Skip to content

fix: read the drawn-visuals digest from the held revision reading in page state - #7181

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-7176
Nov 25, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-7176

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Since #7109, leaf page state opened the active revision's document twice: it got the render reading's digest from read_artifact, which builds a bundle descriptor and reads the document again even though the state read had already read it. The held revision reading carries the same digest (RevisionReading.digest, computed from the manifest, documented as RevisionArtifact.digest), so page_state, the thread part check in thread.py and the handover pass's _live in handover_pass.py, which made the same digest-only call, now take it from read_revision. Nothing changes in what any of them reports.

tests/journeys/test_interact_document.py::test_a_state_read_never_materializes_a_revision_bundle fails on main (assert 2 == 1 at line 781) and passes with this change; tests/model/test_interact_anchors.py and tests/model/test_handover_pass.py pass too.

Closes #7176 — automated triage

`leaf page state` and a thread's part check passed `drawn_visuals` the
digest from `read_artifact`, which reads the revision's document again to
build a bundle descriptor. The held revision reading already carries the
same digest (`RevisionReading.digest`, from the manifest), so a state read
opens the active revision's document once again, as
`test_a_state_read_never_materializes_a_revision_bundle` requires.

Closes #7176

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The same digest-only read is left in _live in src/leaf/handover_pass.py, return revision, read_artifact(page_dir, revision).digest. It builds the whole bundle descriptor, the active revision's HTML included, only to get the manifest digest that read_revision(page_dir, revision).digest already holds. _live runs on every handover check and on _unread, so this is the one remaining caller of the pattern this PR removes. I'll push the same change there.

… the handover pass

`_live` read the whole bundle descriptor, the active revision's HTML included,
only for the manifest digest the held revision reading already carries.
Nothing changes in what the handover pass reports.
@max-sixty
max-sixty merged commit 9c7abe6 into main Nov 25, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/issue-7176 branch November 25, 2026 18:28
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.

test_a_state_read_never_materializes_a_revision_bundle: page state reads the active revision twice since #7109

2 participants