dsh-hive-runner 0.6.4 → 0.7.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.
- package/CHANGELOG.md +179 -0
- package/README.md +297 -100
- package/README.zh-CN.md +203 -63
- package/SPEC.md +227 -61
- package/cordis.patch.yml +38 -6
- package/docs/DESIGN.md +122 -31
- package/index.js +617 -37
- package/lib/anomalies.js +216 -0
- package/lib/audit.js +134 -0
- package/lib/commands.js +282 -12
- package/lib/config.js +51 -1
- package/lib/events.js +249 -0
- package/lib/gates.js +101 -0
- package/lib/host-env.js +51 -22
- package/lib/http.js +59 -4
- package/lib/notify.js +145 -0
- package/lib/patrol.js +218 -0
- package/lib/round.js +430 -124
- package/lib/runs.js +96 -4
- package/lib/supervisor.js +152 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,181 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
Version 0.6.0 is the first public snapshot; 0.1.0-0.5.0 were local development
|
|
8
8
|
iterations of the plugin before this repository was published.
|
|
9
9
|
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
### Documentation
|
|
13
|
+
|
|
14
|
+
- Aligned `README.md`, `README.zh-CN.md`, `SPEC.md`, `docs/DESIGN.md`, `CONTRIBUTING.md`
|
|
15
|
+
and `SECURITY.md` with the 0.7 code: task/agent terminology, queen-session parenting
|
|
16
|
+
rules, the panel's agent-concurrency and resume controls, intervention/arch-review
|
|
17
|
+
event shapes, the Node 22.19 floor and the current test count. No behaviour change.
|
|
18
|
+
|
|
19
|
+
## [0.7.0] - 2026-12-04
|
|
20
|
+
|
|
21
|
+
The queen becomes a coordinator: the supervisor now feeds her the anomalies she has to
|
|
22
|
+
act on, and the plugin gives her the tools to order, triage, review and govern the swarm
|
|
23
|
+
without editing code or claiming cards.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **Queen message injection.** Supervision events (`card-failed`, `card-timeout`,
|
|
28
|
+
`heartbeat-warn`, `worker-aborted`, `round-failed`, `auto-paused`,
|
|
29
|
+
`environment-error`) are coalesced into one digest and injected into the registered
|
|
30
|
+
queen Session through DSH's public Agent inbox
|
|
31
|
+
(`agent.followup({ id, role: 'user', content, source: { kind: 'hive-runner' } })`;
|
|
32
|
+
`steer`/`inject` fallbacks). A healthy swarm delivers nothing; when no queen Session is
|
|
33
|
+
live the digest stays in a pending list.
|
|
34
|
+
- **Queen patrol.** `patrolMs` (default 5 minutes) re-reads the supervisor status and
|
|
35
|
+
reports auto-paused repositories, stalled heartbeats and workers past their deadline;
|
|
36
|
+
it delivers only when something is pending. `anomalyDebounceMs`/`anomalyMax` bound the
|
|
37
|
+
digest queue.
|
|
38
|
+
- **Queen tool surface.** `hive_tasks` (list/show/add/reopen/retry/rm, with the last-run
|
|
39
|
+
record), `hive_arch_review`, `hive_events`, `hive_lesson_add`, `hive_recall`,
|
|
40
|
+
`hive_roles`, `hive_supervisor_control` (pause/resume/limits), `hive_anomalies`
|
|
41
|
+
(list/ack/patrol) and `hive_intervene`.
|
|
42
|
+
- **Gate pipeline.** Cards tagged `gate:group` dispatch only when every base card is
|
|
43
|
+
done, `gate:overall` only when every group gate is done; status exposes
|
|
44
|
+
`gate.phase`/`releaseReady` and reports `no-overall` when a repository does not
|
|
45
|
+
declare a release gate. Manual `hive_run_round` obeys the same order.
|
|
46
|
+
- **Architecture-review audit.** A done card without an `arch_review` event older than
|
|
47
|
+
`archReviewGraceMs` (default 10 minutes) becomes an `arch-review-missing` anomaly
|
|
48
|
+
(warning + pending digest).
|
|
49
|
+
- **Interventions.** `hive_intervene` records `queen_intervention { card, action, reason }`
|
|
50
|
+
for reopen/split/reassign/pause/fail/guide/remove/rebuild/escalate; a deletion stores
|
|
51
|
+
the removed card's title/state/scope in the event, a rebuild is limited to two per card,
|
|
52
|
+
and more than three interventions on one stuck card write `queen_escalation` and raise
|
|
53
|
+
the red-flag anomaly.
|
|
54
|
+
- New tools are allowlisted through fixed argv templates: `hive-tasks
|
|
55
|
+
list/add/reopen/retry/rm` (add supports an optional `--draft`), `hive lesson add`,
|
|
56
|
+
`hive roles list/add/rm` (umbrella `@d86e/hive`, `rolesBin`).
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- Reopen reasons are rendered at the top of the retried worker prompt as
|
|
61
|
+
`## Queen guidance for this attempt`.
|
|
62
|
+
- Status adds `pendingAnomalies` and the per-repository `gate` snapshot; the HTTP route
|
|
63
|
+
adds `GET ?op=pending` and `POST ?op=ack`.
|
|
64
|
+
- Commands never forward `--force` for the queen's `rm`.
|
|
65
|
+
|
|
66
|
+
### Compatibility
|
|
67
|
+
|
|
68
|
+
- DSH 0.2.2-rc.5: `Agent.followup/steer/inject` and the session-log source-kind rule are
|
|
69
|
+
the APIs used by the notifier. No DSH change is required.
|
|
70
|
+
- Existing configurations keep working: every new key is defaulted, and
|
|
71
|
+
`notifyQueen: false` leaves delivery in the pending list.
|
|
72
|
+
|
|
73
|
+
## [0.6.7] - 2026-12-04
|
|
74
|
+
|
|
75
|
+
### Fixed
|
|
76
|
+
|
|
77
|
+
- Card workers are now parented to the **queen conversation** — the Session where the
|
|
78
|
+
panel was initialised and the queen took over. The panel registers that Session id
|
|
79
|
+
with the supervisor (`POST /api/hive-runner?op=queen { sessionId }`, or the
|
|
80
|
+
`hiveSupervisor.setQueenSession()` service), and every worker activation uses exactly
|
|
81
|
+
that parent, so the subagents appear in the user's own queen session instead of a
|
|
82
|
+
hidden session or an arbitrary live agent.
|
|
83
|
+
- Nothing is dispatched before that registration: the supervisor skips the round and
|
|
84
|
+
status reports `waiting: no-queen-session` per repository (and at the top level),
|
|
85
|
+
which is a startup-order hint, not an error. It never falls back to another Session.
|
|
86
|
+
- `status` exposes `queenSessionId` and the workers of each repository keep their
|
|
87
|
+
`sessionId`/`parentSource: "queen"`; last-run records carry `parentSource: "queen"`
|
|
88
|
+
as well.
|
|
89
|
+
- Requires `dsh-hive-panel` 0.2.3 or newer: its init/queen activation registers the
|
|
90
|
+
queen Session and every panel snapshot re-registers it after a plugin restart.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Published
|
|
94
|
+
|
|
95
|
+
- npm: `dsh-hive-runner@0.6.7` on 2026-12-04.
|
|
96
|
+
|
|
97
|
+
## [0.6.6] - 2026-12-04
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- Follows hive-consensus 1.5.0's announcement board: `hive claim` and `hive guard`
|
|
102
|
+
never block, so the runner no longer fails a card when another agent already
|
|
103
|
+
announced the same or a related path. `hive guard --json` overlaps are parsed,
|
|
104
|
+
logged (`card <id> in <repo> overlaps: ...`), kept on the last-run record and
|
|
105
|
+
treated as information: the worker keeps working and merge-on-commit three-way
|
|
106
|
+
merges the concurrent edits at commit time (unresolved conflicts stay as markers).
|
|
107
|
+
- Worker prompt rewritten for announcements: announce every scope entry (including
|
|
108
|
+
`resource:` keys) with `hive guard --task <card id>` before starting — the task id
|
|
109
|
+
ties the worker's own announcement to the card, so a retry or a re-announcement never
|
|
110
|
+
reports itself as an overlap — treat overlaps as information
|
|
111
|
+
only, and keep the release/lesson/commit/finish rules. The old "guard exits 2" stop
|
|
112
|
+
rule, the `HIVE_AGENT`-on-every-command rule and the "lease enforcement skipped"
|
|
113
|
+
warning are gone; the repository hook is owned by merge-on-commit and needs no
|
|
114
|
+
environment variable for a commit.
|
|
115
|
+
- Every per-card Hive command now runs with `HIVE_INSTANCE=<card id>` (claim, guard,
|
|
116
|
+
done, fail, release, renew), and the worker activation injects the same value, so
|
|
117
|
+
concurrent workers of one runner are distinct announcers and their overlaps surface
|
|
118
|
+
instead of being mistaken for the announcer itself.
|
|
119
|
+
- Lessons are now a pair: before dispatch `hive recall` runs for every scope path plus
|
|
120
|
+
the repository root and the deduplicated matches lead the worker prompt
|
|
121
|
+
(`## Recalled experience (hive recall)`); after the work, workers write genuinely new
|
|
122
|
+
knowledge with `hive lesson add`. A read error is logged and recorded on the run
|
|
123
|
+
record, never a card failure.
|
|
124
|
+
- Last-run records carry the optional `overlaps` array (`{ key, agent, task,
|
|
125
|
+
expiresAt }`, valid entries only, at most 100) on the opening `running` write and the
|
|
126
|
+
terminal write, and the `lessons` summary (`{ count, scopes, error? }`) the panel
|
|
127
|
+
reads to show how many lessons were read.
|
|
128
|
+
|
|
129
|
+
### Fixed
|
|
130
|
+
|
|
131
|
+
- The last-run record's `output` is now the worker's **final result message** only:
|
|
132
|
+
the text blocks of the last assistant message. Reasoning/thinking blocks, tool calls
|
|
133
|
+
and the narration around them are stripped, and the provider diagnostic is no longer
|
|
134
|
+
appended (the card verdict already carries the failure reason). If a provider returns
|
|
135
|
+
no typed text block, the last non-empty text is used as a fallback; a run with no
|
|
136
|
+
text at all falls back to the card verdict. The 200-line/32-KiB cap is unchanged.
|
|
137
|
+
|
|
138
|
+
### Removed
|
|
139
|
+
|
|
140
|
+
- The consensus claim-expiry abort: the `leaseCheckMs` config key and
|
|
141
|
+
`DEFAULT_LEASE_CHECK_MS` export, the claim-deadline interval and the lease-expiry
|
|
142
|
+
failure branch. The hard `cardTimeoutMs` remains; the claim deadline stays as status
|
|
143
|
+
observability only.
|
|
144
|
+
- The `hive/no-hive-agent-env` deferrable error and the hook-warning detection it fed
|
|
145
|
+
(hive-consensus 1.5.0 emits no such warnings).
|
|
146
|
+
|
|
147
|
+
### Tests
|
|
148
|
+
|
|
149
|
+
- 124 `node:test` scenarios: announcement overlaps never block a card and are
|
|
150
|
+
logged/recorded, guard CLI problems only warn, per-card `HIVE_INSTANCE` injection,
|
|
151
|
+
lesson reads for every scope path and the repository root, run records with
|
|
152
|
+
`overlaps`/`lessons`, and the unchanged freeze-mode skip.
|
|
153
|
+
|
|
154
|
+
## [0.6.5] - 2026-12-04
|
|
155
|
+
|
|
156
|
+
### Fixed
|
|
157
|
+
|
|
158
|
+
- Every card now has a hard wall-clock timeout (`cardTimeoutMs`, default 15 min).
|
|
159
|
+
At the deadline the worker is aborted, the card is recorded failed, and its
|
|
160
|
+
leases are released, so a stuck worker can no longer stay "running" forever.
|
|
161
|
+
- While a card is in flight its claim lease is checked every `leaseCheckMs`
|
|
162
|
+
(default 1 s); an expired claim immediately aborts the worker, fails the card
|
|
163
|
+
and releases the leases.
|
|
164
|
+
- The running last-run record is refreshed as soon as the worker activation is
|
|
165
|
+
accepted: it carries `sessionId`/`agentName` while the card is still in progress,
|
|
166
|
+
not only after the terminal write. Panels can therefore open the worker chat for a
|
|
167
|
+
card that is currently running instead of waiting for done/failed.
|
|
168
|
+
- Status exposes the live `workers` of each repository with `cardId`, `sessionId`,
|
|
169
|
+
`agentName`, `startedAt`, `lastOutputAt`, `heartbeat`, `claimDeadline` and
|
|
170
|
+
`timeoutAt`, so the panel can jump to the worker session and show a stuck card.
|
|
171
|
+
- Heartbeat: while a worker runs, the repository HEAD is used as the observable
|
|
172
|
+
output signal. No movement for `heartbeatWarnMs` (default 5 min) marks the
|
|
173
|
+
worker `heartbeat: "warn"` in status and the last-run record and logs a warning.
|
|
174
|
+
|
|
175
|
+
### Added
|
|
176
|
+
|
|
177
|
+
- Config keys `cardTimeoutMs`, `heartbeatWarnMs`, `heartbeatIntervalMs` and
|
|
178
|
+
`leaseCheckMs` (all defaulted; see `cordis.patch.yml`).
|
|
179
|
+
|
|
180
|
+
### Changed
|
|
181
|
+
|
|
182
|
+
- Default claim TTL raised from `5m` to `20m` so the new 15-minute card timeout fits
|
|
183
|
+
inside a claim; set `ttl` ≥ `cardTimeoutMs` if you override either.
|
|
184
|
+
|
|
10
185
|
## [0.6.4] - 2026-12-04
|
|
11
186
|
|
|
12
187
|
### Added
|
|
@@ -19,6 +194,10 @@ iterations of the plugin before this repository was published.
|
|
|
19
194
|
failure records keep them. Records without an activation stay byte-identical
|
|
20
195
|
to the previous shape.
|
|
21
196
|
|
|
197
|
+
### Published
|
|
198
|
+
|
|
199
|
+
- npm: `dsh-hive-runner@0.6.4` on 2026-12-04.
|
|
200
|
+
|
|
22
201
|
## [0.6.3] - 2026-12-04
|
|
23
202
|
|
|
24
203
|
### Added
|