@zauso-ai/capstan-feedback 0.1.2
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/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +996 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type VerifyStatus = "passed" | "failed" | "skipped";
|
|
2
|
+
export type VerifySeverity = "error" | "warning" | "info";
|
|
3
|
+
export type VerifyStepKey = "structure" | "contracts" | "typecheck" | "build" | "assertions" | "smoke";
|
|
4
|
+
export interface VerifyDiagnostic {
|
|
5
|
+
code: string;
|
|
6
|
+
severity: VerifySeverity;
|
|
7
|
+
summary: string;
|
|
8
|
+
detail?: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
file?: string;
|
|
11
|
+
line?: number;
|
|
12
|
+
column?: number;
|
|
13
|
+
source?: "capstan" | "typescript";
|
|
14
|
+
}
|
|
15
|
+
export interface VerifyStepResult {
|
|
16
|
+
key: VerifyStepKey;
|
|
17
|
+
label: string;
|
|
18
|
+
status: VerifyStatus;
|
|
19
|
+
durationMs: number;
|
|
20
|
+
diagnostics: VerifyDiagnostic[];
|
|
21
|
+
command?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface VerifySummary {
|
|
24
|
+
status: VerifyStatus;
|
|
25
|
+
stepCount: number;
|
|
26
|
+
passedSteps: number;
|
|
27
|
+
failedSteps: number;
|
|
28
|
+
skippedSteps: number;
|
|
29
|
+
diagnosticCount: number;
|
|
30
|
+
errorCount: number;
|
|
31
|
+
warningCount: number;
|
|
32
|
+
}
|
|
33
|
+
export interface VerifyReport {
|
|
34
|
+
appRoot: string;
|
|
35
|
+
status: VerifyStatus;
|
|
36
|
+
generatedBy: "capstan-feedback";
|
|
37
|
+
steps: VerifyStepResult[];
|
|
38
|
+
diagnostics: VerifyDiagnostic[];
|
|
39
|
+
summary: VerifySummary;
|
|
40
|
+
}
|
|
41
|
+
export interface VerifyOptions {
|
|
42
|
+
cwd?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function verifyGeneratedApp(appRoot: string, options?: VerifyOptions): Promise<VerifyReport>;
|
|
45
|
+
export declare function renderVerifyReportText(report: VerifyReport): string;
|
|
46
|
+
export declare function parseTypeScriptDiagnostics(output: string): VerifyDiagnostic[];
|
|
47
|
+
export declare function suggestRepairHint(message: string): string;
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,WAAW,GACX,WAAW,GACX,OAAO,GACP,YAAY,GACZ,OAAO,CAAC;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAmGD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,CA0EvB;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAuDnE;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA8B7E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAczD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,996 @@
|
|
|
1
|
+
import { access, readFile } from "node:fs/promises";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { execFile } from "node:child_process";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
import { promisify } from "node:util";
|
|
7
|
+
import { JSDOM } from "jsdom";
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
const packageDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const repoRoot = resolve(packageDir, "../../..");
|
|
11
|
+
const tscBinary = resolve(repoRoot, "node_modules/.bin/tsc");
|
|
12
|
+
const requiredGeneratedFiles = [
|
|
13
|
+
"capstan.app.json",
|
|
14
|
+
".capstan/graph-metadata.json",
|
|
15
|
+
"agent-surface.json",
|
|
16
|
+
"human-surface.html",
|
|
17
|
+
"tsconfig.json",
|
|
18
|
+
"src/index.ts",
|
|
19
|
+
"src/control-plane/index.ts",
|
|
20
|
+
"src/assertions/index.ts",
|
|
21
|
+
"src/human-surface/index.ts",
|
|
22
|
+
"src/agent-surface/index.ts",
|
|
23
|
+
"src/agent-surface/transport.ts"
|
|
24
|
+
];
|
|
25
|
+
export async function verifyGeneratedApp(appRoot, options = {}) {
|
|
26
|
+
const root = resolve(options.cwd ?? process.cwd(), appRoot);
|
|
27
|
+
const steps = [];
|
|
28
|
+
const context = {};
|
|
29
|
+
const structureStep = await measureStep("structure", "Generated Structure", async () => runStructureChecks(root, context));
|
|
30
|
+
steps.push(structureStep);
|
|
31
|
+
if (structureStep.status !== "passed") {
|
|
32
|
+
steps.push(skippedStep("contracts", "Surface Contracts", "Verify skipped because structure failed."));
|
|
33
|
+
steps.push(skippedStep("typecheck", "TypeScript Check", "Verify skipped because structure failed."));
|
|
34
|
+
steps.push(skippedStep("build", "Generated Build", "Verify skipped because structure failed."));
|
|
35
|
+
steps.push(skippedStep("assertions", "Generated Assertions", "Verify skipped because structure failed."));
|
|
36
|
+
steps.push(skippedStep("smoke", "Runtime Smoke", "Verify skipped because structure failed."));
|
|
37
|
+
return buildVerifyReport(root, steps);
|
|
38
|
+
}
|
|
39
|
+
const contractsStep = await measureStep("contracts", "Surface Contracts", async () => runContractChecks(root, context));
|
|
40
|
+
steps.push(contractsStep);
|
|
41
|
+
if (contractsStep.status !== "passed") {
|
|
42
|
+
steps.push(skippedStep("typecheck", "TypeScript Check", "Verify skipped because contracts failed."));
|
|
43
|
+
steps.push(skippedStep("build", "Generated Build", "Verify skipped because contracts failed."));
|
|
44
|
+
steps.push(skippedStep("assertions", "Generated Assertions", "Verify skipped because contracts failed."));
|
|
45
|
+
steps.push(skippedStep("smoke", "Runtime Smoke", "Verify skipped because contracts failed."));
|
|
46
|
+
return buildVerifyReport(root, steps);
|
|
47
|
+
}
|
|
48
|
+
const typecheckStep = await measureStep("typecheck", "TypeScript Check", async () => runTypeScriptCheck(root), formatTypeScriptCommand(root, true));
|
|
49
|
+
steps.push(typecheckStep);
|
|
50
|
+
if (typecheckStep.status !== "passed") {
|
|
51
|
+
steps.push(skippedStep("build", "Generated Build", "Verify skipped because typecheck failed."));
|
|
52
|
+
steps.push(skippedStep("assertions", "Generated Assertions", "Verify skipped because typecheck failed."));
|
|
53
|
+
steps.push(skippedStep("smoke", "Runtime Smoke", "Verify skipped because typecheck failed."));
|
|
54
|
+
return buildVerifyReport(root, steps);
|
|
55
|
+
}
|
|
56
|
+
const buildStep = await measureStep("build", "Generated Build", async () => runTypeScriptBuild(root), formatTypeScriptCommand(root, false));
|
|
57
|
+
steps.push(buildStep);
|
|
58
|
+
if (buildStep.status !== "passed") {
|
|
59
|
+
steps.push(skippedStep("assertions", "Generated Assertions", "Verify skipped because build failed."));
|
|
60
|
+
steps.push(skippedStep("smoke", "Runtime Smoke", "Verify skipped because build failed."));
|
|
61
|
+
return buildVerifyReport(root, steps);
|
|
62
|
+
}
|
|
63
|
+
const assertionStep = await measureStep("assertions", "Generated Assertions", async () => runAssertionChecks(root));
|
|
64
|
+
steps.push(assertionStep);
|
|
65
|
+
if (assertionStep.status !== "passed") {
|
|
66
|
+
steps.push(skippedStep("smoke", "Runtime Smoke", "Verify skipped because assertions failed."));
|
|
67
|
+
return buildVerifyReport(root, steps);
|
|
68
|
+
}
|
|
69
|
+
steps.push(await measureStep("smoke", "Runtime Smoke", async () => runSmokeChecks(root)));
|
|
70
|
+
return buildVerifyReport(root, steps);
|
|
71
|
+
}
|
|
72
|
+
export function renderVerifyReportText(report) {
|
|
73
|
+
const lines = [
|
|
74
|
+
"Capstan Verify",
|
|
75
|
+
`App: ${report.appRoot}`,
|
|
76
|
+
`Status: ${report.status}`,
|
|
77
|
+
`Summary: ${report.summary.passedSteps}/${report.summary.stepCount} steps passed, ${report.summary.errorCount} errors, ${report.summary.warningCount} warnings`
|
|
78
|
+
];
|
|
79
|
+
for (const step of report.steps) {
|
|
80
|
+
lines.push("");
|
|
81
|
+
lines.push(`[${step.status}] ${step.label} (${step.durationMs}ms)`);
|
|
82
|
+
if (step.command) {
|
|
83
|
+
lines.push(`command: ${step.command}`);
|
|
84
|
+
}
|
|
85
|
+
if (!step.diagnostics.length) {
|
|
86
|
+
lines.push("diagnostics: none");
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
for (const diagnostic of step.diagnostics) {
|
|
90
|
+
const location = diagnostic.file
|
|
91
|
+
? `${diagnostic.file}${diagnostic.line ? `:${diagnostic.line}${diagnostic.column ? `:${diagnostic.column}` : ""}` : ""}`
|
|
92
|
+
: undefined;
|
|
93
|
+
lines.push(`- [${diagnostic.severity}] ${diagnostic.code}: ${diagnostic.summary}`);
|
|
94
|
+
if (location) {
|
|
95
|
+
lines.push(` at ${location}`);
|
|
96
|
+
}
|
|
97
|
+
if (diagnostic.detail) {
|
|
98
|
+
lines.push(` detail: ${diagnostic.detail}`);
|
|
99
|
+
}
|
|
100
|
+
if (diagnostic.hint) {
|
|
101
|
+
lines.push(` hint: ${diagnostic.hint}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const repairChecklist = buildRepairChecklist(report);
|
|
106
|
+
if (repairChecklist.length) {
|
|
107
|
+
lines.push("");
|
|
108
|
+
lines.push("Repair Checklist");
|
|
109
|
+
for (const [index, item] of repairChecklist.entries()) {
|
|
110
|
+
lines.push(`${index + 1}. ${item.stepLabel}: ${item.summary}`);
|
|
111
|
+
if (item.file) {
|
|
112
|
+
const location = `${item.file}${item.line ? `:${item.line}${item.column ? `:${item.column}` : ""}` : ""}`;
|
|
113
|
+
lines.push(` at ${location}`);
|
|
114
|
+
}
|
|
115
|
+
if (item.hint) {
|
|
116
|
+
lines.push(` next: ${item.hint}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return `${lines.join("\n")}\n`;
|
|
121
|
+
}
|
|
122
|
+
export function parseTypeScriptDiagnostics(output) {
|
|
123
|
+
const diagnostics = [];
|
|
124
|
+
const pattern = /^(?<file>.+?)\((?<line>\d+),(?<column>\d+)\): error (?<tscode>TS\d+): (?<message>.+)$/gm;
|
|
125
|
+
for (const match of output.matchAll(pattern)) {
|
|
126
|
+
const groups = match.groups;
|
|
127
|
+
if (!groups) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const message = groups.message ?? "Unknown TypeScript error";
|
|
131
|
+
const detail = groups.tscode ?? "TS0000";
|
|
132
|
+
const file = groups.file ?? "";
|
|
133
|
+
diagnostics.push({
|
|
134
|
+
code: "typescript_error",
|
|
135
|
+
severity: "error",
|
|
136
|
+
summary: message,
|
|
137
|
+
detail,
|
|
138
|
+
hint: suggestRepairHint(message),
|
|
139
|
+
file,
|
|
140
|
+
line: Number(groups.line),
|
|
141
|
+
column: Number(groups.column),
|
|
142
|
+
source: "typescript"
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return diagnostics;
|
|
146
|
+
}
|
|
147
|
+
export function suggestRepairHint(message) {
|
|
148
|
+
if (message.includes("Cannot find module")) {
|
|
149
|
+
return "Check generated import paths or rerun `capstan graph:scaffold --force` to refresh framework-owned files.";
|
|
150
|
+
}
|
|
151
|
+
if (message.includes("is not assignable to type")) {
|
|
152
|
+
return "Align the handler output with the generated type contract before rerunning `capstan verify`.";
|
|
153
|
+
}
|
|
154
|
+
if (message.includes("Property") && message.includes("does not exist")) {
|
|
155
|
+
return "Compare the handler payload with the generated capability, task, or artifact contracts.";
|
|
156
|
+
}
|
|
157
|
+
return "Fix the reported issue and rerun `capstan verify` to confirm the application converges again.";
|
|
158
|
+
}
|
|
159
|
+
async function runStructureChecks(root, context) {
|
|
160
|
+
const diagnostics = [];
|
|
161
|
+
for (const relativePath of requiredGeneratedFiles) {
|
|
162
|
+
const target = resolve(root, relativePath);
|
|
163
|
+
const exists = await pathExists(target);
|
|
164
|
+
if (!exists) {
|
|
165
|
+
diagnostics.push({
|
|
166
|
+
code: "missing_file",
|
|
167
|
+
severity: "error",
|
|
168
|
+
summary: `Expected generated file "${relativePath}" is missing.`,
|
|
169
|
+
hint: "Rerun `capstan graph:scaffold --force` to restore framework-owned files.",
|
|
170
|
+
file: target,
|
|
171
|
+
source: "capstan"
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (diagnostics.length) {
|
|
176
|
+
return diagnostics;
|
|
177
|
+
}
|
|
178
|
+
const graph = await readJsonFile(resolve(root, "capstan.app.json"), diagnostics, {
|
|
179
|
+
code: "invalid_app_graph",
|
|
180
|
+
hint: "Regenerate the application so `capstan.app.json` becomes valid again."
|
|
181
|
+
});
|
|
182
|
+
if (graph) {
|
|
183
|
+
context.graph = graph;
|
|
184
|
+
}
|
|
185
|
+
const manifest = await readJsonFile(resolve(root, "agent-surface.json"), diagnostics, {
|
|
186
|
+
code: "invalid_agent_surface_manifest",
|
|
187
|
+
hint: "Regenerate the application so `agent-surface.json` matches the current compiler output."
|
|
188
|
+
});
|
|
189
|
+
if (manifest) {
|
|
190
|
+
context.manifest = manifest;
|
|
191
|
+
}
|
|
192
|
+
const metadata = await readJsonFile(resolve(root, ".capstan/graph-metadata.json"), diagnostics, {
|
|
193
|
+
code: "invalid_graph_metadata",
|
|
194
|
+
hint: "Regenerate the application so Capstan can rehydrate graph metadata."
|
|
195
|
+
});
|
|
196
|
+
if (metadata) {
|
|
197
|
+
context.metadata = metadata;
|
|
198
|
+
}
|
|
199
|
+
if (!context.metadata?.normalizedVersion) {
|
|
200
|
+
diagnostics.push({
|
|
201
|
+
code: "missing_normalized_version",
|
|
202
|
+
severity: "error",
|
|
203
|
+
summary: "Generated graph metadata is missing `normalizedVersion`.",
|
|
204
|
+
hint: "Regenerate the application with the current compiler.",
|
|
205
|
+
file: resolve(root, ".capstan/graph-metadata.json"),
|
|
206
|
+
source: "capstan"
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return diagnostics;
|
|
210
|
+
}
|
|
211
|
+
async function runContractChecks(root, context) {
|
|
212
|
+
const diagnostics = [];
|
|
213
|
+
const graph = context.graph;
|
|
214
|
+
const manifest = context.manifest;
|
|
215
|
+
if (!graph || !manifest) {
|
|
216
|
+
diagnostics.push({
|
|
217
|
+
code: "contracts_unavailable",
|
|
218
|
+
severity: "error",
|
|
219
|
+
summary: "Contract checks could not run because structure parsing did not complete.",
|
|
220
|
+
hint: "Fix the structure step before retrying contract verification.",
|
|
221
|
+
source: "capstan"
|
|
222
|
+
});
|
|
223
|
+
return diagnostics;
|
|
224
|
+
}
|
|
225
|
+
compareCount(diagnostics, "capability_count_mismatch", "capabilities", graph.capabilities.length, manifest.summary?.capabilityCount, root);
|
|
226
|
+
compareCount(diagnostics, "task_count_mismatch", "tasks", (graph.tasks ?? []).length, manifest.summary?.taskCount, root);
|
|
227
|
+
compareCount(diagnostics, "artifact_count_mismatch", "artifacts", (graph.artifacts ?? []).length, manifest.summary?.artifactCount, root);
|
|
228
|
+
const manifestCapabilityKeys = new Set((manifest.capabilities ?? []).map((entry) => entry.key).filter(Boolean));
|
|
229
|
+
const manifestTaskKeys = new Set((manifest.tasks ?? []).map((entry) => entry.key).filter(Boolean));
|
|
230
|
+
const manifestArtifactKeys = new Set((manifest.artifacts ?? []).map((entry) => entry.key).filter(Boolean));
|
|
231
|
+
for (const capability of graph.capabilities) {
|
|
232
|
+
if (!manifestCapabilityKeys.has(capability.key)) {
|
|
233
|
+
diagnostics.push({
|
|
234
|
+
code: "missing_capability_projection",
|
|
235
|
+
severity: "error",
|
|
236
|
+
summary: `Capability "${capability.key}" is missing from the agent surface manifest.`,
|
|
237
|
+
hint: "Regenerate the app so the manifest projection catches up with the App Graph.",
|
|
238
|
+
file: resolve(root, "agent-surface.json"),
|
|
239
|
+
source: "capstan"
|
|
240
|
+
});
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (capability.policy) {
|
|
244
|
+
const manifestCapability = (manifest.capabilities ?? []).find((entry) => entry.key === capability.key);
|
|
245
|
+
if (manifestCapability?.policy !== capability.policy) {
|
|
246
|
+
diagnostics.push({
|
|
247
|
+
code: "policy_projection_mismatch",
|
|
248
|
+
severity: "error",
|
|
249
|
+
summary: `Capability "${capability.key}" lost its policy projection.`,
|
|
250
|
+
detail: `Expected policy "${capability.policy}", received "${manifestCapability?.policy ?? "missing"}".`,
|
|
251
|
+
hint: "Regenerate the agent surface manifest so policy-aware consumers see the right boundary.",
|
|
252
|
+
file: resolve(root, "agent-surface.json"),
|
|
253
|
+
source: "capstan"
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
for (const task of graph.tasks ?? []) {
|
|
259
|
+
if (!manifestTaskKeys.has(task.key)) {
|
|
260
|
+
diagnostics.push({
|
|
261
|
+
code: "missing_task_projection",
|
|
262
|
+
severity: "error",
|
|
263
|
+
summary: `Task "${task.key}" is missing from the agent surface manifest.`,
|
|
264
|
+
hint: "Regenerate the app so task lifecycle discovery stays in sync with the App Graph.",
|
|
265
|
+
file: resolve(root, "agent-surface.json"),
|
|
266
|
+
source: "capstan"
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
for (const artifact of graph.artifacts ?? []) {
|
|
271
|
+
if (!manifestArtifactKeys.has(artifact.key)) {
|
|
272
|
+
diagnostics.push({
|
|
273
|
+
code: "missing_artifact_projection",
|
|
274
|
+
severity: "error",
|
|
275
|
+
summary: `Artifact "${artifact.key}" is missing from the agent surface manifest.`,
|
|
276
|
+
hint: "Regenerate the app so artifact discovery remains consistent for agent consumers.",
|
|
277
|
+
file: resolve(root, "agent-surface.json"),
|
|
278
|
+
source: "capstan"
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const authMode = manifest.transport?.auth?.mode;
|
|
283
|
+
const authEffects = manifest.transport?.auth?.effects ?? [];
|
|
284
|
+
if (authMode !== "hook_optional") {
|
|
285
|
+
diagnostics.push({
|
|
286
|
+
code: "missing_transport_auth_mode",
|
|
287
|
+
severity: "error",
|
|
288
|
+
summary: "Generated manifest is missing the expected transport auth mode.",
|
|
289
|
+
detail: `Expected "hook_optional", received "${authMode ?? "missing"}".`,
|
|
290
|
+
hint: "Regenerate the app so transport auth hooks remain discoverable.",
|
|
291
|
+
file: resolve(root, "agent-surface.json"),
|
|
292
|
+
source: "capstan"
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
for (const effect of ["allow", "approve", "deny", "redact"]) {
|
|
296
|
+
if (!authEffects.includes(effect)) {
|
|
297
|
+
diagnostics.push({
|
|
298
|
+
code: "missing_transport_auth_effect",
|
|
299
|
+
severity: "error",
|
|
300
|
+
summary: `Transport auth effect "${effect}" is missing from the agent surface manifest.`,
|
|
301
|
+
hint: "Regenerate the app so agent consumers can reason about the available auth effects.",
|
|
302
|
+
file: resolve(root, "agent-surface.json"),
|
|
303
|
+
source: "capstan"
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return diagnostics;
|
|
308
|
+
}
|
|
309
|
+
async function runTypeScriptCheck(root) {
|
|
310
|
+
return runTypeScriptCommand(root, true);
|
|
311
|
+
}
|
|
312
|
+
async function runTypeScriptBuild(root) {
|
|
313
|
+
return runTypeScriptCommand(root, false);
|
|
314
|
+
}
|
|
315
|
+
async function runAssertionChecks(root) {
|
|
316
|
+
const diagnostics = [];
|
|
317
|
+
const assertionModulePath = resolve(root, "dist/assertions/index.js");
|
|
318
|
+
if (!(await pathExists(assertionModulePath))) {
|
|
319
|
+
return [
|
|
320
|
+
{
|
|
321
|
+
code: "missing_assertion_output",
|
|
322
|
+
severity: "error",
|
|
323
|
+
summary: 'Expected assertion build output "dist/assertions/index.js" is missing.',
|
|
324
|
+
hint: "Keep the generated assertions module in the build output so Capstan can run app assertions.",
|
|
325
|
+
file: assertionModulePath,
|
|
326
|
+
source: "capstan"
|
|
327
|
+
}
|
|
328
|
+
];
|
|
329
|
+
}
|
|
330
|
+
try {
|
|
331
|
+
const moduleUrl = `${pathToFileURL(assertionModulePath).href}?t=${Date.now()}-assertions`;
|
|
332
|
+
const loaded = (await import(moduleUrl));
|
|
333
|
+
const runAppAssertions = loaded.runAppAssertions;
|
|
334
|
+
if (!runAppAssertions || typeof runAppAssertions !== "function") {
|
|
335
|
+
return [
|
|
336
|
+
{
|
|
337
|
+
code: "missing_assertion_runner",
|
|
338
|
+
severity: "error",
|
|
339
|
+
summary: "Built assertions module does not export `runAppAssertions`.",
|
|
340
|
+
hint: "Preserve the generated assertions runtime so Capstan can execute graph-derived checks.",
|
|
341
|
+
file: assertionModulePath,
|
|
342
|
+
source: "capstan"
|
|
343
|
+
}
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
const runs = await runAppAssertions();
|
|
347
|
+
if (!Array.isArray(runs)) {
|
|
348
|
+
return [
|
|
349
|
+
{
|
|
350
|
+
code: "invalid_assertion_runner_result",
|
|
351
|
+
severity: "error",
|
|
352
|
+
summary: "Built assertions module returned an unexpected result shape.",
|
|
353
|
+
hint: "Keep `runAppAssertions` returning an array of assertion run records.",
|
|
354
|
+
file: assertionModulePath,
|
|
355
|
+
source: "capstan"
|
|
356
|
+
}
|
|
357
|
+
];
|
|
358
|
+
}
|
|
359
|
+
for (const run of runs) {
|
|
360
|
+
if (!isAssertionRunRecord(run)) {
|
|
361
|
+
diagnostics.push({
|
|
362
|
+
code: "invalid_assertion_run_record",
|
|
363
|
+
severity: "error",
|
|
364
|
+
summary: "One generated assertion run returned an invalid result record.",
|
|
365
|
+
hint: "Keep app assertions returning `{ assertion, result }` records with stable fields.",
|
|
366
|
+
file: assertionModulePath,
|
|
367
|
+
source: "capstan"
|
|
368
|
+
});
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if (run.result.status !== "failed") {
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
diagnostics.push({
|
|
375
|
+
code: "app_assertion_failed",
|
|
376
|
+
severity: "error",
|
|
377
|
+
summary: run.result.summary ?? `Assertion "${run.assertion.key ?? "unknown"}" failed.`,
|
|
378
|
+
...(run.result.detail ? { detail: run.result.detail } : {}),
|
|
379
|
+
...(run.result.hint ? { hint: run.result.hint } : {}),
|
|
380
|
+
...(run.result.file
|
|
381
|
+
? { file: resolve(root, run.result.file) }
|
|
382
|
+
: { file: assertionModulePath }),
|
|
383
|
+
source: "capstan"
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
return [
|
|
389
|
+
{
|
|
390
|
+
code: "assertion_runtime_failed",
|
|
391
|
+
severity: "error",
|
|
392
|
+
summary: "Generated assertions failed while importing or executing.",
|
|
393
|
+
detail: error instanceof Error ? error.stack ?? error.message : String(error),
|
|
394
|
+
hint: "Fix the generated or custom assertion runtime before rerunning `capstan verify`.",
|
|
395
|
+
file: assertionModulePath,
|
|
396
|
+
source: "capstan"
|
|
397
|
+
}
|
|
398
|
+
];
|
|
399
|
+
}
|
|
400
|
+
return diagnostics;
|
|
401
|
+
}
|
|
402
|
+
async function runTypeScriptCommand(root, noEmit) {
|
|
403
|
+
const args = ["-p", resolve(root, "tsconfig.json")];
|
|
404
|
+
if (noEmit) {
|
|
405
|
+
args.push("--noEmit");
|
|
406
|
+
}
|
|
407
|
+
try {
|
|
408
|
+
await execFileAsync(tscBinary, args, {
|
|
409
|
+
cwd: root
|
|
410
|
+
});
|
|
411
|
+
return [];
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
const failed = error;
|
|
415
|
+
const combined = [failed.stdout ?? "", failed.stderr ?? ""].filter(Boolean).join("\n");
|
|
416
|
+
const diagnostics = parseTypeScriptDiagnostics(combined);
|
|
417
|
+
if (diagnostics.length) {
|
|
418
|
+
return diagnostics;
|
|
419
|
+
}
|
|
420
|
+
return [
|
|
421
|
+
{
|
|
422
|
+
code: "typescript_error",
|
|
423
|
+
severity: "error",
|
|
424
|
+
summary: noEmit ? "TypeScript verification failed." : "Generated build failed.",
|
|
425
|
+
detail: combined.trim() || formatTypeScriptCommand(root, noEmit),
|
|
426
|
+
hint: noEmit
|
|
427
|
+
? "Fix the generated application type errors and rerun `capstan verify`."
|
|
428
|
+
: "Fix the generated application build errors and rerun `capstan verify`.",
|
|
429
|
+
source: "typescript"
|
|
430
|
+
}
|
|
431
|
+
];
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
async function runSmokeChecks(root) {
|
|
435
|
+
const diagnostics = [];
|
|
436
|
+
const distIndexPath = resolve(root, "dist/index.js");
|
|
437
|
+
const exists = await pathExists(distIndexPath);
|
|
438
|
+
if (!exists) {
|
|
439
|
+
return [
|
|
440
|
+
{
|
|
441
|
+
code: "missing_build_output",
|
|
442
|
+
severity: "error",
|
|
443
|
+
summary: 'Expected build output "dist/index.js" is missing.',
|
|
444
|
+
hint: "Run the generated build again and make sure dist output is emitted before smoke verification.",
|
|
445
|
+
file: distIndexPath,
|
|
446
|
+
source: "capstan"
|
|
447
|
+
}
|
|
448
|
+
];
|
|
449
|
+
}
|
|
450
|
+
try {
|
|
451
|
+
const moduleUrl = `${pathToFileURL(distIndexPath).href}?t=${Date.now()}`;
|
|
452
|
+
const loaded = (await import(moduleUrl));
|
|
453
|
+
const domain = loaded.domain;
|
|
454
|
+
const agentSurfaceManifest = loaded.agentSurfaceManifest;
|
|
455
|
+
const humanSurfaceHtml = loaded.humanSurfaceHtml;
|
|
456
|
+
const renderAgentSurfaceManifest = loaded.renderAgentSurfaceManifest;
|
|
457
|
+
const renderHumanSurfaceDocument = loaded.renderHumanSurfaceDocument;
|
|
458
|
+
const controlPlane = loaded.controlPlane;
|
|
459
|
+
const handleAgentSurfaceRequest = loaded.handleAgentSurfaceRequest;
|
|
460
|
+
const parsedManifest = typeof agentSurfaceManifest === "string"
|
|
461
|
+
? parseAgentSurfaceManifest(agentSurfaceManifest, diagnostics, distIndexPath)
|
|
462
|
+
: undefined;
|
|
463
|
+
if (!domain || typeof domain.key !== "string" || !domain.key) {
|
|
464
|
+
diagnostics.push({
|
|
465
|
+
code: "missing_domain_export",
|
|
466
|
+
severity: "error",
|
|
467
|
+
summary: "Smoke check could not resolve a valid domain export from the built application.",
|
|
468
|
+
hint: "Ensure the generated root module still exports `domain` after custom edits.",
|
|
469
|
+
file: distIndexPath,
|
|
470
|
+
source: "capstan"
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
if (typeof agentSurfaceManifest !== "string") {
|
|
474
|
+
diagnostics.push({
|
|
475
|
+
code: "missing_agent_surface_manifest_export",
|
|
476
|
+
severity: "error",
|
|
477
|
+
summary: "Smoke check could not find `agentSurfaceManifest` in the built application.",
|
|
478
|
+
hint: "Preserve the generated agent surface exports in `src/index.ts` and rerun the build.",
|
|
479
|
+
file: distIndexPath,
|
|
480
|
+
source: "capstan"
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
if (!renderAgentSurfaceManifest || typeof renderAgentSurfaceManifest !== "function") {
|
|
484
|
+
diagnostics.push({
|
|
485
|
+
code: "missing_agent_surface_manifest_renderer",
|
|
486
|
+
severity: "error",
|
|
487
|
+
summary: "Smoke check could not find `renderAgentSurfaceManifest` in the built application.",
|
|
488
|
+
hint: "Preserve the generated agent surface renderer so transport consumers can rehydrate the manifest.",
|
|
489
|
+
file: distIndexPath,
|
|
490
|
+
source: "capstan"
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
else if (typeof agentSurfaceManifest === "string" &&
|
|
494
|
+
renderAgentSurfaceManifest() !== agentSurfaceManifest) {
|
|
495
|
+
diagnostics.push({
|
|
496
|
+
code: "agent_surface_manifest_render_mismatch",
|
|
497
|
+
severity: "error",
|
|
498
|
+
summary: "Built `renderAgentSurfaceManifest()` no longer matches the exported manifest string.",
|
|
499
|
+
hint: "Keep the generated agent surface render function aligned with the built manifest export.",
|
|
500
|
+
file: distIndexPath,
|
|
501
|
+
source: "capstan"
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
if (typeof humanSurfaceHtml !== "string" || !humanSurfaceHtml.includes("Capstan Human Surface")) {
|
|
505
|
+
diagnostics.push({
|
|
506
|
+
code: "missing_human_surface_export",
|
|
507
|
+
severity: "error",
|
|
508
|
+
summary: "Smoke check could not load the built human surface document.",
|
|
509
|
+
hint: "Keep the generated human surface exports intact so Capstan can project runtime HTML.",
|
|
510
|
+
file: distIndexPath,
|
|
511
|
+
source: "capstan"
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
if (!renderHumanSurfaceDocument || typeof renderHumanSurfaceDocument !== "function") {
|
|
515
|
+
diagnostics.push({
|
|
516
|
+
code: "missing_human_surface_renderer",
|
|
517
|
+
severity: "error",
|
|
518
|
+
summary: "Smoke check could not find `renderHumanSurfaceDocument` in the built application.",
|
|
519
|
+
hint: "Preserve the generated human surface renderer so Capstan can rebuild runtime HTML deterministically.",
|
|
520
|
+
file: distIndexPath,
|
|
521
|
+
source: "capstan"
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
else if (typeof humanSurfaceHtml === "string" &&
|
|
525
|
+
renderHumanSurfaceDocument() !== humanSurfaceHtml) {
|
|
526
|
+
diagnostics.push({
|
|
527
|
+
code: "human_surface_render_mismatch",
|
|
528
|
+
severity: "error",
|
|
529
|
+
summary: "Built `renderHumanSurfaceDocument()` no longer matches the exported human surface HTML.",
|
|
530
|
+
hint: "Keep the generated human surface render function aligned with the built HTML export.",
|
|
531
|
+
file: distIndexPath,
|
|
532
|
+
source: "capstan"
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
if (!controlPlane?.search || typeof controlPlane.search !== "function") {
|
|
536
|
+
diagnostics.push({
|
|
537
|
+
code: "missing_control_plane_search",
|
|
538
|
+
severity: "error",
|
|
539
|
+
summary: "Smoke check could not call `controlPlane.search` from the built application.",
|
|
540
|
+
hint: "Preserve the generated control plane export in `src/index.ts` and rerun the build.",
|
|
541
|
+
file: distIndexPath,
|
|
542
|
+
source: "capstan"
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
const searchResult = controlPlane.search("");
|
|
547
|
+
const searchRecord = searchResult;
|
|
548
|
+
if (!searchRecord ||
|
|
549
|
+
!Array.isArray(searchRecord.capabilities) ||
|
|
550
|
+
!Array.isArray(searchRecord.tasks) ||
|
|
551
|
+
!Array.isArray(searchRecord.artifacts)) {
|
|
552
|
+
diagnostics.push({
|
|
553
|
+
code: "invalid_control_plane_search_result",
|
|
554
|
+
severity: "error",
|
|
555
|
+
summary: "Built `controlPlane.search` returned an unexpected result shape.",
|
|
556
|
+
hint: "Keep the generated control plane result contract stable so agents can rely on it.",
|
|
557
|
+
file: distIndexPath,
|
|
558
|
+
source: "capstan"
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
else if (parsedManifest &&
|
|
562
|
+
(searchRecord.capabilities.length !== (parsedManifest.summary?.capabilityCount ?? 0) ||
|
|
563
|
+
searchRecord.tasks.length !== (parsedManifest.summary?.taskCount ?? 0) ||
|
|
564
|
+
searchRecord.artifacts.length !== (parsedManifest.summary?.artifactCount ?? 0))) {
|
|
565
|
+
diagnostics.push({
|
|
566
|
+
code: "control_plane_search_count_mismatch",
|
|
567
|
+
severity: "error",
|
|
568
|
+
summary: "Built `controlPlane.search` no longer returns the manifest-sized discovery result for an empty query.",
|
|
569
|
+
detail: `Expected ${parsedManifest.summary?.capabilityCount ?? 0} capabilities, ${parsedManifest.summary?.taskCount ?? 0} tasks, and ${parsedManifest.summary?.artifactCount ?? 0} artifacts.`,
|
|
570
|
+
hint: "Keep search discovery aligned with the generated agent manifest so coding agents can trust both surfaces.",
|
|
571
|
+
file: distIndexPath,
|
|
572
|
+
source: "capstan"
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (!controlPlane?.execute || typeof controlPlane.execute !== "function") {
|
|
577
|
+
diagnostics.push({
|
|
578
|
+
code: "missing_control_plane_execute",
|
|
579
|
+
severity: "error",
|
|
580
|
+
summary: "Smoke check could not call `controlPlane.execute` from the built application.",
|
|
581
|
+
hint: "Preserve the generated control plane execute path so agent and human flows stay convergent.",
|
|
582
|
+
file: distIndexPath,
|
|
583
|
+
source: "capstan"
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
else if (parsedManifest?.capabilities?.[0]?.key) {
|
|
587
|
+
const capabilityKey = parsedManifest.capabilities[0].key;
|
|
588
|
+
const executionResult = await controlPlane.execute(capabilityKey, { smoke: true });
|
|
589
|
+
if (!isCapabilityExecutionResult(executionResult, capabilityKey)) {
|
|
590
|
+
diagnostics.push({
|
|
591
|
+
code: "invalid_control_plane_execute_result",
|
|
592
|
+
severity: "error",
|
|
593
|
+
summary: "Built `controlPlane.execute` returned an unexpected capability result.",
|
|
594
|
+
hint: "Keep generated capability handlers returning the standard execution result contract.",
|
|
595
|
+
file: distIndexPath,
|
|
596
|
+
source: "capstan"
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
if (!handleAgentSurfaceRequest || typeof handleAgentSurfaceRequest !== "function") {
|
|
601
|
+
diagnostics.push({
|
|
602
|
+
code: "missing_agent_transport_handler",
|
|
603
|
+
severity: "error",
|
|
604
|
+
summary: "Smoke check could not find `handleAgentSurfaceRequest` in the built application.",
|
|
605
|
+
hint: "Preserve the generated agent transport export in `src/index.ts` and rerun the build.",
|
|
606
|
+
file: distIndexPath,
|
|
607
|
+
source: "capstan"
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
const manifestResponse = await handleAgentSurfaceRequest({ operation: "manifest" });
|
|
612
|
+
if (!manifestResponse || manifestResponse.ok !== true) {
|
|
613
|
+
diagnostics.push({
|
|
614
|
+
code: "invalid_agent_transport_manifest_response",
|
|
615
|
+
severity: "error",
|
|
616
|
+
summary: "Built `handleAgentSurfaceRequest` did not return a successful manifest response.",
|
|
617
|
+
hint: "Keep the generated agent transport contract intact so external agents can discover the app.",
|
|
618
|
+
file: distIndexPath,
|
|
619
|
+
source: "capstan"
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
else if (!isManifestTransportBody(manifestResponse.body)) {
|
|
623
|
+
diagnostics.push({
|
|
624
|
+
code: "invalid_agent_transport_manifest_body",
|
|
625
|
+
severity: "error",
|
|
626
|
+
summary: "Built `handleAgentSurfaceRequest({ operation: \"manifest\" })` returned an unexpected body shape.",
|
|
627
|
+
hint: "Keep the generated transport manifest response aligned with the manifest projection.",
|
|
628
|
+
file: distIndexPath,
|
|
629
|
+
source: "capstan"
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
else if (parsedManifest &&
|
|
633
|
+
!manifestsHaveMatchingSummary(parsedManifest, manifestResponse.body.manifest)) {
|
|
634
|
+
diagnostics.push({
|
|
635
|
+
code: "agent_transport_manifest_mismatch",
|
|
636
|
+
severity: "error",
|
|
637
|
+
summary: "Built transport manifest no longer matches the exported manifest summary.",
|
|
638
|
+
hint: "Keep the generated manifest renderer and transport manifest response in sync.",
|
|
639
|
+
file: distIndexPath,
|
|
640
|
+
source: "capstan"
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
const searchResponse = await handleAgentSurfaceRequest({
|
|
644
|
+
operation: "search",
|
|
645
|
+
query: ""
|
|
646
|
+
});
|
|
647
|
+
const transportSearchBody = searchResponse.body;
|
|
648
|
+
if (!isSearchTransportResponse(transportSearchBody)) {
|
|
649
|
+
diagnostics.push({
|
|
650
|
+
code: "invalid_agent_transport_search_response",
|
|
651
|
+
severity: "error",
|
|
652
|
+
summary: "Built `handleAgentSurfaceRequest({ operation: \"search\" })` returned an unexpected body shape.",
|
|
653
|
+
hint: "Keep transport search aligned with the generated search result contract.",
|
|
654
|
+
file: distIndexPath,
|
|
655
|
+
source: "capstan"
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
else if (parsedManifest &&
|
|
659
|
+
(transportSearchBody.capabilities.length !== (parsedManifest.summary?.capabilityCount ?? 0) ||
|
|
660
|
+
transportSearchBody.tasks.length !== (parsedManifest.summary?.taskCount ?? 0) ||
|
|
661
|
+
transportSearchBody.artifacts.length !== (parsedManifest.summary?.artifactCount ?? 0))) {
|
|
662
|
+
diagnostics.push({
|
|
663
|
+
code: "agent_transport_search_count_mismatch",
|
|
664
|
+
severity: "error",
|
|
665
|
+
summary: "Built transport search no longer returns a manifest-sized discovery result for an empty query.",
|
|
666
|
+
hint: "Keep transport discovery aligned with the exported agent manifest.",
|
|
667
|
+
file: distIndexPath,
|
|
668
|
+
source: "capstan"
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
if (parsedManifest?.capabilities?.[0]?.key) {
|
|
672
|
+
const capabilityKey = parsedManifest.capabilities[0].key;
|
|
673
|
+
const executeResponse = await handleAgentSurfaceRequest({
|
|
674
|
+
operation: "execute",
|
|
675
|
+
key: capabilityKey,
|
|
676
|
+
input: { smoke: true }
|
|
677
|
+
});
|
|
678
|
+
if (!executeResponse ||
|
|
679
|
+
executeResponse.ok !== true ||
|
|
680
|
+
!isCapabilityExecutionResult(executeResponse.body, capabilityKey)) {
|
|
681
|
+
diagnostics.push({
|
|
682
|
+
code: "invalid_agent_transport_execute_response",
|
|
683
|
+
severity: "error",
|
|
684
|
+
summary: "Built transport execute path returned an unexpected capability result.",
|
|
685
|
+
hint: "Keep transport execute aligned with the generated capability execution contract.",
|
|
686
|
+
file: distIndexPath,
|
|
687
|
+
source: "capstan"
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
const humanSurfaceModuleUrl = `${pathToFileURL(resolve(root, "dist/human-surface/index.js")).href}?t=${Date.now()}-human-surface`;
|
|
693
|
+
const humanSurfaceModule = (await import(humanSurfaceModuleUrl));
|
|
694
|
+
const humanSurface = humanSurfaceModule.humanSurface;
|
|
695
|
+
const mountHumanSurfaceBrowser = humanSurfaceModule.mountHumanSurfaceBrowser;
|
|
696
|
+
const renderedDocument = typeof renderHumanSurfaceDocument === "function"
|
|
697
|
+
? renderHumanSurfaceDocument()
|
|
698
|
+
: typeof humanSurfaceHtml === "string"
|
|
699
|
+
? humanSurfaceHtml
|
|
700
|
+
: undefined;
|
|
701
|
+
if (!humanSurface || !Array.isArray(humanSurface.routes)) {
|
|
702
|
+
diagnostics.push({
|
|
703
|
+
code: "invalid_human_surface_projection",
|
|
704
|
+
severity: "error",
|
|
705
|
+
summary: "Smoke check could not resolve a valid human surface projection from the built application.",
|
|
706
|
+
hint: "Preserve the generated human surface exports so runtime HTML stays tied to graph-defined routes.",
|
|
707
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
708
|
+
source: "capstan"
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
else if (!mountHumanSurfaceBrowser || typeof mountHumanSurfaceBrowser !== "function") {
|
|
712
|
+
diagnostics.push({
|
|
713
|
+
code: "missing_human_surface_browser_mount",
|
|
714
|
+
severity: "error",
|
|
715
|
+
summary: "Smoke check could not find `mountHumanSurfaceBrowser` in the built human surface module.",
|
|
716
|
+
hint: "Keep the generated human surface browser runtime export intact.",
|
|
717
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
718
|
+
source: "capstan"
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
else if (renderedDocument) {
|
|
722
|
+
const dom = new JSDOM(renderedDocument, { url: "https://capstan.local/" });
|
|
723
|
+
const snapshot = mountHumanSurfaceBrowser(dom.window.document);
|
|
724
|
+
if (!snapshot || typeof snapshot.activeRouteKey !== "string" || !snapshot.activeRouteKey) {
|
|
725
|
+
diagnostics.push({
|
|
726
|
+
code: "invalid_human_surface_runtime_snapshot",
|
|
727
|
+
severity: "error",
|
|
728
|
+
summary: "Built human surface runtime did not return a valid snapshot.",
|
|
729
|
+
hint: "Keep the generated browser runtime returning a stable snapshot for verification and future harnesses.",
|
|
730
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
731
|
+
source: "capstan"
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
else if (humanSurface.routes[0]?.key &&
|
|
735
|
+
snapshot.activeRouteKey !== humanSurface.routes[0].key) {
|
|
736
|
+
diagnostics.push({
|
|
737
|
+
code: "unexpected_human_surface_active_route",
|
|
738
|
+
severity: "error",
|
|
739
|
+
summary: "Built human surface runtime did not activate the expected default route.",
|
|
740
|
+
detail: `Expected "${humanSurface.routes[0].key}", received "${snapshot.activeRouteKey}".`,
|
|
741
|
+
hint: "Keep the generated route order and default activation behavior stable.",
|
|
742
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
743
|
+
source: "capstan"
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
const routeNodes = Array.from(dom.window.document.querySelectorAll("[data-route-key]"));
|
|
747
|
+
if (routeNodes.length !== humanSurface.routes.length) {
|
|
748
|
+
diagnostics.push({
|
|
749
|
+
code: "human_surface_route_projection_mismatch",
|
|
750
|
+
severity: "error",
|
|
751
|
+
summary: "Built human surface document no longer projects every generated route.",
|
|
752
|
+
detail: `Expected ${humanSurface.routes.length} route nodes, received ${routeNodes.length}.`,
|
|
753
|
+
hint: "Keep the generated human surface HTML aligned with the route projection.",
|
|
754
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
755
|
+
source: "capstan"
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
const resultKeys = snapshot.results ? Object.keys(snapshot.results) : [];
|
|
759
|
+
if (resultKeys.length !== humanSurface.routes.length) {
|
|
760
|
+
diagnostics.push({
|
|
761
|
+
code: "human_surface_result_projection_mismatch",
|
|
762
|
+
severity: "error",
|
|
763
|
+
summary: "Built human surface runtime snapshot no longer tracks every generated route result.",
|
|
764
|
+
detail: `Expected ${humanSurface.routes.length} route results, received ${resultKeys.length}.`,
|
|
765
|
+
hint: "Keep runtime snapshot generation aligned with the graph-defined routes.",
|
|
766
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
767
|
+
source: "capstan"
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
const activeRouteOutput = snapshot.activeRouteKey
|
|
771
|
+
? dom.window.document.querySelector(`[data-route-result-output="${snapshot.activeRouteKey}"]`)?.textContent ?? ""
|
|
772
|
+
: "";
|
|
773
|
+
if (!activeRouteOutput.includes("route.idle")) {
|
|
774
|
+
diagnostics.push({
|
|
775
|
+
code: "invalid_human_surface_route_result_output",
|
|
776
|
+
severity: "error",
|
|
777
|
+
summary: "Built human surface route result output no longer reflects the initial idle route state.",
|
|
778
|
+
hint: "Keep the generated human surface runtime wiring the route result projection to the initial snapshot.",
|
|
779
|
+
file: resolve(root, "dist/human-surface/index.js"),
|
|
780
|
+
source: "capstan"
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
catch (error) {
|
|
786
|
+
return [
|
|
787
|
+
{
|
|
788
|
+
code: "runtime_smoke_failed",
|
|
789
|
+
severity: "error",
|
|
790
|
+
summary: "Smoke check failed while importing or executing the built application.",
|
|
791
|
+
detail: error instanceof Error ? error.stack ?? error.message : String(error),
|
|
792
|
+
hint: "Inspect the built runtime exports and fix the failing module before rerunning `capstan verify`.",
|
|
793
|
+
file: distIndexPath,
|
|
794
|
+
source: "capstan"
|
|
795
|
+
}
|
|
796
|
+
];
|
|
797
|
+
}
|
|
798
|
+
return diagnostics;
|
|
799
|
+
}
|
|
800
|
+
async function measureStep(key, label, runner, command) {
|
|
801
|
+
const startedAt = Date.now();
|
|
802
|
+
const diagnostics = await runner();
|
|
803
|
+
const durationMs = Date.now() - startedAt;
|
|
804
|
+
const hasError = diagnostics.some((diagnostic) => diagnostic.severity === "error");
|
|
805
|
+
return {
|
|
806
|
+
key,
|
|
807
|
+
label,
|
|
808
|
+
status: hasError ? "failed" : "passed",
|
|
809
|
+
durationMs,
|
|
810
|
+
diagnostics,
|
|
811
|
+
...(command ? { command } : {})
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function skippedStep(key, label, summary) {
|
|
815
|
+
return {
|
|
816
|
+
key,
|
|
817
|
+
label,
|
|
818
|
+
status: "skipped",
|
|
819
|
+
durationMs: 0,
|
|
820
|
+
diagnostics: summary
|
|
821
|
+
? [
|
|
822
|
+
{
|
|
823
|
+
code: "skipped",
|
|
824
|
+
severity: "info",
|
|
825
|
+
summary,
|
|
826
|
+
source: "capstan"
|
|
827
|
+
}
|
|
828
|
+
]
|
|
829
|
+
: []
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
function buildVerifyReport(appRoot, steps) {
|
|
833
|
+
const diagnostics = steps.flatMap((step) => step.diagnostics);
|
|
834
|
+
const failedSteps = steps.filter((step) => step.status === "failed").length;
|
|
835
|
+
const passedSteps = steps.filter((step) => step.status === "passed").length;
|
|
836
|
+
const skippedSteps = steps.filter((step) => step.status === "skipped").length;
|
|
837
|
+
const errorCount = diagnostics.filter((diagnostic) => diagnostic.severity === "error").length;
|
|
838
|
+
const warningCount = diagnostics.filter((diagnostic) => diagnostic.severity === "warning").length;
|
|
839
|
+
const status = failedSteps ? "failed" : "passed";
|
|
840
|
+
return {
|
|
841
|
+
appRoot,
|
|
842
|
+
status,
|
|
843
|
+
generatedBy: "capstan-feedback",
|
|
844
|
+
steps,
|
|
845
|
+
diagnostics,
|
|
846
|
+
summary: {
|
|
847
|
+
status,
|
|
848
|
+
stepCount: steps.length,
|
|
849
|
+
passedSteps,
|
|
850
|
+
failedSteps,
|
|
851
|
+
skippedSteps,
|
|
852
|
+
diagnosticCount: diagnostics.length,
|
|
853
|
+
errorCount,
|
|
854
|
+
warningCount
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
function formatTypeScriptCommand(root, noEmit) {
|
|
859
|
+
return `${tscBinary} -p ${resolve(root, "tsconfig.json")}${noEmit ? " --noEmit" : ""}`;
|
|
860
|
+
}
|
|
861
|
+
function buildRepairChecklist(report) {
|
|
862
|
+
const seen = new Set();
|
|
863
|
+
const items = [];
|
|
864
|
+
for (const step of report.steps) {
|
|
865
|
+
if (step.status !== "failed") {
|
|
866
|
+
continue;
|
|
867
|
+
}
|
|
868
|
+
for (const diagnostic of step.diagnostics) {
|
|
869
|
+
if (diagnostic.severity !== "error") {
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
const key = [
|
|
873
|
+
step.key,
|
|
874
|
+
diagnostic.code,
|
|
875
|
+
diagnostic.file ?? "",
|
|
876
|
+
diagnostic.summary,
|
|
877
|
+
diagnostic.hint ?? ""
|
|
878
|
+
].join("::");
|
|
879
|
+
if (seen.has(key)) {
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
seen.add(key);
|
|
883
|
+
items.push({
|
|
884
|
+
stepLabel: step.label,
|
|
885
|
+
summary: diagnostic.summary,
|
|
886
|
+
...(diagnostic.hint ? { hint: diagnostic.hint } : {}),
|
|
887
|
+
...(diagnostic.file ? { file: diagnostic.file } : {}),
|
|
888
|
+
...(diagnostic.line ? { line: diagnostic.line } : {}),
|
|
889
|
+
...(diagnostic.column ? { column: diagnostic.column } : {})
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
return items;
|
|
894
|
+
}
|
|
895
|
+
function parseAgentSurfaceManifest(manifest, diagnostics, file) {
|
|
896
|
+
try {
|
|
897
|
+
return JSON.parse(manifest);
|
|
898
|
+
}
|
|
899
|
+
catch (error) {
|
|
900
|
+
diagnostics.push({
|
|
901
|
+
code: "invalid_agent_surface_manifest_export",
|
|
902
|
+
severity: "error",
|
|
903
|
+
summary: "Built `agentSurfaceManifest` is not valid JSON.",
|
|
904
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
905
|
+
hint: "Regenerate the agent surface projection so the built manifest becomes parseable again.",
|
|
906
|
+
file,
|
|
907
|
+
source: "capstan"
|
|
908
|
+
});
|
|
909
|
+
return undefined;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
function manifestsHaveMatchingSummary(expected, received) {
|
|
913
|
+
if (!received?.summary) {
|
|
914
|
+
return false;
|
|
915
|
+
}
|
|
916
|
+
return (received.summary.capabilityCount === expected.summary?.capabilityCount &&
|
|
917
|
+
received.summary.taskCount === expected.summary?.taskCount &&
|
|
918
|
+
received.summary.artifactCount === expected.summary?.artifactCount);
|
|
919
|
+
}
|
|
920
|
+
function isManifestTransportBody(value) {
|
|
921
|
+
if (!isRecord(value)) {
|
|
922
|
+
return false;
|
|
923
|
+
}
|
|
924
|
+
return isRecord(value.manifest) && isRecord(value.summary);
|
|
925
|
+
}
|
|
926
|
+
function isSearchTransportResponse(value) {
|
|
927
|
+
return isSearchResultRecord(value);
|
|
928
|
+
}
|
|
929
|
+
function isSearchResultRecord(value) {
|
|
930
|
+
if (!isRecord(value)) {
|
|
931
|
+
return false;
|
|
932
|
+
}
|
|
933
|
+
return (Array.isArray(value.capabilities) &&
|
|
934
|
+
Array.isArray(value.tasks) &&
|
|
935
|
+
Array.isArray(value.artifacts));
|
|
936
|
+
}
|
|
937
|
+
function isCapabilityExecutionResult(value, capabilityKey) {
|
|
938
|
+
if (!isRecord(value)) {
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
return value.capability === capabilityKey && typeof value.status === "string";
|
|
942
|
+
}
|
|
943
|
+
function isAssertionRunRecord(value) {
|
|
944
|
+
if (!isRecord(value) || !isRecord(value.assertion) || !isRecord(value.result)) {
|
|
945
|
+
return false;
|
|
946
|
+
}
|
|
947
|
+
return (typeof value.assertion.key === "string" &&
|
|
948
|
+
typeof value.assertion.title === "string" &&
|
|
949
|
+
typeof value.result.status === "string" &&
|
|
950
|
+
typeof value.result.summary === "string");
|
|
951
|
+
}
|
|
952
|
+
async function readJsonFile(path, diagnostics, options) {
|
|
953
|
+
try {
|
|
954
|
+
const contents = await readFile(path, "utf8");
|
|
955
|
+
return JSON.parse(contents);
|
|
956
|
+
}
|
|
957
|
+
catch (error) {
|
|
958
|
+
diagnostics.push({
|
|
959
|
+
code: options.code,
|
|
960
|
+
severity: "error",
|
|
961
|
+
summary: `Failed to read JSON file "${path}".`,
|
|
962
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
963
|
+
hint: options.hint,
|
|
964
|
+
file: path,
|
|
965
|
+
source: "capstan"
|
|
966
|
+
});
|
|
967
|
+
return undefined;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function compareCount(diagnostics, code, label, expected, received, root) {
|
|
971
|
+
if (received === undefined || received === expected) {
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
diagnostics.push({
|
|
975
|
+
code,
|
|
976
|
+
severity: "error",
|
|
977
|
+
summary: `Generated manifest ${label} count does not match the App Graph.`,
|
|
978
|
+
detail: `Expected ${expected}, received ${received}.`,
|
|
979
|
+
hint: "Regenerate the application so compiler projections and manifests converge again.",
|
|
980
|
+
file: resolve(root, "agent-surface.json"),
|
|
981
|
+
source: "capstan"
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
async function pathExists(path) {
|
|
985
|
+
try {
|
|
986
|
+
await access(path, constants.F_OK);
|
|
987
|
+
return true;
|
|
988
|
+
}
|
|
989
|
+
catch {
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
function isRecord(value) {
|
|
994
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
995
|
+
}
|
|
996
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAA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"name": "@zauso-ai/capstan-feedback",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@zauso-ai/capstan-app-graph": "0.1.2",
|
|
22
|
+
"jsdom": "^29.0.1"
|
|
23
|
+
},
|
|
24
|
+
"description": "Verification and diagnostics for Capstan",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/barry3406/capstan.git",
|
|
28
|
+
"directory": "packages/feedback"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"author": "barry3406",
|
|
32
|
+
"homepage": "https://github.com/barry3406/capstan",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"capstan",
|
|
35
|
+
"ai-agent",
|
|
36
|
+
"full-stack",
|
|
37
|
+
"framework",
|
|
38
|
+
"mcp",
|
|
39
|
+
"a2a",
|
|
40
|
+
"typescript"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
}
|
|
45
|
+
}
|