Conversation
3ff4d71 to
a647022
Compare
tt-a1i
left a comment
There was a problem hiding this comment.
审查提交:a64702220cda33bf0267d002fe4f08c3d6f38953。
需要修改后再合并。
具体问题
P2 — 重命名只比较新路径,展示为整文件新增 · web/host/workspace-changes.ts:212
Exact-head real-Git repro git mv old.txt new.txt without content edits returns status renamed but additions=2/deletions=0 and /dev/null new-file diff. previousPath is parsed but omitted from diff and numstat pathspecs.
P2 — 只读改动查看会执行 textconv 命令 · web/host/workspace-changes.ts:207
Exact-head real-Git repro configures diff.audit.textconv='sh .git/textconv.sh' and *.txt diff=audit; loadWorkspaceChanges executes it and writes .git/audit-marker. --no-ext-diff does not disable textconv. Route validates session/workspace identity but has no trust/execution admission check.
验证范围
Full production/test diff reviewed; 41 Node tests and 45 UI tests pass. Independent real-Git rename and textconv reproduction saved in repro.mts/repro.log.
限制与后续
No browser layout acceptance. Textconv repro uses explicit local Git config, not a claim that a fresh clone can inject config. Baseline HEAD can move during sequential per-file reads; not independently reproduced.
Problem
The Web UI does not expose the current Session workspace's Git changes, so users cannot review modified, deleted, untracked, or binary files from the active workspace. Closes #536.
Value
Users can understand workspace state and inspect bounded file-level diffs without leaving the Web UI. The view is read-only and scoped to the active Session.
Approach
GET /api/workspace-changesendpoint that discovers the repository, compares against the currentHEAD(or the empty tree when there is noHEAD), and computes bounded per-file diffs.mainatf6b49ae59605b1276b8267f2886d22c03f01533c; final candidate SHA isa64702220cda33bf0267d002fe4f08c3d6f38953.Validation
node --test --experimental-strip-types tests/web/workspace-changes.test.ts— 2 passed.node --test --experimental-strip-types --test-name-pattern="Session-bound workspace changes" tests/web/web-host.test.ts— 1 passed.bunx vitest run tests/web/app-render.spec.ts tests/web/web-store.spec.ts tests/web/web-protocol.spec.ts— 159 passed.bun run check— passed: contracts, UI/root type checks, format, lint, and production Web build.bun run test:web:e2e— 33 passed, 1 failed in the pre-existing delayed workspace-creation receipt test; the target unknown-admission test passed at the final SHA. The original CI failure (Response has been disposedin that target test) was reproduced from the recorded CI log, but not locally; the same target test passed 30 times on the PR head and 10 times on its parent.bun run test— 1,564 tests reported, 1,554 passed, 0 test-level failures, 10 skipped; the runner also reported the unrelated optional background-terminal deadline process-tree failure. The full suite is therefore not a clean green gate.Impact