Skip to content

Explore a single visibility gate for history hiding across read surfaces #2338

Open

Description

@bplatz

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:

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:

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

  1. Is one gate feasible across non-query surfaces, or only for query-shaped reads?
  2. Would a surface × rule test matrix give most of the safety for less?
  3. Does either fit the per-query cost budget for ledgers that use neither rule?

Activity

  1. added
    P3
    triage:needs-decision
    area:query
    on Nov 11, 2026
  2. added this to the 5.0.0 milestone on Nov 12, 2026
  3. bplatz commented on Nov 15, 2026

    @bplatz
    ContributorAuthor

    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 (Cypher properties() 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 in reads_of (crawl, Cypher, rdfLists, wildcard paths and reasoning, which all count as Everything). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:querytriage:needs-decision

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions