Skip to content

fix: confine compare-evidence output to the successor private artifact root - #178

Merged
Nagi-Inaba merged 2 commits into
mainfrom
agent/compare-evidence
Oct 19, 2026
Merged

Nagi-Inaba merged 2 commits into
mainfrom
agent/compare-evidence

Conversation

@Nagi-Inaba

Copy link
Copy Markdown
Owner

Problem

compare-evidence wrote its result wherever --output pointed; it only checked that the path was new. Its siblings compare-runs and compare-targets confine the output to the successor run's private artifact root. The comparison is derived from private run evidence, so it should not land outside that root.

Change

  • compare-audit-evidence.mjs now applies the same insidePrivateRoot check as the siblings (same error text), rooted at the validated --after run's artifact root. The check runs after both runs validate, so a rejected path no longer creates parent directories first. The new-file-only guarantee and the post-validation stability re-checks are unchanged. There are now three copies of this small helper; they were left separate on purpose rather than refactoring the siblings here.
  • The saved-evidence.md example and the command usage line in cli-command-registry.mjs use a path inside the after-run artifact root; docs/cli-reference.md is regenerated.
  • tests/run-evidence.test.mjs: the comparison test writes inside the artifact root and checks that it does not overwrite; a new test covers three outside paths and checks that nothing is written.
  • CHANGELOG entry (Changed), because scripts that wrote the comparison elsewhere must change --output.

Verification

  • node --test tests/run-evidence.test.mjs tests/cli-reference.test.mjs: 13 pass, 0 fail
  • node scripts/build-cli-reference.mjs --check: PASS (30 commands)
  • node scripts/verify-all.mjs passed on the combined branch of all four fixes (95 test files, Windows / Node.js 24.19.0); remote CI runs it here
  • Codex / Claude parity: sync-distributions --write followed by --check is clean

Compatibility

  • Schema/profile/procedure version impact: none
  • Migration required: yes for scripts that pass compare-evidence --output outside the --after run's private artifact root; point it inside that root
  • CHANGELOG updated

Security and privacy

  • No credentials, private URLs, local paths, or real audit evidence are included
  • Public-report/privacy boundaries are unchanged (the change narrows where private comparison output may be written)
  • Release preparation, publication and remote CI results are reported separately

Issue

Part of the 2026-10-19 review fixes (P10 in the internal review). Closes no issue.

🤖 Generated with Claude Code

Nagi-Inaba and others added 2 commits October 19, 2026 14:01
…t root

compare-runs and compare-targets already reject outputs outside the after-run artifact root, but compare-evidence wrote wherever --output pointed. Apply the same check after both runs validate, so a rejected output no longer creates parent directories first. The saved-evidence example and the usage line now use a path inside the after-run artifact root.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T11:16:55.817845Z 41e4bc4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Nagi-Inaba
Nagi-Inaba merged commit 8b31670 into main Oct 19, 2026
6 checks passed
@github-actions
github-actions Bot deleted the agent/compare-evidence branch October 19, 2026 11:22
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.

1 participant