Repository navigation
feat(atlas-search): resolve chunk occurrences by canonical hash (#3125 slice 3) - #13450
Conversation
…slice 3) Read side of the chunk_occurrences provenance registry slice 2 (aggregate.rs) writes: lookup_by_hash fans out over the shards the caller's TierCeiling admits, keyed by canonical SHA-256 (content identity, not per-shard chunk id). Pre-registry shards are skipped; real shard errors fail the lookup. get-chunk attaches the resolved rows as an occurrences array (absent when empty, like notes); monolith/local backends keep their shape via the trait default. Closes part of #3125
|
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 3 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: ✅ CompletedThis 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: 8001f3222d
ℹ️ 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".
…row sensitivity (#3125 slice 3) Addresses both Codex P1 findings on #13450. P1-1 (grant ignored on occurrence provenance): get-chunk stays an explicit-id tool — the chunk gate remains context.permits(...) under LocalOwner, preserving the documented Python parity — while the caller's Sensitivity is now threaded through run_get_chunk_with_context as `grant`. Every derived payload (occurrence provenance, neighbor expansion) uses context.effective_ceiling(grant), so a personal-capped caller no longer receives secret-tier source locators, and a personal-only service no longer requests a secret-tier fan-out. P1-2 (occurrence rows only shard-tier filtered): lookup_by_hash now joins chunk_occurrences to chunks and checks each row's own sensitivity against the caller ceiling, fail-closed to SecretBearing on an unrecognized label. personal and local-only both map to Tier::Internal, so the per-row check is what actually separates them inside one admitted shard. Tests (failing before the fix, green after): - occurrence_rows_are_filtered_by_their_own_chunk_sensitivity_not_just_shard_tier - get_chunk_occurrence_lookup_uses_the_effective_ceiling
Summary
Read side of the
chunk_occurrencesprovenance registry that slice 2 (#13216, aggregate.rs) writes:lookup_by_hashfans out over the scan shards the caller'sTierCeilingadmits, keyed by canonical SHA-256 content hash (not per-shard chunk id).get-chunkattaches the resolved rows as anoccurrencesarray (absent when empty, same shape rule asnotes). Monolith/local backends keep their shape via the trait default (empty).Moves #3125 rule 3 one step: registry rows become readable through get-chunk.
Evidence
cargo test -p atlas-core --test occurrences: 4 passed (lookup fan-out + legacy-skip, get-chunk surfacing, ceiling gating, per-row sensitivity) — includesoccurrence_rows_are_filtered_by_their_own_chunk_sensitivity_not_just_shard_tiercargo test -p atlas-core --test disclosure: 19 passed — includesget_chunk_occurrence_lookup_uses_the_effective_ceilingcargo test -p atlas-core --test aggregate --test occurrences --test disclosure --lib: 169 lib + 4 + 19 + 7 passedcargo test -p atlas-search: 43 passedecead345a7a4b99b26d42d2e839838ee261516fe54136d287847852a0ffe4f9f; fixtures assert lookup returns every admitted shard row for that hashset.select(same ladder as vector fan-out); each occurrence row further gated by its own chunksensitivityagainst the caller ceiling (fail-closed toSecretBearingon unknown labels); pre-registry shards skipped, real shard errors failReview fixes (Codex P1s)
Both Codex P1 findings addressed in
2ec9a09d444:run_get_chunk_with_contexttakesgrant: Sensitivity; the explicit-id chunk gate keeps its documented form (context.permitsunderLocalOwner, Python parity), while derived payloads (occurrence provenance, neighbor expansion) usecontext.effective_ceiling(grant). Server passes the job ceiling, CLI passescontext.ceiling().lookup_by_hashjoinschunk_occurrencestochunksand filters each row byc.sensitivityagainst the caller ceiling; both the tier ceiling and the full Sensitivity ceiling are threaded through the trait,Box<T>impl andShardedBackend.Merge Danger
Low. Additive: one new module (
occurrences.rs), one trait method with a default (empty), one ShardedBackend override, one optional get-chunk field. No schema change, no migration. Risk: a slow/failing shard now fails the get-chunk occurrences lookup the same way it fails vector search — intended (partial provenance is as wrong as partial search).Closes part of #3125
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T16:27:55Z", "session_id": "ses_e5df6d41c99ffecEDTR9A7JlCT", "lane": null, "host": "amd", "worktree": "/home/user/git/code-worktrees/3125-s3", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/user/git/code-worktrees/3125-s3", "repo": "developing-today/code", "branch": "code-f/3125-provenance-slice-3", "sha": "8001f3222d1c7359298ede6508bebce3af5f4c91" }, "auth_subject": "oc-code-07", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.