TAL-2646: Read a branch's committed changes through git status and diff scope #2156
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.47) × (1 − Review Confidence (0.25)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 481 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 32% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.370
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2156"
general
weight: 0.35
chatgpt-codex-connector[bot]
Linked work
TAL-2646 (server part; App adoption is TAL-2008)
What changed
After an agent commits its work, the Git status read a clean tree and the server had no way to read what the branch committed.
git.statusandgit.difftakescope: 'uncommitted' | 'branch'. Omitting it (oruncommitted) runs today's read unchanged, cache included.branch(GitRunner.branchStatus) finds the first ref that exists oforigin/HEAD,origin/main,origin/master,main,masterin onefor-each-ref, takes its merge base with HEAD, and listsbase...HEADfile by file (--name-status+--numstat, renames detected). Each file has its status,change_kind, line counts anddiff_kind: 'branch'; the response addsbase_ref(origin/HEADis named by the branch it points at) anddetached. With no base, or no shared history, it answersbase_ref: nulland no files.git.diffwithscope=branch(orkind=branch) returns the merge-base-to-HEAD diff for the file, empty without a base.summarizeFileshelper shared by both reads.GitScopeSchema, optionaldetached/base_refonGitStatusSchema,diff_kindgainsbranch.contracts/web-api.openapi.jsonregenerated; new shared fixturecontracts/fixtures/git-branch-status.jsonis pinned by the server test that produces it (App tests in TAL-2008 read it).How it was tested
npx vitest run src/workspace/git.test.ts(server): 41 passed, including the 4 newbranch scope (TAL-2646)tests on disposable repos: two branch commits equal the fixture (base_ref: origin/mainvia a symbolicorigin/HEAD) while the default scope on the same clean tree still returns no files and nobase_ref/detached; branch diff of a committed file; detached HEAD; no candidate base givesbase_ref: nulland empty files.session-visibility.test.tsandworktrees.test.ts: 76 passed.npm run typecheck(contracts, server, frontend) andnpm run lint(contracts, server, frontend) pass.scripts/changed-components.py --base origin/main --head HEAD --merge-baseselects contracts, web_server, web_frontend, web_sidecar; no App, Relay or Docker suite.Regression proof
4f4fe37f63e8740d57bf90cee3aeca7a2fa0bc84with only the new tests and fixture applied.cd web/packages/server && npx vitest run src/workspace/git.test.ts -t 'branch scope'lists what a clean branch committed…:expected { is_git: true, …(8) } to deeply equal { is_git: true, …(6) }with- "base_ref": "origin/main",- "files": [ { "path": "feature.txt", … "diff_kind": "branch" …(the server returned the clean-tree status);diffs a committed file…:- "additions": 1 / + "additions": 0,- "kind": "branch" / + "kind": "unstaged";reports a detached HEAD:- "detached": true,- "changed": 2 / + "changed": 0;answers no base…:- "base_ref": null.Release notes
changelog.d/TAL-2646.json: Added, components["web"],announce: false(server API only; the visible Git sheet change ships with TAL-2008).Checklist
python3 app/ci/release_notes.py validate --base origin/mainafter staging)Codablemodels decode tolerantly (no App model change; new fields are optional)web/packages/contracts)Risk: low. The uncommitted path only moved its sort and totals into a shared helper. Rollback: revert the commit.