# Injection defences: Fable follow-up

Paul requested these changes after reviewing 862bb1c3. Merge origin/main first
(5a6755bb, merged as 5f603516). Preserve legitimate work: missing certification
must not suppress diagnostics or fix rounds. Authority remains a person's tap
or a current owner-chosen project setting plus deterministic checks.

## Checks and merge authority

Without a base gate manifest, run candidate gates and hosted CI as diagnostics,
with no BaseChecksSHA. With a manifest, run immutable base gates for certification.
When gate files change, also run candidate gates in an independent checkout and
report both outcomes. Candidate results drive repair feedback but cannot certify
merging. Gate-change auto-merge still requires passing base checks and the
explicit setting. A person can approve a legitimate gate update whose old gate
fails but whose candidate checks pass.

Manifest paths may name directories. Resolve them from the base tree, pin their
whole contents read-only, and classify new, changed or deleted descendants as
gate changes. Pin directories against helper shadowing, including new Python
modules. Checked changes also require not_sensitive unless the owner enables a
separate sensitive-change waiver. Existing eligibility and current-roster checks
remain mandatory.

## Previews

Verify the exact CSP on the served marker, not just exported _headers. A missing
or different header is unconfirmed and clearly reported. Open previews in an
Equipo wrapper whose frame-src permits only that preview origin and whose
sandboxed iframe cannot navigate the top page. Permit a current owner to approve
one exact preview without the header, after a successful secret scan; do not
silently omit the header or publish an insecure fallback. Tailnet placement
limits readers, not browser egress. Public-preview grants apply prospectively.

Bundle pinned, digest-verified gitleaks artifacts for Linux and Mac with runner
releases. Execute scans offline inside the sandbox, using trusted scanner
configuration and exports only. Runtime scanning and its test need no host Go
module cache.

## Text provenance

Use collision-proof multi-line data blocks for logs, diffs and other multi-line
values. Quote each value once. Keep the person's fix note under its own source
label. Hand-offs carry only composer messages belonging to that request. A
corrupt notebook opens empty with a warning; its corrupt bytes remain untouched.

## Platform and verification

Revise the separate CARLOS patch against platform main in a disposable worktree.
Accept standard CSP values generally and reject requested policies that cannot
be applied, before publication. Include usage documentation. Do not push CARLOS.
Tighten rule 4 in AGENTS and the hosted spec branch. Every guard gets a failing
test and an observed mutation failure. Run the requested local gates, push Equipo,
and wait for hosted CI. Record both branches, the platform base, tests and
mutations in ../report2.md. No merge into main or deployment.

## Implementation contract

Protocol 28 is required for the directory-gate certificate, served preview
policy and per-preview exception. Older runners remain diagnostic. No further
migration is needed: the sensitive-change waiver and public-preview grant time
use the existing autonomy JSON; the exact owner, candidate and export grant is
stored on its preview step. Removing an owner revokes their standing authority.

The fixed preview policy omits frame-ancestors so the instance can embed it.
The preview itself cannot embed other frames. The instance wrapper pins
frame-src to the exact preview origin and uses a sandboxed iframe without
popups or top navigation. An exception never skips the secret scan.

Gitleaks v8.30.1 is a pinned Go module. Release builds compile it separately for
Linux amd64 and Mac arm64, record each digest in the install manifest, and link
the corresponding digest into each runner. Tests re-execute the already compiled
gitleaks command from the test binary. No compiler or module cache is needed to
prepare or run a scanner during those tests.

## Final review corrections

The trusted base gate keeps its own outcome alongside the combined checks
outcome. Candidate diagnostics cannot turn a failed base gate into a pass.
A base failure enters the existing fix-round path; any merge explanation names
the base failure. Persist the outcome additively, after main's migrations.

Preview link labels contain only the host. Their targets remain Equipo wrapper
routes. The exported and verified CSP names the configured Equipo origin in
frame-ancestors, including after restart. A republishing attempt offers no stale
header-confirmation link.

The platform patch refuses serving only for requested security headers that
cannot be applied. Invalid nonsecurity lines retain the edge's skip behaviour.
