Repository navigation
Render native Git file operations as commentable evidence - #2685
Merged
Merged
Conversation
Preserve operation metadata and deferred Git evidence in one manifest shape, including metadata-only files and same-path file-type replacements. Judge evidence in the widget, keep copy preimages unambiguous, and defer the shared Pierre renderer until text opens.
leaf-agent
reviewed
Oct 12, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
A collapsed textual file can show a commentable operation label before its Git evidence is checked. In render(), only zero-hunk or open records reach prepareEntry; a closed record can therefore say “copied” (or show binary/mode metadata and counts) even if its deferred patch describes a different operation. deferredFile() detects that mismatch only on disclosure, so a reader can comment on false metadata without ever seeing a refusal. This contradicts the producer contract’s promise that metadata is checked before its row appears. The manifest needs an eager evidence slice for the row’s metadata, validated before the row commits, while the textual hunks can stay deferred.
leaf-agent
previously approved these changes
Oct 12, 2026
leaf-agent
approved these changes
Oct 12, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 13, 2026
The [main CI run](https://github.com/max-sixty/leaf/actions/runs/38325751994) fails three diff browser cases because their fixtures and request expectations predate #2685's patch validation. The fallback fixture now supplies a complete Git section, and the hunk test checks that disclosure reuses parsed evidence without another request. The held-request navigation case is removed: the exact patch is loaded before its CallDiff link appears, so its route cannot hold the request it claimed to test. Both retained failing node IDs failed on current `main` before this change and pass afterward with `uv run pytest -q -n0` (2 passed). `git diff --check` passed. This changes test coverage only; the diff widget's behavior is unchanged. Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 13, 2026
A reply can carry a widget introduced after the page a reader has pinned, or use a different meaning of an existing widget. Previously, every pinned page had to accept that markup and one globally registered implementation rendered all revisions. Each page and frozen message now retains its own widget publication: declarations, constructors, private modules, styles, initial drawings and recorded command meaning. Decisions and asks keep their captured meaning while the reader changes page versions. The document still runs one current Leaf kernel and one instance of shared runtime/vendor libraries. Publication-addressed widget resources and scoped custom-element registries isolate their implementations. Samples preserve those identities, including generated children; served pages, captured exports and Worker delivery follow the same resource ownership. Classic initial drawings remain classic scripts outside the module graph. Shared reaction chrome follows the viewed document. Registry-declared widgets now default-export a constructor; Leaf owns registration. Generated child widgets use `createWidgetElement(owner, tag, Constructor)`, and `layerFact(owner, name)` reads the owning publication. All maintained widgets, authoring examples, public references and callers are converted together. Removing the old registration wrapper outdents class bodies by two spaces and accounts for most raw changed lines; the loader and all maintained widget callers move to this registration contract together. Independent survey fixes landed first in [#2672](#2672) (preview producer), [#2673](#2673) (preparation lifetime), [#2679](#2679) (deferred presence), [#2680](#2680) (annotation seats), [#2683](#2683) (preview shutdown), and [#2685](#2685) (native Git evidence). This PR now contains only the publication migration and its integration proof: 228 files, +17,248/−14,329 lines; ignoring whitespace leaves +5,052/−2,133 (77% of raw changed lines disappear). Validation exercises different meanings of the same tag, new reply widgets in old pinned pages, captured actions and undo, generated sample children, classic initial drawings, private-module/shared-runtime identity, and historical offline exports with zero external requests. Independent readers used desktop, keyboard and phone interactions. The last browser-startup source caac297 served triage comparison against maina3a139255 adds four code requests and 19,133 code bytes before presentation; both arms have no browser errors, identical layout shifts and byte-identical settled screenshots. The current integrated source passes 108 framework/build checks, 410 runtime tests, the complete lint gate and focused model/browser contrasts. Earlier source-specific proof includes 82 Worker and eight eval-runner checks; the integrated 51310e7 build passes all 105 site pages and three public Worker startup checks against main250595204. Its product/triage add about 4.7 KB with unchanged code request counts, while the frozen gallery adds 94,125 code bytes for its captured registry, scoped styles and separately addressed constructors. Layout shifts are identical in each pair. Integration with main3a7414145 preserves the upgraded commenting interface while private history loads. Local comments now paint through the canonical publication presenter in that waiting phase; existing early-send, arrival and refusal controls pass. Sample conversation selection captures intent when its command arrives, before waiting for child history, and carries it through both canonical destinations. Four held-child contrasts verify ordinary page/panel selection and cancellation after newer child typing. Structured admission and source refusals now preserve canonical finding codes through the publication-specific callers; seven focused model/process controls cover captured commands, retired captures, approval and quiet hooks. The subsequent CLI JSON integration also passes five reply/refusal controls and the complete-publication atomicity control; the constructor and browser runtime source is unchanged. The newly merged late-shadow usability fixture also uses the constructor export; its unchanged browser assertions pass. The scoped-registry vendoring adapter forwards native retained-move callbacks; the unchanged composer selection assertion and five lifecycle/browser contrasts pass. Broad CI exposed eager page-parser imports in the quiet Codex hook. Reserved revision identities now stay lightweight, while content reads use the unchanged canonical capture validator. Quiet/pending hook paths and seven incomplete/obsolete/duplicate capture controls pass. Ten other failures were outdated fixtures for complete captures, captured replies, native Git headers, scoped child creation, split widget styles, structured findings and the ask API; all eleven original failures pass locally with their behavioral assertions preserved. Final exact-head Linux CI passes the broad Python suite, complete website lifecycle including dormant reads and wake/restore/write, all bundle/runtime/Worker/eval assertions, pre-commit, website build and bundled-release Chrome measurement. The fresh automated review approves 80d3708 with no findings. [Final CI run](https://github.com/max-sixty/leaf/actions/runs/38334710468). The main risk is a constructor-timing or generated-child caller missed by the focused contrasts. The scoped-registry dependency and the across-corpus API cutover are the architectural cost of removing the old pinned-page vocabulary restriction. > _This was written by Codex on behalf of max-sixty_
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.
Native Git copies, binary changes, mode changes, empty files, and file-type replacements now appear as reviewable evidence in
lf-diff. Authors can pass the patch throughpatch_manifest.pywithout rewriting its metadata into prose. The producer records native operation metadata and deferred evidence; the widget validates that evidence with Pierre and rejects inconsistent manifests. Metadata-only changes have commentable file rows, textual changes retain line comments, and a file-type replacement keeps one logical file identity. Copy preimages detach when more than one destination could own the old coordinate.Every file's complete Git patch is delivered and parsed before its listing metadata appears, including closed textual files: a header slice cannot establish the displayed counts or whether its hunks are complete. The entry retains that one parsed file; syntax, Pierre SSR, and textual DOM wait for disclosure. Network failures retain an explicit Retry route, while inconsistent evidence shows its refusal without unverified operation, count, mode, or source-path labels. Opening a refusal programmatically cannot trigger another request as though the user reopened it.
A single Pierre build graph exposes parser and renderer facades sharing implementation. The parser closure remains 26,606 bytes; the earlier parser-split comparison avoided 334,087 bytes of renderer work before presentation. Paired measurements of this repair against the prior PR head (
22ade43d) show its transport cost: the closed two-file fixture adds one request and 2,056 total bytes (including 1,760 code bytes); the 14-operation native fixture adds six requests and 4,140 bytes. A diagnostic 100-file manifest with 100 changed lines per file adds 103 total requests and 367,912 bytes before presentation. All retain zero drawn source lines and defer the textual renderer. Full-patch delivery scales with the manifest; that cost establishes the native listing's truth before the user sees it.Validation passed: