Skip to content

fix(qa): format_parity SKIPs on non-GGUF primary instead of FAILing#907

Merged
noahgift merged 1 commit into
mainfrom
fix/qa-format-parity-skip-non-gguf
Apr 19, 2026
Merged

fix(qa): format_parity SKIPs on non-GGUF primary instead of FAILing#907
noahgift merged 1 commit into
mainfrom
fix/qa-format-parity-skip-non-gguf

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

  • apr qa <safetensors> previously exited 5 with "Failed gates: format_parity" because the gate treated a non-GGUF primary as a failure, not a category mismatch
  • Peer gates (ollama_parity, ptx_parity, capability_match, gpu_state_isolation, gpu_speedup) all SKIP cleanly on non-GGUF; format_parity now matches that convention
  • Surfaced by the 2026-04-19 MCP M4 free-form integration session against qwen2.5-coder-0.5b (evidence/mcp/m4-freeform-session-2026-04-19.md) — apr.qa via MCP correctly propagated isError: true, but the underlying CLI gate was the bug

What changes

  • run_format_parity_gate peeks the primary's 8-byte magic first (cheap) and SKIPs immediately on non-GGUF, before resolving the SafeTensors reference or reading the full (potentially multi-GB) blob
  • P0-QA-001 "never silently skip" invariant preserved — when the primary IS GGUF but the reference SafeTensors can't be found, the gate still FAILs with the actionable huggingface-cli download hint
  • Two regression tests gated on feature = "inference":
    • format_parity_skips_safetensors_primary — minimal .safetensors header → SKIP + "Non-GGUF"
    • format_parity_skips_apr_primary — APR magic bytes → SKIP + "Non-GGUF"

Verification

Before (reproducer):

$ apr qa qwen2.5-coder-0.5b-instruct/model.safetensors --json
...
FAIL format_parity: Primary model must be GGUF format for cross-format parity test
summary: Failed gates: format_parity
exit: 5

After:

$ apr qa qwen2.5-coder-0.5b-instruct/model.safetensors --json
...
SKIP format_parity: Non-GGUF format (format parity test compares GGUF vs SafeTensors forward passes)
summary: All QA gates passed (6 executed, 6 skipped)
exit: 0

Test plan

  • cargo test -p apr-cli --features inference --lib format_parity — 2 new tests green
  • End-to-end against qwen2.5-coder-0.5b SafeTensors — exits 0, passed_overall=true
  • CI ci/gate + workspace-test green

🤖 Generated with Claude Code

`apr qa <safetensors>` previously exited 5 with "Failed gates: format_parity"
because the format_parity gate treated a non-GGUF primary as a failure rather
than as a category mismatch. This surfaced in the 2026-04-19 MCP M4 free-form
integration session (see evidence/mcp/m4-freeform-session-2026-04-19.md) —
11 of 12 gates correctly SKIPped on non-GGUF, but format_parity alone FAILed,
which in turn made apr.qa via the MCP surface return isError=true on otherwise
healthy SafeTensors checkpoints.

Peer gates (ollama_parity, ptx_parity, capability_match, gpu_state_isolation,
gpu_speedup) all SKIP cleanly on non-GGUF with a reason string. This aligns
format_parity with that convention.

Also reorders the check so we peek the primary's 8-byte magic *before*
resolving the SafeTensors reference or reading the full (potentially multi-GB)
GGUF blob. When the primary isn't GGUF, we skip before doing any expensive
work. The P0-QA-001 "never silently skip" invariant still holds — when the
primary IS GGUF but the reference SafeTensors can't be found, the gate still
FAILs with the actionable `huggingface-cli download` hint.

Regression coverage:
- format_parity_skips_safetensors_primary — creates a minimal .safetensors
  and asserts SKIP + "Non-GGUF" message
- format_parity_skips_apr_primary — same for APR magic bytes

Verified end-to-end: `apr qa qwen2.5-coder-0.5b-instruct/model.safetensors`
now exits 0 with "All QA gates passed (6 executed, 6 skipped)".
@noahgift noahgift enabled auto-merge (squash) April 19, 2026 10:45
@noahgift noahgift merged commit f4ff5bb into main Apr 19, 2026
11 checks passed
@noahgift noahgift deleted the fix/qa-format-parity-skip-non-gguf branch April 19, 2026 10:59
noahgift added a commit that referenced this pull request Apr 19, 2026
…ffold

Cuts a patch release combining the two PRs that landed post-v0.31.0 (#907, #908)
plus incidental `cargo fmt --all` normalization across the workspace.

Wire-level changes:
- Workspace + root `aprender` package bumped 0.31.0 → 0.31.1
- All 60+ path-dep pins updated in lockstep so the published crates resolve
  against each other without range-version drift
- `opentelemetry` / `opentelemetry_sdk` / `opentelemetry-otlp` kept at 0.31.0
  (external deps — global sed caught them as false-positives during bump)

CHANGELOG.md covers:
- Fixed: `apr qa` format_parity gate SKIPs non-GGUF primaries (#907)
- Added: `pmcp = "2.3"` optional dep behind `pmcp-dispatcher` feature (#908)

Pre-push gates:
- cargo fmt --all (applied — 45 lines across 17 non-Cargo files)
- cargo test -p aprender-contracts --lib: 1371 passed / 0 failed
- cargo deny check advisories: advisories ok

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
noahgift added a commit that referenced this pull request Apr 19, 2026
…ffold (#909)

* chore(release): v0.31.1 — QA format_parity SKIP fix + MCP M5 pmcp scaffold

Cuts a patch release combining the two PRs that landed post-v0.31.0 (#907, #908)
plus incidental `cargo fmt --all` normalization across the workspace.

Wire-level changes:
- Workspace + root `aprender` package bumped 0.31.0 → 0.31.1
- All 60+ path-dep pins updated in lockstep so the published crates resolve
  against each other without range-version drift
- `opentelemetry` / `opentelemetry_sdk` / `opentelemetry-otlp` kept at 0.31.0
  (external deps — global sed caught them as false-positives during bump)

CHANGELOG.md covers:
- Fixed: `apr qa` format_parity gate SKIPs non-GGUF primaries (#907)
- Added: `pmcp = "2.3"` optional dep behind `pmcp-dispatcher` feature (#908)

Pre-push gates:
- cargo fmt --all (applied — 45 lines across 17 non-Cargo files)
- cargo test -p aprender-contracts --lib: 1371 passed / 0 failed
- cargo deny check advisories: advisories ok

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

* ci(release): disable sccache — sovereign-ci runner image missing rustc-sccache wrapper

The `sovereign-ci:stable` container image is currently missing the
`rustc-sccache` wrapper script, causing every sccache-gated CI job
(ci/test, ci/lint, ci/coverage, ci/gate) to fail at the rustc probe:

    error: could not execute process `rustc-sccache /.../rustc -vV`
      (never executed)
    Caused by: No such file or directory (os error 2)

Reruns fail identically — not transient.

Workaround: flip `enable_sccache: true → false` on this repo's
workflow input. The sovereign-ci reusable workflow reads this to set
`RUSTC_WRAPPER: ${{ inputs.enable_sccache && 'rustc-sccache' || '' }}`,
so disabling it removes the wrapper entirely and CI builds proceed
normally (just slower, since there's no compile cache).

Revert once paiml/.github ships a runner image with the wrapper
present — this is a temporary unblock for the v0.31.1 release PR.

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

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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