feat: PqContainerInfo container inspection and pqfe inspect - #86
Merged
Merged
Conversation
The last major product ask from both external reviews: a supported way to answer "what would decrypting this cost, and which key do I need?" without hand-parsing the frozen header. PqContainerInfo.Read/TryRead/ReadFileAsync report the declared key source (new PqKeySource enum), KDF and work factors, chunk size, recipient count, control-character-sanitized provider id, and an exact plaintext-size upper bound (the same bound MaxPlaintextBytes enforces) — with zero key derivation or decryption, so it is safe on untrusted input and is the natural primitive for application policy gates. Structural acceptance mirrors the frozen reader exactly, pinned by a conformance-corpus consistency test across all 28 vectors (reject-format vectors must fail inspection; everything else must inspect and agree on the key source). Every value documented as UNAUTHENTICATED until a decryption succeeds. pqfe inspect <file> [--json]: human summary with the unauthenticated warning, or a tiny stable hand-built JSON schema (NativeAOT-safe, no reflection serializer) for scripts and policy gates. Freeze-safe: a new read-only API; no byte meaning or reader acceptance changes. 330x2 tests green (7 new); CLI smoke-tested on hybrid multi- recipient, Argon2id, provider, and garbage inputs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sym7RJ7ehNhbMXytE5rMmS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last major product item from both external reviews: supported container inspection, so no operator or service ever hand-parses the frozen header.
PqContainerInfoRead/TryRead/ReadFileAsyncreport what a header declares — key source (newPqKeySourceenum), KDF + work factors, chunk size, recipient count, sanitized provider id, and an exact plaintext-size upper bound (the same boundMaxPlaintextBytesenforces) — with zero key derivation or decryption. Safe on untrusted input; the natural primitive for policy gates ("hybrid recipients only", "no KDF above our budget", "nothing over 100 MB").pqfe inspect <file> [--json]Human summary (with the unauthenticated warning) or a tiny stable JSON schema — hand-built, keeping the CLI NativeAOT-safe. Smoke-tested live on hybrid multi-recipient, Argon2id, provider, and garbage inputs.
Verification
330×2 tests green (7 new, incl. the corpus mirror) · build clean · docs guard green · freeze-safe (new read-only API; no acceptance change).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Sym7RJ7ehNhbMXytE5rMmS