Deterministic Skills
Deterministic Skills
R1 now has an additive deterministic skill substrate under
internal/r1skill/. It does not replace the markdown skill system yet;
it sits beside it during migration.
What ships now
- Canonical JSON IR in
internal/r1skill/ir - 8-stage analyzer in
internal/r1skill/analyze - Compile proof generation via
cmd/r1-skill-compile - Minimal deterministic runtime in
internal/r1skill/interp - Opt-in execution path in
cmd/r1-mcp/backends.gofor manifests
with useIR=true
Dual-stack migration
- Markdown skills still load through
internal/skill/registry.go - Deterministic skills load through
internal/r1skill/registry - Capability manifests opt into deterministic execution with:
- useIR: true
- irRef: <path to .r1.json>
- compileProofRef: <path to .proof.json>
Compile flow
Compile a skill:
go run ./cmd/r1-skill-compile ./skills/deterministic-echo/skill.r1.json
Check-only mode:
go run ./cmd/r1-skill-compile --check ./skills/deterministic-echo/skill.r1.json
The compiler emits a sibling .proof.json file. Runtime execution is
allowed only when the manifest references both the IR and its proof.
Runtime flow
stoke_invoke consults skillmfr.Manifest. When useIR=true, the MCP
backend:
1. loads the IR from irRef
2. loads the compile proof from compileProofRef
3. executes the skill through internal/r1skill/interp
4. returns deterministic output in the MCP response
Example
The repo ships one deterministic example:
skills/deterministic-echo/skill.r1.jsonskills/deterministic-echo/skill.r1.proof.json
It uses the stdlib:echo pure function and demonstrates the minimal
compile-and-run path without depending on external effects.
Current limitations
- HCL parsing is not implemented in this pass; the executable path uses
canonical JSON IR.
- The interpreter currently supports
pure_fnand replay-cached
llm_call. Additional node kinds should be added incrementally.
- Markdown remains the default worker-loop skill path; deterministic
execution is manifest-gated.
Author guidance
- Keep new deterministic skills in canonical JSON IR for now.
- Generate and commit the
.proof.jsonartifact with the skill. - Use deterministic skills for bounded effectful logic; keep prose
skills for prompt-time guidance until the migration window closes.
Pages in this directory
- AGENTIC-API-CATALOG.md
- AGENTIC-API.md
- ANTI-TRUNCATION.md
- ARCHITECTURE.md
- BEACON-PRIMITIVES.md
- BEACON-PROTOCOL.md
- BUSINESS-VALUE.md
- DEPLOYMENT.md
- FEATURE-MAP.md
- HOW-IT-WORKS.md
- MIGRATION-MARKDOWN-TO-DETERMINISTIC.md
- README.md
- ROADMAP.md
- SKILL-WIZARD.md
- SKILLS-DETERMINISTIC.md
- TRUST-LAYER.md
- anti-deception-matrix.md
- bench-corpus-format.md
- bench-swebench.md
- benchmark-stance.md
- browser-executor.md
- deploy-executor.md
- gates-yaml.md
- harness-architecture.md
- mcp-security.md
- operator-guide.md
- provider-pool.md
- r1-serve.md
- s6-deprecation-closures.md
- stoke-agent-serve.md
- stoke-protocol.md
- stoke-spec-final.md
- trustplane-integration.md
- upgrades-sow-verification.md
- wave-a-wal.md
- wave-b-receipts-honesty.md
- wave-b-wal.md
- wave-c-wal.md
- wave-d-expansion.md
- websearch.md