@jmanuelcorral/openteam 0.17.6 → 0.18.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 (32) hide show
  1. package/README.es.md +4 -4
  2. package/README.md +4 -4
  3. package/dist/certificates/graph-release-certificate.json +2 -2
  4. package/dist/certificates/graph-shadow-certificate.json +2 -2
  5. package/dist/cli.js +887 -2536
  6. package/dist/commands/dispatch.d.ts +2 -135
  7. package/dist/commands/dispatch.d.ts.map +1 -1
  8. package/dist/config/schema.d.ts +2 -0
  9. package/dist/config/schema.d.ts.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +6107 -6402
  13. package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -1
  14. package/dist/orchestrator/coordinator.d.ts +26 -0
  15. package/dist/orchestrator/coordinator.d.ts.map +1 -1
  16. package/dist/orchestrator/nodeIteration.d.ts +36 -0
  17. package/dist/orchestrator/nodeIteration.d.ts.map +1 -0
  18. package/dist/orchestrator/outputContract.d.ts +91 -0
  19. package/dist/orchestrator/outputContract.d.ts.map +1 -0
  20. package/dist/orchestrator/reportArtifactProbe.d.ts +40 -0
  21. package/dist/orchestrator/reportArtifactProbe.d.ts.map +1 -0
  22. package/dist/orchestrator/reportArtifactReader.d.ts +36 -0
  23. package/dist/orchestrator/reportArtifactReader.d.ts.map +1 -0
  24. package/dist/orchestrator/reportDurability.d.ts +70 -0
  25. package/dist/orchestrator/reportDurability.d.ts.map +1 -0
  26. package/dist/orchestrator/subsessions.d.ts +1 -1
  27. package/dist/orchestrator/subsessions.d.ts.map +1 -1
  28. package/dist/plugin/orchestrateTool.d.ts +41 -1
  29. package/dist/plugin/orchestrateTool.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/orchestrator/ralphLoop.d.ts +0 -57
  32. package/dist/orchestrator/ralphLoop.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAwRR"}
1
+ {"version":3,"file":"orchestratorAgent.d.ts","sourceRoot":"","sources":["../../src/opencodeArtifacts/orchestratorAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iCAAiC,CAAC;AAInE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAmTR"}
@@ -106,6 +106,25 @@ export type CoordinatorDeps = {
106
106
  * the exact pre-#217 single-pool behaviour when it is absent.
107
107
  */
108
108
  reportedModelSlots?: (runtimeId: LocalRuntimeId) => Readonly<Record<string, number>> | undefined;
109
+ /**
110
+ * Report reader for the per-node done-signal (unify dispatch paths). Injected
111
+ * I/O port — reading the report file is filesystem access, so it lives at the
112
+ * composition root, not here. Given a resolved report path it returns the
113
+ * file's text, or `undefined` on any error (missing/unreadable). The
114
+ * coordinator parses only a bounded status token from the text
115
+ * (`parseReportStatus`); the report BODY never crosses `assertReferenceOnly`.
116
+ *
117
+ * REQUIRED, not optional. Iteration is governed by the configured bound
118
+ * (`orchestrator.maxRetries`), NOT by whether this port happens to be wired:
119
+ * `maxRetries: 0` means one pass, any higher value re-dispatches a node until
120
+ * it declares `openteam-status: done` or its pass budget is exhausted. Making
121
+ * the port required means dropping the forwarding from the plugin boundary to
122
+ * the coordinator is a COMPILE error, not a silent regression to never-iterate
123
+ * — mirroring the same guarantee `reportArtifactExists` already has. The port
124
+ * is read only when the budget permits a re-dispatch, so a single-pass node
125
+ * never calls it.
126
+ */
127
+ readReportArtifact: (reportPath: string) => Promise<string | undefined>;
109
128
  };
110
129
  export type CorrelatedCostRecord = CostRecord & {
111
130
  decisionID: string;
@@ -120,6 +139,13 @@ export type RoleTaskResult = {
120
139
  decision: RoutingDecision;
121
140
  subsession: SubsessionResult;
122
141
  record: CorrelatedCostRecord;
142
+ /**
143
+ * Reference-only path the role was instructed to write its findings to
144
+ * (`composeSubsessionPrompt`). A plain string path — never content — so it
145
+ * survives `assertReferenceOnly` when projected to the coordinator. The
146
+ * coordinator reads this file to synthesise the actual findings for the user.
147
+ */
148
+ reportPath: string;
123
149
  };
124
150
  /**
125
151
  * Emits an observable warning the first time an unknown worker roleID is
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAEf,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,O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AAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B,aAAa,EAAE,EAAE,CA2BnB;AAqFD,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,eAAe,CAAC,CAoE1B"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * **Per-node iteration primitives** — the pure, deterministic helpers that bound
3
+ * how many times an orchestrated graph node may run before it must declare
4
+ * itself done.
5
+ *
6
+ * ## Why this exists (unify the two dispatch paths)
7
+ * openteam used to have two dispatch paths: `openteam-orchestrate` ran each
8
+ * graph node exactly once, while a separate `runRalphLoop` engine implemented
9
+ * iterate-until-done for a single hardcoded `ralph` role on its own entry point.
10
+ * Iteration is now a property of the graph itself: every node runs through the
11
+ * one orchestrate path and keeps working until it declares completion (via the
12
+ * output contract's status token) or this bound is hit. These helpers carry the
13
+ * arithmetic so the bound's meaning is unambiguous to a reader and testable in
14
+ * isolation.
15
+ *
16
+ * Pure: no I/O, clock, randomness, or env access. The retry budget is derived
17
+ * from injected config, never read from the environment here.
18
+ */
19
+ /**
20
+ * Default number of RETRIES per node when the orchestrator config does not pin
21
+ * one. A retry is an ADDITIONAL pass after the initial attempt, so the default
22
+ * of 2 means **three total passes** per node (one initial + two retries). Kept
23
+ * as the single source of truth for both the config schema default and the
24
+ * runtime fallback so the two can never drift.
25
+ */
26
+ export declare const DEFAULT_MAX_RETRIES = 2;
27
+ /**
28
+ * Total passes a node may run, from its retry budget. Pure.
29
+ *
30
+ * `maxRetries` counts RETRIES (additional passes after the first), so the pass
31
+ * budget is `1 + maxRetries`: `maxRetries = 2` → 3 passes, `maxRetries = 0` → a
32
+ * single pass (iteration effectively disabled). When `maxRetries` is undefined
33
+ * (no orchestrator config), {@link DEFAULT_MAX_RETRIES} applies.
34
+ */
35
+ export declare function nodePassBudget(maxRetries: number | undefined): number;
36
+ //# sourceMappingURL=nodeIteration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeIteration.d.ts","sourceRoot":"","sources":["../../src/orchestrator/nodeIteration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAErE"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * **Subsession output contract** — the deterministic instruction appended to
3
+ * every orchestrated role's prompt, plus the reference-only report path that
4
+ * carries a role's findings back to the coordinator.
5
+ *
6
+ * ## Why this exists (GE — orchestrate findings are discarded)
7
+ * `openteam-orchestrate` spawns a real subsession, the role does real work, and
8
+ * the subsession succeeds — but the coordinator only ever receives a
9
+ * reference-only `RoleResultSummary` (roleID, model, success, sessionID). The
10
+ * role's actual output never leaves its session, so a coordinator with nothing
11
+ * to report was observed inventing an `in_progress` narrative for work that had
12
+ * already finished. This module closes that gap **without** weakening the
13
+ * privacy boundary: the role is told to persist its findings to a file, and the
14
+ * coordinator is handed the file **path** — a reference, never content. The
15
+ * path passes `assertReferenceOnly` because it is a plain string on a
16
+ * non-forbidden key.
17
+ *
18
+ * Pure: no I/O, clock, randomness, or env access. The batch identifier is
19
+ * injected by the caller (`runRoleTasks` derives it from `deps.newDecisionID`),
20
+ * never generated here, so composition stays deterministic and unit-testable.
21
+ */
22
+ /**
23
+ * Machine-local root (repo-relative) for per-batch role report artifacts.
24
+ *
25
+ * Lives under `.opencode/openteam-local/` — the P15b machine-local, git-ignored
26
+ * side of the portability boundary — **by deliberate decision**, not accident.
27
+ * A role report is per-run runtime output (keyed by an ephemeral batch id), not
28
+ * portable team-state, so it belongs where telemetry and session logs live.
29
+ * `.opencode/.gitignore`'s `openteam-local/` rule ignores this whole directory,
30
+ * so reports never appear in `git status` and never get committed; the user can
31
+ * still open them locally. Placing them under the tracked `.opencode/openteam/`
32
+ * directory instead would leak an unbounded stream of per-batch files into the
33
+ * repository.
34
+ */
35
+ export declare const ROLE_REPORTS_ROOT = ".opencode/openteam-local/reports";
36
+ /**
37
+ * Bounded completion status a role declares in its report artifact, parsed by
38
+ * code from a fixed vocabulary. This — not a free-text `DONE` substring match —
39
+ * is the done-signal that ends per-node iteration. `"unknown"` covers an absent
40
+ * or unparseable declaration and is deliberately NOT `"done"`: a node that
41
+ * cannot prove completion must be assumed to have more work, never assumed
42
+ * finished.
43
+ *
44
+ * Only this small enum ever influences control flow. The report BODY is never
45
+ * carried across the `assertReferenceOnly` boundary — reading a bounded status
46
+ * token from a file is not a content leak.
47
+ */
48
+ export type ReportStatus = "done" | "continue" | "unknown";
49
+ /**
50
+ * The exact marker a role writes to declare its status, e.g.
51
+ * `openteam-status: done`. A specific, unambiguous token (unlike a bare `DONE`
52
+ * substring, which matched incidental prose such as "not done yet") so the
53
+ * parse is deterministic and cannot be tripped by ordinary report content.
54
+ */
55
+ export declare const REPORT_STATUS_MARKER = "openteam-status";
56
+ /**
57
+ * Parses the bounded completion status from a role's report text. Pure.
58
+ *
59
+ * The LAST declaration wins: a role updates its report across iterations, so its
60
+ * final `openteam-status:` line is authoritative. An absent, empty, or
61
+ * unrecognised declaration returns `"unknown"` — treated by the caller as
62
+ * not-done, never as done.
63
+ */
64
+ export declare function parseReportStatus(text: string | undefined): ReportStatus;
65
+ /**
66
+ * Deterministic, per-role report artifact path within a batch. Pure.
67
+ *
68
+ * Shape: `<ROLE_REPORTS_ROOT>/<batchID>/<roleID>.md`. Same inputs always
69
+ * produce the same path, so the coordinator can predict where each role writes.
70
+ */
71
+ export declare function roleReportPath(batchID: string, roleID: string): string;
72
+ /** Result of composing a role's base prompt with its output contract. */
73
+ export type SubsessionPromptComposition = {
74
+ /** Base prompt with the standing output contract appended. */
75
+ readonly prompt: string;
76
+ /** Reference-only path the role is instructed to write its findings to. */
77
+ readonly reportPath: string;
78
+ };
79
+ /**
80
+ * Appends the standing output contract to a role's base prompt and returns the
81
+ * augmented prompt together with the report path the role is told to write.
82
+ *
83
+ * Pure and deterministic: `batchID` is injected by the caller, never generated
84
+ * here. Reference-only: it emits a file path, never content.
85
+ */
86
+ export declare function composeSubsessionPrompt(input: {
87
+ readonly prompt: string;
88
+ readonly roleID: string;
89
+ readonly batchID: string;
90
+ }): SubsessionPromptComposition;
91
+ //# sourceMappingURL=outputContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputContract.d.ts","sourceRoot":"","sources":["../../src/orchestrator/outputContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAItD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAUxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,yEAAyE;AACzE,MAAM,MAAM,2BAA2B,GAAG;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAwCF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,GAAG,2BAA2B,CAM9B"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * **Report artifact probe** — the concrete filesystem adapter behind the
3
+ * `ReportArtifactProbe` port consumed by the durability gate
4
+ * (`reportDurability.ts`).
5
+ *
6
+ * ## Why this is its own named, exported unit
7
+ * The durability gate is the entire point of the orchestrate durability work:
8
+ * it downgrades a subsession that reported success but wrote no usable report.
9
+ * That guarantee is only as strong as the real probe wired at the composition
10
+ * root. When the probe lived inline in `src/index.ts` it was never driven by
11
+ * any test — every test injects a fake port — so the adapter could be mutated
12
+ * to fail permanently open (`return true`: every role reported durable, no
13
+ * report ever required) and the whole suite stayed green. This is exactly the
14
+ * failure shape this repo has been bitten by before: a green suite over a
15
+ * composition root whose real adapter is never exercised.
16
+ *
17
+ * Extracting it here makes it a separately-testable unit driven against the
18
+ * REAL filesystem (a genuinely missing path, an empty file, a non-empty file,
19
+ * and a directory), so breaking its predicate now fails a named test. Testing
20
+ * it against a mocked `fs` would recreate the same hole one layer up, so the
21
+ * unit calls `node:fs/promises` directly rather than injecting `stat`.
22
+ *
23
+ * ## Fail-safe
24
+ * The probe never throws: any error (a missing path raises `ENOENT`, a
25
+ * permission error, etc.) resolves to `false`. Durability is only ever asserted
26
+ * on positive evidence — a file that exists AND is non-empty. It is handed a
27
+ * path and returns a boolean; no content ever crosses the `assertReferenceOnly`
28
+ * privacy boundary.
29
+ */
30
+ import type { ReportArtifactProbe } from "./reportDurability";
31
+ /**
32
+ * Real filesystem implementation of {@link ReportArtifactProbe}. Resolves
33
+ * `true` iff `reportPath` names a regular file that exists AND is non-empty;
34
+ * resolves `false` otherwise, including for a missing path, an empty file, a
35
+ * directory (`isFile()` is what excludes it), or any thrown filesystem error.
36
+ * Wired at the composition root (`src/index.ts`); every other layer consumes
37
+ * the injected port.
38
+ */
39
+ export declare const reportArtifactExists: ReportArtifactProbe;
40
+ //# sourceMappingURL=reportArtifactProbe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportArtifactProbe.d.ts","sourceRoot":"","sources":["../../src/orchestrator/reportArtifactProbe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,mBAOlC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * **Report artifact reader** — the concrete filesystem adapter behind the report
3
+ * READER port consumed by per-node iterate-until-done in the coordinator
4
+ * (`coordinator.ts`) and injected as `readReportArtifact` on `OrchestrateDeps`.
5
+ *
6
+ * ## Why this is its own named, exported unit
7
+ * The done-signal that ends per-node iteration is a bounded status token the
8
+ * role writes into its report artifact; the coordinator must READ that file to
9
+ * parse the token. Reading a file is I/O, so it cannot live in the pure
10
+ * `router/` or coordinator logic — it is an injected port. Extracting the real
11
+ * adapter here (rather than inlining it at the composition root) keeps
12
+ * `src/index.ts` as wiring and makes the adapter a separately-testable unit
13
+ * driven against the REAL filesystem. That matters for the same reason the
14
+ * existence probe (`reportArtifactProbe.ts`) was extracted: an adapter that no
15
+ * test drives can be mutated to misbehave while the suite stays green. Testing
16
+ * it against a mocked `fs` would recreate that hole one layer up, so the unit
17
+ * calls `node:fs/promises` directly.
18
+ *
19
+ * ## Fail-safe
20
+ * The reader never throws: any error (a missing path raises `ENOENT`, a
21
+ * permission error, a path that is a directory, etc.) resolves to `undefined`.
22
+ * `undefined` is treated by the caller as "no proof of completion", so a node
23
+ * whose report cannot be read is retried rather than assumed done — the failure
24
+ * mode is safe. It returns the file text so the caller can parse a bounded
25
+ * status token from it; the report BODY is reduced to a small enum before it can
26
+ * influence control flow and never crosses the `assertReferenceOnly` boundary.
27
+ */
28
+ /**
29
+ * Real filesystem implementation of the report reader port. Resolves the UTF-8
30
+ * text of the file at `reportPath`, or `undefined` on any error (a missing
31
+ * path, a directory, a permission error, or any thrown filesystem error).
32
+ * Wired at the composition root (`src/index.ts`); every other layer consumes the
33
+ * injected port.
34
+ */
35
+ export declare const readReportArtifact: (reportPath: string) => Promise<string | undefined>;
36
+ //# sourceMappingURL=reportArtifactReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportArtifactReader.d.ts","sourceRoot":"","sources":["../../src/orchestrator/reportArtifactReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,eACjB,MAAM,KACjB,OAAO,CAAC,MAAM,GAAG,SAAS,CAM5B,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * **Report durability gate** — the deterministic, code-enforced check that a
3
+ * dispatched role actually persisted its findings, downgrading a subsession
4
+ * that reported success but wrote no usable report to a bounded failure.
5
+ *
6
+ * ## Why this exists (GE — orchestrate findings are discarded)
7
+ * The output contract (`outputContract.ts`) *instructs* each role to write its
8
+ * findings to a report file, but an instruction in a prompt is a request, not a
9
+ * guarantee: a model can ignore it and still return `success: true`. That
10
+ * silently re-opens the exact defect — work discarded, reported as success. A
11
+ * prompt cannot fix a prompt; only code can. This module verifies durability in
12
+ * code via an injected filesystem probe.
13
+ *
14
+ * ## Reusable across every dispatch pass — by deliberate decision
15
+ * Iteration is now a property of the orchestration graph: every graph node runs
16
+ * through the single `openteam-orchestrate` path and may be dispatched several
17
+ * times until it declares itself done or its retry bound is hit (see
18
+ * `nodeIteration.ts`). The gate lives HERE, in the orchestrator layer, as a
19
+ * small separately-testable unit — NOT welded into the `openteam-orchestrate`
20
+ * tool handler — so every dispatch pass consumes it and none can silently
21
+ * discard work. (The former standalone Ralph loop entry points — the `openteam
22
+ * loop` CLI command and the `openteam-loop` tool — were retired when the two
23
+ * dispatch paths were unified.)
24
+ *
25
+ * ## Purity / boundaries
26
+ * The gate does no I/O itself: the filesystem existence probe is an injected
27
+ * port (`ReportArtifactProbe`), exactly like every other I/O boundary in this
28
+ * codebase. It is handed a path and returns a boolean — no content ever crosses
29
+ * the `assertReferenceOnly` privacy boundary. Path resolution
30
+ * (`resolveReportProbePath`) is a pure string join.
31
+ */
32
+ import type { RoleTaskResult } from "./coordinator";
33
+ /**
34
+ * Bounded, content-free failure reason recorded when a role's subsession
35
+ * reported success but the promised report artifact was not durably written
36
+ * (absent or empty). A fixed machine-readable literal — never free text, never
37
+ * content — so any consumer can branch on it deterministically.
38
+ */
39
+ export declare const REPORT_NOT_DURABLE_REASON = "report-missing-or-empty";
40
+ /**
41
+ * Injected durability probe. Resolves `true` iff `reportPath` names a file that
42
+ * exists AND is non-empty, and `false` otherwise (including any error). The
43
+ * concrete adapter lives at the composition root (`stat` → `isFile() && size >
44
+ * 0`); the gate only consumes this port. Reference-only: it is handed a path
45
+ * and returns a boolean, never content.
46
+ */
47
+ export type ReportArtifactProbe = (reportPath: string) => Promise<boolean>;
48
+ /**
49
+ * Resolves the on-disk path to probe for a role's report. The report path is
50
+ * relative to the working directory the subsession ran under; when a dispatch
51
+ * supplies a `directory` override, the probe must look there, not at the
52
+ * process cwd. Pure string join — no I/O — so it is shared by every dispatch
53
+ * path instead of each re-deriving (and subtly diverging on) the join.
54
+ */
55
+ export declare function resolveReportProbePath(baseDirectory: string | undefined, reportPath: string): string;
56
+ /**
57
+ * Deterministic durability gate, reusable by ANY dispatch path. For every role
58
+ * whose subsession reported success, it verifies IN CODE — via the injected
59
+ * `probe` — that the promised report artifact exists and is non-empty. A
60
+ * success with no usable report is downgraded to a bounded failure
61
+ * (`success: false`, `failureStage: "report"`,
62
+ * `failureReason: REPORT_NOT_DURABLE_REASON`) so discarded work can never be
63
+ * surfaced to a coordinator as a plain success. Failed subsessions are passed
64
+ * through untouched (there is nothing to preserve).
65
+ *
66
+ * Reference-only: the probe is handed a path and returns a boolean; no content
67
+ * crosses the `assertReferenceOnly` boundary.
68
+ */
69
+ export declare function applyReportDurabilityGate(results: readonly RoleTaskResult[], probe: ReportArtifactProbe): Promise<RoleTaskResult[]>;
70
+ //# sourceMappingURL=reportDurability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportDurability.d.ts","sourceRoot":"","sources":["../../src/orchestrator/reportDurability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE3E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GACjB,MAAM,CAIR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC,CAiB3B"}
@@ -53,7 +53,7 @@ export type SubsessionResult = {
53
53
  model: ModelSelection;
54
54
  response?: unknown;
55
55
  failureReason?: string;
56
- failureStage?: "create" | "prompt";
56
+ failureStage?: "create" | "prompt" | "report";
57
57
  };
58
58
  export type SubsessionDeps = {
59
59
  timeoutMs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"subsessions.d.ts","sourceRoot":"","sources":["../../src/orchestrator/subsessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,CAAC,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,CAAC,EAAE;QACN,SAAS,CAAC,EAAE,MAAM,CAAC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EAAE,EAAE,MAAM,CAAA;aAAE,CAAC;YAAC,KAAK,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC,CAAC;QACzD,MAAM,EAAE,CACN,IAAI,EAAE,yBAAyB,KAC5B,OAAO,CAAC;YAAE,IAAI,CAAC,EAAE,OAAO,CAAC;YAAC,KAAK,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC,CAAC;KACnD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAiQF,wBAAsB,aAAa,CACjC,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,iBAAiB,EACtB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAuE3B"}
@@ -5,6 +5,7 @@ import type { GraphEventV1, GraphSpecV1 } from "../graph/schema";
5
5
  import type { RuntimeConcurrencyLimiter } from "../local/concurrency";
6
6
  import type { LocalRuntimeId } from "../local/types";
7
7
  import { type CoordinatorDeps, type RoleTaskResult } from "../orchestrator/coordinator";
8
+ import { type ReportArtifactProbe } from "../orchestrator/reportDurability";
8
9
  import type { OpencodeSessionClient } from "../orchestrator/subsessions";
9
10
  import type { GraphJournal } from "../storage/graph/provider";
10
11
  import type { EventSink } from "../telemetry/eventLog";
@@ -52,7 +53,14 @@ export type RoleResultSummary = {
52
53
  };
53
54
  success: boolean;
54
55
  sessionID?: string;
55
- failureStage?: "create" | "prompt";
56
+ /**
57
+ * Reference-only path the role was instructed to write its findings to. A
58
+ * plain string path (never content), so it survives `assertReferenceOnly`.
59
+ * The coordinator READS this file to synthesise the actual findings; the
60
+ * `reportPath` key is intentionally NOT in `FORBIDDEN_RAW_KEYS`.
61
+ */
62
+ reportPath?: string;
63
+ failureStage?: "create" | "prompt" | "report";
56
64
  failureReason?: string;
57
65
  };
58
66
  export type OrchestrateResult = {
@@ -196,6 +204,38 @@ export type OrchestrateDeps = {
196
204
  * must never throw.
197
205
  */
198
206
  readonly rosterRoleIDs: () => Promise<ReadonlySet<string>>;
207
+ /**
208
+ * Durability probe (#report-durability). A REQUIRED injected I/O port that
209
+ * answers, in code, whether a role's promised report artifact was actually
210
+ * written: it resolves `true` iff the given path names a file that exists AND
211
+ * is non-empty, and `false` otherwise (including any error). The tool applies
212
+ * it as a deterministic gate after each subsession finishes so a role that
213
+ * succeeded but wrote no findings is downgraded to a bounded failure instead
214
+ * of being reported to the coordinator as a plain success — closing the
215
+ * "work silently discarded" hole a prompt instruction alone cannot. Reference
216
+ * only: it is handed a path and returns a boolean; it never reads content
217
+ * across the `assertReferenceOnly` boundary. Required (not optional) so that
218
+ * dropping the composition-root wiring is a compile error rather than a silent
219
+ * fail-open that would re-open the exact defect this gate exists to close. The
220
+ * adapter MUST be fail-safe: on a missing/unreadable path it returns `false`
221
+ * and must never throw. Typed as the shared `ReportArtifactProbe` so the gate
222
+ * unit and every dispatch path that reuses it agree on one port shape.
223
+ */
224
+ readonly reportArtifactExists: ReportArtifactProbe;
225
+ /**
226
+ * Report READER for the per-node iterate-until-done done-signal (unify
227
+ * dispatch paths). Given a resolved report path it resolves the file's text,
228
+ * or `undefined` on any error (missing/unreadable). The coordinator reduces
229
+ * that text to a bounded status token (`parseReportStatus`) to decide whether
230
+ * a node has declared itself done; the report BODY never crosses the
231
+ * `assertReferenceOnly` boundary — this port returns text that is collapsed to
232
+ * a small enum before it can influence control flow. Required (not optional),
233
+ * mirroring `reportArtifactExists`, so dropping the composition-root wiring is
234
+ * a compile error rather than a silent regression to never-iterate. The
235
+ * adapter MUST be fail-safe: on a missing/unreadable path it returns
236
+ * `undefined` and must never throw.
237
+ */
238
+ readonly readReportArtifact: (reportPath: string) => Promise<string | undefined>;
199
239
  };
200
240
  /**
201
241
  * Builds a `GraphSpecV1` from orchestrate payload assignments. Each assignment
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateTool.d.ts","sourceRoot":"","sources":["../../src/plugin/orchestrateTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,KAAK,EAEV,YAAY,EACZ,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,KAAK,eAAe,EAIpB,KAAK,cAAc,EAGpB,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;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vB,uBAAuB,GACvB,wBAAwB,GACxB,sBAAsB,GACtB,+BAA+B,GAC/B,oBAAoB,GACpB,SAAS,CAAC;AAEd;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GACrC,0BAA0B,CAK5B;AAQD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,oBAAoB,GAC3B,0BAA0B,GAAG,SAAS,CAaxC;AAED,yEAAyE;AACzE,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GACrB;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAA;CAAE,CAAC;AA+H9E;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CASlE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAezE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,kBAAkB,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,EAAE,EACjE,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,MAAM,EAAE,CAiBV;AAqBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,cAAc,CAmJ3E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmanuelcorral/openteam",
3
- "version": "0.17.6",
3
+ "version": "0.18.0",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
6
6
  "license": "MIT",
@@ -1,57 +0,0 @@
1
- import type { OpenTeamConfig } from "../config/schema";
2
- import type { RoutingDecision, TaskSignals } from "../router/types";
3
- import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
4
- /**
5
- * W3 ralph loop (#174).
6
- *
7
- * Makes the guaranteed `ralph` role a real behaviour rather than an unreachable
8
- * profile: a bounded iterate-until-done cycle. Each pass dispatches the `ralph`
9
- * role through the real coordinator ({@link runRoleTask}), so the loop inherits
10
- * two guarantees for free — the mandatory-local gate (#143), which refuses to run
11
- * BEFORE the first iteration when no local runtime is reachable and never falls
12
- * through to a frontier provider, and local-first routing, which keeps every
13
- * iteration on a local runtime.
14
- *
15
- * This module is only loop CONTROL: model/runtime work is the injected coordinator
16
- * deps, and the done-signal is an injected predicate. Deterministic given its
17
- * ports — no clock, randomness or direct I/O.
18
- */
19
- /** Canonical roleID of the guaranteed ralph role. */
20
- export declare const RALPH_ROLE_ID = "ralph";
21
- /** Default iteration cap so the loop can never spin unbounded. */
22
- export declare const DEFAULT_RALPH_MAX_ITERATIONS = 10;
23
- export type RalphLoopInput = {
24
- readonly task: TaskSignals;
25
- readonly prompt: string;
26
- readonly config: OpenTeamConfig;
27
- readonly parentSessionID?: string;
28
- /** Iteration cap; defaults to {@link DEFAULT_RALPH_MAX_ITERATIONS}. */
29
- readonly maxIterations?: number;
30
- };
31
- /** Why the loop stopped: the done-signal fired, or the iteration cap was hit. */
32
- export type RalphLoopTermination = "done" | "cap";
33
- export type RalphLoopResult = {
34
- readonly iterations: number;
35
- readonly termination: RalphLoopTermination;
36
- readonly decision: RoutingDecision | undefined;
37
- readonly results: readonly RoleTaskResult[];
38
- };
39
- export type RalphLoopDeps = CoordinatorDeps & {
40
- /**
41
- * The done-signal predicate (#174). Reads the iteration's subsession result and
42
- * decides whether the task is finished. Injected so the "fake runtime" that
43
- * reports done/not-done stays outside the loop control under test.
44
- */
45
- readonly isDone: (result: RoleTaskResult) => boolean;
46
- };
47
- /**
48
- * Runs the ralph loop (#174): dispatches the `ralph` role repeatedly until the
49
- * injected done-signal fires or the iteration cap is reached.
50
- *
51
- * On the first pass, {@link runRoleTask} enforces the mandatory-local gate: when
52
- * no local runtime is reachable it throws before any dispatch, so the loop fails
53
- * before the first iteration and no model is contacted — the caller sees the
54
- * thrown, actionable error.
55
- */
56
- export declare function runRalphLoop(input: RalphLoopInput, deps: RalphLoopDeps): Promise<RalphLoopResult>;
57
- //# sourceMappingURL=ralphLoop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ralphLoop.d.ts","sourceRoot":"","sources":["../../src/orchestrator/ralphLoop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;GAcG;AAEH,qDAAqD;AACrD,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC,kEAAkE;AAClE,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,KAAK,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,QA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