Retracting a plan's assumption replanned it and withdrew its pending
approval. An executor tick holding the old plan then saw the withdrawn
approval, treated it as expired and replanned a second time. Entering
replanning is now a compare-and-set, so only the first reconsideration
replans and a stale one does nothing. A regression test fails with three
plans without the guard.
The pending → ready and pending → cancelled transitions, and cancellation
of open steps, saved a step unconditionally. Under load an executor
holding a stale "pending" copy could write "ready" over a step another
executor had already claimed and was running, after which the step could
be claimed again: the full race suite caught two restarts from one plan.
These transitions now use SaveIf, which writes only when the stored status
is still the expected one. A deterministic regression test hands the
executor a stale copy and fails without the fix; the concurrency test now
races eight executors ticking repeatedly.
Volition and planning now run as part of cognition (PLAN §8.2 item 3):
- A volition hook derives wants after each cycle from what it perceived
and produced, satisfies answer wants when a reply is sent, raises due,
overdue, expired and conflicting commitments, and expires faded wants.
Events produced by earlier cycles are not re-derived.
- An intend process proposes deciding about the strongest undecided
wants; the candidate competes for the workspace, so attention gates
what the mind decides to pursue. The handler makes value tensions
explicit (caution against disruptive writes, privacy against reading
personal data), resolves them with recorded scores, runs deterministic
formation with commitments, policy preview, goals and values, records
the decision whatever it is, and plans a formed intention in the same
transaction. Operator requests carry their own weight in formation.
- Explicit requests in conversation ("restart <unit>", "logs for <unit>",
"fetch <url>") become wants with proposed means instead of direct
invocations; the reply says the request was recorded and that acting
depends on commitments and policy.
- The executor is woken after commits, runs in a scheduler-owned loop and
reacts to the event bus: a new commitment tightens or abandons affected
intentions (withdrawing their pending approvals), a weakened assumption
or a finished goal triggers reconsideration. A tightened plan may reuse
its strategy; a failed one may not.
- Metacognition gains volition checks: strong wants repeatedly set aside,
intentions with no recorded reason, intentions a commitment forbids,
commitments that cannot be kept, churn, repeated failed execution,
cost outweighing value, and intentions that outlived their goal.
- A plan model role and prompt let a model propose decompositions that
the planner validates. Ablations are a fork-only configuration field.
- Approvals required by an intention are described as coming from a
commitment or value constraint. The expectation after an approved
action is linked to the execution event, not the request.
- The wants.values column of the unreleased migration 0026 is renamed
value_keys: VALUES is reserved and the generic snapshot restore does
not quote identifiers.
- The hostile-output security test now uses a message that asks for no
action, because an operator's "status of <unit>" is legitimately a
read-only status check.
Plans turn intentions into revisable dependency graphs (migration 0027):
objective, assumptions, ordered or dependent steps, capabilities,
expected observations, preconditions, risk, estimates, budget,
completion criteria, abort conditions and the alternatives considered.
- Validation owns structure: acyclic dependencies, registered and
unlocked capabilities only, schema-valid parameters, targets that agree
with parameters, read-only checks, a closed set of step kinds and
internal actions. Model proposals are parsed into the same structure;
fields that could carry authority or claim progress are reported as
ignored, and an invalid draft is stored as a draft that never runs.
- The planner prefers deterministic strategies: a direct action verified
by observation, a read-only diagnosis that requests temporary scoped log
access with risk and fallback stated, and an escalation that diagnoses
and informs the operator instead of repeating a failed action. Failed
strategies are not reused; a model is consulted only when none applies.
- The executor holds no state in memory: it claims a step with a
conditional update, acts only through Invoke and RequestCapability, and
records the outcome. Waiting for approval or access forms a subordinate
intention and blocks the parent with the reason. Expectations become
verification predictions resolved from a read-only observation, so an
HTTP-level success is never taken as the outcome; a miss is a prediction
error that weakens the supporting belief and triggers reconsideration.
Replanning creates a new revision, withdraws open requests of the old
one and keeps it as history, within a replan limit. Checks never raise
approval prompts. Budgets stop runaway plans. Preconditions skip actions
when the world already changed. Dream plans and disabled sandbox minds
never act. An interrupted non-idempotent action with no record is
blocked for verification instead of repeated; recorded outcomes are
adopted. Completed plans are stored as procedural memories; a completed
escalation does not count as fulfilling the intention.
- Executions and approvals record their origin; minds may withdraw their
own pending approval requests; Preview reports a decision without side
effects; service.status is allowed by default as a bounded read.