Skip to content

Add CLI verifier and epoch-based key rotation (v1.3.0)#10

Merged
bradleygauthier merged 2 commits intomainfrom
cli-keyring-v1.3.0
Mar 9, 2026
Merged

Add CLI verifier and epoch-based key rotation (v1.3.0)#10
bradleygauthier merged 2 commits intomainfrom
cli-keyring-v1.3.0

Conversation

@bradleygauthier
Copy link
Contributor

Summary

Adds the capsule CLI tool and epoch-based key rotation system, bumping the release to v1.3.0.

CLI (cli.py) — command-line tool installed as capsule via pip:

  • capsule verify <source> — structural, full (SHA3-256 recomputation), and signature (Ed25519) verification from JSON or SQLite. Output: colored terminal, --json, or --quiet (exit code only).
  • capsule inspect — display a capsule's full 6-section content by --seq or --id.
  • capsule keys info | rotate | export-public — keyring management.
  • capsule hash <file> — SHA3-256 utility.

Epoch-based key rotation (keyring.py) — NIST SP 800-57 aligned key lifecycle. Keyring at ~/.quantumpipes/keyring.json with atomic writes. Backward-compatible verification across rotations via fingerprint lookup. Seamless migration from single-key installations.

Epoch-aware signature verificationSeal(keyring=kr) resolves the correct epoch's public key from signed_by fingerprint.

Zero new dependencies (stdlib argparse + existing pynacl).

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • Breaking change (fix or feature that changes existing behavior)
  • Protocol change (modifies the CPS specification)
  • Documentation update
  • Test improvement

Checklist

Python reference (reference/python/)

  • Tests pass: cd reference/python && pytest tests/
  • Linter passes: cd reference/python && ruff check src/ tests/
  • Type checker passes: cd reference/python && mypy src/qp_capsule/
  • Golden fixtures pass: cd reference/python && pytest tests/test_golden_fixtures.py

TypeScript reference (reference/typescript/)

  • Tests pass: cd reference/typescript && npm test
  • Type check passes: cd reference/typescript && npx tsc --noEmit
  • Conformance passes: cd reference/typescript && npm run conformance

General

  • Documentation updated (if applicable)
  • CHANGELOG.md updated (if user-facing change)

Protocol Impact

  • No protocol impact (implementation only)
  • Protocol change (requires CPS version bump and golden fixture update)

Introduces the `capsule` CLI for verification, inspection, and key
management, plus an epoch-based keyring system for automated Ed25519
key rotation aligned with NIST SP 800-57.

New modules: cli.py, keyring.py with full test suites.
Epoch-aware signature verification in Seal. Updated docs, spec,
and changelog for v1.3.0.
- test_protocol_structure: assert "ts-v*" to match actual TypeScript
  release workflow tag prefix (was asserting "v*")
- storage.py: fix import order (ruff I001), accept **engine_kwargs
  forwarded to create_async_engine
- conftest: add autouse fixture that closes stale event loops left by
  pytest-asyncio before sync tests can orphan them via asyncio.run();
  use NullPool for test storage to avoid pooled connection leaks
@bradleygauthier bradleygauthier merged commit 0829eba into main Mar 9, 2026
11 checks passed
@bradleygauthier bradleygauthier deleted the cli-keyring-v1.3.0 branch March 9, 2026 03:53
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