"Documentation should be a mirror of the source code, not an interpretation."
This guide provides the precise terminology used in the Bitcode codebase, verified against actual implementation.
Source: /packages/agent-generics/src/types.ts, /packages/generic-agents/PTRR
The codebase uses AgentVariationStep enum:
export enum AgentVariationStep {
PLAN = 'plan',
TRY = 'try',
REFINE = 'refine',
RETRY = 'retry'
}Preferred factory: factoryPTRRAgent (factoryPTRRAgent is ).
Source: /packages/generation-generics/src/types.ts
Generation (primitive)
→ FailsafeGeneration (base kinds — parents)
→ ThinkingsGeneration (base kinds — children of each failsafe)
export enum FailsafeGeneration {
PREPARE_CONCISE_CONTEXT = 'prepare_concise_context', // CONTEXT SIGNAL/NOISE
CHUNK_THEN_SUM = 'chunk_then_sum', // BIG INPUT
STITCH_UNTIL_COMPLETE = 'stitch_until_complete' // BIG OUTPUT repair
}export enum ThinkingsGeneration {
REASON = 'reason',
JUDGE = 'judge',
STRUCTURED_OUTPUT = 'structured_output'
}tools_execution— after all failsafes, once, if structured output includesuseTools
Total per PTRR step: 3 FailsafeGenerations × Thinkings composition + optional tools postprocess.
Architecture interface: PTRRStepGenerationArchitecture.
| Term | Meaning |
|---|---|
| Usable tools | Tools visible via AgentToolsRegistry.getUsableTools() (hierarchy). |
| Doc interpolation | formatUsableTools → auto:tools_doc_code_tools on Thinkings prompts. |
| useTools | LLM selection: { name, input, reason }[] on step structured output. |
| usedTools | Execution results: { tool, input?, output?, error? }[]. |
| Results interpolation | Prior usedTools → auto:tools_results on later generations. |
| DocCodeToolPrompt | Prompt carrier for purpose/capabilities/parameters/output sections. |
Full guide: packages/agent-generics/TOOLS-IN-PTRR.md.
| Legacy | Prefer |
|---|---|
ThricifiedGeneration |
ThinkingsGeneration |
SubStep / GenerationExecution |
Generation / GenerationExecution |
FailsafeExecution |
FailsafeGenerationExecution |
PTRRSubStepArchitecture |
PTRRStepGenerationArchitecture |
AgentGenerationSubStepPrompt |
ThinkingsGenerationPrompt |
FailsafeGeneration and FailsafeGenerationPrompt are already the modern
names (no rename). "SubStep" was the old term for Generation within a Step.
"Meta" is not a term.
Source: /packages/prompts/src/parts/PromptPart.ts
- Branded string type:
string & { readonly __brand: 'PromptPart' } - Created via
createPromptPart(content: string): PromptPart
Source: /packages/prompts/src/prompt.ts
- Registry-based formatting system
- Hierarchical path organization
AgentPrompt— name + identityAgentStepPrompt— Plan/Try/Refine/Retry purposeFailsafeGenerationPrompt— failsafe handling instructionThinkingsGenerationPrompt— Reason/Judge/Output instructionToolExecutionPrompt— tool postprocess
Use Host for pipeline execution boxes (LocalHost, SandboxHost). Do not use "Harness" for Host.