Skip to content

Add reviewed tracker CSV imports to the MVP - #11

Merged
sdcarlson merged 24 commits into
mainfrom
relay-csv-mvp
Sep 6, 2026
Merged

sdcarlson merged 24 commits into
mainfrom
relay-csv-mvp

Conversation

@sdcarlson

@sdcarlson sdcarlson commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Tracker CSV imports let users confirm column mappings, preview exact research records and omitted fields, then explicitly import without resetting existing application status or accepted wording. Malformed, ambiguous, missing-URL and oversized batches are rejected; repeat imports preserve source history.

This branch includes the merged delivery foundation and context documentation from main e0f69c9, plus the session-expiry correction from #15. CSV and workspace 401 responses clear private state before parsing, and late refresh/mutation continuations cannot restore it. The final refresh guard addresses a reproduced child-importer expiry interaction; loading or importing research never accepts a draft or sends an application.

Validation: the previous combined application head passed 73 unit tests, typecheck, lint, build, five Chromium journeys and all hosted checks (compiled-production check needed one unchanged-job rerun; the recurring 503 is tracked in #22). The latest head 5beb10a adds one refresh guard and an actual-callback regression: the new test failed without the guard and passes with it across 20 timing gaps. All 17 scoped session/CSV regressions, typecheck and lint pass. Fresh full CI runs on the latest head; do not treat older results as its completed CI.

Mateo's approval remains required. Protected squash auto-merge is queued. If #15 merges first, reconcile with its squash commit; if this PR lands first, close #15 as included. Real Simplify export compatibility, user adoption and production deployment remain unverified. No new database migration.

Closes #17
Closes #7

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 92a63d9)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects in this delta. Human approval remains mandatory.

CSV mapping is client-side only. Import reuses the existing authenticated /api/workspace path: owner from getChatGPTUser(), origin check, validateRows, importedJobStatus (Ready → Held), and the established upsert that preserves local status, draft, and accepted_draft unless incoming status is Submitted/Live loop. Tracker rows always send Held and put source lifecycle in notes. Observation identity is tracker-csv:<label>:<jobKey> plus name/status/notes, so repeats dedupe and note/status revisions remain separate. Preview does not write; mapping/source/file changes clear the preview. refresh after import goes through reconcileEditor (dirty + version bump → conflict / 409). No new tables, migrations, or workflow permission changes; rollback is a revert of UI/parser/dependency only.

Agent tools still expose preview and draft-stage only, not import. nodeLinker: hoisted restates the existing .npmrc setting for pnpm 11.

Ran

  • Diff 2372771…92a63d9 and re-read current head (92a63d9 still tip of relay-csv-mvp)
  • Changed files plus adjacent contracts: app/api/workspace/route.ts, lib/domain.ts, db/schema.ts, app/chatgpt-auth.ts, lib/editor.ts, workspace refresh/import gate, app/agent-tools.ts
  • Prior review threads: none
  • gh pr checks: grokcell validate passed. This automation was still pending.

Inspected only (not executed)

  • pnpm test / tests/tracker-csv.test.mjs / tests/import.test.mjs (no node_modules here)
  • tests/api.test.mjs (needs a local server)
  • tsc, lint, production build, D1/SQLite migrations, browser flow
  • AGENTS.md and docs/threat-model.md are not in this repo

Documented limit: real Simplify export compatibility is unverified. App unit/API tests are not in required CI (only grokcell template validation runs on the PR).

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

sdcarlson and others added 3 commits September 5, 2026 16:37
Signed-off-by: Seth Carlson <66243744+sdcarlson@users.noreply.github.com>
Overlapping GET responses could apply an older payload after a newer one, and a 401 only flipped signedOut while jobs, sources, events, editor, and import text stayed in memory. Gate refreshes by request generation, drop private workspace state on auth expiry, and keep in-flight editor typing plus save acknowledgement on the current session.

Co-authored-by: Seth Carlson <sdcarlson@users.noreply.github.com>
@sdcarlson
sdcarlson enabled auto-merge (squash) September 5, 2026 23:39

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head cb9cb94)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Subsequent-push delta since the last review (92a63d9): only .github/workflows/ci.yml and codeql.yml. That prior note that app tests were not in required CI is addressed. No prior inline threads to re-verify.

Workflows. ci.yml is contents: read only, applies D1 with --local, binds Vinext to 127.0.0.1:3102, and runs tests/api.test.mjs which refuses non-local hosts. No secrets or uploaded build artifacts. codeql.yml uses pull_request (not pull_request_target); the job grants contents: read, actions: read, and security-events: write for SARIF upload, with build-mode: none. Rollback is a revert: no new tables or migrations.

CSV path (unchanged since 92a63d9, re-checked). Mapping stays client-side. Import reuses authenticated /api/workspace: owner from getChatGPTUser(), origin check, validateRows, importedJobStatus (Ready → Held), and the existing upsert that keeps local status, draft, and accepted_draft unless incoming status is Submitted/Live loop. Tracker rows always send Held and put source lifecycle in notes. Observation identity is tracker-csv:<label>:<jobKey> plus name/status/notes. Preview does not write; mapping/source/file changes clear preview. Post-import refresh goes through reconcileEditor (dirty + version bump → conflict). Agent tools still expose preview and draft-stage only.

Ran

  • Diff 2372771…cb9cb94 and delta 92a63d9…cb9cb94; re-read origin/relay-csv-mvp (cb9cb94 still tip)
  • Changed files plus adjacent contracts: app/api/workspace/route.ts, lib/domain.ts, db/schema.ts, app/chatgpt-auth.ts, lib/editor.ts, workspace refresh/import gate, app/agent-tools.ts
  • Prior review threads: none
  • gh pr checks on this head: CI, CodeQL analyze, grokcell validate passed

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser flow (covered by the passing CI job, not re-run in this environment)
  • AGENTS.md and docs/threat-model.md are not in this repo

Documented limit: real Simplify export compatibility is unverified.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@sdcarlson
sdcarlson marked this pull request as draft September 5, 2026 23:41
auto-merge was automatically disabled September 5, 2026 23:41

Pull request was converted to draft

sdcarlson and others added 3 commits September 5, 2026 16:44
Signed-off-by: Seth Carlson <66243744+sdcarlson@users.noreply.github.com>
POST 401 and GET 401 now use the same generation bump as overlapping refresh tickets. A deferred 200 after expiry is dropped, and a successful mutation does not show a saved notice if the following refresh expired the session.

Co-authored-by: Seth Carlson <sdcarlson@users.noreply.github.com>
Signed-off-by: Seth Carlson <66243744+sdcarlson@users.noreply.github.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 0a56f3f)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior reviews (92a63d9, cb9cb94) reported no defects and left no inline threads. Subsequent-push delta is the delivery/identity foundation (1ac5ae5…0a56f3f) plus Chromium coverage that a mapping/source/file change clears tracker preview before import.

Identity / isolation. Production entry is deploy/worker.mjs → authenticatedRequest: RS256 Access JWT, issuer/audience/exp/iat, human sub+email, then all oai-* and Access client headers are stripped and replaced. Service tokens may hit /readyz but fail workspace identity. releaseConfig disables workers.dev and preview URLs and sets run_worker_first. Staging smoke asserts service credentials get 401 on /api/workspace.

CSV / acceptance / stale writes (unchanged client/API since last review; re-checked). Mapping is client-side. Import uses authenticated /api/workspace (getChatGPTUser(), origin check, validateRows). Tracker rows are always Held with source lifecycle in notes. Upsert keeps local status, draft, and accepted_draft unless incoming status is Submitted/Live loop. Observation identity is tracker-csv:<label>:<jobKey> plus name/status/notes. Preview does not write. Post-import refresh goes through reconcileEditor. Agent tools still expose preview and draft-stage only.

Workflows / provenance / rollback. PR CI is contents: read only and does not reference deploy secrets. Deploy runs only after successful push CI on this repo’s main, re-checks run path/SHA/event/repo, refuses a stale main tip, downloads relay-release-<sha> from that run, and verifies checksums. Rollback requires a prior successful relay-release production record and git diff of drizzle/ vs origin/main. No new tables in this slice.

Ran

  • Diff 2372771…0a56f3f and delta cb9cb94…0a56f3f; re-fetched origin/relay-csv-mvp (0a56f3f still tip)
  • Changed delivery/identity/workflow files plus adjacent contracts: app/api/workspace/route.ts, app/chatgpt-auth.ts, lib/domain.ts, lib/tracker-csv.ts, app/tracker-import.tsx, db/schema.ts, lib/editor.ts (reconcileEditor), app/agent-tools.ts
  • AGENTS.md, docs/threat-model.md
  • Prior threads: none
  • gh pr checks on this head: CI (quality, api/browser/production integration, dependencies, templates), CodeQL, and Dependabot config passed

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys (covered by the passing CI jobs, not re-run in this environment)

Documented limits: real Simplify export compatibility and live deployment are unverified. Merge still depends on #14 landing first and the other maintainer’s approval.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

Check HTTP status before JSON so a plaintext gateway Unauthorized expires the session instead of throwing. Epoch-invalidate in-flight POST and GET continuations so a delayed preview or import cannot restore private report state or start a new refresh. Keep the accepted save on the session so a later snapshot-less refresh still acknowledges it, while unsaved external version bumps remain conflicts. Tests drive processRefresh/processMutation, the same functions Workspace calls.

Co-authored-by: Seth Carlson <sdcarlson@users.noreply.github.com>
@sdcarlson
sdcarlson marked this pull request as ready for review September 6, 2026 00:22
@sdcarlson

Copy link
Copy Markdown
Contributor Author

Cleanup update on 9b561f7: #14 is merged and this branch is reconciled with its squash commit without changing the tested tree. Marked ready for peer review. The branch now includes #15 session protection plus a confirmed CSV-specific fix: plaintext/JSON POST 401 clears all private workspace state before parsing; pending pre-expiry import completion cannot start a refresh that restores signed-out data. Plaintext browser regression failed before the fix; both 401 cases and all three existing journeys pass now. Local validation: 72 unit tests, typecheck, lint, build, fresh-database API and compiled-production gateway integration passed. Incoming #15 node:test registrations were marked void to satisfy the canonical linter without masking test failures. Hosted checks are running; no merge/production claim. Preserve these commits when integrating #13 or #24. Peer approval is still required.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 9b561f7)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior reviews (92a63d9, cb9cb94, 0a56f3f) reported no defects and left no inline threads.

Subsequent-push delta (0a56f3f…9b561f7): session expiry and stale refresh/mutation handling in lib/workspace-refresh.ts, app/workspace.tsx, and app/tracker-import.tsx.

401 / isolation. readWorkspaceResponse treats HTTP 401 as expiry before json(), so a plaintext gateway Unauthorized cannot throw and skip cleanup. expireSession increments epoch and clears lastAck; applyExpired drops jobs, sources, events, editor, import text, preview, report, and import UI. Tracker preview/import checks status === 401 first, then expireSession + applyExpired. A later onImported refresh is admitted only while mutationIsLive matches the render epoch, so a deferred import 200 cannot reload private records after expiry.

Stale writes / exact acceptance. Overlapping GETs keep only the latest refresh ticket. Mutations and refreshes started before expiry are ignored after the epoch bump. lastAck + acknowledgeSave / reconcileEditor still keep in-flight typing and the accepted save, and an external version bump without an own save still conflicts. JSON preview still requires an exact previewedImport match before import.

CSV / API (unchanged since last review; re-checked). Mapping stays client-side. Import reuses authenticated /api/workspace (getChatGPTUser(), origin check, validateRows). Tracker rows are always Held with source lifecycle in notes. Upsert keeps local status, draft, and accepted_draft unless incoming status is Submitted/Live loop. Observation identity is tracker-csv:<label>:<jobKey> plus name/status/notes. Preview does not write. Agent tools still expose preview and draft-stage only. No new tables, migrations, or workflow permission changes in this PR vs merge-base e037ebf.

Ran

  • git fetch + gh api head check: local, origin/relay-csv-mvp, and PR tip still 9b561f743b18219972ee176ac2bbe0e17d9464fa immediately before this comment
  • Diff e037ebf…9b561f7 and delta 0a56f3f…9b561f7
  • Adjacent contracts: app/api/workspace/route.ts, lib/domain.ts, lib/editor.ts, lib/tracker-csv.ts, db/schema.ts, app/agent-tools.ts
  • AGENTS.md, docs/threat-model.md
  • Prior GraphQL review threads: none
  • gh pr checks on this head: Quality, Integration (api/browser/production), Dependency security, Bundled agent contracts, and CodeQL passed

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys (covered by the passing CI jobs; no node_modules in this environment)

Documented limits: real Simplify export compatibility and live deployment are unverified.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 9b561f7)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior reviews (92a63d9, cb9cb94, 0a56f3f) reported no defects and left no open threads. Delta since 0a56f3f: session-gated workspace refresh/mutation, tracker 401 clearing, and tests. #14 is now main (e037ebf); this remaining merge delta is the CSV feature plus that session work.

Traced

  • Mapping stays client-side. Preview/import POST the existing /api/workspace path: owner from getChatGPTUser(), owner=? reads/writes, 2 MB / 200-row bounds, HTTP(S) posting URLs via jobKey.
  • Tracker rows are always Status: 'Held'; source status is notes only. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft; INSERT OR IGNORE observations retain revisions when notes change and drop exact repeats.
  • Mapping/source/file changes clear preview; import sends the previewed row objects. JSON import still requires an exact local preview match.
  • 401 is detected before JSON parse. expireSession bumps epoch so in-flight GET/POST 200s are ignored; private jobs/sources/events/editor/import text/report are cleared. Tracker 401 calls the same expire path and unmounts the CSV panel.
  • No schema, workflow, deploy, or release-script changes versus current main.

Ran: confirmed GitHub head 9b561f743b18219972ee176ac2bbe0e17d9464fa immediately before posting; git diff origin/main...HEAD file list; read AGENTS.md, docs/threat-model.md, and the contracts adjacent to import/refresh (route.ts, domain.ts, editor reconcile). Inspected GitHub CI for this head: unit/quality, api/browser/production integration, CodeQL, and dependency security are green.

Not executed here: local unit/e2e/API runs (no node_modules; runner is Node 22 vs engines.node >= 24). Relied on the green CI jobs above, not on re-running PR code.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@sdcarlson

Copy link
Copy Markdown
Contributor Author

Final verified correction integrated at 1e648e3: includes #15 exact 8faab98 continuation guard, independently cleared by Astra, and current main e0f69c9. Combined checkout passed 73 unit tests (including actual-callback race), typecheck, lint, build and all five Chromium journeys. Earlier same feature tree passed API and compiled-production integration; fresh hosted checks run on this final head. Protected squash auto-merge is queued; Mateo approval and all checks remain mandatory. If #15 merges first, reconcile with that squash before merging #11. No known unresolved review threads.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 1e648e3)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior reviews (92a63d9 … bddaaed) reported no defects and left no inline threads. Subsequent-push delta is 8faab98 (merged via 1e648e3): after processMutation ignore-handling, run rechecks mutationIsLive so a POST 200 that became stale when a concurrent 401 bumped the epoch cannot write preview report state or call refresh() on the new epoch. Regression compiles the real Workspace callbacks.

Re-checked contracts (CSV/API unchanged this push)

  • Mapping stays client-side. Preview/import POST /api/workspace: owner from getChatGPTUser(), owner=? reads/writes, 2 MB / 200-row bounds, HTTP(S) posting URLs via jobKey.
  • Tracker rows are always Status: 'Held'; source lifecycle is notes only. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft; INSERT OR IGNORE observations retain revisions when notes change and drop exact repeats.
  • Mapping/source/file changes clear preview; import sends the previewed row objects. JSON import still requires an exact local preview match.
  • 401 is detected before JSON parse. expireSession bumps epoch so in-flight GET/POST 200s are ignored; private jobs/sources/events/editor/import text/report are cleared. Tracker 401 uses the same expire path and unmounts the CSV panel.
  • No schema, workflow, deploy, or release-script changes versus current main.

Ran

  • Confirmed GitHub head 1e648e3580cba8c29eeda98f3075b65713975dd8 immediately before posting (matches local HEAD and origin/relay-csv-mvp)
  • Diff e0f69c9…1e648e3 (PR vs base) and two-dot delta bddaaed..1e648e3 (guard + test only)
  • Adjacent contracts: app/workspace.tsx run/refresh, lib/workspace-refresh.ts, app/tracker-import.tsx, app/api/workspace/route.ts, lib/domain.ts, lib/tracker-csv.ts, db/schema.ts
  • AGENTS.md, docs/threat-model.md
  • Prior GraphQL review threads: none
  • gh pr checks on this head: Quality, Integration (api/browser/production), Dependency security, Bundled agent contracts, and CodeQL passed

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys (no node_modules; runner is Node 22 vs engines.node >= 24). Relied on the green CI jobs above, not on re-running PR code.

Documented limits: real Simplify export compatibility and live deployment remain unverified.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 5beb10a)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior reviews (92a63d9 … 1e648e3) reported no defects and left no inline threads. Subsequent-push delta (1e648e3…5beb10a) is 8102c81: after processRefresh ignore-handling, refresh rechecks refreshIsLive so a GET 200 that became stale when a child importer 401 bumped the epoch cannot setJobs / restore records. tests/refresh-expiry.test.mjs compiles the real Workspace callbacks across yield gaps.

Traced (new guard + unchanged CSV/API contracts)

  • Importer 401 calls expireSession + applyExpired without processMutation. processRefresh can already have returned records while still live; the post-await refreshIsLive check drops that continuation before writes. JS has no await between that check and setJobs.
  • Mapping stays client-side. Preview/import POST /api/workspace: owner from getChatGPTUser(), owner=? reads/writes, 2 MB / 200-row bounds, HTTP(S) posting URLs via jobKey(r.Job, r.url).
  • Tracker rows are always Status: 'Held'; source lifecycle is notes only. Observation identity is tracker-csv:<label>:<jobKey>. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft; INSERT OR IGNORE observations retain revisions when notes change.
  • Mapping/source/file changes clear preview; import sends the previewed row objects. JSON import still requires an exact local preview match.
  • No schema, workflow, deploy, or release-script changes versus current main.

Ran

  • Confirmed GitHub head 5beb10ade0c1e41b55c9cd887f74c5346f5705e9 immediately before posting (matches local HEAD and origin/relay-csv-mvp)
  • Diff e0f69c9…5beb10a (PR vs base) and two-dot delta 1e648e3..5beb10a (refresh live-check + test)
  • Adjacent contracts: app/workspace.tsx refresh/run, lib/workspace-refresh.ts, app/tracker-import.tsx, app/api/workspace/route.ts import upsert, lib/domain.ts jobKey/validateRows/importedJobStatus, lib/tracker-csv.ts
  • AGENTS.md, docs/threat-model.md
  • Prior GraphQL review threads: none
  • Inspected hosted checks on this head: Quality, Integration (api/production), Dependency security, Bundled agent contracts, and CodeQL passed. Integration (browser) was still pending.

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys. Relied on the green CI jobs above, not on re-running PR code.

Documented limits: real Simplify export compatibility and live deployment remain unverified.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

cursor Bot pushed a commit that referenced this pull request Sep 6, 2026
…landing PR.

Fold the current #15/#11 continuation checks and regressions, keep history loads from applying after expiry, and match the lockfile to shadcn 4.18.0. Remove the deferred profile calibration loop and the production-diagnostics changes that were rejected for #22.

Co-authored-by: sykosyber <sykosyber@users.noreply.github.com>
sykosyber
sykosyber previously approved these changes Sep 6, 2026

@sykosyber sykosyber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partner Extra High review of 5beb10ade0c1e41b55c9cd887f74c5346f5705e9.

CSV mapping stays client-side. Preview/import POST the existing authenticated /api/workspace path (owner=? reads/writes, 2 MB / 200-row bounds, HTTP(S) posting URLs via jobKey). Tracker rows are always Status: 'Held'; source lifecycle is notes only. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft; INSERT OR IGNORE observations retain revisions when notes change. Mapping/source/file changes clear preview; import sends the previewed row objects.

401 is handled before JSON parse in both workspace and TrackerImport. onUnauthorized expires the session and clears private state. refresh rechecks refreshIsLive before restoring records, covering the child-importer expiry gap. Loading/importing research never accepts a draft.

Required CI is green on this head. This approval is for this commit only and does not merge or deploy. If this lands first, close #15 as included.

@sdcarlson
sdcarlson dismissed sykosyber’s stale review September 6, 2026 01:11

The merge-base changed after approval.

@sdcarlson

Copy link
Copy Markdown
Contributor Author

Updated against main 431b207 after PR15 merged. New head 44ae98e preserves the exact reviewed application tree from 5beb10a (no tree diff); conflict resolution retained CSV expireSession/workspaceEpoch wiring. Typecheck and all 74 unit tests passed. Fresh hosted checks requested automatically; please renew latest-head approval after they pass.

@sdcarlson
sdcarlson requested a review from sykosyber September 6, 2026 01:11

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 44ae98e)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior reviews (92a63d9 … 5beb10a) reported no defects and left no inline threads. Subsequent-push delta is merge 44ae98e of main (431b207, #15 squash). First parent is 5beb10a; the merge tree is identical to that last-reviewed tip. Conflict note on app/workspace.tsx kept the CSV expireSession / workspaceEpoch wiring; vs current main the file still differs only by the TrackerImport mount.

Traced (unchanged application tree; re-checked unique CSV slice vs main)

  • Mapping stays client-side (csv-parse 7.0.2). Preview/import POST /api/workspace: owner from getChatGPTUser(), owner=? reads/writes, 2 MB / 200-row bounds, HTTP(S) posting URLs via jobKey(r.Job, r.url).
  • Tracker rows are always Status: 'Held'; source lifecycle is notes only. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft; INSERT OR IGNORE observations retain revisions when notes change.
  • Mapping/source/file changes clear preview; import sends the previewed row objects. JSON import still requires an exact local preview match. Agent tools still expose preview and draft-stage only.
  • Importer 401 calls expireSession + applyExpired. onImported admits refresh() only while mutationIsLive matches the render epoch; refresh also rechecks refreshIsLive before setJobs.
  • No schema, workflow, deploy, or release-script changes versus current main.

Ran

  • Confirmed GitHub head 44ae98e10ec18f70e4196d674b4bc17f6b61905e immediately before posting (matches local HEAD and origin/relay-csv-mvp)
  • Diff 431b207…44ae98e (PR vs base) and two-dot/tree compare 5beb10a / 44ae98e (identical trees)
  • Adjacent contracts: app/workspace.tsx mount, app/tracker-import.tsx, lib/tracker-csv.ts, app/api/workspace/route.ts import upsert, lib/domain.ts jobKey/validateRows/importedJobStatus, lib/workspace-refresh.ts, db/schema.ts observation unique index, app/agent-tools.ts
  • AGENTS.md, docs/threat-model.md
  • Prior GraphQL review threads: none
  • Inspected hosted checks on this head: Quality, Integration (api/browser/production), Dependency security, Bundled agent contracts, and CodeQL passed

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys. Relied on the green CI jobs above, not on re-running PR code.

Documented limits: real Simplify export compatibility and live deployment remain unverified. Peer approval of this head is required; the prior approval of 5beb10a was dismissed by this reconcile.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

sykosyber
sykosyber previously approved these changes Sep 6, 2026

@sykosyber sykosyber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partner Extra High review of 44ae98e10ec18f70e4196d674b4bc17f6b61905e.

This head is the merge of current main (431b207, #15 squash) into relay-csv-mvp. First parent is 5beb10a. The two trees are identical (a38e858). Conflict resolution on app/workspace.tsx kept the TrackerImport mount plus expireSession / workspaceEpoch wiring; versus current main that file still differs only by that mount.

CSV mapping stays client-side (lib/tracker-csv.ts). Preview/import POST the existing authenticated /api/workspace path (getChatGPTUser(), owner=? reads/writes, 2 MB / 200-row bounds). Tracker rows are always Status: 'Held'; source lifecycle is notes only. jobKey uses the HTTP(S) posting URL; observation identity is tracker-csv:<label>:<jobKey>. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft. Mapping/source/file changes clear preview; import sends the previewed row objects. Agent tools, schema, and domain upsert are unchanged versus main. Loading/importing research never accepts a draft.

Importer 401 is handled before JSON parse. onUnauthorized expires the session and clears private state. onImported calls refresh() only while mutationIsLive matches the render epoch.

Required CI is green on this head, including Integration (production): run 34003231418. This approval is for this commit only and does not merge or deploy. Real Simplify export compatibility remains unverified. Close #15 is already done; this PR still closes #17 and #7.

# Conflicts:
#	README.md
#	integrations/README.md
@sdcarlson

Copy link
Copy Markdown
Contributor Author

Updated after #13 merged as a25aafe. Head5be6058 retains CSV behavior and both session caller guards, integrates canonical public copy and keeps CSV setup documentation. Typecheck,84 unit tests and public-copy check pass. Fresh checks and latest-head review requested. Coordinating #39 first to minimize base churn.

@sdcarlson
sdcarlson requested a review from sykosyber September 6, 2026 01:19

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Review (head 5be6058)

Medium — required Quality is red after the #13 merge. Human approval remains mandatory. Prior reviews (92a63d9 … 44ae98e) reported no product-contract defects and left no inline threads. Partner approvals of 5beb10a and 44ae98e were dismissed by later pushes.

Finding

Severity: Medium (merge-blocking required check; no user-data or acceptance impact)
Where: tests/assistant.test.mjs:32 and tests/public-copy.test.mjs:14 (test( registrations; 10 oxlint hits)
Trigger: Merge 5be6058 brought #13 (a25aafe) onto this branch. Those files call test(...), which returns a Promise. This branch already prefixes node:test registrations with void (e.g. tests/domain.test.mjs) so oxlint typescript(no-floating-promises) passes. The merge did not apply that to the incoming files.
Impact: Quality and release build failed on this head (run 34003559335): pnpm lint — 10 errors, then the workflow stopped. Integration (api/browser/production), CodeQL, dependency security, and bundled agent contracts passed. Same lint pattern also failed on main’s #13 commit; this PR still cannot merge green until it is fixed here.
Smallest fix: Prefix the incoming test( calls with void, matching the #15 reconciliation. Do not skip or rewrite the tests.

CSV / session contracts (re-checked; no new defect)

Unique application slice vs main is unchanged: TrackerImport mount, lib/tracker-csv.ts, docs/CSS/csv-parse. Mapping stays client-side. Preview/import POST /api/workspace (getChatGPTUser(), owner=?, 2 MB / 200-row bounds). Tracker rows are always Held; source lifecycle is notes only. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft. Mapping/source/file changes clear preview; import sends the previewed rows. Importer 401 expires the session and clears private state; onImported / refresh recheck live epoch before restore. No schema, workflow, deploy, or release-script changes vs main.

Conflict resolution kept main’s public-copy README block and placed CSV docs after <!-- relay:public:end -->; integrations README kept the Tracker CSV section plus the incoming ChatGPT/Codex section.

Ran

  • Confirmed GitHub / origin/relay-csv-mvp / local HEAD still 5be6058c8186f791ef78659efd4c06a206e740a4 immediately before this comment
  • Diff a25aafe...5be6058 and two-dot 44ae98e..5be6058
  • Adjacent contracts: app/workspace.tsx mount, app/tracker-import.tsx, lib/tracker-csv.ts, app/api/workspace/route.ts upsert, lib/domain.ts, lib/workspace-refresh.ts, db/schema.ts, app/agent-tools.ts
  • AGENTS.md, docs/threat-model.md
  • Prior GraphQL inline threads: none
  • Inspected hosted checks on this head, including Quality failure annotations

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys. Relied on hosted jobs, not on re-running PR code.

Documented limits: real Simplify export compatibility and live deployment remain unverified.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@sykosyber sykosyber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partner Extra High review of 5be6058c8186f791ef78659efd4c06a206e740a4. Not approving this head.

Required Quality failed on hosted run 34003559335 job 101406598113: oxlint typescript(no-floating-promises) on ten test(...) registrations that return a Promise:

  • tests/assistant.test.mjs 32, 59, 77, 108, 128
  • tests/public-copy.test.mjs 14, 20, 35, 40, 49

Those files are byte-identical to current main, where the same rule does not fail Quality. The unique installer delta on this PR is nodeLinker: hoisted in pnpm-workspace.yaml (.npmrc already has node-linker=hoisted). Combined CI is red until Quality is green.

CSV contracts on this merge otherwise match the previously reviewed slice: mapping is client-side; preview/import POST authenticated /api/workspace; tracker rows are always Held; observation identity is tracker-csv:<label>:<jobKey>; accepted_draft is preserved; 401 clears private state; onImported is gated by mutationIsLive. Public-copy markers stayed intact; CSV copy is outside the managed block.

Do not merge until Quality is green on the latest head. This branch is also behind the #39 license squash; rebase after the lint fix. Extra High will re-review that SHA. This does not merge or deploy.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (head e21d3e2)

No evidence-backed correctness, isolation, acceptance, stale-write, migration, workflow-permission, provenance, or rollback defects at this head. Human approval remains mandatory.

Prior Medium finding on 5be6058 (floating test( registrations after the #13 merge; Quality red) is fully addressed. tests/assistant.test.mjs and tests/public-copy.test.mjs now await all 10 node:test registrations (the same no-floating-promises contract other files satisfy with void). Quality and release build is green on this head.

Subsequent-push delta (5be6058…e21d3e2): merge of main a42b8e7 (#39 Apache-2.0 license) plus the test-await commit. Application, CSV, session, schema, and workflow files are unchanged from the last reviewed tip.

CSV / session contracts (re-checked; no new defect). Unique slice vs a42b8e7 is still TrackerImport, lib/tracker-csv.ts, docs/CSS/csv-parse, and tests. Mapping stays client-side. Preview/import POST /api/workspace (getChatGPTUser(), owner=?, 2 MB / 200-row bounds). Tracker rows are always Held; source lifecycle is notes only. Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft. Mapping/source/file changes clear preview; import sends the previewed rows. Importer 401 expires the session and clears private state; onImported / refresh recheck live epoch before restore. No schema, workflow, deploy, or release-script changes vs main.

Partner approvals of 5beb10a and 44ae98e remain dismissed by later pushes. This review does not approve, merge, or deploy.

Ran

  • Confirmed GitHub / origin/relay-csv-mvp / local HEAD still e21d3e27bcab5688d884925e87494ed95e0ba8b4 immediately before this comment
  • Diff a42b8e7...e21d3e2 and two-dot 5be6058..e21d3e2
  • Adjacent contracts: app/workspace.tsx mount, app/tracker-import.tsx, lib/tracker-csv.ts, app/api/workspace/route.ts upsert, lib/domain.ts via jobKey/validateRows
  • AGENTS.md, docs/threat-model.md
  • Prior GraphQL inline threads: none
  • Inspected hosted checks on this head: Quality, Integration (api/browser/production), Dependency security, Bundled agent contracts, and CodeQL passed

Inspected only (not executed here)

  • pnpm test / tsc / lint / production build / browser / production-gateway journeys. Relied on the green hosted jobs above, not on re-running PR code.

Documented limits: real Simplify export compatibility and live deployment remain unverified.

Open in Web View Automation 

Sent by Cursor Automation: RELAY pull request review

@sykosyber sykosyber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partner Extra High review of e21d3e27bcab5688d884925e87494ed95e0ba8b4.

This head merges current main (a42b8e7, #39 Apache 2.0) and prefixes the inherited tests/assistant.test.mjs / tests/public-copy.test.mjs registrations with await so oxlint typescript(no-floating-promises) is satisfied. The tests still run. LICENSE matches main. CSV application contracts are unchanged from the last reviewed slice:

  • Mapping is client-side (lib/tracker-csv.ts). Preview/import POST authenticated /api/workspace (owner=?, 2 MB / 200-row bounds).
  • Tracker rows are always Status: 'Held'; source lifecycle is notes only. Observation identity is tracker-csv:<label>:<jobKey>.
  • Upsert keeps Ready/Submitted/Live loop/Skip, accepted_draft, and draft. Mapping/source/file changes clear preview; import sends the previewed row objects.
  • Importer 401 is handled before JSON parse. onUnauthorized expires the session. onImported calls refresh() only while mutationIsLive matches the render epoch.
  • Public-copy markers are intact; CSV copy is outside the managed block.

Required CI is green on this head, including Quality and Integration (production): run 34003685900. This approval is for this commit only and does not merge or deploy. Real Simplify export compatibility remains unverified. Closes #17 and #7 when it lands.

@sdcarlson
sdcarlson merged commit 256854b into main Sep 6, 2026
10 checks passed
@sdcarlson
sdcarlson deleted the relay-csv-mvp branch September 6, 2026 01:23
cursor Bot pushed a commit that referenced this pull request Sep 6, 2026
Keep remaining unique trees (local-dev Node guard, copy/paste handoffs,
selected-job history, and null-URL packets). Deduplicate the Tracker CSV
setup section introduced by the #11 squash.

Co-authored-by: sykosyber <sykosyber@users.noreply.github.com>
sdcarlson pushed a commit that referenced this pull request Sep 6, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Problem and result

Closes #8
Closes #9
Closes #19

`main` already includes protected CI/CD (#14), context playbooks (#18),
session-expiry (#15 / #7), ChatGPT/Codex public-copy (#13), Apache 2.0
(#39 / #38), and tracker CSV (#11 / #17). This branch merges that tip
and keeps the remaining unique trees:

- Local-dev Node/port/sign-in, with a Windows-safe Node guard instead of
Bash (#12 / #19)
- Copy/paste draft handoffs, exact-acceptance actions, and
dirty-navigation guards (#24)
- Selected-job review history beyond the GET 200-event window (#8)
- Assistant packets for valid jobs with `url: null` (#9)
- Canonical public-copy listing for Tracker CSV (the #11 squash kept
that note outside the maintained block)

Head `4d8f007` merges `origin/main` (`256854b`, #11) into the previous
landing. Conflict resolution kept `void test` wrappers, history/null-URL
API coverage, and one Tracker CSV setup section.

The changes-requested review is on superseded `9e307b9`. Independent
preservation review of `8d6ba1a` retired the five original code
findings. These merges do not restore them.

Deferred, matching maintainer comments, and **not** in this PR:

- Profile calibration loop (#26)
- `shadcn` 4.20.1 (#32)
- Production 503 diagnostics (#22 / draft #40)
- Assistant research/next-task handoff (#37 / #41) — stacked on landed
#13, not this consolidation
- Unused UI-kit cut / competing review-loop draft (#42)

Keep #16 open: remaining development-tool advisories. Keep #21 open
until post-merge Pages verification. Keep #22 open. Cloudflare hosting
(#3), two-account isolation (#4), recruiting (#5), backup rehearsal
(#6), and Grok Bot VM command review (#20) still need human/environment
work.

## Evidence

- Local on `4d8f007`: `pnpm lint`, `pnpm typecheck`, `pnpm test` (98
passed), `pnpm public-copy:check`, `pnpm build`, `pnpm test:api`, `pnpm
test:e2e` (6 passed), `pnpm test:production` passed.
- GitHub CI on `4d8f007` ([run
34003847782](https://github.com/SyberLabs/relay/actions/runs/34003847782)):
quality, API, browser, production, CodeQL, dependency-security, and
bundled agent contracts were running or already green after this merge;
required `CI` still needs the remaining jobs.
- User-visible proof: copy/paste packet, Windows-safe
`scripts/ensure-node.mjs`, Load earlier review history, null-URL
packets. CSV import and ChatGPT/Codex prepare now come from `main`.
- Security, data migration, and rollback impact: no new D1 migration.
React trio stays at 19.2.8. CI Vinext still uses ephemeral ports when
`RELAY_CI_STATE` is set. Production integration keeps the original
request sequence.

## Review

- [ ] One issue owns this scope; unrelated changes are separate. This is
an explicit integration PR covering the remaining open merge train.
- [x] Tests exercise the changed behavior, including failure paths
(including compiled Workspace continuation and history-after-expiry
regressions).
- [x] No credentials, personal applications, or private research are
included.
- [x] Agent findings from the `9e307b9` review remain addressed.
- [ ] A maintainer other than the author will approve. **@sdcarlson must
approve the latest push** (`4d8f007`); prior reviews do not cover this
merge commit.
- [x] Public capabilities, integration limits and lead-engineer credit
match `docs/public-copy.json`; run `pnpm public-copy:check` and follow
`docs/PUBLIC-COPY.md` when these change.

After merge, close the superseded feature PRs (#12, #24) as landed here
rather than squash-merging them separately. #11, #13, #15, and #39 are
already merged. #26 and #32 stay closed as deferred. #40, #41, and #42
stay on their own tracks.

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-3877d527-b5e4-46d7-8c5f-573418309ece?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-3877d527-b5e4-46d7-8c5f-573418309ece&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: sykosyber <sykosyber@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import tracker CSV research through an explicit review Ignore stale workspace responses and clear private state on sign-out

4 participants