Story-1716 Cost (a/2) — cached role-agnostic prefix + serialization + version-check

RFD-AGT-002 D-9. Atlas's per-turn prompt splits in two: a stable prefix (system text + capability universe + the role-agnostic Product Catalog) that is identical for every counsel turn and so can be served from the provider's prefix cache, and a dynamic suffix (Page Context · the user's role · resolved permissions · the message) that is never cached. This Story builds the cached half: building it deterministically, fingerprinting it, refusing a stale one, and gating the DeepSeek default on the D-5 refusal floor. Sibling cost child (the functions dispatcher: per-session budget + debounce + ADR-130 bound) is out of scope here.

The split (RFD-AGT-002 §3.1)

[ STABLE PREFIX            ]  +  [ DYNAMIC SUFFIX                 ]
  system + capability universe        Page Context · the user's role ·
  + Product Catalog (role-agnostic)   resolved permissions · the message
  —— CACHED, shared across turns ——   —— never cached, per turn ——

The prefix carries NO role, NO permissions, NO power-integer — the role filter + authz run live in the uncached suffix (§3.2). So one warm cache is reused across turns and firms.

AC1 — role-agnostic cached prefix with deterministic serialization (cache-hit reproducible)

AC2 — per-turn catalog-version check rejects a stale prefix

AC3 — DeepSeek used only if it passes the D-5 refusal floor

Files

Verification