Skip to content

fix(artifacts): prevent stale verifier evidence after scan - #331

Merged
pengfei-threemoonslab merged 2 commits into
mainfrom
codex/issue-317-artifact-lifecycle
Aug 7, 2026
Merged

fix(artifacts): prevent stale verifier evidence after scan#331
pengfei-threemoonslab merged 2 commits into
mainfrom
codex/issue-317-artifact-lifecycle

Conversation

@pengfei-threemoonslab

@pengfei-threemoonslab pengfei-threemoonslab commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • treat the complete verifier control/identity surface as one lifecycle set when a standalone scan replaces a report
  • remove stale verifier.json, handoff, PR comment, run projection, verification inputs, identity artifacts, receipt, and copied authorization before publishing the new report
  • fail closed before replacing report.json when any stale verifier artifact cannot be removed, with an exact-path structured recovery action
  • run baseline save's supporting scan in an isolated temporary directory so it cannot clobber the current report or forensic verifier evidence
  • document command-scoped artifact authority, add the CHANGELOG entry, and regenerate llms-full.txt

Root cause

The original lifecycle set removed the terminal receipt and handoff but retained route-bearing surfaces such as verifier.json, verify-run.json, and pr-comment.md. That could leave a fresh standalone report.json beside an older actionable verifier route while deleting the receipt that made the mismatch detectable.

Separately, baseline save invoked run_scan without an explicit output directory. Its internal scan therefore used the manifest's normal reports directory, replacing report.json and triggering verifier cleanup even though the command only needed the in-memory report.

Impact

A standalone scan now retires all 11 verifier route/identity artifacts before publishing a replacement report. No stale control substrate or downstream feedback route survives beside a newer release decision. If cleanup is denied, the existing report remains untouched and agent mode names the exact file to remove.

baseline save now writes only the requested baseline/audit outputs; an existing verification receipt, handoff, verifier substrate, run projection, PR comment, inputs, and report remain byte-identical.

Validation

  • focused regressions for scan cleanup, fail-closed recovery, preview → init → scan, baseline preservation, and verify rewrite ordering: passed
  • full affected modules (test_scan.py, test_init_auto.py, test_cli.py, test_verify_orchestrator.py, test_baseline_integrity.py): 167 passed
  • full repository suite: all non-packaging tests passed; the packaging fixture's isolated dependency install was blocked by the network sandbox, then all 8 packaging tests passed with package-index access
  • Ruff checks for all modified Python files: passed
  • git diff --check: passed
  • Agents Shipgate committed-ref verify: control.state=complete, merge_verdict=mergeable, release decision passed, 0 blockers, 0 review items
  • terminal verification receipt reproduced successfully

Closes #317

@pengfei-threemoonslab pengfei-threemoonslab changed the title fix(artifacts): prevent stale verifier handoff after scan fix(artifacts): prevent stale verifier evidence after scan Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(artifacts): prevent a prior verifier handoff from surviving a later scan

1 participant