Skip to main content

Module startup

Module startup 

Source
Expand description

Startup context (Wave 14C): the deterministic Atlas + Surface fusion handed to agents at session start, plus the task delta (Wave 14E) that renders only new relevant APIs against the context ledger.

Prompt-cache stability: the artifact hash is a pure function of (epoch, renderer_version, trust_policy, budget) — no timestamps — so the same epoch + config always yields byte-identical startup text.

Structs§

GlobalRankCache
Global-rank cache (Wave 15.2, per-ModelEpoch rank caching): the expensive, epoch-stable parts of a global Surface build — SystemRanker::new (heterogeneous node graph + adjacency + rarity), the 50-iteration global PageRank vector, and the projection to symbol scores — serialized to the store cache so consecutive startups in the same model epoch skip the rank build entirely.
StartupContext
The startup artifact: atlas + surface + coverage + omissions, with the deterministic artifact hash. surface_render is the SAME render the artifact printed — ledger recording derives visible ids from it, so the surface is never computed twice per startup.

Constants§

RENDERER_VERSION
Renderer version: part of the artifact hash. Bump when the startup renderer’s output format changes (invalidates prompt-cache keys).

Functions§

allocate_startup_budget
THE one startup-budget allocator (transport parity): every transport that builds a startup artifact — CLI context startup, MCP system_context, HTTP, Hermes, the SDKs, the Claude SessionStart / PreCompact hooks, and the benchmark harness — resolves its budget through this function and never derives an Atlas:Surface split itself.
build_startup
Build the deterministic startup artifact: the existing System Atlas content (capped at budget.atlas) fused with the budget-selected System Surface Map (the production select_and_render_global pipeline), coverage warnings, and honest omissions. The surface’s omitted ids populate the OMISSIONS section; the ledger records ONLY rendered ids.
load_global_rank_cache
Load the per-ModelEpoch global rank cache from the store cache (key rank:global:<hash> over epoch + policy + salt). None on any miss/error — never panics, never fabricates. The entry is validated against the current epoch/policy/salt (belt-and-suspenders: the key already pins them).
render_startup
The spec’s startup block format. Pure function of the context struct, so build_startup(..).artifact.text == render_startup(&startup) always.
store_global_rank_cache
Persist the per-ModelEpoch global rank cache (best-effort: cache failures never fail the caller).
task_delta_with_ids
task_delta plus the ids it rendered (for ledger recording). Routed through the one authoritative build_surface service in Task mode; never re-dumps the Atlas — the custom task/PPR selection implementation was deleted, build_surface is the only ranking pipeline. semantic is the caller-resolved scorer — transport parity: every transport with inference enabled passes the SAME scorer it passed to the task pack (interface choice must not change ranking quality). None redistributes the 10% share explicitly.
task_surface
Task-personalized surface map (full map, no novelty filter — this is a map, not a delta): entries re-ranked by task PPR + importance via the one authoritative build_surface service in Task mode.
task_surface_with_ids
task_surface plus the rendered entry ids (for ledger recording). semantic is the caller-resolved scorer — transport parity, same rule as task_delta_with_ids.
visible_ids_from_startup
The kind-scoped id sets shown by the startup artifact (for ledger recording): (symbols, files, components, flows). The surface side records ONLY the render result’s rendered_ids — budget-omitted candidates are never marked visible (audit fix: the ledger must describe what the agent actually saw). Consumes the ALREADY-PRODUCED render (startup.surface_render) — the surface is built exactly once per startup; this function never rebuilds it.