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
//! QRY-6's A2-seal compile-fail guard.
//!
//! `crate::authority`'s own module doc ("Pinning the seal") states the
//! sealed/public split this crate's design depends on — `engine`, `decode`,
//! `provider`, `session`, and `statement_gate` all stay `pub(crate)`, so the
//! only way anything outside this crate can reach a query session is through
//! [`polyc_query::authority::QueryAuthority::scope_for`], which accepts
//! nothing but an already-verified `Principal` — but until this test existed,
//! that split was enforced by convention plus manual review alone (see that
//! module's own doc for why a trybuild harness was originally judged "more
//! machinery than the invariant warrants"). A PR that widens one of those
//! modules back to `pub` passes every other test and `just arch` cleanly;
//! this is the one check that catches it directly, by proving a snippet
//! compiled as an EXTERNAL crate (this integration test binary, which only
//! ever sees `polyc_query`'s own public surface, the same as any other
//! downstream crate) fails to name any of them.
//!
//! This guards two vectors, both exercised by the same fixture: a QUALIFIED
//! path into a sealed module (`polyc_query::engine::QueryEngine`, ...), and a
//! future CRATE-ROOT RE-EXPORT of a sealed item (`polyc_query::QueryEngine`,
//! ...) — `lib.rs` already does `pub use engine::QueryLimits;` for its one
//! legitimately root-exported item, so a qualified-path check alone would
//! stay green even if a later PR added e.g. `pub use engine::QueryEngine;`
//! next to it, defeating the seal while every qualified-path line kept
//! failing exactly as before.
//!
//! `crates/query/tests/compile-fail/sealed_modules.rs` is the fixture;
//! `sealed_modules.stderr` pins the expected rustc output. Regenerate the
//! `.stderr` after a deliberate wording change with `TRYBUILD=overwrite
//! cargo test -p polyc-query --test compile_fail`, then review the diff.