Repository navigation
Give projected data explicit subject identity - #1184
Merged
Merged
Conversation
Use declared records.key identity for data anchors while keeping other projected keys bound to their source revision. Preserve keyed drafts and reaction identity when the record moves or changes text. Cover the behavior in a browser regression and document the anchor contract.
Separate render reconciliation keys from durable subjects. Let producers identify records across source replacements, keep positional data revision scoped, and resolve anchors by subject within section and source. Cover changing keys and missing worktree evidence in browser regressions.
leaf-agent
reviewed
Sep 25, 2026
leaf-agent
approved these changes
Sep 26, 2026
max-sixty
pushed a commit
that referenced
this pull request
Sep 26, 2026
The nightly visual review journey expected a comment anchor without `identity` and expected its thread to become “Earlier data” after the source changed. #1184 made visual review case IDs stable subject identities, so the emitted anchor now includes that ID and the thread stays attached. This updates both assertions to the current contract. The [failed nightly run](https://github.com/max-sixty/leaf/actions/runs/36216495039) reported the extra `identity` field. The focused test reproduced that failure locally, then exposed the outdated thread expectation after the first assertion was corrected. `uv run pytest tests/test_render_visual_review_journey.py -q -n0` now passes (2 tests). --------- Co-authored-by: leaf-agent <[email protected]>
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.
Projected data previously used the source revision as part of every comment location. That made a comment on a stable row appear outdated whenever its source was replaced. The first fix inferred durable identity from a
records.keydeclaration, but that declaration describes only one input shape and cannot distinguish a rendering key from the subject it represents.projectDatanow acceptsidentify(record, index)when a producer can name a subject across replacements. The rendering key continues to reconcile nodes; the anchor records the subject identity and the source revision observed by the user. Resolution and reaction matching use identity within the section and source, while locations such as diff lines remain revision scoped. The shipped row, visual case, pull request, and worktree producers declare identity where their contracts support it. A missing worktree placeholder does not claim the worktree's identity, and producer guidance requires a new authored ID for a replacement worktree. The owning code marks this identity contract experimental and open to change as more producers use it.Browser regressions cover a subject whose rendering key changes, comment/reaction/draft continuity, revision scoped data, and worktree evidence disappearing and returning. Local checks passed: 1,416 everyday tests on the original reviewed head. After integrating current
main, 99 startup browser tests, 158 projection browser tests, 125 runtime tests, and pre-commit passed.Closes #1146