@staix/agent-hub 0.48.0 → 0.48.1

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 CHANGED
@@ -4,6 +4,10 @@ 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.1
8
+
9
+ - 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.
10
+
7
11
  ## 0.48.0
8
12
 
9
13
  - 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.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.48.1, 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,7 @@ 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.
51
52
  - 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
53
  - 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
54
 
@@ -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. 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
 
@@ -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.0
21
+ bun add -g github:STAIxBWLB/agent-hub#v0.48.1
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.48.1
58
+
59
+ 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.
60
+
61
+ `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.
62
+
57
63
  ## Upgrading to 0.48.0
58
64
 
59
65
  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.
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "documents": {
4
4
  "README.md": {
5
- "verifiedAgainst": "c73ad69559f72e57233a7525c07fb8892aa41441",
5
+ "verifiedAgainst": "19b5ae2859acd182d43d7bb3441ee19d9f15981a",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
14
+ "verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
15
15
  "paths": [
16
16
  "src/",
17
17
  "templates/"
18
18
  ]
19
19
  },
20
20
  "docs/operations.md": {
21
- "verifiedAgainst": "c73ad69559f72e57233a7525c07fb8892aa41441",
21
+ "verifiedAgainst": "19b5ae2859acd182d43d7bb3441ee19d9f15981a",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
38
+ "verifiedAgainst": "d7c733817dbfc2c640d3749a921a7f9e5eda1fbd",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
46
+ "verifiedAgainst": "19b5ae2859acd182d43d7bb3441ee19d9f15981a",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
65
+ "verifiedAgainst": "19b5ae2859acd182d43d7bb3441ee19d9f15981a",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
192
+ "verifiedAgainst": "19b5ae2859acd182d43d7bb3441ee19d9f15981a",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
491
+ "verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
542
+ "verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
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": "c73ad69559f72e57233a7525c07fb8892aa41441",
599
+ "verifiedAgainst": "4ef41748e0ae28e1f2854eac0c4d317e199971c0",
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": "@staix/agent-hub",
3
- "version": "0.48.0",
3
+ "version": "0.48.1",
4
4
  "description": "Native multi-agent hub: Claude Code, Codex, Kimi Code, Pi and local inference as peers in one project",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-hub",
3
- "version": "0.48.0",
3
+ "version": "0.48.1",
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.0",
14820
+ version: "0.48.1",
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.0",
14802
+ version: "0.48.1",
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,
@@ -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.d.tasks().find((t) => t.id === id);
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.d.tasks().find(row => row.id === taskId);
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.d.tasks().find(task => task.id === stall.task);
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,22 @@ export class Tasks {
3779
3782
  return this.roadmapResult(by, id);
3780
3783
  }
3781
3784
 
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
+
3782
3798
  private roadmapSnapshot(by: PeerId): RoadmapSnapshot {
3783
3799
  let freshness: SpecsCheckReport["freshness"] | undefined;
3784
- try { const report = this.d.specsRead?.("check", []); if (report && "freshness" in report && !report.truncated && report.errors === 0)
3800
+ try { const report = by === HUB ? this.roadmapSpecsCheck() : this.d.specsRead?.("check", []); if (report && "freshness" in report && !report.truncated && report.errors === 0)
3785
3801
  freshness = report.freshness.filter(row => this.publicMetadataText(row.path) && (row.id === undefined || this.publicMetadataText(row.id))); } catch { /* unavailable evidence stays unknown */ }
3786
3802
  return { milestones: this.d.board.milestones(), links: this.d.board.milestoneLinks(), tasks: this.d.board.list(), releases: this.d.board.releases(), freshness,
3787
3803
  issueOf: task => { try { const source = this.planIssueIdentity(task); return source ? `${source.repo.toLowerCase()}#${source.issue}` : undefined; } catch { return undefined; } },