Repository navigation
Open
Labels
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingtriage:needs-decisionBlocked on a product/design decision
Milestone
Description
From the review of #2280. Lower priority, and exploratory: this may not turn out to be the right design, but it is worth evaluating.
The problem
History hiding is enforced separately at each read surface, for two rules:
- feat: DROP takes a graph and its history out of the ledger #2251's graph drop records;
- feat: TTL, history retention and proof-verified permanent erasure #2280's retention removal journal (targeted removal and erasure).
The read surfaces include:
- query execution, including EXISTS in HAVING / ORDER BY;
- dataset queries;
- time-travel and history ranges;
- search graph sources (BM25, vector);
- export and pack;
- raw commit reads, including those through a branch;
- the storage proxy's index blobs;
- query peers.
Each one checks on its own, so a surface that is missed leaks. #2280 found and fixed seven leaks this way, one surface at a time:
9b7f6c679: EXISTS in HAVING / ORDER BY1fe0504ea: dataset namespace decodingbd73be2a7,6942782ec: raw reads through a branch17a5ea32a: index blobs through the storage proxy54c9a0f9f,8b0bbf011: query peers' journal reads789ca70ee(feat: DROP takes a graph and its history out of the ledger #2251): graph drops
The idea
The reviewer's suggestion: fluree_db_query::ir::walk::for_each_pattern (fluree-db-query/src/ir/walk.rs), now shared by GraphReads, history reads and search sources, could be the start of a single visibility gate that every read surface goes through. A rule would be added once and would apply everywhere, and a new surface would get it by construction.
Why it may not be the right idea
- Not every surface is pattern-shaped. Queries are, but raw commit and blob reads, the storage proxy, pack/export, search indexes and query peers are not. One gate might end up a dispatcher over unrelated checks, without removing the per-surface work.
- It must stay free for ledgers that don't use these features. The per-query check is now an in-memory lookup that does nothing for ledgers without removals or drops (
bb59c127993313f66ee8991afa310facd5588dd1). A unified gate must not add walking or allocation for them. - A cheaper alternative may cover most of the risk: a conformance test matrix that runs every read surface against every hiding rule. It would catch a missed surface in CI without restructuring the code.
To decide
- Is one gate feasible across non-query surfaces, or only for query-shaped reads?
- Would a surface × rule test matrix give most of the safety for less?
- Does either fit the per-query cost budget for ledgers that use neither rule?
Metadata
Metadata
Assignees
Labels
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingtriage:needs-decisionBlocked on a product/design decision
Activity
bplatz commentedon Nov 15, 2026
From the review of #2377: the history refusal has now missed a runtime read four times, each one a read that no pattern in the query states:
9b7f6c679(EXISTS in HAVING/ORDER BY),1f5ba99cb(RDF list view),7a7e0987d(Cypherproperties()and hydration),5ba0609ff(policy conditions and class checks). For query-shaped reads, the structural fix is to refuse at the scan, using the subject and predicate a historical scan is actually bound to, instead of working out reads from the query text and its policies. That would also retire the exception list inreads_of(crawl, Cypher, rdfLists, wildcard paths and reasoning, which all count asEverything). The cost constraint above still applies: no per-scan work on ledgers without a removal.This is narrower than the single gate across surfaces described above, so whoever picks this up may want to split it into its own issue.