wicked-crew 0.7.1 → 0.7.3

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 (56) hide show
  1. package/dist/api/delivery-index.d.ts +61 -0
  2. package/dist/api/delivery-index.d.ts.map +1 -0
  3. package/dist/api/delivery-index.js +87 -0
  4. package/dist/api/delivery-index.js.map +1 -0
  5. package/dist/api/governance-steering.d.ts +139 -0
  6. package/dist/api/governance-steering.d.ts.map +1 -0
  7. package/dist/api/governance-steering.js +302 -0
  8. package/dist/api/governance-steering.js.map +1 -0
  9. package/dist/api/governance-wiki.d.ts +28 -0
  10. package/dist/api/governance-wiki.d.ts.map +1 -0
  11. package/dist/api/governance-wiki.js +97 -0
  12. package/dist/api/governance-wiki.js.map +1 -0
  13. package/dist/api/routes.d.ts +21 -16
  14. package/dist/api/routes.d.ts.map +1 -1
  15. package/dist/api/routes.js +196 -10
  16. package/dist/api/routes.js.map +1 -1
  17. package/dist/api/server.d.ts.map +1 -1
  18. package/dist/api/server.js +56 -1
  19. package/dist/api/server.js.map +1 -1
  20. package/dist/api/testing.d.ts +117 -0
  21. package/dist/api/testing.d.ts.map +1 -0
  22. package/dist/api/testing.js +152 -0
  23. package/dist/api/testing.js.map +1 -0
  24. package/dist/campaign/supervision.d.ts +296 -0
  25. package/dist/campaign/supervision.d.ts.map +1 -0
  26. package/dist/campaign/supervision.js +515 -0
  27. package/dist/campaign/supervision.js.map +1 -0
  28. package/dist/campaigns/plan.d.ts +64 -0
  29. package/dist/campaigns/plan.d.ts.map +1 -0
  30. package/dist/campaigns/plan.js +201 -0
  31. package/dist/campaigns/plan.js.map +1 -0
  32. package/dist/campaigns/routes.d.ts +28 -0
  33. package/dist/campaigns/routes.d.ts.map +1 -0
  34. package/dist/campaigns/routes.js +177 -0
  35. package/dist/campaigns/routes.js.map +1 -0
  36. package/dist/core/adapter.d.ts +160 -1
  37. package/dist/core/adapter.d.ts.map +1 -1
  38. package/dist/core/adapter.js +300 -1
  39. package/dist/core/adapter.js.map +1 -1
  40. package/dist/projects/routes.d.ts +4 -4
  41. package/dist/qe/acceptance.d.ts +20 -1
  42. package/dist/qe/acceptance.d.ts.map +1 -1
  43. package/dist/qe/acceptance.js +32 -0
  44. package/dist/qe/acceptance.js.map +1 -1
  45. package/dist/qe/conformance.d.ts +158 -0
  46. package/dist/qe/conformance.d.ts.map +1 -0
  47. package/dist/qe/conformance.js +244 -0
  48. package/dist/qe/conformance.js.map +1 -0
  49. package/dist/studio/assets/index-BAW9rqNT.css +32 -0
  50. package/dist/studio/assets/index-UahdRwF7.js +532 -0
  51. package/dist/studio/index.html +2 -2
  52. package/dist/studio/testid-inventory.json +4387 -0
  53. package/endpoint-manifest.json +154 -9
  54. package/package.json +3 -3
  55. package/dist/studio/assets/index-D-BFUYnY.js +0 -530
  56. package/dist/studio/assets/index-D6S9zUtO.css +0 -32
@@ -0,0 +1,117 @@
1
+ /**
2
+ * The `/api/v1/testing/*` surface (crew-testing) — the wire behind the studio's Testing page:
3
+ * RUN the governance evals (does the steering corpus actually catch the behaviors it claims
4
+ * to?) and IMPORT a named eval corpus for later runs.
5
+ *
6
+ * Thin by design, like `governance-steering.ts`: validation is zod (strict, unknown keys named —
7
+ * the FINDING-031 doctrine); the evals themselves are the ENGINE's (`governanceEvals` pushes
8
+ * every sample through the same decide path enforcement runs, over a read-only connection to
9
+ * the steering store — the daemon computes no verdict of its own), and the report is the
10
+ * engine's serde output passed through VERBATIM (snake_case field names — the pinned crew/studio
11
+ * wire contract; the steering wave shipped a drift because each side guessed, so neither side
12
+ * reshapes it). Corpus import writes through the engine's knowledge seam under the
13
+ * `evals:<name>` scope — the daemon never opens a store itself.
14
+ *
15
+ * Error posture mirrors the steering surface: a build whose engine addon predates the evals
16
+ * bindings answers 501 (`GovernanceEvalsUnsupportedError` — "upgrade the engine"; wicked-core-ts
17
+ * 0.7.5 carries them, 0.7.4 does not), never 400 ("fix your request") — and never a crash: this
18
+ * daemon must serve both routes honestly against the released 0.7.4 addon.
19
+ */
20
+ import type { FastifyInstance, FastifyRequest } from 'fastify';
21
+ import { z } from 'zod';
22
+ import { type CoreAdapter } from '../core/adapter.js';
23
+ import type { Actor } from '../core/types.js';
24
+ import type { AuditLog } from './audit.js';
25
+ export declare const RunGovernanceEvalsSchema: z.ZodObject<{
26
+ type: z.ZodOptional<z.ZodEnum<["architecture", "development", "security", "testing", "operations", "compliance", "design-ux"]>>;
27
+ corpus: z.ZodOptional<z.ZodString>;
28
+ }, "strict", z.ZodTypeAny, {
29
+ type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
30
+ corpus?: string | undefined;
31
+ }, {
32
+ type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
33
+ corpus?: string | undefined;
34
+ }>;
35
+ export declare const ImportEvalCorpusSchema: z.ZodObject<{
36
+ name: z.ZodString;
37
+ samples: z.ZodArray<z.ZodObject<{
38
+ id: z.ZodString;
39
+ description: z.ZodString;
40
+ kind: z.ZodEnum<["good", "bad"]>;
41
+ steering_type: z.ZodString;
42
+ signals: z.ZodObject<{
43
+ phase: z.ZodOptional<z.ZodString>;
44
+ tool: z.ZodOptional<z.ZodString>;
45
+ files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
+ content: z.ZodOptional<z.ZodString>;
47
+ }, "strict", z.ZodTypeAny, {
48
+ content?: string | undefined;
49
+ tool?: string | undefined;
50
+ phase?: string | undefined;
51
+ files?: string[] | undefined;
52
+ }, {
53
+ content?: string | undefined;
54
+ tool?: string | undefined;
55
+ phase?: string | undefined;
56
+ files?: string[] | undefined;
57
+ }>;
58
+ }, "strict", z.ZodTypeAny, {
59
+ id: string;
60
+ kind: "good" | "bad";
61
+ description: string;
62
+ steering_type: string;
63
+ signals: {
64
+ content?: string | undefined;
65
+ tool?: string | undefined;
66
+ phase?: string | undefined;
67
+ files?: string[] | undefined;
68
+ };
69
+ }, {
70
+ id: string;
71
+ kind: "good" | "bad";
72
+ description: string;
73
+ steering_type: string;
74
+ signals: {
75
+ content?: string | undefined;
76
+ tool?: string | undefined;
77
+ phase?: string | undefined;
78
+ files?: string[] | undefined;
79
+ };
80
+ }>, "many">;
81
+ }, "strict", z.ZodTypeAny, {
82
+ name: string;
83
+ samples: {
84
+ id: string;
85
+ kind: "good" | "bad";
86
+ description: string;
87
+ steering_type: string;
88
+ signals: {
89
+ content?: string | undefined;
90
+ tool?: string | undefined;
91
+ phase?: string | undefined;
92
+ files?: string[] | undefined;
93
+ };
94
+ }[];
95
+ }, {
96
+ name: string;
97
+ samples: {
98
+ id: string;
99
+ kind: "good" | "bad";
100
+ description: string;
101
+ steering_type: string;
102
+ signals: {
103
+ content?: string | undefined;
104
+ tool?: string | undefined;
105
+ phase?: string | undefined;
106
+ files?: string[] | undefined;
107
+ };
108
+ }[];
109
+ }>;
110
+ export interface TestingRoutesDeps {
111
+ audit: AuditLog;
112
+ actorOf: (req: FastifyRequest & {
113
+ actor?: Actor;
114
+ }) => Actor;
115
+ }
116
+ export declare function registerTestingRoutes(app: FastifyInstance, adapter: CoreAdapter, deps: TestingRoutesDeps): void;
117
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/api/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmC,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,KAAK,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiD3C,eAAO,MAAM,wBAAwB;;;;;;;;;EAK1B,CAAC;AAEZ,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKxB,CAAC;AAEZ,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,KAAK,KAAK,CAAC;CAC7D;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,iBAAiB,GACtB,IAAI,CAyFN"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * The `/api/v1/testing/*` surface (crew-testing) — the wire behind the studio's Testing page:
3
+ * RUN the governance evals (does the steering corpus actually catch the behaviors it claims
4
+ * to?) and IMPORT a named eval corpus for later runs.
5
+ *
6
+ * Thin by design, like `governance-steering.ts`: validation is zod (strict, unknown keys named —
7
+ * the FINDING-031 doctrine); the evals themselves are the ENGINE's (`governanceEvals` pushes
8
+ * every sample through the same decide path enforcement runs, over a read-only connection to
9
+ * the steering store — the daemon computes no verdict of its own), and the report is the
10
+ * engine's serde output passed through VERBATIM (snake_case field names — the pinned crew/studio
11
+ * wire contract; the steering wave shipped a drift because each side guessed, so neither side
12
+ * reshapes it). Corpus import writes through the engine's knowledge seam under the
13
+ * `evals:<name>` scope — the daemon never opens a store itself.
14
+ *
15
+ * Error posture mirrors the steering surface: a build whose engine addon predates the evals
16
+ * bindings answers 501 (`GovernanceEvalsUnsupportedError` — "upgrade the engine"; wicked-core-ts
17
+ * 0.7.5 carries them, 0.7.4 does not), never 400 ("fix your request") — and never a crash: this
18
+ * daemon must serve both routes honestly against the released 0.7.4 addon.
19
+ */
20
+ import { z } from 'zod';
21
+ import { GovernanceEvalsUnsupportedError } from '../core/adapter.js';
22
+ import { API_PREFIX } from './api-prefix.js';
23
+ import { STEERING_TYPE_VALUES } from './governance-steering.js';
24
+ const V = API_PREFIX;
25
+ function message(err) {
26
+ return err instanceof Error ? err.message : String(err);
27
+ }
28
+ /** Same unknown-key-naming 400 body builder as api/routes.ts (restated because that module does
29
+ * not export it and importing routes.ts here would be a cycle through registerRoutes). */
30
+ function invalidBody(err, what) {
31
+ const unknown = err.issues.flatMap((i) => (i.code === 'unrecognized_keys' ? i.keys : []));
32
+ const error = unknown.length > 0
33
+ ? `${what}: unknown field${unknown.length > 1 ? 's' : ''} ${unknown
34
+ .map((k) => `\`${k}\``)
35
+ .join(', ')} — this endpoint does not accept ${unknown.length > 1 ? 'them' : 'it'}, and ignoring ${unknown.length > 1 ? 'them' : 'it'} would run a different request than you sent`
36
+ : what;
37
+ return { error, details: err.issues };
38
+ }
39
+ // The sample shape is the PINNED wire contract (snake_case, the engine's serde spelling) —
40
+ // `steering_type` stays an open string on purpose: the engine validates it against ITS
41
+ // vocabulary, so engine-side validation stays the one spelling of what a type is (the steering
42
+ // import doctrine). The run body's `type` IS closed here, because it selects from the same
43
+ // 7-value facet the steering routes already export — one spelling, shared.
44
+ const EvalSignalsSchema = z
45
+ .object({
46
+ phase: z.string().optional(),
47
+ tool: z.string().optional(),
48
+ files: z.array(z.string()).optional(),
49
+ content: z.string().optional(),
50
+ })
51
+ .strict();
52
+ const EvalSampleSchema = z
53
+ .object({
54
+ id: z.string().min(1),
55
+ description: z.string().min(1),
56
+ kind: z.enum(['good', 'bad']),
57
+ steering_type: z.string().min(1),
58
+ signals: EvalSignalsSchema,
59
+ })
60
+ .strict();
61
+ export const RunGovernanceEvalsSchema = z
62
+ .object({
63
+ type: z.enum(STEERING_TYPE_VALUES).optional(),
64
+ corpus: z.string().min(1).optional(),
65
+ })
66
+ .strict();
67
+ export const ImportEvalCorpusSchema = z
68
+ .object({
69
+ name: z.string().min(1),
70
+ samples: z.array(EvalSampleSchema).min(1),
71
+ })
72
+ .strict();
73
+ export function registerTestingRoutes(app, adapter, deps) {
74
+ const { audit, actorOf } = deps;
75
+ // ── Run the governance evals (the Testing page's Run action) ─────────────────
76
+ // Both fields optional — `{}` (or no body at all) means "the built-in default corpus, every
77
+ // steering type". The 200 body is the engine's serde report passed through verbatim
78
+ // (snake_case; `degraded` is `null`, kept in-band, when the run was full-fidelity).
79
+ app.post(`${V}/testing/evals/run`, {
80
+ config: {
81
+ manifest: {
82
+ requestType: 'RunGovernanceEvalsBody',
83
+ responseType: 'GovernanceEvalReport',
84
+ // 501: the installed engine addon predates the evals bindings (wicked-core-ts < 0.7.5)
85
+ // — upgrade the engine, the request was already correct.
86
+ statusCodes: [200, 400, 500, 501],
87
+ },
88
+ },
89
+ }, async (req, reply) => {
90
+ // `?? {}`: a bodyless POST is a legal spelling of the all-defaults run.
91
+ const parsed = RunGovernanceEvalsSchema.safeParse(req.body ?? {});
92
+ if (!parsed.success) {
93
+ return reply.code(400).send(invalidBody(parsed.error, 'Invalid evals run body'));
94
+ }
95
+ try {
96
+ // Passed through verbatim — no reshaping on our side of the seam: the report IS the
97
+ // pinned contract, snake_case and all (`summary.false_positives`, `nearest_rules`).
98
+ // (Spread-rebuilt args: exactOptionalPropertyTypes — an absent key, never `undefined`.)
99
+ return await adapter.runGovernanceEvals({
100
+ ...(parsed.data.type !== undefined ? { type: parsed.data.type } : {}),
101
+ ...(parsed.data.corpus !== undefined ? { corpus: parsed.data.corpus } : {}),
102
+ });
103
+ }
104
+ catch (err) {
105
+ if (err instanceof GovernanceEvalsUnsupportedError) {
106
+ return reply.code(501).send({ error: err.message });
107
+ }
108
+ // An engine/store failure is OURS, not the caller's — the body already parsed, so
109
+ // nothing here maps to 400.
110
+ return reply.code(500).send({ error: message(err) });
111
+ }
112
+ });
113
+ // ── Import a named eval corpus (the Testing page's Import action) ────────────
114
+ // Samples land in the knowledge store under the `evals:<name>` scope — the string a later
115
+ // evals run names as `corpus`. Audited (a write), unlike the run above (compute over the
116
+ // existing stores — the wiki-scoreboard read posture).
117
+ app.post(`${V}/testing/corpora/import`, {
118
+ config: {
119
+ manifest: {
120
+ requestType: 'ImportEvalCorpusBody',
121
+ responseType: 'ImportEvalCorpusResponse',
122
+ // 501: same presence gate as the run route — the two bindings ship together, and
123
+ // importing a corpus no engine on this host can run would be a trap, not a feature.
124
+ statusCodes: [200, 400, 500, 501],
125
+ },
126
+ },
127
+ }, async (req, reply) => {
128
+ const parsed = ImportEvalCorpusSchema.safeParse(req.body);
129
+ if (!parsed.success) {
130
+ return reply.code(400).send(invalidBody(parsed.error, 'Invalid corpus import body'));
131
+ }
132
+ try {
133
+ const result = await adapter.importGovernanceCorpus(parsed.data.name, parsed.data.samples);
134
+ audit.record('testing.corpus.imported', actorOf(req), {
135
+ detail: {
136
+ name: parsed.data.name,
137
+ samples: parsed.data.samples.length,
138
+ scope: result.scope,
139
+ embedded: result.embedded,
140
+ },
141
+ });
142
+ return result;
143
+ }
144
+ catch (err) {
145
+ if (err instanceof GovernanceEvalsUnsupportedError) {
146
+ return reply.code(501).send({ error: err.message });
147
+ }
148
+ return reply.code(500).send({ error: message(err) });
149
+ }
150
+ });
151
+ }
152
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../src/api/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,+BAA+B,EAAoB,MAAM,oBAAoB,CAAC;AAGvF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,CAAC,GAAG,UAAU,CAAC;AAErB,SAAS,OAAO,CAAC,GAAY;IAC3B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;2FAC2F;AAC3F,SAAS,WAAW,CAAC,GAAe,EAAE,I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AAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,+BAA+B,EAAE,CAAC;gBACnD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,296 @@
1
+ /** Kill policy applied to IN-FLIGHT nodes when a campaign-level budget exhausts. */
2
+ export type CampaignKillPolicy = 'kill-running' | 'abandon-running';
3
+ /**
4
+ * The resolved budget policy a campaign runs under. All ceilings are explicit values —
5
+ * resolution (`resolveBudgetPolicy`) fails closed on malformed input rather than silently
6
+ * falling back, because a typo'd budget must never mean "unbounded".
7
+ */
8
+ export interface CampaignBudgetPolicy {
9
+ /** Campaign-level wall-clock budget, ms. Includes time spent waiting on humans. */
10
+ wallClockBudgetMs: number;
11
+ /** Per-node wall-clock timeout, ms, counted while the node is `running` only. */
12
+ nodeTimeoutMs: number;
13
+ /**
14
+ * The TH-8-style `WICKED_UNIT_TIMEOUT_SECS` pin every node environment must carry.
15
+ * An ambient value is HONORED (it is the pin); only when the environment says nothing
16
+ * does the campaign default apply. Unpinned means the engine's 2-hour default — the
17
+ * exact unbounded-spend hazard this module exists to close.
18
+ */
19
+ unitTimeoutSecs: number;
20
+ /** Nightly cap: hard ceiling on schedulable nodes per campaign (fail-closed preflight). */
21
+ maxNodes: number;
22
+ /** Optional campaign cost ceiling, USD. Absent ⇒ wall-clock stays the only hard ceiling. */
23
+ maxCostUsd?: number;
24
+ /** What happens to in-flight nodes at budget exhaustion. */
25
+ killPolicy: CampaignKillPolicy;
26
+ }
27
+ /** Campaign-proven pin (the 2026-08 studio E2E campaign ran `WICKED_UNIT_TIMEOUT_SECS=900`). */
28
+ export declare const DEFAULT_UNIT_TIMEOUT_SECS = 900;
29
+ /** Default per-node timeout: 30 min ≈ 4× the observed 7m41s governed feature run. */
30
+ export declare const DEFAULT_NODE_TIMEOUT_SECS = 1800;
31
+ /** Default campaign wall-clock budget: 4 h (a 21-node ladder ≈ 2.7 h serial at observed rate). */
32
+ export declare const DEFAULT_WALL_CLOCK_BUDGET_SECS = 14400;
33
+ /** Default nightly node cap (the proven ladder was 21 scenarios; 25 leaves headroom). */
34
+ export declare const DEFAULT_MAX_NODES = 25;
35
+ export declare const DEFAULT_KILL_POLICY: CampaignKillPolicy;
36
+ /** The env knobs `resolveBudgetPolicy` reads. All crew-side; documented in docs/campaign-budgets.md. */
37
+ export declare const ENV_BUDGET_SECS = "WICKED_CAMPAIGN_BUDGET_SECS";
38
+ export declare const ENV_NODE_TIMEOUT_SECS = "WICKED_CAMPAIGN_NODE_TIMEOUT_SECS";
39
+ export declare const ENV_UNIT_TIMEOUT_SECS = "WICKED_UNIT_TIMEOUT_SECS";
40
+ export declare const ENV_MAX_NODES = "WICKED_CAMPAIGN_MAX_NODES";
41
+ export declare const ENV_MAX_COST_USD = "WICKED_CAMPAIGN_MAX_COST_USD";
42
+ export declare const ENV_KILL_POLICY = "WICKED_CAMPAIGN_KILL_POLICY";
43
+ /**
44
+ * Resolve the budget policy from an environment (defaults ↦ documented ceilings; malformed
45
+ * values throw — fail closed, TH-8 posture). Pass `process.env` in the daemon; tests pass
46
+ * a literal.
47
+ */
48
+ export declare function resolveBudgetPolicy(env?: Record<string, string | undefined>): CampaignBudgetPolicy;
49
+ /**
50
+ * The TH-8-style environment pins every campaign node MUST launch with. Until the full
51
+ * TH-8 environment manifest lands, this is the manifest's budget block: the interim
52
+ * mitigation test-R22 names ("the environment manifest must pin WICKED_UNIT_TIMEOUT_SECS").
53
+ */
54
+ export declare function nodeEnvPins(policy: CampaignBudgetPolicy): Record<string, string>;
55
+ /**
56
+ * Fail-closed preflight: a node environment must carry the exact `WICKED_UNIT_TIMEOUT_SECS`
57
+ * pin the policy resolved. Missing ⇒ the engine's 2-hour default applies silently;
58
+ * mismatched ⇒ the manifest lies about the environment. Both refuse.
59
+ */
60
+ export declare function assertNodeEnvPinned(nodeEnv: Record<string, string | undefined>, policy: CampaignBudgetPolicy): void;
61
+ /**
62
+ * Nightly cap, fail-closed (test-R22 interim: "the nightly recipe must cap campaign size
63
+ * explicitly"). Called with the campaign's node count BEFORE launch; over-cap refuses with
64
+ * both numbers so the operator sees exactly what to trim or raise.
65
+ */
66
+ export declare function assertWithinNightlyCap(nodeCount: number, policy: CampaignBudgetPolicy): void;
67
+ /**
68
+ * The scheduler-facing phase vocabulary, deliberately COARSER than core's `NodeStatus`
69
+ * (DES-CAMPAIGN-001 §2): supervision needs to know spend posture, not scheduling detail.
70
+ * `pending` = never launched (Pending/Ready); `running` = consuming a worker slot
71
+ * (Running); `awaiting-human` = quiet by design, no slot (AwaitingHuman/ReadyToResume);
72
+ * `terminal` = Completed/Failed/Blocked/Cancelled.
73
+ */
74
+ export type SupervisedNodePhase = 'pending' | 'running' | 'awaiting-human' | 'terminal';
75
+ /** One node as the scheduler reports it to a sweep. */
76
+ export interface SchedulerNodeView {
77
+ nodeId: string;
78
+ phase: SupervisedNodePhase;
79
+ /** The node's live run id, when one was dispatched (core `node_run_id`). */
80
+ runId?: string;
81
+ }
82
+ /**
83
+ * The seam TH-9's campaign adapter implements (over core's `CancelRun` + the TS-bridge
84
+ * campaign state). Tests drive a fake. Every mutation carries the human-readable reason
85
+ * so the abort is visible AT THE SCHEDULER too, not only in supervision state.
86
+ */
87
+ export interface SupervisedScheduler {
88
+ /** The campaign's nodes, right now. Read per sweep, never cached. */
89
+ listNodes(campaignId: string): Promise<SchedulerNodeView[]>;
90
+ /** Abort one live node (⇒ core CancelRun on its run). */
91
+ cancelNode(campaignId: string, nodeId: string, runId: string | undefined, reason: string): Promise<void>;
92
+ /** Prevent a never-launched node from ever dispatching. */
93
+ excludeNode(campaignId: string, nodeId: string, reason: string): Promise<void>;
94
+ }
95
+ /** Why a node was excluded/aborted by supervision. */
96
+ export type ExclusionKind = 'campaign-budget' | 'cost-budget' | 'node-timeout';
97
+ /** The excluded-with-reason record — the AC's "never silent" is this object existing. */
98
+ export interface NodeExclusion {
99
+ kind: ExclusionKind;
100
+ reason: string;
101
+ /** ISO-8601 exclusion time (supervisor clock). */
102
+ at: string;
103
+ /**
104
+ * How the exclusion was effected: `excluded` = never launched, blocked at dispatch;
105
+ * `cancelled` = in-flight, killed; `abandoned` = in-flight, left to finish under
106
+ * `abandon-running` (still excluded from any post-budget launch, still reported).
107
+ */
108
+ applied: 'excluded' | 'cancelled' | 'abandoned';
109
+ }
110
+ /** Per-node cost as recorded in evidence. Wall-clock is supervisor-stamped, always present. */
111
+ export interface NodeCost {
112
+ /** Wall-clock the node spent `running` (ms), summed across observations. */
113
+ wallMs: number;
114
+ /** USD figure reported by the pipeline for this node, when its CLI exposes one. */
115
+ usd?: number;
116
+ inputTokens?: number;
117
+ outputTokens?: number;
118
+ }
119
+ /** Supervision's view of one node. */
120
+ export interface NodeSupervision {
121
+ nodeId: string;
122
+ phase: SupervisedNodePhase;
123
+ runId?: string;
124
+ /** Epoch ms the node was first observed `running`. */
125
+ startedAt?: number;
126
+ cost: NodeCost;
127
+ exclusion?: NodeExclusion;
128
+ }
129
+ /** Campaign-level budget exhaustion record. */
130
+ export interface BudgetExhaustion {
131
+ kind: 'wall-clock' | 'cost';
132
+ /** ISO-8601. */
133
+ at: string;
134
+ /** What was spent when the ceiling tripped (ms for wall-clock, USD for cost). */
135
+ spent: number;
136
+ /** The ceiling that tripped (ms for wall-clock, USD for cost). */
137
+ budget: number;
138
+ policyApplied: CampaignKillPolicy;
139
+ }
140
+ /** The full supervision state for one campaign — TH-9's `GET /campaigns/:id` merges this. */
141
+ export interface CampaignSupervisionState {
142
+ campaignId: string;
143
+ policy: CampaignBudgetPolicy;
144
+ /** Epoch ms supervision began (campaign launch). */
145
+ startedAt: number;
146
+ /** Wall-clock elapsed at the last sweep, ms. */
147
+ elapsedMs: number;
148
+ /** Total recorded USD cost across nodes (absent until any node reports one). */
149
+ totalCostUsd?: number;
150
+ /** Set exactly once, when a campaign-level budget exhausts. The abort IS visible here. */
151
+ exhausted?: BudgetExhaustion;
152
+ nodes: NodeSupervision[];
153
+ }
154
+ /**
155
+ * Synthetic /ws frame: a campaign-level budget exhausted. LOCAL type like
156
+ * `WorkerStalledFrame` — NOTE for the next `wicked-crew-api-types` release: add this frame
157
+ * and `campaignNodeExcluded` to the published contract (forward-additive on the wire).
158
+ */
159
+ export type CampaignBudgetExceededFrame = {
160
+ type: 'campaignBudgetExceeded';
161
+ campaign: string;
162
+ kind: 'wall-clock' | 'cost';
163
+ /** ms for wall-clock, USD for cost. */
164
+ budget: number;
165
+ spent: number;
166
+ policyApplied: CampaignKillPolicy;
167
+ /** Node ids excluded/aborted by this exhaustion, for the scoreboard's immediate redraw. */
168
+ nodes: string[];
169
+ };
170
+ /** Synthetic /ws frame: one node was excluded/aborted by supervision (incl. node timeouts). */
171
+ export type CampaignNodeExcludedFrame = {
172
+ type: 'campaignNodeExcluded';
173
+ campaign: string;
174
+ node: string;
175
+ kind: ExclusionKind;
176
+ reason: string;
177
+ applied: NodeExclusion['applied'];
178
+ };
179
+ export interface CampaignSupervisorDeps {
180
+ scheduler: SupervisedScheduler;
181
+ /** The /ws fan-out for synthetic frames (`events/bus.ts` `broadcast` in the daemon). */
182
+ broadcast: (frame: CampaignBudgetExceededFrame | CampaignNodeExcludedFrame) => void;
183
+ /** Clock (tests stub it). */
184
+ now?: () => number;
185
+ /** Wired to the daemon's warn logger — an abort is an operator-attention signal. */
186
+ log?: (m: string) => void;
187
+ }
188
+ /** Default sweep cadence: budgets are minutes-scale; 15 s keeps overshoot ≪ any ceiling. */
189
+ export declare const DEFAULT_SUPERVISION_SWEEP_INTERVAL_MS = 15000;
190
+ export declare class CampaignSupervisor {
191
+ private readonly deps;
192
+ private readonly campaigns;
193
+ private readonly now;
194
+ private readonly log;
195
+ private handle;
196
+ private sweeping;
197
+ constructor(deps: CampaignSupervisorDeps);
198
+ /**
199
+ * Begin supervising a campaign under a policy. Call at launch — the wall clock starts
200
+ * HERE, not at the first sweep. Re-registering an id is a bug (two clocks, one spend).
201
+ */
202
+ supervise(campaignId: string, policy: CampaignBudgetPolicy): void;
203
+ /**
204
+ * Stop ENFORCING (campaign reached a terminal status). State stays readable — deliberately
205
+ * no delete, or a post-terminal report would be irrecoverable. Also reached automatically
206
+ * when a sweep observes every node terminal.
207
+ */
208
+ release(campaignId: string): void;
209
+ /** Record pipeline-reported cost for a node (tokens/USD — wall-clock is supervisor-owned). */
210
+ recordNodeCost(campaignId: string, nodeId: string, cost: {
211
+ usd?: number;
212
+ inputTokens?: number;
213
+ outputTokens?: number;
214
+ }): void;
215
+ /** The supervision state for one campaign, or undefined when it was never supervised. */
216
+ state(campaignId: string): CampaignSupervisionState | undefined;
217
+ /** One enforcement pass over every supervised campaign. Tests drive it directly. */
218
+ sweep(): Promise<void>;
219
+ /** Arm the periodic sweep. Unref'd — the daemon's server lifecycle owns shutdown. */
220
+ start(intervalMs?: number): void;
221
+ stop(): void;
222
+ private sweepCampaign;
223
+ /**
224
+ * Abort everything the budget no longer covers. Every touched node gets an
225
+ * excluded-with-reason record; one campaignBudgetExceeded frame + one
226
+ * campaignNodeExcluded frame per node ride the /ws fan-out; the warn log names them all.
227
+ */
228
+ private exhaust;
229
+ private excludeOne;
230
+ private trackNode;
231
+ private totalCostUsd;
232
+ }
233
+ /** Filename of the supervision evidence artifact inside a campaign's evidence dir. */
234
+ export declare const SUPERVISION_REPORT_FILENAME = "campaign-supervision.json";
235
+ /**
236
+ * The `campaign-supervision.json` evidence artifact (snake_case like the ledger's
237
+ * manifests). Per-node cost rows are what the TH-14 scoreboard's cost column diffs
238
+ * between campaigns — a cost regression shows up exactly like a verdict regression.
239
+ * Deliberately NOT new fields on wicked-ledger's manifest 2.1: that schema moves through
240
+ * its owner's release train (ADR 0006); this artifact rides in the same evidence dir.
241
+ */
242
+ export interface CampaignSupervisionReport {
243
+ report: 'campaign-supervision';
244
+ version: 1;
245
+ campaign_id: string;
246
+ generated_at: string;
247
+ policy: {
248
+ wall_clock_budget_secs: number;
249
+ node_timeout_secs: number;
250
+ /** The TH-8-style WICKED_UNIT_TIMEOUT_SECS pin nodes ran under. */
251
+ unit_timeout_pin_secs: number;
252
+ max_nodes: number;
253
+ max_cost_usd?: number;
254
+ kill_policy: CampaignKillPolicy;
255
+ };
256
+ started_at: string;
257
+ elapsed_ms: number;
258
+ budget: {
259
+ exhausted: boolean;
260
+ kind?: 'wall-clock' | 'cost';
261
+ at?: string;
262
+ policy_applied?: CampaignKillPolicy;
263
+ };
264
+ totals: {
265
+ wall_ms: number;
266
+ cost_usd?: number;
267
+ input_tokens?: number;
268
+ output_tokens?: number;
269
+ };
270
+ nodes: Array<{
271
+ node_id: string;
272
+ phase: SupervisedNodePhase;
273
+ run_id?: string;
274
+ cost: {
275
+ wall_ms: number;
276
+ usd?: number;
277
+ input_tokens?: number;
278
+ output_tokens?: number;
279
+ };
280
+ excluded?: {
281
+ kind: ExclusionKind;
282
+ reason: string;
283
+ at: string;
284
+ applied: NodeExclusion['applied'];
285
+ };
286
+ }>;
287
+ }
288
+ /** Build the evidence report from live supervision state. */
289
+ export declare function buildSupervisionReport(state: CampaignSupervisionState): CampaignSupervisionReport;
290
+ /**
291
+ * Write the report into a campaign's evidence directory (caller resolves the dir — the
292
+ * QE pipeline owns evidence placement; crew never writes ledger DOMAIN records, and this
293
+ * is an artifact file, not a runs/verdicts row). Returns the absolute path written.
294
+ */
295
+ export declare function writeSupervisionReport(evidenceDir: string, report: CampaignSupervisionReport): Promise<string>;
296
+ //# sourceMappingURL=supervision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supervision.d.ts","sourceRoot":"","sources":["../../src/campaign/supervision.ts"],"names":[],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