Skip to content

Render native Git file operations as commentable evidence - #2685

Merged
max-sixty merged 3 commits into
mainfrom
codex/guidance-preparation-attribution
Oct 12, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/guidance-preparation-attribution

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

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 through patch_manifest.py without 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:

  • 30 focused model cases, including native capture, deferred metadata, and malformed evidence; the shipped parser also agrees with all 23 accepted/refused patch-table cases and all 14 native fixture operations; six corrupt listing fields are refused while their textual files remain closed.
  • Nineteen final browser cases cover closed corrupt-field refusal, valid copied rows without eager SSR, network retry and focus, exact-line travel by mouse and keyboard, cancellation, source replacement, provenance, native rows at desktop and mobile sizes, accepted/refused patches, captured offline export, shared syntax rendering, source-refresh provenance, and stale selection restoration with cancellation. The delayed-navigation controls hold textual preparation after evidence admission; refreshed fixture counts match their patch. Earlier focused checks cover copy/rename coordinate ownership, failed hydration, stable commentable rows, print layout, and draft retention across refusal.
  • 381 runtime tests, 105 framework/build tests, committed browser bundle consistency, and pinned Ruff, Prettier, and ESLint checks.
  • Paired served previews and an independent rendered-reader task verify posted mode, binary, copy, rename, and edited-copy line comments, including filtering, reopening, keyboard disclosure, and dark phone touch input; posted anchors retain their file and line ownership. The closed two-file and 100-file comparisons have no layout shifts; the native fixture retains the same small count-label adjustment in both arms. Its paired screenshots are byte-identical.

This was written by Codex on behalf of max-sixty

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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
leaf-agent previously approved these changes Oct 12, 2026
@max-sixty
max-sixty merged commit e09a847 into main Oct 12, 2026
3 checks passed
@max-sixty
max-sixty deleted the codex/guidance-preparation-attribution branch October 12, 2026 23:53
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_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants