Repository navigation
Conversation
The blob gate (blob_gate::decide/blob_events) decided fetches and observes from a reference index that had no producer, so it was never wired into a serving path and blobs were served to any peer. - blob_gate: build_reference_index (with transitive HashSeq children), hashseq_children, fold_group_events (group log -> Worlds, world key = group create-hash hex), RefreshingWorlds (producer-swappable fold). - event_store: EventStore::document_references — applied, unremoved document.put events as (blob hash, group) pairs; LocalEvents exposes it. - serve: when the event store is open (web UI), BlobsProtocol runs the gate handler (push still decided by the AccessPolicy); a refresh task re-folds on the group-warning cadence so removals revoke fetch. Without the store, serve keeps push-only handling and warns the gate is inactive. - local: LocalNode::set_blob_gate lets an embedder supply the gate to serve(); default behavior unchanged. - groups::worlds::Worlds::empty for fail-closed fallbacks. Tests: blob_gate producer tests (index + HashSeq attribution, group-log fold gating, refresh revoking a removed member); existing suites pass.
fold_group_events partitioned the group log by world, but GroupLog::record names the log's global heads as after, so any second group's events name dependencies living in another partition. fold::index rejects those partitions with MissingDependency and build_blob_gate failed the whole gate closed, denying even authorized members. Keep only intra-partition after edges: ordering inside a world is preserved and membership reads each world's own projection, so no authority is lost. Adds a regression test with two groups where the second create names the first group's events, as a real group log would.
|
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 33 minutes. View limit details
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. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3c1b38e47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Some(gate) => BlobsProtocol::new( | ||
| &store_handle, | ||
| Some(crate::blob_gate::blob_events( | ||
| Arc::clone(gate), | ||
| crate::blob_gate::BlobPolicy::default(), |
There was a problem hiding this comment.
Preserve local blob reads when enabling the gate
When the web UI is enabled, this installs the membership gate on the same blob protocol used by the local CLI and REPL. However, LocalEvents::record always writes group: None, so documents published through LocalEvents::publish (including editor saves) are excluded from the reference index; ordinary uploads in commands/put.rs do not create document references either. Consequently, cmd_get_local, cmd_gethash, and REPL fetches are denied for these files even though their metadata remains accessible and the local client is trusted by build_access_policy. Wire a compatible reference/authorization path for existing local operations before enabling this gate unconditionally.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fa56e7e. The gate now counts local trust: decide_with_local admits fetch/observe from the node's own key and the data directory's client key — the two keys build_access_policy already trusts automatically for writes. id serve passes those as the gate's local readers; LocalNode passes its own node id. Locally published content (group: None documents, plain uploads) is therefore readable by the local CLI/REPL again, while remote peers still need world membership for every hash. Coverage: unit test a_local_reader_fetches_an_unreferenced_blob_but_a_stranger_cannot (blob_gate lib) and the peer-level test of the same name in pkgs/id/tests/blob_gate.rs (local reader fetches an unreferenced blob over the blobs protocol; a stranger is refused with the same denial code).
| let Ok(bytes) = store.get_bytes(hash).await else { | ||
| continue; | ||
| }; | ||
| let kids = crate::blob_gate::hashseq_children(&bytes); |
There was a problem hiding this comment.
Bound blob reads while building the reference index
For every referenced document, this reads the entire blob into memory merely to guess whether it is a HashSeq, including documents with no group that are subsequently discarded from the index. hashseq_children then allocates another hash vector for any 32-byte-aligned payload. With large persisted documents, startup now requires memory proportional to their full contents and can exhaust memory before the router starts; the refresh task repeats this scan every 60 seconds. Identify collection roots explicitly and bound or stream their parsing rather than loading arbitrary document contents during authorization-index construction.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fa56e7e. The HashSeq expansion in build_blob_gate is now bounded: (1) only group-referenced blobs are candidates — ungrouped references were read and then discarded from the index, exactly the waste named here; (2) a candidate is read into memory only when store.status reports it complete with a size that is a positive multiple of 32 and no larger than MAX_HASHSEQ_BYTES (1 MiB = 32768 children). The size comes from the store status, never from reading content, so building or refreshing the index no longer loads whole documents to guess whether they are HashSeq collections.
| #[cfg(feature = "web")] | ||
| let blob_gate: Option<Arc<crate::blob_gate::RefreshingWorlds>> = match &event_events { | ||
| Some(events) => { | ||
| let folded = build_blob_gate( |
There was a problem hiding this comment.
Document the authorization wiring before activating it
This changes production blob authorization without adding the design record required by pkgs/id/AGENTS.md for significant behavioral and architectural changes. A repository-wide Markdown search found existing records describing the gate as unwired, but no design record covering this integration's document-reference source, HashSeq inference, refresh/revocation timing, or ungated behavior without the web event store. Add the required dated document so these authorization trade-offs have a reviewable record.
AGENTS.md reference: pkgs/id/AGENTS.md:L159-L168
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in fa56e7e. Added the dated design record the protocol requires: doc/2026-11-13T09-00-00Z_design_blob_gate_authorization_wiring.md (pkgs/id/docs is a symlink to doc/). It covers the document-reference source (event-store document references, world key agreement, why group: None documents and artifacts are not sources), HashSeq inference (all-children-present plus the size bound), refresh/revocation timing (RefreshingWorlds swaps folds; removal takes effect at the next refresh, fail-closed on unreadable sources), local trusted readers, and the ungated behavior without the web event store (announced by a startup warning naming #173; opening the store in non-web serve is a separate, deliberately unmade change).
|
🤖 Agent note · salvage check — PR #3917 is fully contained in this PR; closing it as the duplicate
|
|
Unblocked 2026-11-13 under Drew's order "fix all fixable and reblocked" (set decisions-2026-11-13-blocked-review): queue task(s) 13492 released to the queue. The block rested on the premise that dezren39-authored work is Drew-owned — revoked by Drew's 2026-11-11 authorship ruling (dezren39 is the fleet's working identity; its issues/PRs are fleet work product, not a hold). Verified live at release: issue open, no Drew-hold labels (user/owned, held, do-not-auto-edit). |
… design record (#173) P1 (serve wiring): the gate now trusts the node's own key and the data directory client key as local readers (decide_with_local), mirroring build_access_policy — the local CLI/REPL keep reading locally published (group: None) and uploaded blobs with the gate on; remote peers still need world membership for every hash. P2 (reference index build): HashSeq expansion only considers group-referenced blobs and reads a blob only when the store status reports it complete with a positive multiple-of-32 size no larger than MAX_HASHSEQ_BYTES (1 MiB), so index building no longer loads whole documents into memory to guess at collections. P1 (docs): dated design record for the authorization wiring — reference source, HashSeq inference, refresh/revocation timing, local trust, and the ungated non-web behavior — per pkgs/id AGENTS.md. Tests: blob_gate lib 19 passed (new decide_with_local unit test), blob_gate integration 11 passed (new peer-level local-reader test: local reader fetches an unreferenced blob, stranger refused), documents 7 passed, content_removal 5 passed; cargo check --features web passes.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Agent note · task 5874 parked — Codex findings fixed; merge now needs a crate-split port
Done this shift (commit fa56e7e on this PR's branch): all three Codex findings on a3c1b38 are fixed and each thread has its disposition reply:
Why not merged: this PR is now CONFLICTING with main — not from its own content but from the pkgs/id crate split (#4407/#4408) that landed on main after the branch base: the gate core moved into Port plan (the resume steps, in order):
|
|
Agent note — shepherd map: Codex findings fixed at head; PR now needs a crate-split port before merge (task 13492, lane any-d, 2026-11-13) State verified fresh: PR OPEN, head fa56e7e, CONFLICTING vs current main. Issue #173's old "Drew-owned hard stop" is withdrawn — dezren39 is the fleet identity (Drew 2026-11-11), and the 2026-11-12 cleanup already released this task on that basis. Reviews: Codex's three findings (P1 local blob reads locked out when the gate is enabled; P1 design record required before activating authorization wiring; P2 unbounded HashSeq reference-index reads) were all fixed in head fa56e7e — the fixes are in this diff (decide_with_local local-trust admission, bounded/group-only HashSeq expansion, and doc/2026-11-13T09-00-00Z_design_blob_gate_authorization_wiring.md). Codex re-review of the fix head failed on usage limits, so the threads carry the author's fix replies without a bot re-check; the fixes must be re-verified by test at the ported head (below). Reconciliation map (trial merge on current main, aborted clean; nothing pushed): the pkgs/id crate split (step 7b, #4411, and the blob_gate split) moved every file this PR touches:
Acceptance gate for the port session: port the 5 branch commits onto current main per the map; |
|
🤖 Agent note · task 13492 picked up — resuming the crate-split port (lane any-a)
|
|
agent-note:v1 — PR #7181 closed as superseded by PR #9723 (task 5874, lane code-b) Salvage check (required before closing a duplicate): PR #9723 is a final-state port of this PR's five commits (f62c344, f588a77, 0b0736c, a3c1b38, fa56e7e) onto current main after the pkgs/id crate split, done as a per-file 3-way merge against the split's new homes and verified file by file. Nothing unique to this PR was left behind:
PR #9723 merged 2026-11-14T04:47:24Z (merge commit 3b8741d). Closing this PR as superseded; its branch can be deleted. |
|
🤖 Agent note · task 13492 — this PR is superseded by the crate-split port, PR #9734
|
|
🤖 Agent note · task 13492 — closing as superseded: the port merged as PR #9723 Update to the salvage note above: the canonical port is PR #9723 (merged 2026-11-14T04:47Z, commit 39b6187), built by the task 5874 lane in parallel with task 13492's identical port (PR #9734, now also closed as superseded). Verified fresh against |
Opened by the branch-disposition execution (2026-11-07) from branch
queue/5874-173-blob-gate-shepherd.Branch origin: queue branch for issue #5874.
This branch was laptop-local work (or a stranded remote branch) with real changes ahead of
mainand no PR. Per Drew's 2026-11-07 branch-disposition ruling, ahead branches with real changes get a PR; this PR surfaces the work for triage instead of leaving it stranded on a branch.Triage owner: batch issue in developing-today/code, "Unowned PR batch from branch disposition (2026-11-07)". Outcome per batch triage: close with reason, or route to impl/finish/merge as a follow-on fix task.
Evidence: branch-ahead review
~/workspace/scratch/branch-ahead-review-2026-11-07.md; execution log~/workspace/scratch/branch-disposition-2026-11-07.md.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.