@staix/agent-hub 0.44.0 → 0.45.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 (100) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +3 -8
  3. package/docs/agent-notes/adapters.md +2 -2
  4. package/docs/agent-notes/daemon.md +1 -1
  5. package/docs/agent-notes/local-worker.md +1 -1
  6. package/docs/agent-notes/security-review.md +1 -1
  7. package/docs/agent-notes/tasks.md +3 -1
  8. package/docs/agent-notes/tests.md +3 -2
  9. package/docs/design/adapters.md +4 -2
  10. package/docs/design/agent-hub.md +1 -1
  11. package/docs/design/roadmap.md +75 -2
  12. package/docs/design/supervision.md +21 -1
  13. package/docs/design/task-board.md +30 -2
  14. package/docs/dogfood.md +13 -4
  15. package/docs/events.md +5 -1
  16. package/docs/influences.md +7 -0
  17. package/docs/memory.md +4 -4
  18. package/docs/operations.md +51 -18
  19. package/docs/quickstart.md +8 -2
  20. package/docs/research.md +16 -0
  21. package/docs/roadmap.json +4 -0
  22. package/docs/roadmap.md +9 -0
  23. package/docs/sdlc.md +15 -3
  24. package/docs/security.md +3 -3
  25. package/docs/verification/2026-11-19-claude-implementer-2.1.328.md +49 -0
  26. package/docs/verification/2026-11-20-claude-implementer-2.1.329.md +49 -0
  27. package/docs/verification/2026-11-20-sdlc-metrics-diagnosis.md +7 -0
  28. package/docs/verification/2026-11-21-0.45.0.md +69 -0
  29. package/docs/verification/2026-11-22-codex-0171-reviewer-isolation.md +47 -0
  30. package/docs/verified.json +32 -26
  31. package/package.json +2 -2
  32. package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
  33. package/plugins/agent-hub/kimi-hook.js +472 -229
  34. package/plugins/agent-hub/kimi-review-policy-worker.js +5 -5
  35. package/plugins/agent-hub/server.js +513 -258
  36. package/scripts/check-docs.mjs +9 -1
  37. package/src/adapters/acp.ts +11 -1
  38. package/src/adapters/compat.ts +3 -3
  39. package/src/adapters/definitions/builtin-metadata.ts +2 -2
  40. package/src/adapters/definitions/native-context.ts +10 -0
  41. package/src/adapters/jcode.ts +10 -0
  42. package/src/adapters/local-worker.ts +3 -2
  43. package/src/adapters/pi.ts +15 -4
  44. package/src/cli/console-state.ts +3 -1
  45. package/src/cli/help.ts +3 -1
  46. package/src/cli/identity.ts +2 -1
  47. package/src/cli/main.ts +11 -5
  48. package/src/cli/recovery-package.ts +16 -3
  49. package/src/cli/roadmap-write.ts +59 -0
  50. package/src/cli/roadmap.ts +81 -4
  51. package/src/cli/sdlc-output.ts +4 -0
  52. package/src/cli/upgrade-runtime.ts +10 -6
  53. package/src/hub/agent-mem-range.ts +43 -0
  54. package/src/hub/board.ts +102 -1
  55. package/src/hub/check-runner.ts +25 -1
  56. package/src/hub/config-apply.ts +4 -2
  57. package/src/hub/config-trust.ts +1 -1
  58. package/src/hub/context-window.ts +1 -1
  59. package/src/hub/cost-governance.ts +11 -7
  60. package/src/hub/daemon.ts +253 -30
  61. package/src/hub/dogfood-read.ts +4 -2
  62. package/src/hub/edit-guard.ts +100 -0
  63. package/src/hub/events.ts +79 -8
  64. package/src/hub/facts.ts +57 -4
  65. package/src/hub/hub-tools.ts +2 -0
  66. package/src/hub/lifecycle.ts +6 -1
  67. package/src/hub/log-rotation.ts +130 -0
  68. package/src/hub/memory-profile.ts +137 -21
  69. package/src/hub/no-writes.ts +1 -0
  70. package/src/hub/operational-authority.ts +3 -2
  71. package/src/hub/operational-settings.ts +2 -2
  72. package/src/hub/recovery-store.ts +49 -21
  73. package/src/hub/research-experiments.ts +132 -0
  74. package/src/hub/research-quality.ts +8 -2
  75. package/src/hub/research-record.ts +35 -0
  76. package/src/hub/research.ts +128 -28
  77. package/src/hub/roadmap-check.ts +65 -0
  78. package/src/hub/roadmap-decompose.ts +80 -0
  79. package/src/hub/roadmap-export.ts +27 -0
  80. package/src/hub/roadmap-sync.ts +97 -0
  81. package/src/hub/roadmap.ts +40 -0
  82. package/src/hub/sdlc-branch-ci.ts +128 -0
  83. package/src/hub/sdlc-merge.ts +6 -3
  84. package/src/hub/sdlc-metrics.ts +19 -5
  85. package/src/hub/sdlc.ts +73 -5
  86. package/src/hub/settings.ts +1 -0
  87. package/src/hub/snapshots.ts +13 -1
  88. package/src/hub/startup-event-seeds.ts +21 -15
  89. package/src/hub/startup-timing.ts +3 -1
  90. package/src/hub/supervision-proposals.ts +10 -2
  91. package/src/hub/supervision-rules.ts +26 -3
  92. package/src/hub/supervision.ts +7 -0
  93. package/src/hub/task-pr.ts +47 -0
  94. package/src/hub/task-worktree.ts +18 -11
  95. package/src/hub/tasks.ts +502 -34
  96. package/src/hub/usage-rollup.ts +35 -20
  97. package/src/local/tools.ts +13 -1
  98. package/src/memory/client.ts +3 -2
  99. package/src/pi/extension.ts +15 -3
  100. package/src/pi/tool-receipts.ts +26 -0
package/docs/dogfood.md CHANGED
@@ -10,13 +10,17 @@ agent-hub is developed with agent-hub. This page lists every feature, whether it
10
10
 
11
11
  | Feature | State here | Measured by |
12
12
  | --- | --- | --- |
13
+ | Review draft before macOS (#1576) | source and fixture coverage; active after release and restart | compare macOS shard runs per merged PR before and after rollout; target close to one full set of shards per merged PR |
14
+ | Edit governance guards (#1556 T3) | off by default; fixture coverage, available after release and restart | inspect edit guard availability and text-free evidence counts; compare shadow and advisory proposals and check outcomes |
13
15
  | Sandboxed package-manager caches (#1549 T3 partial) | source and isolated macOS fixture coverage; active after release and restart | offline Bun and npm installs use per-command writable caches and leave a temporary home untouched; caller overrides and host-wrapper parity are tested; sandboxed reader-lease identity remains open |
14
- | External merge cost and scan diagnostics (#1555 AC2) | source and fixture coverage; available here after release and restart | compare observed merged PR cost coverage and per-source unknown scan counts in `ahub sdlc metrics` and `ahub sdlc status` |
16
+ | External merge cost and scan diagnostics (#1555 AC2, #1579) | source and fixture coverage; branch-scoped CI cost readback is available here after release and restart, with live post-upgrade verification pending | compare known `first_pass_check`, CI-at-merge, full-gate and macOS-shard sample counts in `ahub sdlc metrics` after a merged PR; compare per-source unknown scan counts in `ahub sdlc status` |
15
17
  | Quota event sampling (#1555 AC4) | source and fixture coverage; active here after release and restart | compare recorded quota row rate and research-quality gap duration across the upgrade |
16
18
  | Routine snapshot cooldown (#1550 AC3) | source and fixture coverage; active here after release and restart | count cooldown-start diagnostics and turn-end events with unknown file evidence; compare boundary latency and verify a retry after ten minutes |
17
19
  | Marker-only no-reply guidance (#1550 AC4) | source and fake-agent coverage; available here after release and upgrade | compare status reply hops and queues after upgrade; fake ACP and Codex tests pin marker-only completion |
18
20
  | Roadmap milestones (#1479 R1) | source and isolated fixture coverage; not enabled in the installed hub until release/restart | computed public approved/total and cached issue/spec/train counts; unknown evidence stays unknown; private membership is count-only; real control/CLI, CAS, inheritance, privacy and conditional recovery tests |
21
+ | Roadmap decomposition (#1480 R2 part 1) | source and fake-model/fake-`gh` coverage; not enabled in the installed hub until release/restart; proposes only, so nothing is intaken, linked or published | the share of proposed parts kept (a part that cites a linked id) versus dropped as unsupported, and the share marked `needs_spec` against `task`; a repeat run that supersedes the pending answer instead of doubling it; private milestone text, spec text and issue titles never in the prompt |
19
22
  | Roadmap bottom-up placement (#1481 R3) | source and fake-`gh`/fake-model coverage; not enabled in the installed hub until release/restart; `import-github` is dry-run by default and is never run with `--apply` against this repository's GitHub in a test | `ahub roadmap unplaced` row counts with `partial`/`unavailable` shown; the share of triage suggestions accepted rather than rejected or dropped as unsupported; a second `import-github --apply` that changes nothing; private tasks only ever counted |
23
+ | Roadmap decomposition acceptance (#1480 R2 part 2) | source coverage with a fake model; the installed hub needs release/restart before a part can be accepted, and no part is released without `ahub intake approve` | drafts held against their milestone (`milestone_links` kind `task`); a repeated accept of one part that adds no row; the share of accepted parts released and completed; a part the screen refuses rendering `[pii]` in the reply |
20
24
  | Distinguishable sessions and sender provenance (#1036, `session_identity`) | on after release and upgrade: a connection that names a peer id but is not that peer's current session is a distinct `<peer>~<origin>` session that can send and read, holds none of the peer's roles and replaces nobody; the channel plugin binds to its own project; every envelope and attach event records the connection. Nothing is refused to a connection that worked before. The recovery label `session_identity` applies once an unsettled delivery holds a session's message | `grep '"session":true' .agenthub/state/events.jsonl` lists every message a foreign session sent, with its minted id and no path or text; a recipient's header shows `from "claude~<id>"` for it; test/identity-provenance.test.ts (AC1, AC3, AC4, recovery label) and test/identity-channel-project.test.ts (AC2, real plugin against a new and an old hub) hold it. Not authentication: a same-user process can always act as the user |
21
25
  | Claude channel attach evidence (#1171) | source and fixture coverage after merge and plugin/daemon upgrade; native Claude push proof remains unverified until a live `ahub claude` session | `ahub status` shows `channel` or `tools-only` with its evidence label; a marker-inheriting non-channel parent remains pull-only and its delivery is read by `hub_inbox` (`test/claude-channel-evidence.test.ts`, `test/daemon.test.ts`); inspect native TUI attaches separately, since fixtures use a synthetic parent row |
22
26
  | Accepted channel delivery settlement (#1172) | source and fixture coverage after merge and plugin/daemon upgrade; native channel handling and long-running-session behavior remain unverified | `bus.accepted_settle_ms` defaults to 10 minutes; explicit channel `hub_inbox` metadata shows accepted/held ids and revisions even when a pull is blocked; a timeout becomes `needs_review` without replay; an important/task/review timeout yields one ids-only status notice when the configured conductor feed is on, with `feed: off` remaining an opt-out; daemon and MCP fixtures cover timeout and opt-out; live accepted-to-completed/timeout behavior remains unverified |
@@ -142,7 +146,7 @@ agent-hub is developed with agent-hub. This page lists every feature, whether it
142
146
  | macOS shards deferred on stacked PRs (#1307) | on in CI for every PR after merge | macOS job-minutes per day and the longest macOS queue wait (57 runs, about 2,250 job-minutes and waits over an hour on 2026-11-07, before); `check (macos-latest)` deferral failures that were followed by a full macOS run on the same PR after it targeted `main` |
143
147
  | Seed anchor diagnostics (#684) | on in the seeded checker; exact-match failure remains mandatory | missing anchors report the base commit, enclosing symbol and current file/line or explicit unknown; `test/seeded-check.test.ts` |
144
148
  | Release authorization (#481 S6, #1063, #1120, #1381) | fixture coverage; delegated live consent awaits release and project upgrade | `test/sdlc-release-authorization.test.ts`, `test/sdlc-release-authorization-flow.test.ts` and `test/runtime-capture-checker.test.ts` retain candidate/docs/origin/restart bindings, actual user/conductor actors and checker capture behavior; `test/sdlc-release-configured-authorization.test.ts`, `test/sdlc-release-configured-policy.test.ts` and `test/sdlc-release-configured-report.test.ts` cover package defaults, release-notes and tag-only/requested-version sources, exact-report bindings, docs:none receipts, malformed or local policy, npm target refusal and unchanged actor/remote checks; no fixture authorizes a live release |
145
- | SDLC metrics and control bands (#481 S7) | `ahub sdlc metrics` on; bands off until `[bands]` is set in `.agenthub/sdlc.toml`, and they write cards only in advise or enforce (in off the report still shows tiers). Completion checks are off here, so `first_pass_check` and the PR-based figures read unknown | its own report; breach episodes per week by tier, and band cards the planner accepted rather than dropped |
149
+ | SDLC metrics and control bands (#481 S7) | `ahub sdlc metrics` on; bands off until `[bands]` is set in `.agenthub/sdlc.toml`, and they write cards only in advise or enforce (in off the report still shows tiers). Completion checks are off here; GitHub first-pass fallback is available after the #1579 change is released and the hub restarts | its own report, including known and unknown first-pass and PR-based samples after a new merged PR; breach episodes per week by tier, and band cards the planner accepted rather than dropped |
146
150
  | Fresh headless reviewers (#223, #519) | configured here (`codex-review`); per-tool approval correction and no-verdict diagnostics/re-offer (#783) take effect after release and upgrade | reviews by fresh sessions, findings they add; a per-review start failure names a closed cause class (#722): `ahub status` reviewer line and hub.log `[cause: ...]`, with the share of failures that are `unknown`; stale admission skips and current-policy `no_verdict` reroutes leave the reviewer available (#781); a real `hub_review` verdict per verified backend/version, beyond inventory-only proof; bounded refusal diagnostics, confirmed re-offers without queue holds, and uncertain fallback holds |
147
151
  | Optional Orca companion (#1198 O0-O4) | moved to [STAIxBWLB/ahub-orca](https://github.com/STAIxBWLB/ahub-orca) (#1387); nothing of it remains in this repository. Still off: not installed here, enabled by nothing, not in the package; fixture checks only, `fixture_only` on macOS and unsupported elsewhere, and the native receipts are **person-run** and **not run** | that repository's `support-matrix.json` and `receipts/`; it reads ahub only through `docs/contracts/companion-cli-v1.json`, which `test/companion-contract.test.ts` holds ahub to |
148
152
  | Kimi periodic review isolation (#1284) | source and isolated fixture coverage; running-hub/native-account behavior is unchanged until release and restart | max-input benchmark records historical inline blocking and worker control-response ordering separately from synchronous authority cost; fake-clock absolute cadence/no-overlap, complete filesystem tamper checks, source and plugin-only workers, and native/worker cleanup retry tests; no new native compatibility or model-quality claim |
@@ -179,10 +183,11 @@ agent-hub is developed with agent-hub. This page lists every feature, whether it
179
183
  | Recovery and upgrade wait settings (#489 H4, task 445) | available after release; this PR does not change this hub's running configuration: the five `recovery.*` settings default to the waits they replace (managed attach 600 s, unmanaged reconnect 90 s, control request 30 s, shutdown 30 s, terminal idle 120 s) and nothing is set in this repository's config | every default equals its old constant (pinned with independent literals), every person-visible wait refuses a value below what shipped, a bad or unreadable file is the default and never an error inside a recovery, the coordinator reads both layers and the file at each wait, and inherit and undo go through the local file; the waits' use inside the real recovery driver (a configured value changing an actual attachment, shutdown or control wait) is covered only as far as the tests in this PR reach, and no real upgrade was run with a configured value |
180
184
  | Tasks and routing operational settings (#489 H2, task 441) | available after release; this PR does not change this hub's running configuration: the six `tasks.*` settings default to the constants they replace (demotion threshold 1.5, half-life, contradiction window, re-screen cap 10, split minimum 5 observations, split failure share 0.3), and nothing is set in this repository's `config.local.json` | each setting's default equals its old constant (pinned independently of the descriptor), each reader is called by the code that used the constant, `ahub settings set`, inherit and undo for `tasks.demote_at`, and a reload that reaches the next demotion, re-screen and split read; 29 hand-made mutants, none surviving; inherit and undo are not yet looped over all six keys, and no live `ahub settings set tasks.*` against a running hub |
181
185
  | Bus and delivery operational settings (#489 H3, task 444) | available after release; no running hub configuration is changed here; five defaults retain the previous retry/digest/pull/note/history constants | default pins, bounded H1 schema/UI/apply parity, next-operation runtime traces and real-daemon write/inherit/undo fixtures for all five keys; live native console/dashboard editing and production delivery performance remain unverified |
182
- | Adapter timing settings (#489 H5, task 446) | available after release; no running hub configuration is changed here; defaults remain ACP tool ceiling 30 min, activity batch 50 ms and Jcode steer 5 s | independent legacy pins, bounds/schema/UI/apply checks, fake-based watchdog/batching/absolute-deadline behavior and real-daemon next-launch snapshots/inherit/undo; native/account timing and live console/dashboard editing remain unverified |
186
+ | Adapter timing settings (#489 H5, task 446) | available after release; no running hub configuration is changed here; defaults remain ACP tool ceiling 30 min (60 min since #1601), activity batch 50 ms and Jcode steer 5 s | independent legacy pins, bounds/schema/UI/apply checks, fake-based watchdog/batching/absolute-deadline behavior and real-daemon next-launch snapshots/inherit/undo; native/account timing and live console/dashboard editing remain unverified |
183
187
  | Model relay and inference settings (#489 H6, task 447) | available after release; no running hub configuration changed here; legacy defaults retained and all seven rows require daemon restart | default pins, schema/UI/apply parity, fake-clock cooldown/backoff and local fake-server journal coverage; configured native/model calls and live console/dashboard editing remain unverified |
184
188
  | UI and console settings (#489 H7, task 448) | available after release; no running console or hub configuration changed here; defaults retained | independent default pins, bounds and config/inherit/undo, startup snapshot/fallback, poll seam, notice/history, cold-start counted trimming and permission/close handling; native interactive console editing remains unverified |
185
- | Context gate | off: `context.gate = 0` | context-pressure events |
189
+ | Context gate | off: `context.gate = 0`; Pi occupancy has source and fake-bridge coverage in headless and TUI modes after release, native live status remains unverified | context-pressure events; `ahub status` reports `pi_usage` and freshness for a verified current Pi session |
190
+ | Roadmap drift, mirror and export (#1482 R4) | source and fake-GitHub coverage; mirror off by default and live write not exercised; mirror inventory fails closed at 1000 issues and PRs | `ahub roadmap check` findings and unknown rules, preview fingerprints, generated roadmap validation and ids-only supervision notices |
186
191
  | Structured checkpoint fields (#1331, `hub_checkpoint`) | on after release and hub upgrade: the fields are optional, so a checkpoint that sends only `summary` behaves as before; quota checkpoints run here, context checkpoints only where `context.gate` is set (off here) | one `checkpoint` event per accepted checkpoint (peer, reason `quota` or `context`, the names of the fields it carried, never its text); `events.checkpoints` in `quality.json` (`total`, `byFieldCount`, `byField`) shows how many checkpoints used the fields and which; over-length refusals name the field and limit in the tool result, and the unit and daemon tests are `test/checkpoint-fields.test.ts` and `test/daemon-context.test.ts` |
187
192
  | Context headroom admission (#802) | off by default: `context.max_assignment_used = 0`; not enabled here by this PR | `ahub route explain` known/unknown context decisions and offered owners; pure/session-freshness, real Tasks/manual override and machine-local config regressions; native live admission remains unverified |
188
193
  | Always-ask action classes (#636) | on after release for managed Claude forms, hub-owned ACP in ask mode, local/Pi tools and received Codex command approvals; Codex native bypass stays not enforceable | classed permission requests (a `gh api graphql` query is a read, a mutation, `gh run` or `gh workflow` write and every command with a shell expansion in a classed position (`git push $B`, `rm -rf "$DIR"`) is asked about: #756, #762; `test/action-class.test.ts` holds the table), full local/Pi command visibility and denied effects for incomplete native views; actionPolicyInfo current-child enforceability, remaining class budgets and weakening attention; Codex native no-request and Kimi non-ask ceilings are explicit |
@@ -202,6 +207,8 @@ agent-hub is developed with agent-hub. This page lists every feature, whether it
202
207
  | Urgent accept takes back unaccepted offers; WIP refusal splits accepted from offered (#1080) | on after release and upgrade; fixture coverage only (`test/urgent-wip.test.ts`: a real `Tasks` over a real board, an owner at its limit with one accepted task and offers). A live urgent task for a busy owner is not recorded here | task history: `unassigned` by `hub` with a `displaced by urgent task` note; the planner notice `was taken back from`; any `planner WIP capacity` refusal that still reads as one undivided list of open tasks |
203
208
  | Declared needs keep work from a peer that cannot do it (#1081: `needs_network`, `needs_worktree`) | on after release and upgrade, for tasks proposed with `needs_network` or `needs_worktree` (or `--needs-network`, `--needs-worktree`); fixture coverage only (`test/routing-network-needs.test.ts` and `test/routing-worktree-needs.test.ts`: routing, `route explain`, explicit assignment, a reservation, accept with a rostered fake Pi and Codex, and a real git repo showing a refused accept creates no branch ref; `test/capabilities-network-worktree.test.ts`: a real daemon's per-peer capabilities). A real Pi or local worker offered flagged work is not recorded here. A hub-made worktree for a sandboxed peer (#1115) is covered by fixtures only (`test/task-worktree.test.ts`: real git, a bare origin, the hub's commit and push, a moved branch or HEAD refused, the path policy, decline and cancel cleanup; `test/task-worktree-sandbox.test.ts`: the real `sandbox-exec` profile, unchanged, with the peer editing and the hub's commit after (the peer's own commit failing is asserted in `test/sandbox-git-refs.test.ts`, #1123); `test/task-worktree-tasks.test.ts`: accept, refusal, decline, cancel and the done hand-off through `Tasks`), so it is on after release and upgrade, for flagged work offered to Pi or local in a git repository with a GitHub origin, and its metric is a Pi or local task whose branch was committed and pushed by the hub and reviewed, with no `.git` write attempt from the sandbox (expected: none) and no empty `task/*` refs left by a declined or cancelled one | `ahub route explain` lines `skipped, no network` and `skipped, no worktree` for Pi or local; Pi or local declines of work that needed the network or a worktree (expected: none once the task is flagged); empty branch refs left by a declined Pi or local task (expected: none for flagged tasks); unflagged tasks that were declined for a missing worktree or registry, which show the planner is not flagging them |
204
209
  | Sandbox refuses `.git` ref, HEAD and worktree writes (#1123) | on after release and upgrade for the local worker and Pi (hub sandbox); fixture coverage under the real `sandbox-exec` only (`test/sandbox-git-refs.test.ts`: the main checkout, a hub-made worktree, a worktree beside its project, a bare repository's worktree, a submodule, a nested one and a linked worktree's, folded names, projects below directories named like the rules; `test/sandbox.test.ts` and `test/tools.test.ts` rewritten where they asserted a sandboxed commit). It needs macOS, so the Linux gate skips it. A real Pi or local worker task is not recorded here; since #1129 a sandboxed task of a write class gets the hub's worktree and commit whether or not it is flagged | a Pi or local write-class task that ends with uncommitted edits in the main checkout (expected: none, the hub made it a worktree), the local `git` tool's `the sandbox does not let you move a branch` note in turn results, and any `Operation not permitted` on a `.git/refs`, `HEAD` or `worktrees` path from a command that should not need it |
210
+ | Managed worktree pre-handoff checks (#1549 T1) | source and fake Pi daemon fixtures only; active after release and upgrade, with live Pi execution unverified | count managed-owner `hub_check_start` runs whose runner ref matches the task's recorded commit, and later `hub_task_done` tip-fence refusals; `test/pi-daemon.test.ts` and `test/task-worktree-tasks.test.ts` cover exact-head admission, unchanged-head reuse, protected paths and later handoff |
211
+ | Managed worktree PR handoff (#1549 T2) | fake GitHub fixtures only; active after release and upgrade, with live Pi execution unverified | managed-owner completions whose `sdlc.pr` identifies the exact pushed head; creation, reuse, lost reply and authority-change refusals are covered by `test/task-pr.test.ts` and `test/task-worktree-tasks.test.ts` |
205
212
  | Hub worktree and commit for every write-class task of a hub-sandboxed owner (#1129) | on after release and upgrade, for `implement` and `bulk_edit` work offered to Pi or the local worker in a git repository, whether or not the task says `needs_worktree`; fixture coverage only (`test/task-worktree-tasks.test.ts`: an unflagged implement and bulk_edit task get the worktree at accept, the hub commits it at `hub_task_done`, decline and cancel clear it, read-only classes and PII tasks get none, a self-claim makes it; `test/routing-worktree-needs.test.ts`: write-class work is not offered where the hub cannot make a worktree and the trace names the cause, read-only classes are not refused; `test/pi-daemon.test.ts` runs a real Pi accept in a repository). A real Pi or local worker task through a whole accept, edit and done is not recorded here | write-class tasks owned by Pi or local whose `hub_task_done` carries a hub commit and branch (expected: all of them); `ahub route explain` lines `skipped, no worktree` for Pi or local on write-class work outside a git repository (expected there, with the cause), write-class tasks that stay with Claude or Codex because the hub could not make a worktree (the cost of this rule: watch whether it starves Pi), and empty `task/*` refs left by a declined or cancelled one (expected: none) |
206
213
  | Paged `hub_task_list` (#1083) | on after release and upgrade, for agents (an agent session's `ahub board` follows the pages); the person's console and `ahub board` from a terminal keep the bare array. Fixture coverage only (`test/task-list-page.test.ts`: a real daemon with 600 seeded tasks; `test/board-agent-paged.test.ts`: the real `ahub board` and `--columns` under an agent identity over a two-page board). A real conductor session reading the live board is not recorded here | the size of a conductor's `hub_task_list` result on the live board (expected: under 64 KB, a `next` cursor while more exist); a page walk that ends with no task repeated; `ahub board` run from an agent shell listing as many tasks as `ahub board` from a terminal; any peer or script that still fails parsing `hub_task_list` as a bare array |
207
214
  | `ahub init` guided prompt (#1065 T2) | on wherever a person runs `ahub init` at a terminal on a new project with no flag and no `--yes`; fixture coverage only (the real CLI under a scripted pty in a temporary HOME: `test/init-prompt.test.ts`). A person answering it on a real new project is not yet recorded and not run here | `ahub init` runs by a person that end with `wrote ...` after the plan, against runs that end `nothing was written` (N, Ctrl-C, Ctrl-D, three bad answers); no `Write this?` line in any log of a peer, live-test or piped run; the settings a person changes from the default, per question |
@@ -230,6 +237,8 @@ agent-hub is developed with agent-hub. This page lists every feature, whether it
230
237
  | Headless amem Records (#1320) | source and disposable fixtures only; off in the running hub until release/upgrade and coordinated shared-home upgrades; production source uses the exact 0.23.1 policy API; no native/provider-backed receipt | Record capture accepted/dropped counts, forwarded answer/digest bytes, injected brief/recall bytes; proven saved-ID/anchor overlap compaction, unchanged unrelated notes, privacy/owner/steering fences and restart fallback in `test/headless-record*.test.ts` |
231
238
  | Research record v2 and dataset export (#1277; person, memory and budget hand-off blocks #1278, #1279, task 802) | off here: `research.enabled` is not set in this repository's config; source and fixture coverage after merge (`test/research-record-v2.test.ts`, `test/research-quality.test.ts`, `test/research-dataset*.test.ts`: a real `hub.db` with hand-computed blocks, the privacy canary and the CLI over two registered projects); no live research pilot has run | `ahub research export --dataset <dir>` then `quality.json`: per-field `unknown` share (a share near 1 for a block means its source is not reaching the record), token attribution share, quota gaps |
232
239
  | Observed model per turn (#1402 T1 to T5) | source and fixture coverage after merge and release; the running hub reports it after upgrade and restart. Live per-agent ids are unrecorded (no model call was made for it), so each agent's source below is from its native schema or the repo's receipts | the share of approved tasks whose owner model is known at `served` or `session` grade: `ahub research` prints `owner model known (served or session): N of M tasks`, and `by model` stops reading `unknown` for them (a `configured` grade counts as a model but not toward that share). `ahub status` and `ahub model list` show the last observed model with its grade (`observed (served)` / `observed (session)`) in place of `not reported` when no override, instance, launch or native baseline model is known. Sources: Codex thread/start and `model/rerouted`, Claude print `modelUsage`, ACP `currentModelId`, Pi `get_state`, Antigravity hook `modelName`; records written before #1402 stay `unknown` until `ahub research backfill` |
240
+ | Edit-governance factorial analysis (#1556 T4) | fixture coverage; available after release, with no live arm selection | compare known and unknown edit-rate groups and 2x2 contrasts; `quality.json` reports cost per verified success unknown until component costs are measured |
241
+ | Edit governance counts (#1556 T2) | runs on this repository once `research.enabled` is on and the hub restarts; source and fixture coverage only until then | `quality.json` `fields["edits.editTool.total"]`: `n` records and how many are `unknown` (tree_only or no evidence); a read-only turn adds no `edits` field |
233
242
  | Dogfood scorecard (#687) | on after release; read-only weekly receipt | `ahub report --dogfood --since 7d --json`; bounded evidence and explicit unknowns |
234
243
  | Claim verdicts and fact_check provenance (#901) | source/fixture coverage; the live research pilot (a person entering verdicts with `ahub task claim`) remains unverified | `ahub report --dogfood` research rows: `claims.reachedPersonVerdict`, per-slot `personVerdict`/`modelLabel`/`agreement`, `factCheck.selection`/`passed`/`failed`/`missingKeysPerRun`; null until a verdict or a keyed check is recorded |
235
244
  | Claim evidence links and synthesis readiness (#931 T1-T3) | source/isolated fixtures after merge; this dev-profile repository publishes no evidence writer and has no live research evidence pilot | Unicode scalar offsets, complete/version-bound projections, duplicate-origin groups and private-upgrade readback; explicit offline manifests bind registered artifact hashes and the complete latest-link inventory; ready-then-new-counterevidence, changed claims/projections/artifacts, missing judgments, open/withdrawn historical contradictions, person disposition and privacy-race fixtures; separate citation/provenance/judgment statuses never certify truth; live research acceptance remains unverified |
package/docs/events.md CHANGED
@@ -6,6 +6,10 @@ file is for tools (`ahub export`, `ahub report`, research measurements). The
6
6
  version is bumped only when a field changes meaning or goes away; new fields and
7
7
  new event types do not bump it.
8
8
 
9
+ ## Rotation (#1546)
10
+
11
+ `events.jsonl` rotates by size: when the live file reaches 64 MiB the daemon renames it to `events.jsonl.<start>`, where `<start>` is the byte offset, in the one stream the segments and the live file make together, of the segment's first byte. Three rotated segments are kept. The oldest is dropped only when no open task could need it: it is kept while its last event is at or after the creation of the oldest open task, so the log may grow past three segments until that task closes, and `hub.log` says when it kept one. Readers (`ahub export`, `ahub report`, `ahub research backfill`, `ahub usage`, the startup seeds, `dogfood`) read the segments oldest first and then the live file, so they see the lines an unrotated file would have held; a byte offset is a position in that stream and survives a rotation. Dropped segments are gone: an offset below the oldest kept byte starts at the oldest kept segment, and a task whose first event was dropped is read from what the log still holds. `hub.log` rotates the same way at 16 MiB with two segments kept, by copy and truncate while the daemon runs (its stderr also appends to the file) and by rename at the next start.
12
+
9
13
  Every event has `v` (schema version), `at` (ISO time) and `type`. No event ever
10
14
  carries a message body or a task title or detail. Private (PII) envelopes are
11
15
  marked `private: true`, and PII tasks `pii: true`.
@@ -41,7 +45,7 @@ marked `private: true`, and PII tasks `pii: true`.
41
45
  | `visual` | `id`, `kind` (`mermaid`, `comparison`, `table`, `beforeAfter`), payload UTF-8 `bytes`, image `files` count, optional numeric `task`: a bounded public visual was stored (#1058). Never the title, source, comparison/table text, path or image bytes. Ordinary delivery records carry only the visual stub and id. |
42
46
  | `native_thread` | `peer` (`codex`), `thread` (its native thread id), `fresh` (`true` when the TUI started the thread, `false` when it resumed one): each thread the Codex adapter adopts, before any turn on it. The upgrade planner reads it: a thread with no rollout that the hub saw start, with no `turn_start` since, is planned as a fresh start (issue #215) |
43
47
  | `turn_start` | `peer`, `turn` (`<peer>#<hub run>.<n>`, unique across restarts). A turn follows the adapter: pausing a busy peer does not end it |
44
- | `turn_end` | `peer`, `turn`, `ms`, `tokens` (when the adapter reported any during the turn), `files` and `snapshotMs` (when snapshots are on: how many files the turn changed, and the time both snapshots took); optional numeric `task`, `attribution` (`delivery`, `single_open`, `unattributed`) frozen at turn start, `pii: true` for an attributed PII task; optional `model` and `modelEvidence`, both or neither (#1402): the model id the adapter observed for the turn, with how it was learned, strongest first: `served` (the provider or the native transcript named it for this turn's responses), `session` (the native session's current model id), `configured` (only the hub's own override or launch flag is known). An alias is recorded as the native surface reported it, never expanded; a label that fails the safe-label check is dropped with its evidence |
48
+ | `turn_end` | `peer`, `turn`, `ms`, `tokens` (when the adapter reported any during the turn), `files` and `snapshotMs` (when snapshots are on: how many files the turn changed, and the time both snapshots took); optional numeric `task`, `attribution` (`delivery`, `single_open`, `unattributed`) frozen at turn start, `pii: true` for an attributed PII task; optional `model` and `modelEvidence`, both or neither (#1402): the model id the adapter observed for the turn, with how it was learned, strongest first: `served` (the provider or the native transcript named it for this turn's responses), `session` (the native session's current model id), `configured` (only the hub's own override or launch flag is known). An alias is recorded as the native surface reported it, never expanded; a label that fails the safe-label check is dropped with its evidence; optional `edits` (#1556 T2, only with `research.enabled`, never for a private turn, absent on a read-only turn): closed counts `obs` (`hook`, `stream`, `tree`), `arm`, `e` (edit tool) and `s` (shell route) as five counts each (total, verified full read, partial read only, blind or stale, rejected or blocked), `u` (tree writes no hook attributed), `fe`, `rev`. Never a path, a command or text; the operational view does not export it |
45
49
  | `tokens` | `peer`, `n` (tokens added since the previous report), optional `source: kimi_wire` and opaque `id` (the native row, used to keep a partial-write retry exactly once), optional numeric `task`, `attribution` (`delivery`, `single_open`, `unattributed`), `pii: true` for an attributed PII task |
46
50
  | `usage` | `peer`, `source` (`omniroute`, `claude_transcript`, `claude_result`, `codex_appserver`, `kimi_wire`, `jcode_acp`, `agy_transcript`), opaque `id`, optional `measuredAt` (provider/source time), the `requestedModel`, `servedModel` and `provider` labels, and any provider-reported counters (`inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `reasoningTokens`, `totalTokens`); optional numeric `task`, `attribution` (`delivery`, `single_open`, `unattributed`), `pii: true` for an attributed PII task. Missing counters stay unknown. |
47
51
  | `task` | `id`, `event` (the board history event, e.g. `proposed`, `assigned`, `done`, `check failed`, `blocked`, `ready`), `by`, `state`, `owner`, `reviewer`, `class`, `pii`, and `reason` when the board recorded a move reason (`manual`, `budget`, `offline`, `idle`, `rejections`, `declined`, `inference_failed`, `delivery_failed`, `step_limit`). The research record (docs/research.md, #1277) reads these for every terminal task, approved or cancelled; no new event type was added |
@@ -0,0 +1,7 @@
1
+ # Influences
2
+
3
+ agent-hub shares no code with these projects. Each informed a feature; the design and implementation are agent-hub's own.
4
+
5
+ - [agent-bridge](https://github.com/raysonmeng/agent-bridge): a bridge between Claude Code and Codex. Its forwarding of agent messages, marker tiers, busy guard and turn watchdog informed the bus.
6
+ - claude-mem: a memory service for coding agents. It was the hub's memory backend until 2026-10-17, when the first-party `@staix/agent-mem` replaced it; `ahub memory` can still import from it ([memory](memory.md)).
7
+ - [GSD](https://github.com/gsd-build/get-shit-done): a phased workflow for coding agents. Its acceptance-criteria checklist remains in the review's Compliance pass ([analysis](gsd-collaboration-analysis.md)).
package/docs/memory.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Hub memory integration
2
2
 
3
- Agent-hub consumes the exact-pinned first-party [`@staix/agent-mem`](https://github.com/STAIxBWLB/agent-mem) library (the exact pin is in [package.json](../package.json); initial pin `0.1.1`). The package owns portable storage, tiers, graph, goals, sync, import and raw commands. Agent-hub owns caller authority, current project privacy policy, task lifecycle integration and presentation. Claude-mem is an optional, explicit import source only; runtime recall and capture make no worker HTTP requests.
3
+ Agent-hub consumes the first-party [`@staix/agent-mem`](https://github.com/STAIxBWLB/agent-mem) library through the declared range `>=X.Y.Z <M.0.0` in [package.json](../package.json) (X.Y.Z at or above 0.33.0, M the next major; the lockfile resolves a release inside it). A plain release inside the range is accepted without a hub release when the package's `HOST_API_MIN` and `HOST_API_VERSION` are positive integers, `MIN <= VERSION`, and their range intersects the host API range this hub supports (`[1, 1]`); a package without them, or with an incompatible host API, is refused with the cause and the next step. A new major is a reviewed raise. Format-floor note: a new minor may raise the on-disk format floor, and a store written by it is not readable by an older hub or amem, so roll the hub back only together with the store, and read agent-mem's release notes for the new floor before upgrading. The package owns portable storage, tiers, graph, goals, sync, import and raw commands. Agent-hub owns caller authority, current project privacy policy, task lifecycle integration and presentation. Claude-mem is an optional, explicit import source only; runtime recall and capture make no worker HTTP requests.
4
4
 
5
5
  ## Portable core and data directory
6
6
 
@@ -214,7 +214,7 @@ Write screening examines both the JSON representation and literal structured key
214
214
 
215
215
  ## Agent-authored records (#1320)
216
216
 
217
- Managed headless Codex, Kimi, Qwen, Jcode, Pi and local turns receive the package-owned Record instruction once per owned turn. Claude sessions keep their own amem hook path; isolated reviewers and person-owned TUI prompts receive no new instruction. The public `recordsEnabled` accessor from exact-pinned amem 0.30.0 applies the effective machine/repository `records: false` setting to instruction, capture and Record preference. An unavailable policy disables this optional path.
217
+ Managed headless Codex, Kimi, Qwen, Jcode, Pi and local turns receive the package-owned Record instruction once per owned turn. Claude sessions keep their own amem hook path; isolated reviewers and person-owned TUI prompts receive no new instruction. The public `recordsEnabled` accessor from agent-mem 0.32.1 applies the effective machine/repository `records: false` setting to instruction, capture and Record preference. An unavailable policy disables this optional path.
218
218
 
219
219
  The hub imports the instruction and parser from agent-mem. Valid final-answer records become `Record` capture rows with project and peer attribution, not curated notes or approved evidence. Complete text and anchors clear current secret, PII, private-path and deny policy before storage. Private, PII, review-scoped, remote, unbound and incomplete turns are excluded. Owner, turn, session, profile and policy must remain current; unsafe steering excludes the rest of that turn. No model or network call is added.
220
220
 
@@ -290,11 +290,11 @@ An unchanged failure emits one safe log line per episode. A complete bounded pol
290
290
 
291
291
  `ahub memory declined [--json]` is a read-only inspection that an agent shell may also run (#1522). It reports physical outbound row IDs and safe policy categories, never title, body, path nodes or literal private patterns. Reads defer promotions and recheck the profile binding. Forgotten originals still matter: `forget` changes materialized visibility but leaves the source row in append-only history. Do not use it as a promise to clear a sync refusal.
292
292
 
293
- The exact-pinned agent-mem 0.30.0 supplies bounded `inspectSyncPolicy` inspection for shared-v1 and generation profiles. A complete result lists the declined IDs and safe rule categories for the inspected physical outbound history, including originals hidden by a later forget. An incomplete `input-bound` result may now carry an optional `bound` receipt (`kind`, `limit`, `observed`, `nextStep`); `complete` and `reason` keep their shapes. An unavailable, stale or bounded-out inspection remains explicitly incomplete; it never proves that no declined rows exist. The hub uses the public SDK rather than private helpers, snapshots of full history or its own portable log reader.
293
+ The declared agent-mem floor (0.33.0) supplies bounded `inspectSyncPolicy` inspection for shared-v1 and generation profiles. A complete result lists the declined IDs and safe rule categories for the inspected physical outbound history, including originals hidden by a later forget. An incomplete `input-bound` result may now carry an optional `bound` receipt (`kind`, `limit`, `observed`, `nextStep`); `complete` and `reason` keep their shapes. An unavailable, stale or bounded-out inspection remains explicitly incomplete; it never proves that no declined rows exist. The hub uses the public SDK rather than private helpers, snapshots of full history or its own portable log reader.
294
294
 
295
295
  The package also owns per-row local placement. The hub adopts only the projection of a successful trusted SDK placement result: `ok` with its verified withheld/exported counts. Since agent-mem 0.23.0 the daemon passes `placementAttestation` on every `syncMemory` pass, built by the package's own `createPlacementAttestation` for the memory home (`hostPlacementAttestation`, `src/hub/memory-sync-attestation.ts`). A legacy or shared-v1 store ignores it. The hub supplies no writer facts of its own, never fabricates the proof and builds a new one per pass, so no measurement outlives it. A refusal (`PlacementWriterContextError`) is its own closed cause `writer` in status, the dashboard and the log: the category (`running CLI`, `host package`, `setup receipt`, `declared writer`, `active locator`, `home floor`, `writer renewal`, or `unknown` for an unrecognized SDK category), the cause class (`missing`, `changed`, `unavailable`) and the next step (repair the amem install and its host pin, then a person runs `amem migrate --sync-placement --dry-run`). The package's message, paths and versions never enter status or logs. It logs once per episode like every other cause. Count projection does not delete or rewrite notes, change policy or promote a declined row; transport failures remain failures.
296
296
 
297
- Legacy stores without active per-row placement still refuse a sync containing declined rows. The native amem CLI has person-only activation from 0.22.0 ([activation documentation](https://github.com/STAIxBWLB/agent-mem/blob/v0.24.0/README.md#initial-sync-placement-activation)). A person using a CLI upgraded with the hub's pin (0.30.0; a 0.22.1 install sharing the home drops Record entries, see [Agent-authored records](#agent-authored-records-1320)) can preview it with every local writer installation declared, including the CLI and hub library installs:
297
+ Legacy stores without active per-row placement still refuse a sync containing declined rows. The native amem CLI has person-only activation from 0.22.0 ([activation documentation](https://github.com/STAIxBWLB/agent-mem/blob/v0.24.0/README.md#initial-sync-placement-activation)). A person using a CLI upgraded with the hub's declared floor (0.32.1; a 0.22.1 install sharing the home drops Record entries, see [Agent-authored records](#agent-authored-records-1320)) can preview it with every local writer installation declared, including the CLI and hub library installs:
298
298
 
299
299
  ```sh
300
300
  amem migrate --sync-placement --dry-run --writer-root '<cli-install-root>' --writer-root '<host-amem-install-root>' --json
@@ -1211,7 +1211,7 @@ operation cannot confirm startup.
1211
1211
  Each completed daemon startup writes one `startup timings ms:` line to `hub.log`,
1212
1212
  with fixed phase names and durations; the span before `task_runtime` carries
1213
1213
  the sub-phases `task_checks`, `task_ports`, `task_board` and `task_recovery`
1214
- (#1445), and its board reads cover open tasks only. `task_checks` no longer waits for the first check-runner probe (about 8 s over ssh to a remote runner): startup waits for it at most 500 ms, `ahub status` reports the runner as unavailable with `runner probe in progress` until it settles, and `check_run` joins the same single probe. The three event-seed consumers share one
1214
+ (#1445), and its board reads cover open tasks only. The work after readiness is split into one boundary per step (`post_ready_handoff`, `_queue`, `_watch`, `_reconcile`, `_goals`, `_leases`, `_crash`, `_pi`, `_drift`, #1591), so a slow start names the step that held control replies. `task_checks` no longer waits for the first check-runner probe (about 8 s over ssh to a remote runner): startup waits for it at most 500 ms, `ahub status` reports the runner as unavailable with `runner probe in progress` until it settles, and `check_run` joins the same single probe. The three event-seed consumers share one
1215
1215
  lossless streaming pass; abandoned snapshot bodies are not read for startup.
1216
1216
  The [startup receipt](verification/2026-11-07-daemon-startup-1232.md) separates
1217
1217
  seed I/O from bounded usage-rollup I/O and records the isolated measurements.
@@ -1873,7 +1873,10 @@ delivery. A delivery or answer is not a task completion receipt.
1873
1873
 
1874
1874
  The hub writes structured events to `.agenthub/state/events.jsonl` alongside
1875
1875
  `hub.log` (schema: `docs/events.md`). They carry ids, routing, sizes, states and
1876
- token counts, never message bodies or task titles.
1876
+ token counts, never message bodies or task titles. Both rotate by size (#1546):
1877
+ `events.jsonl` in 64 MiB segments with three kept (longer while an open task may
1878
+ need one) and `hub.log` at 16 MiB with two kept; every reader reads the segments
1879
+ before the live file, so rotation loses no input (`docs/events.md` "Rotation").
1877
1880
 
1878
1881
  ```bash
1879
1882
  ahub report --since 7d # turns, busy time and tokens per peer, messages, overlaps, task events
@@ -2081,7 +2084,7 @@ ahub memory forget 1a2b3c4d # also promote, demote, supersede, rebu
2081
2084
 
2082
2085
  `"memory": { "native": false }` in `.agenthub/config.json` turns it off for a project.
2083
2086
 
2084
- The exact-pinned `@staix/agent-mem` 0.30.0 resolves `AMEM_HOME`, then `$AGENTHUB_HOME/memory`, then `~/.agenthub/memory`. An absent `M/profile.json` selects shared v1; an explicit generation selects `M/generations/G` with the package's readonly legacy bridge. All daemon memory consumers and the hub memory/goal CLI use that selected profile. Invalid metadata or a missing selected generation makes native memory unavailable while the bus and board continue; there is no fallback to legacy writes. Inspect the daemon's memory binding/availability before interpreting missing memory as an empty store.
2087
+ The declared `@staix/agent-mem` range (`>=0.33.0 <1.0.0` in `package.json`, resolved to 0.33.0 by `bun.lock`) resolves `AMEM_HOME`, then `$AGENTHUB_HOME/memory`, then `~/.agenthub/memory`. A plain release inside that range opens memory without a hub release when its host API range intersects the supported `[1, 1]`; an out-of-range, unattested, prerelease or host-API-incompatible package refuses to open it. A new minor can raise the store format floor: an older hub or amem cannot read a store a newer one wrote, so roll back the hub together with the store. An absent `M/profile.json` selects shared v1; an explicit generation selects `M/generations/G` with the package's readonly legacy bridge. All daemon memory consumers and the hub memory/goal CLI use that selected profile. Invalid metadata or a missing selected generation makes native memory unavailable while the bus and board continue; there is no fallback to legacy writes. Inspect the daemon's memory binding/availability before interpreting missing memory as an empty store.
2085
2088
 
2086
2089
  The daemon checks its selector at hub operation entry and before candidate/counter writes. It does not hot-switch handles or provide an atomic fence against selection changes during an in-flight core call. Quiesce consumers and close their handles before migration or selection changes; reopen through the supported session-preserving lifecycle afterward. Candidate/counter storage remains `M/candidates.db`, independent of `G`; since agent-mem 0.7.0 `amem review` also lists and accepts candidates on a selected generation. Every running hub using this home needs an authenticated receipt: a matching ready binding, or a generation-capable unbound receipt (`disabled` when native memory is off, `unavailable` when opening failed) proving it holds no memory handle. An unbound daemon and zero running hubs are quiesced for memory; a stale bound handle, unreadable registry or unknown runtime is not ready. Existing JSON memory/goal results remain unchanged; the additive binding receipt belongs to daemon status, profile-check and the decay object. This source integration does not authorize installing a new runtime, migrating real memory, restarting sessions or claiming real-machine sync/capture receipts. Migration/deactivation and their limits belong to [agent-mem](https://github.com/STAIxBWLB/agent-mem); see [the hub profile contract](memory.md#selected-memory-profile).
2087
2090
 
@@ -2845,7 +2848,7 @@ A guarded file edit that the daemon keeps at its accepted value remains visible
2845
2848
  | Routing | `recovery.control_timeout_s` (30-300 seconds, default 30) | `config.local.json` | next use; the next control request of the recovery coordinator to a hub reads it |
2846
2849
  | Routing | `recovery.shutdown_wait_s` (30-300 seconds, default 30) | `config.local.json` | next use; the next wait for a committed source to stop reads it once, at its start |
2847
2850
  | Routing | `recovery.terminal_idle_wait_s` (30-600 seconds, default 120) | `config.local.json` | next use; the next wait for a terminal to go idle before it is closed reads it |
2848
- | Start | `adapter_timing.acp_tool_ceiling_min` (1-30 minutes, default 30) | `config.local.json` | next use; a new ACP launch captures it; effective ceiling is at least the watchdog |
2851
+ | Start | `adapter_timing.acp_tool_ceiling_min` (1-120 minutes, default 60) | `config.local.json` | next use; a new ACP launch captures it; effective ceiling is at least the watchdog |
2849
2852
  | Start | `adapter_timing.acp_activity_batch_ms` (10-50 ms, default 50) | `config.local.json` | next use; a new ACP launch captures its activity batch delay; pending flushes are unchanged |
2850
2853
  | Start | `adapter_timing.jcode_steer_timeout_s` (5-60 seconds, default 5) | `config.local.json` | next use; a new Jcode launch captures one total native steer deadline |
2851
2854
  | Routing | `model_relay.cooldown_failures` (1-100, default 3) | `config.local.json` | restart; consecutive transport/startup failures before cooling an alias |
@@ -2962,9 +2965,20 @@ primitive option values for Kimi/generic ACP and Jcode, including Jcode's inheri
2962
2965
  ACP options. An accepted edit leaves active tool ceilings, pending activity
2963
2966
  flushes and native steer deadlines unchanged until a new peer starts.
2964
2967
 
2965
- The open-tool ceiling defaults to the legacy 30 minutes, can only tighten, and
2966
- remains `max(watchdogMs, configured ceiling)` with remaining-only rearming. The
2967
- activity delay defaults to the legacy 50 ms and never exceeds that buffer window;
2968
+ The open-tool ceiling defaults to 60 minutes, because this repository's own
2969
+ instructions expect a gate run to wait up to 50 (`dot remote verify --wait 50m`);
2970
+ it can be tightened or raised, and remains `max(watchdogMs, configured ceiling)`
2971
+ with remaining-only rearming, so a tool call that reports no progress for those
2972
+ minutes still ends the turn. A turn the ceiling cancels names its cause: hub.log
2973
+ gets the ceiling and its minutes for a configured kind whose own native
2974
+ diagnostics stay withheld, plus the launch that restarts that peer (`ahub jcode`,
2975
+ or `ahub jcode --as <peer>` for an extra instance) and the held row it leaves
2976
+ behind; a private turn's tool titles stay withheld with them. That restart brings
2977
+ the peer back but does not redeliver the cancelled delivery, so the person settles
2978
+ it with the command `ahub queue show <id>` prints, after
2979
+ `ahub queue list --peer <peer>` names the row.
2980
+
2981
+ The activity delay defaults to the legacy 50 ms and never exceeds that buffer window;
2968
2982
  its 4096-character threshold and privacy handling stay fixed. Jcode's default
2969
2983
  5-second steer deadline can only rise, and one absolute timer covers all native
2970
2984
  phases; pre-send refusals and post-send uncertainty retain their existing fences.
@@ -3521,9 +3535,10 @@ them automatically.
3521
3535
 
3522
3536
  For an ACP peer (headless Kimi, Qwen, Jcode) a tool call that was announced and
3523
3537
  has not completed or failed counts as running work, not silence: the inactivity
3524
- watchdog (`watchdog_ms`) keeps the turn alive up to a 30 min tool ceiling (never
3525
- below `watchdog_ms`) since the peer's last output, then cancels the turn as
3526
- before and logs which open tool call was silent (#542).
3538
+ watchdog (`watchdog_ms`) keeps the turn alive up to the open-tool ceiling
3539
+ (`adapter_timing.acp_tool_ceiling_min`, default 60 min since #1601, never below
3540
+ `watchdog_ms`) since the peer's last output, then cancels the turn as before and
3541
+ logs which open tool call was silent (#542).
3527
3542
 
3528
3543
  After the inactivity watchdog cancels a Codex turn, a late acceptance, answer or
3529
3544
  completion from that turn is dropped and never reaches a later audience; its
@@ -3731,7 +3746,10 @@ deadline once, and a deadline after a told result ends silently (#540). Cancelle
3731
3746
  attempts and a draft PR's deferred `check (macos-latest)` are pending to this watcher,
3732
3747
  not failures; it keeps watching for a replacement run. After `gh pr ready`, an older
3733
3748
  macOS aggregate failure stays pending while a newer same-workflow macOS shard is queued
3734
- or running (#1490). If GitHub returns multiple
3749
+ or running (#1490). Review admission accepts this repository's draft head when Ubuntu,
3750
+ seeded guards and the other required checks pass and the failed macOS aggregate's
3751
+ exact-head job proves its draft-deferral step was the only failure (#1576); merge
3752
+ still needs the full macOS gate. If GitHub returns multiple
3735
3753
  rows for one check, the hub uses an older-run filter only when workflow identity and
3736
3754
  start times identify one unique latest run; ambiguous duplicates cannot establish a
3737
3755
  pass (#1527). On the result the owner and the reviewer each get one
@@ -4387,7 +4405,7 @@ release. The global CLI is promoted last.
4387
4405
 
4388
4406
  A lost commit or start reply is reconciled against the actual daemon identity,
4389
4407
  package digest, terminal binding, and phase receipt. An uncertain terminal
4390
- creation is never repeated blindly. Recovery retains the exact-pinned first-party memory package with the preserved runtime, includes its identity and bytes in the digest, and refuses missing, symlinked or changed retained dependencies instead of resolving a mutable ancestor/global installation. It does not copy the full dependency tree.
4408
+ creation is never repeated blindly. Recovery retains the first-party memory package with the preserved runtime, includes its identity and bytes in the digest, and refuses missing, symlinked or changed retained dependencies instead of resolving a mutable ancestor/global installation. It does not copy the full dependency tree.
4391
4409
 
4392
4410
  After creating a managed terminal, the coordinator saves its exact handle, incarnation and worktree before waiting up to 600 seconds (10 minutes) for authenticated attachment to the expected target hub and conversation. A pending or failed creation receipt also waits when the current target has a verified live launcher; its saved binding retains the pending/failed origin across interruption. An idle terminal alone is not attachment proof: after idle, the coordinator re-reads the launch record and Orca's identity every second within the same bound, until the terminal maps to the expected session or contradicts it (#599). Without a current launch record, a confirmed-ended row for another terminal and an attached session still reporting no id keep the chosen terminal waiting within the same bound; a late matching record continues that wait. Live replacement and unreadable records still block. Only non-offline session ids count, and older-instance launchers are checked before declaring a launch gone. Timeout retains the binding and diagnostic receipt; resume waits on that same binding rather than opening a duplicate.
4393
4411
 
@@ -6151,6 +6169,21 @@ proposed milestones and link open issues. Imports are idempotent, partial reads
6151
6169
  are marked, and nothing is written back to GitHub. See the [bottom-up placement
6152
6170
  contract](design/roadmap.md#bottom-up-placement-r3).
6153
6171
 
6172
+ ### Decomposition (R2)
6173
+
6174
+ `ahub roadmap decompose <id>` asks the configured planner or unique conductor's
6175
+ hub model how one milestone decomposes, reading only the milestone's public title
6176
+ and outcome, the goal or architecture specs it links and the issues it links. Each
6177
+ proposed part cites an id it was shown and says whether it needs its own spec
6178
+ issue or goes straight to a task; an answer that cites nothing it was shown is
6179
+ dropped whole. The kept parts are saved as one pending model answer per milestone,
6180
+ so a second run supersedes the first. Proposing intakes, links and publishes nothing.
6181
+ `ahub roadmap decompose <id> --accept <part>` holds one proposed part as a backlog
6182
+ intake draft linked to the milestone, carrying its spec or task kind; nothing offers,
6183
+ pulls or routes it until the person releases it with `ahub intake approve`, and
6184
+ accepting the same part again returns the same draft. No part becomes a spec issue on
6185
+ GitHub. See the [decomposition contract](design/roadmap.md#decomposition-r2).
6186
+
6154
6187
  ## Planning and phased releases (#263)
6155
6188
 
6156
6189
  Use `ahub backlog list` to read public staged work (a table by rank with the reserved owner, dependencies and cut titles, then a count by reserved owner; `--full` and piped output keep whole titles and `--json` prints the raw listing), then `ahub backlog plan <id>
@@ -6599,7 +6632,7 @@ Default-branch capture runs only at daemon startup when a Claude implementer is
6599
6632
 
6600
6633
  Project Git retains the core policy that clears credential.helper and core.askpass; an HTTPS push needing those helpers may fail, rather than importing credentials or relaxing that policy. Task branch/config proof reads are bounded synchronous reads (1.5 seconds per reader); slow or unknown evidence asks. The existing sandbox profile discovery is also synchronous; moving it to an asynchronous inventory proof with a shared deadline remains a follow-up. The nonce is visible in a permission response, so it proves a bounded grant rather than native-dispatch provenance.
6601
6634
 
6602
- The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) covers Claude Code 2.1.309, and the [2.1.310 receipt](verification/2026-10-26-claude-implementer-2.1.310.md) repeats it on 2.1.310 (with 2.1.309 as a control), and the [2.1.314 receipt](verification/2026-10-31-claude-implementer-2.1.314.md) repeats it and the host-wrapper procedure on 2.1.314 (with 2.1.310 as a control), and the [2.1.316 receipt](verification/2026-10-31-claude-implementer-2.1.316.md) repeats both on 2.1.316 (with 2.1.314 as a control), and the [2.1.318 receipt](verification/2026-11-05-claude-implementer-2.1.318.md) repeats both on 2.1.318 (with 2.1.316 as a control), and the [2.1.319 receipt](verification/2026-11-06-claude-implementer-2.1.319.md) repeats both on 2.1.319 (with 2.1.318 as a control), and the [2.1.322 receipt](verification/2026-11-10-claude-implementer-2.1.322.md) repeats both on 2.1.322 (with 2.1.319 as a control), and the [2.1.323 receipt](verification/2026-11-13-claude-implementer-2.1.323.md) repeats both on 2.1.323 (with 2.1.322 as a control), each with a deterministic loopback fixture and no real account/model call. It is not sandbox proof or a runtime receipt gate. The real account/model/person interaction remains a separate live leg.
6635
+ The [native permission receipt](verification/2026-10-23-headless-claude-permissions.md) covers Claude Code 2.1.309, and the [2.1.310 receipt](verification/2026-10-26-claude-implementer-2.1.310.md) repeats it on 2.1.310 (with 2.1.309 as a control), and the [2.1.314 receipt](verification/2026-10-31-claude-implementer-2.1.314.md) repeats it and the host-wrapper procedure on 2.1.314 (with 2.1.310 as a control), and the [2.1.316 receipt](verification/2026-10-31-claude-implementer-2.1.316.md) repeats both on 2.1.316 (with 2.1.314 as a control), and the [2.1.318 receipt](verification/2026-11-05-claude-implementer-2.1.318.md) repeats both on 2.1.318 (with 2.1.316 as a control), and the [2.1.319 receipt](verification/2026-11-06-claude-implementer-2.1.319.md) repeats both on 2.1.319 (with 2.1.318 as a control), and the [2.1.322 receipt](verification/2026-11-10-claude-implementer-2.1.322.md) repeats both on 2.1.322 (with 2.1.319 as a control), the [2.1.323 receipt](verification/2026-11-13-claude-implementer-2.1.323.md) repeats both on 2.1.323 (with 2.1.322 as a control), and the [2.1.328](verification/2026-11-19-claude-implementer-2.1.328.md) and [2.1.329](verification/2026-11-20-claude-implementer-2.1.329.md) receipts repeat both on those versions (each with 2.1.323 as a control), each with a deterministic loopback fixture and no real account/model call. It is not sandbox proof or a runtime receipt gate. The real account/model/person interaction remains a separate live leg.
6603
6636
 
6604
6637
  A headless Claude reviewer is run by the hub instead (task 223): declare
6605
6638
  `"claude-review": { "kind": "claude", "roles": ["reviewer"], "start_mode": "headless" }`
@@ -6737,7 +6770,7 @@ Native launcher connections retry transport timeouts/unclean closes with bounded
6737
6770
 
6738
6771
  ## amem runtime (agent-mem#13 P4)
6739
6772
 
6740
- The hub exact-pins @staix/agent-mem <!-- facts:agent-mem-pin -->0.30.0<!-- /facts:agent-mem-pin --> for recall, curated evidence and local deterministic capture. No runtime call reaches a claude-mem worker; `memory.worker_url` is ignored. The person's `ahub memory import claude-mem` remains explicit and off by default. Existing profile, alias, PII and private-turn fences still apply. `ask --remember` and context checkpoints propose machine-local candidates, never automatic curated evidence. See [memory integration](memory.md#in-process-recall-and-capture-agent-mem13-p4) for changed behavior and bounded-view ceilings.
6773
+ The hub accepts @staix/agent-mem <!-- facts:agent-mem-pin -->>=0.33.0 <1.0.0<!-- /facts:agent-mem-pin --> (a range `bun.lock` resolves; a newer plain release in it with a supported host API needs no hub release) for recall, curated evidence and local deterministic capture. No runtime call reaches a claude-mem worker; `memory.worker_url` is ignored. The person's `ahub memory import claude-mem` remains explicit and off by default. Existing profile, alias, PII and private-turn fences still apply. `ask --remember` and context checkpoints propose machine-local candidates, never automatic curated evidence. See [memory integration](memory.md#in-process-recall-and-capture-agent-mem13-p4) for changed behavior and bounded-view ceilings.
6741
6774
 
6742
6775
  ## Person-run backlog legs (#1176)
6743
6776
 
@@ -7241,7 +7274,7 @@ settled stubs fit the current response ceiling.
7241
7274
 
7242
7275
  ## Handing work to another project (#604, agent-hub#1030)
7243
7276
 
7244
- Work that belongs to another repository that runs agent-hub on this machine goes onto that repository's board, not into this session. Its own roles plan, implement and review it, and each state change it reaches is reported back here. The first case: after a library you maintain publishes a release, raising its exact pin in a consumer belongs on the consumer's board.
7277
+ Work that belongs to another repository that runs agent-hub on this machine goes onto that repository's board, not into this session. Its own roles plan, implement and review it, and each state change it reaches is reported back here. The first case: after a library you maintain publishes a release that a consumer's declared range does not cover, raising it in the consumer belongs on the consumer's board.
7245
7278
 
7246
7279
  ```
7247
7280
  ahub task handoff --project <root|id> [<class>] <title...> [--path <p>]... [--issue <n>] [--task <n>] [--detail <text>] [--duplicate-ok <reason>] [--key <uuid>]
@@ -7381,11 +7414,11 @@ Corrupt or unreadable provenance stays unknown and held. The status next step di
7381
7414
 
7382
7415
  A ready memory profile does not prove a successful sync. Read the separate automatic-sync result and timestamp in `ahub status` or Memory. It resets to not run after daemon restart; it is not a machine-global record of manual CLI attempts. Missing remote configuration (shared v1, generation and sharded homes alike) is the neutral `not-configured` state; an interrupted/stopped attempt is neutral `stopped`. Both keep their safe next step and produce no failure log under `quietSyncError`.
7383
7416
 
7384
- For policy-declined rows, a person or an agent shell runs `ahub memory declined --json` to inspect IDs and safe rule categories, never note text. The pinned agent-mem 0.30.0 public `inspectSyncPolicy` API bounds physical outbound inspection for shared-v1 and generation profiles. A complete result supplies the declined IDs and rules; `complete:false` means the scan is unavailable, stale or over its diagnostic bound, not zero declined rows. The command stays read-only and rechecks its profile binding. No migration or policy edit is performed automatically.
7417
+ For policy-declined rows, a person or an agent shell runs `ahub memory declined --json` to inspect IDs and safe rule categories, never note text. The agent-mem public `inspectSyncPolicy` API (0.32.1 and later) bounds physical outbound inspection for shared-v1 and generation profiles. A complete result supplies the declined IDs and rules; `complete:false` means the scan is unavailable, stale or over its diagnostic bound, not zero declined rows. The command stays read-only and rechecks its profile binding. No migration or policy edit is performed automatically.
7385
7418
 
7386
- The hub projects verified withheld/exported counts when a trusted SDK sync returns a successful placement result. That projection is covered by an injected-result fixture, not an activated-store sync. Agent-mem requires a fresh `placementAttestation` even for an already active v3 store; since 0.35.0 the daemon builds one with the package's own `createPlacementAttestation` on every sync pass and supplies no writer facts of its own, so no attestation is fabricated. A refused attestation is the closed cause `writer` in status, the dashboard and the log: its category, its cause class (`missing`, `changed`, `unavailable`) and the next step (repair the amem install and its host pin, then a person runs `amem migrate --sync-placement --dry-run`). Activation remains a person-run action. A nonzero withheld count in a successful result is not a transport failure and does not mean those rows were deleted, rewritten or published. Inspect the IDs and rules before deliberately changing any source or approved policy; a forget operation does not remove its original text from physical history.
7419
+ The hub projects verified withheld/exported counts when a trusted SDK sync returns a successful placement result. That projection is covered by an injected-result fixture, not an activated-store sync. Agent-mem requires a fresh `placementAttestation` even for an already active v3 store; since 0.35.0 the daemon builds one with the package's own `createPlacementAttestation` on every sync pass and supplies no writer facts of its own, so no attestation is fabricated. A refused attestation is the closed cause `writer` in status, the dashboard and the log: its category, its cause class (`missing`, `changed`, `unavailable`) and the next step (repair the amem install and its host pin, then a person runs `amem migrate --sync-placement --dry-run`). An in-place agent-mem patch upgrade inside the declared range turns the writer proof to `changed` the same way, because placement records each writer's installed version and file hash, and it stays that way until a person re-runs `amem migrate --sync-placement --dry-run`. Activation remains a person-run action. A nonzero withheld count in a successful result is not a transport failure and does not mean those rows were deleted, rewritten or published. Inspect the IDs and rules before deliberately changing any source or approved policy; a forget operation does not remove its original text from physical history.
7387
7420
 
7388
- A legacy store without active per-row placement still blocks a sync containing declined rows. Status names inactive placement and the person-only `amem migrate --sync-placement --dry-run` preview, which requires every local writer installation through repeatable `--writer-root` flags. It keeps `ahub memory declined` as the safe inspection step. The native CLI supports activation from 0.22.0; the pinned core is 0.30.0. See the [activation preview and prerequisites](memory.md#automatic-sync-health-1173) before any separately authorized apply. Preview writes nothing, and activation does not migrate layouts, change policy or automatically raise a format floor. The hub does not invoke it or fabricate its proof.
7421
+ A legacy store without active per-row placement still blocks a sync containing declined rows. Status names inactive placement and the person-only `amem migrate --sync-placement --dry-run` preview, which requires every local writer installation through repeatable `--writer-root` flags. It keeps `ahub memory declined` as the safe inspection step. The native CLI supports activation from 0.22.0; the declared core floor is 0.33.0. See the [activation preview and prerequisites](memory.md#automatic-sync-health-1173) before any separately authorized apply. Preview writes nothing, and activation does not migrate layouts, change policy or automatically raise a format floor. The hub does not invoke it or fabricate its proof.
7389
7422
 
7390
7423
  The bounded diagnostic addresses #1173 AC4; AC5 has result projection and the host attestation. Whether an activated store syncs on a person's machine is not established by the isolated fixtures.
7391
7424
 
@@ -18,7 +18,7 @@ Or use the matching GitHub release:
18
18
 
19
19
  <!-- facts:install-tag -->
20
20
  ```bash
21
- bun add -g github:STAIxBWLB/agent-hub#v0.44.0
21
+ bun add -g github:STAIxBWLB/agent-hub#v0.45.0
22
22
  ahub setup
23
23
  ```
24
24
  <!-- /facts:install-tag -->
@@ -54,6 +54,12 @@ A project whose hub is stopped is upgraded without starting it: `ahub upgrade
54
54
  --all-stopped --to <version>` does that for every stopped project at once
55
55
  (`--dry-run` lists each one first).
56
56
 
57
+ ## Upgrading to 0.45.0
58
+
59
+ The memory library moves from an exact agent-mem pin to the range `>=0.33.0 <1.0.0` (0.33.0 in the lockfile): a newer agent-mem minor now loads without a hub release when its host API matches, and `ahub doctor` names the cause when it does not. No memory home or sync format floor is raised automatically, but a newer minor may raise a store format floor, so roll the hub back together with the store. An ACP peer (headless Kimi, Qwen, Jcode) now keeps a turn with a silent open tool call alive for up to 60 minutes instead of 30, so a long gate wait no longer cancels it; a value you set in `adapter_timing.acp_tool_ceiling_min` is kept, and the setting now accepts up to 120. When the ceiling does cancel a Jcode turn, `hub.log` says so and names the restart and queue commands. `events.jsonl` and `hub.log` now rotate by size (`docs/events.md` "Rotation"): a script of your own that reads `events.jsonl` directly should read the `events.jsonl.<offset>` segments before the live file. With `research.enabled`, research records gain a text-free `edits` block. `ahub roadmap check`, `sync` and `export` are new; nothing writes to GitHub unless you apply with a confirmation fingerprint. `ahub roadmap decompose <id>` proposes cited parts of a milestone, and `--accept <part>` holds one as an intake draft until you release it with `ahub intake approve`. The opt-in `edit_governance.arm` setting stays `baseline` unless you change it.
60
+
61
+ `ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.45.0` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
62
+
57
63
  ## Upgrading to 0.44.0
58
64
 
59
65
  The memory library moves to agent-mem 0.30.0. No memory home or sync format floor is raised automatically; coordinate any later floor change across every installation sharing the home. Sandboxed commands get writable Bun and npm caches when the caller has not set their paths. Ready reserved backlog work can now be pulled automatically when it becomes eligible.
@@ -502,7 +508,7 @@ More: `ahub help`. How it is built and why: [`docs/specs/2026-09-19-agent-hub-de
502
508
 
503
509
  ## Shared memory
504
510
 
505
- The hub exact-pins the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->0.30.0<!-- /facts:agent-mem-pin --> core, including deterministic capture; no claude-mem worker is needed. Existing shared-v1 memory remains the default; upgrading does not migrate it. Managed agents use screened `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools, or propose a correction with `hub_memory_correct`; only a person accepts candidates through the supported `amem review` path. Since agent-mem 0.7.0, `amem review` also accepts candidates on a selected generation.
511
+ The hub accepts the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->>=0.33.0 <1.0.0<!-- /facts:agent-mem-pin --> core as a range below the next major: a plain release inside it with a supported host API needs no hub release, and the lockfile resolves one release. That includes deterministic capture; no claude-mem worker is needed. Existing shared-v1 memory remains the default; upgrading does not migrate it. Managed agents use screened `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools, or propose a correction with `hub_memory_correct`; only a person accepts candidates through the supported `amem review` path. Since agent-mem 0.7.0, `amem review` also accepts candidates on a selected generation.
506
512
 
507
513
  Before any real generation migration, upgrade every hub sharing that memory home to 0.12.30 or later and check its authenticated binding with `ahub memory profile-check` in each custom registry. Ready bindings prove compatibility, not an atomic live cutover: quiesce consumers and close their handles before migrating, then reopen through the supported session-preserving lifecycle. Invalid or changed profiles disable native memory without falling back to legacy writes; the bus and board continue. See [memory operations](operations.md#hub-memory) for the remaining rollout gates.
508
514
 
package/docs/research.md CHANGED
@@ -36,6 +36,8 @@ held record lacked, and a held v2 row written before `ownerModels` existed (#140
36
36
  `ahub research backfill` can prove an owner model from the surviving events (readers keep the latest row of a task). A v2 row also replaces a held v1 row of the same task. A failing write is one `hub.log` line per hub run and
37
37
  never changes the task flow.
38
38
 
39
+ The live writer does not read `events.jsonl` from byte 0 at each closure (#1555 AC5). One catch-up pass over the bytes appended since the last closure (the first closure after a hub start reads the file once) keeps, for each task id, the byte offset of its latest proposal and the cross-task state as of that offset: which peers are attached, their add-on fingerprints, whether the log reports briefs at all, and the first hub run that attributes person events. A closing task then reads only its own slice from that offset, skips `quota` rows (no record field reads one), and ignores a usage row whose key the log counted before the slice. A task whose proposal the tail does not hold, or an id the log started more than once, is read whole, as before. The row is the same one the whole-file fold gives for that task, byte for byte (`test/research-slice.test.ts`); a difference is a defect.
40
+
39
41
  `ahub research backfill` builds the same records from a project's existing `events.jsonl` (marked
40
42
  `writer.source: "backfill"`), reading every event attributed to a task, and appends those the store does not hold yet.
41
43
  It is for tasks approved before research was on: a record it writes is final, so running it while a live record still
@@ -97,6 +99,20 @@ delivery is created no later than it is updated), and treats the journal as unkn
97
99
  | `stalls` | persisted idle-ladder entries on the task's history (the stall table itself is cleared when a task closes); null without the board |
98
100
  | `handoffs` | `in`, `out` from the handoff tables |
99
101
  | `cohort` | `silent`, `advisory` or `none` |
102
+ | `edits` | #1556 T2, text-free counts folded from `turn_end.edits` of the owner turns of a non-PII task: `observability` (`hook_and_tree`, `stream_and_tree`, `tree_only`, `unknown`), `policyArm`, `editTool` and `shellRoute` (`total`, `verifiedFullRead`, `partialReadOnly`, `blindOrStale`, and `occRejected` or `blockedByGuard`), `unattributedTreeWrites`, `postEdit`. `editTool` and `shellRoute` are null, never 0, when no hook or stream saw the task's tool calls (`tree_only`) or the log holds no edit evidence; `quality.json` then counts each of their leaves as unknown. Live writer and `ahub research backfill` fold the same events with one function, so the rows are byte-identical. A row written before this has no block and reads as unknown |
103
+
104
+ When a write's pre-image is unavailable, its route total remains known but all three read-grade fields are null. A task mixing observability kinds has unknown route totals instead of partial counts. A tree-write or post-edit total is null when any contributing turn lacks that evidence.
105
+
106
+ ### Edit-governance factorial analysis
107
+
108
+ `groupEditRates` reads the latest task records and groups only an unambiguous single owner, owner model, family and recorded arm. Private records are withheld; missing or ambiguous identity and unknown arms are counted as unknown. `policyArm` is the last recorded turn arm, not proof that all turns used that arm; model evidence grades remain visible.
109
+
110
+ The five labels are `baseline`, `soft_guidance`, `route_guard`, `occ_guard` and `combined_guard`. For each group, `p = S / (E + S)`, `b_E = E_blind_or_stale / E`, `b_S = S_blind_or_stale / S`, and `B = (1-p)b_E + p b_S`. Partial reads are reported separately and are not silently added to blind or stale. The sensitivities are `b_S - b_E` and `p`. Missing counts, invalid counts, a zero denominator, or unknown or nonzero unattributed tree writes make the affected result null, never zero.
111
+
112
+ `editFactorial` compares baseline, route, OCC and combined rates as descriptive arithmetic; `editFactorialGroup` also requires the same family, owner model and task class on all four groups. Neither result establishes causal comparability; a separately preregistered and evidenced design is needed. `editMarginalBenefit` computes the declared formula only from caller-supplied costs, deltas and penalties and never selects a live arm.
113
+
114
+ `C_success` stays unknown until a later spec defines measured, unit-consistent cost components; `quality.json` reports `fields["edits.costPerVerifiedSuccess"]` as null and counts every v2 task as unknown. `editSuccessCost` accepts caller-supplied component totals only when execution, verification, rework and human costs have separate evidence, the same unit and identical task sets, and the caller supplies an evidenced nonempty verified-success subset. These are declared inputs, not a host verification; aggregate TaskRecord tokens or time are never substituted.
115
+
100
116
 
101
117
  The record reads the board through a read-only handle (`readEvidence`): titles, details, plans, refs and notes are never
102
118
  decoded, and the journal's envelope bodies are never read.
@@ -0,0 +1,4 @@
1
+ {
2
+ "version": 1,
3
+ "milestones": []
4
+ }
@@ -0,0 +1,9 @@
1
+ # Roadmap
2
+
3
+ Generated from the public roadmap view.
4
+
5
+ ## Now
6
+
7
+ ## Next
8
+
9
+ ## Later
package/docs/sdlc.md CHANGED
@@ -156,13 +156,15 @@ are the ones printed by `ahub help`; placeholders name values to choose.
156
156
 
157
157
  Task lifecycle fields store stage, issue/PR identity, observed head, reviewed head, local-gate head/result and bounded check/readback metadata. Legacy rows read with no lifecycle metadata. Every change goes through Tasks and records its actor; adapters/tools/CLI never write Board directly. Readback timestamps identify observations, not a freshness promise. Persist no task text in lifecycle receipts; public output uses the existing PII stub and publicTitle/publicView.
158
158
 
159
- A reviewer records the head it actually reviewed. If GitHub no longer reports that head, a stale verdict refuses before effects. Changes requested does not require green CI. Approval requires a current review and all configured required checks successful on that head; neutral/skipped does not substitute unless explicitly allowed by the project's gate contract. A local check records an exact SHA and its result; it is a claimed local receipt, labelled separately from externally fetched CI.
159
+ A reviewer records the head it actually reviewed. If GitHub no longer reports that head, a stale verdict refuses before effects. Changes requested does not require green CI. Approval requires a current review and all configured required checks successful on that head, except the proven draft macOS deferral described below; neutral/skipped does not substitute unless explicitly allowed by the project's gate contract. For that draft only, missing GitHub approval and outstanding review requests are deferred to merge, because the connector does not review a draft. Unknown review-request evidence, a pending change request, unresolved threads and all other blockers still refuse approval. A local check records an exact SHA and its result; it is a claimed local receipt, labelled separately from externally fetched CI.
160
160
 
161
161
  ## Readbacks and presentation
162
162
 
163
163
  Use structured gh JSON/GraphQL read-only calls (the guarded merge below is the one exception) with validated repository and numeric artifact identities. No shell interpolation, PR/issue body fetching, token logging or unbounded comment storage. Failure yields unknown. Required checks come from repository rules or explicitly configured names; an empty/unknown set is not silently green. Review-thread status is counted, not copied. Cancellation and task-owner generation fencing prevent a late read from approving reassigned work.
164
164
 
165
- GitHub may return more than one row for a named check after a rerun or cancellation. When every row has a workflow identity and start time, and those identify one uniquely newest run of the same workflow, the hub evaluates that run and drops older rows. If workflow identity or ordering is ambiguous, it retains the rows; duplicate evidence remains a blocker rather than a guessed pass. In the CI watcher, cancelled attempts and a draft PR's deferred `check (macos-latest)` read as pending so the watcher can wait for a replacement run; the aggregate draft check still must pass before review readiness.
165
+ GitHub may return more than one row for a named check after a rerun or cancellation. When every row has a workflow identity and start time, and those identify one uniquely newest run of the same workflow, the hub evaluates that run and drops older rows. If workflow identity or ordering is ambiguous, it retains the rows; duplicate evidence remains a blocker rather than a guessed pass. In the CI watcher, cancelled attempts and a draft PR's deferred `check (macos-latest)` read as pending so the watcher can wait for a replacement run. Review admission can accept this repository's draft head only when Ubuntu and seeded guards pass, the remaining required checks pass, and the failed macOS aggregate's exact-head job proves its draft-deferral step was the sole failure. Incomplete or stale proof remains a blocker. This is review readiness, not a successful full gate: the macOS aggregate still needs to pass for merge.
166
+
167
+ For the repository workflow, see the `Draft first` and `Merging after approval` rules in `AGENTS.md`. The connector reviews after the approved draft is marked ready; its unresolved threads and pending change requests still block merge. A later push invalidates the earlier head's approval. The reviewer marks the approved head ready and merges only after the full exact-head gate and review blockers settle.
166
168
 
167
169
  ahub sdlc status and explain expose mode, stage, gate, observed/reviewed/local-check heads, next actor and next action. Console/dashboard derive the same result. Merge ordering compares exact PR path sets, reports intersections and never guesses an automatic landing order where dependencies are unknown. Release readiness lists merged work since the tag, stale/nonancestor documentation stamps and open native/live receipts; each unknown remains visible.
168
170
 
@@ -412,7 +414,7 @@ What each metric reads, and what it does not:
412
414
  - `first_pass_check` uses the first completion check; if none exists, it uses the latest isolated run before the first done at that done's recorded head. Without matching evidence it is unknown.
413
415
  - `accepted_to_plan_ms` measures task acceptance to plan review only when no spec-acceptance event was recorded. A carried spec acceptance counts as a spec-acceptance anchor.
414
416
  - `stale_head_re_reviews` counts review rounds whose verdict was bound to a different head than the review was requested for (the `done`'s recorded head against the verdict's findings head), so it needs both heads on the round. New done entries record the requested commit independently of cost plans; older done entries use the cost head or the head of the bound spec report. A task with no such round is `unknown`, not 0. (A `done` after an `approved` is not a signal: the board cannot produce one.)
415
- - `acceptance_to_merge_ms`, `same_head_ci_reruns`, `ci_runs_at_merge`, `github_reviews_at_merge` and `review_rounds_at_merge` come from the merge-time readback. The guarded merge (`ahub sdlc merge`, or the auto-merge after an approving verdict) reads the merged PR once, after the merge is observed, and records on the task's merge record `cost: { mergedAt, ciRuns, ciReruns, reviews }`: CI runs linked to any head of the PR (an attempt after the first of one run id is a rerun) and distinct GitHub reviews. The read is bounded (8 s, the same fixed queries as `ahub sdlc costs`), host-written and never a tool input, and it never decides the merge result. A CI figure is known only when the run list was complete, and a failed or partial read leaves the field `null`; a task whose merge was not read, merged before this record existed or merged by hand where the host did not observe it, is `unknown` for all of them, never 0. A PR merged outside the hub while its repository's merge mode is `off` is observed by the host for an approved task (`mergeReadback`, #1555: a pass every 5 minutes that reads at most three tasks and reads a task again no sooner than 10 minutes later, for 24 hours after the approval; only a merge at the reviewed head is recorded) and supplies the same figures when its cost read completes. `review_rounds_at_merge` counts the task's review handoffs (`done`) up to the merge. `merged` in the report says how many counted tasks have a read merge and how many do not. `ahub sdlc costs` still carries the per-PR cost table with its own scope.
417
+ - `acceptance_to_merge_ms`, `same_head_ci_reruns`, `ci_runs_at_merge`, `github_reviews_at_merge` and `review_rounds_at_merge` come from the merge-time readback. The guarded merge (`ahub sdlc merge`, or the auto-merge after an approving verdict) reads the merged PR once, after the merge is observed, and records on the task's merge record `cost: { mergedAt, ciRuns, ciReruns, reviews }`: CI runs linked to any head of the PR (an attempt after the first of one run id is a rerun) and distinct GitHub reviews. When GitHub omits a run's link to the PR, the runs are the PR branch's complete pull-request run inventory between the PR's creation and its merge, read only for a same-repository head on a branch no other overlapping PR uses (#1584); incomplete pagination or ambiguous branch ownership keeps the figure unknown. The read is bounded (8 s, the same fixed queries as `ahub sdlc costs`), host-written and never a tool input, and it never decides the merge result. A CI figure is known only when the run list was complete, and a failed or partial read leaves the field `null`; a task whose merge was not read, merged before this record existed or merged by hand where the host did not observe it, is `unknown` for all of them, never 0. A PR merged outside the hub while its repository's merge mode is `off` is observed by the host for an approved task (`mergeReadback`, #1555: a pass every 5 minutes that reads at most three tasks and reads a task again no sooner than 10 minutes later, for 24 hours after the approval; only a merge at the reviewed head is recorded) and supplies the same figures when its cost read completes. `review_rounds_at_merge` counts the task's review handoffs (`done`) up to the merge. `merged` in the report says how many counted tasks have a read merge and how many do not. `ahub sdlc costs` still carries the per-PR cost table with its own scope.
416
418
  - `stalls` counts open stalls on public tasks by kind and the dones recorded without writes.
417
419
 
418
420
  `.agenthub/sdlc.toml` may set `[bands.<metric>]` for `acceptance_to_plan_ms`, `acceptance_to_first_review_ms`, `first_pass_approval`, `rework_rounds`, `first_pass_check`, `stale_head_re_reviews`, `hotfix_rate` or `security_open_alerts`. Every field is optional and bounded: `window` (4 to 200, default 20), `min_samples` (3 to 200, default 8, at most `window`), `log_sigma` 2, `diagnose_sigma` 3, `propose_sigma` 4 (ordered, 0.5 to 20), `drift_run` (3 to 50, default 6) and `min_delta` (the smallest step worth any tier: an hour for the times, one round, half a rate). An unknown metric or field is refused with its path. The newest value is compared with the mean and population standard deviation of the `window` values before it, on the bad side only (a longer time, more rework, a lower rate). The deviation is floored per metric (half an hour, or half a round or a rate) so a flat baseline does not turn one step into thousands of deviations. Fewer than `min_samples` before it fires nothing, and so does a step under `min_delta`, drift included. A run of `drift_run` newest values all more than one deviation on the bad side is at least `diagnose` even when none reaches a sigma tier, provided the newest step clears `min_delta`. Tiers:
@@ -727,3 +729,13 @@ or additional task readback. Live audit/survey dogfood (#1403 T8) still requires
727
729
  the person's separate instruction; this feature adds no schedule or live run.
728
730
 
729
731
  Externally observed merged PRs use host-only `mergeReadback` evidence. Its cost fields remain unknown if the bounded readback cannot complete. The latest configured security scan reports a per-source number or `unknown`; an unreadable source is never reported as zero.
732
+
733
+ ## Closed-task compaction (#1555 AC6)
734
+
735
+ A task that reaches `approved` or `cancelled` drops its ephemeral state, and nothing a metric or a verdict reads:
736
+
737
+ - Its `touches` rows (`Turns.pruneTouches`). Every reader looks at open tasks only (`conflictsOf`, `pathWarnings`, the owner-write evidence of an in-progress task), and the overlap counts are already frozen in `tasks.history`. A startup pass also prunes rows of tasks that closed while no hub ran. A turn that ends after its task closed records no rows.
738
+ - The output tail and staged `output.log` of its finished or stale isolated checks (`ContainerRunner.compactTask`). The receipt keeps its status, exit, head, tree, timing, owner and revision; a queued or running run is never touched.
739
+ - The settled results of a closed Pi session in `pi_tool_receipts` (`compactPiResult`): a new session closes the earlier ones, and a result over 2,000 characters keeps its prefix and, for a shell result, its exit code. The active session's receipts are untouched.
740
+
741
+ Task rows, history, `sdlc` receipts, `usage_rollup` and `rollup_seen` are never deleted or edited. `test/terminal-compaction.test.ts` computes `sdlcMetrics`, `costMetrics`, `releaseMetrics`, the usage roll-up and the whole task rows before and after a compaction and requires them identical.