ADR 0014: Orkeon main after #244, effort levels, a parallel index, an index cache and the prompt cache
- Status: accepted
- Date: 2026-10-30
- Amends: ADR 0013
Context
The pin of ADR 0013 is 3fcfbbe (Orkeon #240). Orkeon main then merged ten pull requests, up to f80665f
(2026-10-30):
- #241, an audit of Orkeon's documentation against its code: no change of the scripting surface.
- #242,
efforttakesxhighandmaxbesidelow,mediumandhigh, on the agent builder, the per-call options andllm.profile. A provider declares the levels its field knows; one that knows fewer (OpenAI'sreasoning_effort, Ollama'sthink) sends the highest it knows below the one asked, and warns. - #243,
index_codebase max_parallelism: how many files the index build reads and parses at once (0, the default, one per processor). The index is identical whatever the degree. - #244, an index cache between sessions:
index_codebasesaves the tree under<root>/.orkeon/cache/raggable-tree/(its own.gitignore), reloads it when no file changed (hit), reindexes the changed files when at most half changed and no package marker did (refreshed), and rebuilds otherwise (miss);use_cache: falserebuilds, then saves (bypassed). The response gainscacheandreindexed_file_count. - #246, three fixes found while adapting to #244, none of the scripting surface: an Anthropic
ctx.llm.actturn that called a tool no longer fails on its second model call (#245); what a host tool allocates (index_codebaseon a large repository) no longer counts against the script's memory limit (#247); the index cache drops the entries of another runtime version when it saves, and compacts its database when more than half of it is free (#248). - #253 and #255, fixes of the code analysis found while running
/analyze, none of the scripting surface:package_summarypicks its entry points by name and reports a package's dependencies (#249, #250),.gitignorecharacter classes are honoured (#251), and a C#using, a Goimportand a Rustusedraw import edges (#252). - #256, the prompt cache from scripts (#254):
agentBuilder().cache({ systemPrompt?, tools?, ttl? })and thecachekey ofLlmConfig.with, a host defaultLlm:Cache, and the usage report andsession_statskeep a cache or reasoning count no call reported null (absent) instead of 0. Before it, no script agent could ask Anthropic to cache, so Orkeon Code paid every prompt at the full rate. - #258 and #259, none of the scripting surface: the index reads
.git/info/excludeand the nested.gitignorefiles, not the root one alone;claude-haiku-5is priced and every Anthropic model declares its cache write and read rates (#257), socostUsdis no longer unpriced on Haiku 5.5 and a cached prompt is costed at its own rate (a 1-hour write at the 5-minute rate: the usage event carries no TTL).
Three branches of Orkeon Code waited on these: /effort xhigh|max, /analyze --parallel N and /analyze --rebuild,
each with the typings edited by hand.
Decision
- The pin moves to
f80665f(.orkeon-version,ORKEON_RUNTIME_COMMIT), the typings are regenerated from a checkout at it, the hand edits of the three branches give way to them. /effortoffers the five levels,/analyzetakes--parallel N(max_parallelism) and--rebuild(use_cache: false), as their branches wrote them./analyzesays what the cache did: the index summary readscacheandreindexed_file_count, and the indexing line names the outcome (hit,refreshedwith the files reindexed,miss,bypassed), so a second run that took seconds is explained, and so is a--rebuild. The dev steps that build the index when the session holds none say it the same way:/dev-planon itscode index builtline,/dev-specand/dev-changeon theinventory:line of their end message.- Every agent requests the prompt cache of its system prompt and its tool definitions, for the vendor's default
lifetime:
profiledAgent(orkeonAgent(), where every composition root starts an agent) calls.cache({ systemPrompt: true, tools: true }). The prompts are assembled so that this prefix stays byte-identical turn after turn, which is what the cache needs. Anthropic caches only what a request marks; the other providers cache by their own rules and ignore the request. - An unreported count stays unreported: the usage reader keeps a null cache or reasoning count null, and
/usageshows it-.
Consequences
- On a runtime before #244 the summary has no
cachefield: the line says nothing of a cache. On one before #242,xhighandmaxfail the agent's build, as any unknown value did. - An agent's own
.cache(...)wins over the host defaultLlm:Cache: a host cannot turn Orkeon Code's cache off from its settings. On a runtime before #256,.cachedoes not exist and every agent fails its build. - The check made for this ADR:
npm run checkand the runtime smoke onf80665fin source mode.