Skip to content

An edit valid only whole lands as one batch: code/edit takes several edits, checked once on the result - #5945

Merged
joelteply merged 9 commits into
canaryfrom
fable/edits-land-together
Nov 14, 2026
Merged

joelteply merged 9 commits into
canaryfrom
fable/edits-land-together

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

For: any resident editing any file the guard parses, when a fix is only valid whole: a moved brace, or a rename at two sites. Card 45c6cda4.

Found (Benchy on the M5, 2026-11-11): her test was appended after mod tests's closing brace. Moving the brace takes two changes, and each is unparseable on its own. The parse guard rightly refused each half, and she retried for about 25 minutes.

Change:

  • New EditMode::Batch { edits }: the edits apply in order, each to the result of the one before.
  • The guard checks the final result once: all edits land or none does.
  • A batch reports where its first edit landed.
  • The TypeScript binding gains the variant.

Test: a_fix_valid_only_whole_lands_as_one_batch. Each half alone is refused and leaves the file unchanged; the batch lands and the result parses.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…edits, checked once on the result

Benchy on the M5, 2026-11-11 15:10-15:37Z: a test appended after mod tests' closing brace; moving
the brace needs two changes, each unparseable alone, so the parse guard (rightly) refused each half
and she retried for ~25 minutes. EditMode::Batch { edits } applies its edits in order, each to the
result of the one before, and the guard checks the final result once: all land or none does. A
batch reports the landing site of its first edit. The TypeScript binding gains the variant.

For: any resident editing any file the guard parses (a fix valid only whole: a moved brace, a
rename at two sites). Test: a_fix_valid_only_whole_lands_as_one_batch (each half refused and
unchanged; the batch lands and parses). Card 45c6cda4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits November 11, 2026 09:49
- The edit receipt shows the construct the edit landed in, and the repair search ends where
  that construct closes: one measured span (construct_span, from indent) replaces two guessed
  line counts (APPLIED_CONTEXT_RADIUS, REPAIR_SEARCH_LINES).
- Feedback to her is no longer cut: every duplicate site, the whole search text, the whole
  checker message. The 60-byte search slice could panic on a multibyte character.
- A write over an existing file that cannot be read now fails instead of recording its old
  content as empty, which made an undo erase the file.
- apply_reverse_simple returns the file as it stands when the change had no hunks (that IS
  its undo), so undo no longer swallows a None; a dead restored-content computation is gone.
- Optional notices append with String::extend; the rest of the defaults state their reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…inks (writes_outside_a_class)

The file engine wrote her files with fs::write: a crash mid-write left a torn file, and the
writes ratchet counts it as a writer choosing its own placement. continuum_host::durable gains
write_replace_keeping, for a file whose shape belongs to someone else: staged, synced, renamed,
landing on a symlink's target and keeping the old permissions, so an executable script stays
executable and a link stays a link (a plain write_replace would have stripped both). The four
writes in ops.rs (write, edit, undo of delete, undo of edit) go through it. Pinned by a unix
test in durable's tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@github-actions github-actions Bot added size: L and removed size: M labels Nov 11, 2026
joelteply and others added 2 commits November 11, 2026 11:00
Every edit mode reaches one comparison after apply_edit; a result equal to the file as it stands
is refused before any write, with a typed probe and 'NO CHANGE: ...' (FEEDBACK-PARITY problem 4,
invariant 2). Twice on the M5, 2026-11-11, an identical search/replace answered ok and was taken
as a fix (Benchy 16:01Z, Aiko 16:52Z). Pinned by a test that the file is not rewritten.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Nov 11, 2026
…and any whole-tree sample follow, labelled as such (#5946)

The touched-file failure printed the advice (which can carry a whole-tree sample) before the
offenders, so the sample read as the change's own sites: on 2026-11-11 an agent spent an hour
on #5945/#5939/#5936 chasing continuum-academy files those PRs never touched, and asked CI's
owner about a CI bug that did not exist. Selection, counts and the gate are unchanged; only
the order and the headings of the message move. zero() reads the same way.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply and others added 2 commits November 11, 2026 11:32
…s every line the wider range also removes

The span from her start line missed sympy-22005's string tail (a string's lines need not follow
indent); the construct her end line sits in holds it. A parse cannot tell a dropped tail from
destroyed code (Aiko, 2026-11-11: an end_line hint that parsed would have deleted a for loop's
header), so the hint lists the removed lines verbatim and she decides. Also: the edit-schema
round-trip test builds an array field (Batch's edits), and the agentic surface ceiling is re-pinned
17986 -> 18162 for the batch variant, with its reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

SOURCE PASS on Codex's delta 3a3741f..4ede7f1 (head 4ede7f1). Cormac, 2026-11-11. Verified by reading the code; I did not run the tests. CI at this head is green, with 0 failing.

Claim verified: the delta changes no behaviour except removing the empty range, and every caller handles the new None.

  • construct_span returns None only when total == 0, which is where it used to return 1..=0. Every other return is wrapped in Some with the same range.
  • The only callers are edit_checks.rs:320 and :737 (git grep "construct_span(" pr5945).
  • repair_hint (:320): the old 1..=0 made the candidate loop empty, so control fell through to GENERAL.to_string() at the end of the function. The new else { return GENERAL } gives the same result.
  • numbered_neighborhood (:737) already returns "(file is now empty)" at :732 when total == 0, so the .into_iter().flatten() None case cannot happen. It is still the correct shape.
  • The file has one #[cfg(test)] mod (:744), which this delta added.

Notes (not blocking):

  • assert_eq!(construct_span("", 1), None) is the assertion that guards the change.
  • The numbered_neighborhood("") assertion exercises the existing early return, not this delta.
  • Both tests lack the // what this catches: line.

@joelteply
joelteply merged commit d94cdaf into canary Nov 14, 2026
45 checks passed
@joelteply
joelteply deleted the fable/edits-land-together branch November 14, 2026 06:27
joelteply added a commit that referenced this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant