This repository was archived by the owner on May 13, 2026. It is now read-only.
fix(query): skip unresolvable pre-tag atom refs with warn (alpha BLOCKER 4b171) - #566
Merged
Merged
Conversation
…KER 4b171) When Alice tags an existing schema with `org_hash` and then writes more molecules, the set-org-hash design intentionally does not migrate pre-tag atom data. Post-tag molecules ship through the org log fine, but a molecule whose ref contains a pre-tag atom uuid ships the ref without the backing atom — leaving a receiver (Bob) with an orphan ref that fails every unfiltered query on the shared schema with `Atom not found for key`. Fix: in `fetch_atoms_with_key_metadata_async_with_org`, when both the org-prefixed and unprefixed atom lookups miss for an org-scoped read, log a warning and skip the ref instead of erroring the whole query. Personal reads keep the strict error so genuine data integrity bugs still surface. Adds two regression tests in `tests/org_key_prefixing_test.rs`: - `test_org_query_skips_unresolvable_pretag_atom_refs_with_warn` — org schema with a simulated sync gap (delete one atom at the Sled level), unfiltered query must succeed and return the resolvable molecules. - `test_personal_query_still_errors_on_missing_atom` — personal schema with a missing atom must still raise `InvalidField`. See gbrain `projects/alpha-e2e-dogfood-run-5` for repro context. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
shiba4life
disabled auto-merge
April 20, 2026 04:22
shiba4life
added this pull request to the merge queue
Apr 20, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Alpha BLOCKER 4b171, surfaced by dogfood run #5: Alice tags a schema with
org_hashafter ingesting. Post-tag molecules sync fine, but molecules whose refs point to pre-tag atom uuids ship the ref without the backing atom data — designorg_shared_sync.mdexplicitly does not migrate pre-tag molecules. Receiver (Bob) holds an orphan ref and every unfiltered query on the shared schema fails withAtom not found for key.Fix is query-side, scoped to org reads: when BOTH the org-prefixed and unprefixed lookups miss, log
warnand skip the ref instead of erroring out the whole query. Personal reads stay strict (genuine integrity bugs still surface). Option 2 from the run-5 followup — non-destructive, does not touch set-org-hash, does not re-emit pre-tag molecules (that would be option 3, separate task if we want it).Changes
src/schema/types/field/filter_utils.rs— onOk(None)after dual-read, iforg_hash.is_some(),log::warn!+continue. Else keep the existingInvalidFielderror.tests/org_key_prefixing_test.rs— two regression tests:test_org_query_skips_unresolvable_pretag_atom_refs_with_warn: org schema + simulated sync gap (delete atom at Sled level). Unfiltered query must succeed.test_personal_query_still_errors_on_missing_atom: personal schema + missing atom still raisesInvalidField.Test plan
cargo fmt --allcargo clippy --workspace --all-targets -- -D warnings— greencargo test --workspace --all-targets— greenRefs gbrain
projects/alpha-e2e-dogfood-run-5andprojects/alpha-e2e-dogfood-run-5/4b171severity:BLOCKER.🤖 Generated with Claude Code