Skip to content

Integrate and repair CR-7 review writes and guarded actions - #416

Merged
BunsDev merged 9 commits into
mainfrom
cr7-write-repair
Oct 27, 2026
Merged

BunsDev merged 9 commits into
mainfrom
cr7-write-repair

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Integrate the CR-7 comment/review, head-guarded merge, state/edit and reviewer-request stack from #412, #413, #414 and #415. Main refuses stale-document submits, validates inline paths and ranges against complete fresh patch evidence, and resolves renamed base-side comments to the current filename. Pending composer edits survive navigation; confirmation shows frozen inline bodies and destinations.

The follow-up at signed head fffd07ec7006347142453217e6bdf899373ff31d keeps GraphQL execution/internal/malformed errors uncertain until readback, blocking another write instead of treating a possibly applied mutation as rejected. A failing regression applied the remote change before returning an execution error; the repair confirms it by readback without resending. The edit confirmation also describes the remaining check/write race accurately. Independent review found no remaining important source finding in this repair.

Current validation: full build and renderer typecheck passed; full unit command passed 2,165 tests with 22 skips and zero failures. The first full E2E command failed: 464 desktop passes, seven skips, one panel-resize failure; the site stage was not reached. Its passive trace shows off-script zero-button pointer moves interleaved with scripted drags and capture loss. Independent review supports conflicting input delivery without identifying its source or establishing a resize-code defect. The unchanged focused resize diagnostic passed 1/1 with retries disabled, and the separately executed site stage passed 7/7. These narrower passes do not make the failed aggregate command green. All 14 CR-7 action cases passed. The first cold transcript measurement passed at 174.5 ms against the unchanged 500 ms limit on an Apple M5 Max. First-failure traces and the diagnostic remain preserved.

Earlier published head 1a332391c21fdf99326517b3ddb38fc0e3b0c60c passed hosted run 40409103774: 468 desktop passes, four skips, 7/7 site passes, and a 219.9 ms cold transcript median. Those results do not validate this new head. Fresh hosted and protected merge-queue checks are pending. The dated repair receipt preserves exact heads, initial regression failures, fixture correction and validation limits; the historical LM-2 hosted performance failure remains separate.

Refs #326; authenticated live writes still require a disposable repository named by Val, and human/reference acceptance remains open. CF-8's missing-artifact row records existing #328 unit evidence, not human acceptance. After this PR is merged and verified, #412, #413, #414 and #415 can be closed as superseded. Their owner worktrees remain protected until release and guarded merge/recovery validation.

BunsDev and others added 8 commits October 24, 2026 18:10
CR-5's anchorFor returns a seven-field LineAnchor with commitSha, the commit
its line numbers count in. The unwired intent model checked for an exact
six-field shape, so it refused every real anchor, and its digest never bound
the diff base.

LineAnchor moves into the shared contract. patch.ts re-exports it and the
model uses it. commitSha must be 40-hex, must be the head on the head side,
and is part of the digest. The future write adapter still checks a base-side
commitSha against the fresh read's diffBaseSha.

This also records the check of CR-4's action slots. Adds no GitHub mutation,
IPC channel or UI. Refs #326.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Val decided on 2026-10-25: Code Review writes go through the person's own
gh login, and decisions 2-4 are in scope. This is the first increment.

- code-review:write: a separate localOnly channel. Main names the session
  from the sender and document epoch, re-reads the account, repository
  permission and PR before preview and before send, and checks gh's login
  state before dispatch. Fixed endpoints only: two POSTs, bodies on stdin.
- Sends are durable, at most once per intent; an unclear outcome stays
  unknown until a read-back matches the intent marker or the person stops
  tracking it.
- Comment and review composers, line comments from Changes, and a doubt card.
- Unit, IPC and Electron coverage of success, rejection, timeout, crash and
  reconciliation, all against a synthetic gh. No live write was run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mergePreflight decides, from the reviewed revision and one set of fresh
GitHub facts, whether Merge may be offered and with which methods.

A changed account, repository, PR, head or target asks for renewed
confirmation. Closed, draft, conflicting, blocked, behind, unknown,
queue-required and unreadable states stay unavailable, with Open in GitHub
as the fallback. An offer lists only explicitly allowed methods and carries
the reviewed head as expectedHeadSha. Check counts and model findings are
refused as inputs. mergeOperation builds a merge operation only from an
offered method.

Pure and unwired: no GitHub request, read, IPC channel or UI. Refs #326.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The second write increment. The header's Merge opens a panel; main reads
push permission, the repository's allowed methods, GitHub's merge state and
the target branch's rules fresh for every check, preview and submit, and
#412's mergePreflight decides what may be offered.

- One PUT, repos/{o}/{r}/pulls/{n}/merge, with sha = the reviewed head from
  the durable intent and an offered merge_method. A moved head, a moved
  target or a withdrawn method between preview and merge sends nothing.
- Unknown, blocked or queue-required state and unreadable settings or rules
  stay unavailable with Open on GitHub; check counts and model findings are
  not inputs.
- An unclear merge is unknown, blocks the PR, and is confirmed only if the
  PR merged by this account at that head.
- Unit, IPC and Electron coverage against a synthetic gh. No live merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
)

Decisions 2-4, put in scope by Val on 2026-10-25, as the third write
increment on code-review:write.

- The state pill is a menu: close, reopen, convert to draft, ready for
  review, only from the states GitHub allows. Close and reopen PATCH the PR;
  draft and ready are GitHub's two fixed GraphQL mutations, the only GraphQL
  sent, matched text for text with the node id as the one variable.
- Edit pull request: the title and description in one form. Only changed
  fields are sent, and main refuses the edit if GitHub's text changed since
  it was read; the PR is then read again.
- Request reviewers by login; never the author or oneself.
- Permission (push, triage or authorship as GitHub grants it), head, target
  and login are read again at preview and at submit. An unclear change
  stays unknown until the PR shows it.
- Unit, IPC guard and Electron coverage against a synthetic gh. No live run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 26, 2026 10:52pm UTC

Request Review

@github-code-quality

github-code-quality Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main d717bb0 cr7-write-repair fffd07e +/-
65% 65% 0%
View coverage of the 10 most impacted files.
File main d717bb0 cr7-write-repair fffd07e +/-
apps/desktop/sr...ions/intents.ts 100% 99% -1%
apps/desktop/sr...ain/commands.ts 87% 87% 0%
apps/store-desk...rc/main/demo.ts 95% 95% 0%
apps/desktop/sr...review/patch.ts 98% 100% +2%
apps/desktop/sr...eview/writes.ts 0% 86% +86%
apps/desktop/sr...rite-service.ts 0% 97% +97%
apps/desktop/sr...review-patch.ts 0% 97% +97%
apps/desktop/sr...review-write.ts 0% 100% +100%
apps/desktop/sr...ons/write-gh.ts 0% 100% +100%
apps/desktop/sr...ge-preflight.ts 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 26, 2026 23:28 UTC

This branch was successfully deployed

1 active deployment
Preview — fffd07ec Deployed Oct 26, 2026 by vercel[bot]
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.

1 participant