harnery 0.14.0 → 0.15.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 (45) hide show
  1. package/README.md +1 -0
  2. package/dist/commander.d.ts.map +1 -1
  3. package/dist/commander.js +2 -0
  4. package/dist/commands/supervisor.d.ts +4 -0
  5. package/dist/commands/supervisor.d.ts.map +1 -0
  6. package/dist/commands/supervisor.js +238 -0
  7. package/dist/core/supervisor/index.d.ts +3 -0
  8. package/dist/core/supervisor/index.d.ts.map +1 -0
  9. package/dist/core/supervisor/index.js +2 -0
  10. package/dist/core/supervisor/read.d.ts +2 -0
  11. package/dist/core/supervisor/read.d.ts.map +1 -0
  12. package/dist/core/supervisor/read.js +1 -0
  13. package/dist/core/supervisor/runner.d.ts +34 -0
  14. package/dist/core/supervisor/runner.d.ts.map +1 -0
  15. package/dist/core/supervisor/runner.js +198 -0
  16. package/dist/core/supervisor/state.d.ts +69 -0
  17. package/dist/core/supervisor/state.d.ts.map +1 -0
  18. package/dist/core/supervisor/state.js +413 -0
  19. package/dist/core/workflow/engine.d.ts.map +1 -1
  20. package/dist/core/workflow/engine.js +21 -8
  21. package/dist/core/workflow/index.d.ts +1 -1
  22. package/dist/core/workflow/index.d.ts.map +1 -1
  23. package/dist/core/workflow/proof.d.ts.map +1 -1
  24. package/dist/core/workflow/proof.js +1 -0
  25. package/dist/core/workflow/run-state.d.ts +2 -0
  26. package/dist/core/workflow/run-state.d.ts.map +1 -1
  27. package/dist/core/workflow/run-state.js +12 -0
  28. package/dist/core/workflow/specialists.d.ts +7 -0
  29. package/dist/core/workflow/specialists.d.ts.map +1 -0
  30. package/dist/core/workflow/specialists.js +78 -0
  31. package/dist/core/workflow/types.d.ts +17 -0
  32. package/dist/core/workflow/types.d.ts.map +1 -1
  33. package/package.json +11 -1
  34. package/src/commander.ts +2 -0
  35. package/src/commands/supervisor.ts +315 -0
  36. package/src/core/supervisor/index.ts +24 -0
  37. package/src/core/supervisor/read.ts +14 -0
  38. package/src/core/supervisor/runner.ts +278 -0
  39. package/src/core/supervisor/state.ts +552 -0
  40. package/src/core/workflow/engine.ts +21 -8
  41. package/src/core/workflow/index.ts +1 -0
  42. package/src/core/workflow/proof.ts +1 -0
  43. package/src/core/workflow/run-state.ts +17 -0
  44. package/src/core/workflow/specialists.ts +97 -0
  45. package/src/core/workflow/types.ts +18 -0
package/README.md CHANGED
@@ -23,6 +23,7 @@
23
23
  - **Cross-machine presence:** sessions on every machine that shares a repo see each other, labeled by machine. Zero-config over the repo's own git remote (presence refs), with an optional live-socket upgrade via an end-to-end-encrypted relay — the public `relay.harnery.com`, or self-host with `harn relay serve` / the bundled Cloudflare Worker (`relay/worker/`). The relay sees only ciphertext in opaquely-named rooms.
24
24
  - **Coordination-aware workflows:** `harn workflow run <script>` executes bounded, schema-gated multi-subagent workflow scripts — plain JS stages fanning out to headless harness-CLI subagents that are born coordination-registered (heartbeats, events, claim guards), with deterministic code deciding the routing between stages. An optional host-owned policy gates dispatch and declared external mutations with `ALLOW`, `ASK`, and `DENY`; CLI `ASK` requests park durably for an explicit approve/deny and same-run resume, while library callers remain fail-closed by default.
25
25
  - **Durable work above attempts:** `harn work` preserves an objective across bounded workflow attempts, dependencies, approval parks, failures, and review. Its one-shot reconciler derives state from append-only local evidence and reports the next explicit action without silently spawning, retrying, or accepting work.
26
+ - **Bounded goal supervision:** `harn supervisor` freezes a specialist team and safety limits around a root durable-work graph, then runs foreground scheduling cycles until success, human attention, no progress, or budget exhaustion. Specialist roles survive as configuration while every child remains a bounded process.
26
27
  - **Standalone web UI:** `harn web up` boots a local Next.js dashboard for the coord layer, councils, per-project state, and a local coding-agent status view (Claude Code / Codex / Cursor usage, backed by `harn devtools`). Ships with the git clone, not the npm package (see [Install](#install)).
27
28
  - **Backup + sync:** `harn backup` snapshots `.harnery/` via [restic](https://restic.net/); `harn sync` keeps a curated subset live across machines via [rclone](https://rclone.org/) (Google Drive or any rclone remote).
28
29
 
@@ -1 +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G,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC;IACrF,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACpE,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,EAAE,WAkCzB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAoD3E"}
package/dist/commander.js CHANGED
@@ -47,6 +47,7 @@ import { registerReadCommand } from "./commands/read.js";
47
47
  import { registerRelayCommand } from "./commands/relay.js";
48
48
  import { registerScratchCommand } from "./commands/scratch.js";
49
49
  import { registerSessionCommand } from "./commands/session.js";
50
+ import { registerSupervisorCommand } from "./commands/supervisor.js";
50
51
  import { registerSyncCommand } from "./commands/sync.js";
51
52
  import { registerSectionCommand, registerTocCommand } from "./commands/toc.js";
52
53
  import { registerTokensCommand } from "./commands/tokens.js";
@@ -134,6 +135,7 @@ export function createHarneryProgram(opts = {}) {
134
135
  registerSyncCommand(program, emit);
135
136
  registerWorkflowCommand(program, emit);
136
137
  registerWorkCommand(program, emit);
138
+ registerSupervisorCommand(program, emit);
137
139
  if (include("web"))
138
140
  registerWebCommand(program, emit);
139
141
  return program;
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { EmitContext } from "../commander.js";
3
+ export declare function registerSupervisorCommand(program: Command, emit: EmitContext): void;
4
+ //# sourceMappingURL=supervisor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../src/commands/supervisor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA4CnD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CA0FnF"}
@@ -0,0 +1,238 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { workflowSubscriptionOnly } from "../core/config.js";
4
+ import { createBuiltinHarnessRegistry } from "../core/harnesses/index.js";
5
+ import { findCoordRoot } from "../core/hooks/resolve/coord-root.js";
6
+ import { loadPolicyFile } from "../core/policy/index.js";
7
+ import { createSupervisor, listSupervisors, readSupervisor, runSupervisor, } from "../core/supervisor/index.js";
8
+ export function registerSupervisorCommand(program, emit) {
9
+ const registry = createBuiltinHarnessRegistry();
10
+ const supervisor = program
11
+ .command("supervisor")
12
+ .description("Run a bounded specialist team over a durable-work dependency graph.");
13
+ supervisor
14
+ .command("create <root-work-id>")
15
+ .description("Freeze a goal, specialist team, automation policy, and execution limits.")
16
+ .requiredOption("--team <file>", "JSON object mapping specialist ids to profiles")
17
+ .option("--id <goal-id>", "Stable goal id (generated by default)")
18
+ .option("--title <text>", "Goal title (defaults to root work title)")
19
+ .option("--max-cycles <n>", "Foreground cycle ceiling (default 50)")
20
+ .option("--max-runtime-ms <n>", "Foreground wall-time ceiling (default 14400000)")
21
+ .option("--max-parallel-work <n>", "Concurrent work-item ceiling (default 1)")
22
+ .option("--max-total-attempts <n>", "Graph-wide attempt ceiling (default 100)")
23
+ .option("--max-agents-per-work <n>", "Child-agent ceiling per work item (default 20)")
24
+ .option("--agent-concurrency <n>", "Child concurrency per work item (default 4)")
25
+ .option("--accept-passing-proof", "Allow the supervisor to explicitly accept passing proof")
26
+ .option("--no-resume-approved", "Stop after an approval instead of resuming its parked run")
27
+ .option("--retry-blocked", "Allow bounded retry of blocked work")
28
+ .option("--json", "Emit the complete supervisor record as JSON")
29
+ .action((rootWorkId, opts) => {
30
+ withSupervisorRoot(emit, (coordRoot) => {
31
+ const specialists = readTeamFile(opts.team);
32
+ for (const [id, profile] of Object.entries(specialists)) {
33
+ if (profile.harness && !registry.get(profile.harness)) {
34
+ throw new Error(`specialist ${id} names unknown harness ${JSON.stringify(profile.harness)}`);
35
+ }
36
+ }
37
+ emitSupervisor(createSupervisor({
38
+ coordRoot,
39
+ rootWorkId,
40
+ specialists,
41
+ id: opts.id,
42
+ title: opts.title,
43
+ limits: {
44
+ max_cycles: integer(opts.maxCycles),
45
+ max_runtime_ms: integer(opts.maxRuntimeMs),
46
+ max_parallel_work: integer(opts.maxParallelWork),
47
+ max_total_attempts: integer(opts.maxTotalAttempts),
48
+ max_agents_per_work: integer(opts.maxAgentsPerWork),
49
+ agent_concurrency: integer(opts.agentConcurrency),
50
+ },
51
+ automation: {
52
+ accept_passing_proof: opts.acceptPassingProof,
53
+ resume_approved: opts.resumeApproved,
54
+ retry_blocked: opts.retryBlocked,
55
+ },
56
+ }), opts.json, emit, true);
57
+ });
58
+ });
59
+ supervisor
60
+ .command("list")
61
+ .description("List durable goals and their derived next action.")
62
+ .option("--json", "Emit complete supervisor records as JSON")
63
+ .action((opts) => {
64
+ withSupervisorRoot(emit, (coordRoot) => {
65
+ const records = listSupervisors(coordRoot);
66
+ if (opts.json) {
67
+ emit.config({ format: "json" });
68
+ emit.data(records);
69
+ }
70
+ else if (records.length === 0) {
71
+ emit.text("no durable supervisors\n");
72
+ }
73
+ else {
74
+ emit.text(`${records.map(renderSupervisorRow).join("\n")}\n`);
75
+ }
76
+ });
77
+ });
78
+ supervisor
79
+ .command("show <goal-id>")
80
+ .description("Show one goal, frozen team, bounds, graph state, and next action.")
81
+ .option("--json", "Emit the complete supervisor record as JSON")
82
+ .action((goalId, opts) => {
83
+ withSupervisorRoot(emit, (coordRoot) => {
84
+ emitSupervisor(readSupervisor(coordRoot, goalId), opts.json, emit, true);
85
+ });
86
+ });
87
+ registerRunCommand(supervisor, "tick", registry, emit);
88
+ registerRunCommand(supervisor, "run", registry, emit);
89
+ }
90
+ function registerRunCommand(supervisor, mode, registry, emit) {
91
+ supervisor
92
+ .command(`${mode} <goal-id>`)
93
+ .description(mode === "tick"
94
+ ? "Perform at most one bounded scheduling cycle."
95
+ : "Run bounded cycles until success, attention, no progress, or budget exhaustion.")
96
+ .option("--harness <name>", "Fallback harness for agent calls without a specialist")
97
+ .option("--cwd <dir>", "Working directory for child agents")
98
+ .option("--subscription-only", "Require stored harness-login billing")
99
+ .option("--allow-api-billing", "Permit API-key override billing")
100
+ .option("--policy <file>", "Host policy JSON/JSONC")
101
+ .option("--isolation <mode>", "shared | worktree | sandbox | remote")
102
+ .option("--approval-to <address>", "Address durable ASK requests")
103
+ .option("--actor <name>", "Actor recorded on supervisor work decisions")
104
+ .option("--json", "Emit the complete run report as JSON")
105
+ .action(async (goalId, opts) => {
106
+ await withSupervisorRootAsync(emit, async (coordRoot) => {
107
+ if (opts.harness && !registry.get(opts.harness)) {
108
+ throw new Error(`unknown harness ${JSON.stringify(opts.harness)}`);
109
+ }
110
+ const report = await runSupervisor({
111
+ coordRoot,
112
+ goalId,
113
+ mode,
114
+ actor: opts.actor,
115
+ onLog: opts.json ? undefined : (line) => emit.text(`${line}\n`),
116
+ engine: {
117
+ spawners: registry.spawners(),
118
+ defaultHarness: opts.harness,
119
+ cwd: opts.cwd,
120
+ subscriptionOnly: opts.subscriptionOnly === true ? true : workflowSubscriptionOnly(coordRoot),
121
+ allowApiBilling: opts.allowApiBilling,
122
+ harnessEvidence: Object.fromEntries(registry
123
+ .list()
124
+ .map((adapter) => [
125
+ adapter.profile.id,
126
+ { toolEvidence: adapter.profile.capabilities.toolEvidence },
127
+ ])),
128
+ policy: opts.policy ? loadPolicyFile(opts.policy) : undefined,
129
+ approvalMode: "park",
130
+ approvalAddressee: opts.approvalTo,
131
+ isolation: opts.isolation,
132
+ networkAccess: "enabled",
133
+ },
134
+ });
135
+ emitSupervisorReport(report, opts.json, emit);
136
+ });
137
+ });
138
+ }
139
+ function readTeamFile(path) {
140
+ const absolute = resolve(path);
141
+ let value;
142
+ try {
143
+ value = JSON.parse(readFileSync(absolute, "utf8"));
144
+ }
145
+ catch (error) {
146
+ throw new Error(`cannot read supervisor team at ${absolute}: ${error.message}`);
147
+ }
148
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
149
+ throw new Error("supervisor team must be a JSON object keyed by specialist id");
150
+ }
151
+ return value;
152
+ }
153
+ function emitSupervisor(record, json, emit, detail = false) {
154
+ if (json) {
155
+ emit.config({ format: "json" });
156
+ emit.data(record);
157
+ return;
158
+ }
159
+ if (!detail) {
160
+ emit.text(`${renderSupervisorRow(record)}\n`);
161
+ return;
162
+ }
163
+ const projection = record.projection;
164
+ const lines = [
165
+ `${record.intent.id}: ${record.intent.title}`,
166
+ `state: ${projection.state}`,
167
+ `root: ${record.intent.root_work_id}`,
168
+ `reason: ${projection.reason}`,
169
+ `next: ${projection.next_action}`,
170
+ `work: ${projection.work_ids.length}`,
171
+ `attempts: ${projection.attempts_used}/${record.intent.limits.max_total_attempts}`,
172
+ `specialists: ${projection.specialists.join(", ") || "none"}`,
173
+ `automation: accept=${record.intent.automation.accept_passing_proof}, ` +
174
+ `resume=${record.intent.automation.resume_approved}, retry=${record.intent.automation.retry_blocked}`,
175
+ ];
176
+ if (projection.attention_work.length) {
177
+ lines.push(`attention: ${projection.attention_work.join(", ")}`);
178
+ }
179
+ emit.text(`${lines.join("\n")}\n`);
180
+ }
181
+ function emitSupervisorReport(report, json, emit) {
182
+ if (json) {
183
+ emit.config({ format: "json" });
184
+ emit.data(report);
185
+ return;
186
+ }
187
+ emit.text(`supervisor ${report.goal_id}: ${report.stop_reason}\n` +
188
+ `reason: ${report.reason}\n` +
189
+ `cycles: ${report.cycles}; dispatches: ${report.dispatches}; acceptances: ${report.acceptances}\n` +
190
+ `state: ${report.projection.state}; next: ${report.projection.next_action}\n`);
191
+ }
192
+ function renderSupervisorRow(record) {
193
+ const projection = record.projection;
194
+ return `${record.intent.id} ${projection.state.padEnd(20)} ${projection.attempts_used}/${record.intent.limits.max_total_attempts} ${projection.next_action.padEnd(18)} ${record.intent.title}`;
195
+ }
196
+ function integer(value) {
197
+ if (value === undefined)
198
+ return undefined;
199
+ if (!/^\d+$/.test(value))
200
+ throw new Error(`expected a positive integer, got ${JSON.stringify(value)}`);
201
+ return Number.parseInt(value, 10);
202
+ }
203
+ function withSupervisorRoot(emit, fn) {
204
+ const coordRoot = findCoordRoot();
205
+ if (!coordRoot) {
206
+ emit.error({
207
+ code: "no_coord_root",
208
+ message: "no .harnery/ coordination root found; run `init` first",
209
+ });
210
+ emit.setExitCode(1);
211
+ return;
212
+ }
213
+ try {
214
+ fn(coordRoot);
215
+ }
216
+ catch (error) {
217
+ emit.error({ code: "supervisor_failed", message: error.message });
218
+ emit.setExitCode(1);
219
+ }
220
+ }
221
+ async function withSupervisorRootAsync(emit, fn) {
222
+ const coordRoot = findCoordRoot();
223
+ if (!coordRoot) {
224
+ emit.error({
225
+ code: "no_coord_root",
226
+ message: "no .harnery/ coordination root found; run `init` first",
227
+ });
228
+ emit.setExitCode(1);
229
+ return;
230
+ }
231
+ try {
232
+ await fn(coordRoot);
233
+ }
234
+ catch (error) {
235
+ emit.error({ code: "supervisor_failed", message: error.message });
236
+ emit.setExitCode(1);
237
+ }
238
+ }
@@ -0,0 +1,3 @@
1
+ export { type RunSupervisorInput, runSupervisor, type SupervisorDispatchOutcome, type SupervisorRunReport, type SupervisorStopReason, } from "./runner.js";
2
+ export { assertSupervisorId, type CreateSupervisorInput, collectSupervisorWork, createSupervisor, listSupervisors, newSupervisorId, readSupervisor, SUPERVISOR_INTENT_SCHEMA_VERSION, type SupervisorAutomationPolicy, type SupervisorIntent, type SupervisorLimits, type SupervisorNextAction, type SupervisorProjection, type SupervisorRecord, type SupervisorState, } from "./state.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/supervisor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,cAAc,EACd,gCAAgC,EAChC,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { runSupervisor, } from "./runner.js";
2
+ export { assertSupervisorId, collectSupervisorWork, createSupervisor, listSupervisors, newSupervisorId, readSupervisor, SUPERVISOR_INTENT_SCHEMA_VERSION, } from "./state.js";
@@ -0,0 +1,2 @@
1
+ export { assertSupervisorId, collectSupervisorWork, listSupervisors, readSupervisor, SUPERVISOR_INTENT_SCHEMA_VERSION, type SupervisorAutomationPolicy, type SupervisorIntent, type SupervisorLimits, type SupervisorNextAction, type SupervisorProjection, type SupervisorRecord, type SupervisorState, } from "./state.js";
2
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/core/supervisor/read.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gCAAgC,EAChC,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export { assertSupervisorId, collectSupervisorWork, listSupervisors, readSupervisor, SUPERVISOR_INTENT_SCHEMA_VERSION, } from "./state.js";
@@ -0,0 +1,34 @@
1
+ import { type RunWorkItemInput } from "../work/index.js";
2
+ import { type SupervisorProjection } from "./state.js";
3
+ export type SupervisorStopReason = "succeeded" | "awaiting_attention" | "blocked" | "budget_exhausted" | "no_progress" | "tick_complete";
4
+ export interface SupervisorDispatchOutcome {
5
+ work_id: string;
6
+ action: "run" | "resume" | "retry";
7
+ status: "completed" | "parked" | "failed";
8
+ run_id?: string;
9
+ error?: string;
10
+ }
11
+ export interface SupervisorRunReport {
12
+ goal_id: string;
13
+ mode: "tick" | "run";
14
+ stop_reason: SupervisorStopReason;
15
+ reason: string;
16
+ started_at: string;
17
+ ended_at: string;
18
+ duration_ms: number;
19
+ cycles: number;
20
+ dispatches: number;
21
+ acceptances: number;
22
+ outcomes: SupervisorDispatchOutcome[];
23
+ projection: SupervisorProjection;
24
+ }
25
+ export interface RunSupervisorInput {
26
+ coordRoot: string;
27
+ goalId: string;
28
+ mode?: "tick" | "run";
29
+ actor?: string;
30
+ engine: Omit<RunWorkItemInput["engine"], "maxAgents" | "concurrency" | "specialists">;
31
+ onLog?: (line: string) => void;
32
+ }
33
+ export declare function runSupervisor(input: RunSupervisorInput): Promise<SupervisorRunReport>;
34
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/core/supervisor/runner.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,oBAAoB,EAE1B,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX,oBAAoB,GACpB,SAAS,GACT,kBAAkB,GAClB,aAAa,GACb,eAAe,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnC,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,WAAW,EAAE,oBAAoB,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,UAAU,EAAE,oBAAoB,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,aAAa,CAAC,CAAC;IACtF,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAQD,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAuJ3F"}
@@ -0,0 +1,198 @@
1
+ import { resolve } from "node:path";
2
+ import { acceptWorkItem, reconcileWorkItem, runWorkItem, } from "../work/index.js";
3
+ import { acquireSupervisorLease, readSupervisorIgnoringLease, } from "./state.js";
4
+ export async function runSupervisor(input) {
5
+ const coordRoot = resolve(input.coordRoot);
6
+ const mode = input.mode ?? "run";
7
+ const actor = input.actor?.trim() || `supervisor:${input.goalId}`;
8
+ const log = input.onLog ?? (() => undefined);
9
+ const startedAt = new Date().toISOString();
10
+ const startedMs = Date.now();
11
+ const release = acquireSupervisorLease(coordRoot, input.goalId);
12
+ let cycles = 0;
13
+ let dispatches = 0;
14
+ let acceptances = 0;
15
+ const outcomes = [];
16
+ try {
17
+ const initial = readSupervisorIgnoringLease(coordRoot, input.goalId);
18
+ const cycleLimit = mode === "tick" ? 1 : initial.intent.limits.max_cycles;
19
+ const deadline = startedMs + initial.intent.limits.max_runtime_ms;
20
+ while (cycles < cycleLimit) {
21
+ cycles++;
22
+ let record = refreshGraph(coordRoot, input.goalId, actor);
23
+ log(`[${record.intent.title}] cycle ${cycles}: ${record.projection.state}; ` +
24
+ `${record.projection.ready_work.length} ready, ${record.projection.attention_work.length} attention`);
25
+ if (record.projection.state === "succeeded") {
26
+ return report("succeeded", record.projection.reason, record);
27
+ }
28
+ if (Date.now() >= deadline) {
29
+ return report("budget_exhausted", "supervisor wall-time limit reached", record);
30
+ }
31
+ const before = graphFingerprint(record);
32
+ let changed = false;
33
+ if (record.intent.automation.accept_passing_proof) {
34
+ for (const work of record.work) {
35
+ if (work.projection.state !== "in_review")
36
+ continue;
37
+ acceptWorkItem(coordRoot, work.intent.id, {
38
+ actor,
39
+ reason: "passing proof accepted by frozen supervisor policy",
40
+ });
41
+ acceptances++;
42
+ changed = true;
43
+ log(`[${record.intent.title}] accepted ${work.intent.id} from passing proof`);
44
+ }
45
+ if (changed)
46
+ record = refreshGraph(coordRoot, input.goalId, actor);
47
+ if (record.projection.state === "succeeded") {
48
+ return report("succeeded", record.projection.reason, record);
49
+ }
50
+ }
51
+ const candidates = selectCandidates(record);
52
+ const selected = selectWithinAttemptBudget(record, candidates).slice(0, record.intent.limits.max_parallel_work);
53
+ if (selected.length > 0 && Date.now() < deadline) {
54
+ const settled = await Promise.all(selected.map(async (candidate) => {
55
+ dispatches++;
56
+ log(`[${record.intent.title}] ${candidate.action} ${candidate.record.intent.id}`);
57
+ try {
58
+ const result = await runWorkItem({
59
+ coordRoot,
60
+ workId: candidate.record.intent.id,
61
+ retry: candidate.action === "retry",
62
+ actor,
63
+ engine: {
64
+ ...input.engine,
65
+ specialists: record.intent.specialists,
66
+ maxAgents: record.intent.limits.max_agents_per_work,
67
+ concurrency: record.intent.limits.agent_concurrency,
68
+ },
69
+ });
70
+ return {
71
+ work_id: candidate.record.intent.id,
72
+ action: candidate.action,
73
+ status: "completed",
74
+ run_id: result.runId,
75
+ };
76
+ }
77
+ catch (error) {
78
+ const latest = reconcileWorkItem(coordRoot, candidate.record.intent.id, actor);
79
+ return {
80
+ work_id: candidate.record.intent.id,
81
+ action: candidate.action,
82
+ status: latest.projection.state === "awaiting_approval" ? "parked" : "failed",
83
+ run_id: latest.projection.latest_run_id,
84
+ error: boundedError(error.message),
85
+ };
86
+ }
87
+ }));
88
+ outcomes.push(...settled);
89
+ changed = true;
90
+ }
91
+ record = refreshGraph(coordRoot, input.goalId, actor);
92
+ const after = graphFingerprint(record);
93
+ if (record.projection.state === "succeeded") {
94
+ return report("succeeded", record.projection.reason, record);
95
+ }
96
+ if (mode === "tick") {
97
+ return report(before === after ? "no_progress" : "tick_complete", before === after
98
+ ? "the tick found no legal progress action"
99
+ : "one bounded supervisor cycle completed", record);
100
+ }
101
+ if (Date.now() >= deadline) {
102
+ return report("budget_exhausted", "supervisor wall-time limit reached", record);
103
+ }
104
+ if (record.projection.state === "budget_exhausted") {
105
+ return report("budget_exhausted", record.projection.reason, record);
106
+ }
107
+ if (selected.length === 0 && !changed) {
108
+ return report(stopForProjection(record.projection), record.projection.reason, record);
109
+ }
110
+ if (selected.length === 0 && record.projection.state !== "ready") {
111
+ return report(stopForProjection(record.projection), record.projection.reason, record);
112
+ }
113
+ if (before === after) {
114
+ return report("no_progress", "a supervisor cycle produced no durable state change", record);
115
+ }
116
+ }
117
+ const final = refreshGraph(coordRoot, input.goalId, actor);
118
+ return report("budget_exhausted", `supervisor cycle limit reached (${cycleLimit})`, final);
119
+ }
120
+ finally {
121
+ release();
122
+ }
123
+ function report(stopReason, reason, record) {
124
+ const endedAt = new Date().toISOString();
125
+ return {
126
+ goal_id: input.goalId,
127
+ mode,
128
+ stop_reason: stopReason,
129
+ reason,
130
+ started_at: startedAt,
131
+ ended_at: endedAt,
132
+ duration_ms: Date.now() - startedMs,
133
+ cycles,
134
+ dispatches,
135
+ acceptances,
136
+ outcomes,
137
+ projection: record.projection,
138
+ };
139
+ }
140
+ }
141
+ function refreshGraph(coordRoot, goalId, actor) {
142
+ const before = readSupervisorIgnoringLease(coordRoot, goalId);
143
+ for (const work of before.work)
144
+ reconcileWorkItem(coordRoot, work.intent.id, actor);
145
+ return readSupervisorIgnoringLease(coordRoot, goalId);
146
+ }
147
+ function selectCandidates(record) {
148
+ const candidates = [];
149
+ for (const work of record.work) {
150
+ if (work.projection.state === "ready") {
151
+ candidates.push({ record: work, action: "run", consumesAttempt: true });
152
+ continue;
153
+ }
154
+ if (work.projection.state === "awaiting_approval" &&
155
+ work.projection.next_action === "resume" &&
156
+ record.intent.automation.resume_approved) {
157
+ candidates.push({ record: work, action: "resume", consumesAttempt: false });
158
+ continue;
159
+ }
160
+ if (work.projection.state === "blocked" &&
161
+ work.projection.next_action === "retry" &&
162
+ record.intent.automation.retry_blocked) {
163
+ candidates.push({ record: work, action: "retry", consumesAttempt: true });
164
+ }
165
+ }
166
+ return candidates;
167
+ }
168
+ function selectWithinAttemptBudget(record, candidates) {
169
+ let remaining = record.projection.attempts_remaining;
170
+ return candidates.filter((candidate) => {
171
+ if (!candidate.consumesAttempt)
172
+ return true;
173
+ if (remaining <= 0)
174
+ return false;
175
+ remaining--;
176
+ return true;
177
+ });
178
+ }
179
+ function graphFingerprint(record) {
180
+ return JSON.stringify(record.work.map((work) => [
181
+ work.intent.id,
182
+ work.projection.state,
183
+ work.projection.next_action,
184
+ work.projection.attempts_used,
185
+ work.events.length,
186
+ ]));
187
+ }
188
+ function stopForProjection(projection) {
189
+ if (projection.state === "budget_exhausted")
190
+ return "budget_exhausted";
191
+ if (projection.state === "blocked")
192
+ return "blocked";
193
+ return "awaiting_attention";
194
+ }
195
+ function boundedError(message) {
196
+ const normalized = message.replace(/\s+/g, " ").trim();
197
+ return normalized.length > 2_000 ? `${normalized.slice(0, 1_999)}…` : normalized;
198
+ }
@@ -0,0 +1,69 @@
1
+ import { type WorkRecord } from "../work/read.js";
2
+ import type { WorkflowSpecialistProfile } from "../workflow/types.js";
3
+ export declare const SUPERVISOR_INTENT_SCHEMA_VERSION: 1;
4
+ export interface SupervisorLimits {
5
+ max_cycles: number;
6
+ max_runtime_ms: number;
7
+ max_parallel_work: number;
8
+ max_total_attempts: number;
9
+ max_agents_per_work: number;
10
+ agent_concurrency: number;
11
+ }
12
+ export interface SupervisorAutomationPolicy {
13
+ accept_passing_proof: boolean;
14
+ resume_approved: boolean;
15
+ retry_blocked: boolean;
16
+ }
17
+ export interface SupervisorIntent {
18
+ schema_version: typeof SUPERVISOR_INTENT_SCHEMA_VERSION;
19
+ id: string;
20
+ title: string;
21
+ root_work_id: string;
22
+ specialists: Record<string, WorkflowSpecialistProfile>;
23
+ limits: SupervisorLimits;
24
+ automation: SupervisorAutomationPolicy;
25
+ created_at: string;
26
+ }
27
+ export type SupervisorState = "ready" | "running" | "awaiting_attention" | "blocked" | "budget_exhausted" | "succeeded";
28
+ export type SupervisorNextAction = "run" | "wait_for_run" | "resolve_approval" | "review" | "retry" | "none";
29
+ export interface SupervisorProjection {
30
+ id: string;
31
+ title: string;
32
+ root_work_id: string;
33
+ state: SupervisorState;
34
+ reason: string;
35
+ next_action: SupervisorNextAction;
36
+ work_ids: string[];
37
+ ready_work: string[];
38
+ resumable_work: string[];
39
+ retryable_work: string[];
40
+ attention_work: string[];
41
+ attempts_used: number;
42
+ attempts_remaining: number;
43
+ specialists: string[];
44
+ }
45
+ export interface SupervisorRecord {
46
+ intent: SupervisorIntent;
47
+ projection: SupervisorProjection;
48
+ work: WorkRecord[];
49
+ }
50
+ export interface CreateSupervisorInput {
51
+ coordRoot: string;
52
+ rootWorkId: string;
53
+ specialists: Readonly<Record<string, WorkflowSpecialistProfile>>;
54
+ title?: string;
55
+ id?: string;
56
+ limits?: Partial<SupervisorLimits>;
57
+ automation?: Partial<SupervisorAutomationPolicy>;
58
+ }
59
+ export declare function createSupervisor(input: CreateSupervisorInput): SupervisorRecord;
60
+ export declare function readSupervisor(coordRoot: string, goalId: string): SupervisorRecord;
61
+ /** @internal Runner seam; ignores the lease held by this supervisor process. */
62
+ export declare function readSupervisorIgnoringLease(coordRoot: string, goalId: string): SupervisorRecord;
63
+ export declare function listSupervisors(coordRoot: string): SupervisorRecord[];
64
+ export declare function collectSupervisorWork(coordRoot: string, rootWorkId: string): WorkRecord[];
65
+ export declare function assertSupervisorId(goalId: string): void;
66
+ export declare function newSupervisorId(): string;
67
+ /** @internal Runner seam; one exclusive crash-recoverable supervisor lease. */
68
+ export declare function acquireSupervisorLease(coordRoot: string, goalId: string): () => void;
69
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/core/supervisor/state.ts"],"names":[],"mappings":"AAeA,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,eAAO,MAAM,gCAAgC,EAAG,CAAU,CAAC;AAO3D,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;CACxB;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