@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.
Files changed (155) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/config/elicitation-questions.json +5 -17
  3. package/dist/engine/cascade-hooks/registry.js +0 -2
  4. package/dist/engine/challenge-scenarios-loader.d.ts +3 -3
  5. package/dist/engine/compliance-injector.d.ts +3 -3
  6. package/dist/engine/dashboard/kanban-logic.d.ts +1 -1
  7. package/dist/engine/doc-generator/portal/risk-matrix-svg.d.ts +1 -1
  8. package/dist/engine/doc-generator/proposal/proposal-generator.d.ts +1 -1
  9. package/dist/engine/elicitation/answer-extractor.d.ts +1 -4
  10. package/dist/engine/elicitation/answer-extractor.js +197 -68
  11. package/dist/engine/elicitation/decision-gap-detector.js +59 -79
  12. package/dist/engine/elicitation/index.d.ts +0 -1
  13. package/dist/engine/elicitation/index.js +0 -1
  14. package/dist/engine/elicitation/question-generator.js +10 -3
  15. package/dist/engine/elicitation/question-grounding-gate.js +83 -34
  16. package/dist/engine/evidence-gates/lifecycle-gate.js +27 -14
  17. package/dist/engine/evidence-index/index-builder.js +7 -2
  18. package/dist/engine/frontmatter-sha/frozen-fields.d.ts +1 -1
  19. package/dist/engine/handoff-artifacts/schemas/red-tests-handoff.d.ts +2 -2
  20. package/dist/engine/handoff-artifacts/schemas.d.ts +22 -22
  21. package/dist/engine/human-summary.js +3 -3
  22. package/dist/engine/implementation-contract/common.d.ts +1 -1
  23. package/dist/engine/implementation-contract/renderer.js +17 -39
  24. package/dist/engine/keyword-matcher/stopwords.d.ts +2 -2
  25. package/dist/engine/lifecycle-hints.d.ts +1 -1
  26. package/dist/engine/lifecycle-hints.js +13 -29
  27. package/dist/engine/provider-adapters/adapters/claude.d.ts +1 -1
  28. package/dist/engine/provider-adapters/adapters/gemini.d.ts +1 -1
  29. package/dist/engine/provider-adapters/adapters/gpt4.d.ts +1 -1
  30. package/dist/engine/provider-adapters/adapters/markdown.d.ts +1 -1
  31. package/dist/engine/safety/atomic-write-file.d.ts +1 -1
  32. package/dist/engine/safety/cross-process-lock.d.ts +1 -1
  33. package/dist/engine/safety/path-sanitizer.d.ts +1 -1
  34. package/dist/engine/security-analyzer/profile-detector.js +48 -16
  35. package/dist/engine/spec-format/copula-blacklist.d.ts +2 -2
  36. package/dist/engine/spec-format/lean-spec-generator.d.ts +2 -2
  37. package/dist/engine/spec-format/lean-spec-generator.js +9 -10
  38. package/dist/engine/spec-format/metadata-value-policy.d.ts +20 -20
  39. package/dist/engine/spec-generator/fallback-generator.js +13 -20
  40. package/dist/engine/spec-grounding/contract.d.ts +5 -0
  41. package/dist/engine/spec-grounding/contract.js +10 -6
  42. package/dist/engine/spec-migrator/lean-migration.js +9 -16
  43. package/dist/engine/text-signal-boundaries.js +45 -12
  44. package/dist/engine/universal-rules/rules/planu-modes.js +0 -2
  45. package/dist/engine/web-fetcher/stack-advisor.d.ts +2 -2
  46. package/dist/engine/web-fetcher/stack-advisor.js +78 -17
  47. package/dist/engine/well-known/manifest-schema.d.ts +33 -33
  48. package/dist/engine/workers/schema.d.ts +3 -3
  49. package/dist/hosts/claude-code/ux/mcp-resources.d.ts +4 -4
  50. package/dist/hosts/codex/rest-shim.d.ts +1 -1
  51. package/dist/native/lightweight-command-catalog.d.ts +30 -30
  52. package/dist/server/openapi-spec.d.ts +132 -132
  53. package/dist/tools/challenge-spec/challenge-report.d.ts +13 -0
  54. package/dist/tools/challenge-spec/challenge-report.js +55 -0
  55. package/dist/tools/challenge-spec/event-challenge-scenarios.js +8 -27
  56. package/dist/tools/challenge-spec/resilience-challenge-scenarios-a.js +16 -32
  57. package/dist/tools/challenge-spec/resilience-challenge-scenarios-b.js +15 -20
  58. package/dist/tools/challenge-spec/scenario-collector.d.ts +13 -0
  59. package/dist/tools/challenge-spec/scenario-collector.js +86 -0
  60. package/dist/tools/challenge-spec/scenarios-data.js +10 -9
  61. package/dist/tools/challenge-spec/scenarios-failure.js +38 -54
  62. package/dist/tools/challenge-spec/scenarios-scale.js +14 -15
  63. package/dist/tools/challenge-spec/scenarios-security.d.ts +1 -1
  64. package/dist/tools/challenge-spec/scenarios-security.js +18 -11
  65. package/dist/tools/challenge-spec/scenarios-utils.d.ts +31 -5
  66. package/dist/tools/challenge-spec/scenarios-utils.js +102 -6
  67. package/dist/tools/challenge-spec/security-challenge-scenarios.d.ts +1 -1
  68. package/dist/tools/challenge-spec/security-challenge-scenarios.js +20 -25
  69. package/dist/tools/challenge-spec.js +46 -124
  70. package/dist/tools/clarify-requirements/multiple-choice.js +1 -1
  71. package/dist/tools/clarify-requirements/questions-context.js +11 -11
  72. package/dist/tools/clarify-requirements/questions.js +3 -23
  73. package/dist/tools/clarify-requirements.js +38 -0
  74. package/dist/tools/compliance-gate-handler.d.ts +1 -1
  75. package/dist/tools/create-spec/autopilot-analyzer.d.ts +1 -1
  76. package/dist/tools/create-spec/autopilot-analyzer.js +29 -54
  77. package/dist/tools/create-spec/post-creation.js +23 -4
  78. package/dist/tools/create-spec.js +51 -168
  79. package/dist/tools/delete-first/suggest-deletions.d.ts +1 -1
  80. package/dist/tools/elicit-requirements-handler.js +20 -12
  81. package/dist/tools/generate-batch-script.d.ts +2 -2
  82. package/dist/tools/init-project/rules-generator.js +0 -1
  83. package/dist/tools/oauth-handler.d.ts +1 -1
  84. package/dist/tools/register-sdd-tools.d.ts +1 -1
  85. package/dist/tools/register-spec-tools/core-spec-tools.js +11 -2
  86. package/dist/tools/render-spec-for-provider.d.ts +2 -2
  87. package/dist/tools/scan-orphan-spec-refs.d.ts +6 -6
  88. package/dist/tools/schemas/agents.d.ts +7 -7
  89. package/dist/tools/schemas/analysis.d.ts +11 -11
  90. package/dist/tools/schemas/delete.d.ts +5 -5
  91. package/dist/tools/schemas/github.d.ts +4 -4
  92. package/dist/tools/schemas/ide-config.d.ts +12 -12
  93. package/dist/tools/schemas/infra.d.ts +9 -9
  94. package/dist/tools/schemas/lifecycle.d.ts +50 -50
  95. package/dist/tools/schemas/llm-provider-schemas.d.ts +7 -7
  96. package/dist/tools/schemas/plugins-schemas.d.ts +12 -12
  97. package/dist/tools/schemas/project-graph.d.ts +6 -6
  98. package/dist/tools/schemas/rbac.d.ts +2 -2
  99. package/dist/tools/schemas/registry.d.ts +3 -3
  100. package/dist/tools/schemas/runtime-security.d.ts +2 -2
  101. package/dist/tools/schemas/session.d.ts +2 -2
  102. package/dist/tools/schemas/spec.d.ts +15 -15
  103. package/dist/tools/schemas/token-intelligence.d.ts +6 -6
  104. package/dist/tools/schemas/token-optimization.d.ts +2 -2
  105. package/dist/tools/schemas/workers-schema.d.ts +4 -4
  106. package/dist/tools/skill-bootstrap-handler.d.ts +7 -7
  107. package/dist/tools/suggest-stack.js +49 -13
  108. package/dist/tools/tool-registry/deprecated-stubs.d.ts +1 -1
  109. package/dist/tools/triage-request.d.ts +3 -3
  110. package/dist/tools/update-status/dod-gates.d.ts +8 -0
  111. package/dist/tools/update-status/dod-gates.js +68 -43
  112. package/dist/tools/update-status/file-sync.d.ts +1 -1
  113. package/dist/tools/update-status/file-sync.js +10 -45
  114. package/dist/tools/update-status/index.js +133 -97
  115. package/dist/tools/update-status/qa-gate.js +26 -0
  116. package/dist/tools/update-status/response-builder.d.ts +1 -1
  117. package/dist/tools/update-status/response-builder.js +11 -19
  118. package/dist/tools/update-status/transition-guard.d.ts +2 -2
  119. package/dist/tools/update-status/transition-guard.js +11 -8
  120. package/dist/tools/update-status-actions.d.ts +0 -1
  121. package/dist/tools/update-status-actions.js +10 -26
  122. package/dist/tools/update-status-convention-gate.d.ts +1 -6
  123. package/dist/tools/update-status-convention-gate.js +9 -33
  124. package/dist/tools/validate-lint.d.ts +1 -1
  125. package/dist/tools/validate-lint.js +39 -1
  126. package/dist/types/docs.d.ts +0 -4
  127. package/dist/types/env.d.ts +0 -4
  128. package/dist/types/estimation.d.ts +0 -2
  129. package/dist/types/multi-teammate-review.d.ts +4 -4
  130. package/dist/types/plugin-install.d.ts +7 -7
  131. package/dist/types/spec/core.d.ts +20 -0
  132. package/dist/types/spec/inputs.d.ts +1 -1
  133. package/dist/types/stack/index.d.ts +1 -1
  134. package/dist/types/stack/recommend.d.ts +10 -0
  135. package/package.json +21 -18
  136. package/planu-native.json +1 -1
  137. package/planu-plugin.json +1 -1
  138. package/src/i18n/messages/en.json +0 -72
  139. package/src/i18n/messages/es.json +0 -72
  140. package/src/i18n/messages/pt.json +0 -72
  141. package/dist/config/elicitation-dimensions.json +0 -51
  142. package/dist/engine/actuals-estimator.d.ts +0 -14
  143. package/dist/engine/actuals-estimator.js +0 -64
  144. package/dist/engine/cascade-hooks/hooks/living-specs.hook.d.ts +0 -3
  145. package/dist/engine/cascade-hooks/hooks/living-specs.hook.js +0 -19
  146. package/dist/engine/elicitation/non-interactive-defaults.d.ts +0 -9
  147. package/dist/engine/elicitation/non-interactive-defaults.js +0 -28
  148. package/dist/engine/elicitation/option-builder.d.ts +0 -9
  149. package/dist/engine/elicitation/option-builder.js +0 -85
  150. package/dist/engine/progress-writer.d.ts +0 -10
  151. package/dist/engine/progress-writer.js +0 -63
  152. package/dist/tools/clarify-requirements/interview-mode.d.ts +0 -42
  153. package/dist/tools/clarify-requirements/interview-mode.js +0 -342
  154. package/dist/tools/update-status/mode-hints.d.ts +0 -4
  155. package/dist/tools/update-status/mode-hints.js +0 -24
@@ -1,342 +0,0 @@
1
- // tools/clarify-requirements/interview-mode.ts — Structured Interview Mode (SPEC-252)
2
- // Tracks coverage across 7 dimensions and guides toward create_spec
3
- import { isShortTopic } from './questions.js';
4
- /** Keywords per dimension used to detect coverage from answer text. */
5
- const DIMENSION_KEYWORDS = {
6
- technical: [
7
- 'typescript',
8
- 'javascript',
9
- 'python',
10
- 'java',
11
- 'rust',
12
- 'go',
13
- 'database',
14
- 'sql',
15
- 'nosql',
16
- 'api',
17
- 'rest',
18
- 'graphql',
19
- 'grpc',
20
- 'microservice',
21
- 'monolith',
22
- 'architecture',
23
- 'framework',
24
- 'library',
25
- 'sdk',
26
- 'algorithm',
27
- 'data structure',
28
- 'cache',
29
- 'queue',
30
- 'message broker',
31
- 'docker',
32
- 'kubernetes',
33
- 'serverless',
34
- 'function',
35
- 'endpoint',
36
- 'backend',
37
- 'frontend',
38
- 'fullstack',
39
- 'stack',
40
- 'implementation',
41
- 'deploy',
42
- 'build',
43
- 'compile',
44
- 'runtime',
45
- ],
46
- ux: [
47
- 'user',
48
- 'ui',
49
- 'interface',
50
- 'ux',
51
- 'experience',
52
- 'design',
53
- 'layout',
54
- 'screen',
55
- 'page',
56
- 'form',
57
- 'input',
58
- 'button',
59
- 'menu',
60
- 'navigation',
61
- 'mobile',
62
- 'responsive',
63
- 'accessible',
64
- 'accessibility',
65
- 'a11y',
66
- 'wcag',
67
- 'flow',
68
- 'journey',
69
- 'onboarding',
70
- 'dashboard',
71
- 'view',
72
- 'visual',
73
- 'theme',
74
- 'color',
75
- 'typography',
76
- 'component',
77
- 'widget',
78
- ],
79
- 'edge-cases': [
80
- 'edge case',
81
- 'corner case',
82
- 'error',
83
- 'failure',
84
- 'invalid',
85
- 'empty',
86
- 'null',
87
- 'undefined',
88
- 'exception',
89
- 'boundary',
90
- 'limit',
91
- 'overflow',
92
- 'timeout',
93
- 'retry',
94
- 'fallback',
95
- 'race condition',
96
- 'concurrent',
97
- 'duplicate',
98
- 'missing',
99
- 'malformed',
100
- 'validation',
101
- 'constraint',
102
- 'maximum',
103
- 'minimum',
104
- 'zero',
105
- 'negative',
106
- 'large',
107
- 'empty list',
108
- 'not found',
109
- '404',
110
- 'conflict',
111
- ],
112
- tradeoffs: [
113
- 'tradeoff',
114
- 'trade-off',
115
- 'vs',
116
- 'versus',
117
- 'alternative',
118
- 'option',
119
- 'approach',
120
- 'decision',
121
- 'pros',
122
- 'cons',
123
- 'advantage',
124
- 'disadvantage',
125
- 'balance',
126
- 'priority',
127
- 'complexity',
128
- 'simplicity',
129
- 'maintainability',
130
- 'scalability',
131
- 'cost',
132
- 'benefit',
133
- 'risk',
134
- 'impact',
135
- 'consistency',
136
- 'availability',
137
- 'partition',
138
- 'cap theorem',
139
- 'eventual',
140
- 'strong consistency',
141
- ],
142
- security: [
143
- 'security',
144
- 'auth',
145
- 'authentication',
146
- 'authorization',
147
- 'permission',
148
- 'role',
149
- 'rbac',
150
- 'jwt',
151
- 'token',
152
- 'session',
153
- 'cookie',
154
- 'csrf',
155
- 'xss',
156
- 'sql injection',
157
- 'sanitize',
158
- 'encrypt',
159
- 'encryption',
160
- 'https',
161
- 'tls',
162
- 'ssl',
163
- 'secret',
164
- 'credential',
165
- 'password',
166
- 'hash',
167
- 'salt',
168
- 'oauth',
169
- 'saml',
170
- 'sso',
171
- 'rate limit',
172
- 'ddos',
173
- 'audit log',
174
- 'pii',
175
- 'gdpr',
176
- 'data protection',
177
- 'vulnerability',
178
- 'threat',
179
- 'attack',
180
- 'penetration',
181
- ],
182
- performance: [
183
- 'performance',
184
- 'latency',
185
- 'throughput',
186
- 'response time',
187
- 'speed',
188
- 'fast',
189
- 'slow',
190
- 'optimization',
191
- 'cache',
192
- 'caching',
193
- 'cdn',
194
- 'load',
195
- 'scale',
196
- 'concurrent',
197
- 'async',
198
- 'parallel',
199
- 'batch',
200
- 'benchmark',
201
- 'profile',
202
- 'metric',
203
- 'monitor',
204
- 'sla',
205
- 'p99',
206
- 'p95',
207
- 'millisecond',
208
- 'second',
209
- 'rps',
210
- 'tps',
211
- 'qps',
212
- 'memory',
213
- 'cpu',
214
- 'bandwidth',
215
- 'bottleneck',
216
- ],
217
- integration: [
218
- 'integration',
219
- 'integrate',
220
- 'api',
221
- 'webhook',
222
- 'event',
223
- 'third-party',
224
- 'external',
225
- 'service',
226
- 'provider',
227
- 'vendor',
228
- 'sdk',
229
- 'library',
230
- 'plugin',
231
- 'connector',
232
- 'adapter',
233
- 'interface',
234
- 'contract',
235
- 'protocol',
236
- 'format',
237
- 'json',
238
- 'xml',
239
- 'csv',
240
- 'import',
241
- 'export',
242
- 'sync',
243
- 'async',
244
- 'push',
245
- 'pull',
246
- 'poll',
247
- 'stream',
248
- 'batch',
249
- 'migration',
250
- 'interop',
251
- ],
252
- };
253
- /** Priority order for picking the next uncovered dimension. */
254
- const DIMENSION_PRIORITY = [
255
- 'technical',
256
- 'security',
257
- 'edge-cases',
258
- 'performance',
259
- 'integration',
260
- 'tradeoffs',
261
- 'ux',
262
- ];
263
- /** Questions template per dimension. Avoids trivial things a senior dev already knows. */
264
- const DIMENSION_QUESTION_TEMPLATES = {
265
- technical: (topic) => `For "${topic}", which architectural constraints or technology choices are non-negotiable — and which are open to discussion?`,
266
- ux: (topic) => `Who are the distinct user personas for "${topic}", and what are the critical interaction flows that must feel seamless?`,
267
- 'edge-cases': (topic) => `What are the failure modes for "${topic}" that could silently corrupt data or leave the system in an inconsistent state?`,
268
- tradeoffs: (topic) => `What tradeoffs are you willing to accept for "${topic}" — e.g., consistency vs. availability, simplicity vs. extensibility, speed to ship vs. completeness?`,
269
- security: (topic) => `What is the threat model for "${topic}"? Which data is sensitive, who are the adversaries, and which attack vectors are in scope?`,
270
- performance: (topic) => `What are the concrete SLAs for "${topic}" — target latency (p95/p99), throughput (rps), and acceptable degradation under load?`,
271
- integration: (topic) => `Which external systems or third-party services must "${topic}" integrate with, and what are the contract/version constraints?`,
272
- };
273
- /**
274
- * Analyzes answers to update which dimensions are covered.
275
- * Merges with an existing coverage map if provided.
276
- */
277
- export function updateCoverageFromAnswers(answers, existing) {
278
- const base = existing ?? {
279
- technical: false,
280
- ux: false,
281
- 'edge-cases': false,
282
- tradeoffs: false,
283
- security: false,
284
- performance: false,
285
- integration: false,
286
- };
287
- const allText = Object.values(answers).join(' ').toLowerCase();
288
- const dimensions = Object.keys(DIMENSION_KEYWORDS);
289
- const updated = { ...base };
290
- for (const dim of dimensions) {
291
- if (updated[dim]) {
292
- continue;
293
- } // already covered
294
- const keywords = DIMENSION_KEYWORDS[dim];
295
- if (keywords.some((kw) => allText.includes(kw))) {
296
- updated[dim] = true;
297
- }
298
- }
299
- return updated;
300
- }
301
- /**
302
- * Returns the lowest-priority uncovered dimension, or null if all are covered.
303
- */
304
- export function pickNextDimension(coverage) {
305
- for (const dim of DIMENSION_PRIORITY) {
306
- if (!coverage[dim]) {
307
- return dim;
308
- }
309
- }
310
- return null;
311
- }
312
- /**
313
- * Generates a targeted follow-up question for a specific dimension.
314
- * Takes existing answers into account to avoid repeating covered ground.
315
- */
316
- export function generateDimensionQuestion(dimension, topic, answers) {
317
- const alreadyMentioned = Object.values(answers).join(' ').toLowerCase();
318
- const baseQuestion = DIMENSION_QUESTION_TEMPLATES[dimension](topic);
319
- // Add context hint if the answer set is non-empty and hints at partial coverage
320
- const keywords = DIMENSION_KEYWORDS[dimension];
321
- const partiallyMentioned = keywords.filter((kw) => alreadyMentioned.includes(kw));
322
- if (partiallyMentioned.length > 0 && partiallyMentioned.length < 3) {
323
- return `${baseQuestion} (You mentioned ${partiallyMentioned.slice(0, 2).join(', ')} — go deeper on constraints and non-obvious implications.)`;
324
- }
325
- return baseQuestion;
326
- }
327
- /**
328
- * Computes completion percentage based on how many dimensions are covered (0–100).
329
- */
330
- export function computeCompletion(coverage) {
331
- const total = Object.keys(coverage).length;
332
- const covered = Object.values(coverage).filter(Boolean).length;
333
- return total === 0 ? 0 : Math.round((covered / total) * 100);
334
- }
335
- /**
336
- * Returns true if the topic is too simple for interview mode.
337
- * Delegates to isShortTopic from questions.ts.
338
- */
339
- export function shouldSkipInterview(topic) {
340
- return isShortTopic(topic);
341
- }
342
- //# sourceMappingURL=interview-mode.js.map
@@ -1,4 +0,0 @@
1
- import type { ModeSuggestion } from '../../types/index.js';
2
- /** Returns the suggested Claude Code permission mode for a given spec status, or undefined for unknown statuses. */
3
- export declare function getSuggestedMode(newStatus: string): ModeSuggestion | undefined;
4
- //# sourceMappingURL=mode-hints.d.ts.map
@@ -1,24 +0,0 @@
1
- // tools/update-status/mode-hints.ts — Map spec status to suggested Claude Code permission mode
2
- // SPEC-494: Claude Code mode hints per spec phase
3
- const MODE_MAP = {
4
- draft: 'default',
5
- review: 'default',
6
- approved: 'plan',
7
- implementing: 'acceptEdits',
8
- done: 'default',
9
- discarded: 'default',
10
- };
11
- const MODE_HINTS = {
12
- default: 'Spec is in an early phase — Claude will ask before each change.',
13
- plan: 'Spec is approved. Use `/mode plan` to prevent accidental edits while reviewing the implementation plan.',
14
- acceptEdits: 'Spec is the contract — safe to auto-accept file edits. Use `/mode acceptEdits`. Bash commands still ask for approval.',
15
- };
16
- /** Returns the suggested Claude Code permission mode for a given spec status, or undefined for unknown statuses. */
17
- export function getSuggestedMode(newStatus) {
18
- const mode = MODE_MAP[newStatus];
19
- if (mode === undefined) {
20
- return undefined;
21
- }
22
- return { mode, hint: MODE_HINTS[mode] ?? '' };
23
- }
24
- //# sourceMappingURL=mode-hints.js.map