1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// QRY-6: every one of these modules is `pub(crate)` on `polyc_query` (see
// `crate::authority`'s "Pinning the seal" module doc, and `crate`'s own
// module doc for the full sealed/public split) — none of them, or the items
// inside them, may resolve from a crate that isn't `polyc_query` itself.
// `authority` (`QueryAuthority`/`Principal`/`ScopedQuery`), `output`
// (`QueryResultJson`), and the `SearchIndex`/`SearchIndexError` wiring handle
// re-exported at the crate root are the crate's genuinely `pub` surface and
// are deliberately NOT named here. `SearchIndex` widens nothing: `search_index`
// itself stays `pub(crate)` — the line below proves it — and the handle only
// lets a Container open, register, and supervise the projection. It reads
// nothing back out.
//
// The `core_*` modules and `credential` carry the projected query plane. They
// are sealed the same way and for the same reason: a root re-export of one
// would hand a downstream crate the read path's own internals. `core_redaction`
// is absent deliberately — it is `#![cfg(test)]`, so it is not in a normal
// build at all and cannot widen anything.
//
// This guards two vectors: a QUALIFIED path into a sealed module (the
// `polyc_query::<module>::<item>` lines below), and a future CRATE-ROOT
// RE-EXPORT of a sealed item (the unqualified `polyc_query::<item>` lines).
// `lib.rs` already does `pub use engine::QueryLimits;` for the one
// legitimately root-exported resource-config struct, so a qualified-path
// check alone would stay green even if a future PR added e.g.
// `pub use engine::QueryEngine;` at the root — that would make the engine
// reachable as `polyc_query::QueryEngine` from any downstream crate,
// defeating the seal, while every line below kept compiling to the same
// errors. The unqualified imports close that hole: each currently fails to
// resolve (E0432, nothing of that name at the crate root today); if a root
// re-export is later added, that one line starts compiling, its expected
// error disappears, and trybuild fails the diff.
use REGISTRY;
use QueryEngine;
use EventsTableProvider;
use QueryScope;
use check_statement_allowed;
use COMMITTED_TURNS_VIEW_SQL;
use PostingsRecord;
use evidence_of;
use CoreExecutionAdmission;
use DirectCoreMetadata;
use CompiledCoreQuery;
use CredentialAuthority;
use REGISTRY as ROOT_REGISTRY;
use QueryEngine as RootQueryEngine;
use EventsTableProvider as RootEventsTableProvider;
use QueryScope as RootQueryScope;
use check_statement_allowed as root_check_statement_allowed;
use COMMITTED_TURNS_VIEW_SQL as ROOT_COMMITTED_TURNS_VIEW_SQL;
use PostingsRecord as RootPostingsRecord;
use evidence_of as root_evidence_of;
use CoreExecutionAdmission as RootCoreExecutionAdmission;
use DirectCoreMetadata as RootDirectCoreMetadata;
use CompiledCoreQuery as RootCompiledCoreQuery;
use CredentialAuthority as RootCredentialAuthority;