Repository navigation
feat(core,web): members-only (v0x03) and specific-people (v0x04) envelopes with conformance vectors - #392
Merged
Conversation
enc v0x03 seals members-only content of a public repository under a per-object key bound to the nonce and the AD, with a key commitment and 64-byte padding for discussion types; v0x04 (private::named) seals a letter to up to 16 identities by ECDH slots. The open path admits v0x01 only in private repositories and v0x03 only in public ones (DocHeader.vis). Private::from_resolution_mixed gives a public repository's members-lane keys whose git-plane seams stay public. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
gen.py writes mixed_doc_seal/open (v0x03: AD-bound key, commitment, padding, version-by-visibility) and named_envelope/_open (v0x04: n = 1, 3, 16 and the reader-rule negatives); the Rust harness runs them and opens every letter slot through the SDK's decrypt_property as a drift check. Six hand-written private vectors the generator does not produce are kept instead of deleted on each run. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
lib/private mirrors forge-core: sealMembersDoc and the openContent dispatch on enc[0] and doc.vis, tag 25 and the 64-byte padding in the TLV, and lib/private/named (noble ECDH over the full compressed point, WebCrypto AES) for letters. The conformance harness runs every mixed_doc and named_envelope vector and opens each slot through the evo-sdk facade as a drift check; encryption-key gains sealLetterAs/openLetterAs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… 0x02) A sealed artifact whose header carries a letter's slot block instead of an epoch: the file key is HKDF-Expand(PRK_obj, obj-pack ‖ 0x00 ‖ 0x02 ‖ fileId) and the whole header is every segment's AD. For the Maintainers environments of stream 1I. named_artifact vectors in gen.py, both harnesses. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… and 64 private-repos.md §3.7 (artifacts sealed to specific people), §4.1 (members v0x03: AD-bound per-object key, commitment, padding; specific-people v0x04 with its writer and reader rules; which version where), §4.3 (tag 25 for letters, 22-24 and 27 defined but reserved, the tag-64 padding record), §4.4, §10 and §11, whose new summary values gen.py asserts. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (94)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- a distinct private::Lane for a public repository's members lane: no
git-plane seams (ref hashes, codec, packs), artifacts sealed under the
lane key; Private is private-repo only again
- Unreadable::Letter ('letter') for a v0x04 document on the epoch-key path,
with the V4 guard in Rust doc::decrypt
- letter reader rule: the owner at slot 0, no identity twice, 33-byte sender
keys that are points; one checkRecipients helper in TS with length checks
- manifest/owner wiring documented on open_artifact and the letter openers
- zeroization of K_obj copies, members TLV on failure, artifact segments
- vectors: v04 on the content path, reserved tags 23/24/27, n 0/17,
truncated, refUpdate/config letters, non-point and uncompressed sender
keys, sender_not_slot0, duplicate_recipient, writer refusals; the
generator validates points and checks the writer rule independently
- spec: why the full commitment, not only the KCV, is checked
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 5, 2026
PastaPastaPasta
added a commit
that referenced
this pull request
Oct 5, 2026
Resolves the encryption-key.ts imports with #392's letters, and makes sealLetterAs send from the held key its sender slot names and openLetterAs try every held key (a letter does not say which of the reader's keys it went to). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
What
The shared crypto core for members-only content in public repositories (mixed-visibility phase 1, streams 1J, the crypto half of 1A and the crypto half of 1C). No UI, no write or read wiring: the lane, web-lane, dg and env streams build on this.
Members-only content,
encv0x03 (crates/forge-core/src/private/doc.rs,forge-web/lib/private/doc.ts)Unreadable(CommitMismatch), neverBadTagand never a silent drop.DocHeader.vis/PrivateDoc.visis the document's ownvis, which consensus holds equal to the repository's visibility. It is absent, and so private, by default. The open path admits v0x01 only in private repositories and v0x03 only in public ones; v0x04 is admitted in both. A writer refuses the other pairings too.private::Lane, not aPrivate. It implements none of the git-plane seams (ref hashes, codec, packs), so one object never answers for both planes.Lane::seal_docwrites v0x03 (its anchor config v0x02).Lane::seal_artifactseals members artifacts (a kind-70 long body, a Members environment) under the lane key, never as plaintext.Lane::epoch_keysgives keyed ref-name hashes for later phases.Specific-people letters,
encv0x04 (private/named.rs,lib/private/named.ts)recipientKeyId, aCOMMIT_obj, slot version0x02, the sender in slot 0,n ≤ 16,AD' = AD(0x04, epoch 0) ‖ SHA-256(H), and TLV tag 25 listing the recipients in slot order.senderKeyId, an ECDSA_SECP256K1 ENCRYPTION key;count(tag 25) = n, the owner at slot 0, no identity twice, and the reader's own id at its slot.owner_keys/ownerKeysmust be the keys of this document's (or this manifest's)$ownerId.open_contentreturns a distinctUnreadable::Letter('letter') for a well-framed v0x04 document.packHashbeforeopen_artifact.forge_core::envelope(platform_encryption). A newenvelope::SharedKeygives one ECDH per key pair.@noble/secp256k1and hashes the full compressed point (not the x-only slice) with WebCrypto AES.lib/auth/encryption-key.tsgains onlysealLetterAs/openLetterAs. They open the vault key for the call and then wipe it.DocHeader::ad_without_keys/docAdWithoutKeysgive the repoId-only, epoch-0 AD.Sealed artifacts under a specific-people header (DFPK version 0x02), for the Maintainers environments of stream 1I: the letter's slot block stands where version 0x01 has its epoch,
K_pack = HKDF-Expand(PRK_obj, "dash-forge/v2/obj-pack" ‖ 0x00 ‖ 0x02 ‖ fileId), and the whole header is every segment's AD. Whole-file open only.TLV. Tag 25 is legal only in v0x04. Tag 64 is the padding record. Tags 22–24 and 27 are defined in the spec but stay reserved, so no reader opens them.
Spec.
docs/security/private-repos.md§3.7, §4.1, §4.3, §4.4, §10 and §11. The new §11 values are asserted by the generator. §8.1/§17 rule text anddocs/errors.mdare left to the lane stream.Vectors
tools/private-repos-vectors/gen.py(independent Python,cryptography, secp256k1 by hand, points validated) writes 73 new files. Both harnesses run them byte for byte:mixed_doc_seal__*(11):v03_{comment,issue,review,inline,long_body}plusreview_empty,event_not_paddedand four refusals.mixed_doc_open__*(24):member,outsider_placeholder,commit_mismatch,forged_after_reveal_refused,v01_relabelled_refused,pad_roundtrip;no_lane,body_tampered,moved_to_other_target,v01_byte_relabelled_as_v03,v03_in_private_refused,v03_too_short;late,v04_publicandv04_private(Letter),config_anchor_public.named_envelope__n{1,3,16}, each with every recipient's open, plus six writer refusals (refused_*), checked independently in the generator.named_envelope_open__*(22):swapped_slots,not_a_recipient,other_slot_flipped,equivocating_slot,wrong_sender_key_type;…_purpose,sender_key_missing,sender_key_not_a_point,sender_key_uncompressed,other_owner,second_key_opens,recipient_list_short,sender_not_slot0,duplicate_recipient,reader_not_at_its_slot,epoch_not_zero,n_zero,n_seventeen,truncated,ref_update_refused,config_refused,slot_version_1_refused.named_artifact__n3andnamed_artifact_open__*(6).decrypt_property, the evo-sdkencryptedForfacade) with therepoKey.wrappeddeclaration as a carrier. This is test-only.private_*vectors are byte-identical. Six of them were committed by hand on master (efbb9f1, d0e6607), and the master generator deletes them on every run. AHAND_WRITTENkeep-list now preserves them; porting them into the generator is a follow-up.private_*.How tested
cargo fmt --all -- --check,cargo clippy -p forge-core --all-targets -- -D warnings,cargo test -p forge-core. Locally after the review fixes: fmt and forge-core clippy pass, built from this branch's sources under the shared-target staleness rule. The forge-core tests passed on an earlier run (823 lib tests), but the shared build directory may have served another branch's forge-core to that run, and the rule-compliant re-run was stopped by the disk watchdog. CI is the authoritative Rust gate for this head. Only forge-core changed, and no other crate uses the changed types.tsc --noEmit,next lint, copy lint,vitest run(365 files, 6,019 tests passed, 33 skipped).python3 tools/private-repos-vectors/gen.py --write-vectorsadds files only and leaves every existing file unchanged.python3 forge-contracts/schema/vectors.py --checkpasses.Limits
open_content/openContenthold no ECDH keys. A well-framed v0x04 document returnsUnreadable(NoKey)there and opens throughnamed::open/openLetter.Syet. That is a performance follow-up for the phase-2 documents.keyring::header_ofmust setvis;Keyring::openturns a v0x03CommitMismatchintoEarlierUseunderearlier_use(), andhidden_bucketfiles it under "wrong or missing key". It should be counted as not encrypted for this repo.long_bodyroom under v0x03 is 32 bytes less.🤖 Generated with Claude Code