Skip to content

Evidence-tier publishing: contract sibling, latest-evidence.json, builder --evidence-release (#506) - #674

Draft
MaxGhenis wants to merge 6 commits into
mainfrom
evidence-tier-506-port
Draft

Evidence-tier publishing: contract sibling, latest-evidence.json, builder --evidence-release (#506)#674
MaxGhenis wants to merge 6 commits into
mainfrom
evidence-tier-506-port

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Implements the microcosm#506 design (owner directive: the best available artifact should be publishable at all times WITHOUT weakening certified gating), generalizing the #490/#497 register pattern — adjudicate, record, carry the caveat in the artifact. Leaves #506 open for the owner to close after the first evidence publish (the current best dense artifact).

The tier, structurally

  • validate_evidence_release_dir (microcosm-data): a sibling of validate_release_dir, not a relaxation — same required files, same shape/provenance/hash/cross-manifest checks, plus a mandatory non-empty known_failures block: every recorded gate failure verbatim, each with an owner issue ref. Gate-verdict requirements (US critical-target fit, source-coverage gate.passed) are exactly what the tier records instead of enforcing. Dirty-git, hash mismatches, and build-id mismatches still refuse: the tier relaxes verdicts, never auditability.
  • Mutual exclusion is structural, both directions. Evidence manifests declare schema_version: "1-evidence" + tier: "evidence"; the certified contract rejects that schema marker no matter which gates failed, and a certified-shape manifest (no tier, no known_failures, schema 1) fails the evidence contract. validate_release_dir itself is untouched.
  • Scope: national-default releases only. Local-area roles (Release contract needs dataset-role classes: national-default checks reject valid non-default local-area artifacts #398) and UK exact-k releases (One country-agnostic gate battery: phased evaluation, unconditional reporting, per-country gate selection (#578) #611 gate battery) are refused by name — no evidence semantics have been adjudicated for them.

Publish path

  • publish_release(evidence=True) validates via the evidence contract, creates the immutable tag exactly as today, and moves only a new latest-evidence.json pointer (payload mirrors latest_pointer_payload + tier). The certified latest.json path never appears in an evidence commit — pointer isolation is pinned in both directions by tests.
  • latest_evidence_release() is the consumer; latest_release() now refuses a pointer payload naming a foreign tier (defense if an evidence payload ever landed in latest.json).
  • microcosm-publish-release --evidence; Slack alerts label the tier so they can never read as a certified release announcement.

Builder --evidence-release

Tests

49 new tests across the three suites (19 contract, 13 release/publish, 2 CLI guard, 11 builder + the #568 AST guard now also covering the evidence branch shape). Full workspace suite green (uv run pytest: exit 0 on this branch), ruff clean.

Notes for the merge gate

🤖 Generated with Claude Code

MaxGhenis and others added 6 commits August 11, 2026 18:22
validate_evidence_release_dir as a sibling of the certified contract: same
required files and shape/provenance/hash checks, plus a mandatory non-empty
known_failures block (verbatim gate-failure strings, each with an owner issue
ref). Evidence manifests declare a distinct schema marker (1-evidence) and
tier field, so the certified contract structurally rejects them in one
direction and the evidence contract rejects certified-shape manifests in the
other; validate_release_dir itself is untouched. Scoped to national-default
releases: local-area roles (#398) and UK exact-k releases (#611) are refused
pending their own adjudicated evidence semantics.

publish_release grows evidence=True: validates via the evidence contract,
publishes the immutable tag as usual, and moves only latest-evidence.json
(payload mirrors latest_pointer_payload + tier) — the certified latest.json
path never appears in an evidence commit. latest_evidence_release reads the
new pointer; latest_release now refuses a pointer payload naming a foreign
tier. The publish CLI grows --evidence. Slack alerts label the evidence tier
so they can never read as a certified release announcement.

Ported from the pre-rename populace tree (branch evidence-tier-506, commit
9012391d) onto the microcosm namespace.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… owned known_failures (#506)

On terminal-gate failure the certified path is unchanged: batched pre-export
raise, #568 weight-evidence sidecar, no H5, no manifests. Under
--evidence-release the same recorded failures instead ride into the release
manifest's known_failures block and the run continues through the H5 write,
reform smoke, take-up contract, and manifests. Every conversion point
resolves owners immediately — a failure matching neither the standing
US_EVIDENCE_FAILURE_OWNERS register (the two #506-adjudicated dense
families: SOI Table 1.4 dollar fit -> #487, QRF tail concentration ->
#481/#487) nor the --evidence-failure-owners per-run file refuses the
export. An all-green run under the flag is refused: the flag is structurally
incapable of minting a certified-shape manifest (the release manifest gets
the 1-evidence schema marker + tier + known_failures via
_evidence_release_manifest_fields, which raises on an empty record).

Release ids: --evidence-release auto-ids carry the -evidence- segment;
certified builds refuse ids that squat it. Incompatible with --exact-k (the
ladder lane keeps its own tag-only contract). Preflight and mid-build
source-stage gates, --audit-export-targets, and the dirty-worktree refusal
abort in both modes: the tier relaxes terminal gate verdicts, never
artifact auditability.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…test-evidence.json (#506)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r paths, harden scope (#506)

Findings fixed from the cross-family adversarial review of the committed
diff:

- (HIGH) Pointer isolation was bypassable through manifest-declared root
  artifacts: an artifact entry whose path IS latest.json (or
  latest-evidence.json) uploaded at that root path. publish_release now
  refuses reserved pointer paths as root artifacts on BOTH tiers, pinned in
  both directions.
- (HIGH) known_failures was unbound from the artifact's own record. The
  evidence contract now requires every build_manifest gates.calibration
  failure verbatim in known_failures, and recomputes the certified
  critical-target verdicts requiring each breach acknowledged by name — a
  softened or dropped entry refuses. (Over-disclosure stays legal: the tier
  can under-promise, never under-disclose.)
- (MEDIUM) The evidence contract now refuses non-populace-us release ids:
  a generic id with the segment must not buy a weaker contract by
  deactivating the US-specific requirements.
- (MEDIUM) latest_release now refuses ANY tier field in latest.json —
  explicit 'certified' and null included; no certified producer writes one.
- (PLAUSIBLE, confirmed) An evidence attempt refused for an unowned failure
  now falls through to the same failed-run path as a certified gate failure,
  #568 weight-evidence sidecar included, before re-raising the refusal.
- (COVERAGE) New AST guard pins the main() conversion shape: every terminal
  'Release gates failed' raise after the #548 accumulator is conditioned on
  --evidence-release, every one before it is unconditional, the all-green
  refusal precedes the manifest write, and _build_manifests receives the
  owned record.

Adjudicated without change: the certified-path refusal of '-evidence-' ids
is the intentional reserved-namespace guard (disclosed in the PR body);
LatestPointer.tier is a deliberate additive API field, now in the changelog
fragment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…limited acknowledgment (#506)

Round-2 adversarial findings on the round-1 fixes, all confirmed and fixed:

- (HIGH) './latest.json' dodge: root-artifact paths must now already be in
  canonical clean relative POSIX form before the reserved-pointer check —
  a path the Hub would canonicalize differently is refused outright; bare
  file names are enforced for every release-dir upload (extra_files
  traversal included).
- (HIGH) Fail-open binding: the evidence contract now REQUIRES both locally
  checkable records to exist and be list-of-strings shaped —
  build_manifest gates.calibration.failures and calibration_diagnostics
  build.release_gates.failures (the run's merged terminal record) — and
  binds both into known_failures verbatim. Deleting a record now refuses
  instead of disabling its binding.
- (HIGH) Coverage-gate failures are now bound: us_source_coverage
  gate.failures must each ride within a known_failures entry, and the
  builder records them (prefixed, owner-checked) at the evidence tier so a
  real build with a failing coverage gate stays publishable-by-construction.
- (MEDIUM) Acknowledgment matching is now name-delimited against the
  diagnostics' own target names (ctc_amount can no longer be satisfied by
  an actc_amount entry), with the quoted-token fallback only when a
  recomputed failure names no target.
- (MEDIUM) The AST guard now pins polarity (exact certified-guard forms),
  the exact guard chain of the all-green refusal, the forwarded
  evidence_known_failures Name (not a constant), the owned-record
  assignment, and all five owner-resolution sites.
- (MEDIUM, adjudicated) A telemetry-crash failure appended after the batched
  owner check exports the H5 before the next owner check refuses manifests —
  consistent with the #568 late-gate doctrine (weights retained in the
  written dataset); now documented at the conversion site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Cross-family review trail (sol, 2 rounds)

Both rounds ran gpt-5.6-sol (ultra effort, read-only) against the committed diff only, with an adversarial brief enumerating the tier invariants. Every finding was adjudicated; fixes landed as their own commits so the trail is inspectable.

Round 1 (on the initial three commits) → fixed in 7032f3ad

  1. HIGH, fixed — pointer isolation bypassable via manifest-declared root artifacts (an artifact entry whose path IS latest.json). Both pointer paths now reserved against root artifacts on both tiers, tested in both directions.
  2. HIGH, fixedknown_failures unbound from recorded gate results (fabrication/softening possible). Bound in round 1 to gates.calibration.failures + recomputed critical-fit breaches.
  3. MEDIUM, fixed — generic release ids (acme-evidence-build) deactivated the US-specific requirements; the evidence contract now requires the populace-us- prefix.
  4. MEDIUM, adjudicated no-change — certified builds refusing -evidence- ids is the intentional reserved-namespace guard (a formerly-accepted hypothetical id now refuses; disclosed in the PR body, pinned by test).
  5. MEDIUM, fixedlatest_release accepted explicit tier: certified/null payloads; now ANY tier field in latest.json refuses.
  6. LOW, acceptedLatestPointer gained a defaulted tier field (additive API change; in the changelog fragment).
  7. COVERAGE, fixed — main()-flow conversions were unpinned; added the AST control-flow guard.
  8. PLAUSIBLE, fixed — an evidence attempt refused pre-export for an unowned failure lost the CG tail transfer: field-local donor quarantine + mass-conserving own-tail stratum + E01000 receipt (#567) #568 weight-evidence sidecar; refusals now fall through to the certified failed-run path (sidecar included) before re-raising.

Round 2 (on the round-1 fixes) → fixed in 3850350c

  1. HIGH, fixed./latest.json dodged the raw-string reserved-path check; root-artifact paths must now be canonical clean relative POSIX form, and all release-dir uploads must be bare file names (extra_files traversal included).
  2. HIGH, fixed — binding was fail-open when gates.calibration was deleted; both locally checkable records (gates.calibration.failures, diagnostics build.release_gates.failures) are now REQUIRED and shape-checked, then bound verbatim.
  3. HIGH, fixedus_source_coverage gate.failures were relaxed but unbound; now each must ride within a known_failures entry, and the builder records them (owner-checked) at the evidence tier.
  4. MEDIUM, fixed — acknowledgment matching hardened to name-delimited against the diagnostics' own target names (ctc_amount no longer satisfiable by an actc_amount entry). Residual caveat, documented in the helper docstring: the binding guarantees each recorded failure is named with an owner; prose sentiment around it is for human review, as in the Adjudicate the medical-dental publish tolerance to 0.25 pending the loss-contract alignment #490 register pattern.
  5. MEDIUM, adjudicated no-change — a _TerminalBatchTelemetry crash line appended after the batched owner check exports the H5 before the final owner check refuses manifests; consistent with the CG tail transfer: field-local donor quarantine + mass-conserving own-tail stratum + E01000 receipt (#567) #568 late-gate doctrine (weights retained in the written dataset), now documented at the conversion site.
  6. MEDIUM, fixed — the AST guard had mutation false-passes (polarity flip, evidence_known_failures=None, unreachable refusal); now pins exact guard forms, the exact refusal guard chain, the forwarded Name, and all five owner-resolution sites.
  7. PLAUSIBLE, fixedextra_files traversal covered by the bare-file-name rule above.

Round-2 'held' list (attacked, no hole): verbatim-binding on well-formed records, non-empty/owned known_failures, exact-path reservation, in-dir latest.json uploads staying under releases/<id>/, tier-field rejection, certified byte-identity of the three raise sites and sidecar branch, single-sidecar refusal ordering, final owner recheck closing late unowned failures, and the id-scope triple (prefix + UK exact-k + role refusals).

🤖 Generated with Claude Code

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