Skip to content

feat(ship-009): PARTIAL discharge first MODEL-1 gate via apr-provenance-v1 multi-bind#1009

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

feat(ship-009): PARTIAL discharge first MODEL-1 gate via apr-provenance-v1 multi-bind#1009
noahgift wants to merge 1 commit into
mainfrom
feat/falsify-ship-009-partial-discharge

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

Changes

  • contracts/apr-provenance-v1.yaml: v1.0.0 → v1.1.0 — add GATE-APR-PROV-004 with binds_to: AC-SHIP1-009, falsification_id: FALSIFY-SHIP-009, discharge_status: PARTIAL_ALGORITHM_LEVEL, partial_discharge_note, and full_discharge_blocks_on: "teacher .apr republish (PMAT-686) populating the three named fields".
  • crates/aprender-core/src/format/tests/provenance_tests.rs: 2 new tests —
    • falsify_ship_009_apr_metadata_applies_to_model_1_teacher — teacher-representative AprV2Metadata { license: Some("apache-2.0"), data_source: Some("qwen2.5-coder-7b-instruct"), data_license: Some("apache-2.0"), .. } round-trips byte-identically with no leak into custom.
    • falsify_ship_009_gate_apr_prov_004_has_partial_discharge_markerinclude_str!() YAML-binding asserts the new gate fields match exactly.
  • crates/aprender-core/Cargo.toml: add serde_yaml = "0.9" to [dev-dependencies] (needed for YAML-binding test).
  • docs/specifications/aprender-train/ship-two-models-spec.md: v2.23.0 → v2.24.0 with new v2.24.0 amendment block documenting the first MODEL-1 PARTIAL + first multi-model multi-bind.

Discharge status

Model Fully ACTIVE PARTIAL Touched
MODEL-2 3/12 7/12 10/12 (83.3%)
MODEL-1 9/10 (teacher shipped) 1/10 10/10

MODEL-1 AC-SHIP1-009 flips to fully ACTIVE the moment PMAT-686 republishes the teacher .apr with license, data_source, data_license populated as named fields — fixture-swap only, no code change, no contract change.

Test plan

  • cargo test -p aprender-core --lib format::tests::provenance_tests — 5/5 green (3 SHIP-022 + 2 SHIP-009)
  • cargo fmt --check -p aprender-core clean
  • cargo clippy -p aprender-core --lib -- -D warnings clean
  • pv validate contracts/apr-provenance-v1.yaml — 0 errors, 0 warnings
  • CI ci / gate + workspace-test green before merge

🤖 Generated with Claude Code

…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 added a commit that referenced this pull request Apr 22, 2026
13 workspace Cargo.toml edits converting pinned crates.io
versions of renacer, entrenar, entrenar-lora, batuta, and
trueno-graph to `{ workspace = true }` aliases pointing at
the in-tree crates (aprender-profile, aprender-train,
aprender-orchestrate, aprender-graph).

Root cause: after APR-MONO Phase 2/3 consolidation, several
crates still pinned old crates.io sibling versions. Each
carried a transitive dep on an older `aprender` (0.14.1,
0.27.8), producing a diamond that broke
`cargo clippy -p aprender` with an ambiguous-package error.

Post-fix metadata:
  aprender: 1 package (workspace 0.31.2)
  renacer / entrenar / trueno-graph: 0 crates.io packages

Unblocks main-andon (required CI checks) and PRs #1008
(FALSIFY-SHIP-016 PARTIAL) and #1009 (FALSIFY-SHIP-009 PARTIAL).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
noahgift added a commit that referenced this pull request Apr 22, 2026
* fix(apr-mono): eliminate sibling-pin diamond dep (muda)

13 workspace Cargo.toml edits converting pinned crates.io
versions of renacer, entrenar, entrenar-lora, batuta, and
trueno-graph to `{ workspace = true }` aliases pointing at
the in-tree crates (aprender-profile, aprender-train,
aprender-orchestrate, aprender-graph).

Root cause: after APR-MONO Phase 2/3 consolidation, several
crates still pinned old crates.io sibling versions. Each
carried a transitive dep on an older `aprender` (0.14.1,
0.27.8), producing a diamond that broke
`cargo clippy -p aprender` with an ambiguous-package error.

Post-fix metadata:
  aprender: 1 package (workspace 0.31.2)
  renacer / entrenar / trueno-graph: 0 crates.io packages

Unblocks main-andon (required CI checks) and PRs #1008
(FALSIFY-SHIP-016 PARTIAL) and #1009 (FALSIFY-SHIP-009 PARTIAL).

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

* fix(ci-lint): unblock workspace clippy exposed by sibling-alias activation

The sibling-alias MUDA fix in 3f38207 activates crates that were never
clippy-gated under main's red CI. This commit adds the minimum lint-unblock
changes needed for `cargo clippy --all-targets -- -D warnings` to pass.

Code fixes:
- aprender-compute GPU path (wgsl_forward, cached_matmul, dispatch, parallel):
  underscore-prefix unused vars, `.unwrap()` → `.expect()` with descriptive
  messages, collapsible_if, doc_lazy_continuation, allow map_entry, drop two
  bogus `contract_post_*!()` macro calls (type-mismatched, never compiled).
- aprender-graph/shortest_path.rs: add `#[must_use]` + doc on dijkstra_path,
  `.map_or(false, |&d| cost > d)` → `.is_some_and(|&d| cost > d)`.
- aprender-graph/pattern.rs: `mapping.iter()` → `mapping`.

Crate-level lint allows (pedantic lints carried over from pre-monorepo crates
— to be fixed per-lint in dedicated follow-up PRs):
- aprender-profile/src/lib.rs: 9 pedantic lints (renacer legacy).
- apr-cli/tests/*.rs (13 files): `disallowed_methods` etc for integration
  tests where `unwrap()` is idiomatic.
- apr-cli/examples/tool_calling_demo.rs: `disallowed_methods` for serde_json
  `json!` macro expansion.

Dead code (MUDA-aligned cleanup):
- Delete apr-cli/examples/probar_tui_testing.rs + federation_tui_demo.rs —
  both reference the removed `ratatui` crate and deleted `federation::tui`
  module.
- Drop matching `[[example]]` entries from apr-cli/Cargo.toml.

Verification:
  cargo clippy --all-targets -- -D warnings  # clean in 36s

Ported from closed PR #1010 (commit 4338cbf on fix/apr-mono-muda). Keeps
#1011's Cargo.toml changes intact; no conflicts with the MUDA fix commit.

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
noahgift added a commit that referenced this pull request Apr 23, 2026
…umns (Refs PMAT-680, PMAT-681)

The running "MODEL-1 coverage N/10" counter in amendments v2.24.0..v2.29.0
silently assumed AC-SHIP1-009 (apr-provenance `GATE-APR-PROV-004`
multi-bind) was live on main as the 1/10 baseline. On main `601c0740f`
that baseline is not live — `contracts/apr-provenance-v1.yaml` is still
v1.0.0 with 3 gates; the SHIP-009 multi-bind addition lives only in
open PR #1009 (commit `90598277a`, not a main ancestor).

This commit:
- Bumps spec **Version** 2.29.0 → 2.29.1 (correction, not new content).
- Inserts "v2.29.1 correction amendment (2026-04-23)" paragraph above
  the v2.21.0 amendment block, stating the corrected counts:
    MODEL-1 6/10 on main (not 7/10 as v2.29.0 claimed)
    MODEL-2 6/12 touched on main (not 10/12 as v2.23.x running claim)
- Adds "On-main status" column to §4.2 MODEL-1 AC table, mapping every
  AC-SHIP1-* row to one of {on main, PR #NNNN OPEN, stacked branch}.
- Adds "On-main status" column to §5.2 MODEL-2 AC table, mapping every
  AC-SHIP2-* row to one of {DISCHARGED on main, PARTIAL on main,
  PR #NNNN OPEN, blocked on task #132 Phase 3}.
- Retains prior amendment text unchanged under the correction to
  preserve audit history.

Five-Whys on the drift:
1. Why did the count say 7/10 when main holds 6/10? — Amendments
   v2.24.0..v2.29.0 computed N/10 as prior + 1 on every PARTIAL
   landed on a branch, not on ancestry check vs main.
2. Why didn't main-ancestry gate the count? — No automation bound
   spec claims to `git merge-base --is-ancestor`.
3. Why no automation? — Zero-Tolerance policy (§3 row #8, v2.16.0)
   was codified faster than the tooling that would enforce it.
4. Why did the assumed-ancestry drift accrete? — SHIP-009 PR #1009
   opened but review-stalled; every amendment after it was written
   against the expected (not actual) merge order.
5. Why no single-source-of-truth for AC status? — The spec itself
   is the source, and it's hand-edited. PMAT-683 adds the
   `cargo xtask audit-ship-two` CI gate that closes this loop.

Known residual drift:
- `bench/ship_007.rs:32` comment "MODEL-1 is now at 4/10 AC-SHIP1
  items touched (SHIP-008 + SHIP-009 + ...)" inherits the same
  bad assumption. Code comments are out of scope for this
  doc-only correction; leave a PMAT-follow-up for code-comment
  reconciliation once SHIP-009 PR #1009 lands.

Ticket closure: PMAT-680 (wrap-text count), PMAT-681 (on-main vs
in-PR columns).

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

Copy link
Copy Markdown
Contributor Author

Superseded by #1031 — rebased onto the MODEL-1 stack at v2.33.0. Closing in favor of the replacement once the new one merges.

@noahgift

Copy link
Copy Markdown
Contributor Author

Superseded by #1031; replacement rebased onto the SHIP-003/004/001 stack at v2.33.0.

@noahgift noahgift closed this Apr 23, 2026
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