Technique and resource resolution
Context windows are precious, so definitions arrive at the granularity of need — workflow metadata at get_workflow, one activity at get_activity, one technique per step at get_technique, resources only when a technique cites them. All behaviour is composed from techniques (markdown capability definitions referenced by ::-paths), resolved workflow-first with a shared meta fallback, delivered as bundles, and backed by reference material that loads only on demand.
Canonical source: docs/resource_resolution_model.md. The normative file anatomy is the technique protocol specification.
meta layer (a same-named local technique shadows the meta one). The resolved body arrives with its rules auto-included, grouped into a techniques / rules / unresolved bundle; resource links inside it are rewritten into get_resource refs and fetched lazily.One kind of technique
A technique is a markdown file whose slug is its canonical id. There is one kind of technique — standalone files and grouped folders use the same published shape on the wire.
- Identity —
id,version,capability - Inputs / outputs — optional typed slots; outputs may name an
artifactfilename - Protocol — ordered imperative steps the agent follows
- Rules — named behavioural invariants bundled with the technique
{sub}.md is a full technique in its own right — not a fragment of the parent file.References
Activities and workflows compose behaviour by listing ::-delimited references. The path has up to three parts:
- Workflow (optional) — omit for the current workflow; prefix to reach another workflow
- Technique — standalone slug or group folder name
- Nested segment (optional) — sub-technique inside a group, or a rule name if no sub-technique matches
A group prefix like agent-conduct can expand to every agent-conduct-* rule. Anything that matches nothing lands in the unresolved bucket — never silently dropped.
:: at resolution time.meta fallback; nested segments address sub-techniques; a leading workflow segment reaches shared layers explicitly.Borrowed activities and source-workflow scoping
A workflow may reuse an activity file authored in another workflow — a borrowed cross-workflow activity. Bare technique refs inside that activity (including activity-group shorthand like activity-id::op) resolve against the source workflow the activity file was authored in, not the borrowing session's workflow. Explicit workflow:: prefixes still reach named workflows directly. The same scoping applies to checkpoint fragment refs and to binding-provenance producer scans on step-bound get_technique fetches. Non-borrowed activities keep source scope equal to the session workflow, so behaviour is unchanged outside the borrowed-activity case.
Workflow fragments
Beyond technique refs, a workflow can declare reusable content once under fragments in workflow.yaml and import it by reference:
fragments.rules— shared rule texts; rules slots accept either a rule string or{ ref: "[workflow::]name" }fragments.checkpoints— shared checkpoint bodies (message, options, effects); akind:checkpointstep imports one viaref, contributing its own site-localid
Resolution follows the same scoping as technique refs: workflow::name resolves only in that workflow's fragments; a bare name tries the declaring workflow first, then meta. Fragment bodies are plain content — a fragment cannot itself contain a reference. The loader materializes refs at load and delivery time, so agents always receive full content, never a ref to resolve. The check:fragments guard rejects inline copies that duplicate a declared fragment.
Delivery at workflow and activity granularity
Agents never chain resolution calls at runtime. The server pre-resolves reference lists into bundles when you call:
get_workflow— orchestrator bundle: workflow-declared refs plus core orchestrator techniques (engine traversal, checkpoints, dispatch, discipline)get_activity— worker bundle: activity refs, inheritedtechniques.activityfrom the workflow, plus core worker techniques (yield/resume, finalize, conduct rules)
Each bundle groups resolved content into three buckets. When a single technique is delivered, ancestor Initial / Final protocol blocks wrap the technique body recursively and the server renumbers the combined sequence. In persistent-context mode, reference-not-repeat delivery replaces already-delivered content with { delivery: "unchanged", content_hash } markers; fetch recording warns when a manifested step was never loaded.
Eager step-technique bundling
The lazy per-step model above is complemented by automatic eager bundling on every get_activity call. The worker passes context_tokens — its context window size in tokens — and the server derives a cumulative per-activity character budget:
context_tokens × headroomFraction × charsPerToken (defaults 0.80 × 4; env-overridable). Ungated step-bound techniques are inlined in document order under step_techniques until the budget would overflow; gated steps and per-activity bundleTechniques.maxChars oversize caps stay lazy. maxChars: 0 opts the activity out entirely. Each inlined entry is byte-identical to a step-bound get_technique fetch, including provenance annotations; resources referenced inside inlined techniques are never inlined. Bundled steps are recorded as technique_bundled events and satisfy manifest fidelity checks. Protocol details are in Protocol.
Resources: lazy by design
Large reference material — CLI guides, templates, API notes — never rides along in technique bundles. At delivery time the server rewrites markdown hyperlinks inside a technique into fetchable get_resource refs. The agent calls get_resource only when the running technique actually needs the linked material.
Resource ids support:
- Bare slug — resolved in the session's current workflow
- Workflow prefix —
meta/activity-worker-promptpulls from another workflow'sresources/folder - Section anchor —
#heading-slugreturns one heading block, not the whole file
#section narrows a large resource to the template the technique actually needs.Related
How techniques declare inputs/outputs and how binding works is the technique protocol specification; what the resolved bundles look like on the wire is in the tool reference.