Skip to content

R2: automatic claims check (pqdocket check) - #10

Merged
altrudev merged 3 commits into
mainfrom
altru/r2-check
Dec 5, 2026
Merged

altrudev merged 3 commits into
mainfrom
altru/r2-check

Conversation

@altrudev

@altrudev altrudev commented Dec 5, 2026

Copy link
Copy Markdown
Owner

R2: pqdocket check works out which post-quantum migration claims apply to a project, checks each one (including attempts to disprove it), and reports Verified / Partly shown / Unknown / Not met, with evidence and the next step for every gap. No typing needed; signing stays opt-in.

What's new

  • pqdocket check [folder]
    • Proposes claims automatically: no classical key establishment (always), uses ML-KEM, uses post-quantum signatures.
    • Checks them against the scan, CBOMs from other tools, and disproof checks.
    • Saves the claims to pqdocket-claims.json; disabled claims stay off.
    • Options: --cbom, --exclude "tests/**", --details, --output (schema schemas/verdicts.schema.json).
  • Disproof checks look where the scan is weakest:
    • key files (RSA/EC/OpenSSH keys, DH parameters)
    • Dockerfiles and deploy scripts (openssl dhparam, ssh-keygen -t rsa)
    • web server DH/ECDH settings
    • classical-only TLS group lists
    • pre-standard Kyber/Dilithium names
    • dependency manifests
  • pqdocket claim "api.example.com uses hybrid ML-KEM" adds a claim in plain English and echoes what it understood.
  • Rules:
    • Text matching alone never reaches Verified, and a CBOM only helps if it describes files in this folder.
    • Nothing is skipped silently: symlinks, unreadable folders, unknown file types and oversized files are gaps.
    • Dependency folders are named in the limits.
    • pqdocket's own outputs are never evidence.
  • Scanner: scan_path gains include and skip_dirs.
  • Version: 0.3.0.

Independent review

A separate reviewer that hadn't seen the work checked the spec and the diff. It found 11 issues, mostly ways to reach Verified too easily. All are fixed, each with a regression test, and the reviewer's reproduction folders no longer produce a wrong Verified. Cause and fix are in .altru/LESSONS.md.

Checks

  • pytest: 134 passed (41 new)
  • ruff check .: clean
  • mypy src: clean

Spec: .altru/specs/r2-check.md


Generated by Claude Code

- pqdocket check works out which claims apply (no classical key
  establishment; uses ML-KEM; uses post-quantum signatures), checks each
  against the scan, CBOMs from other tools and disproof checks, and prints
  Verified / Partly shown / Unknown / Not met with evidence and next steps
- Disproof checks look where the scan does not: key files, Dockerfiles and
  deploy scripts, web server DH/ECDH settings, classical-only TLS group
  lists, pre-standard Kyber/Dilithium names, dependency manifests
- Claims saved to pqdocket-claims.json and re-checked on later runs;
  disabled claims stay off; plain-English claims via pqdocket claim
- Text matching alone never reaches Verified; docs and images do not block
  it, unknown file types do; pqdocket's own outputs are never evidence
- Verdicts JSON (schemas/verdicts.schema.json), unsigned: signing is opt-in
- Version 0.3.0
- A CBOM only counts as evidence for Verified if its assets point at files
  that exist in the checked folder; otherwise the gap says so
- FN-DSA/Falcon found only in a CBOM is capped at Partly shown
- build/, dist/, target/ are now checked; dependency folders are named in
  the limits; symlinks and unreadable folders are listed as gaps
- Build files, manifests and key files get the full crypto rules
- OpenSSH, generic public keys and unrecognised id_rsa/id_ecdsa files count
  as possible counter-evidence
- pqdocket's own outputs recognised by content, not file name; the --output
  file is excluded, so repeated runs give the same answer
- Folder claims about another target are not judged on this folder
- Files too large or unreadable for a check become coverage gaps
- Claims file field types are validated
- One regression test per finding
Path.glob("tests/**") matches only folders before Python 3.13, so excluded
test folders were still scanned on 3.11 and 3.12.
@altrudev
altrudev merged commit 0b3c5fb into main Dec 5, 2026
4 checks passed
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