Skip to content

fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up) - #1214

Merged
pengfei-threemoonslab merged 23 commits into
mainfrom
claude/issue-1146-rebinding-followup
Nov 18, 2026
Merged

pengfei-threemoonslab merged 23 commits into
mainfrom
claude/issue-1146-rebinding-followup

Conversation

@pengfei-threemoonslab

@pengfei-threemoonslab pengfei-threemoonslab commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

#1162 (merged as 08a3835fd4) took a binding that reads the same on both sides out of the rows when every doubt about it was the agent's: constructor identity, caller census, import search. The cycle-3 review found a hole. A constructor doubt can come from machinery that also rebinds the agent module's own names: a wildcard import, globals().update(...) or other reflective namespace access, exec- or setattr-style calls, or a module star-imported there that is not read. Those reasons were tagged only construction, and the tool readers recorded nothing for the tool names the same machinery can rebind. So a replaced tool read as "the same":

The review also found two contract sentences in #1162 that are wrong:

  • The CHANGELOG said "No other field, status or exit code moves". In fact a handoff or sub_agents target name bound more than once, or an MCP server's URL, command or arguments the read cannot name, can turn compared into partial.
  • The docs said an object read in part keeps its row. It keeps it only when its agent is already uncertain (compare() fires only then; on an otherwise proved agent it is an agent limit, as on main).

The fix

  • A structured cause, not text. inputs/python_imports.py gains Rebinding, a str subclass that keeps its words and also carries module (the module whose names it can rebind) and names (None for every name).

    • _external_constructor_use returns one for:
      • executable or reflective machinery (eval/exec/setattr/getattr/__import__/frame access…);
      • builtin or dynamic import machinery;
      • imported reflection machinery;
      • reflective namespace access (globals(), vars(), __dict__ writes);
      • a wildcard import.
    • _unread_import returns one for each "could reassign it" import, with names set to what the statement binds: None for from x import *, the bound names otherwise. rebound_names(issue, module_ref, names) tells a reader which of its names an issue can reach.
    • The object flows unchanged through _Stop.detail, the caches and builder_calls.constructor_issue. Formatting it into the reason text keeps the words.
  • The readers add the doubt. When the constructor issue is a Rebinding for the agent's own module, each reader adds definition_identity to every one of the agent's bindings it can reach, beside construction. That is all of them for module-wide machinery, and only the imported names for a named import.

  • A named import of another name stays agent-level. from ..adk.tuatha_config import config (2026 08 27 kcg rename v1 cianfhoghlaim/tuatha#1, read at its pins: line 18 of each subject agent) can rebind config only. Its tools stay in read_same with [construction].

  • Contract text.

  • Every unread import counts (fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up) #1214 review). The constructor stop used to cite only the first unread import, with only its names. It now carries every unread import of the agent's module: joined_rebinding takes the union of their names, or all names if any one is a wildcard. In c15, from shared_a import config then from shared_b import * now reaches lookup.

  • A caller writing the agent module's namespace (fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up) #1214 review).

    • CallerCensus gains namespace_written, set structurally by _writes_namespace from the syntax of the use. These count as writes:
      • setattr(m, …) or delattr(m, …);
      • vars(m) or m.__dict__ stored into, deleted from, or changed through .update, .setdefault or .pop;
      • either one handed to exec or eval as a namespace.
    • Only for the agent's own module, builder_calls.constructor_issue then returns the census issue as a Rebinding for all names, so the readers add definition_identity.
    • Reading the module or passing it on as a value (return pipeline_service) is not a write and stays construction. This is the narrow rule.
  • scan no longer crashes (fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up) #1214 review).

    • Rebinding defines __getnewargs_ex__, so copy, deepcopy and pickle rebuild it with its structure.
    • Resolution.__post_init__ turns caveats, search_caveats and detail into plain str. Nothing a Resolution carries out (evidence(), the ADK unresolved_references records, import_resolutions) holds the structure.
    • found.unread and the namespace-source CallLimit take plain text too.
    • No other custom str subclass or object reaches extraction or report data. Before this, Rebinding objects reached tool.extraction["import_resolutions"] through evidence(), and risk_hints's model_copy(deep=True) raised.

Corpus

Development corpus (49 members, run.py --jobs 4), engine 9abcdb2227 pinned at ~/.cache/shipgate-q2/engine-1146fu-9abcdb22, output ~/.cache/shipgate-q2/out-1146fu-9abcdb22. It started at load ~4.

After the #1214 review

Engine 5964786955 is pinned at ~/.cache/shipgate-q2/engine-1146fu-59647869, output ~/.cache/shipgate-q2/out-1146fu-59647869.

Tests

In tests/test_application_read_same.py:

  • Five new regressions, each a candidate row as on main with definition_identity:

    • ADK wildcard import (c11c);
    • ADK wildcard import outside --scope app (c11);
    • ADK globals().update (c14);
    • the SDK twins of c11 and c14.
  • test_a_named_import_of_another_name_from_an_unread_module_stays_a_doubt_about_the_agent: the tuatha shape. The unchanged tool stays in read_same with [construction].

  • test_a_handoff_target_rebound_after_the_handoff_is_still_a_guess (c12): pins the kept, fail-closed behaviour and its partial status.

  • From the fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up) #1214 review:

    • c15 (two-unread-imports), and c17 and c17b (adk- and sdk-caller-writes-namespace), are added to the same regression table.
    • test_a_rebinding_reason_survives_copy_and_pickle round-trips copy, deepcopy and pickle, keeps module and names, and checks a Resolution carries plain str only.
    • test_scan_reads_an_agent_beside_an_unread_import[google_adk|openai_agents_sdk] runs scan on the review's repro (from .missing_helper import setup beside the tool import) and expects exit 0, where the previous head exited 4.

tests/test_imported_tool_review.py::test_a_guessed_binding_is_never_an_established_addition_or_removal is back to main's assertion. Its agent module calls __import__, so other keeps its row.

Local checks:

  • ruff check .: exit 0.
  • python -m compileall -q src tests: exit 0.
  • python -m pytest -n 4 over the application, reader and constructor suites, plus tests/test_adapter_static_only.py and tests/test_risk_hints.py: exit 0 at head 6b0515d4, the latest of these runs. The 36 files are:
    • test_application_*, test_action_application, test_adk_tool_factories;
    • test_imported_tool_*, test_list_expressions, test_object_bound_tools;
    • test_builder_*, test_google_adk, test_python_import_resolution;
    • test_import_search_ownership, test_framework_constructor_*, test_constructor_*;
    • test_distribution_surface_parity, test_application_q2_benchmark, test_tool_reach_effects, test_sdk_*.
  • The full suite was not re-run locally, per the coordinator's targeted-tests instruction; CI runs it.
  • No schema file changes.

Review rounds

#1214 review

  1. Blocker, scan crash: fixed. Rebinding.__getnewargs_ex__ is added, and Resolution stringifies what it carries out. The scan repro exits 0 for both readers, with tests.
  2. Major, only the first unread import counted: fixed. joined_rebinding takes the union of names, or all names when any import is a wildcard. c15 is pinned.
  3. Major, a caller module's machinery: fixed with the narrow rule. CallerCensus.namespace_written is set from syntax. Writes keep the row; reads and passing the module on stay construction. c17 and c17b are pinned. Corpus cost: 0 rows.

Not done / follow-ups

  • Order-aware guesses. Make the handoff and sub-agent guess ignore rebindings after the construction, or under if __name__ == "__main__":. Today c12/c12c go from compared to partial with one row. The cycle-3 ruling keeps that because it fails closed.
  • Objects read in part on a proved agent. Such an object is still an agent limit and no row. Making reading in part always a binding doubt is a decision for the owner.
  • Machinery in another module, beyond the narrow rule. A caller's module that writes into the agent module's namespace now counts. Code in another module that could reach it otherwise (its own wildcard import or exec without naming the agent module) does not.

Checklist

Summary

Type

  • Check or risk-model change
  • Input adapter change
  • CLI or GitHub Action behavior
  • Report, schema, or SARIF output
  • Documentation only

Authorship

  • A coding agent wrote some or all of this change. Agent: Claude Code, Opus 5.5
  • A person read the whole diff before opening this pull request.

Verification

See Tests and Corpus above.

Release-readiness notes

  • No user-code import added to default scan paths
  • No network access added to default scan paths
  • New or changed check IDs are documented in docs/checks.md (none changed)
  • Report/schema changes are additive or documented in STABILITY.md (no new field; STABILITY.md's 0.5 line now names the status moves)

Refs #1146

Refs #1162, #1147

🤖 Generated with Claude Code

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site
… counts, and a caller's namespace write keeps the row (#1146 follow-up)
Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.
Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.
* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry
* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes
* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries
…imit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.
* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors
* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors
…#1200)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* fix(host-diff): bind command-setting script bytes
* fix(cli): emit structured recovery for handled command errors

* test(cli): assert worker refusal through exit code and stderr

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors

* Name unread host changes and compare Action helper commands (#1199)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented comma…
* fix(cli): emit structured recovery for handled command errors

* test(cli): assert worker refusal through exit code and stderr

* fix(cli): fail closed on unread inputs and missing fixture evidence
…#1194)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(inputs): retain JSONC and JSONL data and type malformed input errors (#1043)

* fix(inputs): bound YAML expansion and structured nesting (#1043)

* Run PR checks against main after retargeting

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors

* Name unread host changes and compare Action helper commands (#1199)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_r…
* fix(identity): stabilize expiry, TOML evidence and local repository IDs (#1034)

* fix(control): preserve distinct remote-less workspace identities

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors

* Name unread host changes and compare Action helper commands (#1199)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holdi…
…ncating (#1079) (#1187)

* fix(privacy): redact the capability lock family and redact before truncating (#1079)

capabilities.lock.json, both capability-lock-diff files and both capability
delta attestations were built from unredacted capability facts, so a key in a
tool name, owner (controls.evidence_owner), scope, authority source or source
pointer was published verbatim, including in changed[] rows and
semantic_changes[].

Redact where the lock is assembled, before any digest is taken, and where a
lock is read back. Each capability digest whose input redaction changed is
recomputed over the redacted text by one shared recipe, and the id follows
identity_hash, so every published digest (ids, set hashes, payload subject
keys and set digests) describes the published text and the reference consumer
accepts the attestations. A fact or lock with nothing to redact keeps every
byte; an old lock reads back as the fresh export. Two capabilities that
redaction would merge keep their source identity digests.

Redact before cutting text to a length: the n8n HTTP path hint (200), skill
excerpts (180), and the Python reader's expression text (160) and source-slot
refusal rows (1,024) cut first, so a credential straddling the cut published
its head. New core.privacy helpers redact_and_truncate / truncate_redacted
never cut inside a redaction marker.

The #1077 leak test no longer excludes the lock family. STABILITY gains a
migration note and rewords the #1026 note's sentence about the lock family.

* fix(privacy): redact instruction previews and Git diagnostics before bounding; correct the lock digest claims (#1079)

Review cycle 1 on #1187.

- The agent's instructions.value_preview (OpenAI and Anthropic prompt
  files, ADK instruction) was cut to 500 characters before report-time
  redaction, so a key across the cut published its head in report.json and
  packet.json. Git's diagnostic in a verify diff status was bounded to 240
  characters and never redacted. Both now go through redact_and_truncate /
  truncate_redacted, with a straddle test for each source type.
- Read-time redactions are not counted in privacy_audit. Documented in the
  migration note with a link to #586, and pinned by two tests that name it;
  the counting itself is left to #586.
- STABILITY, CHANGELOG and docs/capability-standard.md no longer say every
  published digest describes what is shown: tool_id (tool_v2_) and the
  observation ids (obs_v1_) are digests of source text a reader cannot
  recompute and can check by dictionary, as on main.
- The collision fallback's diff rows are best effort and reachable only with
  name-derived tool ids; the docstring, STABILITY and the test say so.

* fix(privacy): drop a cut word at the Git stderr capture limit and never cut through a marker (#1079)

Review cycle 2 on #1187.

- The Git stderr capture keeps the first 8 KiB; a token cut at that limit
  could land in the 240-character diagnostic too short for any rule. When
  the capture fills the limit, its last word is dropped before decoding.
- verify's headline title (_bounded, _bounded_bytes) and an evidence gap's
  headline subject bound already-redacted text but could cut through a
  [REDACTED:...] marker and publish half of it. Both now cut with
  truncate_redacted.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors

* Name unread host changes and compare Action helper commands (#1199)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(p…
…ions (#1196)

* fix(inputs): preserve constructor evidence for bounded Python expressions (#1037)

* test(ci): align generator comparison and stabilize the wheel fixture

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors

* Name unread host changes and compare Action helper commands (#1199)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they …
@pengfei-threemoonslab
pengfei-threemoonslab merged commit ebf1f8f into main Nov 18, 2026
16 checks passed
pengfei-threemoonslab added a commit that referenced this pull request Nov 18, 2026
…anges use, and propose the next-reader decision (#916) (#1215)

* docs(benchmark): measure which frameworks agent-changing PRs use, and propose the next-reader decision (#916)

benchmark/framework-mix/ pins 375 public pull requests from the 90 days to
2026-11-17, each judged from source at its merge base and head: 250 from
framework-neutral title searches in randomly drawn hours (the share), and 125
from per-framework code searches (how readable each framework's bindings
are). Holdout-pool repositories and development-corpus pull requests are
excluded before anything is read.

Of the 61 neutral pull requests that change an agent's tools, sub-agents or
handoffs, or an MCP server's tools: 31 use no framework, 18 change an MCP
server, 5 LangChain or LangGraph, 1 PydanticAI, 6 another named framework,
and none the OpenAI Agents SDK or Google ADK.

docs/engineering/next-application-reader.md (status: proposed) recommends no
new framework reader yet, states the criterion in Q0/Q1 terms, addresses the
ROADMAP non-goal, and leaves MCP server registrations to the owner as a scope
question. No reader is implemented.

* test(shard): give the framework-mix benchmark test its measured weight (#916)

* docs(benchmark): state the framework mix's title-frame recall and correct its judgments

The neutral frame samples pull requests titled as agent tool changes. Its
word rule matches 1 of the 49 development-corpus titles and 1 of the 59
relevant pull requests the framework frames found, so its shares are
shares among such titles, not among agent-changing pull requests. The
README, the decision record and the CHANGELOG now say so, with the
recall table counted by summarize.py.

- Judgments corrected after review: two capped dossiers re-read as
  relevant, coding-agent plugins and memory layers reclassified, one
  stacking rule, readability and existing-agent fixes, a local `agents`
  package no longer read as the SDK. Every capped not-relevant
  application pull request was re-read from its full patch; sample.json
  records dossier_capped and reread_full_patch.
- reach is counted over agent-binding pull requests; criterion 1 uses
  addressable with reach at the low end of its interval. No reader now
  rests on Q1 0 of 49 and on the sample's size and frame.
- Pool effect and cluster caveat stated; two titles naming a private
  person recorded as null.
- The test checks the walked hours and candidates are the first of
  their seeded orders.

Refs #916

* fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up) (#1214)

* fix(application): code that can rebind the agent module's names keeps a tool's row (#1146 follow-up)

* docs(changelog): amend #1146's compatibility sentence and record the rebinding follow-up's corpus result (#1146)

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(application): rebinding reasons survive copy, every unread import counts, and a caller's namespace write keeps the row (#1146 follow-up)

* docs(changelog): the rebinding follow-up counts every unread import and a caller's namespace write (#1146)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* Compare host inputs from explicit committed heads (#1204)

* feat(diff): compare pinned host commits without a checkout

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): consistently report unreadable configuration shapes

* fix(verify): preserve human review for host-only comparisons (#1190)

* fix(verify): preserve human review for host-only comparisons (#1152)

* fix(verify): preserve incomplete host comparison recovery

* fix(setup): install and route host-only advisory verification

* fix(setup): load the workflow through the static wheel layout

* test(verify): pin the incomplete comparison recovery command

* test(setup): check the host-only advisory workflow handoff

* fix(verify): preserve host review across pinned comparisons

* fix(host): preserve workflow setup and review summaries

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004) (#1202)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_required (#1154)

A pull request that added Bash(*) to .claude/settings.json was blocked
(strict exit 20). The same change padded past the reader's 1 MiB bound,
with a leading // line, or cut short was review_required (strict exit 0,
control review_publishable): the blocker disappeared and two medium
review rows stood in for it.

- verify records each changed file the boundary assessment could not
  read as a policy evidence gap (unknown_policy_evidence, source_type
  agent_boundary_input), so the one decision engine holds the verdict at
  insufficient_evidence and strict mode exits 20. The verifier control
  for such a run is human_review_required, as check already said. A file
  git reports unchanged on both sides adds no gap. The 1 MiB bound stays.
- Every host-config parse goes through one nesting bound (64 levels,
  core/structured_depth.py): a 5,000-deep file is a typed, file-named
  refusal in diff, check, audit --host and verify instead of a
  RecursionError traceback or internal_error.
- An empty detached check --diff adds the input issue boundary_diff_empty
  (require_review, partial coverage) and keeps its stop; the boundary
  result model refuses decision allow with incomplete input coverage.

* fix(verify): count every unread host file, honour no-newline markers, never allow a detached diff (#1154)

Review round 1 on #1161:

- The diff reader dropped Git's "\ No newline at end of file", so a new
  host config without a final newline was rebuilt with one, mismatched
  the file and read as unresolved: valid new files failed strict CI.
  DiffHunk records the marker per side and every rebuild honours it. A
  *_content_unresolved row no longer counts as unread on its own.
- The assessment records which input-issue files the reader did not
  read: a read or parse failure, a Claude Code settings or hook shape it
  refuses, an enabled plugin's hook file it does not open, an OpenShell
  document it refuses, a binary file. verify's gap counts those, so a
  string where a rule list belongs, a refused OpenShell policy and an
  unparseable base hold the verdict too. The gap names the unread side.
- A JSON host config whose top level, or MCP server map, is not an
  object is a CONFIG-PARSE-FAILED row (parser NotAnObject); a top-level
  array no longer crashes check or makes verify exit 4.
- A detached diff (check --diff, MCP diff_text) never reports allow and
  reports coverage unknown where it read everything it named (issue
  boundary_diff_unbound); its stop and rows are unchanged. The boundary
  result model refuses allow beside a stopping control.
- STABILITY and CHANGELOG state the decision precedence exactly.

* fix(mcp): keep the shipgate.check description within 1024 characters (#1154)

The detached-diff sentence added in the previous commit took the
description to 1029 characters, past the cap test_mcp_server holds every
tools/list description to for model APIs that refuse a longer one. It now
states only that the decision is never allow; the coverage rule is the
result model's.

* fix(host): count a shape refusal as unread only for a Claude settings or hook file (#1154)

Review cycle 2 on #1161:

- The inventory reads a nested .github/workflows/*.yml, and the shared
  adapter's .shipgate/agent-contract.json and .agents-shipgate state
  files, as configuration under the Claude Code host, and refuses a
  permissions value that is not a Claude settings object. Counting that
  refusal as unread made a nested workflow with permissions: read-all
  insufficient_evidence where main said review_required. Only a Claude
  Code settings layer or hook file now records a shape refusal; the
  misfiling itself is left for a follow-up.
- docs/host-boundary-support.md: unreadable boundary policies are counted
  as unread, and an unparseable unified or Codex policy also blocks.
- The agent-protocol repair-after example is regenerated from its
  documented command and its README sentence corrected.
- STABILITY: risk_level stays explanatory under the detached rule.

* fix(host): name an unchanged in-tree directory link as an unchanged limit, not a refusal (#1004)

chanzuckerberg/single-cell-data-portal#7802 changes only `.mcp.json`, and
`diff` refused it: four unchanged Terraform links such as
`.happy/terraform/envs/dev/modules -> ../../modules` are not at a boundary
location, so the reader does not read through them, a `**/` glob could match
beneath them, and each was a blocking `unreadable` limit that
`unchanged_limits` never named. One untouched link hid every row.

By the owner ruling of 2026-11-15, such a link is named as an unchanged
`unreadable` limit, and the rows beside it kept, when Git proves it
unchanged without following it (`cli/verify/git.py::unread_link_unchanged`):
the same mode-120000 entry and blob on both sides, a relative text naming in
one hop an in-tree directory that does not hold the link, the same tree
object for that directory with no link or submodule beneath it, and in a
working tree every entry beneath it read by its own entry and unfiltered
hash. A link where a host reads agent configuration keeps its blocking
limit, so configuration cannot be moved behind a link
(`boundary_registry.is_host_configuration_location`): a configuration
file's name, at, under or above an anchored configuration directory,
inside a `**/` configuration directory or a plugin manifest directory, or
with such a path beneath it by Git's listing. The comparator checks the
link's own path too.

`diff`, `verify`'s host comparison, the PR comment and a `partial`
comparison read one proof. `check` cannot name a limit, so it refuses with
`unchanged_limits_not_representable` as for every unchanged limit. The
inventory, `audit --host`, baselines and drift are unchanged, and an
unchanged link adds no #1154 evidence gap. No schema, contract, limit kind
or check ID moves.

Two tests pinned the old refusal with `docs/proxy -> ../src/pkg`; they now
name a directory holding a link, which still refuses, keeping their intent.

* fix(host): unchanged-link proof skips build output, shares work, and bounds a comparison (#1004)

Review cycle 1 on PR #1202.

- Build output no longer defeats the working-tree proof. A directory or
  link named as one the repository walk never enters (`__pycache__`,
  `node_modules`, `.venv`, `.pytest_cache` and the rest of
  `_WALK_SKIPPED_DIRECTORIES`) is not walked beneath the directory a link
  names, so a local test run no longer turns `diff` incomparable while
  `verify --head` compares. Every host's reader enumerates its sources from
  that walk; a file another reader opens by reference (a hook script, an
  OpenShell policy) is compared at its own path or carries its own limit.
  A file Git tracks beneath such a name still counts, checked by its own
  entries. Any other ignored name, such as `.terraform`, still counts.
- `UnreadLinkProver` examines a directory several links name once, keyed
  by its path and tree object: one listing, one registry match and one
  working-tree check. One comparison examines at most 20,000 files and
  128 MiB beneath its links. Past a bound, a link keeps its limit, and the
  refused comparison's coverage detail says why. The registry match a
  directory shares rests on an invariant now pinned by a test: beneath a
  link that is not itself a configuration location, whether a path is
  configuration depends on its part below the link alone.
- CHANGELOG and STABILITY say a configured `verify --head`, as the Action
  runs it, still refuses any committed link at its whole-commit archive
  (#688), with misleading `Fix the manifest in place` advice, so such a
  repository never reaches this comparison in CI.
- Tests pin the fail-closed branches: the 10,000-file bound, the per-link
  and comparison byte bounds, the comparison file budget, a gitlink beneath
  the directory, and `core.fileMode=false` and `core.autocrlf` checkouts.
- The carve-out wording says `.cursor`, `.vscode` and `.agents` are
  anchored at the repository root; a nested copy is named, as tests pin.

* test(diff): assert diagnostics after decoding terminal colors

* Name unread host changes and compare Action helper commands (#1199)

* fix(host-diff): name unread changes and compare Action helpers

* fix(host-drift): distinguish malformed Action helper evidence

* docs: correct YAML list placeholder paths (#593) (#1173)

* fix(application): a binding that reads the same on both sides is not a candidate change; application comparison 0.5 (#1146) (#1162)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): show specific changes in large candidate findings (#1174)

* fix(application): a binding that reads the same on both sides is not a candidate change (#1146)

* test(application): re-render the Q2 goldens from main's answers with #1146, and record its shard weight

* docs(application): say read_same is new since 1.3.0 (#1146)

* fix(application): a doubt about which definition or setting is bound keeps the row; application comparison 0.5 (#1146)

* test(application): re-render the Q2 goldens with application comparison 0.5, and state what dropped rows no longer carry (#1146)

* fix(application): an unread rebinding import, a guessed handoff target and an unnamed MCP endpoint keep the row (#1146)

* fix(diff): show specific changes in large candidate findings (#1168)

* test(application): re-render the Q2 golden inputs from the final engine's run (#1146)

* fix(diff): rank candidate reach before other changes

* fix(openapi): surface unread schema carrier references (#1175)

* fix(openapi): surface unread schema carrier references (#1166)

* fix(openapi): resolve media carriers and identify unread references

* Count unsupported cold-start settings as changed cases

Refs #1084

* fix(readers): stabilize n8n selection and explain unread MCP files (#1176)

* fix(readers): make n8n selection deterministic and explain unread MCP files (#1073)

* test: classify the unread MCP warning decoder as a non-message

* fix(n8n): prefer canonical node fields and clarify MCP audit guidance

* fix(verify): record effective plugin opt-in in capability locks (#1178)

* fix(verify): record effective plugin opt-in in capability locks (#1062)

* docs: explain where capability lock hashes change

* fix(verify): clear stale scan artifacts before manifest-free previews (#1179)

* fix(verify): clear stale scan artifacts before manifest-free previews (#1067)

* fix(verify): clear stale remediation before host comparison

* fix(org): validate supplied attestation verdicts and capabilities (#1180)

* fix(org): check attestation verdict and capabilities against the verifier (#1066)

* docs(org): place the attestation bundle release note

* fix(org): cross-check attestation claims before publishing

* fix(attest): use report evidence bound by a verified receipt (#1181)

* fix(attest): use report evidence bound by a verified receipt (#1068)

* docs(attest): place the receipt-bound evidence release note

* fix(attest): publish only receipt-bound report evidence

* test(packaging): check built-in entry-point declarations (#1182)

* test(packaging): verify built-in check entry-point parity (#1051)

* docs(packaging): explain built-in registration and wheel contract files

* fix(verify): bind prepared comparison reports to the base ref (#1183)

* fix(verify): bind prepared comparison reports to the base ref (#1076)

* test(verify): check the currency of base comparison reports

* fix(verify): recheck prepared comparison report origins

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031) (#1198)

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(security): refuse a linked reports directory inside the repository; contain captured inputs (#1031)

Review cycle 3 on #1198.

- An output directory typed with --out (scan, verify, the Action's
  --out agents-shipgate-reports) and verify's default reports directory are
  walked from the repository root before they are resolved
  (refuse_links_inside): a link or junction in any component inside the
  repository is refused before inputs load or anything is written.
  Directories above the repository stay the operator's choice. The --out
  write root is the validated directory as typed.
- verification-inputs/ copies go through write_contained.
- The shared symlink walk and directory creation also refuse junctions.
- apply-patches loads each planned target as a manifest before writing and
  refuses a patch that would leave it unloadable.
- Tests pin the printed apply-patches command running from another
  directory, and the mechanical repair's --workspace.
- Docs say ownership of .git is checked on POSIX only.
- test_agent_control_reports_dir: the in-repository link spelling is now
  refused by the writer, so the test asserts the refusal.

* fix(scan): anchor relative output overrides to the manifest

* fix(inputs): read encoded and deep Python source safely (#1184)

* fix(inputs): read encoded and deep Python source safely (#1042)

* fix(inputs): keep BOM tolerance out of baseline evidence

* test(inputs): isolate encoding cases from OpenAPI regressions

* test(ci): measure the encoding test shard weight

* fix(security): anchor write containment on trusted roots; one hardened Git environment (#1031)

apply-patches took its containment root from report.manifest_dir, which
arrives in the same untrusted report as the patches. Targets must now also
resolve under the working directory or its git toplevel; anything outside
exits 5 with nothing written. A JSON pointer that does not fit its target
document (a list pointer ending in "-" included) is a malformed patch:
exit 2 with the malformed_patch envelope, no traceback, and every file is
planned before any is written.

output.directory in shipgate.yaml must be a relative path inside the
manifest's directory: the manifest schema rejects absolute, drive, UNC and
".." values (docs/manifest-v0.1.json carries the rule as a pattern), and
scan refuses a directory that resolves outside through a link. scan --out
still writes anywhere.

Every Git child in src/ takes its environment from core/git_env.py's
hardened_git_env(), the union of the five hand-written copies; the hook
runner has it rendered in and the zero-install detector keeps a copy, both
held equal by tests/test_git_env.py. The fixture also disables hooks and
signing.

display_path and the symlink-chain walk each have one implementation in
core/paths.py; the differences callers relied on are named arguments.

* fix(security): contain every scan write and clear; apply-patches edits only the manifest (#1031)

Review round on #1198, including the owner's extension of #1031's
acceptance criteria to linked output leaves and linked parent directories.

- core/contained_write.py: one writer for every file scan writes or
  clears (reports, packet files, scaffolds, current-control.json, verifier
  artifact cleanup). It refuses a link in any directory below the trusted
  root, a link, special file or hard link at the destination, and a
  spelling outside the root, before anything is written or removed; files
  are opened with O_NOFOLLOW where available. The scan checks every
  reports-directory artifact name before its first write.
- apply-patches: a target must load as a Shipgate manifest and is refused
  when it is a protected agent-boundary or trust-root file. New
  --workspace option names the trusted root; verify's printed commands
  carry it. The git toplevel counts only when its .git is a directory or
  gitdir file owned by the user (owned_git_root_for). A directory target is
  a structured error. Refusals print the resolved target.
- output.directory errors say to remove the value or make it relative.
- Fold the remaining display-path copies (codex_config, mcp_manifest,
  discovery artifacts and signals) and the agent_boundary symlink walk.
- Tighten the spawn-site test; state where pointers differ from RFC 6901.

* fix(security): keep the cleanup-failure contract; guard apply-patches --workspace (#1031)

- remove_contained removes through Path.unlink, as the cleanup did before,
  so a removal that fails raises its OSError and clear_verifier_route_artifacts
  still turns it into ArtifactLifecycleError with the same recovery.
- apply-patches --workspace goes through the shared workspace guard
  (require_workspace) before anything is read, like every other
  --workspace command: an absent, non-directory or unreadable workspace is
  a config_error with exit 2. It joins the workspace input sweep.

* fix(inputs): handle non-text codecs and chained Python calls

* docs(inputs): spell out structured input format selection

* fix(inputs): report incomplete Python tool bindings (#1192)

* fix(inputs): report incomplete Python tool bindings (#1038)

* test(ci): measure the Python reader test shard weight

* fix(sdk): keep rebound constructor candidates visible

* fix(inputs): verify Python tool member bindings at their use

* test: expect the tool list mutation call site

* docs: explain ownership of nested manifest placeholders (#1208)

* fix(verify): stop when the explicit head removes the manifest (#1210)

Preserve the human stop when the explicitly evaluated head removes a manifest present at the merge base. A checkout copy cannot produce verification artifacts for the removed gate.

* fix(verify): align preview and trigger comparison inputs (#1188)

Use the shared base resolver and report exclusion for preview and triggers. Preserve actionable missing-ref recovery and the selected no-base mode in preview handoffs.

* fix(verify): show progress before building Git archives (#1206)

* fix(host): align workflow classification and case-folded parsing (#1144)

* fix(host): a policy pack is not a workflow, and CI.YML is parsed as YAML (#1143)

`check`'s workflow predicate (`core/host_boundary.py::_is_workflow_path`)
took any `.yml`/`.yaml` the registry's `shared` adapter enumerates and
tested what followed its first 18 characters for a `/`, without checking
the `.github/workflows/` prefix. The `shared` adapter also enumerates
`policies/*.shipgate.yaml` and the named boundary policies, so every pack
was evaluated as a GitHub workflow:

- a pack with a top-level `permissions: write-all` got
  `HOST-WORKFLOW-WRITE-ALL` and `block` from `check`, and full `verify`
  published it as a release-blocking finding;
- a malformed pack got `HOST-CONFIG-PARSE-FAILED`
  (`workflow_yaml_parse_failed`).

Each displaced the pack's own `BOUNDARY-PROTECTED-SURFACE-UNCLASSIFIED`
row. The predicate also compared the extension case-sensitively, so
`check` never evaluated `.github/workflows/CI.YML`.

The reader's `parse()` chose YAML and TOML by a case-sensitive suffix.
So `CI.YML`, which the registry and the reader classify as a workflow, went
to the JSON parser, and both inventories recorded a blocking
`parse_failed`. `diff` and `verify` came back `incomparable` with no rows,
and `check` answered `require_review` (`BOUNDARY-INPUT-INCOMPLETE`) to a
`write-all` widening that blocks in `ci.yml`. `.codex/CONFIG.TOML` was
refused the same way.

The fix:

- `_is_workflow_path` delegates to `is_github_workflow_path` (#1110), so
  `check` evaluates exactly what the comparison reads as a workflow.
- `parse()` chooses its parser by the case-folded suffix.
- The Codex grant dispatch folds the suffix too, so a parsed `CONFIG.TOML`
  publishes its grants rather than none.

GitHub documents only the `.yml`/`.yaml` extensions in
`.github/workflows`, and says nothing about letter case. So a case variant
stays a workflow, per `glob_match_ci`'s conservative rule.

Closes #1143

* test: re-measure the #1143 test files' shard weights

The `Release.Yaml` route case took the same path as `CI.YML`'s, and its
suffix is already pinned by the parser and agreement cases, so it is
dropped. That leaves:

- tests/test_workflow_directory_instructions.py: 33 cases, 106.4 s
  (was 23 cases, 50.6 s);
- tests/test_declared_policy_pack_boundary.py: 27 cases, 54.6 s
  (was 22 cases, 44.3 s).

Both were measured serially on a loaded machine, where the old cases of
the first file ran about 1.5x their recorded time. The weights overstate
the files, which is the safe direction for the shard that holds them.

* fix(host): parse every workflow name matched by the registry

* fix(verify): hold the verdict on changed unreadable host inputs (#1161)

* fix(verify): a changed host config the reader cannot read holds insufficient_evidence, not review_requi…
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