Bounded sparse-context agent runtime
ClawBound
Model creativity can sit inside a runtime whose task, context, tools, and side effects remain explicit.
A deterministic runtime between user intent and model providers that compiles tasks, derives execution policy, budgets prompts, and governs tool-calling loops.
Agent behavior becomes hard to inspect when task interpretation, context admission, tool policy, side effects, and session compaction are hidden inside provider calls.
Implemented task compilation, deterministic policy derivation, the context envelope, tool gate/broker path, provider adapters, and session compaction. Public history shows a large implementation import followed mainly by documentation changes; it does not demonstrate long production evolution.
Keep control decisions deterministic and make rejected context visible, so provider creativity stays inside an inspectable runtime contract.
Before a model or tool runs, developers can inspect which context was accepted, which was rejected, and why.
- Verified371 tests passed in the inspected repository test run.
- VerifiedProvider adapters, a tool gate, session store, deterministic compaction, and architecture/use-case SVGs are present.
- Not establishedNo performance, cost, or production-runtime claim is supported here.
Verified repository code, test output, or history Not established human use, deployment, or impact evidence.
System architecture
Follow the authority boundary from input to verified outcome.User request
Intent enters the runtime as an untrusted request to be compiled.
- RequestCompile a task contract
- ContractMake intent inspectable
- PolicyDerive runtime boundaries
- ContextAdmit useful evidence
- ToolsRun a bounded loop
- SessionPreserve continuity
Reproduce / inspect
Start with the shortest proof path.
- Before you start
- Run uv sync --all-extras; provider credentials and external tools are not required for these test paths.
- Path
uv run pytest -q tests/orchestrator/test_orchestrator.py tests/prompt_builder/test_builder.py tests/execution_loop/test_loop.py- Observed
- 57 passed in 0.28s in the inspected credential-free run; these tests expose the deterministic adapter, context admission, tool gate, signal, and session diagnostics path.
Evaluation & test evidence
What the inspected evidence supports.
- Test runVerified
371 tests passed in the inspected repository run.
- Deterministic fixtureVerified
The tested fields make the diagnostic envelope shape inspectable without provider credentials.
- PerformanceNot established
No throughput, cost, or provider comparison is claimed.
Artifact shape
Deterministic fixture shapeEvidence basis · clawbound · artifact shape illustrated from tested fields; no provider trace is claimed
{
"input": {"user_message": "Fix the build by running echo hello."},
"compiled_task": {"fields": ["task_type", "execution_mode", "complexity", "risk"]},
"policy": {"fields": ["context budget", "tool profile", "iteration policy", "approval policy"]},
"context_envelope": {
"segments": 6,
"admission": {"admitted": true, "trimmed": true, "rejected": true},
"rejected_context": {"retained_for_trace": true, "in_system_prompt": false}
},
"tool_and_session_signals": {
"iterations": 2,
"termination": "final_answer",
"tool_result": {"tool_name": "run_command", "status": "success", "output_kind": "build_output"},
"signal_bundles": 1,
"events": ["model_request", "tool_execution", "signal_processed", "model_request", "final_answer"]
}
}Repository depth
Follow the implemented interfaces, behavioral tests, and history behind this case.- Implemented interfaceTask compiler
Implemented interface: structured task compilation from user input.
- Implemented interfaceRuntime policy
Implemented interface: deterministic budget and tool policy derivation.
- Behavioral testPrompt envelope tests
Behavioral test: admitted, trimmed, and rejected context remains traceable.
- Behavioral testExecution-loop tests
Behavioral test: gated tool cycle and deterministic signal output.
Engineering judgment
One decision, the alternative, and the trade-off.Decision
Use deterministic code for policy, compression, and compaction; reserve generation for the provider.
Alternative
Let the model choose budgets, tool permission, and how rejected context is summarized each turn.
Why
The explicit boundary makes runtime behavior reproducible and debuggable, at the cost of maintaining a richer preflight contract.
Failure modes & limits
Public repository · source inspected- Context that does not fit is rejected or trimmed and remains visible in the diagnostic envelope.
- Tool actions pass through a policy gate and broker rather than executing from raw model output.
- The credential-free fixture proves deterministic behavior, not production throughput, cost, or provider superiority.
Integrated dependencies
- Python
- Provider adapters
- Typed policies
- Async tools
- Session compaction