test(agency): the Part L incident scenario end to end, and failure modes

The full incident scenario now runs against the assembled daemon: an
operator goal becomes a want to reduce uncertainty, an investigation
intention and a diagnosis plan; telemetry is read; logs need authority,
so a scoped request with risk, mitigation and fallback is raised and the
intention is blocked until an operator grants it; the logs are read with
personal data masked and summarised back into cognition; the operator
supplies the judgement that a restart should help; a standing commitment
turns the restart into a request for approval; after approval the typed
capability runs and health is verified rather than assumed; the fault
persists, so a prediction error weakens the supporting belief, the plan
is replanned into an escalation that reuses the live log grant and does
not repeat the restart; once the database is fixed a second approved
restart verifies, the procedure is learnt, and "Why did you restart
atlas-worker?" is answered from the recorded chain and scores as
supported.

Changes the scenario exposed:
- New operator goals are raised by the goal monitor, so a cycle runs and
  wants are derived from them.
- Intentions link live beliefs about their action's target, so a failed
  expectation is evidence against the belief it rested on and the plan
  lists it as an assumption.
- Reconsideration reacts to a plan's own intention only; a subordinate
  "obtain approval" intention shares the plan and previously caused the
  parent's plan to be closed.
- The harness accepts a clock for the executor's verification windows.

Further failure-mode tests: a retracted assumption replans a waiting plan
away from the restart and withdraws its approval request; conflicting
commitments are raised once in a cycle while both stay represented.
This commit is contained in:
Andy Dixon
2026-09-27 23:34:43 +01:00
parent 212eef6b8c
commit 7d67745ff8
6 changed files with 359 additions and 3 deletions
+4 -1
View File
@@ -31,6 +31,9 @@ func (e *Executor) React(ctx context.Context, ev events.Event) error {
}
meta := func(k string) string { s, _ := ev.Metadata[k].(string); return s }
for _, it := range open {
if !it.ParentID.IsZero() {
continue // a subordinate intention shares its parent's plan; the parent is reconsidered
}
var t *volition.Trigger
switch ev.Type {
case events.CommitmentCreated:
@@ -86,7 +89,7 @@ func (e *Executor) React(ctx context.Context, ev events.Event) error {
func (e *Executor) apply(ctx context.Context, it volition.Intention, t volition.Trigger) error {
if !it.PlanID.IsZero() {
if p, err := e.Plans.Get(ctx, nil, it.PlanID); err == nil && PlanOpen(p.Status) {
if p, err := e.Plans.Get(ctx, nil, it.PlanID); err == nil && PlanOpen(p.Status) && p.IntentionID == it.ID {
return e.reconsider(ctx, p, it, t)
}
}