@staix/agent-hub 0.48.0 → 0.48.2
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.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/docs/agent-notes/tasks.md +2 -0
- package/docs/design/roadmap.md +1 -1
- package/docs/quickstart.md +13 -1
- package/docs/verification/2026-11-27-0.48.1.md +37 -0
- package/docs/verification/2026-11-27-0.48.2.md +50 -0
- package/docs/verified.json +14 -14
- package/package.json +1 -1
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +1 -1
- package/plugins/agent-hub/server.js +1 -1
- package/src/hub/daemon.ts +1 -0
- package/src/hub/main-checkout.ts +29 -1
- package/src/hub/supervision.ts +19 -6
- package/src/hub/tasks.ts +37 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ Issue and pull request numbers in the entries for 0.7.7 and earlier refer to the
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.48.2
|
|
8
|
+
|
|
9
|
+
- The daemon no longer stalls on a roadmap check, on task lists or on status (#1741, #1738). A roadmap check runs one working-tree spec check per call instead of two per GitHub issue it reads (about a second of synchronous git each). A task without a risk receipt no longer reads the whole board for each row of a task list. Status reuses the main checkout's branch answer while git's HEAD and origin/HEAD files are unchanged, instead of two git processes per request.
|
|
10
|
+
- A roadmap check rebuilds its milestone views only when a task, milestone, link or release changed during the check, instead of before and after every GitHub issue it reads (#1741). On a 1156-task board with 52 linked issues, one check fell from about 15 s of main-thread work and 107 whole-board reads to under 0.2 s and one. The transient allocation it caused is what kept the daemon's RSS high: its physical footprint stays small, and the rest is reclaimable heap pages.
|
|
11
|
+
|
|
12
|
+
## 0.48.1
|
|
13
|
+
|
|
14
|
+
- A large board no longer blocks the daemon's event loop (#1738). The supervision round check, run every second and on every task change, skips its full board read while the board status revision, the conductor, the scope and the stored round are unchanged, and per-task supervision notices read one task instead of the whole board. The hub's own roadmap pass (the five-minute sweep and each task change's notice) reuses one working-tree spec check for up to 60 s instead of running one per `milestoneList` call. On a 1156-task board the two paths held the loop about 2.5 s of every 3 s and for 28-38 s every five minutes.
|
|
15
|
+
|
|
7
16
|
## 0.48.0
|
|
8
17
|
|
|
9
18
|
- Release N-1 for 0.48.x is published 0.47.0, which declares agent-mem `>=0.39.0 <1.0.0`; its fixture lock pins the 0.39.0 that the 0.47.0 release resolved, with control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Code, Codex, Kimi Code, Pi and a hub-owned local worker (plus Qwen Code, Jcode a
|
|
|
5
5
|
Antigravity if you want them) share a message bus, a task board and a memory, each
|
|
6
6
|
connected through its own native interface.
|
|
7
7
|
|
|
8
|
-
Status: 0.48.
|
|
8
|
+
Status: 0.48.2, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
|
|
9
9
|
project. Site: [agent-hub.staix.net](https://agent-hub.staix.net).
|
|
10
10
|
|
|
11
11
|
Inspect bounded task and attempt metadata with `ahub lineage show`; admit external
|
|
@@ -48,6 +48,8 @@ Scope: the task flow, assignment, the state machine and the hub's MCP tools. Rea
|
|
|
48
48
|
- `review()` reads `escalateAfter()` (`tasks.escalate_after`, 1-10, default `ESCALATE_AFTER` = 3) at each `changes_requested` verdict, so a reload applies from the next verdict; never capture it at construction or compare against a literal (#488).
|
|
49
49
|
- A guard in `tasks.ts` or `conductor.ts` passes `preEffect` (throws `PreEffectToolRefusal`, `src/hub/tool-refusal.ts`) only before the operation's first board or hold write; a throw after a write, a readback failure or a wrapped error stays a plain `Error` (#254). The Pi side of the rule is in `adapters.md`.
|
|
50
50
|
- Supervision reasons use structured enums, never history notes, check output or approval titles. Round signatures survive restart; later summaries count only newly joined tasks.
|
|
51
|
+
- Supervision on a timer or per task change (#1738): `checkRound` skips the board read while its key (conductor, scope, `board.statusRevision()`, stored round) matches the last check that sent nothing, and it never keeps a key after a refused send. Per-task notices read through the `task(id)` port. Never add a `board.list()` to a supervision path that runs every second or on every task write.
|
|
52
|
+
- Roadmap check and task views (#1741): `roadmapCheck` takes one spec check per call and passes it to every `milestoneList` it runs; never let `current()` or a per-issue step start another, since an uncached working-tree check is about a second of synchronous git. `current()` rebuilds the views only when its board key (`statusRevision`, milestones, links, releases, the caller's planner role) moved; add any new input of `roadmapSnapshot` to that key; building them scans every board task's text. `riskViewFor` returns before `riskCards` when the task has no risk receipt for the head; a task list calls it once per row.
|
|
51
53
|
- Supervision rules and proposals (#1362, #1368, #1374: `src/hub/supervision-rules.ts`, `src/hub/supervision-proposals.ts`): the reading stage has no effect path, `supervision-proposals.ts` reaches the board and bus only through ports, and a proposal runs its existing action only on an explicit `accept` by a present role with that action's own authority (`escalate`: conductor or person), never automatically and never retried; `Tasks.supervisionNotice` refuses a private task. Read `docs/design/supervision.md` before changing these paths.
|
|
52
54
|
- Guidance variants (#1363, #1367, #1376: `src/hub/guidance-variants.ts`, `Tasks.guidanceVariant*`): lifecycle writes go only through `Tasks.guidanceVariantCreate` and `guidanceVariantWithdraw`; the `guidance_experiments` and `guidance_variants` tables are private local state, never copied into `Task`, refs, history, public views, bus notices or memory, and the guidance tools stay out of capture (`GUIDANCE_TOOL_NAMES`). Read `docs/design/guidance-experiments.md` before changing these paths.
|
|
53
55
|
|
package/docs/design/roadmap.md
CHANGED
|
@@ -308,7 +308,7 @@ A local milestone has at most one remote number per repository. R3's `milestone_
|
|
|
308
308
|
|
|
309
309
|
`ahub roadmap export` renders deterministic JSON and Markdown from screened milestone views. `--write` writes only `docs/roadmap.md` and `docs/roadmap.json` in the caller's Git worktree after proving it shares the selected repository, enforcing its current deny, read-only and PII path policy and refusing symlinks or hardlinks. A partially completed two-file write is reported. `--issue <n> --apply --confirm <fingerprint>` updates that issue body only after a matching preview, under the same person/conductor policy. The fingerprint binds repository, issue and rendered body.
|
|
310
310
|
|
|
311
|
-
Task state and merge changes schedule affected public milestones for an ids-only supervision notice. The existing five-minute merge-readback sweep rechecks unresolved findings, including the close-lag boundary. A durable marker suppresses a finding already delivered; an unavailable feed or evidence is retried on a later change or sweep. Private tasks are never named. `scripts/check-roadmap.mjs` is a standalone Node validator: it checks the generated JSON's schema, linked spec IDs and tracked spec paths, and checks known issue states when a GitHub token is available. `scripts/check.sh` and the hosted docs step run it. Only `docs/roadmap.md` is exempt from the documentation stamp because this validation covers the generated page; the standalone release docs checker retains its Node-only contract.
|
|
311
|
+
Task state and merge changes schedule affected public milestones for an ids-only supervision notice. The existing five-minute merge-readback sweep rechecks unresolved findings, including the close-lag boundary. The hub's own pass reuses one working-tree spec check for up to 60 s across its milestone reads (#1738), so spec freshness in a finding can be up to a minute old. Reads by the person and peers check again, once per read: a roadmap check keeps the one spec check it started with across all of its issue reads. A durable marker suppresses a finding already delivered; an unavailable feed or evidence is retried on a later change or sweep. Private tasks are never named. `scripts/check-roadmap.mjs` is a standalone Node validator: it checks the generated JSON's schema, linked spec IDs and tracked spec paths, and checks known issue states when a GitHub token is available. `scripts/check.sh` and the hosted docs step run it. Only `docs/roadmap.md` is exempt from the documentation stamp because this validation covers the generated page; the standalone release docs checker retains its Node-only contract.
|
|
312
312
|
|
|
313
313
|
## Dashboard and console surfaces (R5)
|
|
314
314
|
|
package/docs/quickstart.md
CHANGED
|
@@ -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.48.
|
|
21
|
+
bun add -g github:STAIxBWLB/agent-hub#v0.48.2
|
|
22
22
|
ahub setup
|
|
23
23
|
```
|
|
24
24
|
<!-- /facts:install-tag -->
|
|
@@ -54,6 +54,18 @@ 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.48.2
|
|
58
|
+
|
|
59
|
+
Nothing to do beyond the upgrade. The daemon stops stalling on roadmap checks, task lists and status (#1741). A roadmap check now runs one spec check and builds its milestone views once, unless the board changes during the check; before, it repeated both around every GitHub issue it read. A task list no longer reads the whole board for every row. Status no longer starts two git processes per request. The daemon's RSS also stays lower, because those repeats caused most of its transient allocation. 0.48.2 raises no store, sync or agent-mem floor.
|
|
60
|
+
|
|
61
|
+
`ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.48.2` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
|
|
62
|
+
|
|
63
|
+
## Upgrading to 0.48.1
|
|
64
|
+
|
|
65
|
+
Nothing to do beyond the upgrade. A hub on a large board stops blocking its event loop (#1738): the supervision round check no longer reads the whole board every second, and the hub's own roadmap pass reuses one spec check for up to 60 s, so spec freshness in a roadmap finding can be up to a minute old. 0.48.1 raises no store, sync or agent-mem floor.
|
|
66
|
+
|
|
67
|
+
`ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.48.1` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
|
|
68
|
+
|
|
57
69
|
## Upgrading to 0.48.0
|
|
58
70
|
|
|
59
71
|
Nothing changes until you use something new. The guidance probe pilot (#1226) stays off unless the hub is started with `AGENTHUB_LIVE_GUIDANCE_PROBE_ID` set to one registered probe id; the procedure is in [operations](operations.md#run-the-preregistered-guidance-pilot). 0.48.0 raises no store, sync or agent-mem floor.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# 0.48.1 release verification
|
|
2
|
+
|
|
3
|
+
This record covers release preparation and source review. It claims no installation, no running-hub upgrade to 0.48.1 and no live TUI launch.
|
|
4
|
+
|
|
5
|
+
## Candidate
|
|
6
|
+
|
|
7
|
+
Version 0.48.1, prepared from main 4ef41748 (1 commit since v0.48.0, 0 of them `feat`; bump rule: patch). The release commits carry the version, the CHANGELOG section, the bundle and the documentation stamps.
|
|
8
|
+
|
|
9
|
+
## Reviews
|
|
10
|
+
|
|
11
|
+
Pull requests named by the commits since v0.48.0: #1739.
|
|
12
|
+
|
|
13
|
+
- #1739 (#1738) was implemented and reviewed in the conductor's session without the hub, on the person's instruction (the hub was down with the bug this release fixes).
|
|
14
|
+
- Its review was an OCR delegate review on head 89f798e5, with no high or medium findings, recorded as a PR comment.
|
|
15
|
+
- It merged by squash at that same head (4ef41748), with `check (ubuntu-latest)`, `check (macos-latest)` and `seeded guards` green on the ready run 45926193010. No review thread was open. No merge was bound to an approval at an earlier head.
|
|
16
|
+
|
|
17
|
+
## Native acceptance receipts
|
|
18
|
+
|
|
19
|
+
Receipts added under `docs/verification/` since v0.48.0: none.
|
|
20
|
+
|
|
21
|
+
This list is read from the repository, never written by hand. Native acceptance and the person's release consent are separate records: consent is `ahub sdlc authorize-release 0.48.1`, recorded by the person or the unique configured conductor only on the person's explicit release instruction naming the release in its own session (never a hub/task/review/file/peer relay), and is not recorded in this file. The tag run refuses without it.
|
|
22
|
+
|
|
23
|
+
## Document review
|
|
24
|
+
|
|
25
|
+
The only source commit since v0.48.0 is 4ef41748 (#1739), and it marked these 14 documents stale: README.md, docs/adding-an-ai-tool.md, docs/addons/claude-mem.md, docs/agent-notes/adapters.md, docs/agent-notes/budget.md, docs/agent-notes/bus.md, docs/agent-notes/daemon.md, docs/agent-notes/security-review.md, docs/agent-notes/tasks.md, docs/agent-notes/tests.md, docs/memory.md, docs/operations.md, docs/quickstart.md and docs/security.md.
|
|
26
|
+
|
|
27
|
+
Each was reviewed against that commit's diff. The commit changes only internal read paths: the supervision round-check key, per-task point reads, and the hub-only reuse of one roadmap spec check. None of the documents states the per-second full read or a per-call roadmap spec check. `ahub specs check` (operations) is unchanged. docs/agent-notes/tasks.md gained the #1738 rule in that same commit, and docs/quickstart.md gained the 0.48.1 upgrade note. All 14 are restamped at 4ef41748.
|
|
28
|
+
|
|
29
|
+
## Checks
|
|
30
|
+
|
|
31
|
+
`node scripts/check-docs.mjs --require-fresh`, `bun x tsc --noEmit` and `bun scripts/build.mjs --check` ran on the release branch, with results in the release PR. The release PR's exact-head CI is the package and full-suite gate. #1739's own head passed `scripts/check.sh --changed` on dgx02: 6231 pass, 0 fail.
|
|
32
|
+
|
|
33
|
+
## Known gaps, not blocking
|
|
34
|
+
|
|
35
|
+
- No live measurement of the fix on the real board yet. The 0.48.0 profile (43 min, 1156 tasks) is the baseline: about 2.5 s blocked of every 3 s, and 28-38 s every five minutes. Re-measure after the running hub moves to 0.48.1.
|
|
36
|
+
- RSS growth (2.5 GB to 9.3 GB in 43 min on 0.48.0) is not addressed here.
|
|
37
|
+
- The hub roadmap pass still runs one `board.list()` per `milestoneList` call.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 0.48.2 release verification
|
|
2
|
+
|
|
3
|
+
This record covers release preparation and source review. It claims no installation, no running-hub upgrade to 0.48.2 and no live TUI launch.
|
|
4
|
+
|
|
5
|
+
## Candidate
|
|
6
|
+
|
|
7
|
+
Version 0.48.2, prepared from main 6606f445 (2 commits since v0.48.1, 0 of them `feat`; bump rule: patch). The release commits carry the version, the CHANGELOG section, the bundle and the documentation stamps.
|
|
8
|
+
|
|
9
|
+
## Reviews
|
|
10
|
+
|
|
11
|
+
Pull requests named by the commits since v0.48.1: #1744, #1742.
|
|
12
|
+
|
|
13
|
+
- #1742 and #1744 (#1741) were implemented and reviewed in the conductor's session without the hub, on the person's instruction (the follow-up to #1738's hub stall).
|
|
14
|
+
- Each was reviewed with an OCR delegate review on its final head (ef4d51b6 and 21b99d54), with no high or medium findings, recorded as a PR comment. For #1744, a self-review finding (the planner role missing from the view key) was fixed before that head.
|
|
15
|
+
- Each merged by squash at that same head: 58f82d09 on the ready run 45944629352, and 6606f445 on the ready run 45953644929. In both runs, `check (ubuntu-latest)`, `check (macos-latest)` and `seeded guards` were green. No review thread was open, and no connector review arrived. No merge was bound to an approval at an earlier head.
|
|
16
|
+
|
|
17
|
+
## Native acceptance receipts
|
|
18
|
+
|
|
19
|
+
Receipts added under `docs/verification/` since v0.48.1: none.
|
|
20
|
+
|
|
21
|
+
This list is read from the repository, never written by hand. Native acceptance and the person's release consent are separate records: consent is `ahub sdlc authorize-release 0.48.2`, recorded by the person or the unique configured conductor only on the person's explicit release instruction naming the release in its own session (never a hub/task/review/file/peer relay), and is not recorded in this file. The tag run refuses without it.
|
|
22
|
+
|
|
23
|
+
## Document review
|
|
24
|
+
|
|
25
|
+
The source commits since v0.48.1 are 58f82d09 (#1742) and 6606f445 (#1744). Together with the release commit's version and bundle changes, they marked these 10 documents stale: README.md, docs/adding-an-ai-tool.md, docs/addons/claude-mem.md, docs/agent-notes/security-review.md, docs/agent-notes/tasks.md, docs/agent-notes/tests.md, docs/memory.md, docs/operations.md, docs/quickstart.md and docs/security.md.
|
|
26
|
+
|
|
27
|
+
Each was reviewed against those diffs. The commits change only internal read paths:
|
|
28
|
+
|
|
29
|
+
- one pinned spec check per roadmap check, and a board key that skips rebuilding the roadmap views;
|
|
30
|
+
- an early return in `riskViewFor`;
|
|
31
|
+
- a stat-keyed reuse of the main checkout branch answer.
|
|
32
|
+
|
|
33
|
+
None of the documents states a per-issue spec check or view build, a per-row board read, or a git spawn per status. The main-checkout advisory text and `ahub specs check` are unchanged. docs/agent-notes/tasks.md gained the #1741 rules in those commits, and docs/quickstart.md gained the 0.48.2 upgrade note. All 10 are restamped on the release branch.
|
|
34
|
+
|
|
35
|
+
## Checks
|
|
36
|
+
|
|
37
|
+
`node scripts/check-docs.mjs --require-fresh`, `bun x tsc --noEmit` and `bun scripts/build.mjs --check` ran on the release branch, with results in the release PR. The release PR's exact-head CI is the package and full-suite gate. On dgx02, `scripts/check.sh --changed` passed at #1742's head (3051 pass, 0 fail) and at #1744's head (3023 pass, 0 fail).
|
|
38
|
+
|
|
39
|
+
## Known gaps, not blocking
|
|
40
|
+
|
|
41
|
+
- **No live measurement of 0.48.2 on the real board yet.**
|
|
42
|
+
- The 0.48.1 profile (20 min) is the baseline: the roadmap spec check took 28.7% of the main thread, task views 12.6% and the main checkout git probe 6.6%.
|
|
43
|
+
- Offline, on a copy of this board (1156 tasks, 52 linked issues), one roadmap check fell from about 15 s and 107 whole-board reads to 176 ms and one.
|
|
44
|
+
- #1741 and #1738 stay open until a run on 0.48.2 is clean.
|
|
45
|
+
- **Memory.**
|
|
46
|
+
- The running agent-hwp hub on 0.48.1 showed a 124 MB physical footprint against 971 MB RSS; 781 MB of the RSS was reclaimable JSC heap pages.
|
|
47
|
+
- An idle 0.48.1 heap profile held 23 MB of JS heap.
|
|
48
|
+
- RSS is the high-water mark of transient allocation, which these fixes reduce. No retained-object leak was found.
|
|
49
|
+
- The 2.2 GB RSS right after start was not reproduced offline: it needs the real `~/.agenthub` data. Recheck it with `footprint` on 0.48.2.
|
|
50
|
+
- **agent-mem sync placement** (11% of the 0.48.1 profile) belongs to that repository and is not changed here.
|
package/docs/verified.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"documents": {
|
|
4
4
|
"README.md": {
|
|
5
|
-
"verifiedAgainst": "
|
|
5
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
6
6
|
"paths": [
|
|
7
7
|
"package.json",
|
|
8
8
|
"src/",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"docs/security.md": {
|
|
14
|
-
"verifiedAgainst": "
|
|
14
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
15
15
|
"paths": [
|
|
16
16
|
"src/",
|
|
17
17
|
"templates/"
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"docs/operations.md": {
|
|
21
|
-
"verifiedAgainst": "
|
|
21
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
22
22
|
"paths": [
|
|
23
23
|
"package.json",
|
|
24
24
|
"src/",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
"docs/quickstart.md": {
|
|
38
|
-
"verifiedAgainst": "
|
|
38
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
39
39
|
"paths": [
|
|
40
40
|
"package.json",
|
|
41
41
|
"src/",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"docs/adding-an-ai-tool.md": {
|
|
46
|
-
"verifiedAgainst": "
|
|
46
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
47
47
|
"paths": [
|
|
48
48
|
"src/adapters/registry-types.ts",
|
|
49
49
|
"src/adapters/registry.ts",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"docs/addons/claude-mem.md": {
|
|
65
|
-
"verifiedAgainst": "
|
|
65
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
66
66
|
"paths": [
|
|
67
67
|
"src/hub/tooling.ts",
|
|
68
68
|
"src/adapters/definitions/native-policy-aux.ts",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
191
|
"docs/memory.md": {
|
|
192
|
-
"verifiedAgainst": "
|
|
192
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
193
193
|
"paths": [
|
|
194
194
|
"package.json",
|
|
195
195
|
"src/memory/",
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
]
|
|
286
286
|
},
|
|
287
287
|
"docs/agent-notes/adapters.md": {
|
|
288
|
-
"verifiedAgainst": "
|
|
288
|
+
"verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
|
|
289
289
|
"paths": [
|
|
290
290
|
"src/adapters/",
|
|
291
291
|
"src/pi/",
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
]
|
|
337
337
|
},
|
|
338
338
|
"docs/agent-notes/budget.md": {
|
|
339
|
-
"verifiedAgainst": "
|
|
339
|
+
"verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
|
|
340
340
|
"paths": [
|
|
341
341
|
"src/hub/budget.ts",
|
|
342
342
|
"src/cli/statusline-tee.ts",
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
]
|
|
361
361
|
},
|
|
362
362
|
"docs/agent-notes/bus.md": {
|
|
363
|
-
"verifiedAgainst": "
|
|
363
|
+
"verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
|
|
364
364
|
"paths": [
|
|
365
365
|
"src/hub/bus.ts",
|
|
366
366
|
"src/hub/envelope.ts",
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
]
|
|
376
376
|
},
|
|
377
377
|
"docs/agent-notes/daemon.md": {
|
|
378
|
-
"verifiedAgainst": "
|
|
378
|
+
"verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
|
|
379
379
|
"paths": [
|
|
380
380
|
"src/hub/daemon.ts",
|
|
381
381
|
"src/hub/control-client.ts",
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
]
|
|
489
489
|
},
|
|
490
490
|
"docs/agent-notes/tasks.md": {
|
|
491
|
-
"verifiedAgainst": "
|
|
491
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
492
492
|
"paths": [
|
|
493
493
|
"src/hub/tasks.ts",
|
|
494
494
|
"src/hub/board.ts",
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
]
|
|
540
540
|
},
|
|
541
541
|
"docs/agent-notes/tests.md": {
|
|
542
|
-
"verifiedAgainst": "
|
|
542
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
543
543
|
"paths": [
|
|
544
544
|
"test/",
|
|
545
545
|
"scripts/check.sh",
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
]
|
|
597
597
|
},
|
|
598
598
|
"docs/agent-notes/security-review.md": {
|
|
599
|
-
"verifiedAgainst": "
|
|
599
|
+
"verifiedAgainst": "ada52f8d4dd718b96d45089ce176f86139a6dd43",
|
|
600
600
|
"paths": [
|
|
601
601
|
"src/hub/envelope.ts",
|
|
602
602
|
"src/hub/conductor.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-hub",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.2",
|
|
4
4
|
"description": "Channel between Claude Code and the agent-hub daemon: peer messages from Codex, Kimi and the local worker arrive as channel events; hub_send replies.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Young Joon Lee",
|
|
@@ -14817,7 +14817,7 @@ var package_default;
|
|
|
14817
14817
|
var init_package = __esm(() => {
|
|
14818
14818
|
package_default = {
|
|
14819
14819
|
name: "@staix/agent-hub",
|
|
14820
|
-
version: "0.48.
|
|
14820
|
+
version: "0.48.2",
|
|
14821
14821
|
description: "Native multi-agent hub: Claude Code, Codex, Kimi Code, Pi and local inference as peers in one project",
|
|
14822
14822
|
license: "MIT",
|
|
14823
14823
|
type: "module",
|
|
@@ -14799,7 +14799,7 @@ var package_default;
|
|
|
14799
14799
|
var init_package = __esm(() => {
|
|
14800
14800
|
package_default = {
|
|
14801
14801
|
name: "@staix/agent-hub",
|
|
14802
|
-
version: "0.48.
|
|
14802
|
+
version: "0.48.2",
|
|
14803
14803
|
description: "Native multi-agent hub: Claude Code, Codex, Kimi Code, Pi and local inference as peers in one project",
|
|
14804
14804
|
license: "MIT",
|
|
14805
14805
|
type: "module",
|
package/src/hub/daemon.ts
CHANGED
|
@@ -2765,6 +2765,7 @@ export async function startDaemon(opts: DaemonOptions) {
|
|
|
2765
2765
|
tasks: () => board.list(), publicTitle: (task) => tasks.publicTitle(task), isPrivate: (task) => tasks.isPii(task),
|
|
2766
2766
|
approvalAgeMs: () => (config.conductor?.approval_wait_s ?? 30) * 1000,
|
|
2767
2767
|
readRound: (peer) => conductorHolds.readRound(peer), writeRound: (peer, signature) => conductorHolds.writeRound(peer, signature),
|
|
2768
|
+
revision: () => board.statusRevision(), task: (id) => board.get(id), // #1738: the 1 s tick and every task change check the round
|
|
2768
2769
|
emit: (notice) => {
|
|
2769
2770
|
if (stopping || recoveryActive()) return false;
|
|
2770
2771
|
return bus.publish(newEnvelope(HUB, notice.body, { to: [notice.peer], kind: notice.kind, priority: notice.priority,
|
package/src/hub/main-checkout.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { statSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { childEnv } from "./child-process.ts";
|
|
2
4
|
import { hubGitSync } from "./git.ts";
|
|
3
5
|
|
|
@@ -9,7 +11,33 @@ import { hubGitSync } from "./git.ts";
|
|
|
9
11
|
*/
|
|
10
12
|
const git = (cwd: string, args: string[]) => hubGitSync(["-C", cwd, ...args], { encoding: "utf8", env: childEnv(process.env), maxBuffer: 64 * 1024, timeout: 3000 });
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
type CheckoutBranch = { branch: string; defaultBranch: string } | undefined;
|
|
15
|
+
const stamp = (path: string): string => { try { const s = statSync(path); return `${s.ino}:${s.mtimeMs}:${s.size}`; } catch { return "-"; } };
|
|
16
|
+
let lastCheckout: { cwd: string; dirs: { git: string; common: string }; key: string; value: CheckoutBranch } | undefined;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* #1741: status asks on every write and every control request, and each answer was two git spawns. The answer is reused while HEAD,
|
|
20
|
+
* origin/HEAD and a reftable repository's table list keep the same inode, mtime and size; git replaces each of them through a lock file and a
|
|
21
|
+
* rename. The git directories are resolved once per cwd, and a cwd that is not a repository is asked every time.
|
|
22
|
+
*/
|
|
23
|
+
export function mainCheckoutBranch(cwd: string): CheckoutBranch {
|
|
24
|
+
let dirs = lastCheckout?.cwd === cwd ? lastCheckout.dirs : undefined;
|
|
25
|
+
if (!dirs) {
|
|
26
|
+
try {
|
|
27
|
+
const found = git(cwd, ["rev-parse", "--path-format=absolute", "--absolute-git-dir", "--git-common-dir"]);
|
|
28
|
+
const [gitDir, common] = found.status === 0 && typeof found.stdout === "string" ? found.stdout.split("\n") : [];
|
|
29
|
+
if (gitDir && common) dirs = { git: gitDir, common };
|
|
30
|
+
} catch { /* not a repository: no reuse */ }
|
|
31
|
+
}
|
|
32
|
+
if (!dirs) return readCheckoutBranch(cwd);
|
|
33
|
+
const key = [stamp(join(dirs.git, "HEAD")), stamp(join(dirs.common, "refs/remotes/origin/HEAD")), stamp(join(dirs.common, "reftable/tables.list"))].join("|");
|
|
34
|
+
if (lastCheckout?.cwd === cwd && lastCheckout.key === key) return lastCheckout.value;
|
|
35
|
+
const value = readCheckoutBranch(cwd);
|
|
36
|
+
lastCheckout = { cwd, dirs, key, value };
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function readCheckoutBranch(cwd: string): CheckoutBranch {
|
|
13
41
|
try {
|
|
14
42
|
const head = git(cwd, ["symbolic-ref", "--quiet", "--short", "HEAD"]);
|
|
15
43
|
if (head.status !== 0 || typeof head.stdout !== "string" || !head.stdout.trim()) return undefined;
|
package/src/hub/supervision.ts
CHANGED
|
@@ -37,6 +37,10 @@ export interface SupervisionDeps {
|
|
|
37
37
|
/** Durable round state belongs to the daemon's store, not the controller. */
|
|
38
38
|
readRound?: (peer: string) => string | undefined;
|
|
39
39
|
writeRound?: (peer: string, signature: string) => void;
|
|
40
|
+
/** #1738: the board status revision, moved by every task write. With it, an unchanged round check skips the full board read. */
|
|
41
|
+
revision?: () => number;
|
|
42
|
+
/** #1738: one task by id, so a per-task notice does not read the whole board. */
|
|
43
|
+
task?: (id: number) => Task | undefined;
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
/** Deterministic milestone producer. The Bus alone owns batching, retry and native turns. */
|
|
@@ -44,8 +48,14 @@ export class SupervisionFeed {
|
|
|
44
48
|
private readonly approvals = new Set<string>();
|
|
45
49
|
private readonly holds = new Set<string>();
|
|
46
50
|
private readonly rounds = new Map<string, string>();
|
|
51
|
+
/** #1738: the key of the last round check that sent nothing; never set after a refused send, which must stay retryable. */
|
|
52
|
+
private quietRound: string | undefined;
|
|
47
53
|
constructor(private readonly d: SupervisionDeps) {}
|
|
48
54
|
|
|
55
|
+
private taskById(id: number): Task | undefined {
|
|
56
|
+
return this.d.task ? this.d.task(id) : this.d.tasks().find((t) => t.id === id);
|
|
57
|
+
}
|
|
58
|
+
|
|
49
59
|
/** Pending notices may have been withdrawn on role/off change; live requests can notify again on regrant. */
|
|
50
60
|
resetPending(peer: string): void {
|
|
51
61
|
for (const key of this.approvals) if (key.startsWith(`${peer}:`)) this.approvals.delete(key);
|
|
@@ -71,7 +81,7 @@ export class SupervisionFeed {
|
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
milestone(id: number, milestone: SupervisionMilestone, fields: SupervisionFields = {}): boolean {
|
|
74
|
-
const task = this.
|
|
84
|
+
const task = this.taskById(id);
|
|
75
85
|
if (!task || !this.includes(task)) return false;
|
|
76
86
|
if (this.d.isPrivate(task)) return this.send(`task:${id}:${milestone}`, `#${id} [pii]: ${milestone}; ahub task show ${id}`, "status", id);
|
|
77
87
|
const bits = [this.d.publicTitle(task), milestone];
|
|
@@ -86,7 +96,7 @@ export class SupervisionFeed {
|
|
|
86
96
|
|
|
87
97
|
/** R4: only ids and the fixed rule number enter the conductor's feed. */
|
|
88
98
|
roadmapFinding(taskId: number, milestone: number | null, rule: number, marker: string): boolean {
|
|
89
|
-
const task = this.
|
|
99
|
+
const task = this.taskById(taskId);
|
|
90
100
|
if (!task || !this.includes(task) || this.d.isPrivate(task) || milestone !== null && (!Number.isSafeInteger(milestone) || milestone < 1) || !Number.isSafeInteger(rule) || rule < 1 || rule > 8 || !/^[a-f0-9]{64}$/.test(marker)) return false;
|
|
91
101
|
return this.send(`roadmap:${marker}`, `roadmap${milestone === null ? "" : ` milestone ${milestone}`}, task ${taskId}: drift rule ${rule}; inspect ahub roadmap check`, "status", taskId);
|
|
92
102
|
}
|
|
@@ -114,7 +124,7 @@ export class SupervisionFeed {
|
|
|
114
124
|
|
|
115
125
|
/** Tasks owns durable cause/replan deduplication; the feed keeps its configured recipient and scope. */
|
|
116
126
|
taskStalled(stall: TaskStall): boolean {
|
|
117
|
-
const task = this.
|
|
127
|
+
const task = this.taskById(stall.task);
|
|
118
128
|
if (!task || isClosedTaskState(task.state) || !this.includes(task)) return false;
|
|
119
129
|
const cause = stall.cause;
|
|
120
130
|
const bits = [`#${stall.task}: stalled`, `cause ${cause.kind}`, `reason ${cause.code}`];
|
|
@@ -159,13 +169,16 @@ export class SupervisionFeed {
|
|
|
159
169
|
checkRound(): boolean {
|
|
160
170
|
const peer = this.recipient();
|
|
161
171
|
if (!peer) return false;
|
|
172
|
+
const previous = this.d.readRound?.(peer) ?? this.rounds.get(peer);
|
|
173
|
+
// #1738: the result depends only on the recipient, the scope, the tasks and the stored round. While none moved since a check that sent nothing, it sends nothing again.
|
|
174
|
+
const key = this.d.revision ? JSON.stringify([peer, this.d.scope(), this.d.revision(), previous ?? null]) : undefined;
|
|
175
|
+
if (key !== undefined && key === this.quietRound) return false;
|
|
162
176
|
const tasks = this.d.tasks().filter((t) => this.includes(t));
|
|
163
|
-
if (!tasks.length || tasks.some((t) => !isClosedTaskState(t.state))) return false;
|
|
177
|
+
if (!tasks.length || tasks.some((t) => !isClosedTaskState(t.state))) { this.quietRound = key; return false; }
|
|
164
178
|
const signature = tasks.map((t) => t.id).sort((a, b) => a - b).join(",");
|
|
165
|
-
const previous = this.d.readRound?.(peer) ?? this.rounds.get(peer);
|
|
166
179
|
const completed = new Set(previous?.split(",") ?? []);
|
|
167
180
|
const newlyJoined = tasks.filter((t) => !completed.has(String(t.id)));
|
|
168
|
-
if (!newlyJoined.length) return false;
|
|
181
|
+
if (!newlyJoined.length) { this.quietRound = key; return false; }
|
|
169
182
|
const count = `${newlyJoined.length} task${newlyJoined.length === 1 ? "" : "s"}`;
|
|
170
183
|
const cancelled = newlyJoined.filter(t => t.state === "cancelled").length;
|
|
171
184
|
const outcome = cancelled ? `${count} closed (${newlyJoined.length - cancelled} approved, ${cancelled} cancelled)` : `${count} approved`;
|
package/src/hub/tasks.ts
CHANGED
|
@@ -179,6 +179,9 @@ export interface AuditView extends AuditSummary {
|
|
|
179
179
|
/** Findings in this report that were already verified or rejected, so the hub left them as decided. */
|
|
180
180
|
notUpdated?: string[];
|
|
181
181
|
}
|
|
182
|
+
/** #1738: how long one working-tree spec check serves the roadmap snapshot. */
|
|
183
|
+
const ROADMAP_SPECS_REUSE_MS = 60_000;
|
|
184
|
+
|
|
182
185
|
export interface TasksDeps {
|
|
183
186
|
/** #1647 AC4: the hub's own token increments per task (a task id to its count, null when unknown), for the metrics grouped by reason. Read-only; absent means no reading. */
|
|
184
187
|
taskTokens?: () => Readonly<Record<number, number | null>>;
|
|
@@ -3779,9 +3782,26 @@ export class Tasks {
|
|
|
3779
3782
|
return this.roadmapResult(by, id);
|
|
3780
3783
|
}
|
|
3781
3784
|
|
|
3782
|
-
|
|
3785
|
+
/** #1738: the hub's own roadmap pass (the five-minute sweep and each task change's notice) runs milestoneList several times (the sweep, roadmapNotify, roadmapCheck and each
|
|
3786
|
+
* finding's recheck), and a working-tree spec check runs one synchronous git per spec path, so hub reads reuse one check for ROADMAP_SPECS_REUSE_MS. A thrown check is not
|
|
3787
|
+
* kept. Reads by the person and peers, and explicit `specs check`, stay uncached.
|
|
3788
|
+
* ponytail: a time window, not a repository key; key it on HEAD and index state, or run the check off the event loop, if a minute of stale freshness ever matters. */
|
|
3789
|
+
private roadmapSpecs: { at: number; report: SpecsCheckReport | SpecsCoverReport | undefined } | undefined;
|
|
3790
|
+
private roadmapSpecsCheck(): SpecsCheckReport | SpecsCoverReport | undefined {
|
|
3791
|
+
const now = this.d.now?.() ?? Date.now(), kept = this.roadmapSpecs;
|
|
3792
|
+
if (kept && now >= kept.at && now - kept.at < ROADMAP_SPECS_REUSE_MS) return kept.report;
|
|
3793
|
+
const report = this.d.specsRead?.("check", []);
|
|
3794
|
+
this.roadmapSpecs = { at: now, report };
|
|
3795
|
+
return report;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
private roadmapSpecsFor(by: PeerId): SpecsCheckReport | SpecsCoverReport | undefined {
|
|
3799
|
+
return by === HUB ? this.roadmapSpecsCheck() : this.d.specsRead?.("check", []);
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
private roadmapSnapshot(by: PeerId, specs = () => this.roadmapSpecsFor(by)): RoadmapSnapshot {
|
|
3783
3803
|
let freshness: SpecsCheckReport["freshness"] | undefined;
|
|
3784
|
-
try { const report =
|
|
3804
|
+
try { const report = specs(); if (report && "freshness" in report && !report.truncated && report.errors === 0)
|
|
3785
3805
|
freshness = report.freshness.filter(row => this.publicMetadataText(row.path) && (row.id === undefined || this.publicMetadataText(row.id))); } catch { /* unavailable evidence stays unknown */ }
|
|
3786
3806
|
return { milestones: this.d.board.milestones(), links: this.d.board.milestoneLinks(), tasks: this.d.board.list(), releases: this.d.board.releases(), freshness,
|
|
3787
3807
|
issueOf: task => { try { const source = this.planIssueIdentity(task); return source ? `${source.repo.toLowerCase()}#${source.issue}` : undefined; } catch { return undefined; } },
|
|
@@ -3790,9 +3810,9 @@ export class Tasks {
|
|
|
3790
3810
|
};
|
|
3791
3811
|
}
|
|
3792
3812
|
|
|
3793
|
-
milestoneList(by: PeerId): (MilestoneView & { tree: TreeRollup; readyToClose: ReadyToClose })[] {
|
|
3813
|
+
milestoneList(by: PeerId, specs?: () => SpecsCheckReport | SpecsCoverReport | undefined): (MilestoneView & { tree: TreeRollup; readyToClose: ReadyToClose })[] {
|
|
3794
3814
|
this.roadmapReadAuthority(by);
|
|
3795
|
-
const views = withTree(milestoneViews(this.roadmapSnapshot(by)));
|
|
3815
|
+
const views = withTree(milestoneViews(this.roadmapSnapshot(by, specs)));
|
|
3796
3816
|
this.roadmapReadAuthority(by); return views;
|
|
3797
3817
|
}
|
|
3798
3818
|
|
|
@@ -3845,10 +3865,19 @@ export class Tasks {
|
|
|
3845
3865
|
/** Build drift only from the same screened views and host-owned evidence as roadmap reads. */
|
|
3846
3866
|
async roadmapCheck(by: PeerId, include?: (finding: RoadmapDrift) => boolean): Promise<ReturnType<typeof checkRoadmap>> {
|
|
3847
3867
|
const check = this.requestCheck(by); check(); this.roadmapReadAuthority(by);
|
|
3848
|
-
|
|
3868
|
+
// #1741: one spec check per roadmap check. current() rebuilds the views before and after every issue read, and an uncached working-tree check is a
|
|
3869
|
+
// synchronous git per spec path (about a second on this repository), so it ran up to 200 times per call. A thrown check is kept as unavailable.
|
|
3870
|
+
let pinned: { report: SpecsCheckReport | SpecsCoverReport | undefined } | undefined;
|
|
3871
|
+
const specs = () => { if (!pinned) { pinned = { report: undefined }; pinned.report = this.roadmapSpecsFor(by); } return pinned.report; };
|
|
3872
|
+
const boardKey = () => JSON.stringify([this.d.board.statusRevision(), this.d.board.milestones(), this.d.board.milestoneLinks(), this.d.board.releases(), this.isConfiguredPlanner(by)]);
|
|
3873
|
+
let checkedKey = boardKey(); // taken before the views, so a write between the two is compared, not skipped
|
|
3874
|
+
const views = this.milestoneList(by, specs), config = this.d.roadmapConfig?.() ?? { github_mirror: false, github_write: "off" as const }, privacy = JSON.stringify([this.d.routing(), this.d.piiPaths, this.d.deny]);
|
|
3849
3875
|
const snapshot = (rows: typeof views) => JSON.stringify([rows, rows.flatMap(view => view.tasks.map(member => this.d.board.get(member.id)))]);
|
|
3850
3876
|
const evidence = snapshot(views);
|
|
3851
|
-
|
|
3877
|
+
// #1741: building the views runs issueOf over every board task (a regex scan of its text), about 140 ms on a 1156-task board, and current() runs before
|
|
3878
|
+
// and after each issue read. Rebuild only when a task write (statusRevision), a milestone, link or release row, or the caller's planner role (it screens backlog tasks) says the views can differ; config and privacy are compared on every call below.
|
|
3879
|
+
const sameViews = () => { const key = boardKey(); if (key === checkedKey) return true; if (snapshot(this.milestoneList(by, specs)) !== evidence) return false; checkedKey = key; return true; };
|
|
3880
|
+
const current = () => { check(); this.roadmapReadAuthority(by); if (!sameViews() || JSON.stringify(this.d.roadmapConfig?.() ?? { github_mirror: false, github_write: "off" }) !== JSON.stringify(config) || JSON.stringify([this.d.routing(), this.d.piiPaths, this.d.deny]) !== privacy) throw new PreEffectToolRefusal("roadmap or privacy policy changed while checking; retry ahub roadmap check"); };
|
|
3852
3881
|
const rendered = roadmapExport(views), exportStates: (boolean | undefined)[] = [];
|
|
3853
3882
|
for (const [path, expected] of [["docs/roadmap.json", rendered.json], ["docs/roadmap.md", rendered.markdown]] as const) {
|
|
3854
3883
|
try {
|
|
@@ -9045,6 +9074,8 @@ export class Tasks {
|
|
|
9045
9074
|
* retroactive, because the verdict that already passed is a statement about the board it saw.
|
|
9046
9075
|
*/
|
|
9047
9076
|
private riskViewFor(task: Task, head: string | undefined): RiskView | undefined {
|
|
9077
|
+
// #1741: riskView answers undefined without a receipt for this head, so skip the whole-board card read. A task list renders one view per row.
|
|
9078
|
+
if (!task.sdlc?.risk || task.sdlc.risk.head !== head) return undefined;
|
|
9048
9079
|
const repo = task.sdlc?.repo ?? task.refs.repo;
|
|
9049
9080
|
return riskView(task.sdlc?.risk, this.riskCards(), { ...(repo ? { repo } : {}), ...(task.refs.branch ? { branch: task.refs.branch } : {}), head, implementer: task.owner });
|
|
9050
9081
|
}
|