Repository navigation
Read the chained settlement on the fact the page states - #14
Merged
Merged
Conversation
`round_trip` watches the browser's trip, and the send settles its generation in the continuation that reads the response — so the log holds the second comment a step before the store holds its tombstone, and a plain read taken right after the trip is the same assertion made early. A runner loaded enough to fit that read into the step got an unsettled chain back and failed on it, twice on main. The store is read on the fact the page states instead, the way the tabs below this test already read it. Reproduced by holding the page's own reading of the response back a fixed lateness: 100ms fails the old read exactly as CI did, and the wait passes at 100ms, 400ms and 2s. Bug-back with the base rule dropped from `saveDraft` still fails the test, at the send that never goes out.
max-sixty
added a commit
that referenced
this pull request
Sep 12, 2026
Visual-review evidence can overflow inside its own stage, but the shared reading keys previously selected the outer pane, and changing cases or refreshing the source could leave keyboard focus on the document body. This makes every visual case a nested reading region and preserves the active inspection or disposition destination through case selection and source updates. Nested regions distinguish the semantic host used by reading commands from the body that actually contains a control. Response placement, thread-preview placement, and reading-position continuity now share the same outward containment walk as scroller selection, so case conversation stays visible through bounded/flow changes without treating the capture stage as its boundary. Reading keys still use the semantic host, preserving pane ownership from frame controls. Moving an outdated draft from an inline case outlet back to the floating response surface also preserves its exact focused control and text selection without reclaiming focus if the reader moved elsewhere. The end-to-end journey now uses rendered Go-to and target-chooser hints to inspect evidence, page through an overflowing capture, review cases, preserve an exact case comment and draft across a 390px covering Threads view and desktop nonmodal Threads, update source data while that draft is open, apply corrected evidence, and record the final disposition. It uses Leaf's canonical focus-ring reading and asserts exact source provenance and that local inspection creates no durable actions. The broader two-pane landmark and focus-paint audit remains tracked in the workspace follow-up for TODO #14. Tests: `uv run pytest tests/test_render_visual_review_journey.py -q -n0 -x`; `uv run pytest tests/test_render_navigation.py -q -n0 -x`; `uv run pytest tests/test_render_conversations.py -q -n0 -x`; `uv run pytest tests/test_render_projection.py::test_a_source_replacement_preserves_the_focused_draft_and_its_original_anchor -q -n0 -x`; `bin/leaf package check skills/leaf/packages/visual-review`; `uv run pre-commit run --all-files`. The full two-worker suite previously reached 1,037/1,038; its sole runtime-banner startup timeout reproduced on the frozen merge base under the same platform, selection, and parallelism. > _This was written by Codex on behalf of max-sixty_
leaf-agent
added a commit
that referenced
this pull request
Sep 18, 2026
#14's dependency line named PR #520 as the settlement, but #520 kept the adaptive placement and deferred the modal-focus work to #24, which landed in PR #536 as inertness, dialog semantics and focus containment for a covering workspace. That is the surface #14 verifies, so its "Done when" still read "Avoid imposing a modal focus trap on a nonmodal panel" — the containment #536 shipped, described as the defect to avoid. State the containment the shipped modality requires and name both settlements. The dated evidence sentence is left as the 8 September record.
max-sixty
pushed a commit
that referenced
this pull request
Sep 18, 2026
`notes/workspace-followups.md` has been presenting finished work as the plan since 9 September. It opens with "Start #2, #3 and #4 as one coordinated contract batch; run the review-queue simplification #8 alongside it" — all four of those shipped that week — and carries thirteen briefs, each with a live "Next task" and "Done when", for work `TODO.md` dropped as complete. This removes them and leaves the six `TODO.md` still links: #11, #14, #19, #20, #22 and #23. The trim follows the convention #666 set and the reason `CLAUDE.md` gives for it: a note is never a second specification for shipped behavior. #666 removed #6, #7, #16 and #17 the same way, rewriting the two `Owner / dependencies` lines in surviving briefs that named them; it simply did not reach the rest. Each removal is evidenced by the commit that took the item out of `TODO.md`, not by a reading of the current code: | Brief | Removed from `TODO.md` by | | --- | --- | | #1, #3, #5 | [`0f7f06a6`](0f7f06a) — "Completed workspace items #1, #3, and #5 are removed from `TODO.md`" | | #2, #4, #8, #9 | [`28b5da99`](28b5da9) — "the completed #2, #4, #6, #8, #9, and #17 backlog entries are removed while preserving the deferred evaluation work" | | #13, #15 | [`6df40353`](6df4035) — "closes three bounded workspace follow-ups" | | #10, #12 | [`c9eaa2c6`](c9eaa2c) — the continuation cue and the adaptive Threads placement | | #18, #21 | [`e46c8b93`](e46c8b9) — the monitoring workspace and its package-owned root | Alongside the briefs, three group headings are now empty and go; the `Suggested work packages` table loses the rows whose whole scope landed; and four cross-references that named a removed ID are rewritten — #14's dependency on the Threads-placement experiment, #20's ordering behind #8, and the two sentences in `Reproduction record` and `Browser evidence` that pointed at briefs no longer here. #14 needed more than a rewritten pointer. The experiment it waited on was settled in two steps, and only the first removed an ID: [PR #520](#520) kept the adaptive placement and deferred the modal-focus work to #24, which landed in [PR #536](#536) as inertness, dialog semantics and focus containment for a covering workspace. That is the surface #14 exists to verify, so its `Done when` — "Avoid imposing a modal focus trap on a nonmodal panel" — described the containment #536 shipped as the defect to avoid. It now states the containment the shipped modality requires, and the dependency line names both settlements. The dated evidence sections themselves stay. They are the record of what was read in a browser on 8 September, not a plan, and the note's own header scopes them to that date. No test covers `notes/`, and this changes no behavior, so there is nothing to regress. `pre-commit` passes on the file; the `TODO.md` → note anchors all still resolve, and no surviving text references a removed ID. --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Sep 27, 2026
…stop an idle corpus repainting (#1279) The corpus page missed the in-tab responsiveness objectives in `notes/user-feedback-responsiveness.md`: a new revision took ~2.8 s to swap in (1 s objective), and a comment ~220 ms and a board move 111–155 ms to paint (100 ms). Profiling each transition found three causes, none specific to the corpus. **A revision rebuilt the whole page.** The in-place patch treats every upgraded widget as atomic, and the corpus (like any page written as tabs) sits inside one `lf-tabs`. So a one-sentence edit evicted the tab set and re-inserted the page: one 2.1 s `insertBefore` that reconnected every widget, rebuilt five `lf-specimen` iframes, and re-collected the margin once per reconnecting widget. It also fetched the revision document a second time after the install. A new registry key, `x-patch: members`, which `lf-tabs` declares, says the module builds its controls beside its members and reads only their attributes. The patch now reaches inside such a widget while the revision keeps its shell: its own attributes and each member's tag and attributes, in order. A shell change (a tab added or relabeled) still rebuilds it. **An idle corpus repainted the thread layer about 6 times a second.** The example `lf-sort-film` auto-played inside a tab hidden with `until-found`, which still has client rects. Each step announced a layout change, and that re-ran the whole thread presentation and re-read the page. This was the input delay behind the comment and move timings. The film now plays only when `checkVisibility()` says it is shown. **Each thread pass re-read margin targets' words.** `addressableSays` walked every margin target's text on every pass, about 200 ms of a corpus comment. `elementReading` in `passages.js` now keeps that answer exactly as long as the page reading, under the same mutation watcher. The watcher also counted the thread panel rewriting `name` on its `<details>` rows as a change to the page's words. `name` matters only on a `<slot>`, so it counts only there. A corpus comment now re-reads the page 3 times instead of 6. Measured with the #14 benchmark's transitions on one corpus page: | corpus transition | before | after | |---|---|---| | revision: requests / bytes | 33 / 2.18 MB | 10 / 686 KB | | revision: presented | 3.0 s | 1.3 s | | comment: thread-pass CPU (profile) | ~400 ms | ~250 ms | The machine's load average was 30–70 throughout, so read the times as direction, not values. The requests and bytes are exact. Left alone: triage-board's revision is served at 163 KB against 3.8 KB stored. 142 KB of that is the runtime stylesheets every delivered document inlines (`delivery_sheets`), sent uncompressed by the local server. Production compresses it to about 11 KB. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 6, 2026
…rds (#1897) Pressing Escape in a workspace pane, or closing a surface opened over one, now keeps the user in the page region they were reading. Before, they ended up at the workspace header: `d` and `u` stopped moving the pane, and the next Tab started at the top. The Threads panel and the thread cards on the page now have accessible names. These are the fixes from the TODO #14 audit, which followed one task through a workspace by keyboard and checked the accessibility tree. ## The audit I used `annotation-workspace` because it has every part the brief lists: a header with a nav landmark, a bounded pane, an aside holding the annotation rail, and a footer. `rust-sort` covered a pane long enough to scroll. Both ran at 1440×900, 1024×768 and 700×900, through `leaf-dev probe --journey`. The route: - read with `?`, Tab, `j`/`d` - search with `/`, then `c` to comment on the match - send, then Escape - open Threads with `g T` and Tab through it - Escape out - resize from 1440 to 700 and back At each step the probe recorded the focused element, its name and role, whether it had a ring and was on screen, and the ARIA snapshot. ### Fixed - **A let-go left the pane the user was reading.** Escape, closing a panel and `g p` all land on `readingBlock()`. With no argument, it read the page outside every bounded region, and in a workspace whose panes scroll themselves that is only the header. In `rust-sort`, Escape on a link in the Source pane left `d` moving nothing, and Tab started again in the other pane. `reading-regions.js` now remembers the page region the user last acted in (`pageReadingRegion`) separately from the most recent region of any kind. A surface's own region, such as the Threads list, no longer replaces it. Landings and walk origins (`pageReadingBlock`, `landingPlace`) read the visible block in that region; if the region shows none, they read the region that contains it, and so on out to the page. A pane on screen that shows no text block (a figure, a spacer) gets its body as the landing, so the region survives there too. Now Escape in the Source pane leaves `d` paging it (449 → 898), and Tab continues inside it. The `a` walk's starting point and version continuity's fallback region follow the same page region. - **The Threads list stayed the reading-key region after the panel closed.** After a pointer close, `d` scrolled the hidden list: on `review-a-plan` the page stayed at 0, and it now scrolls to 474. Likewise, `g p` from an open beside panel used to land at the top of the document; now it lands on the paragraph in view. A region hidden from layout no longer answers, and the user is back in their page region. A pane scrolled out of view still answers, so `d` continues through a workspace body that carries flowing panes. - **The Threads panel was an unnamed dialog.** Its title now names it. `registerAuxiliarySurface` refuses a surface with no accessible name, so a new panel or drawer can't ship without one. The Queue and Leaves drawers already had names. - **Thread cards on the page had no name.** These are the cards in the rail and the margin. After a send in the rail, focus lands on the card, and a screen reader announced it as an unnamed group. Every card outside the panel is now named "Thread, <topic>". Panel cards take their name from the summary row, which is where focus lands in the panel. ### Checked, no defect - Landmarks: main, the "Review regions" nav, the "Sampling evidence" region, the "Conversations and actions" complementary, and the banner. - Every Tab stop shows its focus ring. Option marks ring their whole row. - Banner, rail, option and composer controls all have names a reader can follow. - Covering posture (700px): the page is inert, the panel has `aria-modal`, Tab wraps inside the panel, the first Escape returns to the thread list, and the second returns to the page. - Posture change from 1440 to 700 and back keeps the focused control and each pane's scroll position. - #1888 changed only `wt-merge`, its corpus entry and its test, so it doesn't overlap. ### Decided, follow-up: focus under a panel that stands beside the page When the panel stands beside the page (a window wide enough to leave a usable page), it still sits over part of it. In a workspace that fills the window, that part holds live controls: - At 1440×900, Tab walks onto `annotation-workspace`'s rail controls, which are under Threads. - `c` on a selection opens the rail's comment box under Threads too. - The Queue panel sits over an Ask's option marks at 1200px. Closing the surface whenever focus lands on content it hides fixed all three, but closed the Queue partway through answering it, so I reverted it and asked. Max's answer: the panels dominate focus. Moving focus never closes or changes a standing panel; instead focus never lands on page content a panel covers, and Threads still stands beside a full-width workspace. This change leaves that behaviour as it is on main; the TODO.md item records the rule, and a follow-up PR implements it. ### Pane focus (deferred TODO item) "Show which pane has focus, and move between panes by key" stays deferred. On a fresh workspace `j`/`d` move nothing until the user enters a pane, because no pane has been acted in yet. That doesn't stop a task, since Tab reaches every pane's controls. ## Underlying fix **Yes.** The let-go defect came from the one place every landing reads, not from `letGo`. `reading-regions.js` kept a single "recent region" slot that the page's panes and the chrome's surfaces shared. Leaf's own fallback focus on the body also counted as the user choosing the page. The first version of this change fixed only `readingBlock`'s default. An independent review then ran three more routes through the same slot: - `g p` from a beside Threads panel - the `a` walk's starting point with focus in the Threads list - a pane with no text block in view All three failed. A fourth route, pane → `g T` → Escape, failed on main too, and so did a fifth: a let-go after the remembered pane scrolled out of a scrolling workspace body. The page's region now lives in its own slot, and readings step outward from it. All five are covered by tests. The unnamed dialog shipped because the axe sweep runs only WCAG-tagged rules, and `aria-dialog-name` is tagged best practice. The registration check now refuses an unnamed auxiliary surface, so none can ship that way. I read `git log -L` on `readingBlock` and `userReadingRegion`: #1811 added the assertion that Escape forgets the pane, recording the behaviour this PR changes. ## Tests - `test_a_click_on_a_panes_words_makes_it_the_subject_of_every_scroll_key`: the region now survives Escape and `u` scrolls the pane. This replaces #1811's assertion that the region is gone. - `test_a_let_go_keeps_the_user_in_the_pane_they_read`: new. It covers pane → `g T` → Escape, a let-go in a pane with no text block in view, `d` through a workspace body carrying flowing panes, and a `g p` landing once that pane has scrolled away. - `test_a_closed_threads_panel_hands_the_page_back_where_the_user_was_reading`: new. It covers `g p` from a beside panel and `d` after a pointer close. - `test_the_thread_panel_and_a_page_thread_carry_names`: new. - Each new assertion fails on main, on the first version of this change, or under a targeted mutation of the line it protects. - `npm run test:runtime` passes. - A selection of browser tests passes, filtered to let-go, walk, panel, drawer, region, pane, card, queue and version cases across navigation, anchors, projection, controls, read-state, threads, margin, send-placement and widgets. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 12, 2026
Workstream #14 of the duplicate-logic sweep. Two readers took browser state back from the rendering, which `skills/leaf/assets/AGENTS.md` forbids, and several rules were written more than once. Each now has one owner, and every caller uses it. ## Behavior changes - **A thread on a line of a diff file not yet loaded is named by its line.** It read "§ diff"; it now reads "§ app.py · new line 1". The datum label is looked up in `anchor-resolution.js` (`datumLabel`), the same way resolution finds datums, and a lazy widget names a datum it has not drawn through a new `lfDatumLabel(key)` hook, which `lf-diff` implements (`module-authoring.md`). `test_a_manifest_diff_can_comment_on_one_unloaded_file` gains that leg, which fails on the base. - **The page's reading takes retired slots from the publisher, not from paint.** `passages.js` reads each holder's standing outcome from the published widget state instead of reading `data-lf-retired` back, and forgets the page reading when those outcomes change. A slot painted retired where the log decided nothing keeps its words in the reading, and slots in a holder's shadow root count too (the old selector missed them). - **Version comparison compares widget state, not the DOM.** The base revision's authored values are folded under its projection with `foldWidgetStates` and compared with the publisher's current widget state. An event admitted under a different declaration of its verb is left out of the base fold rather than throwing. A card the author moved within its column is now marked, the fewest cards whose moves explain the new order (`test_the_diff_marks_the_card_the_author_reordered_and_no_other` fails on the base's column-only rule). - **`quoted()` has one answer.** `widget-descriptors.js` owns it: the descriptor's authored-ancestry reading, which a widget's actions already used, rather than a live `closest()`. - **A malformed fragment escape keeps its literal characters at first paint**, as followed links already did. ## One home each, no behavior change - "The page shows the active revision" is `runtime.showsActive` (`context.js`), replacing `!==` and `>` comparisons in `version.js`, `context.js` and `state-feed.js`. - Fragment decoding lives in `prepaint.js` (`lfInitial.fragmentId`), which `initial-render.js` exports to modules. - The state coordinate key is `stateCoordinate`/`coordinateOf` in `projection/model.js`, used by the publisher and `annotation-inventory.js`. - A local action's meaning reads its widget's captured declaration, as its reading does, rather than the document registry. - `projectData` clears stale datums in the declared shadow roots that resolution reads (`shadowRootsIn`). `test_a_settled_third_party_holder_wears_the_layers_mark` fails on `main` as well as here. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 6, 2026
…are found by one automaton; an inline edge is no gap between words The draft (#12). Placement tracked what a posted thread's anchor depends on and nothing of the draft's, so on a page with no threads yet a script that rewrote the paragraph around a sentence the user was commenting on took the draft's mark off the sentence until the next presentation, and `pendingAt()` returned the passage in the old, now disconnected node. The draft's anchor now stands among the threads' under a key no thread bears: its quote in the index, its section among the ids, its text nodes among those a rewrite settles at once. Placement tells those who hear it whether the draft moved, and the anchor paint repaints the draft's mark from `pendingAt()`. Ids in staged trees (#13). The watcher read the ids a change added or removed with a light-tree `querySelectorAll`, so a widget whose shadow stage held a section, replaced by one staged with the same section before it was put in place, left a section-only thread on the disconnected old element. Ids are now read in the light tree and the declared shadow trees an id is looked for in (`shadowRootsIn`, as `elementById` does). One automaton (#14). The index found copies by hashing each quote's first 16 letters and then its whole length, so at each place the first hash matched it tried every length the quotes sharing it came in: 800 quotes of growing length sharing a run of x's took 4.3 s in Chromium and 9.6 s in Firefox, about 8x per doubling. An Aho–Corasick automaton over the quotes' letters (`automatonOf`) now finds every copy of every quote in one pass, in time with the text, the quotes' total length and the copies found; the matcher reads each copy's words against the page and keeps the fence and context rules on top. No maintained dependency fits: the automaton is 70 lines and runs over a window of the page's letters that a dependency's string API doesn't take. The hash keys, their buckets and `keyStarts` go. `findEach`, Chromium then Firefox: - #9's shape, 1,600 quotes alike but for a number: 14.2 to 12.1 ms, 36 to 12 ms; - #14's shape, 400 and 800 quotes: 515 and 4,258 to 2.5 and 8.3 ms; 1,193 and 9,620 to 2 and 8 ms. The 1,600-mark page is unchanged: presentation 38.9 to 38.5 ms, edit 292 to 290 ms, startup presented at 1,281 to 1,238 ms. The 1,600-section page's edit varied 6.5-11.9 ms on de675ba and 6.5-13 ms here over three runs each; its move 1.2-1.8 against 1.4-1.8. Word gaps (#15). The raw reading held an edge between any two text nodes and a quote's gap matched one, so `one two`, rewritten as `<span>one</span><span>two</span>`, which reads `onetwo`, stayed marked in both browsers while the file's reading detaches it. The raw reading now holds a space wherever the reading reads one (a line break, a block's end: `readSegments`' rule), an edge only between inline elements, and a gap must hold whitespace: an edge may stand in a gap or inside a word, never be one. A quote across two blocks no longer runs their words together (`boldtext` over `bold` and `text` blocks), as in the file. Page search takes the same gap. tests/quote_cases.json gains both cases, a line break, and an inline-edge word. Of the gaps the review named, a line break and a block's end are spaces in both readings; `display: contents` and generated content are style, which neither reading reads. On the 25 example pages, 7,055 quotes captured across each pair of adjacent text nodes all resolve to their own words, or are repeated. Tests, each failing on de675ba in Chromium and Firefox: - test_a_draft_s_passage_keeps_its_mark_when_a_script_rewrites_around_it (#12), read once; - test_a_section_staged_again_in_a_new_widget_keeps_its_thread (#13); - test_words_a_script_sets_in_elements_of_their_own_run_together (#15). Runtime, each failing on de675ba: the seeded check now runs pages holding only a draft and stages filled before they are put in place, and checks the draft's placement and section-only threads after every change; two quote cases; and a `findEach` test that counts the automaton's lookups against the text and the strings' total length for both shapes. The raw-reading test now expects a space at a block's end.
max-sixty
added a commit
that referenced
this pull request
Nov 26, 2026
…age data on first visits Codex's review of the previous commit found faults in it, numbered as its findings are: - #1: the door refused a comment a reader genuinely drew. A revision digests a value alone, so the same value republished under another contract read as a contract the seat never drew. The door now refuses only a current reading that holds an error; an input of another contract is left to `page check`. - #3: on Linux two writes can share a change time, so the separate change-time stat still missed a same-size rewrite with the old modification time (35 of 100 cache trials, 86 of 100 news trials), and the hosted publisher's fingerprint (`record_reading`) ignored it. `file_stamp` takes `changed`, which adds the change time from the same stat and settles on the later of the two times, and every reader of a bound file (news, the hosted fingerprint, the source's cache and run) stamps it that way. - #10: comments keep the file's own revision, but the previous commit made the served state's tail resend a publication's unchanged value on every rerun (one 256 KiB rerun grew the answer from 362 bytes to 262 KB), and a validation cached by the file's revision went stale when the label moved. A bound file's whole value now has its own digest, kept with its reading, which the tail compares (`data.value_key`) and validation keys on; the tail's rerun test is back as it was. - #12: the first-visit state dropped a publication only a thread's widget binds, and advertised the version of all data while sending part of it, so a tab naming that version never got the rest. It now holds every source a document or message of the page binds, and the version of exactly those (`page_data.bound_data`), in place of the export's filter, which leaves messages out. - #13 (part): a widget's construction in `leaf page state` said an input of another contract had its value available. It now says it has none, with why. `page check` still finds a file bound under another contract only in the page's own markup, not in a sample's or a message's. - #14: a read failure whose cause the file's stamp doesn't name, such as a symlink in its path, stayed cached after its cause cleared. A source holding an error is now read again each time. - #15: looking up one source for the door read every bound file. It now reads the one it names.
max-sixty
added a commit
that referenced
this pull request
Nov 26, 2026
… and leave drafts off first visits Codex's review of the previous commit confirmed #3 fixed on Linux and macOS and found these still open: - #10: two overlapping state requests could lose a relabel, since a reading the file cache no longer held fell back to the file's revision, which leaves the label out. `data.value_key` now takes the digest kept with that exact reading, and digests any other reading of a bound file afresh; a publication still stands in by its revision, so a rerun sends no value. - #12: first visits held every binding `working_data_bindings` knows, the unpublished source's among them, so a binding only `index.html` holds put its file in the public state. `bound_data` now reads the published revisions and the messages, and not the draft. - #14: a symlink put in a bound file's path and taken out again moved neither the news nor the run, and a file holding bad bytes was read again on every state read. A bound file's observation (`file_bindings.observed`), which the news, the hosted fingerprint and the source's cache all read, now also says whether its path names it without a symlink, so every reading, an error's included, is kept under it. - #15: admission read every publication to learn whether a source was supplied. It now asks for the one source first, and reads the others only where that source holds nothing. Still open, and reported: #1's comment on a file an input of another contract binds after its page was checked, and a contract that pins the file's name, which a new label then breaks; #13's file-contract check, which reaches the page's own markup and not a sample's or a message's; and the copy of a file source into a live sample, which takes a publication's revision.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Run 32322786164 went red on main with
test_failed_settlement_keeps_the_base_for_a_chained_nondurable_editfailing onassert local.evaluate(STORED_DRAFT_SETTLED, "general")— and the run before it (32322449066, on the merge of #6) failed at the same assertion. Neither commit touches this test or the runtime; both are test-only edits to three other draft-staleness tests.The read is a step early.
round_tripwaits on the browser's ownresponseevents, while the page settles the generation in the continuation that reads that response —sendDraftawaitspost(...)and only then callssettleDraft, which is what writes the tombstone. So the log holds the second comment (the assertions above it read the file, and the server appended before it answered) before the store holds its settlement, and a plain read taken right after the trip is the same assertion made in that gap.tests/CLAUDE.md's "A round trip is not over when its response lands" is this gap; the tabs further down the file already read the same store throughwait_for_function(STORED_DRAFT_SETTLED, ...).Solution
The store is read on the fact the page states, matching the four sites that already do (
test_render.py:15570,:15697,:16216,:16493). No runtime change: the runtime was right, and nothing in the test was relaxed —wait_for_functionfails loudly when the fact never arrives.Testing
Reproduction, fix, and bug-back
Reproduced deterministically by holding the page's own reading of the response back a fixed lateness, leaving the browser's trip on time (so
round_tripreturns where a loaded runner puts it):Bug-back, so the test still catches the runtime rule it names — dropping the nondurable-chain base from
saveDraft(const base = previous?.attempt ?? null) fails it at the send that never goes out:And the wait is not vacuous: pointed at a context nothing settles, it times out rather than passing.
With the runtime restored,
pytest tests/test_render.py -k "draft or settle or generation or general or tombstone"is 28 passed, andpre-commit run --files tests/test_render.pyis clean.Automated fix for failed run