Skip to content

Permit unreferenced IDs to leave revisions - #73

Merged
max-sixty merged 15 commits into
mainfrom
codex/drop-protected-ids
Aug 27, 2026
Merged

max-sixty merged 15 commits into
mainfrom
codex/drop-protected-ids

Conversation

@max-sixty

@max-sixty max-sixty commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Let unreferenced IDs and item widgets leave a revision, while reporting those removals as advice.
  • Protect IDs still needed by unresolved anchors, canonical standing actions, effective standing reports, and explicit widget retirement.
  • Keep visual-part survival independent and add focused acceptance coverage for both reported cases and the standing-state boundaries.

Testing

  • pre-commit run --all-files
  • uv run pytest tests (641 passed, 1 skipped)

Closes #43

Closes #67

Thanks to @max-sixty for reporting these cases in #43 and #67.

This was written by Codex on behalf of max-sixty

@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.

protected_ids reads well — it keeps the whole answer inside the projection, the advice tier lands where #67 asked for it, and each new acceptance test drives its boundary from both sides. Two things, one of which I think is a real hole.

Reports lose the detail ids that actions keep. state_ids.update(...) unions action_rests_on over projection.actions only, so a standing report's record can name a page element the next version drops. Inline below, with a repro.

Visual parts kept the blanket rule. The neighbouring check in checking.py — the one that reports visual parts present in revision r{predecessor} but dropped in index.html (anchors on them will break) — still refuses every dropped part whose section survived, with no reading of whether anything anchors it. That is #67's complaint one grain down: an lf-chart series or an lf-shot region that no thread points at is as unremovable now as an unanchored id was before this PR, and anchored_ids returns only anchor.section, so nothing in the codebase can currently answer "is this part anchored". I read the PR summary's "keep visual-part survival independent" as a deliberate scope line rather than an oversight, so this is a question and not a request: is the part half meant to stay strict, or is it a follow-up?

@max-sixty

max-sixty commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner Author

Visual-part survival remains intentionally strict and independent in this PR, matching the accepted scope for #43 and #67; the existing visual-part acceptance test remains the control for that boundary.

This was written by Codex on behalf of max-sixty

@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.

ab629b5 settles the docstring half — "keeps its owner and fold unit, plus every page id its canonical liveness reading rests on" now covers both channels, which is what the widened union does. One thing left, inline: the new regression passes just as well against a naive reports | actions, so the sentence desired exists to make true — an outranked report stops pinning its detail ids — is asserted nowhere.

I confirmed that behaviour by hand on e5e32a3: with a move report to c-later outranked by a reader move to c-done, dropping c-later exits 0 with · ids dropped from revision r1: ['c-later']. test_interact_document.py, test_interact_contract.py and test_interact_product.py are green there too — 329 passed; ab629b5 is prose-only on top of that.

I also poked the neighbouring case, since the wider union now reaches into report territory: a version that spends overruled on the unit and drops the id the report names is refused, while the two-version route — overrule, stamp, then drop — works. That reads as report_errors's own standing-until-stamped rule rather than a defect; noting it only because it is the sharpest edge the change touches.

Comment thread tests/test_interact_document.py Resolved
leaf-agent and others added 2 commits August 27, 2026 09:08
The render gate used to reach /api/state behind a networkidle navigation,
which waited out the page's first poll and the append that rode on it. The
news stream leaves the network never idle, so the gate now navigates on
load and can reach /api/state while the page's first read is still in
flight — whereupon it counts an empty log, waits for nothing, and reads a
page 120px mid-move. That is what CI reported at run 33053132232.

The window this test constructs is now stated on both sides: the action
still goes in behind the page's first read, and the gate's own read is
held until it has. A 0.4s delay on the page's read reproduces the CI
failure exactly on the old test and passes on the new one at 2s, so the
ordering is an arrangement rather than a margin.

The premise assertion moves ahead of the gate's verdict, since a window
that never opened makes that verdict say nothing.

@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.

The push since my last read is #75's two commits plus a merge of main; that content landed as 44d1ac7, so against today's main the effective diff is back to the same six files. Nothing new to review there. One leftover from those six, outside the diff.

docs/how-it-works.html quotes the check's success line verbatim in its <pre id="loop-transcript"> block — the one introduced as "The output below is a real page's" — and still carries the pre-PR wording:

$ leaf version check ./review
✓ index.html: parses, widgets validate, one module script + theme link, ids and decisions carried over, nothing overflows the 720px column

cmd_check now prints protected ids and decisions carried over. Confirmed at this head by running the check on a shipped example:

$ uv run python plugins/leaf/skills/leaf/scripts/interact.py version check <page>
✓ index.html: parses, widgets validate, one module script + theme link, protected ids and decisions carried over, nothing overflows the 720px column

publish-site.yaml deploys docs/, so as it stands the site would publish a transcript the tool no longer produces — and it's the page that reads as the tool's own voice. Nothing under tests/ pins that block, so the suite stays green either way, which is why it hasn't shown up as a failure. Happy to push the one-line fix if you'd rather not hand-apply it.

@max-sixty

Copy link
Copy Markdown
Owner Author

Updated the transcript in 7ab9232 and added a causal product-page assertion in c34ea8f that runs leaf version check and requires the real success line to appear in the published transcript. The complete local suite passes with 642 tests and one skip.

This was written by Codex on behalf of max-sixty

@max-sixty
max-sixty merged commit b0633bb into main Aug 27, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/drop-protected-ids branch August 27, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants