Skip to content

Give projected data explicit subject identity - #1184

Merged
max-sixty merged 6 commits into
mainfrom
codex/projected-data-identity
Sep 26, 2026
Merged

max-sixty merged 6 commits into
mainfrom
codex/projected-data-identity

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

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.key declaration, but that declaration describes only one input shape and cannot distinguish a rendering key from the subject it represents.

projectData now accepts identify(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

This was written by Codex on behalf of max-sixty

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

Open PR #1183 also closes #1146 and changes the same projection and anchor paths with a different identity contract. If this explicit identify contract is the chosen fix, close #1183 before merging so the two proposals do not land competing behavior.

@max-sixty
max-sixty merged commit 61e6d1a into main Sep 26, 2026
5 checks passed
@max-sixty
max-sixty deleted the codex/projected-data-identity branch September 26, 2026 02:43
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]>
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.

A thread on a keyed datum falls out of its row whenever the source is replaced

2 participants