fix(gateway): evidence/QA/doc paths populate files_changed from git

Bug:
    ContentActions.evidence() hard-coded files_changed=[] and diffed
    against HEAD~1 instead of the branch's parent. QA's _build_qa_claim_
    evidence (and doc/_impl mirrors) sourced files_changed from
    work_session.files_modified, which the gateway commit() never
    populates (no add_files_modified plumbing). Result: QA / docs / PM
    reviewers saw an empty change list on real PRs and only the latest
    commit's delta — flagged in smoke-9 when PR #20 showed the README
    change on GitHub but evidence() reported empty.

Fix:
    Added GitService.list_changed_files (git diff --name-only against
    parent branch). evidence(), _build_qa_claim_evidence,
    _claim_doc_evidence, and _build_i_am_done_ok all source files_changed
    from this — git is the authoritative source. evidence() also drops
    the HEAD~1 base so the diff is the full PR.

    Wired EvidenceRepo into ContentActionsDeps so evidence() returns
    journal_highlights too, matching the QA/doc shape.
This commit is contained in:
Renn F
2026-05-15 06:31:38 +02:00
parent d5ff8c7b13
commit 4fdde2b082
13 changed files with 294 additions and 18 deletions
+1 -1
View File
@@ -78,9 +78,9 @@ async def test_claim_review_returns_evidence_inline() -> None:
task_svc.list_paused_for_agent.return_value = []
task_svc.qa_claim.return_value = t_claimed
work_svc = AsyncMock()
work_svc.files_changed.return_value = ["README.md"]
git_svc = AsyncMock()
git_svc.diff.return_value = "+++ diff content"
git_svc.list_changed_files.return_value = ["README.md"]
deps = _make_deps(task=task_svc, work_session=work_svc, git=git_svc)
c = Choreographer(deps)