Repository navigation
feat(core,dg): members-only content foundations in public repos (lane 0, readers, verdict rule, key-aware membership) - #395
Merged
Conversation
Split the well-formedness predicate (content vs git plane), read sealed documents per document with placeholders for outsiders, count members-only review verdicts for every reader (D15), keep a document's audience fixed on edit, check a child's audience against its parent before sealing, and make the members-key anchor of a public repo settings-free (vis public). Membership changes key on the repo having a members key: dg collab add wraps, remove rotates, keys status/repair/rotate work on public repos with members-only content, and dg repo members enable|status turns it on. Readers hold the key (READERS_IN_MEMBERS_KEY); runners never do. E311, E312 and E313 are new. Members-only sealing (enc v0x03) is refused until the crypto stream's envelope lands. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # forge-web/lib/rules/conformance.test.ts
Members-only issues, comments, reviews and event values of a public repo are sealed with the crypto stream's v0x03 envelope (seal_members) and re-sealed on edit; the keyring opens them with the document's vis. A v0x03 commitment mismatch stays CommitMismatch (never EarlierUse) and is filed with tampered documents. The long-body room of members-only text uses MIN_V3. Adds comments_read (placeholders) and a members_only QA fixture example. 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 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (64)
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 |
…y content Scenario 38: enable the members key on a fresh public repo, check the settings still read from the plaintext config, add a reader (key shared), remove them (rotation to epoch 1, nothing to repair), and a non-member's members status reads it as on but not readable. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- Seal members-only content with the crypto stream's Lane (Keyring::lane), never a private repository's seams. - A reply's audience is the narrowest of its target, the comment it answers and the thread root (read once by thread_docs); dg plans the same. - Audience lookups fail closed: a missing target, root or event target is an error, never public; edits take the audience of the document read. - The web refuses membership changes of a public repo with members-only content until it shares and rotates the key itself. - Never mint epoch 0 over an existing sealed config; one definition of having a members key (any sealed config) everywhere. - Members-only issues are event and transition targets by number; a members key that cannot be read leaves placeholders, never a failed read; a member sees forged content as not encrypted for this repo. - Public sealed content is issues, PRs, comments and reviews only; long-body planning and the too-large message use the v0x03 room. - dg repo members enable routes an enabled repo to repair, tells a writer only maintainers can turn it on, and status reads the current epoch; the wrap estimate uses the measured cost. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 5, 2026
# Conflicts: # crates/forge-core/src/keyring.rs
# Conflicts: # forge-web/lib/rules/conformance.test.ts
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
Phase 1 of members-only content in public repositories (mixed visibility), stream "lane": DESIGN stream 1A (everything except the envelope crypto) and the Rust/
dghalf of stream 1F. The crypto stream's #392 (the v0x03/v0x04 envelopes) has merged; this branch includes current master.Everything keys on "this public repository has a members key" (a lane-0 anchor), never on visibility alone. Private repositories are unchanged: their anchors are byte for byte the same, and every
private_*vector passes unchanged.forge-core
is_well_formedbecomescontent_well_formed(a public repo also admitsencv0x03/v0x04 with an epoch and no plaintext; v0x01 stays private-only) andgit_plane_well_formed(plaintext only, used by the settings fold, the config timeline, the ref fold, and the public release fold / PR lookups by plaintext branch name). A unit test checks that the git plane refuses everyencversion on every kind.post_anchorbuilds its content withanchor_content(visibility, settings, link): a public repo's anchor isvis: "public", carries no settings and nobackend/archived, and has an empty TLV at epoch 0. Rotations and re-anchors carry nothing forward.enable_members_keywrites epoch 0 (self-wrap, anchor, confirm, wraps to every key-holding member);has_members_keyis what membership changes key on.open_withreads a plaintext document as it is and opens a sealed one. An outsider gets a placeholder (MembersOnly: id, author, time, number,asMember, and why it did not open), never E306/E307 or "not found". A public repo's keys load only when a sealed document is met.target_read,comments_readandListed::members_onlyexpose placeholders. A sealed issue or PR read by number throughissue()/patch()returns E311 (a member whose key was not shared yet), E306, or the new E313 (members-only).READERS_IN_MEMBERS_KEY(one constant) decides whether readers hold the key. Arunnerdocument is not a membership, so it never gets a wrap.asMemberon sealed writes. Theproof_refusedfallback never stripsasMemberfrom a sealed document.counted_reviewscounts a sealed review's plaintext verdict for every reader when it carriesasMember, whether or not the reader can open it. Private repos are unchanged (§8.1).Review::members_onlymarks verdict-only rows.edit_keeps_audiencerefuses a plaintext edit of a sealed document and a sealed edit of a plaintext one. A sealed document is always re-sealed as a whole.Collab::request_audience).store_long_bodytakes the audience and refuses a members-only text longer than its field: kind-70 sealed long bodies are not implemented, so nothing is ever stored as a plaintext artifact.doc::seal_members(v0x03) and are re-sealed on edit.Keyring::opensetsvisfrom the document. A v0x03CommitMismatchstaysCommitMismatch(neverEarlierUse) and is filed under "not encrypted for this repo". Members-only PRs are refused (phase 3).docs/errors.md: E311, E312, E313.private-repos.md: §8.1 updated for the split and D15; new §17 "Mixed repositories" (rule level).dg (1F, Rust half)
dg collab addwraps the key whenever the repo has a members key and the role holds it.dg collab removethen rotates: writer, triage and reader, plus a maintainer with the re-anchor. A role change to a role that does not hold the key also rotates. The pure plan functions (add_plan,remove_rotates) have unit tests. In a public repo, a member with no encryption key is still added, with a note to run repair later. A private repo still refuses that member.dg repo keys status|repair|rotatework on public repos with members-only content and return E312 otherwise.dg repo members enable(maintainers only): shows the measured cost (anchor 37M + 74M credits per member, from S1), asks "Turn on members-only content?" in the §10 copy (skip with--yes), then posts the anchor and the wraps. Newdg repo members status.Vectors
mixed_anchor__{public_settings_free,rotation_carries_nothing,…},approval_count__sealed_verdict_{member,outsider,…},mixed_edit__plaintext_refused(+5),content_well_formed__*(10),git_plane_well_formed__*(5). The TypeScript runner skips these cases until stream 1B ports them (MIXED_PENDING_CASESinlib/rules/conformance.test.ts).Not in this PR
git-remote-dashis unchanged. In phase 1 it never needs a key for a public repo, because refs and packs stay public until phase 3, so it does not load an identity (product L4 is moot until then).dg --membersflags and the placeholder rendering indg … viewbelong to 1E. The web side belongs to 1B/1D/1F-web.isWellFormed/privateGateparity belongs to 1B.Review round 1 (
4a919c33)private::Lane(Keyring::lane), never withPrivate. v0x04 opens giveUnreadable::Letter.thread_docsreads them once, anddg pr comment --reply-toplans with the same reads. Tested: a reply to a members-only reply under a public root is sealed.Issue,PatchandCommentcarry theaudienceof the document they were read from, anddgedits use it.grantMember,revokeMemberandchangeMemberRolerefuse a public repo with any sealed config ("This repo has members-only content turned on. Change its members with dg for now."). Covered bymembers-key-guard.test.ts. The enable prompt adds: change members only with an up-to-date Forge.Keyring::has_members_key,keyring::has_members_key; the web uses the same rule). Epoch 0 is never minted over an existing sealed config: an unresolved key is refused and pointed todg repo keys repair(enable_step, tested).dg issue close,lock,labelandcommentresolve the issue withtarget_read, so a maintainer can act on a members-only issue by number without reading it (TargetRead::target, tested). Members-only PRs still need a readable view; they come in phase 3.NotForThisRepo, the same "not encrypted for this repo" bucket ashidden_bucket(recorded for the web stream). E313's fixes now say why the reader can't open it.content_well_formed(Public)admits sealed issues, PRs, comments and reviews only (new vectorcontent_well_formed__public_ref_update_members).dgplans the room with the document's audience (v0x03 room for members-only text), and the too-large message quotes the members-only limit. Members-only long bodies (kind 70) stay refused.dg repo members.enableon a repo where it is already on goes todg repo keys repair(its own cost) or says it is already on.statusyouCanReadis about the current epoch.How tested
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace: green. forge-core lib: 839 passed, including the new mixed vectors, a v0x03 seal/open/reseal round trip, per-document read dispatch, the sealed-proof rule, and the anchor and plan tests. dg: 327 passed.vitest run lib/rules/conformance.test.ts lib/private/conformance.test.ts: 997 passed.4a919c33the gates were run under the cargo lock, with the staleness rule and no debuginfo:-D warnings: clean.cargo test --workspace: 1652 passed, 0 failed.tscand eslint clean, copy lint clean,vitest run6023 passed (33 skipped).7182277b), the same gates were run again: fmt and clippy clean,cargo test --workspace1752 passed, 0 failed, webtsc/eslint/copy lint clean,vitest run6113 passed (33 skipped). Thekeyring.rsconflict with feat(core,cli,web): protect the default branch and every tag by default (D6) #372 was resolved by passing the new default protected patterns into a private repository's epoch-0 anchor.dash-forge-qa/evidence/mv1/lane/e2e-38.log). Re-checked live: the writer's enable refusal,enableon a repo already on, and the removed reader'syouCanRead: false.e2e/cli/scenarios/38-members-key-reader.sh: enable, add a reader, remove them (rotation), keys status, and a non-member's members status.dash-forge-qa/evidence/mv1/lane/README.md, repoD1b5YCGH…/mv1-lane-qa-0353,dgf78dc5e, stale client = debug build of origin/master 40da852):dg repo members enable: the §10 prompt shows the measured cost (~0.00185 DASH for 2 members, 0.0015 actually spent). A writer is refused. Keys status reads "(public, members-only content on)", epoch 0.keyShared: true, no missing wraps). Removing them rotates to epoch 1, with wraps to the maintainer and the writer only.members_onlyfixture: an issue by the writer, a reader's comment on a public issue, a maintainer reply, and a writer's members-only approve. Outsiders and anonymous readers get placeholders only (#3 · members-only issue by …, asMember, NotAMember). Members open it. A public reply on the members-only issue is refused before signing.dg pr view(anonymous) showsapprovedBy: [writer]. The staledgshowsapprovedBy: [],hiddenReviews: 1(the conservative undercount).dg(member row, no wrap) sees NoKeyShared placeholders (the E311 state).dg repo keys statuslists them under missingWraps,dg repo keys repairwraps them, and they can then read.dg repo view,dg repo protect listandgit ls-remotefrom 40da852 are identical before enable, after enable and after the rotation (default branch main,refs/heads/mainprotected, same refs). Staledg issue view 3says E102 where the newdgsays E313.LANEQA-SECRET-*markers): only reads by members contain them.Design questions for the lead
MEMBERS_ONLYis new:issue()/patch()need an answer for an outsider who reads a sealed number, and the design lists only E311/E312. 1E will render the placeholder instead (target_read).🤖 Generated with Claude Code