Skip to content

contracts(apr-pretrain-from-init): v1.2.0 → v1.3.0 — FALSIFY-INIT-ARCH-MATCH-001 (§86.6 closure)#1761

Merged
noahgift merged 3 commits into
mainfrom
feat/contract-init-arch-match
May 17, 2026
Merged

contracts(apr-pretrain-from-init): v1.2.0 → v1.3.0 — FALSIFY-INIT-ARCH-MATCH-001 (§86.6 closure)#1761
noahgift merged 3 commits into
mainfrom
feat/contract-init-arch-match

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

Closes the §86.6 contract follow-up: codifies the INV-INIT-ARCH-MATCH-001 invariant authored as runtime code in PR #1760.

Changes to apr-pretrain-from-init-v1.yaml

  • Bumps version 1.2.0 → 1.3.0 with changelog entry.
  • Adds FALSIFY-INIT-ARCH-MATCH-001 falsification test — bound to the unit-test family cargo test -p aprender-train --lib inv_init_arch_match_001 (7 tests authored in feat(pretrain): INV-INIT-ARCH-MATCH-001 — fail-fast on arch-mismatched --init (§86.6) #1760 covering canonical §86 reject + inverse + matching + skip cases).
  • Adds INV-INIT-ARCH-MATCH-001 proof_obligation — safety invariant: when both metadata.architecture and tensor-name-inferred family resolve to concrete distinct slugs, gate MUST fail-fast before any training step. No false-positive when either side returns \"unknown\".

Salvage path (in the error message)

apr stamp <pre-p0k.apr> --architecture qwen2 --hf-architecture Qwen2ForCausalLM \
                       -o <stamped.apr>
apr pretrain --init <stamped.apr> ...

Requires PR #1757 (apr stamp HF identity extension).

Test plan

  • cargo test -p aprender-contracts --lib lint::gates::tests::load_contracts_real — passes (schema valid)
  • All new YAML fields conform to the contract schema rules from feedback_contract_schema_dryrun.md:
    • metadata.description already present
    • falsification_tests uses sequence form (not map)
    • proof_obligations.type is enum-valid (safety)

Refs

🤖 Generated with Claude Code

…H-MATCH-001 (SPEC §86.6 closure)

Codifies the INV-INIT-ARCH-MATCH-001 invariant authored as runtime code
in PR #1760 (`validate_init_arch_matches_tensor_evidence` in
aprender-train::train::pretrain_real). Adds:

- FALSIFY-INIT-ARCH-MATCH-001: integration falsifier bound to the
  unit-test family `cargo test -p aprender-train --lib
  inv_init_arch_match_001` (7 tests covering: canonical §86 reject,
  inverse reject, matching qwen2 accept, matching llama accept, None
  metadata skip, unmappable metadata skip, GGUF-unknown tensor skip).
- INV-INIT-ARCH-MATCH-001 proof_obligation: safety invariant — when
  both metadata.architecture and tensor-name-inferred family resolve
  to concrete distinct slugs, gate MUST fail-fast before any training
  step. No false-positive when either side returns "unknown".

## Salvage path

The error message includes an inline `apr stamp` recipe (PR #1757):

```
apr stamp <pre-p0k.apr> --architecture qwen2 --hf-architecture Qwen2ForCausalLM \
                       -o <stamped.apr>
apr pretrain --init <stamped.apr> ...
```

## Refs

- PR #1742 (PMAT-690 P0-K base — producer-side stamping)
- PR #1750 (P3-A `apr inspect --quality` — surfaces hf_identity=0/20 pre-stamp)
- PR #1754 (SPEC §85 P2-E findings — context)
- PR #1757 (apr stamp HF identity extension — salvage path)
- PR #1758 (SPEC §86 amendment — defect specification this contract closes)
- PR #1760 (INV-INIT-ARCH-MATCH-001 runtime implementation)
- memory/feedback_upstream_metadata_masquerade.md (methodology #33)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@noahgift noahgift enabled auto-merge (squash) May 17, 2026 15:05
@noahgift noahgift merged commit 971697a into main May 17, 2026
10 checks passed
@noahgift noahgift deleted the feat/contract-init-arch-match branch May 17, 2026 16:51
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