Repository navigation
Preserve runtime state across authored revisions - #621
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Both halves land: I ran each new case against the base runtime and each fails there, and test_render_projection.py and test_render_navigation.py are otherwise green on the branch (the one red, test_command_hub_stops_listening_after_live_version_replacement, fails at the merge base too and is already fixed in #620).
One gap in the invariant the change claims for itself: capture clamps the quote landmark but not the section landmark, and for a heading that carries its own id those are the same element — so a revision that rewords the heading still lands the reader on the clipped title. Detail and a reproduction inline.
Records the option space for combining UI acceptance policy with recurring agent discovery. The note compares Leaf's existing `ui-sweep` composition with public exploratory, visual-audit, goal-driven browser, general QA, and hosted-browser skills; defines the shared mission, evidence, stopping, and calibration contracts; and recommends a Leaf-native pilot before adding persistent QA infrastructure. This is an active research note rather than a shipped product or agent contract. Checks: `uv run pre-commit run --files notes/agent-driven-ui-quality.md` > _This was written by Codex on behalf of max-sixty_
## Summary - distinguish the document scrollport from nested content clips so below-fold words remain readable by the render gate - compose the site-context package into published examples and keep its wide workspace header compact across platform font metrics - update stale browser-suite fixtures for current Live Progress, visual-review navigation, version stamping, data-only pages, and resize confirmation ## Validation - `uv run pytest tests --run-nightly -v` — 2529 passed; the affected startup-timeout node then passed six consecutive focused runs - focused causal slice — 40 passed - Live Progress published-workspace allocation — passed locally at 1200×900 - resize confirmation selection — passed twice in the reviewer’s isolated `-n2` reproduction after removing the confirming-page timeout override - `uv run pre-commit run --files ...` - `npm run typecheck --prefix worker` - `npm test --prefix worker` — 60 passed - `npx wrangler deploy --dry-run --outdir ../.tmp/worker-deploy` - `scripts/verify-site-local.sh` > _This was written by Codex on behalf of max-sixty_
Resolving a selected thread updated the panel optimistically but deferred its focus handoff until the request completed. During that gap, focus fell to the Threads list, so pressing `c` opened the page comment box and cancelled the eventual landing. Move settlement landing into the optimistic transition and restore it on refusal. Resolve now selects the next available thread immediately, while Reopen enters its reply and conditionally restores the reader's exact lifecycle/search view if the request fails. Existing focus-intent guards keep later reader navigation authoritative. Browser coverage holds accepted and refused Resolve/Reopen requests, presses `c` before acknowledgement, retains drafts, and covers last-thread and later-destination behavior. The complete conversation browser file passes 76 tests. The current-head full suite passed 1,036 tests; its two intermittent render-startup failures reproduced on a frozen current-main worktree with the same two-worker selection. > _This was written by Codex on behalf of max-sixty_
leaf-agent
left a comment
There was a problem hiding this comment.
The root-ownership split holds on the path the PR claims. One seam it leaves open: the namespace half of the boundary is enforced — version check rejects an authored data-lf- attribute or lf- class on <html> and <body> through reserved_marker_errors — while the registry half is opt-in and unchecked, so the next runtime writer that reaches past setRuntimeRootStyle reintroduces exactly the collision this PR fixes, and nothing says so. Detail and the enforcement this repo already has for facts of this shape inline.
Superseded by the review on a later commit.
leaf-agent
left a comment
There was a problem hiding this comment.
The seam I raised is enforced for root styles; detail and the remaining attribute-side note are inline. Selection on the branch-owned increment (203d6877): pre-commit run eslint --all-files passes, and the restore and revision-activation cases the refactor touches — test_a_restored_auxiliary_surface_has_final_geometry_before_runtime_loads, test_a_current_auxiliary_choice_replaces_a_persisted_tray_during_replay, test_the_live_page_adopts_a_revision_and_stamps_it_without_replacing_main, test_revision_changes_keep_the_complete_heading_below_reader_chrome, test_revision_changes_follow_authored_text_into_declared_shadow_trees, test_revision_remembers_the_active_region_when_a_workspace_reflows — are green.
…der-heading # Conflicts: # skills/leaf/assets/runtime/version.js
Follow-up to #621. Version activation keeps the document roots alive while replacing authored state, so runtime-owned root attributes and styles need one enforceable ownership boundary. This expands the existing architecture lint from inline styles to root state. It covers direct properties, DOM attribute methods, `dataset`, `classList`, `Object.assign`, `Reflect.set`, stable aliases, and destructured aliases while permitting Leaf-reserved `data-lf-*` attributes and `lf-*` class tokens. Unknown attribute names fail closed. References through the shared `PAGE_PAINT_ATTRIBUTE` registry are resolved from its canonical declaration, so the runtime's existing house style remains checked without duplicating the registry. Validated with causal lint probes for accepted and rejected mutation forms, the full pre-commit gate, and independent review. > _This was written by Codex on behalf of max-sixty_
An in-place authored revision could overwrite or remove live reader state because the
same stable
htmlandbodyelements carry both authored attributes and runtime-ownedstate. The visible symptom was a heading sliding under the fixed banner after the
prepaint
data-lf-livemarker disappeared, but the same boundary also affected bodyfocus and runtime-owned inline layout properties.
Make root ownership explicit: authored classes and attributes replace their prior
authored share, reserved runtime namespaces remain live, and runtime writers register
the individual root attributes and CSS properties they own. Version continuity now
walks the same composed reading tree as passage resolution, preserves a nested heading's
offset within its section, and records the active reading region before a bounded
workspace reflows. An architecture lint rule follows document-root aliases and rejects
inline-style mutations outside that ownership boundary.
Browser regressions cover automatic revision arrival and the rendered Versions control,
including reworded-heading fallback, an initially colliding
body tabindex, collidingruntime CSS properties, a declared shadow-root landmark, and a four-pane bounded-to-flow
transition.
uv run pytest testspasses all 1,051 tests, and every pre-commit hook passes.