export-safety: scope history mode to the local clone and add a triage note - #71
Merged
Merged
Conversation
… note History mode walks every ref in the local clone, so a clone retaining pre-rewrite refs fails the gate even when the canonical remote is clean. Four contributor-facing surfaces instructed running the gate locally and escalating under SECURITY.md on failure with no warning about that scope, steering contributors on a stale clone into a false private advisory. Document the scope rule and add an advisory triage note. The note is purely additive: no violation is suppressed, the exit code and the RESULT line are unchanged, no network call is made, and no ref names or counts are emitted. It stays silent whenever the active tree is contaminated, so present-state findings are never accompanied by a reassuring signal, and its wording names current-candidate contamination alongside the benign explanation rather than clearing any remote. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--historywalks every ref reachable in the local clone, not live remote state. A clone that retains pre-rewrite refs therefore fails the gate even when the canonical remote is clean.Four contributor-facing surfaces instructed running the gate locally and, on failure, escalating under
SECURITY.md— with no warning about that scope. A contributor on a pre-rewrite clone was steered into filing a false private security advisory. This documents the scope rule and adds an advisory triage note to the gate itself.Investigation detail (this repository's published history is not implicated): a disposable full clone of the canonical remote passes
--active-tree --historyat the snapshot checked (origin/main6c3073e, tags v4.2.0–v4.5.1), and release run 30212936289 loggedRESULT: SAFE FOR REQUESTED PUBLIC EXPORT CHECKS. Per the wording rule this PR adds, that is evidence about the recorded snapshot only — not clearance of any failing clone.Boundary declaration
The new test deliberately reuses the already-allowlisted
codex_exec.pyliteral rather than embedding a fresh credential pattern, soHARMLESS_AUDIT_LITERALSis not widened.Generated and release surfaces
SKILL.mdfiles are in parity.changelog.d/fragment is present; generatedCHANGELOG.mduntouched.Verification
python3 scripts/build_skills.py --check— OKpython3 scripts/build_marketplace.py --check— OKpython3 scripts/build-changelog.py --dry-run— OK (fragment-only;CHANGELOG.mdnot written)python3 -m unittest discover -s tests -t . -v— 588 tests; 9 new all pass. One pre-existing environmental failure,test_host_metadata_and_homelab_labels_are_not_distributed, caused by a gitignored local.claude-session-ownersession artifact; the same test passes on unmodifiedorigin/mainin a clean clone, so it cannot occur in CI.python3 -m unittest discover -s scripts -p 'test_*.py' -v— 254 tests, OKpython3 scripts/check_release_consistency.py— OKpython3 scripts/secret_scan.py— clean, 324 filespython3 scripts/check-public-export-safety.py --active-tree --history— active tree SAFE; history fails in this pre-rewrite clone as designed, now with the note, exit 1, all 1551 FAIL lines intact,RESULT:lastgit diff --check— cleanDesign notes
Rejected: a
--remoteflag scoping the walk. Narrowing a security gate's scope is itself a laundering vector.Chosen: a purely additive diagnostic. No violation suppressed, filtered, reordered, or downgraded; exit code untouched;
RESULT:remains the last line; no network; bounded git timeouts; fail-safe to silence.Two reviewer-driven properties are load-bearing:
FAILline and clears no remote, and warns the output is unsafe to paste publicly.multiple_rootswas dropped as a trigger because every root can still be remote-reachable, which would make the note assert something false.Review and post-condition
Tier 3 (governance gate). Independent cross-family adversarial plan review before codegen, per the standing directive for bypass-prone surfaces.
Codex (OpenAI family), two rounds, converged:
"does not change the result above"factually wrong (RESULT:prints below), unbounded git calls breaking the fail-safe claim, exact counts leaking private-work size, and an over-strong"the public repo is clean"claim needing snapshot scoping.multiple_rootsas a trigger; balance the message with current-candidate contamination. Confirmed the documentation wording is now safe against suppressing a genuine escalation.All required changes integrated. Round 2's accepted residual false-silence (annotated-tag/blob-ref violations that create no commit outside remote reachability) is safety-preserving — the verdict stays UNSAFE — and is deliberately not papered over with a provenance heuristic.
Post-condition:
mainCI green onvalidate-frontmatter,smoke-test,consistency,scan,unittest,validate-trace; the gate's behavior on a clean clone is unchanged (verified: still exits 0 with no note).Compliance trace
author: Claude (Anthropic family, Opus 5)
standing_directives: public source/release boundary and full AGENTS.md validation suite; adversarial cross-family plan review before codegen on a bypass-prone surface; fragment-only changelog with no version bump
tier: 3
cross_check: PROCEED WITH CHANGES - Codex (OpenAI family), 2 rounds, converged; every required change integrated
post_condition: required CI green on main; clean-clone gate behavior unchanged (exit 0, no note); note verified to fire only with a clean active tree
mcp_coverage_gap: NONE
contributor_rights: OWNER-AUTHORED
operator_reserved: yes
operator_reserved: yes—AGENTS.mdmatches a specific operator-only CODEOWNERS rule. The operator granted explicit merge pre-authorization for this change in-session; recording the reservation truthfully rather than marking the PR unreserved.