Skip to content

feat(format): apr-code-parity-v1 5-gate PARTIAL discharge#1392

Closed
noahgift wants to merge 2 commits into
mainfrom
feat/codeparity-001-005-partial-discharge
Closed

feat(format): apr-code-parity-v1 5-gate PARTIAL discharge#1392
noahgift wants to merge 2 commits into
mainfrom
feat/codeparity-001-005-partial-discharge

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

@noahgift noahgift commented May 2, 2026

Summary

  • Binds FALSIFY-CODE-PARITY-001..005 from apr-code-parity-v1 at PARTIAL_ALGORITHM_LEVEL via 5 verdict functions.
  • 22 unit tests including 4×4 eligibility band for CODE-PARITY-005.
  • Algorithm-level coverage advances by 5 gates; runtime ship % unchanged.

Gates bound

Gate ID Rule
CODE-PARITY-001 Every row's cross-check passes (rows_passing == total)
CODE-PARITY-002 headline.counts matches actual row tally (shipped/partial/missing)
CODE-PARITY-003 Prose ↔ YAML (category, status, ticket) tuples match
CODE-PARITY-004 P0 ticket closed → row updated AND headline incremented
CODE-PARITY-005 Epic closeable iff shipped ≥ 9 AND missing ≤ 4

Pinned constants

  • AC_CODEPARITY_SHIPPED_FLOOR = 9
  • AC_CODEPARITY_MISSING_CEIL = 4

Five Whys

See commit message — captures vacuous-Pass for open tickets and why both shipped/missing bounds are required.

Test plan

  • cargo test -p aprender-core --lib codeparity_001_005 — 22 passed
  • PMAT pre-commit gates green
  • CI green

🤖 Generated with Claude Code

Binds FALSIFY-CODE-PARITY-001..005 from apr-code-parity-v1 at
PARTIAL_ALGORITHM_LEVEL via 5 verdict functions plus pinned
shipped-floor (9) / missing-ceil (4) constants.

- CODE-PARITY-001: every row's cross-check passes (rows_passing == total)
- CODE-PARITY-002: headline.counts == row tally (shipped/partial/missing)
- CODE-PARITY-003: prose ↔ YAML rows match (category, status, ticket)
- CODE-PARITY-004: P0 ticket closed → row updated AND headline incremented
- CODE-PARITY-005: epic closeable iff shipped ≥ 9 AND missing ≤ 4

## Five Whys

1. Why does apr-code-parity-v1 list 5 falsification IDs without
   algorithm-level discharge? PMAT lints flagged FALSIFY-CODE-PARITY-001..005
   as DRAFT and unbound at PARTIAL_ALGORITHM_LEVEL.
2. Why does that block ship? Coverage % cannot move while the
   parity-matrix-v5.1 contract has no algorithm-level verdict module.
3. Why a 3-tuple `(category, status, ticket)` for CODE-PARITY-003?
   The contract specifies "every (category, status, ticket) tuple
   matches." Including all three fields catches the regression class
   "ticket renamed in YAML but markdown still shows old name" — a
   pure category-only check would miss that.
4. Why vacuous Pass for CODE-PARITY-004 when ticket is open? The
   gate predicate is "ticket_closed → row_updated AND
   headline_bumped." When the antecedent fails (ticket still open),
   the implication is vacuously true. Returning Fail would penalize
   every PR-time check on a still-open ticket — not what the
   contract specifies.
5. Why pin both AC_CODEPARITY_SHIPPED_FLOOR=9 AND
   AC_CODEPARITY_MISSING_CEIL=4 (per the YAML acceptance_criterion)?
   The matrix v5.1 epic close gate is binary on both bounds — a
   single threshold (e.g., shipped/total ≥ 0.5) would let "shipped=9
   but missing=10" silently pass. Both bounds catch the regression
   class "sweep more partials into MISSING bucket without shipping
   anything new."

Adds 22 unit tests including a 4×4 eligibility band for CODE-PARITY-005.
Realistic-healthy walks the canonical 14/3/4 epic-eligible state;
pre-fix walks 5 simultaneous regressions (failing cross-check,
headline drift, prose drift, P0 ghost-close, premature epic close).

No runtime % shift; algorithm-level coverage advances by 5 gates.
@noahgift noahgift force-pushed the feat/codeparity-001-005-partial-discharge branch from 78714d5 to 12986d7 Compare May 11, 2026 15:26
@noahgift noahgift enabled auto-merge (squash) May 11, 2026 15:26
@noahgift
Copy link
Copy Markdown
Contributor Author

Superseded by #1637 (135-PR squash). The commit content is included verbatim in that PR's diff. Closing now to release runner slots; this PR would have auto-closed when #1637 merges.

@noahgift noahgift closed this May 12, 2026
auto-merge was automatically disabled May 12, 2026 09:21

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