Repository navigation
fix(trust): treat manifest-declared policy packs as trust roots (#1075) - #1127
Merged
pengfei-threemoonslab merged 4 commits intoNov 8, 2026
Merged
Conversation
SHIP-VERIFY-TRUST-ROOT-TOUCHED classified a policy pack only by `**/policies/**`, while `checks.policy_packs[].path` may name any file under the manifest's directory. A pull request that edited only a pack declared elsewhere, such as the vendor/shipgate-policies/org-release.yaml layout docs/organization.md recommends, raised no finding and came back mergeable. #1024 classified a --policy-pack named on the command line, not one the manifest declares. verify now feeds the paths a manifest binds into the same internal VerificationContext.configured_trust_root_inputs map #1024 added: - each checks.policy_packs[].path, class `policy`, resolved against the manifest's directory as the scan resolves it; - the audit log that vouches for an in-repository --baseline (baseline.audit_log, or baseline-audit.log beside the baseline, via the scan's own _resolve_audit_log_path), class `shipgate_state` like the baseline, unless baseline.integrity_mode is off. The declarations come from the base manifest, read once from the base commit (the read #1024 makes for the ci exit floor, now shared), and from the head manifest the run loads. A change that removes a declaration and edits the pack in one diff is still a `policy` trust root beside the edited manifest, and a --no-base worktree run is covered by the head's. Command-line inputs keep their classes, and a path the glob table already classifies keeps its class, glob and fingerprint; newly covered paths get new fingerprints. No schema, contract or check ID moves. CHANGELOG, a STABILITY migration note, docs/checks.md (llms-full.txt rebuilt), docs/organization.md and docs/baseline.md say the trust-root set is broader.
The configured manifest is classified before the glob list, so the claim that a classified path keeps its glob holds for the configured inputs only. STABILITY also says when the head's declarations apply alone and that scan --changed-files carries no configured inputs.
This was referenced Nov 8, 2026
Closed
pengfei-threemoonslab
added a commit
that referenced
this pull request
Nov 8, 2026
Brings in #1127 (the #1075 trust-root fix), which 1.3.0 must carry. CHANGELOG.md conflicted because this branch promoted the Unreleased section #1127 added a line to; both files are regenerated from main's Unreleased by the same cut script, so #1127's entry is a one-liner in "Verification, attestation and control", joins the verify highlight, and its full prose is in docs/changelog/1.3.0.md. Its STABILITY migration note is stamped 1.3.0, and llms-full.txt rebuilds identical.
6 of 11 tasks
pengfei-threemoonslab
added a commit
that referenced
this pull request
Nov 8, 2026
The development corpus ran on 04fc9ce (this preparation with #1127): 39 partial, 6 not_established and 4 timeouts; no added, removed or changed row; 415 not_established candidates. All 49 answers equal those of main at 952a74c, which the release record's regression figures come from. Q0 37/49 (retained), Q1 0/49, Q2 0/49, down from 4/49 and 3/49 at the 2026-10-05 ledger. run.py exited 1 on the four timeouts; that is recorded, not a blocker. The holdout has no pinned members. The ledger test now accepts a null answer_id for a member whose row says it has no answer (timeout, refused, unavailable), never with Q1: the first ledger with timeouts. The release record links the ledger, and the release heading is dated 2026-11-08, the day the cut was finalised.
pengfei-threemoonslab
added a commit
that referenced
this pull request
Nov 8, 2026
* release: prepare 1.3.0 on the advisory channel - Version 1.3.0 in pyproject.toml and __version__, the plugin and marketplace manifests, .well-known, the in-tree runtime lines, the capability-lock example, the determinism boundary and llms-full.txt. - CHANGELOG: Unreleased promoted to "1.3.0 - 2026-11-07", one line per change, with the application regression and the Q2 line stated plainly; the full prose moves to docs/changelog/1.3.0.md. Every PR merged since v1.2.0 is cited: #962, #987, #995, #1088 and #1123/#1124 gained citations, and the CI- and lock-only PRs share one line. - STABILITY.md: title, intro paragraphs and 22 migration notes stamped 1.3.0. - Schemas: generated, then pinned (15 documents new since 1.2.0). The host-grants 0.9 inventory and baseline documents no longer say "0.9 has not shipped in a tagged release", which the tag would freeze false. - .github/release-channels.json declares 1.3.0 advisory. * release: codex boundary goldens name 1.3.0; tighten two release-note lines The codex boundary-result goldens pin tool.version, which the full suite enumerated after the bump. The release note's opening says "several ways", not "most of it", and the control-completion line names the MCP input it means. * benchmark(application-q2): ledger for the 1.3.0 release build; Q2 0/49 The development corpus ran on 04fc9ce (this preparation with #1127): 39 partial, 6 not_established and 4 timeouts; no added, removed or changed row; 415 not_established candidates. All 49 answers equal those of main at 952a74c, which the release record's regression figures come from. Q0 37/49 (retained), Q1 0/49, Q2 0/49, down from 4/49 and 3/49 at the 2026-10-05 ledger. run.py exited 1 on the four timeouts; that is recorded, not a blocker. The holdout has no pinned members. The ledger test now accepts a null answer_id for a member whose row says it has no answer (timeout, refused, unavailable), never with Q1: the first ledger with timeouts. The release record links the ledger, and the release heading is dated 2026-11-08, the day the cut was finalised.
pengfei-threemoonslab
added a commit
that referenced
this pull request
Nov 11, 2026
…pack (#1128) (#1130) After #1075 only PR-time verify knew the packs a manifest declares. `check --base main --head HEAD` answered `allow` for a change that edited only `vendor/shipgate-policies/org-release.yaml`, while the same edit to `policies/org.yaml` got `require_review`. The installed PreToolUse hook let the edit land without asking. And verify's boundary assessment published SHIP-AGENT-BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED for the policies/ file but not for the vendored one. - core/trust_roots: manifest_policy_pack_paths, #1127's lexical resolution moved to core, and is_manifest_policy_pack, the normalized casefold match configured_input_trust_root uses. verify's _configured_input_trust_roots calls the resolver; its output is unchanged. - check: the base manifest as committed at the base ref, plus the head manifest, declare the packs. A provided diff, and the MCP tool, read the working tree only and run no Git. evaluate_agent_boundary routes each pack as policies/** is routed. It records trust_root_class: policy only where the trust-root table does not classify the path, so it never takes the graded agent route, and no structural shortcut clears it. - verify: the same packs reach assessment_for_scan_context through a run-private VerificationContext field, so verify publishes the boundary row that check publishes. - hook: _ConfiguredSurfaces replaces the static lookup in PreToolUse, the approval memory, the PostToolUse nudge and the Stop hook. It reads the manifest in the working tree and at --base. It parses a manifest only when the text can name a pack, through `agents-shipgate org policy-packs --json` on a private copy, once per version (kept in the hook state). policies/** rows and fingerprints are byte-identical. No schema, contract, rule ID, check ID, severity or trust_root_class value moves.
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
Closes #1075
SHIP-VERIFY-TRUST-ROOT-TOUCHEDclassified a pack only by**/policies/**, whilechecks.policy_packs[].pathmay name any file under the manifest's directory. A PR that edited only a pack declared elsewhere, such as thevendor/shipgate-policies/org-release.yamllayoutdocs/organization.mdrecommends, raised no finding and came backmergeable/complete.verifynow classifies every pack the base or head manifest declares astrust_root_class: policy, withmatched_globset to the repository-relative path. The same edit now returnshuman_review_required.regular_file_at_refread verify: read an in-repo --diff-from and ci.mode from the base, never from the PR head #1024 makes for theciexit floor;_base_ci_policyis now a projection of that one read, and its note text is unchanged. A PR that removes the declaration and edits the pack in the same diff therefore still gets thepolicyfinding beside themanifestone. The head manifest the run loads also contributes, so a--no-baseworktree run is covered too.VerificationContext.configured_trust_root_inputsmap, via the existing_configured_input_trust_roots, which now takes the manifests.checks/verify.pyandcore/trust_roots.pyare unchanged. Command-line inputs come first, so they keep verify: read an in-repo --diff-from and ci.mode from the base, never from the PR head #1024's classes. A path the glob table already classifies keeps its class and glob, so its fingerprint does not move.baseline.audit_log, the log that vouches for an in-repository--baseline. It defaults tobaseline-audit.logbeside the baseline and resolves through the scan's own_resolve_audit_log_path. It is nowshipgate_state, the class fix(verify): read in-repo --diff-from and ci policy from the base #1074 gave the baseline, except whenbaseline.integrity_mode: off, because the scan does not read it then.services/mailer/shipgate.yamlbindsservices/mailer/rules/org.yaml, not a rootrules/org.yaml), and the audit log against the baseline's. A path outside the repository is not classified.## Unreleasedbullet (placed after verify: read an in-repo --diff-from and ci.mode from the base, never from the PR head #1024's). The STABILITY migration noteverify-manifest-bound-trust-roots-1075says the trust-root set is broader: newly covered paths get new fingerprints, and existing ones do not move. The § Verify Orchestrator sentence is extended.docs/checks.md,docs/organization.mdanddocs/baseline.mdsay the same;llms-full.txtis rebuilt fromdocs/checks.md.Surface discipline: no new surface. No CLI flag, schema, contract, check ID, severity or
trust_root_classvalue is added, and the context map is internal and never serialized. Headline metric: blocked-recall. A PR that weakens the gate through a vendored pack no longer readsmergeable.Type
Authorship
No person has read this diff yet. It needs the owner's review before merge.
Verification
CI is authoritative for
python -m ruff check .,python -m compileall -q src tests, andpython -m pytest.Additional local checks run (Python 3.12, macOS):
origin/main(2cb8f4f),./shipgate verify --base main --head HEADon a scratch repo whose manifest declaresvendor/shipgate-policies/org-release.yaml, with a PR that edits only that file:mergeable,control.state: complete,can_merge_without_human: true, no findings. The same holds for a scopedservices/mailer/shipgate.yamland for a--no-baseworktree edit. With this change all three returnhuman_review_requiredwithSHIP-VERIFY-TRUST-ROOT-TOUCHED(policy,matched_glob= the pack path). The remove-the-declaration case adds thepolicyfinding beside themanifestone. In thepolicies/org.yamlcontrol, the finding's fingerprint (fp_e48e0cb023cc0e6c) and the manifest finding's (fp_bfe9966d650e948e) are identical before and after.python -m pytest tests/test_verify_pr_controlled_inputs.py: 37 passed. The 11 new cases were also run inside an unpatched HEAD export. 9 fail with the missing-trust-root assertion (one with aTypeErroron the new signature). The 2 that pass there are theintegrity-offnegative and the fingerprint-stability guard, which are meant to hold on both.-n auto -m "not perf and not slow" --ignore=tests/test_adapter_static_only.py(22,327 tests): 5 failures, all environmental. Two aretest_check_unmodelled_host_config_keys.py[local_settings_enabled_plugins-*]: this machine's global gitignore hides.claude/settings.local.json, and they pass with an emptyXDG_CONFIG_HOME. Three aretest_schema_roundtrip.py: the local venv has pydantic 2.13.4 whileconstraints/dev.txtpins 2.14.3, and they fail identically on an unpatched HEAD export. After merging main (fix(schemas): freeze published schema bytes; the generator refuses to rewrite one (#1044 slice A) #1116),test_published_schema_freeze.py's version-bump test fails for the same reason, and fails on anorigin/mainexport too. CI's locked closure is authoritative for those.tests/test_adapter_static_only.py: pass.tests/test_latency_budget.py -m perf: pass.python -m ruff check .: pass.python -m compileall -q src tests: ok.python scripts/regenerate_goldens.py --check:Checked 24 sample artifacts; 0 changed.python scripts/build-llms-full.pyre-run; the 20 test files that read the edited docs pass (test_public_surface_contract.pyincluded).tests/shard_seconds.json:test_verify_pr_controlled_inputs.pyre-measured serially at ea14fe2 (53.6s, 37 cases) and recorded as a supplemental increment, as verify: read an in-repo --diff-from and ci.mode from the base, never from the PR head #1024 did.tests/test_shard_partition.pypasses.Release-readiness notes
docs/checks.md(none added or changed; the check's docs section now names the configured inputs)STABILITY.mdDecisions taken
--no-baseruns, where no base manifest is read. Without them, a worktree--no-baseedit of a declared pack still readmergeable. A head-only declaration always comes with a manifest edit, which is itself a trust root, so adding it never creates a lone new review.policies/**gets the same extrapolicyfinding a pack underpolicies/**already gets. The verdict was alreadyhuman_review_required.resolve_input_path). Classifying it is harmless, and it matches fix(verify): read in-repo --diff-from and ci policy from the base #1074's_repository_relative_inputrule.shipgate_state, notpolicy. The issue's sketch sayspolicyfor every path. The audit log is baseline state, though, so it takes the class fix(verify): read in-repo --diff-from and ci policy from the base #1074 gives the baseline. Both classes are inBAND_EXCLUDED_TRUST_ROOT_CLASSES.docs/checks/verify.yaml'sfires_whenalready omits the verify: read an in-repo --diff-from and ci.mode from the base, never from the PR head #1024 inputs and the configured manifest. Editing it would churndocs/checks.jsonand the catalog, so the prose section indocs/checks.mdcarries the update instead.Protected paths touched
none
Follow-up candidates (not in this PR)
checkand the installed hooks still classify by the static table.shipgate check --base main --head HEADon a PR that edits onlyvendor/shipgate-policies/org-release.yamlreturnsallow. The pretooluse hook'sPROTECTED_SURFACESis rendered fromTRUST_ROOT_SURFACESat install time, so it cannot know manifest-declared paths. PR-timeverifyis now the backstop. Making the local boundary evaluator read the manifest's declarations is a separate surface (core/agent_boundary.py).SHIP-VERIFY-POLICY-BASE-ABSENT's fail-safe surface set (_POLICY_SURFACES) also stops at**/policies/**. With no base snapshot, a declared pack edit now raises the trust-root finding but not that fail-safe. The verdict needs a human either way.🤖 Generated with Claude Code