@aragon-agent/cli 0.6.63 → 0.6.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +70 -2
  2. package/README.md +44 -20
  3. package/dist/agent/controller.d.ts +66 -14
  4. package/dist/agent/controller.js +291 -81
  5. package/dist/agent/headless.d.ts +16 -0
  6. package/dist/agent/headless.js +44 -3
  7. package/dist/agent/team-notices.d.ts +57 -7
  8. package/dist/agent/team-notices.js +93 -10
  9. package/dist/app/App.js +199 -77
  10. package/dist/cli.js +4 -1
  11. package/dist/config/cli-commands.d.ts +1 -1
  12. package/dist/config/cli-commands.js +11 -0
  13. package/dist/exec/index.js +2 -0
  14. package/dist/exec/runner.js +10 -1
  15. package/dist/gene/commit-prepare.js +27 -1
  16. package/dist/gene/curator/curator.d.ts +15 -0
  17. package/dist/gene/curator/curator.js +26 -2
  18. package/dist/gene/curator/scripted-lane.d.ts +12 -0
  19. package/dist/gene/curator/scripted-lane.js +101 -0
  20. package/dist/gene/curator/task-context.d.ts +21 -0
  21. package/dist/gene/curator/task-context.js +33 -0
  22. package/dist/gene/curator/task-runner.d.ts +10 -1
  23. package/dist/gene/curator/task-runner.js +39 -4
  24. package/dist/gene/curator/tool-support.js +11 -4
  25. package/dist/gene/curator/toolkit.d.ts +13 -0
  26. package/dist/gene/curator/toolkit.js +23 -1
  27. package/dist/gene/curator/tools-verify.js +2 -2
  28. package/dist/gene/curator/tools-write.js +6 -1
  29. package/dist/gene/curator/validate/evidence-tokens.js +133 -22
  30. package/dist/gene/curator/validate/knowledge.d.ts +41 -1
  31. package/dist/gene/curator/validate/knowledge.js +74 -11
  32. package/dist/gene/curator/validate/prompts.d.ts +10 -2
  33. package/dist/gene/curator/validate/prompts.js +2 -2
  34. package/dist/gene/learn/draft-guard.d.ts +17 -0
  35. package/dist/gene/learn/draft-guard.js +113 -0
  36. package/dist/gene/learn/learn-prompt.d.ts +22 -1
  37. package/dist/gene/learn/learn-prompt.js +27 -2
  38. package/dist/gene/learn/learner.js +20 -2
  39. package/dist/gene/queue.d.ts +16 -0
  40. package/dist/gene/queue.js +44 -1
  41. package/dist/governance/store/run-store.d.ts +20 -0
  42. package/dist/governance/store/run-store.js +54 -8
  43. package/dist/host/index.d.ts +1 -0
  44. package/dist/host/index.js +1 -0
  45. package/dist/host/interaction.d.ts +8 -17
  46. package/dist/host/interaction.js +50 -72
  47. package/dist/host/team-wake-driver.d.ts +90 -0
  48. package/dist/host/team-wake-driver.js +114 -0
  49. package/dist/logging/install.d.ts +32 -1
  50. package/dist/logging/install.js +15 -0
  51. package/dist/team/console-tools.d.ts +12 -0
  52. package/dist/team/console-tools.js +20 -3
  53. package/dist/team/console-view.js +11 -1
  54. package/dist/team/notices.d.ts +81 -4
  55. package/dist/team/notices.js +187 -22
  56. package/dist/team/prompt.js +1 -1
  57. package/dist/team/runtime.d.ts +67 -24
  58. package/dist/team/runtime.js +250 -31
  59. package/dist/team/stall-watch.d.ts +54 -0
  60. package/dist/team/stall-watch.js +119 -0
  61. package/dist/team/task-tool.js +2 -2
  62. package/dist/team/wake.d.ts +176 -0
  63. package/dist/team/wake.js +444 -0
  64. package/package.json +81 -81
package/CHANGELOG.md CHANGED
@@ -12,9 +12,9 @@ were written.
12
12
  - **`task` no longer returns the final report in an interactive session.** It returns "started" — the
13
13
  dispatch id, the labels it created and a one-line cheat sheet of the control tools — and the dispatch
14
14
  then belongs to the runtime, not to a tool call. The report arrives once, at the end, as a transcript
15
- notice plus **at most one** summary turn in which the lead restates it in its own words
15
+ notice and - while the lead is idle - a **wake** that starts a turn for it
16
16
  (`team.autoResume`, default `auto`; `team.settleGraceMs`, default 3000 ms, is the window in which your
17
- next message cancels that turn). `aragon -p`, `aragon exec` and governance mode keep the blocking
17
+ next message cancels that turn; see the lead wake signals below). `aragon -p`, `aragon exec` and governance mode keep the blocking
18
18
  behaviour and the byte-identical report, so scripts, hosts and `schemaVersion` are untouched.
19
19
  **Migration:** read the notice, call `team_collect` when you need the report synchronously, or set
20
20
  `team.detachDispatch: false` (`aragon config set team.detachDispatch false`) to restore the old
@@ -28,6 +28,74 @@ were written.
28
28
  that outlived its turn, because a later `Esc` no longer does it. Both changes are deliberate: one `Esc`
29
29
  used to mean "clear my mind", and it must not be able to throw away two hours of work.
30
30
 
31
+ ### Fixed
32
+
33
+ - **A team run that hit `[Agent] idle watchdog fired` no longer stays dead.** When the model went quiet for
34
+ the whole idle window (210 s by default), or the retry ladder gave up on a transport failure, the run was
35
+ over and nothing started another one: the screen said `N steps left; the run ended with an error.
36
+ /todo continue to retry...`, and the only recovery was you typing something - 12 seconds later, or 89
37
+ minutes later on an unattended run. The host now **re-runs the interrupted run itself**
38
+ (`controller.continue()`: the history is asked again, no message is added) after a grace window you can
39
+ cancel with `Esc` - 15 s, then 45 s, then 120 s - and says why: `The model stopped responding for 3m 30s
40
+ while writing a tool call (task). The last response was discarded; retrying automatically in 15s
41
+ (attempt 1/3) - Esc to cancel.` It needs no todo plan (a lead that dies while composing its first
42
+ dispatch has none) and is independent of `todo.followThrough`.
43
+ Bounded twice: `retry.maxRunResumes` (default 3) back-to-back recoveries, and
44
+ `retry.maxRunResumesPerPrompt` (default 10) per prompt, which only **you typing** refills - so a link
45
+ that dies every other turn still stops. Only the engine's own transient verdicts are recovered
46
+ (idle watchdog, `network_error`, `timeout`, `overloaded`, `server_error`); a rate limit, a rejected key,
47
+ a context overflow and anything the provider calls non-retryable are not, neither is a run you
48
+ stopped with `Esc`, and neither is a stall that began while a **tool was running** (the history then ends
49
+ in tool calls with no results, which the provider would reject, so a retry could only fail).
50
+ A pending team-wake countdown keeps the timer slot (it redoes the same turn and delivers a real signal),
51
+ and a recovery that already holds it makes a later wake answer `busy`.
52
+ `retry.resumeRun: false` (or `/retry off`, or `retry.maxRetries: 0`) restores the old behaviour exactly.
53
+ `aragon -p` and the one-shot `aragon exec` path get **one** recovery, 15 s grace, and exit 1 when it does
54
+ not end in an answer; text already streamed to stdout before the stall is not retracted (the retry line on
55
+ stderr says so), as with the ladder's own `stream_restart`.
56
+
57
+ - **A watchdog death now says where it went quiet.** `run_end` in the log carries `stall`: the phase
58
+ (`awaiting_response`, `thinking`, `text`, `tool_input`, `tool_running`, `between_turns`), the last event,
59
+ the tool being written or run, and the silence on **both** the monotonic and the wall clock - they diverge
60
+ by the length of a suspend, which is how a sleeping laptop is told apart from a quiet network. Nothing is
61
+ added to an `agent_end` that did not die of the watchdog.
62
+
63
+ - **The Gene Bank publishes again: four days of learning produced one gene.** The reviewer was running, but
64
+ the bank stayed empty for four reasons, all fixed. (1) The source check (K2) read grammar and prose as
65
+ facts - `/dev/null`, `2>&1`, `deploy/update/roll`, whole backticked command lines, a localized message,
66
+ `YYYY` placeholders - and vetoed a gene for any one of them; it now ignores those shapes, checks a command
67
+ word by word, and vetoes only when **most** of a draft's specifics (more than half, or more than eight)
68
+ cannot be found in its evidence. A minority is recorded as `KNOWLEDGE_EVIDENCE_UNVERIFIED` and the gene
69
+ goes in **on probation**; `recheck` shares the rule. On the 15 stored candidates K2 passes 13 instead of 3.
70
+ (2) A skill or tool draft could never be created (17 of 17 skills, 1 of 1 tools): the reviewer was never
71
+ told the contract, and a refusal named one issue at a time. Refusals now list every problem, `gene_toolkit
72
+ load author` states the knowledge / skill / preference contract once, and the reviewer prompt (`v3-2026-11`)
73
+ asks for it, never proposes a tool and may propose one skill per reply. Drafts the curator cannot create
74
+ are refused at enqueue, and the ones already queued are moved to `dead/` once an hour (reversible).
75
+ (3) A task that hit its token, turn or finish ceiling was retried four times; it now gets two. (4) A
76
+ reviewer proposal with a complete knowledge draft that passes the checks needing no model is written and
77
+ validated by code and published on probation without starting an agent loop (`resume_validation`, the
78
+ path that produced the only gene so far); any doubt falls back to the agent loop before anything is
79
+ written. The run log now says how many turns, which tools and which refusals a stopped task used.
80
+ **Migration:** none. Kill switches: `ARAGON_GENE_DRAFT_GUARD=0` (enqueue guard and sweep),
81
+ `ARAGON_GENE_SCRIPTED_LANE=0` (scripted lane). A TUI session that holds the curator lease must be restarted
82
+ to load the fix.
83
+ - **In team mode the lead no longer sits idle forever after its subagents finish.** The old follow-up
84
+ turn was judged once, on the lead's own `agent_end`, and a dispatch that ends while the lead is idle
85
+ never produces one - so the report waited for you to type. The runtime now owes the lead a wake as a
86
+ *state*, re-checked whenever a signal arrives, the lead goes idle, a retry beat fires or the host answers.
87
+ Three signals, all raised from runtime facts: the dispatch **ended**, a subagent **failed for good**
88
+ (after the supervisor's post-mortem had its chance to replace it), and the team **stalled**
89
+ (`team.stallSignalMs`, default 180 s, `0` turns it off). The wake text states facts only
90
+ (`<team_signal>`); what the lead does with it is its own call. A dispatch that fails before it can
91
+ even start (a subagent that cannot be built) now reports a failed row per subagent instead of
92
+ vanishing; a failed child no longer downgrades the wake to a notice; a report that could not be
93
+ delivered into the turn it ended in is no longer lost; a report is no longer delivered twice; and the
94
+ first turn after an `Esc` receives the report too. The wake is bounded (3 attempts per notice,
95
+ 4 live-signal wakes per dispatch) and never silent: giving up prints a line. The terminal and the
96
+ desktop run the same driver. **Migration:** none; `team.autoResume` keeps its three values but now
97
+ covers failures and stalls as well as the end, and `at most one summary turn` is no longer a rule.
98
+
31
99
  ### Added
32
100
 
33
101
  - **Prompt profiles: the red team block's wording now lives in an editable Markdown file.** The
package/README.md CHANGED
@@ -2632,29 +2632,50 @@ dispatch started with, so the key can never turn a live team into an awaited too
2632
2632
  call or the other way round. `-p`, `aragon exec` and governance mode always
2633
2633
  dispatch in await mode — the machine contract does not change for this feature.
2634
2634
 
2635
- ### When the report comes back: one notice, at most one summary turn
2635
+ ### When the team needs the lead: three signals, one wake
2636
+
2637
+ The runtime needs the lead in exactly three situations, and in no others: the dispatch
2638
+ **ended** (every child finished - all of them succeeded or some failed), a subagent
2639
+ **failed for good** while the others keep running, or the team **stalled** (nobody is doing
2640
+ real work and somebody is waiting on somebody else). Each becomes a notice that reaches the
2641
+ lead exactly once, and while the lead is idle the runtime also **wakes** it - so a team that
2642
+ finishes at 3 a.m. does not sit there until you type. A single success, a message from a
2643
+ child or a pause is not a signal; those ride along with the next one.
2636
2644
 
2637
2645
  | Key | Values | What it does |
2638
2646
  |---|---|---|
2639
- | `team.autoResume` | `auto` (default) / `notify` / `off` | `auto` gives the lead one bounded turn to summarise the finished dispatch; `notify` only announces it in the transcript; `off` says nothing at all |
2640
- | `team.settleGraceMs` | 500-30000 ms, default 3000 | How long that summary turn waits before it runs, so your next keystroke can cancel it |
2641
-
2642
- The rules are narrow on purpose:
2643
-
2644
- - **At most one summary turn per dispatch.** A second one is never armed.
2645
- - **Any user input cancels it.** The grace window exists for exactly that: a
2646
- message you send inside it becomes the turn, and the notice rides along with
2647
- it instead of costing a second turn.
2648
- - **It never repeats the report.** The summary turn points at the report; the
2649
- report itself is the notice, and `team_collect` returns the same string, byte
2650
- for byte, so the readers cannot drift apart.
2651
- - **It degrades to a plain notice** when the dispatch was aborted or errored,
2652
- when it settled inside the turn that started it, when you already have an
2653
- unread message, when a TODO follow-through or a forced-dispatch nudge already
2654
- owns the follow timer, or when `autoResume` is `notify`.
2655
- - **Notices are delivered exactly once** — idempotent per
2656
- `dispatch:label:status`, and re-sent from a ledger if the fast reviewer's queue
2657
- clear swallowed one.
2647
+ | `team.autoResume` | `auto` (default) / `notify` / `off` | `auto` wakes an idle lead for any of the three signals; `notify` only prints one line; `off` says nothing. With `notify` and `off` the signal still reaches the lead with your next message |
2648
+ | `team.settleGraceMs` | 500-30000 ms, default 3000 | How long a wake waits before it runs, so your next keystroke or `Esc` can cancel it |
2649
+ | `team.stallSignalMs` | `0`, or 60000-3600000 ms; default 180000 | How long nobody may do real work before the lead is told the team stalled. `0` switches only this signal off - the end-of-dispatch and failure wakes are unaffected |
2650
+
2651
+ **What the lead does once it is awake is the lead's call.** The wake carries facts and nothing
2652
+ else: a `<team_signal>` block with the counts, the labels, the first line of each error, who
2653
+ stopped whom and how long things were quiet, plus one provenance line saying it is automatic and
2654
+ not a message from you. It never tells the lead to summarise, retry, replace or stop anything -
2655
+ it can do any of those, or none.
2656
+
2657
+ The rules are there to make the signal reliable without making it a loop:
2658
+
2659
+ - **It always reaches the lead.** A dispatch that ends while the lead is idle wakes it; one that
2660
+ ends mid-turn but could not be delivered into that turn wakes it when the turn ends; a dispatch
2661
+ that dies before its children even start (a model profile that cannot be built) reports a failed
2662
+ row per subagent. A failure no longer downgrades the wake to a plain notice.
2663
+ - **It cannot loop.** A notice gets at most three attempts and then a visible "could not wake the
2664
+ lead" line; failures and stalls wake the lead at most four times per dispatch and at least a
2665
+ minute apart (the fifth is announced instead); the end of a dispatch is always allowed.
2666
+ - **You come first.** A message or `Esc` during the countdown cancels it and the report goes with
2667
+ your message. A turn you interrupt is not restarted behind your back. A later signal still wakes
2668
+ the lead after you cancelled an earlier one.
2669
+ - **A stop you ordered is not news.** Ending the team yourself (or having the lead do it) does not
2670
+ wake the lead for it; the report is still delivered with the next turn.
2671
+ - **Only dispatches the lead is free during.** Blocking dispatches (`-p`, `aragon exec`,
2672
+ governance mode, `team.detachDispatch: false`) return the report in the `task` result and produce
2673
+ no notice and no wake - exactly as before.
2674
+ - **Delivered exactly once** - each notice is acknowledged per steer by Core's receipt, a notice a
2675
+ fast-reviewer queue clear swallowed goes back in the queue, and `team_collect` returning the
2676
+ report removes the notice that would have repeated it.
2677
+ - **`team_status` shows a stall** (`no progress for 3m (blocked: ...)`), and `team_collect` stops
2678
+ waiting the moment a signal arrives.
2658
2679
 
2659
2680
  ### The lead's console: seven control tools
2660
2681
 
@@ -3857,6 +3878,9 @@ env / `.env` → CLI flags**.
3857
3878
  | `retry.respectRetryAfter` | `true` | Honour `Retry-After` (and the provider rate-limit reset headers) as a **floor**, never a replacement — a `Retry-After: 1` on the ninth retry does not undo eight retries of backoff. A stated wait above 60 s is surfaced immediately instead of waited out. |
3858
3879
  | `retry.maxElapsedMs` | `240000` | Wall-clock budget from the first failure, clamped to `[10000, 1800000]`. Under the legacy regime (`team.overseer: false`) with `team.subagentTimeoutMs` positive, keep this below it: an equal budget means a subagent is killed at the same instant its ladder ends, and the user is then told "subagent timed out" for what was a provider outage. |
3859
3880
  | `retry.onPartialStream` | `true` | Allow a restart after content has already streamed to the transcript. The view is rewound and the discarded tool cards removed; engine history is provably clean at that point, because it is only written on a completed turn. `false` refuses the whole path. |
3881
+ | `retry.resumeRun` | `true` | Re-run a run the **engine** interrupted - the idle watchdog fired (`[Agent] idle watchdog fired`) or the retry ladder gave up on a transport failure - instead of leaving it dead. Host-side: it redoes a **run** (`controller.continue()`, no message added) where the ladder above retries a **request**, so it never reaches the engine's `RetryPolicy`. Needs no todo plan and ignores `todo.followThrough`. Waits 15 s, then 45 s, then 120 s (cancel with `Esc`), announces the stall and its stage, and is switched off by `retry.enabled: false` / `retry.maxRetries: 0` as well. A rate limit, a rejected key, a context overflow, a run you stopped with `Esc` and a stall that began while a tool was running (unpaired tool calls in the history) are never recovered. `aragon -p` / `aragon exec` get one recovery, 15 s grace. |
3882
+ | `retry.maxRunResumes` | `3` | Back-to-back recoveries before control goes back to you, clamped to `[0, 10]`. Cleared by any run that ends without an error. `0` disables recovery and is a real value here, not a typo for the default. |
3883
+ | `retry.maxRunResumesPerPrompt` | `10` | Recoveries per prompt, clamped to `[0, 50]`, however well the runs in between went. Cleared **only** by you typing, so a link that dies every other turn still reaches it. `0` disables recovery. |
3860
3884
  | `skills.enabled` | `true` | Master switch for the skill system. |
3861
3885
  | `skills.requireApproval` | `true` | Require a human to approve `skill_install` / `skill_create`. |
3862
3886
  | `skills.catalogMaxBytes` | `6000` | Level 1 catalog ceiling, in UTF-8 **bytes**, clamped to `[500, 40000]`. |
@@ -26,7 +26,8 @@ import type { ToolHookRunner } from '../exec/hooks/tool-wrapper.js';
26
26
  import type { ToolPermission } from '../exec/permission.js';
27
27
  import { type ToolOutputListener } from '@aragon-agent/tui/model/tools/tool-output-store';
28
28
  import type { FilePatch } from '@aragon-agent/tui/model/tools/patch';
29
- import { TeamRuntime } from '../team/runtime.js';
29
+ import { type TeamWakeAck, type TeamWakeBegin, type TeamWakeRequest } from '../team/wake.js';
30
+ export type { TeamWakeAck, TeamWakeBegin, TeamWakeRequest } from '../team/wake.js';
30
31
  import type { ReportOptions } from '../team/report.js';
31
32
  import type { DispatchHandle, DispatchInspection } from '../team/runtime.js';
32
33
  import type { TeamControlRequest } from '../team/console-view.js';
@@ -501,6 +502,22 @@ export declare class AgentController {
501
502
  */
502
503
  private readonly teamNotices;
503
504
  private teamRelay;
505
+ /**
506
+ * The wake governor (team-lead-wake-signals): "the team needs the lead - is now the
507
+ * moment to start a turn?". Level-triggered over the relay's ledger, so a dispatch
508
+ * that ends while the lead is idle still wakes it. Built next to the relay.
509
+ */
510
+ private teamWake;
511
+ /** Dispatches started DETACHED; only these produce notices and wakes (I-WK3). */
512
+ private readonly detachedDispatches;
513
+ /**
514
+ * `prompt()` / `continue()` calls between entry and exit. The engine's own
515
+ * `isRunning()` is false for the whole `gene.planForTurn` await, but a turn is
516
+ * certainly starting then; the governor must not start a second one (RV-P2-10).
517
+ */
518
+ private promptInFlight;
519
+ /** Distinguishes one notice steer's receipt id from the next. */
520
+ private noticeSequence;
504
521
  /**
505
522
  * The monotonic turn counter behind `I-DD11`.
506
523
  *
@@ -715,6 +732,15 @@ export declare class AgentController {
715
732
  steer(text: string): void;
716
733
  /** Return the opaque ID used by the view to match Core's acceptance receipt. */
717
734
  queueUserMessage(text: string, parts?: ContentPart[]): string;
735
+ /**
736
+ * `receipt` (notices only, team-lead-wake-signals) asks for an id WITHOUT making the
737
+ * steer a user message: Core echoes `steering_accepted` for any steer that has one,
738
+ * and the team relay needs that echo. It is deliberately NOT written to
739
+ * `pendingUserSteering` - `hasPendingUserMessages()`, `withdrawQueuedUserMessage()`,
740
+ * `continue()` and `fast`'s `userSteerCount` all read that map and mean "the user is
741
+ * waiting for an answer". The `notice:` prefix keeps every other receipt consumer
742
+ * treating it as an unknown id.
743
+ */
718
744
  private enqueueSteering;
719
745
  /**
720
746
  * Withdraw a queued user message by the id `queueUserMessage` returned.
@@ -1148,20 +1174,33 @@ export declare class AgentController {
1148
1174
  /** Whether a dispatch is live AND was started by an earlier turn. */
1149
1175
  teamOutlivesTurn(): boolean;
1150
1176
  /**
1151
- * The settle facts for the live-or-last dispatch, for the follow-up decision.
1152
- *
1153
- * THE ID TRAVELS WITH THE FACTS. The host spends the continuation with
1154
- * `markTeamContinued()`, and the facts are by definition read AFTER settlement,
1155
- * when `TeamRuntime.live()` already answers `null` - so an id re-derived from
1156
- * `live()` was always null, `session.continued` was never set, and every later
1157
- * `agent_end` earned the same follow-up turn: an unbounded model loop that
1158
- * never lets the user type.
1177
+ * Every attention notice the lead has not been PROVEN to have: the queue plus the
1178
+ * relay's ledger, oldest first. The governor's one input.
1159
1179
  */
1160
- teamSettleFacts(): (NonNullable<ReturnType<TeamRuntime['settleFacts']>> & {
1161
- dispatchId: string;
1162
- }) | null;
1163
- /** Spend the one follow-up turn of the current dispatch (at most one). */
1164
- markTeamContinued(dispatchId: string): void;
1180
+ private owedAttention;
1181
+ /**
1182
+ * Register THE host of wake requests (one at a time). The terminal app and the
1183
+ * desktop coordinator both do it through `host/team-wake-driver.ts`.
1184
+ */
1185
+ subscribeTeamWake(listener: (request: TeamWakeRequest) => void): () => void;
1186
+ /**
1187
+ * The fire-time re-check: still owed, lead still idle, no user message waiting - and
1188
+ * the `<team_signal>` text to submit, rendered NOW so anything that arrived during
1189
+ * the countdown is in it. Synchronous and never throws (I-WK10).
1190
+ */
1191
+ confirmTeamWake(requestId: string): TeamWakeBegin;
1192
+ ackTeamWake(requestId: string, result: TeamWakeAck): void;
1193
+ /** Whether any attention notice is undelivered. `team_collect` stops waiting on it. */
1194
+ hasPendingTeamAttention(): boolean;
1195
+ /**
1196
+ * `team_collect` has just put this dispatch's report in a tool result, so the settle
1197
+ * notice must not deliver it again (RC-8).
1198
+ */
1199
+ acknowledgeTeamSettle(dispatchId: string): void;
1200
+ /** The runtime's live roster as `still running` count: queued + running + paused. */
1201
+ private stillRunningCount;
1202
+ /** Forget everything the team owed the previous conversation. */
1203
+ private resetTeamSignals;
1165
1204
  /**
1166
1205
  * Turn one runtime event into a notice (section 5.3.1).
1167
1206
  *
@@ -1169,8 +1208,21 @@ export declare class AgentController {
1169
1208
  * queue must agree about what happened, and the only way to guarantee that is for
1170
1209
  * all three to read the same event. The queue adds nothing but the "exactly once"
1171
1210
  * bookkeeping.
1211
+ *
1212
+ * ONLY DETACHED DISPATCHES (I-WK3). A blocking dispatch already returns its report
1213
+ * in the `task` result, so a notice about it would deliver the same report twice -
1214
+ * and, now that notices wake the lead, would also start a turn for nothing. The one
1215
+ * exception to "seen `dispatch_start` first" is `dispatch_end.detached`, which the
1216
+ * runtime sets itself so a dispatch that died before it could announce its start
1217
+ * still reaches the lead (I-WK15).
1172
1218
  */
1173
1219
  private onTeamEvent;
1220
+ /** `done` / `aborted` are chatter; `failed` is a SIGNAL and arrives as `child_failed`. */
1221
+ private noteChildSettled;
1222
+ private noteChildFailed;
1223
+ private noteStalled;
1224
+ private noteDispatchEnd;
1225
+ private raiseSignal;
1174
1226
  /** Refused mid-dispatch by `/team`; half a dispatch under two ceilings is not
1175
1227
  * a result anything can afterwards explain (the reasoning `/reload` uses). */
1176
1228
  isTeamBusy(): boolean;