Chapter 56: Compliance Governance (pmat comply)

The pmat comply command is a comprehensive compliance governance system that validates projects against PMAT quality standards. It runs 30+ checks across infrastructure, code quality, language-specific best practices, and governance domains – producing a pass/warn/fail report for every check.

Overview

pmat comply check is the entry point. It loads project configuration from .pmat/project.toml and .pmat.yaml, runs all applicable compliance checks, and outputs a structured report. Checks that do not apply to your project (for example, Lua checks in a Rust-only project) are automatically skipped.

Each check produces one of four statuses:

StatusMeaning
PassMeets or exceeds the standard
WarnAdvisory issue, does not block compliance
FailViolation that must be fixed
SkipCheck not applicable to this project

A project is compliant if it has zero Fail results. In --strict mode, warnings also cause a non-zero exit code.

Basic Usage

# Run all compliance checks against the current directory
pmat comply check

# Run against a specific project path
pmat comply check --path /path/to/project

# Strict mode: exit code 1 on failures, exit code 2 on warnings
pmat comply check --strict

# Show only failures (hide passing and warning checks)
pmat comply check --failures-only

# Output as JSON for CI/CD consumption
pmat comply check --format json

# Output as Markdown for documentation
pmat comply check --format markdown

Exit Codes (Strict Mode)

Exit CodeMeaning
0Fully compliant, no warnings
1One or more failures
2No failures, but warnings present

Compliance Check Catalog

All checks are organized into four categories: Infrastructure, Code Quality, Best Practices (language-specific), and Governance.

Infrastructure Checks

These checks validate that the project’s tooling and configuration are properly set up.

Version Currency

Compares the version recorded in .pmat/project.toml against the running pmat binary version. Projects more than 5 minor versions behind receive a Fail.

# If your project is behind, migrate:
pmat comply migrate

Config Files

Verifies that required configuration files exist:

  • .pmat/project.toml – project version and compliance metadata
  • .pmat-metrics.toml – quality threshold definitions

Git Hooks

Checks that a PMAT-aware pre-commit hook is installed at .git/hooks/pre-commit. The hook file must contain “pmat” or “PMAT” to pass.

# Install hooks
pmat hooks init

CB-030: O(1) Hooks Cache

Validates that the hooks cache directory (.pmat/hooks-cache/) is initialized with either tree-hash.json or a gates/ directory, enabling O(1) pre-commit checks instead of full re-analysis.

# Initialize the cache
pmat hooks cache init

CB-031: Cache Health

Reads .pmat/hooks-cache/metrics.json and checks the cache hit rate. Requires at least 5 runs of data. A hit rate below 60% triggers a warning.

Cargo.lock Present

For Rust projects: verifies that Cargo.lock is committed for reproducible builds.

MSRV Defined

Checks for a rust-version field in Cargo.toml to ensure minimum supported Rust version is declared.

CI Configured

Looks for CI configuration in any of:

  • .github/workflows/ (GitHub Actions)
  • .gitlab-ci.yml (GitLab CI)
  • Jenkinsfile (Jenkins)

Quality Thresholds

Verifies that .pmat-metrics.toml exists with quality gate thresholds.

Deprecated Features

Scans for usage of deprecated PMAT features. Currently always passes.

Code Quality Checks

CB-200: TDG Grade Gate

The TDG (Technical Debt Grade) gate is one of the most important checks. It queries the SQLite index at .pmat/context.db and fails if any non-test function falls below the configured minimum grade.

Default minimum grade: A

Key behaviors:

  • Auto-reindex: If context.db is missing or stale (source files newer than the DB), pmat automatically rebuilds the index before checking.
  • Test exclusion: Functions in paths containing /tests/, /test/, or files ending with _test.rs / _tests.rs are excluded.
  • Path exclusion: Configure paths to exclude via .pmat.yaml or .pmat-gates.toml.
# .pmat.yaml configuration
comply:
  thresholds:
    min_tdg_grade: "B"       # A, B, C, D, F
    tdg_exclude_paths:
      - "vendor/"
      - "generated/"
# .pmat-gates.toml (overrides .pmat.yaml if both exist)
[tdg]
min_grade = "C"
exclude = ["**/*_generated.rs", "vendor/*"]

When violations are found, the output shows up to 10 offending functions:

CB-200: TDG Grade Gate: 3 function(s) below minimum grade A
    src/legacy.rs:20 bad_fn [D] (complexity: 42)
    src/awful.rs:30 terrible_fn [F] (complexity: 60)
    src/old.rs:15 needs_refactor [C] (complexity: 28)

CB-304: Dead Code Percentage

Scans src/ for dead code indicators:

  • #[allow(dead_code)] and #[allow(unused annotations
  • Commented-out code blocks (3+ consecutive lines of //-prefixed code-like content)
  • Block comments (/* ... */) containing code patterns

The default threshold is 15%. Projects between 15-30% receive a warning; above 30% triggers a failure.

Intelligent exclusions:

  • Test modules (#[cfg(test)]) are stripped before analysis
  • Heavily cfg-gated files (SIMD/arch-specific) are skipped entirely
  • macro_rules! blocks are excluded from item counting

CB-040: File Health

Scans Rust source files for oversized files and other health metrics using the file_health module. Checks file line counts against configured maximums.

CB-081: Dependency Health

A 5-point scoring system for Cargo dependency hygiene:

Sub-checkWhat it measures
CB-081-ADirect and transitive dependency counts
CB-081-BDuplicate crate detection (multiple versions)
CB-081-CFeature flag hygiene (default-features = false usage)
CB-081-DSovereign stack bonus (batuta ecosystem crates)
CB-081-ETrend tracking (delta since last check)

Scores 4-5 pass, 2-3 warn, 0-1 fail.

CB-060: ComputeBrick Compliance

For projects using the ComputeBrick ecosystem (trueno, probar, realizar). Validates:

  • CB-001/CB-002: WGSL shader safety (bounds checks, barrier divergence)
  • CB-020: unsafe blocks without // SAFETY: comments
  • CB-021: SIMD intrinsics without #[target_feature]
  • CB-BUDGET: Bricks without assertion/validation
  • BrickProfiler anomaly detection (CV > 15%, efficiency < 25%)

Skipped automatically for non-ComputeBrick projects.

OIP Tarantula Patterns (CB-120 to CB-124)

Advisory (non-blocking) checks for common defect patterns:

IDPatternSeverity
CB-120NaN-unsafe comparison (partial_cmp().unwrap())Error
CB-121Lock poisoning (mutex.lock().unwrap())Warning
CB-122Serde deserialization safety (from_str().unwrap())Error
CB-123Undocumented #[ignore] testsWarning
CB-124Low coverage thresholds (< 80%)Varies

These are tracked as advisory technical debt and reported as warnings even when critical patterns are found.

Coverage Quality Patterns (CB-125 to CB-127)

Unlike the OIP Tarantula patterns, these are blocking checks:

IDPatternWhat it detects
CB-125Coverage exclusion gamingcoverage(off) on production code
CB-126Slow testsTests with hardcoded sleeps or excessive durations
CB-127Slow coverage configSuboptimal coverage tooling configuration

Language-Specific Best Practices

Each language series is automatically skipped if no matching source files are found.

CB-500: Rust Best Practices (CB-500 to CB-530)

31 pattern detectors for Rust projects:

IDPattern
CB-500Publish hygiene (missing license, description, repository)
CB-501Unwrap density (excessive .unwrap() in production code)
CB-502Expect quality (.expect() without descriptive messages)
CB-503Clippy config (missing clippy.toml or configuration)
CB-504Deny config (missing #![deny(warnings)] or similar)
CB-505Workspace lint hygiene
CB-506String byte indexing (potential panics on multi-byte chars)
CB-507Panic macros in library code
CB-508Lossy numeric casts (as without bounds checking)
CB-509Feature gate coverage
CB-510include!() macro hygiene
CB-511Flaky timing tests (tests depending on wall-clock time)
CB-512Error propagation gaps (missing ? operator usage)
CB-513Silent error swallowing (let _ = result)
CB-514Debug eprintln leaks in production
CB-515Catch-all match/default arms
CB-516Hardcoded magic numbers
CB-517Stale debug artifacts
CB-518Expensive clone in loop
CB-519Lossy data pipeline conversions
CB-520Expensive initialization in loop
CB-521Format detection without magic bytes
CB-522Untested path normalization
CB-523External config over embedded
CB-524Incomplete enum match
CB-525Hardcoded field names
CB-526Single path resolution
CB-527Incomplete pattern list
CB-528Division by length (potential division by zero)
CB-530Log without clamp (numerical stability)

CB-600: Lua Best Practices (CB-600 to CB-619)

20 detectors for Lua projects, based on LuaTaint, FLuaScan, and luacheck research:

IDPattern
CB-600Implicit globals
CB-601Nil-unsafe access
CB-602pcall error handling
CB-603Deprecated/dangerous API usage
CB-604Unused variables
CB-605String concatenation in loop
CB-606Missing module return
CB-607Colon/dot method confusion
CB-608Unchecked nil/err
CB-609assert() in library code
CB-610String accumulator in loop
CB-611Weak table misuse
CB-612Test framework
CB-613Require cycles
CB-614Global protection
CB-615Coroutine checks
CB-616Type annotations
CB-617OpenResty checks
CB-618FFI safety
CB-619OOP patterns

CB-700: SQL Best Practices (CB-700 to CB-705)

6 detectors for SQL files:

IDPattern
CB-700SELECT * usage
CB-701Missing WHERE clause on UPDATE/DELETE
CB-702Implicit JOIN syntax
CB-703SQL injection patterns
CB-704Missing index hints
CB-705N+1 query patterns

CB-800: Scala Best Practices (CB-800 to CB-805)

6 detectors for Scala projects:

IDPattern
CB-800Mutable collection usage
CB-801null usage (prefer Option)
CB-802Wildcard imports
CB-803Explicit return statements
CB-804var declarations
CB-805Blocking calls in Future context

CB-900: Markdown Best Practices (CB-900 to CB-904)

5 detectors for Markdown files:

IDPattern
CB-900Broken internal links
CB-901Heading hierarchy skips (e.g., # to ###)
CB-902Missing alt text on images
CB-903Bare URLs (not wrapped in markdown links)
CB-904Long lines (exceeding configured maximum)

CB-950: YAML Best Practices (CB-950 to CB-954)

5 detectors for YAML files:

IDPattern
CB-950Truthy ambiguity (bare yes/no/on/off values)
CB-951Excessive nesting depth
CB-952Missing required fields
CB-953Unpinned GitHub Action versions
CB-954Plaintext secrets in YAML

CB-1000: MLOps Model Quality (CB-1000 to CB-1008)

8 detectors for ML model files (.gguf, .apr, .safetensors):

IDPattern
CB-1000Missing model card
CB-1001Oversized tensor count
CB-1002Missing tokenizer
CB-1004Missing architecture metadata
CB-1005Quantization mismatch
CB-1006Sharded model without index file
CB-1007Excessive file size
CB-1008APR format missing CRC

Governance Checks

CB-130: Agent Context Adoption

Validates that the project is set up for RAG-powered agent code search:

  1. Index exists: .pmat/context.idx or .pmat/context.db must be present
  2. Index is fresh: Less than 24 hours old
  3. CLAUDE.md configured: References pmat_query_code or pmat query
  4. Required patterns: CLAUDE.md contains NEVER use grep and --faults
  5. No forbidden patterns: No grep/find examples that bypass pmat query
# Build or refresh the index
pmat query "test" --rebuild-index

CB-300: Muda Waste Score

Aggregates the Seven Wastes (Toyota Production System) into a single quality health metric scored 0-100:

  • Overproduction: Dead code, unused dependencies
  • Waiting: Slow builds, slow tests
  • Inventory: Stale branches, unused configs
  • Over-processing: Excessive complexity
  • Defects: Bug density, SATD markers

Grades: Lean (90+), Efficient (70-89), Moderate (50-69), High (30-49), Critical (0-29).

CB-301: Reproducibility Level

Classifies project reproducibility following NeurIPS/ICLR standards:

LevelRequirements
GoldCargo.lock + CI + pinned deps + deterministic builds
SilverCargo.lock + CI
BronzeCargo.lock only
NoneNo reproducibility measures

CB-302: Golden Trace Drift

For projects using Renacer golden tracing: validates that renacer.toml exists and traces are still valid. Skipped if no renacer.toml is found.

# Validate traces manually
renacer validate --all

CB-303: EDD Compliance

For simulation projects (using simular or trueno-sim): validates that public functions document their mathematical models in doc comments. Requires 80% compliance to pass.

Sovereign Stack Patterns

For projects in the batuta ecosystem: checks for Five Whys debugging patterns, falsification tests, APR model usage, ticket references, and ML commit classification.

PAIML Dependencies Workspace

Validates that batuta ecosystem dependencies (trueno, aprender, renacer, etc.) are properly declared with workspace inheritance.

CB-1100: Custom Project Scores

Dynamic checks defined in .pmat.yaml under scoring.custom_scores. Each entry specifies a shell command that must output JSON with a score field. Fails if the score is below the configured min_score.

# .pmat.yaml
scoring:
  custom_scores:
    - id: "lighthouse"
      name: "Lighthouse Performance"
      command: "lighthouse --output json | jq '.categories.performance.score * 100'"
      min_score: 90.0
      severity: error

Configuration

.pmat.yaml

The primary configuration file for compliance. Place it in your project root.

comply:
  # Disable or configure individual checks
  checks:
    cb-060: { enabled: true, severity: critical }
    cb-500: { enabled: true, severity: warning }
    cb-130: { enabled: false }  # Disable agent context check

  # Global thresholds
  thresholds:
    coverage: 85.0
    complexity: 20
    dead_code_pct: 5.0
    min_tdg_grade: "B"
    tdg_exclude_paths:
      - "vendor/"
      - "generated/"

  # Suppression rules for false positives
  suppressions:
    - rules: ["CB-954"]
      reason: "max_tokens is an LLM parameter, not a secret"
    - rules: ["CB-501"]
      files: ["examples/**"]
      reason: "Examples use unwrap for brevity"
      expires: "2026-12-31"

quality:
  tdg_enabled: true
  min_tdg_score: 70.0

When a check is disabled via enabled: false, it appears in the report with Skip status and a note that it was disabled in .pmat.yaml.

Suppressions let you silence specific violation IDs for specific file patterns without disabling the entire check category. Suppressions can have an expiration date.

.pmat-gates.toml

Additional gate configuration, primarily used for the TDG grade gate and ComputeBrick settings:

[tdg]
min_grade = "B"
exclude = ["**/*_generated.rs", "vendor/*"]

[compute-brick]
gui_coverage_threshold = 80
max_cv = 15.0

Values in .pmat-gates.toml override corresponding values in .pmat.yaml when both are present.

.pmat/project.toml

Created by pmat comply init. Tracks the project’s PMAT version and last compliance check timestamp:

[pmat]
version = "3.3.0"
last_compliance_check = "2026-02-17T10:30:00Z"
auto_update = false

CI/CD Integration

GitHub Actions

name: PMAT Compliance
on: [push, pull_request]

jobs:
  comply:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install pmat
        run: cargo install pmat

      - name: Run compliance check
        run: pmat comply check --strict --format json > compliance.json

      - name: Upload compliance report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: compliance-report
          path: compliance.json

GitLab CI

comply:
  stage: quality
  script:
    - pmat comply check --strict --format json > compliance.json
  artifacts:
    when: always
    paths:
      - compliance.json

Using JSON Output Programmatically

The --format json output follows this schema:

{
  "project_version": "3.3.0",
  "current_version": "3.3.0",
  "is_compliant": true,
  "versions_behind": 0,
  "checks": [
    {
      "name": "Version Currency",
      "status": "Pass",
      "message": "Project is on latest version (v3.3.0)",
      "severity": "Info"
    }
  ],
  "breaking_changes": [],
  "recommendations": [],
  "timestamp": "2026-02-17T10:30:00Z"
}

Other Subcommands

Beyond check, pmat comply provides several supporting subcommands:

pmat comply init

Scaffolds a new project with PMAT compliance configuration:

pmat comply init
# Creates:
#   .pmat/project.toml   - version tracking
#   .pmat.yaml            - compliance configuration
#   CLAUDE.md             - agent context instructions

Use --force to overwrite existing files.

pmat comply migrate

Migrates project configuration to the latest PMAT version:

pmat comply migrate                     # Migrate to latest
pmat comply migrate --version 3.2.0     # Migrate to specific version
pmat comply migrate --dry-run           # Preview changes
pmat comply migrate --force             # Proceed past breaking changes

pmat comply diff

Shows the changelog between your project’s version and the current binary:

pmat comply diff                        # Show all changes
pmat comply diff --breaking-only        # Show only breaking changes
pmat comply diff --from 3.0.0 --to 3.3.0

pmat comply upgrade

Upgrades a project to a specific quality enforcement style:

pmat comply upgrade --target popperian --dry-run
pmat comply upgrade --target popperian

The Popperian upgrade installs strict enforcement: 95% minimum coverage, zero TDG regression, complexity limits, and Popper falsification contracts.

pmat comply enforce

Installs or removes mandatory git hooks for work tracking:

pmat comply enforce                     # Install hooks (with confirmation)
pmat comply enforce --yes               # Skip confirmation
pmat comply enforce --disable           # Remove hooks

pmat comply report

Generates a compliance report with optional ticket history:

pmat comply report --format markdown --output report.md
pmat comply report --include-history

pmat comply review

Layer 2 (Genchi Genbutsu): generates an evidence-based reviewer checklist with reproducibility, hypothesis, and trace evidence:

pmat comply review --format markdown --output review.md

pmat comply audit

Layer 3 (Governance): generates an audit artifact with sovereign trail. Requires clean git state:

pmat comply audit --format json --output audit.json

What Changed in v3.3.0

Version 3.3.0 introduced several compliance improvements:

  • CB-200 TDG Grade Gate with auto-reindex: The check now automatically rebuilds the SQLite index when context.db is missing or stale, removing the need to manually run pmat query before compliance checks. Staleness is determined by comparing source file modification times against the DB file.

  • .pmat-gates.toml overrides for CB-200: The [tdg] section in .pmat-gates.toml can now override the minimum grade and exclude patterns set in .pmat.yaml, giving teams a separate configuration surface for gate enforcement.

  • CB-500 series expanded to CB-530: New numerical stability checks (CB-528: division by length, CB-530: log without clamp) join the Rust best practices family, bringing the total to 31 detectors.

  • Suppression system for CB patterns: All language-specific best practice checks (CB-500, CB-600, CB-700, CB-800, CB-900, CB-950, CB-1000) now support the .pmat.yaml suppression mechanism, allowing teams to silence false positives with documented reasons and expiration dates.

  • CB-1100 Custom Project Scores: A new extensibility point allowing projects to define custom score commands in .pmat.yaml that are evaluated alongside built-in checks.

What Changed in v3.8.0

Provable Contracts Enforcement (CB-1200 Series)

Version 3.8.0 adds enforcement checks for the provable-contracts ecosystem. These checks ensure that contract YAML files in contracts/ are not “paper-only” — they must bind to real code with real preconditions.

CheckWhat It Does
CB-1208Binding Existence: Verifies that functions listed as implemented in contract YAMLs actually exist in the codebase. Repos where <80% of bound functions are found receive a FAIL. Detects “ghost bindings” — contract entries that name functions that were never written.
CB-1209Contract Trait Enforcement: Checks for a tests/contract_traits.rs file that validates contract trait implementations (e.g., Verifiable, Auditable).
CB-1210Precondition Quality: Analyzes precondition diversity across all contracts. Detects mass-generated boilerplate (>90% identical preconditions) and missing postconditions.
# Run comply check — CB-1208..1210 run automatically when contracts/ exists
pmat comply check

# Example output for a repo with ghost bindings:
#   ✗ CB-1208: Binding Existence: 10/29 bound fns not found
#     (L1, 66% verified, threshold: 80%)

Infrastructure Score Integration

The pmat infra-score command was added as a new top-level scorer (see Chapter 61). It evaluates CI/CD quality across 5 categories with a 100-point scale and 10 bonus points for provable contracts.

CUDA-TDG Default Mode

The pmat cuda-tdg command no longer hard-fails in default report mode. Quality gate enforcement is now exclusive to the pmat cuda-tdg gate subcommand, making the default mode safe for informational use.

Bug Fixes

  • DR-05: version.workspace = true in workspace members no longer triggers a false “Version true does not follow semver” failure.
  • validate-docs: No longer crashes when a directory has a .md extension (e.g., .pmat-work/docs/specifications/pmat-spec.md/).
  • perfection-score: Total score is now clamped to 200.0 maximum, preventing display of scores like 200.2/200.0.

What Changed in v3.14.0

Contract-First Binding Lifecycle (CB-1600..1649)

Version 3.14.0 adds 50 new pmat comply check gates spanning Components 27-31 of the PMAT work-contract binding lifecycle. Together they audit that every .pmat-work/<ID>/contract.json ticket stays anchored to real provable-contracts YAML — from the moment a binding is declared through Kani / Lean discharge.

How Skip Semantics Work

All CB-16xx checks follow a tiered skip-if-absent policy: if the upstream writer that produces the evidence (for example .pmat-work/<ID>/kani-harness-shas.json, falsification.log, or contracts/work/<ID>.manifest.json) has not yet landed, the check returns Skip with a tiered informational message rather than Fail. This is deliberate — it lets the enforcement gates ship before their corresponding writers, and the check automatically lights up the moment the evidence file starts being written. A Skip from one of these checks is not a failure; it just means the infrastructure on the producing side is still being built out.

Component 27: Binding Scope (CB-1600..1609)

Audits every ContractBinding declared in a ticket’s implements: array for internal consistency and anchoring against the referenced YAML.

CheckLevelSemanticSkip-if-absentFail mode
CB-1600L1Orphan detection: staged files with #[pmat_work_contract] attributes must be covered by an active ticket’s implements: rosterNo ticket directoriesUnbound staged file
CB-1601L1YAML SHA drift: ticket’s recorded SHA must match the current bytes of every cited contract YAMLNo bindingsBytes drifted since bind
CB-1602L1Unbind ledger audit: every .pmat-work/ledger/unbinds.json entry must cite a DEBT ticketLedger file absentEntry missing debt reference
CB-1603L3Inherited clause integrity: contract.require must contain every YAML-declared precondition of each bound equationNo bindingsMissing inherited precondition
CB-1604L2Postcondition weakening: inherited_postconditions must be preserved (strengthened or equal) in ensure: — delegates to validate_subcontracting()No inherited postconditionsPostcondition weakened or dropped
CB-1605L4Kani harnesses: every kani_harnesses[] declared in YAML must appear with success: true in .pmat-work/<ID>/kani-report.jsonNo harness decls or no reports yetHarness missing or failing
CB-1606L5Lean theorem gating: bindings whose YAML lean_theorem.status != "proved" require a BLOCK-ON-PROOF follow-up in contract.jsonNo lean_theorem: blocks anywhereUnproved theorem without block
CB-1607L3Equation identifier resolves in referenced YAMLNo bindingsequation: absent from YAML
CB-1608L1Cross-binding consistency: multi-bind tickets cannot mix passing and failing per-binding falsification.log entriesNo falsification logMixed pass/fail across bindings
CB-1609L1Cited YAML file must be tracked in gitNo bindingsYAML untracked / outside index

Component 28: Work Ladder (CB-1610..1619)

Audits the typed verification ladder (L0..L5) — the single ordinal that says how strongly a claim is discharged. Uses the weakest-binding-dominates rule (Liskov-Wing) to determine the max attainable level for a ticket.

L1..L5 ladder

LevelRequired evidence
L0No claim (ticket didn’t enter the ladder)
L1Runtime asserts / unit tests pass (verification-report.json with l1_test_evidence)
L2Codegen-wrapped preconditions + postconditions in place
L3Falsification suite clean (all falsification.log lines status: "pass")
L4Kani bounded model checking discharges every harness (kani-report.json with success: true, no status: "timeout" in falsification log)
L5Lean 4 theorem proved with sorry_count == 0 in lean-proof.json
CheckLevelSemanticSkip-if-absentFail mode
CB-1610L1verification_level string parses to a known variantNo ticketsUnknown level token
CB-1611L1Target level ≤ max attainable level across all bound YAML equationsNo ticketsTicket claims higher than bindings support
CB-1612L3L1 test evidence: verification-report.json carries l1_test_evidence with success/exit-code/status shapepmat work verify hasn’t recorded itEvidence shape invalid
CB-1613L3L3+ falsification.log lines must all be status: "pass"No tickets or no logAny failing line
CB-1614L4L4+ completion requires kani-report.json with success: trueComponent 24 runner absentHarness missing or failing
CB-1615L4Kani harness SHA matches bind-time snapshot (kani-harness-shas.json)No snapshot written yetHarness body edited post-bind
CB-1616L5L5 completion requires lean-proof.json with sorry_count == 0Component 24 Lean runner absentProof contains sorry
CB-1617L3Downgrade without --reason forbidden (ledger audit)No downgrades in ledgerLedger entry missing reason
CB-1618L1Level monotonicity: a ticket cannot drop level across checkpoints without an audited downgrade ledger entryNo checkpoint writer yetUnaudited level drop
CB-1619L3On completion, achieved level == target levelNo completed ticketsCompletion below target

Component 29: Falsification Unification (CB-1620..1629)

Bridges the bespoke FalsificationMethod enum with per-equation falsification_tests[] arrays in the YAML. A ticket bound to a YAML equation automatically inherits FalsificationMethod::ProvableContract{} entries — one per YAML test.

Migration cutoff — 2026-05-17. CB-1620 (inherited roster coverage) ships as a Warn through the migration window so existing tickets can backfill their roster without immediately going red. On 2026-05-17 it auto-promotes to Fail — the cutoff is hard-coded in check_falsification_unification_roster.rs. Make sure every bound ticket’s claims array has a ProvableContract{} entry per YAML falsification_tests[] id before that date.

CheckLevelSemanticSkip-if-absentFail mode
CB-1620L1Every binding has matching ProvableContract{} entries per YAML falsification_tests[] idNo bindingsWarn until 2026-05-17, Fail after — missing inherited entries
CB-1621L1ProvableContract{expected} snapshot must match current YAML scalar expected: valueYAML expected: is mapping/list shape (per-entry skip)Silent drift since bind
CB-1622L3Every ProvableContract roster entry has ≥1 execution line in .pmat-work/<ID>/falsification.logLog not written yetRoster entry never executed
CB-1623L3No duplicate (yaml_path, test_id) across a ticket’s rosterNo bindingsDuplicate roster entry
CB-1624L1Manual deletion audit: any action: "delete" in .pmat-work/ledger/roster-mutations.json must carry via_unbind: trueLedger file absentDeletion without unbind flag
CB-1625L3Any inherited log line with status != "pass" is fatal regardless of ticket levelNo logAny non-pass inherited line
CB-1626L1Referenced test_id exists in the YAML at scan timeNo bindingstest_id drifted / removed from YAML
CB-1627L3Post-bind YAML drift: warn when current YAML falsification_tests[] has IDs not seeded into the ticket’s rosterNo bindingsNew YAML test not backfilled
CB-1628L3Every inherited log line carries the 4-field shape {yaml, test_id, status, duration_ms}No logLines silently dropped post-runner
CB-1629L4L4+ tickets must not record any status: "timeout" line in their falsification logNo L4+ tickets / no logKani-adjacent timeout defeats L4 claim

Component 30: Codegen (CB-1630..1639)

pmat work codegen emits contracts/work/<ID>.rs modules of debug_assert! macros from contract.json clauses, and a #[pmat_work_contract(id = "...", require = "R1", ensure = "E1")] attribute wraps the target function so the generated preconditions/postconditions actually run at call sites.

CB-1634 tightening (v3.14.0). The gate now requires both the clause-level exprbinds_to pairing and the wearing #[pmat_work_contract(id = "<TICKET>")] attribute on a function in src/. A contract clause with expr but no binds_to is an orphaned codegen input — the generator has no target. A binds_to target that isn’t wrapped by the attribute means the generated asserts are never invoked at runtime. Both conditions must be satisfied.

CheckLevelSemanticSkip-if-absentFail mode
CB-1630L2Most recent pmat work codegen run succeeded (codegen/last-run.json)Receipt absentexit_code != 0 / status != pass
CB-1631L2Every #[pmat_work_contract(id = X)] in src/ has a contracts/work/X.rsNo attribute usagesMissing generated module
CB-1632L2Attribute’s require = "Y" / ensure = "Y" IDs match a clause id in the referenced ticket’s contract.jsonNo attribute usagesClause id not found
CB-1633L3contracts/work/<ID>.manifest.json SHA-256 entries match current bytes on diskManifests not emitted yetSHA drift detected
CB-1634L3Every expr clause has binds_to and every ticket with expr+binds_to clauses has ≥1 #[pmat_work_contract(id = "<TICKET>")] usage in src/No clause has expr yetOrphaned expr / missing attribute
CB-1635L3Every binds_to: "crate::a::b::c" target maps to a file in .pmat-work/<ID>/modified-files.jsonWork CLI not emitting diff receiptsTarget file not in diff
CB-1636L3codegen/compile-status.json reports generated macros compile in both debug and releaseReceipt absentEither profile failed
CB-1637L2+Every modified .rs file declaring pub fn carries a #[pmat_work_contract(id = X)] attributeNo L2+ tickets / no modified-files.jsonPublic fn left unwrapped
CB-1638L3Generated contracts/work/*.rs modules are tracked in gitNo generated modulesUngenerated / untracked
CB-1639L4+Every L4+ ticket’s kani_harnesses[] names resolve to a harness body in kani/, tests/, harnesses/, or src/ that references contracts::work::<ID> or the attributeKani integration absentHarness name doesn’t resolve

Component 31: CoT Proof Derivation (CB-1640..1649)

Restructures each chain_of_thought step as a typed node with assumption, implication, evidence_method, and discharged_by, then auto-derives proof obligations, falsification claims, and require/ensure clauses. The checks read hypothetical structured fields via serde_json::Value introspection so they are safe against today’s legacy { step, question, answer } shape and light up automatically once authors emit the new schema.

CheckLevelSemanticSkip-if-absentFail mode
CB-1640L3assumption.references resolve to prior step ids / implications, bound equation names, or axiomatic discharge (exact-string fallback when semantic-search vocabulary absent)No structured stepsDangling reference
CB-1641L3Every step with structured fields has an evidence_methodNo structured stepsStructured step without evidence
CB-1642L1evidence_method = ExistingTest path/name resolves on diskNo ExistingTest stepsTest file / name not found
CB-1643L3L3+ tickets: every structured step has assumption.expr or implication.exprNo L3+ tickets / no structured stepsStructured step missing codegen-ready expr
CB-1644L1.pmat-work/<ID>/agent-runs/<run_id>.json entries carry the replay schema (prompt_sha, tool_calls, commit_sha)Component 10 writer absentReplay field missing
CB-1645L3Derived contracts/work/<ID>.yaml is up-to-date with contract.json preconditions/postconditionsNo derived YAMLDerived YAML stale
CB-1646L1.pmat-work/<ID>/cot-digest.json SHA matches the canonical hash of chain_of_thought (detects manual edits that bypass pmat work cot derive)Digest absentManual edit drift
CB-1647L3No orphan steps — every step chains via discharged_byNo structured stepsUnchained step
CB-1648L4Every Axiomatic discharge in an L4+ ticket is either a bound equation invariant or a documented lemma (non-empty reason prose)No L4+ axiomatic dischargesUndocumented axiomatic
CB-1649L5Every structured step in an L5 ticket carries a Lean theorem/lemma mapping via lean_theorem, lean_lemma, evidence_method.LeanTheorem/LeanLemma, or discharged_by.LeanNo L5 ticketsStep missing Lean mapping

Reading the Reports

In --format json output, CB-16xx checks appear in the checks array alongside existing gates. A clean repo with none of the upstream infrastructure yet produces a long run of Skip entries — that is the expected baseline. As Components 24 (Kani/Lean runners), 10 (agent-run writer), and the pmat work codegen / pmat work cot derive CLIs ship, those Skips convert to Pass/Warn/Fail without any additional configuration on the consumer side.