Skip to content

Make draft handoffs easier and preserve review state - #24

Closed
sdcarlson wants to merge 3 commits into
mainfrom
codex/round2-draft-handoffs
Closed

sdcarlson wants to merge 3 commits into
mainfrom
codex/round2-draft-handoffs

Conversation

@sdcarlson

@sdcarlson sdcarlson commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Draft handoffs now support copying the selected job packet and pasting a complete draft result directly into Relay. Copy and download share one serializer; pasted results reuse job/version and editor-session checks. Loading preserves exact wording for review without saving or accepting it.

Unchanged accepted drafts disable redundant Save and Accept actions. Acceptance labels follow the current exact accepted text, including after conflicting updates. Job and sidebar navigation asks before discarding draft or blocker edits; reselecting the current job or view preserves the editor. Relay status and source-reported status are labeled separately.

The change is integrated with the merged delivery/security foundation. Its dependency graph, security overrides, canonical CI and test discovery are preserved. The fresh audit passes the high-severity threshold, with 1 moderate and 1 low esbuild advisory remaining.

Validation on the integrated runtime: 64 unit tests, TypeScript, lint, build, isolated API tests and local production-worker tests passed. The separate fictional browser regression passed copy/download equivalence, clipboard failure, paste without writes, invalid/wrong-job/stale/oversized rejection, accepted no-op actions, edit/save/reaccept, conflict reversion, blocker-only edits, dirty navigation and controlled delayed file/save operations. Windows clipboard line endings are normalized in the equivalence assertion.

The tracked Playwright browser suite failed to launch locally because its required Chromium executable was absent from the Windows sandbox cache; it is not counted as passing. Tracked tests are unchanged, and the required remote browser CI and peer approval remain merge gates.

Tests used isolated fictional data. No fresh installed-Bot roundtrip, live Claude access, production deployment, external submission or independent user adoption is claimed. Historical trial evidence remains documented separately.

Further integration with #13 and #15 will preserve their provider validation, public-copy source, and session-expiry protections after those changes merge.

@sdcarlson

Copy link
Copy Markdown
Contributor Author

Deferring this newly opened feature PR so the explicitly requested clean-base cleanup has a bounded scope. This is a second editor/handoff feature slice and depends on #13 and the final #15 correction; it was opened during cleanup and currently conflicts with main. Closing is not a rejection of the work: the branch and all commits are preserved. Reopen after the original #11/#12/#13/#15 queue is settled, reconcile with the final base, and run the complete checks. No part of this feature is claimed merged.

@sdcarlson sdcarlson closed this Sep 6, 2026
@sdcarlson sdcarlson reopened this Sep 6, 2026
@sdcarlson

Copy link
Copy Markdown
Contributor Author

Reopened after the active Review and improve Relay owner confirmed this feature is already in its assigned integration/review pass. That owner retains all #24 source/branch changes; this cleanup session will avoid competing writes and wait for the verified handoff. The temporary deferral did not delete or alter the branch.

@sdcarlson
sdcarlson marked this pull request as ready for review September 6, 2026 00:41
@sdcarlson
sdcarlson requested a review from sykosyber as a code owner September 6, 2026 00:41

@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

Reviewed 570e425ffa11afeafc47b182517a3123a469178b (still PR head). No prior automation threads to reconcile.

No actionable defects. Human approval remains mandatory.

Focused on the 10-file delta vs e0f69c97. No API, auth, migration, or workflow changes.

Traced and found consistent with product contracts

  • Paste (draftFromPastedJson → draftFromResult → applyLoadedDraft) stages editor text only. It does not save, accept, or import. Schema must be relay.draft.v1; relay.packet.v1 copy/download is outbound-only.
  • Job key/URL/version must match the editor snapshot; fileLoadApplies still requires job, session, version, and current draft. Wrong-job and stale-version pastes throw before onDraft.
  • Paste is bounded by character and UTF-8 byte size (1.8 MB) plus the existing 20k draft cap.
  • showsExactAcceptance requires Ready, matching id/version, exact accepted_draft, no conflict, and an unchanged draft+blocker. Conflict + revert to the old base is not labeled accepted (lib/editor.ts showsExactAcceptance / jobQueueHint).
  • Dirty job/filter navigation confirms before discard; reselecting the current job or filter keeps the editor. Reload-on-conflict is unchanged.
  • Packet serializer is shared for copy and download; clipboard failure leaves download available.

Inspected, not executed

  • Adjacent contracts: draftFromResult, applyLoadedDraft, fileLoadApplies, acknowledgeSave, validateEdit, save SQL (accepted_draft only when status is Ready).
  • New unit tests in tests/editor.test.mjs and tests/obsidian.test.mjs (read only).
  • Docs/PR text treated as untrusted description, not evidence.

Not run

  • Unit/API/e2e/lint/build: this review environment has no node_modules; I did not install or execute PR code.
  • No workflow, artifact, or migration review (those paths are unchanged).

A reviewer does not grant merge or deployment authority.

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.

Reviewed 570e425ffa11afeafc47b182517a3123a469178b (still PR head). Prior automation assessment on this same commit had no inline threads.

No actionable defects. Human approval remains mandatory.

Delta is 10 files vs e0f69c97. No API, auth, migration, or workflow changes.

Traced against product contracts

  • Paste (draftFromPastedJson → draftFromResult → applyLoadedDraft) stages editor text only. It does not save, accept, or import. Inbound schema is relay.draft.v1; copy/download emit outbound relay.packet.v1 only.
  • Job key/URL/version must match the editor snapshot; fileLoadApplies still requires job, session, version, and current draft. Wrong-job and stale-version pastes throw before onDraft.
  • Paste is bounded by character and UTF-8 byte size (1.8 MB) plus the existing 20k draft cap.
  • showsExactAcceptance requires Ready, matching id/version, exact accepted_draft, no conflict, and an unchanged draft+blocker. Conflict then revert to the old base is not labeled accepted (lib/editor.ts).
  • Dirty job/filter navigation confirms before discard; reselecting the current job or filter keeps the editor. Conflict reload remains the explicit button.
  • Copy and download share selectedJobPacket; clipboard failure leaves download available.

Inspected, not executed

  • Adjacent contracts: draftFromResult, applyLoadedDraft, fileLoadApplies, acknowledgeSave, validateEdit, save SQL (accepted_draft only when status is Ready).
  • New tests in tests/editor.test.mjs and tests/obsidian.test.mjs (read only).
  • Docs/PR text treated as untrusted description, not evidence.
  • GitHub check rollup for this head: Quality, Integration (api/browser/production), Dependency security, Bundled agent contracts, and CodeQL all reported success. I did not re-run those jobs.

Not run

  • Unit/API/e2e/lint/build in this environment. I did not install or execute PR code.

A reviewer does not grant merge or deployment authority.

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 570e425ffa11afeafc47b182517a3123a469178b.

Paste/copy stages editor text only (draftFromPastedJson → draftFromResult → applyLoadedDraft). Inbound schema is relay.draft.v1; copy/download emit relay.packet.v1. Job key/URL/version/session binding is required before onDraft. Paste is bounded by character count and UTF-8 bytes (1.8 MB) plus the existing 20k draft cap. showsExactAcceptance requires Ready, matching identity/version, exact accepted_draft, no conflict, and an unchanged draft+blocker, so conflict-then-revert to the old base is not labeled accepted. Dirty job/filter navigation confirms before discard. No API, auth, migration, or workflow changes. Required CI is green on this head.

This approval is for this commit only and does not merge or deploy.

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>
@sdcarlson

Copy link
Copy Markdown
Contributor Author

Closing as included in reviewed and merged PR36, main commit 7cfec26. The integration preserves this feature, current session protections, and required checks; final validation included98unit tests, release build, six browser journeys and green hosted API/production/CodeQL gates. Branch commits remain available. No additional squash merge is needed.

@sdcarlson sdcarlson closed this Sep 6, 2026
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.

2 participants