@loucompanion/forge-bridge 0.1.4-dev.494233aa2e50 → 0.1.4-dev.60e18c3cfec6
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/README.md +35 -2
- package/dist/bridge/bridge.base.d.ts +9 -0
- package/dist/bridge/bridge.service.d.ts +72 -1
- package/dist/bridge/bridge.service.js +308 -9
- package/dist/bridge/bridge.types.d.ts +16 -0
- package/dist/bridge/local-yield-flag.d.ts +6 -0
- package/dist/bridge/local-yield-flag.js +34 -0
- package/dist/bridge/runner-host-capabilities.d.ts +2 -0
- package/dist/bridge/runner-host-capabilities.js +4 -0
- package/dist/bridge/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/cleanup/cleanup.service.d.ts +9 -0
- package/dist/cleanup/cleanup.service.js +72 -109
- package/dist/cleanup/cleanup.types.d.ts +4 -0
- package/dist/cleanup/forge-owned-paths.d.ts +9 -0
- package/dist/cleanup/forge-owned-paths.js +53 -0
- package/dist/cleanup/host-runtime-ledger.d.ts +5 -0
- package/dist/cleanup/host-runtime-ledger.js +109 -0
- package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
- package/dist/cleanup/managed-branch-sweep.js +111 -0
- package/dist/cli/cli.help.js +18 -0
- package/dist/cli/cli.service.d.ts +16 -0
- package/dist/cli/cli.service.js +142 -16
- package/dist/cli/local-config.d.ts +4 -0
- package/dist/cli/local-config.js +26 -4
- package/dist/runtime/aspnet-runtime-prebuild.js +94 -6
- package/dist/runtime/host-load-admission.d.ts +60 -0
- package/dist/runtime/host-load-admission.js +99 -0
- package/dist/runtime/host-load-child-environment.d.ts +22 -0
- package/dist/runtime/host-load-child-environment.js +67 -0
- package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
- package/dist/runtime/host-load-forge-cgroups.js +140 -0
- package/dist/runtime/host-load-governor-config.d.ts +43 -0
- package/dist/runtime/host-load-governor-config.js +76 -0
- package/dist/runtime/host-load-governor.d.ts +174 -0
- package/dist/runtime/host-load-governor.js +541 -0
- package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
- package/dist/runtime/host-load-ledger-lock.js +185 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +78 -0
- package/dist/runtime/host-load-sampler.d.ts +43 -0
- package/dist/runtime/host-load-sampler.js +74 -6
- package/dist/runtime/host-load-step-class.d.ts +68 -0
- package/dist/runtime/host-load-step-class.js +106 -0
- package/dist/runtime/host-load-step-reaper.d.ts +27 -0
- package/dist/runtime/host-load-step-reaper.js +95 -0
- package/dist/runtime/host-load-step-run.d.ts +73 -0
- package/dist/runtime/host-load-step-run.js +102 -0
- package/dist/runtime/host-load-token-ledger.d.ts +174 -0
- package/dist/runtime/host-load-token-ledger.js +421 -0
- package/dist/runtime/host-pressure-stall.d.ts +21 -1
- package/dist/runtime/host-pressure-stall.js +48 -1
- package/dist/runtime/host-runtime-contract.d.ts +3 -0
- package/dist/runtime/host-runtime-contract.js +4 -1
- package/dist/runtime/host-runtime-lease.d.ts +74 -4
- package/dist/runtime/host-runtime-lease.js +279 -10
- package/dist/runtime/host-runtime-promotion.js +12 -0
- package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
- package/dist/runtime/host-runtime-requirements-check.js +29 -0
- package/dist/runtime/host-runtime-requirements.d.ts +36 -0
- package/dist/runtime/host-runtime-requirements.js +117 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +7 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +13 -1
- package/dist/runtime/runner-settings.d.ts +100 -0
- package/dist/runtime/runner-settings.js +214 -0
- package/dist/sandbox/host-capacity-broker.d.ts +107 -0
- package/dist/sandbox/host-capacity-broker.js +315 -0
- package/dist/sandbox/runtime.d.ts +10 -1
- package/dist/sandbox/runtime.js +45 -2
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/session/managed-attempt-tools.d.ts +2 -0
- package/dist/session/managed-attempt-tools.js +156 -37
- package/dist/session/managed-command-host-load.d.ts +45 -0
- package/dist/session/managed-command-host-load.js +82 -0
- package/dist/session/mcp-argument-coercion.d.ts +23 -0
- package/dist/session/mcp-argument-coercion.js +121 -0
- package/dist/session/phase-completion.artifacts.d.ts +7 -0
- package/dist/session/phase-completion.artifacts.js +94 -25
- package/dist/session/phase-completion.command-validation.d.ts +7 -0
- package/dist/session/phase-completion.command-validation.js +77 -0
- package/dist/session/phase-completion.d.ts +4 -0
- package/dist/session/phase-completion.helpers.js +13 -12
- package/dist/session/phase-completion.js +4 -0
- package/dist/session/phase-completion.prompts.js +6 -1
- package/dist/session/phase-completion.runtime.d.ts +5 -3
- package/dist/session/phase-completion.runtime.js +49 -19
- package/dist/session/phase-completion.schema-parts.d.ts +19 -0
- package/dist/session/phase-completion.schema-parts.js +188 -0
- package/dist/session/phase-completion.schemas.d.ts +3 -3
- package/dist/session/phase-completion.schemas.js +184 -209
- package/dist/session/phase-completion.validation.d.ts +2 -3
- package/dist/session/phase-completion.validation.js +46 -92
- package/dist/session/pre-publication-host-load.d.ts +27 -0
- package/dist/session/pre-publication-host-load.js +111 -0
- package/dist/session/pre-publication-process.d.ts +3 -0
- package/dist/session/pre-publication-process.js +23 -11
- package/dist/session/pre-publication-step-execution.d.ts +11 -0
- package/dist/session/pre-publication-step-execution.js +49 -0
- package/dist/session/pre-publication-validation.d.ts +9 -9
- package/dist/session/pre-publication-validation.js +21 -55
- package/dist/session/provider-cli/provider-cli.artifacts.d.ts +2 -1
- package/dist/session/provider-cli/provider-cli.artifacts.js +20 -7
- package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +32 -1
- package/dist/session/provider-cli/provider-cli.process.js +122 -30
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +5 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +20 -2
- package/dist/session/provider-cli/provider-cli.service.d.ts +6 -0
- package/dist/session/provider-cli/provider-cli.service.js +183 -26
- package/dist/session/provider-cli/provider-cli.types.d.ts +30 -0
- package/dist/session/provider-cli/provider-in-flight-work.d.ts +6 -0
- package/dist/session/provider-cli/provider-in-flight-work.js +47 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +6 -0
- package/dist/session/provider-cli/provider-output-state.js +9 -0
- package/dist/session/publishable-worktree-changes.d.ts +10 -1
- package/dist/session/publishable-worktree-changes.js +21 -5
- package/dist/session/sandbox-host-capacity-gate.d.ts +30 -0
- package/dist/session/sandbox-host-capacity-gate.js +229 -0
- package/dist/session/session.base.d.ts +9 -1
- package/dist/session/session.service.d.ts +9 -2
- package/dist/session/session.service.js +120 -5
- package/dist/session/session.types.d.ts +3 -0
- package/dist/session/session.types.js +12 -3
- package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
- package/dist/session/workspace-runtime-fingerprint.js +138 -0
- package/dist/shared/process/host-process-supervisor.d.ts +1 -0
- package/dist/shared/process/host-process-supervisor.js +1 -1
- package/dist/shared/process/process-tree.d.ts +52 -0
- package/dist/shared/process/process-tree.js +144 -0
- package/dist/shared/process/process.d.ts +67 -0
- package/dist/shared/process/process.js +213 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/dependency-warmer.d.ts +25 -0
- package/dist/worktree/dependency-warmer.js +46 -10
- package/dist/worktree/worktree.service.d.ts +10 -1
- package/dist/worktree/worktree.service.js +42 -2
- package/dist/worktree/worktree.types.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { decomposeGateFileNames, isDebugCompletionPhase, phaseFiles, qaBlockerReasons, qaGateFileNames
|
|
2
|
-
|
|
1
|
+
import { decomposeGateFileNames, decomposeStatuses, draftStatuses, isDebugCompletionPhase, phaseFiles, qaBlockerReasons, qaGateFileNames } from "./phase-completion.js";
|
|
2
|
+
import { browserCheckSchema, qaSidecarsSchema, qaEvidenceWrapperSchema, qaGateEvidenceWrapperSchema, findingEvidenceSchema, objectToolSchema, evidenceObjectSchema, qaScopeSchema, commandEvidenceSchema, resolvedFindingSchema, acceptanceCriteriaSchema, reviewSectionSchema, reviewSectionProperties } from "./phase-completion.schema-parts.js";
|
|
3
|
+
export function toolDescription(phase, qaGate = null, decomposeGate = null, draftGate = null) {
|
|
3
4
|
if (qaGate) {
|
|
4
5
|
return qaGate === "qa_verdict"
|
|
5
6
|
? "Complete the final Forge QA verdict by writing the canonical QA bundle with pass, needs_rework, or blocked evidence."
|
|
@@ -10,6 +11,12 @@ export function toolDescription(phase, qaGate = null, decomposeGate = null) {
|
|
|
10
11
|
? "Complete the Forge Decompose proposal by writing decompose.proposal.json with candidate child items and optional structured QA scopes."
|
|
11
12
|
: `Complete the ${decomposeGate.replace(/_/g, " ")} Decompose gate by writing ${decomposeGateFileNames[decomposeGate]} before continuing.`;
|
|
12
13
|
}
|
|
14
|
+
if (phase === "draft") {
|
|
15
|
+
const gate = draftGate ?? "draft_proposal";
|
|
16
|
+
return gate === "draft_proposal"
|
|
17
|
+
? "Complete the Forge Draft proposal by writing draft.proposal.json with the drafted item in draft_json."
|
|
18
|
+
: `Complete the ${gate.replace(/_/g, " ")} Draft gate before continuing.`;
|
|
19
|
+
}
|
|
13
20
|
if (isDebugCompletionPhase(phase)) {
|
|
14
21
|
return `Complete the ${phase.replace(/_/g, " ")} Debug gate by writing ${phaseFiles[phase].jsonFileName} with structured bug-fix evidence before continuing.`;
|
|
15
22
|
}
|
|
@@ -33,7 +40,7 @@ export function toolDescription(phase, qaGate = null, decomposeGate = null) {
|
|
|
33
40
|
}
|
|
34
41
|
return "Complete Forge validation by writing validation.verdict.json with command, build/test/lint/design, drift, acceptance-criteria, and ready-for-dev-test evidence.";
|
|
35
42
|
}
|
|
36
|
-
export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
43
|
+
export function toolInputSchema(phase, qaGate = null, decomposeGate = null, draftGate = null) {
|
|
37
44
|
const baseProperties = {
|
|
38
45
|
status: {
|
|
39
46
|
type: "string",
|
|
@@ -58,6 +65,9 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
58
65
|
if (decomposeGate) {
|
|
59
66
|
return decomposeGateToolInputSchema(decomposeGate, baseProperties);
|
|
60
67
|
}
|
|
68
|
+
if (phase === "draft") {
|
|
69
|
+
return draftGateToolInputSchema(draftGate ?? "draft_proposal", baseProperties);
|
|
70
|
+
}
|
|
61
71
|
if (isDebugCompletionPhase(phase)) {
|
|
62
72
|
return debugToolInputSchema(phase, baseProperties);
|
|
63
73
|
}
|
|
@@ -67,6 +77,7 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
67
77
|
failed_checks: {
|
|
68
78
|
type: "array",
|
|
69
79
|
description: "Required and non-empty for pass. Provider check/job/step evidence inspected before repair.",
|
|
80
|
+
minItems: 1,
|
|
70
81
|
items: evidenceObjectSchema(["name", "provider_state"], {
|
|
71
82
|
name: { type: "string" },
|
|
72
83
|
provider_state: { type: "string" },
|
|
@@ -81,15 +92,16 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
81
92
|
type: "object",
|
|
82
93
|
description: "Required for pass. Include classification, summary, and concrete evidence.",
|
|
83
94
|
additionalProperties: true,
|
|
95
|
+
required: ["classification", "summary", "evidence"],
|
|
84
96
|
properties: {
|
|
85
97
|
classification: { type: "string" },
|
|
86
98
|
summary: { type: "string" },
|
|
87
|
-
evidence: { type: "array", items: { type: "string" } }
|
|
99
|
+
evidence: { type: "array", minItems: 1, description: "Non-empty list of concrete evidence strings.", items: { type: "string" } }
|
|
88
100
|
}
|
|
89
101
|
},
|
|
90
102
|
changed_files: {
|
|
91
103
|
type: "array",
|
|
92
|
-
description: "
|
|
104
|
+
description: "Required for pass, even when nothing changed: list each changed file, or send [] together with no_code_action when the repair is provider-only. Do not omit it.",
|
|
93
105
|
items: evidenceObjectSchema(["path", "summary"], {
|
|
94
106
|
path: { type: "string" },
|
|
95
107
|
summary: { type: "string" }
|
|
@@ -99,6 +111,7 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
99
111
|
type: "object",
|
|
100
112
|
description: "Required when changed_files is empty. Describe the evidence-backed provider action or blocker.",
|
|
101
113
|
additionalProperties: true,
|
|
114
|
+
required: ["action", "reason"],
|
|
102
115
|
properties: {
|
|
103
116
|
action: { type: "string" },
|
|
104
117
|
reason: { type: "string" },
|
|
@@ -107,26 +120,29 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
107
120
|
},
|
|
108
121
|
narrow_validation: {
|
|
109
122
|
type: "array",
|
|
110
|
-
description: "Required and non-empty for pass. The focused failing command or evidence-backed substitute.",
|
|
123
|
+
description: "Required and non-empty for pass. The focused failing command or evidence-backed substitute; every entry needs exit_code 0 and status pass.",
|
|
124
|
+
minItems: 1,
|
|
111
125
|
items: commandEvidenceSchema()
|
|
112
126
|
},
|
|
113
127
|
workflow_validation: {
|
|
114
128
|
type: "array",
|
|
115
|
-
description: "Required and non-empty for pass. Each failed-job guard/test/drift step with local equivalence supported, substitute, or provider_only.",
|
|
129
|
+
description: "Required and non-empty for pass. Each failed-job guard/test/drift step with local equivalence supported, substitute, or provider_only. supported and substitute entries must have run locally and passed: command, summary, exit_code 0, and status pass. provider_only entries need a reason instead.",
|
|
130
|
+
minItems: 1,
|
|
116
131
|
items: evidenceObjectSchema(["step", "equivalence", "status"], {
|
|
117
132
|
step: { type: "string" },
|
|
118
133
|
equivalence: { type: "string", enum: ["supported", "substitute", "provider_only"] },
|
|
119
|
-
command: { type: "string" },
|
|
120
|
-
exit_code: { type: "number" },
|
|
121
|
-
status: { type: "string" },
|
|
122
|
-
summary: { type: "string" },
|
|
123
|
-
reason: { type: "string" },
|
|
124
|
-
substitute: { type: "string" }
|
|
134
|
+
command: { type: "string", description: "Required unless equivalence is provider_only: the local command that ran." },
|
|
135
|
+
exit_code: { type: "number", description: "Required unless equivalence is provider_only; must be 0." },
|
|
136
|
+
status: { type: "string", default: "pass", description: "Must be pass unless equivalence is provider_only." },
|
|
137
|
+
summary: { type: "string", description: "Required unless equivalence is provider_only." },
|
|
138
|
+
reason: { type: "string", description: "Required when equivalence is provider_only: why only provider CI can prove this step." },
|
|
139
|
+
substitute: { type: "string", description: "Required when equivalence is substitute: what replaces the provider step locally." }
|
|
125
140
|
})
|
|
126
141
|
},
|
|
127
142
|
broader_validation: {
|
|
128
143
|
type: "array",
|
|
129
|
-
description: "Required and non-empty for pass. Normal validation covering every touched compiled/tested surface.",
|
|
144
|
+
description: "Required and non-empty for pass. Normal validation covering every touched compiled/tested surface; every entry needs exit_code 0 and status pass.",
|
|
145
|
+
minItems: 1,
|
|
130
146
|
items: commandEvidenceSchema()
|
|
131
147
|
},
|
|
132
148
|
remaining_risks: {
|
|
@@ -141,13 +157,14 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
141
157
|
provider_state: {
|
|
142
158
|
type: "string",
|
|
143
159
|
enum: ["ready_for_rerun", "rerun_requested", "checks_pending", "still_failing", "blocked_by_provider"],
|
|
144
|
-
description: "Provider state after local validation and before Forge-owned publication."
|
|
160
|
+
description: "Provider state after local validation and before Forge-owned publication. Required for pass, and pass accepts only ready_for_rerun, rerun_requested, or checks_pending."
|
|
145
161
|
},
|
|
146
162
|
ready_for_push: {
|
|
147
163
|
type: "boolean",
|
|
164
|
+
default: true,
|
|
148
165
|
description: "Required for pass and must be true. Forge Bridge performs the commit/push only after this gate passes."
|
|
149
166
|
}
|
|
150
|
-
}, ["status", "summary"], "For status pass, include failed_checks, root_cause, changed_files
|
|
167
|
+
}, ["status", "summary"], "For status pass, include failed_checks, root_cause, changed_files (use [] with no_code_action when nothing changed), narrow_validation, workflow_validation, broader_validation, remaining_risks, provider_state, and ready_for_push: true.");
|
|
151
168
|
}
|
|
152
169
|
if (phase === "comment_repair") {
|
|
153
170
|
return objectToolSchema({
|
|
@@ -157,6 +174,7 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
157
174
|
dispositions: {
|
|
158
175
|
type: "array",
|
|
159
176
|
description: "Exactly one outcome for every actionable dispatch finding; conversation-only comments are omitted.",
|
|
177
|
+
minItems: 1,
|
|
160
178
|
items: evidenceObjectSchema(["claim_id", "kind", "body_sha256", "disposition", "evidence"], {
|
|
161
179
|
claim_id: { type: "string" },
|
|
162
180
|
kind: { type: "string", enum: ["review_thread", "review_body", "issue_comment"] },
|
|
@@ -180,7 +198,7 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
180
198
|
},
|
|
181
199
|
validation: {
|
|
182
200
|
type: "array",
|
|
183
|
-
description: "Scoped verification evidence. May be empty only when no source change was made.",
|
|
201
|
+
description: "Scoped verification evidence. Required and non-empty when changed_files is non-empty, and then every entry needs exit_code 0 and status pass. May be empty only when no source change was made.",
|
|
184
202
|
items: commandEvidenceSchema()
|
|
185
203
|
}
|
|
186
204
|
}, ["status", "summary", "repair_head_sha", "repair_issue_key", "dispositions", "changed_files", "validation"], "Use status pass after every actionable finding has an evidence-backed disposition. Rejected and needs_decision are legitimate outcomes and must not be disguised as code changes.");
|
|
@@ -307,58 +325,56 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
307
325
|
description: "QA plan/checklist. Forge writes this to qa.plan.json; a default checklist is generated if omitted.",
|
|
308
326
|
items: { type: "string" }
|
|
309
327
|
},
|
|
328
|
+
schema_version: { type: "number", enum: [1], description: "Optional; must be 1 when sent." },
|
|
310
329
|
tested_acceptance_criteria: {
|
|
311
330
|
type: "array",
|
|
312
331
|
description: "Required and non-empty for pass/needs_rework. Criteria actually tested by QA.",
|
|
313
332
|
items: { type: "string" }
|
|
314
333
|
},
|
|
334
|
+
acceptance_criteria: {
|
|
335
|
+
type: "array",
|
|
336
|
+
description: "Optional fallback for tested_acceptance_criteria in the QA cycle when the plan gate recorded none.",
|
|
337
|
+
items: { type: "string" }
|
|
338
|
+
},
|
|
315
339
|
commands: {
|
|
316
340
|
type: "array",
|
|
317
|
-
description: "Command evidence written to qa.evidence.json.",
|
|
341
|
+
description: "Command evidence written to qa.evidence.json. When status is pass every entry needs exit_code 0 and status pass. Pass and needs_rework need at least one entry here or in browser_checks, or a notes string.",
|
|
318
342
|
items: commandEvidenceSchema()
|
|
319
343
|
},
|
|
320
344
|
browser_checks: {
|
|
321
345
|
type: "array",
|
|
322
|
-
description: "Browser/manual UI checks with URL or route, action, observed result, screenshot/trace references, console/network notes, and status.",
|
|
323
|
-
items:
|
|
324
|
-
summary: { type: "string" },
|
|
325
|
-
url: { type: "string" },
|
|
326
|
-
route: { type: "string" },
|
|
327
|
-
status: { type: "string" },
|
|
328
|
-
screenshot: { type: "string" },
|
|
329
|
-
trace: { type: "string" }
|
|
330
|
-
})
|
|
346
|
+
description: "Browser/manual UI checks with URL or route, action, observed result, screenshot/trace references, console/network notes, and status. When status is pass every entry needs status pass.",
|
|
347
|
+
items: browserCheckSchema(["summary", "status"])
|
|
331
348
|
},
|
|
332
|
-
sidecars:
|
|
349
|
+
sidecars: qaSidecarsSchema(),
|
|
350
|
+
notes: { type: "string", description: "Additional QA evidence notes." },
|
|
351
|
+
evidence: qaEvidenceWrapperSchema(),
|
|
352
|
+
finding_ids: {
|
|
333
353
|
type: "array",
|
|
334
|
-
description: "Optional
|
|
335
|
-
items:
|
|
336
|
-
path: { type: "string" },
|
|
337
|
-
content_hash: { type: "string" },
|
|
338
|
-
bytes: { type: "number" }
|
|
339
|
-
})
|
|
354
|
+
description: "Optional ids of the in-scope findings this verdict reports. Each must match the id of an entry in findings with scope in_scope; omit it to derive the ids from findings. Not allowed on pass.",
|
|
355
|
+
items: { type: "string" }
|
|
340
356
|
},
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
357
|
+
candidate_bug_ids: {
|
|
358
|
+
type: "array",
|
|
359
|
+
description: "Optional ids of candidate bugs; each must match the id of an entry in candidate_bugs. Omit it to derive the ids from candidate_bugs.",
|
|
360
|
+
items: { type: "string" }
|
|
345
361
|
},
|
|
346
362
|
findings: {
|
|
347
363
|
type: "array",
|
|
348
|
-
description: "QA findings. needs_rework requires at least one actionable in_scope finding.",
|
|
364
|
+
description: "QA findings. needs_rework requires at least one actionable in_scope finding; pass allows none. An in_scope finding also requires non-empty acceptance_criteria, repro_steps, and likely_area arrays, expected, actual, an evidence object, required_fix, and required_regression.",
|
|
349
365
|
items: evidenceObjectSchema(["id", "severity", "scope", "title"], {
|
|
350
366
|
id: { type: "string" },
|
|
351
367
|
severity: { type: "string", enum: ["critical", "major", "minor"] },
|
|
352
368
|
scope: { type: "string", enum: ["in_scope", "out_of_scope", "unclear"] },
|
|
353
369
|
title: { type: "string" },
|
|
354
|
-
acceptance_criteria: { type: "array", items: { type: "string" } },
|
|
355
|
-
repro_steps: { type: "array", items: { type: "string" } },
|
|
356
|
-
expected: { type: "string" },
|
|
357
|
-
actual: { type: "string" },
|
|
358
|
-
evidence:
|
|
359
|
-
likely_area: { type: "array", items: { type: "string" } },
|
|
360
|
-
required_fix: { type: "string" },
|
|
361
|
-
required_regression: { type: "string" }
|
|
370
|
+
acceptance_criteria: { type: "array", description: "Required and non-empty for an in_scope finding.", items: { type: "string" } },
|
|
371
|
+
repro_steps: { type: "array", description: "Required and non-empty for an in_scope finding.", items: { type: "string" } },
|
|
372
|
+
expected: { type: "string", description: "Required for an in_scope finding." },
|
|
373
|
+
actual: { type: "string", description: "Required for an in_scope finding." },
|
|
374
|
+
evidence: findingEvidenceSchema("Required for an in_scope finding."),
|
|
375
|
+
likely_area: { type: "array", description: "Required and non-empty for an in_scope finding.", items: { type: "string" } },
|
|
376
|
+
required_fix: { type: "string", description: "Required for an in_scope finding." },
|
|
377
|
+
required_regression: { type: "string", description: "Required for an in_scope finding." }
|
|
362
378
|
})
|
|
363
379
|
},
|
|
364
380
|
candidate_bugs: {
|
|
@@ -370,7 +386,7 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
370
386
|
severity: { type: "string" },
|
|
371
387
|
scope_reason: { type: "string" },
|
|
372
388
|
repro_steps: { type: "array", items: { type: "string" } },
|
|
373
|
-
evidence:
|
|
389
|
+
evidence: findingEvidenceSchema("Optional evidence object."),
|
|
374
390
|
suggested_action: { type: "string", enum: ["create_bug", "create_follow_up", "accept_risk", "attach_to_current_item"] }
|
|
375
391
|
})
|
|
376
392
|
},
|
|
@@ -381,7 +397,7 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
381
397
|
code: { type: "string" },
|
|
382
398
|
message: { type: "string" },
|
|
383
399
|
severity: { type: "string" },
|
|
384
|
-
evidence: { type: "object" }
|
|
400
|
+
evidence: { type: "object", description: "Optional evidence object." }
|
|
385
401
|
})
|
|
386
402
|
},
|
|
387
403
|
blocker_reason: {
|
|
@@ -401,28 +417,40 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
401
417
|
summary: { type: "string", description: "Concise Architect plan verdict summary." },
|
|
402
418
|
implementation_plan: {
|
|
403
419
|
type: "object",
|
|
404
|
-
description: "Required for pass. Top-level fields inside this object must include schema_version, plan_id, phases, tasks, dependencies, and phase_gates.",
|
|
420
|
+
description: "Required for pass; may be omitted for needs_revision or blocked. Top-level fields inside this object must include schema_version, plan_id, phases, tasks, dependencies, and phase_gates.",
|
|
405
421
|
additionalProperties: true,
|
|
422
|
+
required: ["schema_version", "plan_id", "phases", "tasks", "dependencies", "phase_gates"],
|
|
406
423
|
properties: {
|
|
407
424
|
schema_version: { type: "number", enum: [1] },
|
|
408
425
|
plan_id: { type: "string" },
|
|
409
426
|
phases: {
|
|
410
427
|
type: "array",
|
|
411
|
-
description: "Required top-level implementation_plan.phases array.",
|
|
428
|
+
description: "Required non-empty top-level implementation_plan.phases array.",
|
|
429
|
+
minItems: 1,
|
|
412
430
|
items: { type: "object", additionalProperties: true }
|
|
413
431
|
},
|
|
414
432
|
tasks: {
|
|
415
433
|
type: "array",
|
|
416
|
-
description: "Required Develop child task list. Each task must
|
|
434
|
+
description: "Required non-empty Develop child task list. Each task must have a unique id, a non-empty acceptance_criteria string array, and a non-empty tests array, and should include verification_scope for task-level QA evidence. Do not put parent-story QA/sign-off, child-count/materialization inventory, parent plan artifact checks, or final acceptance proof here; those belong in qa_plan.final_qa.",
|
|
435
|
+
minItems: 1,
|
|
417
436
|
items: {
|
|
418
437
|
type: "object",
|
|
419
438
|
additionalProperties: true,
|
|
439
|
+
required: ["id", "acceptance_criteria", "tests"],
|
|
420
440
|
properties: {
|
|
421
|
-
id: { type: "string" },
|
|
441
|
+
id: { type: "string", description: "Unique, stable task id." },
|
|
422
442
|
title: { type: "string" },
|
|
443
|
+
acceptance_criteria: {
|
|
444
|
+
type: "array",
|
|
445
|
+
minItems: 1,
|
|
446
|
+
description: "Required: at least one independently testable acceptance criterion for this child task, each a non-empty string.",
|
|
447
|
+
items: { type: "string" }
|
|
448
|
+
},
|
|
423
449
|
verification_scope: qaScopeSchema("Task-level QA/verification scope for the materialized child task."),
|
|
424
450
|
tests: {
|
|
425
451
|
type: "array",
|
|
452
|
+
minItems: 1,
|
|
453
|
+
description: "Required non-empty task-specific verification.",
|
|
426
454
|
items: { type: "object", additionalProperties: true }
|
|
427
455
|
}
|
|
428
456
|
}
|
|
@@ -448,19 +476,22 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
448
476
|
phase_gates: {
|
|
449
477
|
type: "array",
|
|
450
478
|
description: "Required non-empty phase gate array.",
|
|
479
|
+
minItems: 1,
|
|
451
480
|
items: { type: "object", additionalProperties: true }
|
|
452
481
|
}
|
|
453
482
|
}
|
|
454
483
|
},
|
|
455
484
|
qa_plan: {
|
|
456
485
|
type: "object",
|
|
457
|
-
description: "Required for pass. Must include schema_version: 1 and non-empty final_qa coverage.",
|
|
486
|
+
description: "Required for pass; may be omitted for needs_revision or blocked. Must include schema_version: 1 and non-empty final_qa coverage.",
|
|
458
487
|
additionalProperties: true,
|
|
488
|
+
required: ["schema_version", "final_qa"],
|
|
459
489
|
properties: {
|
|
460
490
|
schema_version: { type: "number", enum: [1] },
|
|
461
491
|
final_qa: {
|
|
462
492
|
type: "array",
|
|
463
493
|
description: "Required non-empty final QA coverage array.",
|
|
494
|
+
minItems: 1,
|
|
464
495
|
items: { type: "object", additionalProperties: true }
|
|
465
496
|
}
|
|
466
497
|
}
|
|
@@ -478,20 +509,21 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
478
509
|
description: "Concrete reasons that prevent pass status.",
|
|
479
510
|
items: { type: "string" }
|
|
480
511
|
}
|
|
481
|
-
}, ["status", "summary"], "For status pass, include implementation_plan and qa_plan at the top level of the MCP tool arguments. implementation_plan.phases must be a top-level array inside implementation_plan, not nested under another object.");
|
|
512
|
+
}, ["status", "summary"], "For status pass, include implementation_plan and qa_plan at the top level of the MCP tool arguments, as JSON objects rather than quoted strings. implementation_plan.phases must be a top-level array inside implementation_plan, not nested under another object. For needs_revision or blocked, implementation_plan and qa_plan may be omitted; include blockers, revision_questions, or revision_reasons instead.");
|
|
482
513
|
}
|
|
483
514
|
return objectToolSchema({
|
|
484
515
|
...baseProperties,
|
|
485
516
|
commands: {
|
|
486
517
|
type: "array",
|
|
487
|
-
description: "Required for pass. Include at least one deterministic validation command
|
|
518
|
+
description: "Required for pass. Include at least one deterministic validation command; for pass every entry needs exit_code: 0 and status: pass.",
|
|
519
|
+
minItems: 1,
|
|
488
520
|
items: commandEvidenceSchema()
|
|
489
521
|
},
|
|
490
522
|
acceptance_criteria: acceptanceCriteriaSchema(),
|
|
491
|
-
build_status: { type: "string", description: "Required for pass and must be pass." },
|
|
492
|
-
test_status: { type: "string", description: "Required for pass and must be pass." },
|
|
493
|
-
lint_status: { type: "string", description: "Required for pass.
|
|
494
|
-
design_status: { type: "string", description: "Required for pass.
|
|
523
|
+
build_status: { type: "string", default: "pass", description: "Required for pass and must be pass." },
|
|
524
|
+
test_status: { type: "string", default: "pass", description: "Required for pass and must be pass." },
|
|
525
|
+
lint_status: { type: "string", default: "pass", description: "Required for pass, and pass accepts pass or not_applicable. Otherwise fail/needs_rework." },
|
|
526
|
+
design_status: { type: "string", default: "pass", description: "Required for pass, and pass accepts pass or not_applicable. Otherwise fail/needs_rework." },
|
|
495
527
|
drift_checks: {
|
|
496
528
|
type: "array",
|
|
497
529
|
description: "Required for pass. Deterministic checks for unintended drift.",
|
|
@@ -501,10 +533,19 @@ export function toolInputSchema(phase, qaGate = null, decomposeGate = null) {
|
|
|
501
533
|
summary: { type: "string" }
|
|
502
534
|
})
|
|
503
535
|
},
|
|
504
|
-
ready_for_dev_test: { type: "boolean", description: "Required for pass and must be true." }
|
|
536
|
+
ready_for_dev_test: { type: "boolean", default: true, description: "Required for pass and must be true." }
|
|
505
537
|
}, ["status", "summary"], "For status pass, commands must include at least one passing deterministic command, acceptance criteria entries must use status: satisfied plus evidence, and ready_for_dev_test must be true.");
|
|
506
538
|
}
|
|
507
|
-
function decomposeGateToolInputSchema(gate,
|
|
539
|
+
function decomposeGateToolInputSchema(gate, phaseProperties) {
|
|
540
|
+
// Advertise every status the Decompose writer accepts, so the schema and the runtime agree.
|
|
541
|
+
const baseProperties = {
|
|
542
|
+
...phaseProperties,
|
|
543
|
+
status: {
|
|
544
|
+
type: "string",
|
|
545
|
+
enum: [...decomposeStatuses],
|
|
546
|
+
description: "Use pass when the gate is complete (an omitted status means pass); needs_rework, needs_revision, fail, failed, or blocked (with blockers or findings) otherwise."
|
|
547
|
+
}
|
|
548
|
+
};
|
|
508
549
|
if (gate !== "decompose_proposal") {
|
|
509
550
|
return objectToolSchema({
|
|
510
551
|
...baseProperties,
|
|
@@ -512,8 +553,12 @@ function decomposeGateToolInputSchema(gate, baseProperties) {
|
|
|
512
553
|
type: "array",
|
|
513
554
|
description: "Optional issues, constraints, or risks discovered in this Decompose gate.",
|
|
514
555
|
items: { type: "object", additionalProperties: true }
|
|
556
|
+
},
|
|
557
|
+
summary: {
|
|
558
|
+
type: "string",
|
|
559
|
+
description: "Required. What this gate checked or decided, in a sentence or two; it is the gate's evidence."
|
|
515
560
|
}
|
|
516
|
-
}, ["
|
|
561
|
+
}, ["summary"], `Record the ${gate.replace(/_/g, " ")} Decompose gate before continuing.`);
|
|
517
562
|
}
|
|
518
563
|
const candidateSchema = {
|
|
519
564
|
type: "object",
|
|
@@ -552,7 +597,8 @@ function decomposeGateToolInputSchema(gate, baseProperties) {
|
|
|
552
597
|
const proposalSchema = {
|
|
553
598
|
type: "object",
|
|
554
599
|
additionalProperties: true,
|
|
555
|
-
description: "Final Decompose proposal JSON. Must include candidates, and may include blockedReason.",
|
|
600
|
+
description: "Required unless decomposition_json is sent instead (send one of the two). Final Decompose proposal JSON. Must include candidates, and may include blockedReason.",
|
|
601
|
+
required: ["candidates"],
|
|
556
602
|
properties: {
|
|
557
603
|
summary: { type: "string" },
|
|
558
604
|
blockedReason: { type: "string" },
|
|
@@ -567,15 +613,51 @@ function decomposeGateToolInputSchema(gate, baseProperties) {
|
|
|
567
613
|
...baseProperties,
|
|
568
614
|
status: {
|
|
569
615
|
type: "string",
|
|
570
|
-
enum: [
|
|
571
|
-
description: "Use pass only when the Decompose proposal is ready for user sign-off."
|
|
616
|
+
enum: [...decomposeStatuses],
|
|
617
|
+
description: "Use pass only when the Decompose proposal is ready for user sign-off; needs_rework, needs_revision, fail, failed, or blocked otherwise."
|
|
572
618
|
},
|
|
573
619
|
proposal_json: proposalSchema,
|
|
574
620
|
decomposition_json: {
|
|
575
621
|
...proposalSchema,
|
|
576
|
-
description: "Alias for proposal_json
|
|
622
|
+
description: "Alias for proposal_json, for a client that cannot send proposal_json. Required unless proposal_json is sent (send one of the two)."
|
|
623
|
+
}
|
|
624
|
+
// proposal_json and its decomposition_json alias are each required unless the other is sent, so
|
|
625
|
+
// neither is listed as required: an alias-only call is valid, as the writer accepts it.
|
|
626
|
+
}, [], "For the final Decompose proposal, include proposal_json (or its alias decomposition_json) with a candidates array. Work Order-to-Feature candidates may include estimatedQaScope/estimated_qa_scope; Feature-to-Story candidates may include qaScope/qa_scope. Both levels may include designerRefCandidates/designer_ref_candidates.");
|
|
627
|
+
}
|
|
628
|
+
function draftGateToolInputSchema(gate, baseProperties) {
|
|
629
|
+
const status = {
|
|
630
|
+
type: "string",
|
|
631
|
+
enum: [...draftStatuses],
|
|
632
|
+
description: "Use pass when the gate is complete (an omitted status means pass); needs_revision, needs_rework, or blocked otherwise."
|
|
633
|
+
};
|
|
634
|
+
if (gate !== "draft_proposal") {
|
|
635
|
+
const summary = {
|
|
636
|
+
type: "string",
|
|
637
|
+
description: "Required. What this gate checked or decided, in a sentence or two; it is the gate's evidence."
|
|
638
|
+
};
|
|
639
|
+
return objectToolSchema({ ...baseProperties, status, summary }, ["summary"], `Record the ${gate.replace(/_/g, " ")} Draft gate before continuing.`);
|
|
640
|
+
}
|
|
641
|
+
return objectToolSchema({
|
|
642
|
+
...baseProperties,
|
|
643
|
+
status,
|
|
644
|
+
draft_json: {
|
|
645
|
+
type: "object",
|
|
646
|
+
additionalProperties: true,
|
|
647
|
+
description: "Required. The drafted item as a JSON object, in one of three shapes: a work item (non-empty title, description, and acceptanceCriteria strings), a Work Order (non-empty title, summary, objective, planningPacket, and decompositionContext strings), or a decomposition (non-empty summary string and a candidates array). Optional suggested_qa_scope must be a QA scope object.",
|
|
648
|
+
properties: {
|
|
649
|
+
title: { type: "string", description: "Required and non-empty for a work item or Work Order draft." },
|
|
650
|
+
summary: { type: "string", description: "Required and non-empty for a Work Order or decomposition draft." },
|
|
651
|
+
description: { type: "string", description: "Required and non-empty for a work item draft." },
|
|
652
|
+
acceptanceCriteria: { type: "string", description: "Required and non-empty for a work item draft." },
|
|
653
|
+
objective: { type: "string", description: "Required and non-empty for a Work Order draft." },
|
|
654
|
+
planningPacket: { type: "string", description: "Required and non-empty for a Work Order draft." },
|
|
655
|
+
decompositionContext: { type: "string", description: "Required and non-empty for a Work Order draft." },
|
|
656
|
+
candidates: { type: "array", description: "Required for a decomposition draft.", items: { type: "object", additionalProperties: true } },
|
|
657
|
+
suggested_qa_scope: qaScopeSchema("Optional suggested QA scope for the drafted item.")
|
|
658
|
+
}
|
|
577
659
|
}
|
|
578
|
-
}, ["
|
|
660
|
+
}, ["draft_json"], "Record the final Draft proposal with draft_json as a JSON object.");
|
|
579
661
|
}
|
|
580
662
|
function designerRefCandidatesSchema(description) {
|
|
581
663
|
return {
|
|
@@ -603,14 +685,16 @@ function debugToolInputSchema(phase, baseProperties) {
|
|
|
603
685
|
...baseProperties,
|
|
604
686
|
repro_steps: {
|
|
605
687
|
type: "array",
|
|
606
|
-
description: "Required for pass. Minimal reproduction or characterization steps.",
|
|
688
|
+
description: "Required and non-empty for pass. Minimal reproduction or characterization steps.",
|
|
689
|
+
minItems: 1,
|
|
607
690
|
items: { type: "string" }
|
|
608
691
|
},
|
|
609
|
-
observed: { type: "string", description: "Observed failure behavior." },
|
|
610
|
-
expected: { type: "string", description: "Expected behavior." },
|
|
692
|
+
observed: { type: "string", description: "Required for pass. Observed failure behavior." },
|
|
693
|
+
expected: { type: "string", description: "Required for pass. Expected behavior." },
|
|
611
694
|
evidence: {
|
|
612
695
|
type: "array",
|
|
613
|
-
description: "Required for pass. Concrete logs, commands, screenshots, file refs, or characterization notes.",
|
|
696
|
+
description: "Required and non-empty for pass. Concrete logs, commands, screenshots, file refs, or characterization notes.",
|
|
697
|
+
minItems: 1,
|
|
614
698
|
items: { type: "object", additionalProperties: true }
|
|
615
699
|
}
|
|
616
700
|
}, ["status", "summary"], "For status pass, include repro_steps, observed, expected, and evidence.");
|
|
@@ -618,10 +702,11 @@ function debugToolInputSchema(phase, baseProperties) {
|
|
|
618
702
|
if (phase === "debug_root_cause") {
|
|
619
703
|
return objectToolSchema({
|
|
620
704
|
...baseProperties,
|
|
621
|
-
root_cause: { type: "string", description: "Likely root cause tied to code or config evidence." },
|
|
705
|
+
root_cause: { type: "string", description: "Required for pass. Likely root cause tied to code or config evidence." },
|
|
622
706
|
evidence: {
|
|
623
707
|
type: "array",
|
|
624
|
-
description: "Required for pass. Concrete code/log/test evidence supporting the root cause.",
|
|
708
|
+
description: "Required and non-empty for pass. Concrete code/log/test evidence supporting the root cause.",
|
|
709
|
+
minItems: 1,
|
|
625
710
|
items: { type: "object", additionalProperties: true }
|
|
626
711
|
},
|
|
627
712
|
eliminated_alternatives: {
|
|
@@ -629,7 +714,7 @@ function debugToolInputSchema(phase, baseProperties) {
|
|
|
629
714
|
description: "Required for pass. Plausible alternatives checked or ruled out.",
|
|
630
715
|
items: { type: "object", additionalProperties: true }
|
|
631
716
|
},
|
|
632
|
-
risk_area: { type: "string", description: "Subsystem or behavior most at risk from the fix." }
|
|
717
|
+
risk_area: { type: "string", description: "Required for pass. Subsystem or behavior most at risk from the fix." }
|
|
633
718
|
}, ["status", "summary"], "For status pass, include root_cause, evidence, eliminated_alternatives, and risk_area.");
|
|
634
719
|
}
|
|
635
720
|
if (phase === "debug_fix") {
|
|
@@ -637,7 +722,8 @@ function debugToolInputSchema(phase, baseProperties) {
|
|
|
637
722
|
...baseProperties,
|
|
638
723
|
changed_files: {
|
|
639
724
|
type: "array",
|
|
640
|
-
description: "Required for pass. Files changed by the bug fix.",
|
|
725
|
+
description: "Required and non-empty for pass. Files changed by the bug fix.",
|
|
726
|
+
minItems: 1,
|
|
641
727
|
items: evidenceObjectSchema(["path", "summary"], { path: { type: "string" }, summary: { type: "string" } })
|
|
642
728
|
},
|
|
643
729
|
tests_added_or_updated: {
|
|
@@ -662,17 +748,19 @@ function debugToolInputSchema(phase, baseProperties) {
|
|
|
662
748
|
commands: {
|
|
663
749
|
type: "array",
|
|
664
750
|
description: "Required for pass. Targeted regression/repro-negative commands with exit_code: 0 and status: pass.",
|
|
751
|
+
minItems: 1,
|
|
665
752
|
items: commandEvidenceSchema()
|
|
666
753
|
},
|
|
667
754
|
required_regressions: {
|
|
668
755
|
type: "array",
|
|
669
|
-
description: "Required for pass. Repro-negative and regression coverage checklist.",
|
|
756
|
+
description: "Required and non-empty for pass. Repro-negative and regression coverage checklist.",
|
|
757
|
+
minItems: 1,
|
|
670
758
|
items: { type: "string" }
|
|
671
759
|
},
|
|
672
|
-
build_status: { type: "string", description: "Required for pass. pass or not_applicable." },
|
|
673
|
-
test_status: { type: "string", description: "Required for pass. pass or not_applicable." },
|
|
674
|
-
repro_negative: { type: "boolean", description: "Required for pass and must be true after the original repro no longer fails." },
|
|
675
|
-
qa_ready: { type: "boolean", description: "Required for pass and must be true." }
|
|
760
|
+
build_status: { type: "string", default: "pass", description: "Required for pass. pass or not_applicable." },
|
|
761
|
+
test_status: { type: "string", default: "pass", description: "Required for pass. pass or not_applicable." },
|
|
762
|
+
repro_negative: { type: "boolean", default: true, description: "Required for pass and must be true after the original repro no longer fails." },
|
|
763
|
+
qa_ready: { type: "boolean", default: true, description: "Required for pass and must be true." }
|
|
676
764
|
}, ["status", "summary"], "For status pass, commands must include at least one passing deterministic debug regression check, repro_negative must be true, and qa_ready must be true.");
|
|
677
765
|
}
|
|
678
766
|
function qaGateToolInputSchema(gate) {
|
|
@@ -710,150 +798,37 @@ function qaGateToolInputSchema(gate) {
|
|
|
710
798
|
...baseProperties,
|
|
711
799
|
findings: {
|
|
712
800
|
type: "array",
|
|
713
|
-
description: "Normalized in-scope and out-of-scope QA findings.",
|
|
801
|
+
description: "Required for pass or skipped, even when empty. Normalized in-scope and out-of-scope QA findings.",
|
|
714
802
|
items: { type: "object", additionalProperties: true }
|
|
715
803
|
},
|
|
716
804
|
candidate_bugs: {
|
|
717
805
|
type: "array",
|
|
718
|
-
description: "Out-of-scope or follow-up candidates.",
|
|
806
|
+
description: "Required for pass or skipped, even when empty. Out-of-scope or follow-up candidates.",
|
|
719
807
|
items: { type: "object", additionalProperties: true }
|
|
720
808
|
}
|
|
721
809
|
}, ["status", "summary"], "Record normalized QA findings. Pass or skipped requires findings and candidate_bugs arrays, even when empty.");
|
|
722
810
|
}
|
|
811
|
+
const commandRule = gate === "qa_regression"
|
|
812
|
+
? "Required and non-empty for pass. Every entry needs exit_code 0 and status pass, except a verified non-blocking failure classified as out_of_scope_failure or baseline_failure with candidate_bug_id, scope_evidence, acceptance_criteria_independent: true, and its repro or baseline fields."
|
|
813
|
+
: gate === "qa_api"
|
|
814
|
+
? "Required and non-empty for pass, and every entry needs exit_code 0 and status pass."
|
|
815
|
+
: "Command evidence for this gate when applicable.";
|
|
723
816
|
return objectToolSchema({
|
|
724
817
|
...baseProperties,
|
|
725
818
|
commands: {
|
|
726
819
|
type: "array",
|
|
727
|
-
description:
|
|
820
|
+
description: commandRule,
|
|
728
821
|
items: commandEvidenceSchema()
|
|
729
822
|
},
|
|
730
823
|
browser_checks: {
|
|
731
824
|
type: "array",
|
|
732
|
-
description:
|
|
733
|
-
|
|
825
|
+
description: gate === "qa_manual_web"
|
|
826
|
+
? "Browser/manual evidence. Pass requires at least one browser check or a notes string."
|
|
827
|
+
: "Browser/manual evidence for this gate when applicable.",
|
|
828
|
+
items: browserCheckSchema(["summary", "status"])
|
|
734
829
|
},
|
|
830
|
+
sidecars: qaSidecarsSchema(),
|
|
831
|
+
evidence: qaGateEvidenceWrapperSchema(),
|
|
735
832
|
notes: { type: "string", description: "Evidence notes for this gate." }
|
|
736
|
-
}, ["status", "summary"], "Record this QA evidence gate. Use skipped with a reason when the gate is not applicable.");
|
|
737
|
-
}
|
|
738
|
-
function objectToolSchema(properties, required, description) {
|
|
739
|
-
return {
|
|
740
|
-
type: "object",
|
|
741
|
-
additionalProperties: true,
|
|
742
|
-
description,
|
|
743
|
-
properties,
|
|
744
|
-
required: [...required]
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
function evidenceObjectSchema(required, properties) {
|
|
748
|
-
return {
|
|
749
|
-
type: "object",
|
|
750
|
-
additionalProperties: true,
|
|
751
|
-
properties,
|
|
752
|
-
required: [...required]
|
|
753
|
-
};
|
|
754
|
-
}
|
|
755
|
-
function qaScopeSchema(description) {
|
|
756
|
-
return {
|
|
757
|
-
type: "object",
|
|
758
|
-
additionalProperties: false,
|
|
759
|
-
description,
|
|
760
|
-
properties: {
|
|
761
|
-
schema_version: { type: "number", enum: [1] },
|
|
762
|
-
surface: { type: "array", items: { type: "string", enum: [...qaScopeSurfaces] } },
|
|
763
|
-
required_evidence: { type: "array", items: { type: "string", enum: [...qaScopeEvidence] } },
|
|
764
|
-
required_capabilities: {
|
|
765
|
-
type: "array",
|
|
766
|
-
description: "Runner facilities required by implementation and validation. Use docker_engine when tests or project services require access to a Docker daemon, even when the agent itself runs in a managed host worktree.",
|
|
767
|
-
items: { type: "string", enum: ["docker_engine"] }
|
|
768
|
-
},
|
|
769
|
-
not_applicable: { type: "array", items: { type: "string", enum: [...qaScopeEvidence] } },
|
|
770
|
-
browser_required: { type: "boolean" },
|
|
771
|
-
api_required: { type: "boolean" },
|
|
772
|
-
source: { type: "string", enum: [...qaScopeSources] },
|
|
773
|
-
authority: { type: "string", enum: [...qaScopeAuthorities] },
|
|
774
|
-
confidence: { type: "string", enum: [...qaScopeConfidence] },
|
|
775
|
-
confirmed_by_user: { type: "boolean" },
|
|
776
|
-
locked: { type: "boolean" },
|
|
777
|
-
derived_from: {
|
|
778
|
-
type: "object",
|
|
779
|
-
additionalProperties: false,
|
|
780
|
-
properties: {
|
|
781
|
-
work_item_id: { type: "string" },
|
|
782
|
-
mode: { type: "string" }
|
|
783
|
-
}
|
|
784
|
-
},
|
|
785
|
-
rationale: { type: "string" }
|
|
786
|
-
},
|
|
787
|
-
required: ["schema_version", "required_evidence", "not_applicable"]
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
function commandEvidenceSchema() {
|
|
791
|
-
return evidenceObjectSchema(["command", "exit_code", "status", "summary"], {
|
|
792
|
-
command: { type: "string" },
|
|
793
|
-
managed_command_id: { type: "string", description: "Receipt ID returned by forge.start_managed_command after forge.wait_managed_command reports a terminal receipt. A transport-safe wait can return command_continues=true; wait again after retry_after_ms before submitting the gate." },
|
|
794
|
-
exit_code: { type: ["number", "null"], description: "Process exit code, or null when the managed runner timed out or could not launch the process." },
|
|
795
|
-
status: { type: "string" },
|
|
796
|
-
summary: { type: "string" },
|
|
797
|
-
classification: {
|
|
798
|
-
type: "string",
|
|
799
|
-
enum: ["out_of_scope_failure", "baseline_failure"],
|
|
800
|
-
description: "Only for a verified non-blocking failure in a passing QA regression gate. Never use for an in-scope or unexplained failure."
|
|
801
|
-
},
|
|
802
|
-
candidate_bug_id: { type: "string", description: "Required for a classified non-blocking failure; links the preserved failure to candidate_bugs." },
|
|
803
|
-
scope_evidence: { type: "string", description: "Required proof that the failing surface is outside the current acceptance criteria and changed-file scope." },
|
|
804
|
-
acceptance_criteria_independent: { type: "boolean", description: "Required and true only when the current item can be judged independently of this failure." },
|
|
805
|
-
repro_command: { type: "string", description: "Required for out_of_scope_failure; focused command that reproduced the unrelated failure." },
|
|
806
|
-
repro_exit_code: { type: "number", description: "Required non-zero focused repro exit code for out_of_scope_failure." },
|
|
807
|
-
baseline_ref: { type: "string", description: "Required for baseline_failure; immutable ref where the same failure was observed." },
|
|
808
|
-
baseline_exit_code: { type: "number", description: "Required non-zero baseline command exit code for baseline_failure." },
|
|
809
|
-
failure_signature_match: { type: "boolean", description: "Required and true for baseline_failure after matching failing test/error signatures." }
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
function resolvedFindingSchema() {
|
|
813
|
-
return evidenceObjectSchema([
|
|
814
|
-
"qa_id",
|
|
815
|
-
"status",
|
|
816
|
-
"summary",
|
|
817
|
-
"evidence",
|
|
818
|
-
"changed_files",
|
|
819
|
-
"tests_added_or_updated",
|
|
820
|
-
"regression_evidence"
|
|
821
|
-
], {
|
|
822
|
-
qa_id: { type: "string" },
|
|
823
|
-
status: {
|
|
824
|
-
type: "string",
|
|
825
|
-
enum: [...resolvedFindingStatusValues],
|
|
826
|
-
description: "Use resolved when fixed, disputed when the QA finding is incorrect/out-of-scope, or not_reproduced when retesting cannot reproduce it."
|
|
827
|
-
},
|
|
828
|
-
summary: { type: "string" },
|
|
829
|
-
evidence: { description: "Concrete evidence for the resolution." },
|
|
830
|
-
changed_files: { type: "array", description: "Required and non-empty when status is resolved." },
|
|
831
|
-
tests_added_or_updated: { type: "array", description: "Required and non-empty when status is resolved." },
|
|
832
|
-
regression_evidence: { description: "Concrete regression evidence for this QA finding." }
|
|
833
|
-
});
|
|
834
|
-
}
|
|
835
|
-
function acceptanceCriteriaSchema() {
|
|
836
|
-
return {
|
|
837
|
-
type: "array",
|
|
838
|
-
description: "Required for pass. Every entry must be an object with status: satisfied and non-empty evidence.",
|
|
839
|
-
items: evidenceObjectSchema(["criterion", "evidence", "status"], {
|
|
840
|
-
criterion: { type: "string" },
|
|
841
|
-
evidence: { type: "string" },
|
|
842
|
-
status: { type: "string", enum: ["satisfied"] }
|
|
843
|
-
})
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
function reviewSectionSchema() {
|
|
847
|
-
return {
|
|
848
|
-
type: "object",
|
|
849
|
-
description: "Required for pass. Use status pass/fail/needs_rework/not_applicable plus notes.",
|
|
850
|
-
additionalProperties: true,
|
|
851
|
-
properties: reviewSectionProperties()
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
function reviewSectionProperties() {
|
|
855
|
-
return {
|
|
856
|
-
status: { type: "string" },
|
|
857
|
-
notes: { type: "string" }
|
|
858
|
-
};
|
|
833
|
+
}, ["status", "summary"], "Record this QA evidence gate. Use skipped with a reason when the gate is not applicable. Send array fields as JSON arrays, not quoted strings.");
|
|
859
834
|
}
|