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
//! `RequestCacheDescriptor` — compile-time metadata for a `#[request_cache]`
//! resolver (AP2.1-7).
//!
//! A sibling to `AuthUser`: this is the *compile-time* contract the
//! `#[request_cache]` proc-macro generates against. The *runtime* container
//! lives in `crate::request_cache` (a separate top-level module); this
//! descriptor is pure data — a `&'static` const aggregated into the
//! Unified Application Graph by `arcature-build` so the Inspector,
//! `arc check`, and the MCP `system_checks` tool can show per-request
//! memoized resolvers without running the application.
//!
//! # No runtime here
//!
//! This module carries NO runtime behavior — no `RequestCache`, no
//! memoization, no locking. It is metadata only, matching the one-file-one-
//! responsibility law: the descriptor (this file) and the runtime
//! (`crate::request_cache`) are separate concerns. A small app that enables
//! `dx` but not `request-cache` gets the descriptor (so the UAG can record
//! declared resolvers) without the runtime.
//!
//! # Example
//!
//! ```ignore
//! // Generated by `#[request_cache]` in arcature-dx:
//! pub const LOAD_PROFILE_REQUEST_CACHE: ::arcature::RequestCacheDescriptor =
//! ::arcature::RequestCacheDescriptor {
//! name: "load_profile",
//! key_fields: &["user_id"],
//! };
//! ```
/// Compile-time metadata for a per-request memoized resolver.
///
/// The `#[request_cache]` proc-macro generates a `pub const <NAME>_REQUEST_CACHE:
/// RequestCacheDescriptor` for each annotated resolver. The descriptor records
/// the resolver's name and the names of the parameters that form its cache key,
/// so the UAG / Inspector can show "this resolver is memoized per request by
/// `<key_fields>`" without running the resolver.
///
/// The fields are `&'static` so the descriptor is `const`-constructible and
/// lives in the binary (no allocation). A descriptor is *declarative* — it
/// does not cause memoization; the runtime container (`crate::request_cache`)
/// does the memoization. The descriptor is what the graph records.