Require explicit worktree and cwd proof for PR review validation commands #398

Closed
opened 2026-07-07 09:28:52 -05:00 by jcwalker3 · 1 comment
Owner

Problem:
Reviewer final reports can claim validation ran in the PR review worktree even when the visible command transcript does not prove the command working directory. This creates a risk that tests or diffs were run against master, the main checkout, or a stale worktree while the report claims the PR head was validated.

Observed example:
A PR #376 review/merge report created branches/review-feat-issue-308-reconcile-inventory-pagination and pinned head f5953549aad5e822f14f52d3ea3c6d7990109384. It later claimed targeted and full tests ran in that review worktree. However, the visible commands did not consistently show git -C branches/..., explicit working directory, or pwd proof before validation commands.

Required behavior:
Every PR review validation command must explicitly prove the target worktree path and checked-out SHA immediately before running validation.

Acceptance criteria:

  1. Before any diff/test/compile validation, reviewer must record:

    • pwd or explicit command working directory,
    • git rev-parse HEAD,
    • git status --short --branch,
    • expected PR head SHA.
  2. Validation commands must use one of:

    • git -C <review_worktree> ...,
    • cd <review_worktree> && ... in the same command,
    • tool-provided explicit working directory metadata.
  3. Final report must include exact validation command, cwd/worktree, and observed HEAD SHA.

  4. gitea_dry_run_pr_review or final-report validator rejects reports that claim review-worktree validation without cwd/HEAD proof.

  5. Baseline validation must follow the same rule:

    • baseline worktree path,
    • baseline target SHA,
    • cwd proof,
    • exact baseline validation command,
    • baseline result.
  6. Cleanup claims must include final worktree-list proof or equivalent.

  7. Tests cover:

    • validation command without cwd proof,
    • validation command run from main checkout,
    • validation command with wrong HEAD,
    • baseline validation without baseline cwd proof,
    • fully proof-backed validation report.
  8. Documentation updates the review-merge workflow template.

Non-goals:

  • Do not block valid PRs with complete worktree proof.
  • Do not weaken reviewer identity, author-safety, or merge capability gates.
  • Do not allow inferred shell cwd as proof.
Problem: Reviewer final reports can claim validation ran in the PR review worktree even when the visible command transcript does not prove the command working directory. This creates a risk that tests or diffs were run against `master`, the main checkout, or a stale worktree while the report claims the PR head was validated. Observed example: A PR #376 review/merge report created `branches/review-feat-issue-308-reconcile-inventory-pagination` and pinned head `f5953549aad5e822f14f52d3ea3c6d7990109384`. It later claimed targeted and full tests ran in that review worktree. However, the visible commands did not consistently show `git -C branches/...`, explicit working directory, or `pwd` proof before validation commands. Required behavior: Every PR review validation command must explicitly prove the target worktree path and checked-out SHA immediately before running validation. Acceptance criteria: 1. Before any diff/test/compile validation, reviewer must record: * `pwd` or explicit command working directory, * `git rev-parse HEAD`, * `git status --short --branch`, * expected PR head SHA. 2. Validation commands must use one of: * `git -C <review_worktree> ...`, * `cd <review_worktree> && ...` in the same command, * tool-provided explicit working directory metadata. 3. Final report must include exact validation command, cwd/worktree, and observed HEAD SHA. 4. `gitea_dry_run_pr_review` or final-report validator rejects reports that claim review-worktree validation without cwd/HEAD proof. 5. Baseline validation must follow the same rule: * baseline worktree path, * baseline target SHA, * cwd proof, * exact baseline validation command, * baseline result. 6. Cleanup claims must include final worktree-list proof or equivalent. 7. Tests cover: * validation command without cwd proof, * validation command run from main checkout, * validation command with wrong HEAD, * baseline validation without baseline cwd proof, * fully proof-backed validation report. 8. Documentation updates the review-merge workflow template. Non-goals: * Do not block valid PRs with complete worktree proof. * Do not weaken reviewer identity, author-safety, or merge capability gates. * Do not allow inferred shell cwd as proof.
jcwalker3 added the status:in-progress label 2026-07-07 10:27:07 -05:00
Author
Owner

Issue claim heartbeat

<!-- gitea-issue-claim-heartbeat:v1 --> **Issue claim heartbeat** - kind: claim - issue: #398 - branch: feat/issue-398-validation-cwd-proof - phase: claimed - profile: prgs-author - pr: none - blocker: none - next_action: create worktree and begin implementation
sysadmin removed the status:in-progress label 2026-07-08 02:09:13 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#398