Skip to content

feat(falsify-ship-009): MODEL-1 apr-provenance multi-bind PARTIAL discharge (10/10 — last MODEL-1 row)#1031

Closed
noahgift wants to merge 1 commit into
mainfrom
feat/falsify-ship-009-partial-discharge-stacked
Closed

feat(falsify-ship-009): MODEL-1 apr-provenance multi-bind PARTIAL discharge (10/10 — last MODEL-1 row)#1031
noahgift wants to merge 1 commit into
mainfrom
feat/falsify-ship-009-partial-discharge-stacked

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

Discharge FALSIFY-SHIP-009 (AC-SHIP1-009 "MODEL-1 teacher license + data provenance recorded in model.apr metadata") at PARTIAL_ALGORITHM_LEVEL via a SECOND binding on contracts/apr-provenance-v1.yaml v1.0.0 → v1.1.0 (stays ACTIVE).

  • First multi-model multi-bind on a single contract. The same apr-provenance-v1 contract now discharges BOTH MODEL-2 AC-SHIP2-012 (via the pre-existing gates) AND MODEL-1 AC-SHIP1-009 (via the new GATE-APR-PROV-004). The AprV2Metadata + serde-JSON decision rule is model-agnostic, so one contract cleanly carries both bindings.
  • MODEL-1 coverage 9/10 → 10/10 touched — SHIP-009 is the last MODEL-1 AC row needing a PARTIAL annotation, so MODEL-1 is now fully covered at the PARTIAL_ALGORITHM_LEVEL ship-gate surface.
  • Sixth falsification of the repeatedly stated "exhausted" verdict (SHIP-019 → SHIP-017 → SHIP-020 → SHIP-018 → SHIP-016 → SHIP-009); this one is strictly more surprising than the prior five because it is cross-model rather than another MODEL-2 lever.
  • 17 PARTIAL + 3 DISCHARGED across both models after this PR merges.

Changes

  • contracts/apr-provenance-v1.yaml v1.0.0 → v1.1.0 (stays ACTIVE): adds GATE-APR-PROV-004 binding AC-SHIP1-009 / FALSIFY-SHIP-009 at PARTIAL_ALGORITHM_LEVEL with ship_blocking: true; full ACTIVE promotion blocks on teacher .apr republish (PMAT-686) populating license / data_source / data_license as named fields — fixture-swap only, no code change.
  • crates/aprender-core/src/format/tests/provenance_tests.rs (NEW): 2 harness tests:
    • falsify_ship_009_apr_metadata_applies_to_model_1_teacher — AprV2Metadata teacher-representative round-trip (license="apache-2.0", data_source="qwen2.5-coder-7b-instruct", data_license="apache-2.0") through the serde-JSON path with field-level recovery assertions.
    • falsify_ship_009_gate_apr_prov_004_has_partial_discharge_markerinclude_str! YAML-binding test verifying the new gate carries correct binds_to / falsification_id / discharge_status / ship_blocking flags (SHIP-011 Rust-scaffold binding style).
  • crates/aprender-core/Cargo.toml: adds serde_yaml = "0.9" dev-dep for the YAML-binding test.
  • docs/specifications/aprender-train/ship-two-models-spec.md: v2.32.0 → v2.33.0 with verbose changelog entry; AC-SHIP1-009 table row updated to **(PARTIAL_ALGORITHM_LEVEL v2.33.0)**.

Stack

This PR is rebased onto the MODEL-1 PARTIAL stack:

Closes #1009 (the original SHIP-009 PR authored against an older main; superseded by this rebase).

Test plan

  • cargo run -p aprender-contracts-cli --bin pv -- validate contracts/apr-provenance-v1.yaml — 0 errors, 0 warnings
  • cargo test -p aprender-core --lib falsify_ship_009 — 2/2 tests pass
  • cargo test -p aprender-core --lib provenance — 81/81 tests pass (3 pre-existing SHIP-022 + 2 new SHIP-009 + rest of tree)
  • CI required checks (ci / gate, workspace-test) green before auto-merge

🤖 Generated with Claude Code

@noahgift noahgift enabled auto-merge (squash) April 23, 2026 17:32
@noahgift noahgift force-pushed the feat/falsify-ship-009-partial-discharge-stacked branch from 3bacf88 to 57adc9f Compare April 23, 2026 17:37
@noahgift noahgift force-pushed the feat/falsify-ship-009-partial-discharge-stacked branch 2 times, most recently from 49c7d53 to 68198ee Compare April 24, 2026 06:41
noahgift added a commit that referenced this pull request Apr 24, 2026
… race (ANDON paiml/infra#77) (#1043)

* fix(ci): per-PR cargo registry to break intel-runner concurrent-write race (paiml/infra#77)

ANDON 2026-04-24 — aprender 11-PR stack (#1031..#1042) all failing `ci / security`
and `workspace-test` with:

  error: couldn't read /home/noah/.cargo/registry/src/<crate>/lib.rs:
         Permission denied (os error 13)

and the rustix-0.38 equivalent (E0432 unresolved import `libc`/`libc_errno`
originating in the `syscall` macro, which the rustix build.rs regenerates from
src/ files — missing src/ → macro can't find libc crate → cascading errors).

FIVE WHYS
─────────
 1 `ci / security` fails: `cargo install cargo-audit --locked` hits EACCES
   reading `fnv-1.0.7/lib.rs`.
 2 EACCES: the file is missing OR owned by root (docker container creates
   extractions as root on the bind-mounted host registry).
 3 Concurrent writers: 16 self-hosted `intel-clean-room-*` runners bind-mount
   the SAME /home/noah/.cargo/registry — cargo extractions, the ci-reaper
   TTL sweep, and cross-container chown cycles all touch identical paths.
 4 Shared by design: ci.yml:49 was authored for throughput — re-downloading
   crates per job is ~200MB, so the host registry was shared across all
   runners. Race class not modeled.
 5 Precedent already exists: target/ hit the identical race under concurrent
   PRs (task #134) and was fixed by per-PR isolation on
   /mnt/nvme-raid0/targets/aprender-ci/<pr#>. The registry simply never got
   the same treatment.

ROOT CAUSE
──────────
Shared mutable bind mount + concurrent multi-runner write access ≈ guaranteed
race. The existing band-aid (PR #1025 "self-heal cargo registry cache",
cargo-ok + Cargo.toml marker check) only runs inside `ci / security` and
itself races with concurrent jobs that have already passed the cache check.

FIX (this PR)
─────────────
Mirror the target-dir pattern from ci.yml:55 for the cargo registry. Each
PR (or branch) gets its own registry under /mnt/nvme-raid0/cargo-ci/registry/<pr#>.
Docker auto-creates the leaf dir on first mount; the ci-reaper TTL sweep
(ci-reaper.sh:308) needs a companion infra update (paiml/infra#77) to include
the new /mnt path.

 - Removes: /home/noah/.cargo/registry:/usr/local/cargo/registry
 - Adds:    /mnt/nvme-raid0/cargo-ci/registry/${pr#|ref_name}:/usr/local/cargo/registry

Cost: ~200MB per PR on first run (cargo re-downloads crates). Same cost
profile as the target/ isolation fix, which the fleet already absorbed.
Once cargo-ci/registry/<pr#> warms on run 1, run 2+ hit the cache.

FOLLOW-UP
─────────
paiml/infra#77 tracks:
  - forjar recipe to pre-create /mnt/nvme-raid0/cargo-ci/ owner=noah:noah
  - reaper extension: GC /mnt/nvme-raid0/cargo-ci/registry/<pr#>/src with same TTL
  - once infra lands, drop the ANDON comment above

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci: trigger fresh run to pick up paiml/.github#32 security-job CARGO_HOME fix

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
…ce-v1 multi-bind

FALSIFY-SHIP-009 (AC-SHIP1-009 "MODEL-1 teacher license + data
provenance recorded in model.apr metadata") attains
PARTIAL_ALGORITHM_LEVEL by attaching a second binding to the same
C-APR-PROVENANCE contract that already discharges MODEL-2's
AC-SHIP2-012. The AprV2Metadata + serde-JSON decision rule is
model-agnostic, so one contract cleanly carries both discharges.

Changes:
- contracts/apr-provenance-v1.yaml v1.0.0 → v1.1.0 (stays ACTIVE):
  new GATE-APR-PROV-004 block binds AC-SHIP1-009 / FALSIFY-SHIP-009
  at PARTIAL_ALGORITHM_LEVEL with ship_blocking=true; full discharge
  blocks on teacher .apr republish populating license, data_source,
  data_license as named fields (PMAT-686 fixture-swap).
- crates/aprender-core/src/format/tests/provenance_tests.rs:
  - falsify_ship_009_apr_metadata_applies_to_model_1_teacher —
    teacher-representative round-trip (license="apache-2.0",
    data_source="qwen2.5-coder-7b-instruct", data_license="apache-2.0").
  - falsify_ship_009_gate_apr_prov_004_has_partial_discharge_marker —
    include_str! YAML-binding assertion that the new gate has the
    correct binds_to / falsification_id / discharge_status / flags.
- crates/aprender-core/Cargo.toml: add serde_yaml to [dev-dependencies]
  (needed for the YAML-binding test).
- docs/specifications/aprender-train/ship-two-models-spec.md v2.23.0
  → v2.24.0: new v2.24.0 amendment block documenting the first
  MODEL-1 PARTIAL and first multi-model multi-bind on one contract.

Pattern extensions:
- First MODEL-1 PARTIAL (prior six targeted MODEL-2).
- First multi-model multi-bind on ONE contract (prior PARTIALs each
  had a dedicated contract).
- Sixth falsification of the "exhausted" verdict: SHIP-019 →
  SHIP-017 → SHIP-020 → SHIP-018 → SHIP-016 → SHIP-009 — sixth is
  cross-model, strictly more surprising than the prior five.

All 5 provenance tests green (3 SHIP-022 + 2 SHIP-009).

Status after v2.24.0:
- MODEL-2: 3/12 ACTIVE + 7/12 PARTIAL = 10/12 touched (83.3%)
- MODEL-1: 9/10 DISCHARGED (via SHIP-TWO-001-MODEL-1-TEACHER tag) +
  1/10 PARTIAL (009). Will flip to fully ACTIVE when PMAT-686
  republishes teacher.apr with provenance fields populated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Contributor Author

Superseded by #1044 — 11-PR cascade collapsed into single squash-merge to avoid O(n²) rebase treadmill. Content identical; this branch's commit is in #1044.

@noahgift noahgift closed this Apr 24, 2026
auto-merge was automatically disabled April 24, 2026 11:42

Pull request was closed

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