Repository navigation
Description
Problem
A cascading delete needs to discover every live typed reference to a target entity, including inbound attributes it did not anticipate, in the same write transaction that will apply the delete. On the benchmark's pinned core (29dd5888), the unbound-attribute query falls back to an empty-prefix EAVT scan; an output limit does not bound examined facts. The external fact log rejects access during an active write. This blocks full-payload JNI DEL7 in SNB Interactive v2 tracking. It is distinct from #518, which handles a known attribute and value via AVET, and does not depend on choosing a new pending index implementation in #762.
Suggested implementation
- Expose a bounded incoming-reference lookup on the v3 write transaction. Take an exact typed Ref target and return live source-entity/attribute pairs across attributes in that transaction's current view. Do not match an identically named Keyword. An unknown target should return no matches without mutating the dictionary.
- Reuse the existing target-first VAET prefix on durable and large-write working trees. No durable key-format change appears necessary. For small writes, add or reuse target-keyed pending/staged lookups and merge them with the committed range using the existing visibility rules; staged retractions must shadow older assertions. Include WAL-recovered pending data. See snapshot selection.
- Bound both returned live links and records examined (or demonstrate an equivalent bounded seek over old versions). The current live-key cap limits emitted links, not target-local retracted or superseded history. Return a distinct budget-exhausted outcome rather than a silently partial set, so the caller can refuse the delete before any mutation. Do not fall back to a whole-index scan.
Acceptance tests
- Exact results with multiple inbound attributes, an unexpected relation, a same-spelling Keyword, and an unknown target; cover staged assertions/retractions, rollback, checkpoint/reopen, and WAL recovery in the applicable write paths.
- Instrument examined records: at fixed live degree, adding e.g. 100,000 unrelated facts does not introduce a linear scan. In a separate target-local history fixture, a low visit budget reports exhaustion even with few or no live links.
- Cover exact result-cap boundary and overflow. On either budget failure the caller can leave the graph unchanged; no partial graph update or durable-format change is required.
This issue is for the core lookup only. Retain the benchmark pin and track JNI DEL7 integration, its independent reference comparison, and qualification in the benchmark repo.
Activity
test(db): cover the default incoming-reference reader and compare loc…
docs(testing): record the CI results for the incoming-reference lookup (
Merge pull request #926 from project-minigraf/feat/924-incoming-refs
Merge pull request #29 from project-minigraf/feat/924-incoming-refs
docs: describe the incoming-reference lookup in write transactions (p…
adityamukho commentedon Nov 29, 2026
Done on
v3: the core lookup (#926), the JVM binding (project-minigraf/minigraf-java#29) and the docs (project-minigraf/minigraf-docs#104) are merged. Ships in v3.0.0. Parity for the other bindings is tracked in #925.