You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
read contract: report uncommitted records in the working tree, with branch and base #3160
If work in progress lives as uncommitted files in a work branch's working tree (#3158), readers need to see it. Today chant workspace records reads the working tree, but nothing in the read contract says which records are uncommitted, on which branch, or changed since which commit. hud and studio would each have to diff git themselves, which is the kind of second implementation the read contract exists to prevent.
Proposal
records (and status) report, per record, whether it is committed, modified or new in the working tree, and the branch and base commit the working tree is on.
A records --uncommitted filter, with a schema'd document, so a UI can show "kept, not yet applied" from chant alone.
Reader conformance covers the new fields.
Done when
hud's kept-records view and studio's apply.mjs --records read the uncommitted set from chant instead of from git directly.
The contract stays at version 1, and the new fields are added within it the way earlier fields were (#2732, #2688). Each record of a working-tree read in git gets worktree, which is committed, modified or new against HEAD. Staged and unstaged changes count the same, and a rename shows as new plus deleted. The document gets checkout: { branch, head, base, baseFrom, deleted }. base is the merge base of head and the target branch, and the target is found the same way the trust policy's base is (--base, else origin/HEAD, main, master). I chose the merge base over the raw target tip because it is the commit applying the branch is measured against.
records --uncommitted filters to modified and new and sets uncommitted: true. It does not add a separate schema: the records schema requires checkout and the restricted worktree values when uncommitted is true. It refuses --at and --since. Outside git it fails with the existing not-a-git-repository code, so no new reason code was needed. Without --kind, the set has no spec under --uncommitted, because the spec has to be the whole current set.
status --json gets checkout with branch, head, base and baseFrom. It has no per-record list: records --uncommitted is the place to get that.
The reader conformance suite has a new command, records --uncommitted, and the workspace the suite generates leaves one proposed decision (fix-002) uncommitted. createConformanceWorkspace() called directly only adds that decision with uncommitted: true, so tests that allocate ids there are not affected.
Activity
lex00 commentedon Oct 3, 2026
Design as built in #3292.
The contract stays at version 1, and the new fields are added within it the way earlier fields were (#2732, #2688). Each record of a working-tree read in git gets
worktree, which iscommitted,modifiedornewagainst HEAD. Staged and unstaged changes count the same, and a rename shows as new plus deleted. The document getscheckout: { branch, head, base, baseFrom, deleted }.baseis the merge base of head and the target branch, and the target is found the same way the trust policy's base is (--base, else origin/HEAD, main, master). I chose the merge base over the raw target tip because it is the commit applying the branch is measured against.records --uncommittedfilters to modified and new and setsuncommitted: true. It does not add a separate schema: the records schema requirescheckoutand the restrictedworktreevalues whenuncommittedis true. It refuses--atand--since. Outside git it fails with the existingnot-a-git-repositorycode, so no new reason code was needed. Without--kind, the set has nospecunder--uncommitted, because the spec has to be the whole current set.status --jsongetscheckoutwith branch, head, base and baseFrom. It has no per-record list:records --uncommittedis the place to get that.The reader conformance suite has a new command,
records --uncommitted, and the workspace the suite generates leaves one proposed decision (fix-002) uncommitted.createConformanceWorkspace()called directly only adds that decision withuncommitted: true, so tests that allocate ids there are not affected.