Repository navigation
Repair the three nightly cases the Lit application-state cutover reddened - #757
Conversation
…ened Since #746 the application publisher derived the Ask inventory from authored descriptors while it was still waiting for the first server reading. Two nightly cases caught what that paints: a restored Asks tray showed "Accept all (1)" for a suggestion the log had already accepted, and the margin raised the suggestion's Ask marker and claimed the rail before lf-suggestion.js was even requested. Before #746 the inventory stayed empty until the page was presented. The publisher now derives Asks only against an admitted reading, as it already did for threads, and application.test.mjs asserts the empty inventory while waiting and offline, so the PR gate covers what only the nightly suite caught. The third case asserted the contract #746 retired. Authored state is now decoded from source markup before modules upgrade, so a module that moves its element while upgrading is presenting it, and the widget's own render restores the authored placement. The stale-widget case now expects quota back under #task after the v2 activation, which fails when activation reads authored facets off the moved node. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
paintApproval disables version sign-off while unansweredAsks.length > 0, and both selections behind it — effective.asks.unanswered and admittedUnansweredAsks — are now empty in every phase but ready. The other half of that gate, the presented attribute, does not cover the gap: presentation releases the page at PRESENTATION_WAIT_MS whether or not an answer has come, and the offline fallback presents too. So any presented page with no admitted reading now offers approval while an authored Ask stands unanswered.
Measured on this merged tree against the same tree carrying origin/main's application.ts and bundle — one page, one lf-ask, no log behind it, <meta name="lf-review" content="sign-off">:
- first state read refused, page under its offline banner: main leaves the button disabled with "Answer every Ask before approving this work"; this branch enables it with "Approve this work; the page stays open for follow-up".
- first state read held past the 10s presentation wait: same result on both trees.
The Ask chip reads Asks 0/1 on main and Asks 0/0 here in both cases. Approval is the gesture the code itself calls irreversible, and pressing it offline queues the done event to send on reconnect — against an Ask no reading ever answered.
waiting and offline are different facts, but both are "no reading", and the consumer reads an empty inventory as proof every Ask is answered rather than as the absence of proof. Blocking approval whenever no reading has been admitted keeps that honest without restoring the stale count #746 broke; it is one condition, in paintApproval or in approvalBlockingAsks. The publisher's own gate reads correctly to me — this is the consumer that took the empty inventory at face value.
Same root, lower stakes: an offline page also loses its Ask chip, Accept all, and the ask walk, while the inline Accept/Reject controls on the same screen stay live.
Say the word and I'll push the fix.
With Asks published only against an admitted reading, a page presented without one (the first state read refused, or still pending past the presentation wait) listed no Asks, and the approval gate read that empty list as every Ask answered: an offline page offered sign-off over an unanswered Ask, queuing an irreversible `done` for reconnect. approvalBlockingAsks now answers null when no reading is admitted, and paintApproval keeps the control disabled with its own title for that case. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ruled out (#768) The cutover list scored its candidates from a survey's estimates. Six of the rows ranked next were measured against the code, and every one was stale or overstated; an independent review then confirmed the six verdicts and corrected three of the reasons behind them. The rows now carry what was measured, and the ones the measurements ruled out have moved to the survey note, whose table is now named Rejected. What the measurements found: - **`html` as the page scroller** was already done: `26feec8b` made the switch on 2026-08-29, `theme.css` holds the rule, and the runtime reads `document.scrollingElement`. The row is gone. - **Same-document View Transitions** claimed ~150 lines against a `motion.js` of 87. The update applies after the old state is captured, later than the gesture's own turn; pointer input misses the page while it animates; a fold collapses height so later content slides, which a root cross-fade does not draw; and board cards move inside their own scroller, whose clip a snapshot escapes under the Chrome 125 floor. #666 removed the paint-boundary transition version travel used, which also leaves `theme.css`'s `lf-versioning` rule dead — deleted here. - **idiomorph for the version patch**: a live-tree diff keeps only the reader state an exclusion names, while `dom-children.js` compares authored source with authored source and keeps all of it. It has needed no fix since #514 split it out. - **`tsc --checkJs`** runs in under a second, but a bug-back over six runtime fixes (#404, #448, #625, #660, #676, #757) found no error that the fix removed from the files it touched, and the errors it does report are inference artifacts. - **Browser-owned anchoring** was spiked on `agent-a4111d25e33d466d2`. All three capture paths cut over and the anchors matched the Python capture exactly, but Python grew by 168 lines, a quoted `leaf comment` went from 0.2 s to 1.3 s and now needs Chrome, and the anchor tests went from 8 s to 37 s: the refusals and the diagnostics for a quote the page does not show read authored source the rendered page no longer holds. - **The user-level daemon** nets roughly zero lines. The browser already receives pushes over `EventSource`, the 70 µs stat loop serves CLI writers in other processes, pid probing and most locks stay, Windows is not a goal, and a user-level database stops the page directory being the deployment unit. Two rows are new. A size-first sweep of the largest hand-written mechanisms found one candidate the defect-led survey missed: serving each page through starlette and uvicorn, which `mcp` already installs, keeping one process per page. And the keyboard system becomes item #24 under architecture simplification: the reader keeps every key, sequence, hint, and the one-press-per-layer Escape, while the code that infers which surfaces are open — where ten of the last 24 keyboard fixes landed — gives way to a layer stack that openers push and closes pop. No library owns that; the ones that came closest are in Rejected. The preamble now says effort and confidence are estimates unless a row cites a measurement. Checks: the everyday suite (1,135) and `test_a_revision_navigates_without_the_view_transition_api`, which exercises activation with the View Transition API switched off, both pass; pre-commit is green on the changed files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Three nightly cases have been red since #746 (bisected: green at 28554d3, red at bb80748). Main's Linux nightly for c20ecd1 (https://github.com/max-sixty/leaf/actions/runs/35183451662) fails on the same three, so every push run to main ends red and starts a
tend-ci-fixsession until they pass.Asks published before the log was read (two cases). Since #746 the application publisher derived the Ask inventory from authored descriptors while it was still waiting for the first server reading.
test_a_current_auxiliary_choice_replaces_a_persisted_tray_during_replaysaw the banner paint "Accept all (1)" for a suggestion the log had already accepted, andtest_the_room_is_measured_after_a_late_railsaw the margin raise that suggestion's Ask marker and claim--railbeforelf-suggestion.jswas requested (a probe read phasewaiting, no admitted reading, andasks.all == ["sug-copy"]at that moment). Before #746 the inventory stayed empty until the page was presented. The publisher now derives Asks only against an admitted reading, as it already did for threads.application.test.mjsasserts the empty inventory while waiting and offline, which fails against the unfixed publisher, so the PR gate covers what only the nightly suite caught;packages.mdstates it forwatchAsks.Approval stays shut without a reading. An empty inventory before admission is absence of proof, not proof that every Ask is answered, and
paintApprovalread it as the latter: a page presented with no admitted reading (first state read refused, or pending past the presentation wait) offered sign-off over an unanswered Ask.approvalBlockingAsksnow answersnullin that case and the control stays disabled with its own title;test_approval_waits_for_a_reading_of_the_logfails against the previous gate. The Ask chip,Accept alland the ask walk stay absent on such a page, as they were before #746, because nothing there says which authored Asks still stand.A test holding the contract #746 retired (one case). #746 decodes authored state from source markup before modules upgrade.
test_a_stale_package_widget_uses_recursive_parent_eligibility's module moves#quotainto#destinationwhile upgrading, and the widget's ownrenderStatethen restores the authored placement under#task, at v1 and at v2 alike. The case expected the move to survive activation; it now expects#task > #quota. Reading authored facets off the live, moved node at activation (a fault injected intoversion.js) makes that assertion fail.Validation: the three cases pass, as do the approval, application-boundary, chrome-contract and startup modules (126);
npm run test:browser(53) andcheck:browserpass; the full local nightly selection gave 2694 passed and 1 failed —test_the_ask_walk_position_shares_the_shortcut_linemissing a 900 ms boundary flash under load, which passed 24/24 in paired runs of twelve concurrent processes on this branch and on main.🤖 Generated with Claude Code