wicked-crew 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/governance-steering.d.ts +139 -0
- package/dist/api/governance-steering.d.ts.map +1 -0
- package/dist/api/governance-steering.js +302 -0
- package/dist/api/governance-steering.js.map +1 -0
- package/dist/api/routes.d.ts +4 -4
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +117 -8
- package/dist/api/routes.js.map +1 -1
- package/dist/api/testing.d.ts +117 -0
- package/dist/api/testing.d.ts.map +1 -0
- package/dist/api/testing.js +152 -0
- package/dist/api/testing.js.map +1 -0
- package/dist/core/adapter.d.ts +89 -1
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +155 -1
- package/dist/core/adapter.js.map +1 -1
- package/dist/projects/routes.d.ts +2 -2
- package/dist/studio/assets/index-CwXkX3jQ.css +32 -0
- package/dist/studio/assets/index-DGa8A8Nw.js +533 -0
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +943 -251
- package/endpoint-manifest.json +73 -8
- package/package.json +3 -3
- package/dist/studio/assets/index-C8rx24F1.js +0 -530
- package/dist/studio/assets/index-CwmIj-f2.css +0 -32
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/api/v1/governance/steering/*` surface (STEERING program) — the management wire behind
|
|
3
|
+
* the studio's top-level Steering nav: batch IMPORT of steering docs/rules, and "add with chat"
|
|
4
|
+
* AUTHORING as a governed run. Per-rule CRUD deliberately lives elsewhere — this module adds no
|
|
5
|
+
* second door: `GET/POST /governance/rules` (now steering-aware: `?type=` facet,
|
|
6
|
+
* `?include_retired=`, steering-field writes) and `DELETE /governance/rules/:id` in
|
|
7
|
+
* `api/routes.ts` ARE the steering-rule CRUD, because a steering rule IS a conformance rule
|
|
8
|
+
* (the wiki/rules model and the old policy model merged into one).
|
|
9
|
+
*
|
|
10
|
+
* Thin by design, like `campaigns/routes.ts`: validation is zod (strict, unknown keys named —
|
|
11
|
+
* the FINDING-031 doctrine); import normalization/validation is the ENGINE's ingest path on the
|
|
12
|
+
* single-writer actor (fail-closed per entry — the daemon never opens the store for writes);
|
|
13
|
+
* authoring is the EXISTING run machinery (`launchRun` + the `steering-author` drop-in workflow
|
|
14
|
+
* + the standard `POST /runs/:id/gate` HITL flow) — no new chat stack. Error posture mirrors the
|
|
15
|
+
* campaign surface: a build whose engine addon predates the steering model answers 501
|
|
16
|
+
* (`SteeringUnsupportedError` — "upgrade the engine"), never 400 ("fix your request").
|
|
17
|
+
*
|
|
18
|
+
* estate's MCP surface stays READ-ONLY on rules; every steering WRITE flows through here (the
|
|
19
|
+
* governed operator path) — the AW-11 "no rules.write on estate" invariant is a design input of
|
|
20
|
+
* this module, not a coincidence.
|
|
21
|
+
*/
|
|
22
|
+
import type { FastifyInstance, FastifyRequest } from 'fastify';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
import { type CoreAdapter } from '../core/adapter.js';
|
|
25
|
+
import type { Actor } from '../core/types.js';
|
|
26
|
+
import type { AuditLog } from './audit.js';
|
|
27
|
+
/**
|
|
28
|
+
* The steering-type vocabulary (`wicked-crew-api-types::SteeringType`) — enum-as-string, the
|
|
29
|
+
* engine's serde default is `architecture`. ONE spelling, exported: `api/routes.ts` reads it for
|
|
30
|
+
* the `?type=` browse facet so the two surfaces can never disagree about what a type is.
|
|
31
|
+
*/
|
|
32
|
+
export declare const STEERING_TYPE_VALUES: readonly ["architecture", "development", "security", "testing", "operations", "compliance", "design-ux"];
|
|
33
|
+
export declare const STEERING_TYPES: ReadonlySet<string>;
|
|
34
|
+
/** The engine's serde default for a rule row that predates (or omits) `steering_type`. */
|
|
35
|
+
export declare const DEFAULT_STEERING_TYPE = "architecture";
|
|
36
|
+
/** Per-entry ceiling on an import doc / rule payload (UTF-8 bytes) — mirrors the run-files cap. */
|
|
37
|
+
export declare const STEERING_ENTRY_MAX_BYTES: number;
|
|
38
|
+
/** Batch ceiling — an import is a page action, not a bulk-migration channel. */
|
|
39
|
+
export declare const STEERING_IMPORT_MAX_ENTRIES = 200;
|
|
40
|
+
/** Authoring intent is operator prose, not a document store (the guidance-cap doctrine). */
|
|
41
|
+
export declare const STEERING_INSTRUCTIONS_MAX_BYTES: number;
|
|
42
|
+
export declare const SteeringImportSchema: z.ZodObject<{
|
|
43
|
+
type: z.ZodOptional<z.ZodEnum<["architecture", "development", "security", "testing", "operations", "compliance", "design-ux"]>>;
|
|
44
|
+
entries: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
45
|
+
kind: z.ZodLiteral<"doc">;
|
|
46
|
+
name: z.ZodOptional<z.ZodString>;
|
|
47
|
+
content: z.ZodString;
|
|
48
|
+
}, "strict", z.ZodTypeAny, {
|
|
49
|
+
kind: "doc";
|
|
50
|
+
content: string;
|
|
51
|
+
name?: string | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
kind: "doc";
|
|
54
|
+
content: string;
|
|
55
|
+
name?: string | undefined;
|
|
56
|
+
}>, z.ZodObject<{
|
|
57
|
+
kind: z.ZodLiteral<"rule">;
|
|
58
|
+
rule: z.ZodType<import("wicked-crew-api-types").ConformanceRule, z.ZodTypeDef, import("wicked-crew-api-types").ConformanceRule>;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
kind: "rule";
|
|
61
|
+
rule: import("wicked-crew-api-types").ConformanceRule;
|
|
62
|
+
}, {
|
|
63
|
+
kind: "rule";
|
|
64
|
+
rule: import("wicked-crew-api-types").ConformanceRule;
|
|
65
|
+
}>]>, "many">;
|
|
66
|
+
}, "strict", z.ZodTypeAny, {
|
|
67
|
+
entries: ({
|
|
68
|
+
kind: "doc";
|
|
69
|
+
content: string;
|
|
70
|
+
name?: string | undefined;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "rule";
|
|
73
|
+
rule: import("wicked-crew-api-types").ConformanceRule;
|
|
74
|
+
})[];
|
|
75
|
+
type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
entries: ({
|
|
78
|
+
kind: "doc";
|
|
79
|
+
content: string;
|
|
80
|
+
name?: string | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
kind: "rule";
|
|
83
|
+
rule: import("wicked-crew-api-types").ConformanceRule;
|
|
84
|
+
})[];
|
|
85
|
+
type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const SteeringAuthorSchema: z.ZodObject<{
|
|
88
|
+
instructions: z.ZodString;
|
|
89
|
+
type: z.ZodOptional<z.ZodEnum<["architecture", "development", "security", "testing", "operations", "compliance", "design-ux"]>>;
|
|
90
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
91
|
+
documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
content: z.ZodString;
|
|
94
|
+
}, "strict", z.ZodTypeAny, {
|
|
95
|
+
content: string;
|
|
96
|
+
name: string;
|
|
97
|
+
}, {
|
|
98
|
+
content: string;
|
|
99
|
+
name: string;
|
|
100
|
+
}>, "many">>;
|
|
101
|
+
repoRef: z.ZodOptional<z.ZodString>;
|
|
102
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
instructions: string;
|
|
105
|
+
type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
|
|
106
|
+
repoRef?: string | undefined;
|
|
107
|
+
paths?: string[] | undefined;
|
|
108
|
+
documents?: {
|
|
109
|
+
content: string;
|
|
110
|
+
name: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
sessionId?: string | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
instructions: string;
|
|
115
|
+
type?: "architecture" | "development" | "security" | "testing" | "operations" | "compliance" | "design-ux" | undefined;
|
|
116
|
+
repoRef?: string | undefined;
|
|
117
|
+
paths?: string[] | undefined;
|
|
118
|
+
documents?: {
|
|
119
|
+
content: string;
|
|
120
|
+
name: string;
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
sessionId?: string | undefined;
|
|
123
|
+
}>;
|
|
124
|
+
/**
|
|
125
|
+
* Where the author route lands inline documents so the run can read them: a per-run inbox on the
|
|
126
|
+
* daemon host — the existing run file mechanism (runs read the daemon's filesystem; the paths
|
|
127
|
+
* ride the problem statement, never the prompt-fattening content itself).
|
|
128
|
+
*/
|
|
129
|
+
export declare function steeringInboxDir(runId: string): string;
|
|
130
|
+
export interface SteeringRoutesDeps {
|
|
131
|
+
audit: AuditLog;
|
|
132
|
+
actorOf: (req: FastifyRequest & {
|
|
133
|
+
actor?: Actor;
|
|
134
|
+
}) => Actor;
|
|
135
|
+
/** The default council roster for the authoring run (already parsed). */
|
|
136
|
+
roster: () => unknown[];
|
|
137
|
+
}
|
|
138
|
+
export declare function registerGovernanceSteeringRoutes(app: FastifyInstance, adapter: CoreAdapter, deps: SteeringRoutesDeps): void;
|
|
139
|
+
//# sourceMappingURL=governance-steering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance-steering.d.ts","sourceRoot":"","sources":["../../src/api/governance-steering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,KAAK,EAA6C,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0GAQvB,CAAC;AAEX,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAAiC,CAAC;AAEjF,0FAA0F;AAC1F,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,mGAAmG;AACnG,eAAO,MAAM,wBAAwB,QAAa,CAAC;AACnD,gFAAgF;AAChF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,4FAA4F;AAC5F,eAAO,MAAM,+BAA+B,QAAY,CAAC;AA0CzD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAEZ,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYtB,CAAC;AAEZ;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtD;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,KAAK,KAAK,CAAC;IAC5D,yEAAyE;IACzE,MAAM,EAAE,MAAM,OAAO,EAAE,CAAC;CACzB;AAED,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,kBAAkB,GACvB,IAAI,CAkMN"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `/api/v1/governance/steering/*` surface (STEERING program) — the management wire behind
|
|
3
|
+
* the studio's top-level Steering nav: batch IMPORT of steering docs/rules, and "add with chat"
|
|
4
|
+
* AUTHORING as a governed run. Per-rule CRUD deliberately lives elsewhere — this module adds no
|
|
5
|
+
* second door: `GET/POST /governance/rules` (now steering-aware: `?type=` facet,
|
|
6
|
+
* `?include_retired=`, steering-field writes) and `DELETE /governance/rules/:id` in
|
|
7
|
+
* `api/routes.ts` ARE the steering-rule CRUD, because a steering rule IS a conformance rule
|
|
8
|
+
* (the wiki/rules model and the old policy model merged into one).
|
|
9
|
+
*
|
|
10
|
+
* Thin by design, like `campaigns/routes.ts`: validation is zod (strict, unknown keys named —
|
|
11
|
+
* the FINDING-031 doctrine); import normalization/validation is the ENGINE's ingest path on the
|
|
12
|
+
* single-writer actor (fail-closed per entry — the daemon never opens the store for writes);
|
|
13
|
+
* authoring is the EXISTING run machinery (`launchRun` + the `steering-author` drop-in workflow
|
|
14
|
+
* + the standard `POST /runs/:id/gate` HITL flow) — no new chat stack. Error posture mirrors the
|
|
15
|
+
* campaign surface: a build whose engine addon predates the steering model answers 501
|
|
16
|
+
* (`SteeringUnsupportedError` — "upgrade the engine"), never 400 ("fix your request").
|
|
17
|
+
*
|
|
18
|
+
* estate's MCP surface stays READ-ONLY on rules; every steering WRITE flows through here (the
|
|
19
|
+
* governed operator path) — the AW-11 "no rules.write on estate" invariant is a design input of
|
|
20
|
+
* this module, not a coincidence.
|
|
21
|
+
*/
|
|
22
|
+
import { randomUUID } from 'node:crypto';
|
|
23
|
+
import { existsSync, promises as fsp } from 'node:fs';
|
|
24
|
+
import { basename, isAbsolute, join } from 'node:path';
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { SteeringUnsupportedError } from '../core/adapter.js';
|
|
27
|
+
import { API_PREFIX } from './api-prefix.js';
|
|
28
|
+
const V = API_PREFIX;
|
|
29
|
+
/**
|
|
30
|
+
* The steering-type vocabulary (`wicked-crew-api-types::SteeringType`) — enum-as-string, the
|
|
31
|
+
* engine's serde default is `architecture`. ONE spelling, exported: `api/routes.ts` reads it for
|
|
32
|
+
* the `?type=` browse facet so the two surfaces can never disagree about what a type is.
|
|
33
|
+
*/
|
|
34
|
+
export const STEERING_TYPE_VALUES = [
|
|
35
|
+
'architecture',
|
|
36
|
+
'development',
|
|
37
|
+
'security',
|
|
38
|
+
'testing',
|
|
39
|
+
'operations',
|
|
40
|
+
'compliance',
|
|
41
|
+
'design-ux',
|
|
42
|
+
];
|
|
43
|
+
export const STEERING_TYPES = new Set(STEERING_TYPE_VALUES);
|
|
44
|
+
/** The engine's serde default for a rule row that predates (or omits) `steering_type`. */
|
|
45
|
+
export const DEFAULT_STEERING_TYPE = 'architecture';
|
|
46
|
+
/** Per-entry ceiling on an import doc / rule payload (UTF-8 bytes) — mirrors the run-files cap. */
|
|
47
|
+
export const STEERING_ENTRY_MAX_BYTES = 512 * 1024;
|
|
48
|
+
/** Batch ceiling — an import is a page action, not a bulk-migration channel. */
|
|
49
|
+
export const STEERING_IMPORT_MAX_ENTRIES = 200;
|
|
50
|
+
/** Authoring intent is operator prose, not a document store (the guidance-cap doctrine). */
|
|
51
|
+
export const STEERING_INSTRUCTIONS_MAX_BYTES = 16 * 1024;
|
|
52
|
+
function message(err) {
|
|
53
|
+
return err instanceof Error ? err.message : String(err);
|
|
54
|
+
}
|
|
55
|
+
/** Same unknown-key-naming 400 body builder as api/routes.ts (restated because that module does
|
|
56
|
+
* not export it and importing routes.ts here would be a cycle through registerRoutes). */
|
|
57
|
+
function invalidBody(err, what) {
|
|
58
|
+
const unknown = err.issues.flatMap((i) => (i.code === 'unrecognized_keys' ? i.keys : []));
|
|
59
|
+
const error = unknown.length > 0
|
|
60
|
+
? `${what}: unknown field${unknown.length > 1 ? 's' : ''} ${unknown
|
|
61
|
+
.map((k) => `\`${k}\``)
|
|
62
|
+
.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`
|
|
63
|
+
: what;
|
|
64
|
+
return { error, details: err.issues };
|
|
65
|
+
}
|
|
66
|
+
// A doc entry: frontmattered markdown, the SAME format `rules ingest --dir` consumes. The rule
|
|
67
|
+
// entry's payload is validated shape-wise by the ENGINE's normalize/validate path (fail-closed
|
|
68
|
+
// per entry) — the route checks only "is an object", so engine-side validation stays the ONE
|
|
69
|
+
// spelling of what a rule is.
|
|
70
|
+
const ImportDocSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
kind: z.literal('doc'),
|
|
73
|
+
name: z.string().min(1).max(256).optional(),
|
|
74
|
+
content: z.string().min(1),
|
|
75
|
+
})
|
|
76
|
+
.strict();
|
|
77
|
+
const ImportRuleSchema = z
|
|
78
|
+
.object({
|
|
79
|
+
kind: z.literal('rule'),
|
|
80
|
+
rule: z.custom((v) => typeof v === 'object' && v !== null && !Array.isArray(v), { message: '`rule` must be a rule object' }),
|
|
81
|
+
})
|
|
82
|
+
.strict();
|
|
83
|
+
export const SteeringImportSchema = z
|
|
84
|
+
.object({
|
|
85
|
+
type: z.enum(STEERING_TYPE_VALUES).optional(),
|
|
86
|
+
entries: z
|
|
87
|
+
.array(z.discriminatedUnion('kind', [ImportDocSchema, ImportRuleSchema]))
|
|
88
|
+
.min(1)
|
|
89
|
+
.max(STEERING_IMPORT_MAX_ENTRIES),
|
|
90
|
+
})
|
|
91
|
+
.strict();
|
|
92
|
+
export const SteeringAuthorSchema = z
|
|
93
|
+
.object({
|
|
94
|
+
instructions: z.string().min(1),
|
|
95
|
+
type: z.enum(STEERING_TYPE_VALUES).optional(),
|
|
96
|
+
paths: z.array(z.string().min(1)).max(32).optional(),
|
|
97
|
+
documents: z
|
|
98
|
+
.array(z.object({ name: z.string().min(1).max(128), content: z.string().min(1) }).strict())
|
|
99
|
+
.max(32)
|
|
100
|
+
.optional(),
|
|
101
|
+
repoRef: z.string().min(1).optional(),
|
|
102
|
+
sessionId: z.string().min(1).optional(),
|
|
103
|
+
})
|
|
104
|
+
.strict();
|
|
105
|
+
/**
|
|
106
|
+
* Where the author route lands inline documents so the run can read them: a per-run inbox on the
|
|
107
|
+
* daemon host — the existing run file mechanism (runs read the daemon's filesystem; the paths
|
|
108
|
+
* ride the problem statement, never the prompt-fattening content itself).
|
|
109
|
+
*/
|
|
110
|
+
export function steeringInboxDir(runId) {
|
|
111
|
+
// Env override first (the workflowOverlayDir pattern) — what keeps tests out of the
|
|
112
|
+
// operator's real ~/.wicked.
|
|
113
|
+
if (process.env.WICKED_STEERING_INBOX_DIR) {
|
|
114
|
+
return join(process.env.WICKED_STEERING_INBOX_DIR, runId);
|
|
115
|
+
}
|
|
116
|
+
const home = process.env.HOME ?? process.env.USERPROFILE ?? '/tmp';
|
|
117
|
+
return join(home, '.wicked', 'steering-inbox', runId);
|
|
118
|
+
}
|
|
119
|
+
export function registerGovernanceSteeringRoutes(app, adapter, deps) {
|
|
120
|
+
const { audit, actorOf } = deps;
|
|
121
|
+
// ── Batch import (the Steering page's Import action) ─────────────────────────
|
|
122
|
+
// JSON body only, deliberately: this daemon speaks no multipart (no parser registered, and the
|
|
123
|
+
// studio client speaks JSON everywhere else), so doc bytes ride `content` inline. `type` is the
|
|
124
|
+
// page's inferred steering type, applied engine-side as the default for entries that omit one.
|
|
125
|
+
// 200 even when entries rejected — fail-closed PER ENTRY, and the per-entry results ARE the
|
|
126
|
+
// answer; only a malformed batch (400), a pre-steering engine (501), or an engine failure (500)
|
|
127
|
+
// refuse the request as a whole.
|
|
128
|
+
app.post(`${V}/governance/steering/import`, {
|
|
129
|
+
config: {
|
|
130
|
+
manifest: {
|
|
131
|
+
requestType: 'SteeringImportBody',
|
|
132
|
+
responseType: 'SteeringImportResponse',
|
|
133
|
+
// 501: the installed engine addon predates the steering model (wicked-core-ts < 0.7.5)
|
|
134
|
+
// — upgrade the engine, the request was already correct.
|
|
135
|
+
statusCodes: [200, 400, 500, 501],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}, async (req, reply) => {
|
|
139
|
+
const parsed = SteeringImportSchema.safeParse(req.body);
|
|
140
|
+
if (!parsed.success) {
|
|
141
|
+
return reply.code(400).send(invalidBody(parsed.error, 'Invalid steering import body'));
|
|
142
|
+
}
|
|
143
|
+
// Byte caps checked in the route, not zod's char-counting `max`, so the 400 names the
|
|
144
|
+
// actual limit (the guidance-cap doctrine).
|
|
145
|
+
for (const [i, entry] of parsed.data.entries.entries()) {
|
|
146
|
+
const payload = entry.kind === 'doc' ? entry.content : JSON.stringify(entry.rule);
|
|
147
|
+
const bytes = Buffer.byteLength(payload, 'utf8');
|
|
148
|
+
if (bytes > STEERING_ENTRY_MAX_BYTES) {
|
|
149
|
+
return reply.code(400).send({
|
|
150
|
+
error: `entries[${i}] is ${bytes} bytes, over the ${STEERING_ENTRY_MAX_BYTES}-byte per-entry cap`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const results = await adapter.importSteeringRules(parsed.data.entries, parsed.data.type);
|
|
156
|
+
const imported = results.filter((r) => r.status === 'imported').length;
|
|
157
|
+
const rejected = results.length - imported;
|
|
158
|
+
audit.record('governance.steering.imported', actorOf(req), {
|
|
159
|
+
detail: {
|
|
160
|
+
entries: results.length,
|
|
161
|
+
imported,
|
|
162
|
+
rejected,
|
|
163
|
+
...(parsed.data.type !== undefined ? { type: parsed.data.type } : {}),
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
return { results, imported, rejected };
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
if (err instanceof SteeringUnsupportedError) {
|
|
170
|
+
return reply.code(501).send({ error: message(err) });
|
|
171
|
+
}
|
|
172
|
+
// An engine/store failure is OURS, not the caller's — the batch already parsed, so
|
|
173
|
+
// nothing here maps to 400 (per-ENTRY validation failures come back in `results`).
|
|
174
|
+
return reply.code(500).send({ error: message(err) });
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
// ── "Add with chat" (the Steering page's conversational authoring action) ────
|
|
178
|
+
// REUSES crew's run machinery end to end: launches the `steering-author` drop-in workflow
|
|
179
|
+
// (BUILTIN_WORKFLOWS — analyze → propose, with an unconditional human gate on the terminal
|
|
180
|
+
// propose phase: TH-12 propose-as-gate), inline documents land in the per-run steering inbox
|
|
181
|
+
// (the run reads the daemon host's filesystem — the existing run file mechanism), and the
|
|
182
|
+
// operator answers the proposal through the standard POST /runs/:id/gate. Approved rules land
|
|
183
|
+
// via POST /governance/rules with `provenance.source: "chat"` — the run itself writes nothing.
|
|
184
|
+
//
|
|
185
|
+
// Gated on the steering engine too, on purpose: the run only PROPOSES, but proposing rules
|
|
186
|
+
// whose steering fields the CRUD would then refuse (501) is a trap, not a feature.
|
|
187
|
+
app.post(`${V}/governance/steering/author`, {
|
|
188
|
+
config: {
|
|
189
|
+
manifest: {
|
|
190
|
+
requestType: 'SteeringAuthorBody',
|
|
191
|
+
responseType: '{ runId: string }',
|
|
192
|
+
// 409: engine busy / sessionId already exists; 501: pre-steering engine.
|
|
193
|
+
statusCodes: [201, 400, 409, 500, 501],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
}, async (req, reply) => {
|
|
197
|
+
const parsed = SteeringAuthorSchema.safeParse(req.body);
|
|
198
|
+
if (!parsed.success) {
|
|
199
|
+
return reply.code(400).send(invalidBody(parsed.error, 'Invalid steering author body'));
|
|
200
|
+
}
|
|
201
|
+
const b = parsed.data;
|
|
202
|
+
const intentBytes = Buffer.byteLength(b.instructions, 'utf8');
|
|
203
|
+
if (intentBytes > STEERING_INSTRUCTIONS_MAX_BYTES) {
|
|
204
|
+
return reply.code(400).send({
|
|
205
|
+
error: `instructions is ${intentBytes} bytes, over the ${STEERING_INSTRUCTIONS_MAX_BYTES}-byte cap — put long material in \`documents\` or \`paths\`, not the intent`,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
for (const [i, doc] of (b.documents ?? []).entries()) {
|
|
209
|
+
const bytes = Buffer.byteLength(doc.content, 'utf8');
|
|
210
|
+
if (bytes > STEERING_ENTRY_MAX_BYTES) {
|
|
211
|
+
return reply.code(400).send({
|
|
212
|
+
error: `documents[${i}] is ${bytes} bytes, over the ${STEERING_ENTRY_MAX_BYTES}-byte per-document cap`,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// The run id NAMES the per-run inbox directory below, and `join` honors `../` — a
|
|
217
|
+
// free-form id could land inline documents outside the inbox (or alias another run's).
|
|
218
|
+
// Same doctrine as the document `name` scrub: caller text is never a path — but the id
|
|
219
|
+
// must round-trip exactly (it is the run's identity), so refuse loudly instead of
|
|
220
|
+
// scrubbing silently.
|
|
221
|
+
if (b.sessionId !== undefined && !/^(?!\.+$)[A-Za-z0-9._-]{1,128}$/.test(b.sessionId)) {
|
|
222
|
+
return reply.code(400).send({
|
|
223
|
+
error: 'sessionId must be 1-128 characters of [A-Za-z0-9._-] (and not dots only) — it names ' +
|
|
224
|
+
"the run's steering-inbox directory on the daemon host",
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (!adapter.steeringSupported()) {
|
|
228
|
+
return reply
|
|
229
|
+
.code(501)
|
|
230
|
+
.send({ error: new SteeringUnsupportedError('Authoring steering rules').message });
|
|
231
|
+
}
|
|
232
|
+
// Paths are read on the DAEMON host — validate loudly here rather than letting the run
|
|
233
|
+
// burn a phase discovering a browser-local path. Absolute only (the extraWriteRoots
|
|
234
|
+
// doctrine), and existing (a named 400 beats a worker's "no such file" mid-run).
|
|
235
|
+
for (const p of b.paths ?? []) {
|
|
236
|
+
if (!isAbsolute(p)) {
|
|
237
|
+
return reply
|
|
238
|
+
.code(400)
|
|
239
|
+
.send({ error: `paths: \`${p}\` must be absolute on the daemon host` });
|
|
240
|
+
}
|
|
241
|
+
if (!existsSync(p)) {
|
|
242
|
+
return reply.code(400).send({
|
|
243
|
+
error: `paths: \`${p}\` does not exist on the daemon host — the authoring run reads the daemon's filesystem, not the browser's`,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const runId = b.sessionId ?? randomUUID();
|
|
248
|
+
// Inline documents → per-run inbox files; only their PATHS ride the problem statement
|
|
249
|
+
// (content in the prompt would fatten it past what prompt transports tolerate).
|
|
250
|
+
const docPaths = [];
|
|
251
|
+
if (b.documents !== undefined && b.documents.length > 0) {
|
|
252
|
+
const dir = steeringInboxDir(runId);
|
|
253
|
+
await fsp.mkdir(dir, { recursive: true });
|
|
254
|
+
for (const [i, doc] of b.documents.entries()) {
|
|
255
|
+
// basename + charset scrub: the caller's `name` is display text, never a path. The
|
|
256
|
+
// index prefix keeps scrubbed names collision-free and the filename non-empty.
|
|
257
|
+
const safe = `${i}-${basename(doc.name).replace(/[^a-zA-Z0-9._-]/g, '_')}`;
|
|
258
|
+
const target = join(dir, safe);
|
|
259
|
+
await fsp.writeFile(target, doc.content, 'utf8');
|
|
260
|
+
docPaths.push(target);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const type = b.type ?? DEFAULT_STEERING_TYPE;
|
|
264
|
+
const sources = [...(b.paths ?? []), ...docPaths];
|
|
265
|
+
const problem = [
|
|
266
|
+
`Author steering rules for the '${type}' steering type (use it as the default steering_type for every proposed rule without a better fit).`,
|
|
267
|
+
'',
|
|
268
|
+
'Operator intent:',
|
|
269
|
+
b.instructions,
|
|
270
|
+
...(sources.length > 0
|
|
271
|
+
? ['', 'Analyze these files/directories on this machine:', ...sources.map((s) => `- ${s}`)]
|
|
272
|
+
: []),
|
|
273
|
+
].join('\n');
|
|
274
|
+
try {
|
|
275
|
+
await adapter.launchRun({
|
|
276
|
+
problem,
|
|
277
|
+
sessionId: runId,
|
|
278
|
+
clisJson: JSON.stringify(deps.roster()),
|
|
279
|
+
workflow: 'steering-author',
|
|
280
|
+
...(b.repoRef !== undefined ? { repoRef: b.repoRef } : {}),
|
|
281
|
+
});
|
|
282
|
+
// The same trail entry POST /runs writes — this IS a run launch, findable by the same
|
|
283
|
+
// `?action=run.launched` query — plus the steering detail the Steering header renders.
|
|
284
|
+
audit.record('run.launched', actorOf(req), {
|
|
285
|
+
runId,
|
|
286
|
+
detail: {
|
|
287
|
+
workflow: 'steering-author',
|
|
288
|
+
steeringType: type,
|
|
289
|
+
sources: sources.length,
|
|
290
|
+
...(b.repoRef !== undefined ? { repoRef: b.repoRef } : {}),
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
return reply.code(201).send({ runId });
|
|
294
|
+
}
|
|
295
|
+
catch (err) {
|
|
296
|
+
const msg = message(err);
|
|
297
|
+
const busy = /busy|in flight|already/i.test(msg);
|
|
298
|
+
return reply.code(busy ? 409 : 400).send({ error: msg });
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=governance-steering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance-steering.js","sourceRoot":"","sources":["../../src/api/governance-steering.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAoB,MAAM,oBAAoB,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,GAAG,UAAU,CAAC;AAErB;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc;IACd,aAAa;IACb,UAAU;IACV,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,WAAW;CACH,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAEjF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEpD,mGAAmG;AACnG,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,GAAG,IAAI,CAAC;AACnD,gFAAgF;AAChF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAC/C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,GAAG,IAAI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AAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/api/routes.d.ts
CHANGED
|
@@ -52,8 +52,8 @@ export declare const LaunchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
52
52
|
workflow?: string | undefined;
|
|
53
53
|
repoRef?: string | undefined;
|
|
54
54
|
clisJson?: string | undefined;
|
|
55
|
-
retryOf?: string | undefined;
|
|
56
55
|
sessionId?: string | undefined;
|
|
56
|
+
retryOf?: string | undefined;
|
|
57
57
|
entityMode?: "shared" | "isolated" | undefined;
|
|
58
58
|
humanConfirm?: string | undefined;
|
|
59
59
|
}, {
|
|
@@ -63,8 +63,8 @@ export declare const LaunchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
63
63
|
workflow?: string | undefined;
|
|
64
64
|
repoRef?: string | undefined;
|
|
65
65
|
clisJson?: string | undefined;
|
|
66
|
-
retryOf?: string | undefined;
|
|
67
66
|
sessionId?: string | undefined;
|
|
67
|
+
retryOf?: string | undefined;
|
|
68
68
|
entityMode?: "shared" | "isolated" | undefined;
|
|
69
69
|
humanConfirm?: string | undefined;
|
|
70
70
|
}>, {
|
|
@@ -74,8 +74,8 @@ export declare const LaunchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
74
74
|
workflow?: string | undefined;
|
|
75
75
|
repoRef?: string | undefined;
|
|
76
76
|
clisJson?: string | undefined;
|
|
77
|
-
retryOf?: string | undefined;
|
|
78
77
|
sessionId?: string | undefined;
|
|
78
|
+
retryOf?: string | undefined;
|
|
79
79
|
entityMode?: "shared" | "isolated" | undefined;
|
|
80
80
|
humanConfirm?: string | undefined;
|
|
81
81
|
}, {
|
|
@@ -85,8 +85,8 @@ export declare const LaunchSchema: z.ZodEffects<z.ZodObject<{
|
|
|
85
85
|
workflow?: string | undefined;
|
|
86
86
|
repoRef?: string | undefined;
|
|
87
87
|
clisJson?: string | undefined;
|
|
88
|
-
retryOf?: string | undefined;
|
|
89
88
|
sessionId?: string | undefined;
|
|
89
|
+
retryOf?: string | undefined;
|
|
90
90
|
entityMode?: "shared" | "isolated" | undefined;
|
|
91
91
|
humanConfirm?: string | undefined;
|
|
92
92
|
}>;
|
package/dist/api/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/api/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAAwB,WAAW,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/api/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAAwB,WAAW,EAA4E,MAAM,oBAAoB,CAAC;AAEjJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWrD,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAWtF,OAAO,EAAe,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAInF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB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