@planu/cli 4.11.1 → 4.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/config/elicitation-questions.json +5 -17
- package/dist/engine/cascade-hooks/registry.js +0 -2
- package/dist/engine/challenge-scenarios-loader.d.ts +3 -3
- package/dist/engine/compliance-injector.d.ts +3 -3
- package/dist/engine/dashboard/kanban-logic.d.ts +1 -1
- package/dist/engine/doc-generator/portal/risk-matrix-svg.d.ts +1 -1
- package/dist/engine/doc-generator/proposal/proposal-generator.d.ts +1 -1
- package/dist/engine/elicitation/answer-extractor.d.ts +1 -4
- package/dist/engine/elicitation/answer-extractor.js +197 -68
- package/dist/engine/elicitation/decision-gap-detector.js +59 -79
- package/dist/engine/elicitation/index.d.ts +0 -1
- package/dist/engine/elicitation/index.js +0 -1
- package/dist/engine/elicitation/question-generator.js +10 -3
- package/dist/engine/elicitation/question-grounding-gate.js +83 -34
- package/dist/engine/evidence-gates/lifecycle-gate.js +27 -14
- package/dist/engine/evidence-index/index-builder.js +7 -2
- package/dist/engine/frontmatter-sha/frozen-fields.d.ts +1 -1
- package/dist/engine/handoff-artifacts/schemas/red-tests-handoff.d.ts +2 -2
- package/dist/engine/handoff-artifacts/schemas.d.ts +22 -22
- package/dist/engine/human-summary.js +3 -3
- package/dist/engine/implementation-contract/common.d.ts +1 -1
- package/dist/engine/implementation-contract/renderer.js +17 -39
- package/dist/engine/keyword-matcher/stopwords.d.ts +2 -2
- package/dist/engine/lifecycle-hints.d.ts +1 -1
- package/dist/engine/lifecycle-hints.js +13 -29
- package/dist/engine/provider-adapters/adapters/claude.d.ts +1 -1
- package/dist/engine/provider-adapters/adapters/gemini.d.ts +1 -1
- package/dist/engine/provider-adapters/adapters/gpt4.d.ts +1 -1
- package/dist/engine/provider-adapters/adapters/markdown.d.ts +1 -1
- package/dist/engine/safety/atomic-write-file.d.ts +1 -1
- package/dist/engine/safety/cross-process-lock.d.ts +1 -1
- package/dist/engine/safety/path-sanitizer.d.ts +1 -1
- package/dist/engine/security-analyzer/profile-detector.js +48 -16
- package/dist/engine/spec-format/copula-blacklist.d.ts +2 -2
- package/dist/engine/spec-format/lean-spec-generator.d.ts +2 -2
- package/dist/engine/spec-format/lean-spec-generator.js +9 -10
- package/dist/engine/spec-format/metadata-value-policy.d.ts +20 -20
- package/dist/engine/spec-generator/fallback-generator.js +13 -20
- package/dist/engine/spec-grounding/contract.d.ts +5 -0
- package/dist/engine/spec-grounding/contract.js +10 -6
- package/dist/engine/spec-migrator/lean-migration.js +9 -16
- package/dist/engine/text-signal-boundaries.js +45 -12
- package/dist/engine/universal-rules/rules/planu-modes.js +0 -2
- package/dist/engine/web-fetcher/stack-advisor.d.ts +2 -2
- package/dist/engine/web-fetcher/stack-advisor.js +78 -17
- package/dist/engine/well-known/manifest-schema.d.ts +33 -33
- package/dist/engine/workers/schema.d.ts +3 -3
- package/dist/hosts/claude-code/ux/mcp-resources.d.ts +4 -4
- package/dist/hosts/codex/rest-shim.d.ts +1 -1
- package/dist/native/lightweight-command-catalog.d.ts +30 -30
- package/dist/server/openapi-spec.d.ts +132 -132
- package/dist/tools/challenge-spec/challenge-report.d.ts +13 -0
- package/dist/tools/challenge-spec/challenge-report.js +55 -0
- package/dist/tools/challenge-spec/event-challenge-scenarios.js +8 -27
- package/dist/tools/challenge-spec/resilience-challenge-scenarios-a.js +16 -32
- package/dist/tools/challenge-spec/resilience-challenge-scenarios-b.js +15 -20
- package/dist/tools/challenge-spec/scenario-collector.d.ts +13 -0
- package/dist/tools/challenge-spec/scenario-collector.js +86 -0
- package/dist/tools/challenge-spec/scenarios-data.js +10 -9
- package/dist/tools/challenge-spec/scenarios-failure.js +38 -54
- package/dist/tools/challenge-spec/scenarios-scale.js +14 -15
- package/dist/tools/challenge-spec/scenarios-security.d.ts +1 -1
- package/dist/tools/challenge-spec/scenarios-security.js +18 -11
- package/dist/tools/challenge-spec/scenarios-utils.d.ts +31 -5
- package/dist/tools/challenge-spec/scenarios-utils.js +102 -6
- package/dist/tools/challenge-spec/security-challenge-scenarios.d.ts +1 -1
- package/dist/tools/challenge-spec/security-challenge-scenarios.js +20 -25
- package/dist/tools/challenge-spec.js +46 -124
- package/dist/tools/clarify-requirements/multiple-choice.js +1 -1
- package/dist/tools/clarify-requirements/questions-context.js +11 -11
- package/dist/tools/clarify-requirements/questions.js +3 -23
- package/dist/tools/clarify-requirements.js +38 -0
- package/dist/tools/compliance-gate-handler.d.ts +1 -1
- package/dist/tools/create-spec/autopilot-analyzer.d.ts +1 -1
- package/dist/tools/create-spec/autopilot-analyzer.js +29 -54
- package/dist/tools/create-spec/post-creation.js +23 -4
- package/dist/tools/create-spec.js +51 -168
- package/dist/tools/delete-first/suggest-deletions.d.ts +1 -1
- package/dist/tools/elicit-requirements-handler.js +20 -12
- package/dist/tools/generate-batch-script.d.ts +2 -2
- package/dist/tools/init-project/rules-generator.js +0 -1
- package/dist/tools/oauth-handler.d.ts +1 -1
- package/dist/tools/register-sdd-tools.d.ts +1 -1
- package/dist/tools/register-spec-tools/core-spec-tools.js +11 -2
- package/dist/tools/render-spec-for-provider.d.ts +2 -2
- package/dist/tools/scan-orphan-spec-refs.d.ts +6 -6
- package/dist/tools/schemas/agents.d.ts +7 -7
- package/dist/tools/schemas/analysis.d.ts +11 -11
- package/dist/tools/schemas/delete.d.ts +5 -5
- package/dist/tools/schemas/github.d.ts +4 -4
- package/dist/tools/schemas/ide-config.d.ts +12 -12
- package/dist/tools/schemas/infra.d.ts +9 -9
- package/dist/tools/schemas/lifecycle.d.ts +50 -50
- package/dist/tools/schemas/llm-provider-schemas.d.ts +7 -7
- package/dist/tools/schemas/plugins-schemas.d.ts +12 -12
- package/dist/tools/schemas/project-graph.d.ts +6 -6
- package/dist/tools/schemas/rbac.d.ts +2 -2
- package/dist/tools/schemas/registry.d.ts +3 -3
- package/dist/tools/schemas/runtime-security.d.ts +2 -2
- package/dist/tools/schemas/session.d.ts +2 -2
- package/dist/tools/schemas/spec.d.ts +15 -15
- package/dist/tools/schemas/token-intelligence.d.ts +6 -6
- package/dist/tools/schemas/token-optimization.d.ts +2 -2
- package/dist/tools/schemas/workers-schema.d.ts +4 -4
- package/dist/tools/skill-bootstrap-handler.d.ts +7 -7
- package/dist/tools/suggest-stack.js +49 -13
- package/dist/tools/tool-registry/deprecated-stubs.d.ts +1 -1
- package/dist/tools/triage-request.d.ts +3 -3
- package/dist/tools/update-status/dod-gates.d.ts +8 -0
- package/dist/tools/update-status/dod-gates.js +68 -43
- package/dist/tools/update-status/file-sync.d.ts +1 -1
- package/dist/tools/update-status/file-sync.js +10 -45
- package/dist/tools/update-status/index.js +133 -97
- package/dist/tools/update-status/qa-gate.js +26 -0
- package/dist/tools/update-status/response-builder.d.ts +1 -1
- package/dist/tools/update-status/response-builder.js +11 -19
- package/dist/tools/update-status/transition-guard.d.ts +2 -2
- package/dist/tools/update-status/transition-guard.js +11 -8
- package/dist/tools/update-status-actions.d.ts +0 -1
- package/dist/tools/update-status-actions.js +10 -26
- package/dist/tools/update-status-convention-gate.d.ts +1 -6
- package/dist/tools/update-status-convention-gate.js +9 -33
- package/dist/tools/validate-lint.d.ts +1 -1
- package/dist/tools/validate-lint.js +39 -1
- package/dist/types/docs.d.ts +0 -4
- package/dist/types/env.d.ts +0 -4
- package/dist/types/estimation.d.ts +0 -2
- package/dist/types/multi-teammate-review.d.ts +4 -4
- package/dist/types/plugin-install.d.ts +7 -7
- package/dist/types/spec/core.d.ts +20 -0
- package/dist/types/spec/inputs.d.ts +1 -1
- package/dist/types/stack/index.d.ts +1 -1
- package/dist/types/stack/recommend.d.ts +10 -0
- package/package.json +21 -18
- package/planu-native.json +1 -1
- package/planu-plugin.json +1 -1
- package/src/i18n/messages/en.json +0 -72
- package/src/i18n/messages/es.json +0 -72
- package/src/i18n/messages/pt.json +0 -72
- package/dist/config/elicitation-dimensions.json +0 -51
- package/dist/engine/actuals-estimator.d.ts +0 -14
- package/dist/engine/actuals-estimator.js +0 -64
- package/dist/engine/cascade-hooks/hooks/living-specs.hook.d.ts +0 -3
- package/dist/engine/cascade-hooks/hooks/living-specs.hook.js +0 -19
- package/dist/engine/elicitation/non-interactive-defaults.d.ts +0 -9
- package/dist/engine/elicitation/non-interactive-defaults.js +0 -28
- package/dist/engine/elicitation/option-builder.d.ts +0 -9
- package/dist/engine/elicitation/option-builder.js +0 -85
- package/dist/engine/progress-writer.d.ts +0 -10
- package/dist/engine/progress-writer.js +0 -63
- package/dist/tools/clarify-requirements/interview-mode.d.ts +0 -42
- package/dist/tools/clarify-requirements/interview-mode.js +0 -342
- package/dist/tools/update-status/mode-hints.d.ts +0 -4
- package/dist/tools/update-status/mode-hints.js +0 -24
|
@@ -4,50 +4,50 @@
|
|
|
4
4
|
* SPEC-610: Planu HTTP API — OpenAPI document for LLM function calling
|
|
5
5
|
*/
|
|
6
6
|
export declare const OPENAPI_SPEC: {
|
|
7
|
-
readonly openapi:
|
|
7
|
+
readonly openapi: '3.1.0';
|
|
8
8
|
readonly info: {
|
|
9
|
-
readonly title:
|
|
10
|
-
readonly version:
|
|
11
|
-
readonly description:
|
|
9
|
+
readonly title: 'Planu HTTP API';
|
|
10
|
+
readonly version: '1.0.0';
|
|
11
|
+
readonly description: 'Planu Spec Driven Development HTTP API — transport-agnostic access to Planu engine';
|
|
12
12
|
};
|
|
13
13
|
readonly servers: readonly [{
|
|
14
|
-
readonly url:
|
|
15
|
-
readonly description:
|
|
14
|
+
readonly url: 'http://localhost:3000';
|
|
15
|
+
readonly description: 'Local development server';
|
|
16
16
|
}];
|
|
17
17
|
readonly paths: {
|
|
18
18
|
readonly '/api/health': {
|
|
19
19
|
readonly get: {
|
|
20
|
-
readonly operationId:
|
|
21
|
-
readonly summary:
|
|
22
|
-
readonly description:
|
|
20
|
+
readonly operationId: 'getHealth';
|
|
21
|
+
readonly summary: 'Health check';
|
|
22
|
+
readonly description: 'Returns server status and version information';
|
|
23
23
|
readonly responses: {
|
|
24
24
|
readonly '200': {
|
|
25
|
-
readonly description:
|
|
25
|
+
readonly description: 'Server is healthy';
|
|
26
26
|
readonly content: {
|
|
27
27
|
readonly 'application/json': {
|
|
28
28
|
readonly schema: {
|
|
29
|
-
readonly type:
|
|
29
|
+
readonly type: 'object';
|
|
30
30
|
readonly properties: {
|
|
31
31
|
readonly data: {
|
|
32
|
-
readonly type:
|
|
32
|
+
readonly type: 'object';
|
|
33
33
|
readonly properties: {
|
|
34
34
|
readonly status: {
|
|
35
|
-
readonly type:
|
|
36
|
-
readonly example:
|
|
35
|
+
readonly type: 'string';
|
|
36
|
+
readonly example: 'ok';
|
|
37
37
|
};
|
|
38
38
|
readonly version: {
|
|
39
|
-
readonly type:
|
|
40
|
-
readonly example:
|
|
39
|
+
readonly type: 'string';
|
|
40
|
+
readonly example: '1.0.0';
|
|
41
41
|
};
|
|
42
42
|
readonly uptime: {
|
|
43
|
-
readonly type:
|
|
44
|
-
readonly description:
|
|
43
|
+
readonly type: 'number';
|
|
44
|
+
readonly description: 'Process uptime in seconds';
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
readonly required: readonly [
|
|
47
|
+
readonly required: readonly ['status', 'version', 'uptime'];
|
|
48
48
|
};
|
|
49
49
|
readonly error: {
|
|
50
|
-
readonly type:
|
|
50
|
+
readonly type: 'null';
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
};
|
|
@@ -59,35 +59,35 @@ export declare const OPENAPI_SPEC: {
|
|
|
59
59
|
};
|
|
60
60
|
readonly '/api/specs': {
|
|
61
61
|
readonly get: {
|
|
62
|
-
readonly operationId:
|
|
63
|
-
readonly summary:
|
|
64
|
-
readonly description:
|
|
62
|
+
readonly operationId: 'listSpecs';
|
|
63
|
+
readonly summary: 'List specs';
|
|
64
|
+
readonly description: 'Returns all specs, optionally filtered by status';
|
|
65
65
|
readonly parameters: readonly [{
|
|
66
|
-
readonly name:
|
|
67
|
-
readonly in:
|
|
68
|
-
readonly description:
|
|
66
|
+
readonly name: 'status';
|
|
67
|
+
readonly in: 'query';
|
|
68
|
+
readonly description: 'Filter by spec status. Valid values: draft, review, approved, implementing, done, discarded';
|
|
69
69
|
readonly required: false;
|
|
70
70
|
readonly schema: {
|
|
71
|
-
readonly type:
|
|
72
|
-
readonly enum: readonly [
|
|
71
|
+
readonly type: 'string';
|
|
72
|
+
readonly enum: readonly ['draft', 'review', 'approved', 'implementing', 'done', 'discarded'];
|
|
73
73
|
};
|
|
74
74
|
}];
|
|
75
75
|
readonly responses: {
|
|
76
76
|
readonly '200': {
|
|
77
|
-
readonly description:
|
|
77
|
+
readonly description: 'List of specs';
|
|
78
78
|
readonly content: {
|
|
79
79
|
readonly 'application/json': {
|
|
80
80
|
readonly schema: {
|
|
81
|
-
readonly type:
|
|
81
|
+
readonly type: 'object';
|
|
82
82
|
readonly properties: {
|
|
83
83
|
readonly data: {
|
|
84
|
-
readonly type:
|
|
84
|
+
readonly type: 'array';
|
|
85
85
|
readonly items: {
|
|
86
|
-
readonly $ref:
|
|
86
|
+
readonly $ref: '#/components/schemas/Spec';
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
89
|
readonly error: {
|
|
90
|
-
readonly type:
|
|
90
|
+
readonly type: 'null';
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
};
|
|
@@ -97,43 +97,43 @@ export declare const OPENAPI_SPEC: {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
readonly post: {
|
|
100
|
-
readonly operationId:
|
|
101
|
-
readonly summary:
|
|
102
|
-
readonly description:
|
|
100
|
+
readonly operationId: 'createSpec';
|
|
101
|
+
readonly summary: 'Create a spec';
|
|
102
|
+
readonly description: 'Creates a new spec with the given title and description';
|
|
103
103
|
readonly requestBody: {
|
|
104
104
|
readonly required: true;
|
|
105
105
|
readonly content: {
|
|
106
106
|
readonly 'application/json': {
|
|
107
107
|
readonly schema: {
|
|
108
|
-
readonly type:
|
|
108
|
+
readonly type: 'object';
|
|
109
109
|
readonly properties: {
|
|
110
110
|
readonly title: {
|
|
111
|
-
readonly type:
|
|
112
|
-
readonly description:
|
|
111
|
+
readonly type: 'string';
|
|
112
|
+
readonly description: 'Spec title';
|
|
113
113
|
};
|
|
114
114
|
readonly description: {
|
|
115
|
-
readonly type:
|
|
116
|
-
readonly description:
|
|
115
|
+
readonly type: 'string';
|
|
116
|
+
readonly description: 'Spec description / requirements';
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
|
-
readonly required: readonly [
|
|
119
|
+
readonly required: readonly ['title', 'description'];
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
readonly responses: {
|
|
125
125
|
readonly '201': {
|
|
126
|
-
readonly description:
|
|
126
|
+
readonly description: 'Spec created';
|
|
127
127
|
readonly content: {
|
|
128
128
|
readonly 'application/json': {
|
|
129
129
|
readonly schema: {
|
|
130
|
-
readonly type:
|
|
130
|
+
readonly type: 'object';
|
|
131
131
|
readonly properties: {
|
|
132
132
|
readonly data: {
|
|
133
|
-
readonly $ref:
|
|
133
|
+
readonly $ref: '#/components/schemas/Spec';
|
|
134
134
|
};
|
|
135
135
|
readonly error: {
|
|
136
|
-
readonly type:
|
|
136
|
+
readonly type: 'null';
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
139
|
};
|
|
@@ -141,38 +141,38 @@ export declare const OPENAPI_SPEC: {
|
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
143
|
readonly '400': {
|
|
144
|
-
readonly $ref:
|
|
144
|
+
readonly $ref: '#/components/responses/BadRequest';
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
149
|
readonly '/api/specs/{id}': {
|
|
150
150
|
readonly get: {
|
|
151
|
-
readonly operationId:
|
|
152
|
-
readonly summary:
|
|
153
|
-
readonly description:
|
|
151
|
+
readonly operationId: 'getSpec';
|
|
152
|
+
readonly summary: 'Get spec details';
|
|
153
|
+
readonly description: 'Returns a single spec by ID';
|
|
154
154
|
readonly parameters: readonly [{
|
|
155
|
-
readonly name:
|
|
156
|
-
readonly in:
|
|
155
|
+
readonly name: 'id';
|
|
156
|
+
readonly in: 'path';
|
|
157
157
|
readonly required: true;
|
|
158
158
|
readonly schema: {
|
|
159
|
-
readonly type:
|
|
160
|
-
readonly example:
|
|
159
|
+
readonly type: 'string';
|
|
160
|
+
readonly example: 'SPEC-001';
|
|
161
161
|
};
|
|
162
162
|
}];
|
|
163
163
|
readonly responses: {
|
|
164
164
|
readonly '200': {
|
|
165
|
-
readonly description:
|
|
165
|
+
readonly description: 'Spec details';
|
|
166
166
|
readonly content: {
|
|
167
167
|
readonly 'application/json': {
|
|
168
168
|
readonly schema: {
|
|
169
|
-
readonly type:
|
|
169
|
+
readonly type: 'object';
|
|
170
170
|
readonly properties: {
|
|
171
171
|
readonly data: {
|
|
172
|
-
readonly $ref:
|
|
172
|
+
readonly $ref: '#/components/schemas/Spec';
|
|
173
173
|
};
|
|
174
174
|
readonly error: {
|
|
175
|
-
readonly type:
|
|
175
|
+
readonly type: 'null';
|
|
176
176
|
};
|
|
177
177
|
};
|
|
178
178
|
};
|
|
@@ -180,23 +180,23 @@ export declare const OPENAPI_SPEC: {
|
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
182
|
readonly '404': {
|
|
183
|
-
readonly $ref:
|
|
183
|
+
readonly $ref: '#/components/responses/NotFound';
|
|
184
184
|
};
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
readonly '/api/specs/{id}/status': {
|
|
189
189
|
readonly patch: {
|
|
190
|
-
readonly operationId:
|
|
191
|
-
readonly summary:
|
|
192
|
-
readonly description:
|
|
190
|
+
readonly operationId: 'updateSpecStatus';
|
|
191
|
+
readonly summary: 'Update spec status';
|
|
192
|
+
readonly description: 'Transitions a spec to a new status';
|
|
193
193
|
readonly parameters: readonly [{
|
|
194
|
-
readonly name:
|
|
195
|
-
readonly in:
|
|
194
|
+
readonly name: 'id';
|
|
195
|
+
readonly in: 'path';
|
|
196
196
|
readonly required: true;
|
|
197
197
|
readonly schema: {
|
|
198
|
-
readonly type:
|
|
199
|
-
readonly example:
|
|
198
|
+
readonly type: 'string';
|
|
199
|
+
readonly example: 'SPEC-001';
|
|
200
200
|
};
|
|
201
201
|
}];
|
|
202
202
|
readonly requestBody: {
|
|
@@ -204,32 +204,32 @@ export declare const OPENAPI_SPEC: {
|
|
|
204
204
|
readonly content: {
|
|
205
205
|
readonly 'application/json': {
|
|
206
206
|
readonly schema: {
|
|
207
|
-
readonly type:
|
|
207
|
+
readonly type: 'object';
|
|
208
208
|
readonly properties: {
|
|
209
209
|
readonly status: {
|
|
210
|
-
readonly type:
|
|
211
|
-
readonly enum: readonly [
|
|
212
|
-
readonly description:
|
|
210
|
+
readonly type: 'string';
|
|
211
|
+
readonly enum: readonly ['draft', 'review', 'approved', 'implementing', 'done', 'discarded'];
|
|
212
|
+
readonly description: 'New status. Valid values: draft, review, approved, implementing, done, discarded';
|
|
213
213
|
};
|
|
214
214
|
};
|
|
215
|
-
readonly required: readonly [
|
|
215
|
+
readonly required: readonly ['status'];
|
|
216
216
|
};
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
219
|
};
|
|
220
220
|
readonly responses: {
|
|
221
221
|
readonly '200': {
|
|
222
|
-
readonly description:
|
|
222
|
+
readonly description: 'Spec status updated';
|
|
223
223
|
readonly content: {
|
|
224
224
|
readonly 'application/json': {
|
|
225
225
|
readonly schema: {
|
|
226
|
-
readonly type:
|
|
226
|
+
readonly type: 'object';
|
|
227
227
|
readonly properties: {
|
|
228
228
|
readonly data: {
|
|
229
|
-
readonly $ref:
|
|
229
|
+
readonly $ref: '#/components/schemas/Spec';
|
|
230
230
|
};
|
|
231
231
|
readonly error: {
|
|
232
|
-
readonly type:
|
|
232
|
+
readonly type: 'null';
|
|
233
233
|
};
|
|
234
234
|
};
|
|
235
235
|
};
|
|
@@ -237,58 +237,58 @@ export declare const OPENAPI_SPEC: {
|
|
|
237
237
|
};
|
|
238
238
|
};
|
|
239
239
|
readonly '400': {
|
|
240
|
-
readonly $ref:
|
|
240
|
+
readonly $ref: '#/components/responses/BadRequest';
|
|
241
241
|
};
|
|
242
242
|
readonly '404': {
|
|
243
|
-
readonly $ref:
|
|
243
|
+
readonly $ref: '#/components/responses/NotFound';
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
248
|
readonly '/api/specs/{id}/validate': {
|
|
249
249
|
readonly post: {
|
|
250
|
-
readonly operationId:
|
|
251
|
-
readonly summary:
|
|
252
|
-
readonly description:
|
|
250
|
+
readonly operationId: 'validateSpec';
|
|
251
|
+
readonly summary: 'Validate a spec';
|
|
252
|
+
readonly description: 'Runs readiness and quality checks on a spec';
|
|
253
253
|
readonly parameters: readonly [{
|
|
254
|
-
readonly name:
|
|
255
|
-
readonly in:
|
|
254
|
+
readonly name: 'id';
|
|
255
|
+
readonly in: 'path';
|
|
256
256
|
readonly required: true;
|
|
257
257
|
readonly schema: {
|
|
258
|
-
readonly type:
|
|
259
|
-
readonly example:
|
|
258
|
+
readonly type: 'string';
|
|
259
|
+
readonly example: 'SPEC-001';
|
|
260
260
|
};
|
|
261
261
|
}];
|
|
262
262
|
readonly responses: {
|
|
263
263
|
readonly '200': {
|
|
264
|
-
readonly description:
|
|
264
|
+
readonly description: 'Validation results';
|
|
265
265
|
readonly content: {
|
|
266
266
|
readonly 'application/json': {
|
|
267
267
|
readonly schema: {
|
|
268
|
-
readonly type:
|
|
268
|
+
readonly type: 'object';
|
|
269
269
|
readonly properties: {
|
|
270
270
|
readonly data: {
|
|
271
|
-
readonly type:
|
|
271
|
+
readonly type: 'object';
|
|
272
272
|
readonly properties: {
|
|
273
273
|
readonly specId: {
|
|
274
|
-
readonly type:
|
|
274
|
+
readonly type: 'string';
|
|
275
275
|
};
|
|
276
276
|
readonly ready: {
|
|
277
|
-
readonly type:
|
|
277
|
+
readonly type: 'boolean';
|
|
278
278
|
};
|
|
279
279
|
readonly score: {
|
|
280
|
-
readonly type:
|
|
280
|
+
readonly type: 'number';
|
|
281
281
|
};
|
|
282
282
|
readonly issues: {
|
|
283
|
-
readonly type:
|
|
283
|
+
readonly type: 'array';
|
|
284
284
|
readonly items: {
|
|
285
|
-
readonly type:
|
|
285
|
+
readonly type: 'string';
|
|
286
286
|
};
|
|
287
287
|
};
|
|
288
288
|
};
|
|
289
289
|
};
|
|
290
290
|
readonly error: {
|
|
291
|
-
readonly type:
|
|
291
|
+
readonly type: 'null';
|
|
292
292
|
};
|
|
293
293
|
};
|
|
294
294
|
};
|
|
@@ -296,23 +296,23 @@ export declare const OPENAPI_SPEC: {
|
|
|
296
296
|
};
|
|
297
297
|
};
|
|
298
298
|
readonly '404': {
|
|
299
|
-
readonly $ref:
|
|
299
|
+
readonly $ref: '#/components/responses/NotFound';
|
|
300
300
|
};
|
|
301
301
|
};
|
|
302
302
|
};
|
|
303
303
|
};
|
|
304
304
|
readonly '/api/openapi.json': {
|
|
305
305
|
readonly get: {
|
|
306
|
-
readonly operationId:
|
|
307
|
-
readonly summary:
|
|
308
|
-
readonly description:
|
|
306
|
+
readonly operationId: 'getOpenApiSpec';
|
|
307
|
+
readonly summary: 'OpenAPI specification';
|
|
308
|
+
readonly description: 'Returns this OpenAPI document for LLM function calling';
|
|
309
309
|
readonly responses: {
|
|
310
310
|
readonly '200': {
|
|
311
|
-
readonly description:
|
|
311
|
+
readonly description: 'OpenAPI spec';
|
|
312
312
|
readonly content: {
|
|
313
313
|
readonly 'application/json': {
|
|
314
314
|
readonly schema: {
|
|
315
|
-
readonly type:
|
|
315
|
+
readonly type: 'object';
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
318
|
};
|
|
@@ -324,74 +324,74 @@ export declare const OPENAPI_SPEC: {
|
|
|
324
324
|
readonly components: {
|
|
325
325
|
readonly schemas: {
|
|
326
326
|
readonly Spec: {
|
|
327
|
-
readonly type:
|
|
327
|
+
readonly type: 'object';
|
|
328
328
|
readonly properties: {
|
|
329
329
|
readonly id: {
|
|
330
|
-
readonly type:
|
|
331
|
-
readonly example:
|
|
330
|
+
readonly type: 'string';
|
|
331
|
+
readonly example: 'SPEC-001';
|
|
332
332
|
};
|
|
333
333
|
readonly title: {
|
|
334
|
-
readonly type:
|
|
334
|
+
readonly type: 'string';
|
|
335
335
|
};
|
|
336
336
|
readonly status: {
|
|
337
|
-
readonly type:
|
|
338
|
-
readonly enum: readonly [
|
|
337
|
+
readonly type: 'string';
|
|
338
|
+
readonly enum: readonly ['draft', 'review', 'approved', 'implementing', 'done', 'discarded'];
|
|
339
339
|
};
|
|
340
340
|
readonly type: {
|
|
341
|
-
readonly type:
|
|
341
|
+
readonly type: 'string';
|
|
342
342
|
};
|
|
343
343
|
readonly scope: {
|
|
344
|
-
readonly type:
|
|
344
|
+
readonly type: 'string';
|
|
345
345
|
};
|
|
346
346
|
readonly difficulty: {
|
|
347
|
-
readonly type:
|
|
347
|
+
readonly type: 'string';
|
|
348
348
|
};
|
|
349
349
|
readonly risk: {
|
|
350
|
-
readonly type:
|
|
350
|
+
readonly type: 'string';
|
|
351
351
|
};
|
|
352
352
|
readonly tags: {
|
|
353
|
-
readonly type:
|
|
353
|
+
readonly type: 'array';
|
|
354
354
|
readonly items: {
|
|
355
|
-
readonly type:
|
|
355
|
+
readonly type: 'string';
|
|
356
356
|
};
|
|
357
357
|
};
|
|
358
358
|
readonly createdAt: {
|
|
359
|
-
readonly type:
|
|
360
|
-
readonly format:
|
|
359
|
+
readonly type: 'string';
|
|
360
|
+
readonly format: 'date-time';
|
|
361
361
|
};
|
|
362
362
|
readonly updatedAt: {
|
|
363
|
-
readonly type:
|
|
364
|
-
readonly format:
|
|
363
|
+
readonly type: 'string';
|
|
364
|
+
readonly format: 'date-time';
|
|
365
365
|
};
|
|
366
366
|
};
|
|
367
|
-
readonly required: readonly [
|
|
367
|
+
readonly required: readonly ['id', 'title', 'status'];
|
|
368
368
|
};
|
|
369
369
|
readonly ApiError: {
|
|
370
|
-
readonly type:
|
|
370
|
+
readonly type: 'object';
|
|
371
371
|
readonly properties: {
|
|
372
372
|
readonly message: {
|
|
373
|
-
readonly type:
|
|
373
|
+
readonly type: 'string';
|
|
374
374
|
};
|
|
375
375
|
readonly code: {
|
|
376
|
-
readonly type:
|
|
376
|
+
readonly type: 'string';
|
|
377
377
|
};
|
|
378
378
|
};
|
|
379
|
-
readonly required: readonly [
|
|
379
|
+
readonly required: readonly ['message', 'code'];
|
|
380
380
|
};
|
|
381
381
|
};
|
|
382
382
|
readonly responses: {
|
|
383
383
|
readonly BadRequest: {
|
|
384
|
-
readonly description:
|
|
384
|
+
readonly description: 'Bad request — validation error';
|
|
385
385
|
readonly content: {
|
|
386
386
|
readonly 'application/json': {
|
|
387
387
|
readonly schema: {
|
|
388
|
-
readonly type:
|
|
388
|
+
readonly type: 'object';
|
|
389
389
|
readonly properties: {
|
|
390
390
|
readonly data: {
|
|
391
|
-
readonly type:
|
|
391
|
+
readonly type: 'null';
|
|
392
392
|
};
|
|
393
393
|
readonly error: {
|
|
394
|
-
readonly $ref:
|
|
394
|
+
readonly $ref: '#/components/schemas/ApiError';
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
397
|
};
|
|
@@ -399,17 +399,17 @@ export declare const OPENAPI_SPEC: {
|
|
|
399
399
|
};
|
|
400
400
|
};
|
|
401
401
|
readonly NotFound: {
|
|
402
|
-
readonly description:
|
|
402
|
+
readonly description: 'Resource not found';
|
|
403
403
|
readonly content: {
|
|
404
404
|
readonly 'application/json': {
|
|
405
405
|
readonly schema: {
|
|
406
|
-
readonly type:
|
|
406
|
+
readonly type: 'object';
|
|
407
407
|
readonly properties: {
|
|
408
408
|
readonly data: {
|
|
409
|
-
readonly type:
|
|
409
|
+
readonly type: 'null';
|
|
410
410
|
};
|
|
411
411
|
readonly error: {
|
|
412
|
-
readonly $ref:
|
|
412
|
+
readonly $ref: '#/components/schemas/ApiError';
|
|
413
413
|
};
|
|
414
414
|
};
|
|
415
415
|
};
|
|
@@ -417,17 +417,17 @@ export declare const OPENAPI_SPEC: {
|
|
|
417
417
|
};
|
|
418
418
|
};
|
|
419
419
|
readonly InternalError: {
|
|
420
|
-
readonly description:
|
|
420
|
+
readonly description: 'Internal server error';
|
|
421
421
|
readonly content: {
|
|
422
422
|
readonly 'application/json': {
|
|
423
423
|
readonly schema: {
|
|
424
|
-
readonly type:
|
|
424
|
+
readonly type: 'object';
|
|
425
425
|
readonly properties: {
|
|
426
426
|
readonly data: {
|
|
427
|
-
readonly type:
|
|
427
|
+
readonly type: 'null';
|
|
428
428
|
};
|
|
429
429
|
readonly error: {
|
|
430
|
-
readonly $ref:
|
|
430
|
+
readonly $ref: '#/components/schemas/ApiError';
|
|
431
431
|
};
|
|
432
432
|
};
|
|
433
433
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChallengeReport, ChallengeResolutionEvidence, FailureScenario } from '../../types/index.js';
|
|
2
|
+
export declare const MINIMUM_RESOLVED_CHALLENGES = 3;
|
|
3
|
+
/** Count only evidence tied to findings persisted by the same challenge report. */
|
|
4
|
+
export declare function getResolvedChallengeEvidence(report: ChallengeReport | undefined): ChallengeResolutionEvidence[];
|
|
5
|
+
/** Build a report whose resolution state is derived exclusively from explicit evidence. */
|
|
6
|
+
export declare function buildChallengeReport(input: {
|
|
7
|
+
scenarios: FailureScenario[];
|
|
8
|
+
focusAreas: string[];
|
|
9
|
+
overallRisk: ChallengeReport['overallRisk'];
|
|
10
|
+
previousReport?: ChallengeReport;
|
|
11
|
+
runAt?: string;
|
|
12
|
+
}): ChallengeReport;
|
|
13
|
+
//# sourceMappingURL=challenge-report.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export const MINIMUM_RESOLVED_CHALLENGES = 3;
|
|
2
|
+
function isExplicitResolutionEvidence(value) {
|
|
3
|
+
if (typeof value !== 'object' || value === null) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const candidate = value;
|
|
7
|
+
return (typeof candidate.scenario === 'string' &&
|
|
8
|
+
candidate.scenario.trim().length > 0 &&
|
|
9
|
+
(candidate.resolution === 'mitigated' || candidate.resolution === 'accepted') &&
|
|
10
|
+
typeof candidate.evidence === 'string' &&
|
|
11
|
+
candidate.evidence.trim().length > 0 &&
|
|
12
|
+
typeof candidate.resolvedAt === 'string' &&
|
|
13
|
+
candidate.resolvedAt.trim().length > 0);
|
|
14
|
+
}
|
|
15
|
+
function uniqueMatchingEvidence(report, scenarioNames) {
|
|
16
|
+
const evidence = Array.isArray(report?.resolutionEvidence) ? report.resolutionEvidence : [];
|
|
17
|
+
const matched = new Map();
|
|
18
|
+
for (const item of evidence) {
|
|
19
|
+
if (isExplicitResolutionEvidence(item) && scenarioNames.has(item.scenario)) {
|
|
20
|
+
matched.set(item.scenario, item);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return [...matched.values()];
|
|
24
|
+
}
|
|
25
|
+
/** Count only evidence tied to findings persisted by the same challenge report. */
|
|
26
|
+
export function getResolvedChallengeEvidence(report) {
|
|
27
|
+
if (!Array.isArray(report?.findings)) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const scenarioNames = new Set(report.findings
|
|
31
|
+
.map((finding) => finding.scenario)
|
|
32
|
+
.filter((scenario) => typeof scenario === 'string' && scenario.trim().length > 0));
|
|
33
|
+
return uniqueMatchingEvidence(report, scenarioNames);
|
|
34
|
+
}
|
|
35
|
+
/** Build a report whose resolution state is derived exclusively from explicit evidence. */
|
|
36
|
+
export function buildChallengeReport(input) {
|
|
37
|
+
const scenarioNames = new Set(input.scenarios.map((scenario) => scenario.scenario));
|
|
38
|
+
const resolutionEvidence = uniqueMatchingEvidence(input.previousReport, scenarioNames);
|
|
39
|
+
const resolvedScenarios = new Set(resolutionEvidence.map((item) => item.scenario));
|
|
40
|
+
const addressedCount = resolvedScenarios.size;
|
|
41
|
+
return {
|
|
42
|
+
runAt: input.runAt ?? new Date().toISOString(),
|
|
43
|
+
totalScenarios: input.scenarios.length,
|
|
44
|
+
addressedCount,
|
|
45
|
+
focusAreas: input.focusAreas,
|
|
46
|
+
overallRisk: input.overallRisk,
|
|
47
|
+
passed: addressedCount >= MINIMUM_RESOLVED_CHALLENGES,
|
|
48
|
+
findings: input.scenarios.map((scenario) => ({
|
|
49
|
+
scenario: scenario.scenario,
|
|
50
|
+
resolved: resolvedScenarios.has(scenario.scenario),
|
|
51
|
+
})),
|
|
52
|
+
resolutionEvidence,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=challenge-report.js.map
|