Product Requirements Document: Decider Capsule Core
Problem
A decider in capsule core is a component that chooses which verb an agent's turn offers next (contract/decide.md:7-8). Without a decider, the system cannot automatically narrow what the reasoner sees from the full set of available verbs.
The need for a decider arises from a critical failure mode. In the first live run, the decider offered a single verb alone, which looped the reasoner with no way out (contract/decide.md:34-36). Single-verb decisions trap the reasoner because it has no alternative when the chosen verb fails. With a decider, the system can offer a shortlist of verbs—one verb when it is sure and several when it is not—so the reasoner keeps a way out when the decider leans wrong (contract/decide.md:34-35).
The decider solves the problem of over-narrowed offers. Without guidance on which verbs are most likely to succeed, the reasoner either attempts all verbs (inefficient) or commits to a single path (brittle). A decider that ranks verbs by confidence provides the reasoner with ranked choices while preserving alternatives.
What Goes Wrong Without One
Without a decider, the system cannot:
- Rank verbs by likelihood of success
- Narrow the offer intelligently to reduce wasted attempts
- Preserve fallback options when the primary choice fails
- Learn from decision history to improve future rankings
Users
The decider runs within the capsule core as a family that the environment grants via capability (contract/decide.md:7-8). It is invoked during each turn of the agent's loop when the reasoner needs to choose which verb to execute next.
Who runs it: The host adapter invokes the decider by computing what the decider sees from the record and calling the decider family (contract/decide.md:82-84).
Who reads what it decides: The reasoner reads the decider's output to determine which verbs are available and ranked by confidence (contract/decide.md:28-29). The reasoner uses the ranked list to choose which verb to attempt, with fallback options available when a choice fails.
System interaction: The decider is bound into the turn loop through the capsule's verb framework. The reasoner can name what it needs and was not shown, and can express wants for verbs the capsule does not bind (contract/decide.md:49-50, 53).
Goals and Non-Goals
Goals
-
Automatic verb ranking: The decider answers as a model adapter does, an object whose
formnames the verbs it keeps, with the capsule's order preserved (contract/decide.md:28-29). -
Confidence-based narrowing: The decider ranks verbs by confidence—one verb when it is sure and several when it is not (contract/decide.md:34-35). This provides the reasoner with nuanced choices rather than binary accept/reject.
-
Graceful decline: The decider can decline if below threshold and the question is the operator's; when no provider is available, the run parks on the family and a person's reply becomes training data (contract/decide.md:105-107).
-
Evidence-based decisions: The decider answers based on a digest of what the provider gathered (numbers, booleans only), ensuring decisions rest on verifiable evidence (contract/decide.md:82-84).
Non-Goals
-
File content steering: The decider must not read file contents that could steer decisions outside the verifiable evidence (contract/decide.md:88-91). Digest filtering (numbers, booleans, bare words, lists of data only) prevents this (code/jev.rs:19-20).
-
Arbitrary escalation: A decider can only narrow the offer; it cannot expand it or request arbitrary help (code/act.rs:85-87). A reply that keeps no verbs or has no form offers all verbs with no escalation path (code/act.rs:85-87).
-
Operator replacement: When a decider cannot answer, the run goes on with the reasoner picking rather than parking for a person. The decider informs but does not override human judgment (contract/decide.md:77-79).
-
Language-specific support: Initial implementation supports Rust only. Test detection is limited to Rust syntax assumptions (code/accept.rs:267, 285-289).
-
Separate cost metering: A decider's own cost tracking separate from the frame budget is not built (plan/router.md:66).
Design
What the Decider Sees (Input)
The decider receives:
- Operand: The capsule's verb spelled out as a string
- Digest: A computed summary of what the provider gathered during the current turn, containing only numbers, booleans, and bare words—no file contents (contract/decide.md:82-84, code/jev.rs:19-20)
The digest is constrained to prevent model bias. Empirical discovery in V1-L2 showed that without digest constraint, Jev looped 14 turns unable to tell pass/fail on a "read" verb because the model was reading file contents that steered decisions incorrectly (code/jev.rs:23-25, 282-299).
Evidence for acceptance judgments includes gate status, changed files, and added tests (code/accept.rs:1-50). Test name parsing assumes "fn NAME(" stops at non-alphanumeric (code/accept.rs:285-289), and hardcoded file extensions limit support to .rs, .capsule, .md, .sh, .toml, .txt, .html, .json (code/accept.rs:267).
What the Decider Answers (Output)
The decider outputs a JSON object:
{
"form": ["verb1", "verb2", ...],
"distribution": {"verb1": 0.7, "verb2": 0.3},
"confidence": 0.7
}
- form: Space-separated verb names, a subset of those offered, in the capsule's order (contract/decide.md:28-29)
- distribution: Confidence score for each verb kept
- confidence: Overall confidence in the decision
The threshold ranks verbs: Jev returns a shortlist form when overall mass ≥ threshold or the top verb when below threshold (code/jev.rs:1-43). The threshold for decide/verb is 0.6 (code/jev.rs:69). The threshold for accept judgments is 0.8 confidence (code/accept.rs:44).
How the Decider is Bound
The decider is a family the environment grants via (grant capability decide/verb :kind decide) (contract/decide.md:7-8). Both Jev and Laya implement the same :kind decide interface, making them interchangeable providers.
Jev (current implementation): Computes state digest from record (numbers, booleans only), calls LLM with threshold THRESHOLD=0.6, returns shortlist form when mass≥threshold or top verb when below (code/jev.rs:1-43).
Laya (planned replacement): A local distilled version that will replace Jev by implementing the same :kind decide interface. Laya will distill a merged sequence from all records (plan/router.md:69-73). The design for learning mechanism from decision history is pending.
Both are providers; Jev is API-based (generates training data), Laya is local (eliminates API calls).
How the Decider Declines
The decider declines in these cases (contract/decide.md:76-77):
- A decider that cannot say (no response from the provider)
- A pick outside the options (output verb not in offered set)
- An answer that cannot be read (malformed JSON response)
- A lost connection (network failure)
Jev's retry mechanism handles transient failures: retries occur for 5xx and connection errors with 3 attempts and exponential backoff; bad key (401/403) is refused immediately; other errors decline without retry (code/jev.rs:448-490).
When a decider declines below threshold and the question is the operator's, the run parks on the family and a person's reply becomes training data (contract/decide.md:105-107). When no provider is available, the reasoner picks rather than parking, and the decision has no side effects—the run continues (code/jev.rs:448-490).
How Laya Comes to Replace Jev
Laya and Jev both implement the :kind decide interface as providers. The transition requires:
- Same interface: Both answer the same query and return the same JSON form, making them drop-in replacements (contract/decide.md:7-8, 28-29)
- Distilled model: Laya will be trained from a merged sequence of all decision records collected by Jev (plan/router.md:69-73)
- Cost reduction: Laya eliminates API calls, reducing latency and cost compared to Jev's LLM calls
The replacement is a capability swap: the environment can grant decide/verb to Laya instead of Jev without changes to the reasoner or capsule.
Evaluation
How We Know It Is Working
Test coverage: Names of files changed and tests run are the only evidence the host gathers (contract/decide.md:86, 100). Tests must be passed.
tests/decide.rs: Six test cases for the decider interface (plan/router.md:32-35)host/tests/coder.rs: Runs every earlier test under a decider (arity tests) (plan/router.md:32-35)host/tests/jev.rs: Scripted tests showing 0.69–0.83 success rate; demonstrates fixed state digest and shortlist form working (plan/router.md:48-65)host/tests/claude.rs: Additional scripted tests (plan/router.md:32-35)
Configuration verified:
- JSON reply structure:
{"form": name, "distribution": {name: float}, "confidence": float}(code/jev.rs:363) - THRESHOLD=0.6 (empirical) for
decide/verb(code/jev.rs:69) - THRESHOLD=0.8 for acceptance judgments (code/accept.rs:44)
- OPERAND=80 char cutoff, ATTEMPTS=3, PAUSE=1sec doubled per retry (code/jev.rs:438-447)
- Mockable Transport (FnMut) for testing (code/jev.rs:69)
Evaluation criteria:
- Decider's reply contains verifiable evidence components:
{"form": "accept"|"reject", "confidence", "evidence", …}(contract/decide.md:97-98) - Host adapter computes operand and digest from record, never reading agent reasoning (contract/decide.md:82-84)
- With threshold, decider declines if below and question is the operator's; run parks and person's reply becomes training data (contract/decide.md:105-107)
Success metrics:
- Success rate (target: improve beyond Jev's 0.69–0.83)
- Average verb shortlist length (narrowing effectiveness)
- Frequency of single-verb offers (should be rare; single verbs trap the reasoner)
- Decline rate below threshold (should be low; indicates good calibration)
Risks
Known Risks
-
Over-narrowing: The offer is two-sided: the decider narrows what the reasoner sees, and the reasoner can name what it needs and was not shown (contract/decide.md:49-50, 53). Over-narrowed offers leave the reasoner no way out; one-verb offer forces the choice (plan/router.md:57-58).
-
Limited evidence scope: A decider cannot tell a failing test from a passing test if it cannot read test output. A decider that cannot distinguish failure modes cannot accept accurately (contract/decide.md:88-91).
-
Steering by agent claims: Nothing the agent wrote can steer the verdict. The C5 run's friction line claimed what its record did not support (contract/decide.md:102-103).
-
Language-specific limitations: Hardcoded file extensions (.rs, .capsule, .md, .sh, .toml, .txt, .html, .json only); no language support beyond Rust for test detection (code/accept.rs:267, 285-289).
-
No escalation path: A reply that keeps no verbs, a reply with no form, or a declined decision offers all verbs with no way to escalate or request help (code/act.rs:85-87).
-
Continuation without guidance: When a decider cannot answer, the run goes on with the reasoner picking rather than parking for a person. Continuation without decider guidance risks off-strategy choices (contract/decide.md:77-79).
-
No cost metering: A decider's own cost tracking separate from the frame budget is not built (plan/router.md:66).
Mitigation Strategies
- Proposal: Implement minimum shortlist length (e.g., always offer at least 2 verbs unless very confident, threshold > 0.95).
- Proposal: Expand evidence digest to include test output summaries (pass/fail counts) while excluding full file contents.
- Proposal: Add language detection and support for Python, JavaScript, and other common languages in test parsing.
- Proposal: Track decider API calls and cost separately from frame budget to identify optimization opportunities before Laya is ready.
Open Questions
-
Learning from repeated asks: The reasoner asks for more every ask a crossing (contract/decide.md:73). How to learn from repeated asks to avoid looping? (Pending: decision history learning mechanism)
-
Laya distillation design: Laya will distill merged sequence from all records (plan/router.md:69-73). Pending design for learning mechanism from decision history.
-
Dendrite parallelism: D6 open: dendrite spawn/join (parallel branches for multiple agents) (plan/router.md:101). Should decider support parallel decision paths?
-
Builder branch for nonexistent verbs: D6b: builder branch when verb is nonexistent (plan/router.md:101). How should the decider handle wants for unbound verbs?
-
Record indexing and search: K1: record as context with record/search inspect family and turns as index (plan/router.md:101). Should the decider search historical decision records?
-
Cost metering: Should decider API calls and cost be tracked separately from frame budget to enable per-decider optimization?
-
Want handling: Want for unbound verb spawns builder task with no generation—only want and answer as data (contract/decide.md:59-62). Kernel decides binding, not a rule: whether a name is bound is the kernel's own rule. How should the decider advise on wants for verbs the capsule does not bind?
Document Status: Requirements based on contract/decide.md (v1-06d, amended 2026-10-03), code reference implementations (jev.rs, accept.rs, act.rs), and plan/router.md. Proposals marked where sources do not provide complete specification.