Repository navigation
Remove per-publication widget runtimes and duplicate diff metadata - #2742
Conversation
Drop the historical widget implementation guarantee and its scoped registries, resource routing, sample copies and export graph. Restore one widget implementation set per document and remove cross-revision markup constraints. Transport raw keyed Git evidence and derive validated metadata once in the browser. Preserve explicit current-source validation atomicity and existing draft/intent behavior while deleting obsolete identity modes.
leaf-agent
left a comment
There was a problem hiding this comment.
revision_names() now includes every revision marker without checking whether its capture has the fields this runtime needs. If a shared state home contains an older bundle with a missing manifest.json or required manifest field, latest_revision() selects it; LivePage.served_document() then reads that bundle and page delivery fails instead of treating the record as absent. The removed test_revision_inventory_ignores_incomplete_capture_records covered this case. Please restore the inventory's current-format filter while keeping obsolete revision numbers reserved, as the repository's Stage rule requires for older state.
|
tbc, we expect zero backward compat; this should be in AGENTS.md do not bear ANY code complication burden for backward compat |
|
The old-state premise in my earlier review was wrong. #2746 removes the revision-inventory manifest filter and its separate reserved-order path, and states the no-backward-compatibility rule in |
A served document now resolves captured widget and layer resources from its revision entry URL. The registry probe stays at the mutable page root for startup recovery, but it cannot also be the resource base: a page-owned widget exists at the captured revision path, so samples tried to import `/api/samples/<id>/widgets/lf-conversation-workspace.js` and received 404. This repairs the sample and gallery failures in [main CI run 38359427323](https://github.com/max-sixty/leaf/actions/runs/38359427323) following #2742. The failing `test_the_feature_gallery_exercises_its_core_journeys` passed after the change. `pnpm run test:runtime` passed (406 tests). Other independent browser failures in that main run remain under investigation. Co-authored-by: leaf-agent <[email protected]>
Remove the revision-inventory manifest filter added in #2742 for records from older runtimes. Revision enumeration reads marker names again; the separate reserved-order path and its legacy-capture test are gone. Current-format capture reads and interrupted-publication behavior remain covered by focused tests. `AGENTS.md` now states that earlier runtime state, including records in the shared state home, carries no backward-compatibility obligation. This follows the [maintainer's correction](#2742 (comment)) to the earlier review request. Verified: four focused revision and server tests passed, including interrupted capture publication, unchanged revision reads, bounded state reads, and the corrupt-page refusal. Co-authored-by: leaf-agent <[email protected]>
…ate (#5896) Leaf's data contracts could mark one field of each record as `deferred`: the page received rows without it, and a widget fetched each field with `loadDeferred` through `/api/deferred`. Only `lf-diff`'s `unified-diff` contract used it, for each file's patch. Since #2742, `lf-diff` derives each row from its patch, so it fetched every patch as soon as it showed: one request per file right after the state answer, saving no bytes. On leaf.page those per-file requests also passed the edge's stored state answer, so viewing a diff page started the visitor's container. This removes the mechanism. A manifest's patches are part of the value page state carries, which the edge already answers for a visitor who hasn't written. **Removed** - `records.deferred` in the registry schema, and the `contract-records` check, which only kept a deferred field from naming the key. - The `/api/deferred` route and the server functions behind it (`data_manifest`, `deferred_fields`, `deferred_value`, `browser_data_from`), with the two source-protocol methods only it read. - The browser's loader: `loadDeferred` in the portable API and `runtime/deferred-value.js`, and `offlineDeferred` in the export reader. - The export's per-value spans, which let one deferred field be decoded alone: its data file is now one gzipped JSON object keyed by source. - The website's capture of deferred answers into a session's stored responses, and the Worker's routing of them. - `lf-diff`'s Retry for a patch that failed to load, and `readEntry`, which read a manifest patch when its file opened. `sourceRecords` now parses each manifest patch when the source arrives. A patch it can't draw refuses only its own file and is reported as before. **Behaviour that changes for agents.** `leaf page state <page> <message>` reads a message's widgets with their inputs' values. For an `lf-diff` in a message bound to a manifest, that reading now carries every patch (220 KB on pr-walkthrough) instead of the rows without them, as a patch-text source always did. **Kept.** `page_memory.once` (#5856) was justified by the 46 concurrent deferred loads on a cold container. It still makes any requests that reach a cold server together compose the layer once; only its docstring changes. **Measured** on pr-walkthrough with `leaf-dev probe --base`: the page first presents the server's state after 315 requests instead of 363, and 8.08 MB instead of 8.09 MB. The state answer itself grows by the 220 KB of patches, which one deferred request per file used to fetch just after it; later state reads still leave out data the tab already holds. **Tests** - Deleted: the deferred route and its stale-revision refusal, offline deferred reads, `loadDeferred`'s guards, and the in-place and reopen Retry tests. - Replaced: the disclosure test that walked a stale deferred read. Its successor, `test_a_file_opened_while_a_newer_source_draws_shows_the_newer_lines`, holds the wait an opened file keeps on a newer revision's drawing. With that wait removed, it fails with the older lines shown. - Rewritten to read whole values: - the historical-state and snapshot server tests; - the page-owned-contract test, whose old registry now judges data the new one accepts; - the anchors and seated-thread diff tests (a refused file now comes from a patch naming another file); - the offline export test. - Moved: the repeated-key refusal, from a server test to the manifest model test. `tests/browser/projection/test_code_review.py::test_call_diff_source_paths_do_not_alias_durable_rename_coordinates` fails locally on macOS (`556.8 == 563.8 ± 0.5`) identically on the merge base; this change doesn't cause it. **Docs.** `package-data.md` and `module-state.md` lose the deferred paragraphs, and `package-data.md` says what `records` does now. The diff package's author instructions now say the manifest producer isolates a file `lf-diff` can't draw, since size is no longer a reason to use it. > _This was written by Claude Code on behalf of max-sixty_
The guidance cleanup introduced per-publication widget runtimes: captured constructors, declarations, private modules, CSS and initializers could coexist in one document. That guarantee is unwanted. Remove it, including the scoped-registry dependency and adapter, publication contexts and resource routes, copied sample publications, and the additional export graph. Widgets register globally again; the owner-aware construction and declaration APIs are removed across every maintained caller. Replies validate the current authoring vocabulary without the old all-pinned-registry guard.
Git diff manifests now carry only a path and raw patch. The browser derives validated display metadata once instead of comparing its reading with a second Python interpretation. Native operations, source coordinates, comments and Retry use that canonical reading. The publication-specific delivery mode, all-revision sample reads and export preparation disappear with the rejected feature. Ordinary authored revision snapshots and admitted decision meanings retain their existing owners.
The integrated change removes 3,078 net lines, including 1,023 maintained source/build lines and 2,037 test/fixture lines. Most raw churn reverses the constructor-wrapper outdent from the previous change. The rollback keeps unrelated source-validation atomicity, draft focus and queued-sample intent fixes, and removes obsolete optional capture identities and duplicate candidate-revision calculation. Current-format revision inventory filtering and protocol refusal remain: incomplete captures are absent, their IDs stay reserved, and invalid layers do not activate.
Validation: independent source review; 406 runtime, 107 framework/build, 82 Worker and eight eval-runner checks; focused model/process and browser controls for current replies, HTML and JavaScript-only validation failures, normal delivery/export/samples, native Git operations and malformed evidence, coordinates/comments/Retry, runtime edits, detached shadow stages, native editor state, early comments and queued sample intent; all pre-commit hooks. A served triage comparison against ef60582 uses five fewer code requests and 178,115 fewer code bytes before upgrade and presentation, with no browser errors, identical layout shifts and byte-identical settled screenshots. Full CI and automated approval gate the merge.