@staix/agent-hub 0.34.1 → 0.36.0

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 (213) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +53 -7
  3. package/docs/adding-an-ai-tool.md +2 -2
  4. package/docs/addons/claude-mem.md +4 -4
  5. package/docs/addons/open-code-review.md +1 -1
  6. package/docs/agent-notes/README.md +66 -0
  7. package/docs/agent-notes/adapters.md +14 -7
  8. package/docs/agent-notes/budget.md +1 -1
  9. package/docs/agent-notes/bus.md +2 -1
  10. package/docs/agent-notes/daemon.md +9 -7
  11. package/docs/agent-notes/local-worker.md +1 -1
  12. package/docs/agent-notes/models.md +5 -2
  13. package/docs/agent-notes/tasks.md +9 -2
  14. package/docs/agent-notes/tests.md +6 -0
  15. package/docs/design/adapters.md +182 -2
  16. package/docs/design/agent-hub-architecture.md +64 -2
  17. package/docs/design/agent-hub.md +6 -0
  18. package/docs/design/bus.md +26 -0
  19. package/docs/design/execution-reference.md +306 -0
  20. package/docs/design/guidance-experiments.md +438 -0
  21. package/docs/design/model-routes.md +628 -0
  22. package/docs/design/supervision.md +121 -0
  23. package/docs/design/task-board.md +121 -0
  24. package/docs/dogfood.md +45 -13
  25. package/docs/events.md +38 -20
  26. package/docs/memory.md +21 -7
  27. package/docs/operations.md +824 -40
  28. package/docs/profiles.md +2 -2
  29. package/docs/quickstart.md +117 -4
  30. package/docs/research.md +73 -13
  31. package/docs/roles.md +1 -1
  32. package/docs/sdlc.md +117 -11
  33. package/docs/security.md +153 -15
  34. package/docs/smoke.md +14 -0
  35. package/docs/specs/2026-09-19-agent-hub-design.md +13 -7
  36. package/docs/verification/2026-10-25-qwen-dual-output-t0.md +22 -0
  37. package/docs/verification/2026-11-07-compat-python-startup-1248.md +51 -0
  38. package/docs/verification/2026-11-07-compat-receipt-harness-1248.md +105 -0
  39. package/docs/verification/2026-11-07-compat-receipt-producers-1248.md +96 -0
  40. package/docs/verification/2026-11-07-compat-workflow-1248.md +94 -0
  41. package/docs/verification/2026-11-07-daemon-startup-1232.md +169 -0
  42. package/docs/verification/2026-11-07-jcode-receipt-reconstruction-1248.md +118 -0
  43. package/docs/verification/2026-11-07-kimi-delayed-usage.md +34 -0
  44. package/docs/verification/2026-11-07-kimi-review-watch-1284.md +115 -0
  45. package/docs/verification/2026-11-08-agy-1.5.3.md +96 -0
  46. package/docs/verification/2026-11-08-agy-acp-t0.md +56 -0
  47. package/docs/verification/2026-11-08-hub-visual-1058.md +161 -0
  48. package/docs/verification/2026-11-08-jcode-0991-model-setter-1317.md +143 -0
  49. package/docs/verification/2026-11-08-kimi-252-model-setter-1317.md +137 -0
  50. package/docs/verification/2026-11-08-kimi-tui-completion-1282.md +45 -0
  51. package/docs/verification/2026-11-08-kimi-wire-yield-1283.md +31 -0
  52. package/docs/verification/2026-11-08-live-model-override-1317.md +250 -0
  53. package/docs/verification/2026-11-08-qwen-0269-acp.md +138 -0
  54. package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +91 -0
  55. package/docs/verification/2026-11-09-0.35.0.md +129 -0
  56. package/docs/verification/2026-11-09-headless-records-1320.md +157 -0
  57. package/docs/verification/2026-11-09-qwen-0270-acp.md +181 -0
  58. package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +46 -0
  59. package/docs/verification/2026-11-10-0.36.0.md +59 -0
  60. package/docs/verification/2026-11-10-claude-implementer-2.1.322.md +59 -0
  61. package/docs/verification/2026-11-10-qwen-0270-dual-output.md +367 -0
  62. package/docs/verification/2026-11-10-qwen-0271-dual-output.md +101 -0
  63. package/docs/verification/claude-permission-transport-native.py +10 -3
  64. package/docs/verification/claude-shell-wrapper-native.py +8 -8
  65. package/docs/verified.json +245 -15
  66. package/package.json +3 -3
  67. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  68. package/plugins/agent-hub/kimi-hook.js +21230 -0
  69. package/plugins/agent-hub/kimi-review-policy-worker.js +217 -0
  70. package/plugins/agent-hub/server.js +4359 -1071
  71. package/scripts/check-docs.mjs +12 -1
  72. package/src/adapters/acp-model-policy.ts +56 -0
  73. package/src/adapters/acp.ts +175 -5
  74. package/src/adapters/agy/entry.ts +8 -5
  75. package/src/adapters/agy/hooks.ts +65 -15
  76. package/src/adapters/channel-peer.ts +33 -1
  77. package/src/adapters/claude-channel.ts +7 -4
  78. package/src/adapters/claude-implementer.ts +16 -3
  79. package/src/adapters/codex-appserver.ts +118 -8
  80. package/src/adapters/codex-review-isolation.ts +3 -1
  81. package/src/adapters/compat.ts +18 -13
  82. package/src/adapters/definitions/builtin-metadata.ts +8 -1
  83. package/src/adapters/definitions/native-cli-entry-kimi.ts +76 -7
  84. package/src/adapters/definitions/native-cli-preview-common.ts +2 -2
  85. package/src/adapters/definitions/native-cli-preview-kimi.ts +9 -2
  86. package/src/adapters/definitions/reviewer-variants.ts +3 -1
  87. package/src/adapters/kimi-review-policy-worker.js +2 -0
  88. package/src/adapters/kimi-review-policy-worker.ts +85 -0
  89. package/src/adapters/kimi-review-policy.ts +68 -0
  90. package/src/adapters/kimi-review.ts +41 -41
  91. package/src/adapters/kimi-tui-facts.ts +153 -0
  92. package/src/adapters/kimi-wire-usage.ts +33 -8
  93. package/src/adapters/local-worker.ts +60 -21
  94. package/src/adapters/model-token.ts +3 -0
  95. package/src/adapters/pi.ts +27 -5
  96. package/src/adapters/qwen-dual.ts +324 -44
  97. package/src/adapters/registry-types.ts +34 -3
  98. package/src/adapters/registry.ts +1 -0
  99. package/src/adapters/reviewer-policy-watch.ts +86 -0
  100. package/src/adapters/reviewer-print.ts +80 -18
  101. package/src/cli/agents.ts +1 -1
  102. package/src/cli/facts-hook.ts +4 -2
  103. package/src/cli/guidance.ts +67 -0
  104. package/src/cli/help.ts +13 -5
  105. package/src/cli/identity.ts +13 -3
  106. package/src/cli/init-prompt.ts +15 -2
  107. package/src/cli/init-required-checks.ts +122 -0
  108. package/src/cli/init-settings.ts +10 -4
  109. package/src/cli/init.ts +39 -3
  110. package/src/cli/kimi-facts-hook.ts +11 -0
  111. package/src/cli/kimi-plugin.ts +157 -0
  112. package/src/cli/lineage.ts +78 -0
  113. package/src/cli/main.ts +159 -19
  114. package/src/cli/model.ts +52 -0
  115. package/src/cli/output.ts +23 -1
  116. package/src/cli/reset.ts +1 -1
  117. package/src/cli/setup-research.ts +10 -0
  118. package/src/cli/status-lines.ts +8 -4
  119. package/src/hub/autonomy-defaults.ts +20 -9
  120. package/src/hub/board.ts +346 -4
  121. package/src/hub/budget.ts +1 -1
  122. package/src/hub/build-entry.ts +11 -0
  123. package/src/hub/bus.ts +52 -2
  124. package/src/hub/ci-watch.ts +4 -4
  125. package/src/hub/code-facts.ts +10 -3
  126. package/src/hub/completions.ts +3 -1
  127. package/src/hub/config-apply.ts +3 -1
  128. package/src/hub/config-trust.ts +1 -0
  129. package/src/hub/control-client.ts +1 -1
  130. package/src/hub/daemon.ts +1387 -121
  131. package/src/hub/deliverable-files.ts +38 -5
  132. package/src/hub/delivery-hints.ts +4 -2
  133. package/src/hub/delivery-journal.ts +50 -2
  134. package/src/hub/delivery-public.ts +51 -0
  135. package/src/hub/dogfood-profile.ts +9 -5
  136. package/src/hub/envelope.ts +1 -1
  137. package/src/hub/events.ts +28 -18
  138. package/src/hub/execution-lineage-owner.ts +272 -0
  139. package/src/hub/execution-lineage.ts +164 -0
  140. package/src/hub/execution-links.ts +85 -0
  141. package/src/hub/execution-reference.ts +36 -0
  142. package/src/hub/guidance-variants.ts +398 -0
  143. package/src/hub/handoff.ts +1 -0
  144. package/src/hub/hub-tools.ts +62 -2
  145. package/src/hub/instances.ts +4 -3
  146. package/src/hub/kimi-events.ts +46 -0
  147. package/src/hub/kimi-usage.ts +132 -29
  148. package/src/hub/lifecycle.ts +31 -15
  149. package/src/hub/limits.ts +13 -4
  150. package/src/hub/manager.ts +58 -3
  151. package/src/hub/memory-policy.ts +4 -3
  152. package/src/hub/memory-sync-attestation.ts +54 -0
  153. package/src/hub/memory-sync-state.ts +20 -5
  154. package/src/hub/model-overrides.ts +115 -0
  155. package/src/hub/native-hook-launch.ts +12 -3
  156. package/src/hub/operational-view.ts +2 -2
  157. package/src/hub/peers.ts +28 -1
  158. package/src/hub/permission-mode.ts +1 -1
  159. package/src/hub/person-figures.ts +88 -0
  160. package/src/hub/planning.ts +1 -1
  161. package/src/hub/progress.ts +24 -7
  162. package/src/hub/report.ts +38 -4
  163. package/src/hub/research-dataset.ts +158 -0
  164. package/src/hub/research-memory.ts +68 -0
  165. package/src/hub/research-quality.ts +118 -0
  166. package/src/hub/research-record.ts +279 -0
  167. package/src/hub/research.ts +126 -27
  168. package/src/hub/restart.ts +27 -0
  169. package/src/hub/roles.ts +26 -0
  170. package/src/hub/routing.ts +4 -1
  171. package/src/hub/sdlc-merge.ts +39 -1
  172. package/src/hub/sdlc-release.ts +1 -1
  173. package/src/hub/sdlc.ts +62 -11
  174. package/src/hub/settings.ts +5 -0
  175. package/src/hub/startup-event-seeds.ts +51 -0
  176. package/src/hub/startup-readiness.ts +65 -0
  177. package/src/hub/startup-timing.ts +38 -0
  178. package/src/hub/supervision-proposals.ts +405 -0
  179. package/src/hub/supervision-rules.ts +388 -0
  180. package/src/hub/supervision.ts +2 -0
  181. package/src/hub/task-approval.ts +2 -2
  182. package/src/hub/task-repository.ts +5 -0
  183. package/src/hub/tasks.ts +632 -59
  184. package/src/hub/ui.ts +9 -5
  185. package/src/hub/visual-assets.ts +50 -0
  186. package/src/hub/visual.ts +257 -0
  187. package/src/memory/brief.ts +169 -14
  188. package/src/memory/capture.ts +4 -3
  189. package/src/memory/recall.ts +46 -5
  190. package/src/memory/record-provenance.ts +82 -0
  191. package/src/memory/records.ts +116 -0
  192. package/src/models/relay.ts +9 -2
  193. package/src/models/route/adec.ts +190 -0
  194. package/src/models/route/config.ts +64 -3
  195. package/src/models/route/decision-evidence.ts +83 -0
  196. package/src/models/route/decision.ts +215 -0
  197. package/src/models/route/relay-selector.ts +8 -7
  198. package/src/models/route/runtime.ts +35 -22
  199. package/src/models/route/stage-diagnostics.ts +22 -0
  200. package/src/models/route/stage-evidence.ts +55 -0
  201. package/src/models/route/stage-fallback.ts +58 -0
  202. package/src/models/route/stage-input.ts +155 -0
  203. package/src/models/route/stage.ts +5 -147
  204. package/src/ui/guidance-panel.ts +156 -0
  205. package/src/ui/guidance-view.ts +43 -0
  206. package/src/ui/index.html +134 -6
  207. package/src/ui/lineage-view.ts +34 -0
  208. package/src/ui/plugin.ts +136 -11
  209. package/templates/AGENTS.block.md +1 -1
  210. package/templates/config.json +1 -1
  211. package/templates/profiles/general.json +1 -1
  212. package/templates/profiles/research.json +1 -1
  213. package/templates/profiles/writing.json +1 -1
@@ -0,0 +1,121 @@
1
+ ---
2
+ id: supervision
3
+ type: module
4
+ title: Supervision Rules, Proposals and the Decision Path
5
+ status: draft
6
+ parent: agent-hub-architecture
7
+ depends-on: [task-board]
8
+ references: [task-board, bus]
9
+ implements: []
10
+ covers: [supervision]
11
+ tags: [agent-hub]
12
+ paths:
13
+ - src/hub/supervision-rules.ts
14
+ - src/hub/supervision-proposals.ts
15
+ - test/supervision-rules.test.ts
16
+ - test/supervision-proposals.test.ts
17
+ - test/acon-supervision-inbox-1221.test.ts
18
+ ---
19
+
20
+ # Supervision Rules, Proposals and the Decision Path
21
+
22
+ The hub already records what happens to a task: an append-only history of accepted, failed, handed-over and integrated events, its own deliverable measurement, and its own declared-overlap reading. Supervision asks a narrow question of exactly those records: does one of a closed set of conditions hold, and if so which existing hub operation would address it.
23
+
24
+ The reading stage answers that question and nothing else. It is deterministic, and it has no effect path: no proposal, no console page, no inbox entry, no worker turn, no action write, no notification. The proposals stage (#1221 T2) carries a bounded set of those readings to a present role and runs an existing action only when that role says so; what it stores and what it decides is the second half of this document.
25
+
26
+ The module is `src/hub/supervision-rules.ts` for the reading and `src/hub/supervision-proposals.ts` for the queue and the decision path. Their neighbour `src/hub/supervision.ts` turns board milestones into conductor notices and owns their batching, retry and native turns. That module is the milestone producer; these are a pure rule layer over facts already admitted to the public project view, plus the one bounded queue those readings may reach. They are not merged, and the proposal queue starts nothing by itself.
27
+
28
+ ## Facts the rules may read
29
+
30
+ One evaluation takes three fact sets, all authored by the hub, never by a peer or a model:
31
+
32
+ - **task revisions**: an id, a state and the task's structured history (event name, time, check key, plan revision, `evidenceOnly`, `noWrites` and delivered record ids). A note, a withheld body, a review finding or a transcript is not in the fact type and cannot be reached from it.
33
+ - **deliverable measurement**: the hub's own `deliverableStatus` reading per task: whether it measured the files, and which delivered ids it now reads as changed or missing. Ids and states, never a file body.
34
+ - **declared overlap**: the hub's own `overlapHits` rows, one row per unordered pair.
35
+
36
+ Nothing is read from a private task, a cloud observer or a native transcript, and the module imports no board write, bus, daemon, peer or memory module. A source-string test in `test/supervision-rules.test.ts` fails if a clock, a timer, an emit path, `process.env` or one of those imports appears, so the purity is proven mechanically and not only asserted.
37
+
38
+ ## Revision identity
39
+
40
+ An observation binds to a work attempt, not to a history length. A revision is the number of owner episodes (`accepted`, `reassigned`, `escalated`, `reopened`) and the host-authored plan revision, written as `<episodes>:<plan>`; the current attempt starts at the record after the last episode event or plan revision, whichever is later. Unrelated bookkeeping (a check result, a quiet entry) therefore cannot split one pattern into two, and replaying the same records cannot move an observation to a different revision. A plan revision starts an attempt of its own: failures recorded under the previous plan are not read as this plan's and cannot pair with one recorded under the new plan.
41
+
42
+ The acceptance that governs a revision is the last one before it. An acceptance is an episode event, so an acceptance recorded inside the attempt would have opened a new one; a plan revision keeps the acceptance because the same owner continues, which can leave the acceptance before the attempt's first record. A hand-over clears it: a reassignment, escalation or reopen hands the work to another attempt, and the previous owner's acceptance no longer covers it. The overlap rule depends on both boundaries.
43
+
44
+ ## Rules
45
+
46
+ Each rule has an id, a version, one reason code and one suggested existing action. The version is part of an observation: bump it when the trigger, the refs or the meaning of a reason changes, so a stored observation states the contract it was made under.
47
+
48
+ **`repeated_failure` (version 1, reason `repeated_failure`, action `escalate`).** Two equal classified failures inside the current revision, with no clearing evidence between them. A failure is classified into a closed vocabulary: `check:<checkKey>`, `review:changes_requested`, `integration:unresolved`, `done:no-writes`. A code-scope rejection that names no finding (`evidenceOnly`) is not a defect of the work and is not classified. Clearing evidence is a recorded check pass, a landed integration or an approval; each resets the streak. One observation is made per class, so a revision failing two different checks reports both and only the per-revision bound can refuse one. Trigger: `failures:<class>`; refs: the two failure records.
49
+
50
+ **`deliverable_invalidated_check` (version 1, reason `stale_check`, action `recheck`).** The revision recorded a check pass and delivered at least one record, and the hub's own measurement now reads one of those delivered ids as changed or missing. Trigger: `check:<ids>`; refs: the check record and the stale deliverable ids. A delivered id is the only thing that can be stale: a file the hub measured but that this revision never delivered is not evidence about it. If the hub did not measure the files, the rule cannot decide and reports the gap `no-deliverable-measurement` instead of a clean reading.
51
+
52
+ **`declared_overlap_without_integration` (version 1, reason `unintegrated_overlap`, action `request_integration`).** A declared pair whose both sides have accepted their current revision, with no integration request, landed integration or recorded integration failure after either acceptance, and with neither side closed. Persistence is record-based, never elapsed time. Trigger: `overlap:<low>:<high>`, bound to the pair's lower task id so naming the pair in either direction is the same observation; refs: the other task and both acceptance records.
53
+
54
+ Ordinary progress triggers nothing: a passing check, an unequal pair of failures, a cleared streak, an evidence-only rejection, a closed task, a pair that recorded one integration attempt. Elapsed silence is never a trigger by itself: no rule reads a clock, and a record set read two days later reads identically.
55
+
56
+ ## Unknown coverage is an output, never a zero
57
+
58
+ A rule that cannot decide says so with a **gap**: rule id, version, task, revision and one of `no-history`, `no-deliverable-measurement`, `history-truncated`. A revision longer than one rule reads is read as a prefix, and every rule that saw only the prefix reports `history-truncated`; a pair naming a task outside the fact set reports `no-history`. An overlap whose clipped window shows no integration evidence reports `history-truncated` instead of an observation, because integration may sit past the prefix. Gap and observation are separate lists, so "nothing fired" and "nothing could be decided" can never be mistaken for each other.
59
+
60
+ ## Bounds
61
+
62
+ | Bound | Value | Meaning |
63
+ | --- | --- | --- |
64
+ | `MAX_RECORDS` | 64 | records one rule reads from one revision; a longer revision is a prefix and reports `truncated` |
65
+ | `REPEAT_FLOOR` | 2 | equal classified failures before the repetition rule fires: the first is an incident, the second a pattern |
66
+ | `MAX_REFS` | 8 | record refs one observation may carry |
67
+ | `MAX_OBSERVATIONS` | 100 | observations and gaps one shadow supervisor retains |
68
+ | `MAX_PER_REVISION` | 3 | observations one supervisor retains per rule, task and revision |
69
+
70
+ The retention bounds count what they refuse instead of storing it, so a bound never reads as "nothing to report". A refused observation or gap increments `suppressed` and is not kept; a gap that still cannot be retained on a later evaluation is refused and counted again rather than silently dropped.
71
+
72
+ ## The shadow evaluator contract
73
+
74
+ `ShadowSupervisor.observe(facts)` evaluates, keeps only what is new, and returns the observations it added. An observation is deduplicated by `(rule, task, revision, trigger)`: a replayed fact set, a duplicate event or a third equal failure adds nothing and increments `deduped`. Retention is bounded and ordered by that key for observations and by `(rule, task, revision, reason)` for gaps, and the counters are `evaluations`, `observations`, `deduped`, `suppressed` and `gap`.
75
+
76
+ Shadow mode has no effect path at all, and the counters are the literal type zero: `workerTurns: 0`, `actionWrites: 0`, `notifications: 0`. A non-zero value would not typecheck, so AC2 is a property of the type and not only of a fixture. There is no resident worker and no recurring timer; evaluation attaches to events a caller already has.
77
+
78
+ An observation is a closed shape of codes and ids: rule, version, task, revision, trigger, refs, limits (records read and whether they were truncated), the suggested existing action and the reason code. It carries no prose, no note and no file body.
79
+
80
+ **The exported read is one snapshot.** `ShadowSupervisor.snapshot()` returns `{ observations: SupervisionObservation[]; gap: SupervisionGap[]; counts: ShadowCounts; evaluated: EvaluatedRevision[] }`: the retained observations in `(rule, task, revision, trigger)` order, the retained gaps in `(rule, task, revision, reason)` order, the counts object `counts()` also returns, and the coverage of what was read. `observations()`, `gaps()` and `evaluated()` are the three per-list reads behind it. All of them are copies, so a consumer that edits what it received cannot reach the supervisor's state, and none of them adds a fact, a counter or an effect. A consumer reads this shape rather than the retained maps (agent-research#63).
81
+
82
+ **Coverage is part of the reading.** `evaluateSupervision` returns `evaluated`: one `(rule, task, revision)` entry for every rule it actually read, whether or not that rule found anything. A rule that fired nothing and a rule that never ran are different facts, and only the second is invisible here. A closed task is not read at all and has no entry, and neither is a declared overlap with a closed side. A read that cannot decide, such as an overlap naming a task outside the fact set or a clipped revision, has its entry and a gap on the same `(rule, task, revision)`: the gap wins, so that triple counts as unknown, not clean. The supervisor keeps those keys deduped and bounded by `MAX_OBSERVATIONS`, and counts what that bound refused in `counts.evaluatedSuppressed`, so a bound never reads as "nothing was evaluated".
83
+
84
+ ## Proposals and decisions
85
+
86
+ A **proposal** is one observation, kept, with its own identity and life. `src/hub/supervision-proposals.ts` owns them: the store (`supervision_proposals` in `hub.db`, `CREATE TABLE IF NOT EXISTS`, no format bump, so an older hub reads its own tables), the decision path, and the startup reconcile. It imports no board write, no bus, no daemon and no peer module; every board and bus fact reaches it through a port, which is what makes "the queue starts nothing by itself" visible in the imports and not only in prose.
87
+
88
+ Modes come from `supervision.mode`, machine-local and `off` by default:
89
+
90
+ | Mode | What it does |
91
+ | --- | --- |
92
+ | `off` | evaluates nothing; a board event costs one string comparison |
93
+ | `shadow` | stores bounded proposals on the queue and does nothing else: no inbox row, no notice, no turn, no action |
94
+ | `advisory` | the same, and may present a pending proposal in the console's existing inbox, where only an explicit accept or dismiss acts |
95
+
96
+ Observation attaches to the board events the daemon already handles, after the history entry is written, plus one reconcile pass at startup. Nothing polls and nothing is scheduled. A private or unknown task is never observed, and a `backlog` or closed task is not supervised. One board event re-reads the task and each of its declared overlap partners: a pair's reading binds to its lower task id, so a change on the higher-id side is only seen by re-reading the lower one.
97
+
98
+ **Identity and invalidation.** A proposal keeps the reading's dedupe key `(rule, task, revision, trigger)`, unique in the store, so a replayed event or a second read adds nothing and is not counted as advice. A key outlives its proposal: a reading already disposed of (accepted, dismissed or expired) is not proposed again, because the pattern it named has not changed. The queue expires what the current reading no longer produces (new input cleared the pattern, the task moved to another revision, closed, left the board, or the owner's native session was replaced), and a clipped reading, a revision longer than one rule reads, proposes nothing of its own and invalidates nothing, because a prefix proves neither.
99
+
100
+ **The decision path.** A pending proposal is decided by an explicit verb, `accept` or `dismiss`, from the hub tools (`hub_supervision_list`, `hub_supervision_accept`, `hub_supervision_dismiss`) or from the advisory inbox row. Every fence runs before any effect, in this order: the id's own grammar, an existing pending row, a present role on the task (its owner, its reviewer, the configured planner, the conductor, or the person; no new supervisor role exists), the action's own authority, a non-private task, a non-clipped reading, the task still on the board, open and on the same revision, the same native generation it was read under, the reading still holding when re-evaluated, and no `needs_review` delivery holding the owner. The role and the action's authority are read a second time after the facts are awaited and immediately before the row is disposed, because the board can move while that read is in flight. A refusal about the reading expires the proposal; a refusal about the caller, the action's authority or the hold leaves it pending for whoever can take it up. The disposition is a compare-and-set on `state = 'pending'`, so of two deciders racing on one proposal exactly one wins and a decided proposal can never be run twice.
101
+
102
+ A role on the task is not the authority to run what the proposal names. Accepting an `escalate` proposal is the conductor's move, or the person's; an acceptance by the task's owner, reviewer or a planner is refused and the row stays pending rather than being spent on a refusal the action itself would issue. `recheck` and `request_integration` hand the owner a notice, which any present decider may do.
103
+
104
+ **What an acceptance runs.** An existing action, through that action's own authority, never a new one: `escalate` is the conductor's own move for an agent and the board's own escalation for the person, and `recheck` and `request_integration` are the hub's own notice to the owners, whose own record is the check re-run or the integration. Accepting writes nothing to the board: a board acceptance would be a new episode and would replace the acceptance that governs the revision the proposal was read under. Four records stay separate: the intent (this row's disposition, written before the action runs), the receipt (what the action reported: `ran`, `refused`, `unknown`), the task's own result (whatever the board's own method records), and a later review.
105
+
106
+ **An uncertain outcome is never retried.** An action that throws without a synchronous pre-effect refusal leaves the receipt `unknown`. A read settles such a receipt only from the board's own record of that action at or after the **intent** time (`disposedAt`), and only inside the task revision the proposal was read under, so a later escalation of another attempt cannot settle it. The intent time is the boundary and the receipt time is not: the receipt is stamped after a failure threw and again after a restart, so it is always later than the action it reports on. A restart settles an outcome the hub never observed as `unknown` rather than replaying it.
107
+
108
+ **Restart (AC6).** Dedupe keys, dispositions and unknown receipts all live in the table, so a restart keeps them. The one reconcile pass at startup expires pending proposals whose task moved, closed or left the board, and marks an acceptance whose action never reported as `unknown`. Nothing is replayed and nothing is retried.
109
+
110
+ **Bounds.** A proposal is a closed shape of codes and ids: rule, version, task, revision, trigger, refs, records read and whether it was clipped, the existing action, the reason code, the native generation, and later the disposition and its receipt. It carries no prose, no note, no title and no file body, and nothing about a private task reaches it.
111
+
112
+ | Bound | Value | Meaning |
113
+ | --- | --- | --- |
114
+ | `MAX_PROPOSALS` | 100 | pending proposals the queue holds; a further reading is refused, never counted as advice, and counted in the `refused` total `hub_supervision_list` reports |
115
+ | `MAX_PROPOSALS_PER_REVISION` | 3 | proposals one task revision gets, decisions included |
116
+ | `MAX_PROPOSAL_ROWS` | 400 | terminal rows kept for dedupe and history; past it the oldest terminal row goes and a pending row is never pruned |
117
+ | `MAX_PROPOSAL_READ` | 50 | proposals one read returns, pending first |
118
+
119
+ ## Deliberately outside this contract
120
+
121
+ Automatic pause, retry, cancel, reroute, approval or rollback, any automatic acceptance, any import of an external supervision runtime, and any resident worker or recurring timer. The queue proposes an existing action and runs it only when a present role says so. agent-research#63 builds on the reading and bounds above, not on an acceptance path here.
@@ -11,6 +11,8 @@ covers: [task-board]
11
11
  tags: [agent-hub, dogfood]
12
12
  paths:
13
13
  - src/hub/tasks.ts
14
+ - src/hub/sdlc.ts
15
+ - src/hub/build-entry.ts
14
16
  - src/hub/sdlc-metrics.ts
15
17
  - src/hub/board.ts
16
18
  - src/hub/routing.ts
@@ -61,6 +63,16 @@ The task board is the shared record of work and its authority, not a transcript
61
63
 
62
64
  ## Authority and state
63
65
 
66
+ Visual attachments (#1058) annotate public work without changing a task's state,
67
+ outcome or evidence authority. Publication checks current role, turn, task and
68
+ privacy admission before record/bus effects and after awaited file reads. A PII
69
+ task or private turn refuses publication; a task becoming private also withholds
70
+ its retained visual from public reads and assets. A visual id is not a verdict or
71
+ deliverable receipt, and visual-only calls do not count as task progress for
72
+ no-write detection. Ordinary shared tools and the local worker can publish where
73
+ their role permits; isolated fresh-reviewer MCP keeps its exact two-tool contract.
74
+
75
+
64
76
  `Tasks` mediates task proposals, planning, owner/reviewer changes, acceptance, completion and review. `Board` persists the rows, history and typed evidence in SQLite; transport, CLI and UI layers do not independently apply task transitions. The issue remains the change spec and GitHub remains authority for PR/check/tag facts. Separating these authorities prevents a chat claim or adapter callback from bypassing task policy ([#481](https://github.com/STAIxBWLB/agent-hub/issues/481)).
65
77
 
66
78
  A command is authorized against the current actor, role, task state and revision. An asynchronous operation can lose authority while preparing evidence, so write boundaries recheck current scope. Console actions bind the selected task ID and its observed flow revision, rather than an unstable list position. The reason is to keep an approved action attached to the row and state the person actually saw ([#424](https://github.com/STAIxBWLB/agent-hub/issues/424), [#525](https://github.com/STAIxBWLB/agent-hub/issues/525)).
@@ -91,6 +103,56 @@ Review independence and declared scope are different controls. Selection exclude
91
103
 
92
104
  Task text and private-turn words can reach owners, reviewers, overlap notices and memory. Public views use the host's current privacy projection; PII tasks remain stubs for unauthorized observers, and private turns cannot write ordinary shared task text. The projection belongs at the shared boundary because filtering individual callers would leave another observer exposed ([#198](https://github.com/STAIxBWLB/agent-hub/issues/198), [#230](https://github.com/STAIxBWLB/agent-hub/issues/230)).
93
105
 
106
+ ## Spec acceptance carry-over (#1328 T4)
107
+
108
+ `Tasks` may reuse an original person's stored acceptance at existing build-entry gates, using one host `readSpecEdit` observation for carry and the ordinary verdict. Gates return only a virtual receipt and an opaque host proof without a write. `Tasks.acceptSpec` remains USER-only; tools and lifecycle receipt fields cannot create acceptance. `assign()` remains pure and its offer/gate order is unchanged.
109
+
110
+ The source must be an older cancelled local task whose entire `supersededBy` equals `task #N`, `#N` or `N` for the destination. Both stored identities and cached effective repository scopes must agree, and the host-read `lastEditedAt` must equal the source consent (explicit null is valid; missing metadata is unknown). Caller-provided identity changes cannot authorize a carry before the destination identity is recorded. Private/withheld sources, private destinations or caller turns, ambiguous/foreign references, reverse links, changed source cancellation revision/consent metadata, destination flow/identity, roles/policy or unknown host observations cannot grant consent. Source history is not read, so unrelated historical notes are not a carry-currentness input.
111
+
112
+ `Board.specAcceptanceCandidates` reads only bounded source metadata: up to 32 rows plus a truncation sentinel, at most 64 KiB per raw JSON field and 256 KiB total. It never hydrates source tasks or scans their text, plans or history. An incomplete or malformed projection fails closed to manual acceptance. `Tasks` rechecks the projection and destination/caller fences after the host read and revalidates the final outer patch's effective issue/repository/refs scope. Only an admitted outer write consumes the opaque proof with the host Symbol capability: `Board.updateWithSpecAcceptance` uses the existing atomic transaction and deferred observers to publish the original acceptance fields, a HUB `spec acceptance carried` history note naming source/original acceptance time/cancellation revision, and the existing outer event together. A failed admission or second write leaves task, history, status revision and observers unchanged. No plan review, PR/head, local gate or review evidence is cloned; virtual admission snapshots retain the stored flow until atomic publication.
113
+
114
+ ## Merged PR adoption (#1328 T3)
115
+
116
+ The person or the single current configured, rostered conductor can run
117
+ `ahub sdlc adopt-merge <task> --pr <n>` for an active task. `Tasks.adoptMerge`
118
+ binds a missing PR from the explicit command in the established task repository
119
+ (and refuses conflicting bindings), requires a merged PR at the task's last
120
+ recorded full head, green configured required checks at that head and no open
121
+ Important finding. Complete known-zero review threads and pending requests are
122
+ also required, and an explicit change request refuses. No GitHub approving
123
+ verdict is invented or required. One capped GraphQL snapshot supplies the
124
+ head-commit checks and review coverage; incomplete coverage refuses. Unknown
125
+ evidence refuses with a next step. The entire task
126
+ flow and identity, current actor/session, privacy and SDLC policy are fenced
127
+ before and after each awaited GitHub read and immediately before the write.
128
+ Recovery, shutdown and storage holds refuse adoption.
129
+
130
+ Eligible task states are exactly `in_progress`, `in_review` and
131
+ `changes_requested`, with all Important findings dispositioned. `proposed` and
132
+ `backlog` tasks must be assigned and accepted first. `approved` and `cancelled`
133
+ are already closed. Each refusal names the state and the next step. The Board
134
+ transition is host-only and requires the current flow revision; the generic
135
+ state transition table is unchanged.
136
+
137
+ The state becomes `approved` through Tasks, with the actual actor and the
138
+ `merged outside the hub` history event. Ordinary dependent release runs after
139
+ the saved approval. Adoption creates no reviewer verdict, review metric,
140
+ reviewed-head receipt, guarded-merge result, GitHub mutation or branch cleanup.
141
+ A prior withdrawn reviewer approval remains historical and cannot become a
142
+ current reviewer binding through adoption. Historical completion time is the first approval or adoption
143
+ settlement time, separately from reviewer verdict metrics.
144
+ Adoption updates only the GitHub-observed head; existing local and reviewed-head
145
+ metadata remain historical and cannot establish a current reviewer binding.
146
+ Origin follow-back, supervision's approved milestone, task research recording,
147
+ and release/profile settlement timing consume the actual completion. Reviewer
148
+ verdict metrics and reviewerless automatic-done counts remain separate. A later
149
+ adoption never establishes approval before an earlier release.
150
+
151
+ Private tasks and private turns refuse before any GitHub read for every actor,
152
+ including the person. The person's local review authority does not authorize
153
+ sending private task metadata to an external observer. Delegated `--live-test`
154
+ commands cannot borrow the person's authority.
155
+
94
156
  ## Claim evidence records (#931 T1)
95
157
 
96
158
  The #901 owner boundary exposes one canonical `taskClaimIdentity(task, slot)`.
@@ -155,6 +217,33 @@ Stored evidence adds a conditional `research_evidence` recovery feature and
155
217
  store, preserving older recovery records; an empty database requires no new
156
218
  feature. Provenance never manufactures a person verdict or readiness result.
157
219
 
220
+ ## Execution-reference admission (#1220 T2)
221
+
222
+ `Tasks.linkExecutionReference` admits deduplicated inert metadata using the current
223
+ local task id, creation identity, actor role and flow revision. Privacy and role
224
+ checks run before reads and again after screening, before the atomic Board write.
225
+ An identical reference replay creates no second row; stale authority never becomes
226
+ valid because the metadata already exists. Only these admitted references add
227
+ persistence. Read models reuse existing task/attempt rows and recorded evidence,
228
+ with an explicit owning-task scope for dispatch/output/deliverable roots. They
229
+ perform no whole-board scan, native probe, memory write or external resolution.
230
+ Foreign producer keys remain declared target metadata in their own namespace.
231
+ Review currency retains the exact historical head/hash and never carries to
232
+ changed output. The bounds, unavailable equivalence and source-bound cursors are
233
+ specified in [the execution-reference contract](execution-reference.md).
234
+
235
+ ## Guidance-variant lifecycle (#1225 T2)
236
+
237
+ Tasks owns immutable guidance proposals, reads and terminal withdrawal through
238
+ its current task-role, actor/session and privacy fences. Snapshot bodies stay
239
+ in separate private experiment/variant tables, never on Task, refs, plan or
240
+ history. A duplicate never revives stale authority or a withdrawn record; reads
241
+ can show authorized history without declaring it currently applicable. These
242
+ operations change no live role, ownership, permission, routing or native input.
243
+ Controlled recovery retains their conditional feature floor and exact digest.
244
+ The closed payload, storage bounds, declared evidence limits and recovery
245
+ streaming ceiling are specified in [the guidance contract](guidance-experiments.md).
246
+
158
247
  ## Read models and policy extensions
159
248
 
160
249
  Agent list reads return bounded, newest-updated compact pages built from public rows, with a keyset cursor and explicit detail/ID reads. Console compatibility is separate. Pagination is not a frozen snapshot during concurrent edits; its purpose is bounded communication without bypassing private-row projection ([#1083](https://github.com/STAIxBWLB/agent-hub/issues/1083)).
@@ -184,3 +273,35 @@ Placement is computed before reads and sends, never persisted over the stored an
184
273
  Periodic dashboard snapshots perform no comment-material Git or GitHub reads. Explicit task open or refresh requests the review section; a failed read marks only that section unavailable. Material uses the recorded task head and never substitutes the worktree HEAD for a missing commit. Material comes only from guarded immutable Git snapshots in the task's declared refs, plan paths or sections, or complete same-head verified PR paths. Every operation shares eight distinct files, eight seconds including head/PR preparation and 12000 serialized presentation bytes. Both sides share the budget. Truncated material cannot establish placement. Raw hashes bind bytes; projected hashes bind only UTF-8 projected text. The projection name is `text-projection:<extension>` and its version is the existing configured converter fingerprint. This is an opaque configuration identity, not an upstream semantic version; a converter version protocol would be the upgrade path.
185
274
 
186
275
  PII comments remain board-local and public views expose counts only. Private paths retain only supplied lineRange or structural selectors; no coordinate is invented when unsafe selectors are removed. Public review packets carry a host-only opaque package marker so their intended owner receives the packet while logs, operational tails, incoming labels, capture and memory observers receive no quote or body. This marker does not turn an ordinary task into a PII turn. Structured anchored verdicts retain the GitHub verdict mirror with a verdict-only headline when quote provenance is present. Decision metadata, contradiction and safe recurring criteria retain their existing paths; quote-bearing finding proposals remain excluded. The configured PII screen checks reviewer prose before owner-facing publication without receiving source quote selectors. Durable open sent comments and outstanding anchored findings bind shared-memory admission only to the task a note names and its recipient, across restart and intervening chat. Sent comments hold those task-bound writes until resolution or person dismissal; resolved or dismissed comments alone do not retain reviewer history scope. They do not hold notes for an unrelated task or an untagged note after ordinary new input. Anchored-finding scope is conservatively held until the task closes, including later fixed dispositions; a persisted review-package epoch is the path to narrower closure. The metadata scope read is cached against database change stamps and fails closed above 500 role tasks or 16 MiB of UTF-8 history. This exclusion does not hide the owner's summary or check output from its reviewer or owner. Review requests retain trusted observer provenance whenever historical anchors or non-draft comments can be reflected in the completion text, including after comment resolution. Current input provenance separately holds all shared-memory writes and observer sinks for an actually delivered quote-bearing review input or a newly submitted anchored verdict, even if the verdict is refused or immediately closes the task. This exclusion is latched for the input turn until a permitted ordinary next-turn handoff replaces it; restored pull-only sessions instead require a changed native identity. Resolving comments or ending the task alone does not clear it. Bounded ID-only journal receipts preserve held session/input provenance across daemon restart. No matching held record in a complete, intact and readable store is clean; missing expected prior-session records and unreadable, corrupt or unconfirmed session coverage remain unknown. A validated matching release receipt confirms only its own identity. Restored pull-only sessions retain their hold until the native identity changes, regardless of inbox handout. An empty in-memory map alone is not replacement proof. Presence-only traffic and additional inputs within the same active turn cannot clear a latched exclusion. Committed inbox handouts carry the same current-input provenance as push input without claiming a native ACK. Local-worker batches latch before executing any tool, and their final answer and retained history obey the same exclusion. Owner-addressed review outcomes cannot be automatically settled merely because task or reviewer state moved. Original saved-package recipients retain comment scope while comments remain sent, and queued/deferred or unsettled delivery records retain their actual recipients independently of current task roles. A comment dismissal is not a delivery-consumption receipt; any separate uncertainty hold requires explicit disposition. Recovery treats an absent comment section as empty and checks the optional section's counts and digest when present.
276
+
277
+ ## Repository required checks (#1328 T1)
278
+
279
+ Review admission (fresh and cached), CI watches and guarded merge resolve the same
280
+ repository-specific and top-level required names. Only `STAIxBWLB/agent-hub` has a
281
+ native fallback including `seeded guards` for fresh/cached review admission and
282
+ CI watches. Guarded merge continues to require explicit configured names. Another
283
+ repository with no names stays unknown and cannot become ready through an empty
284
+ CI set. Init discovers names in
285
+ one bounded operation of at most three capped GitHub reads, falling back to bounded
286
+ literal workflow metadata on unknown or incomplete evidence. Enforce without names
287
+ refuses before writes. Read-only settings expose running and file SDLC values
288
+ without adding writable settings or widening caller authority. See
289
+ [SDLC required checks](../sdlc.md#required-checks-at-initialization) for bounds and
290
+ unsupported workflow shapes.
291
+
292
+ ## Entry diagnostics (#1328 T2)
293
+
294
+ Build-entry guidance is pure snapshot data, ordered as missing issue identity,
295
+ person spec acceptance, then planner review, each with the actor and command.
296
+ Routing/explain may display it but never read GitHub or change candidate eligibility
297
+ because of it. Existing plan-review holds use the ready-held path, preserving the
298
+ plan-only offer gate; live acceptance still checks spec then plan and rechecks its
299
+ original authority/snapshot. Workflow holds are not peer-ineligibility stalls.
300
+ Private projections withhold issue-specific guidance. Fresh and complete cached
301
+ CI diagnostics share named missing/pending/failed/duplicate/unknown check states,
302
+ without relaxing required checks, inventory completeness or identical-tree reuse.
303
+
304
+ Fresh GraphQL review reads retain the original success proof: a CheckRun must be
305
+ COMPLETED with conclusion SUCCESS; a StatusContext must have state SUCCESS.
306
+ Common normalization cannot turn malformed fresh proof into admission. The shared
307
+ parser and cached evidence schema retain their existing contracts.