@seanmars/tospec 0.19.0-beta.7 → 0.19.0-beta.8

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 (194) hide show
  1. package/CHANGELOG.md +80 -1
  2. package/assets/dashboard/app.js +3 -3
  3. package/assets/rules/tospec/decision.md +3 -0
  4. package/dist/cli/index.d.ts.map +1 -1
  5. package/dist/cli/index.js +191 -33
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/commands/config.d.ts.map +1 -1
  8. package/dist/commands/config.js +135 -24
  9. package/dist/commands/config.js.map +1 -1
  10. package/dist/commands/dashboard.d.ts +2 -2
  11. package/dist/commands/dashboard.d.ts.map +1 -1
  12. package/dist/commands/dashboard.js +75 -10
  13. package/dist/commands/dashboard.js.map +1 -1
  14. package/dist/commands/decision.d.ts +11 -0
  15. package/dist/commands/decision.d.ts.map +1 -1
  16. package/dist/commands/decision.js +164 -26
  17. package/dist/commands/decision.js.map +1 -1
  18. package/dist/commands/shared-output.d.ts +12 -0
  19. package/dist/commands/shared-output.d.ts.map +1 -1
  20. package/dist/commands/shared-output.js +50 -1
  21. package/dist/commands/shared-output.js.map +1 -1
  22. package/dist/commands/show.d.ts +10 -0
  23. package/dist/commands/show.d.ts.map +1 -1
  24. package/dist/commands/show.js +13 -3
  25. package/dist/commands/show.js.map +1 -1
  26. package/dist/commands/validate.d.ts +23 -1
  27. package/dist/commands/validate.d.ts.map +1 -1
  28. package/dist/commands/validate.js +61 -12
  29. package/dist/commands/validate.js.map +1 -1
  30. package/dist/commands/workflow/index.d.ts +5 -5
  31. package/dist/commands/workflow/index.d.ts.map +1 -1
  32. package/dist/commands/workflow/index.js +5 -5
  33. package/dist/commands/workflow/index.js.map +1 -1
  34. package/dist/commands/workflow/instructions.d.ts +23 -0
  35. package/dist/commands/workflow/instructions.d.ts.map +1 -1
  36. package/dist/commands/workflow/instructions.js +84 -16
  37. package/dist/commands/workflow/instructions.js.map +1 -1
  38. package/dist/commands/workflow/new-change.d.ts +2 -0
  39. package/dist/commands/workflow/new-change.d.ts.map +1 -1
  40. package/dist/commands/workflow/new-change.js +32 -4
  41. package/dist/commands/workflow/new-change.js.map +1 -1
  42. package/dist/commands/workflow/schemas.d.ts +2 -0
  43. package/dist/commands/workflow/schemas.d.ts.map +1 -1
  44. package/dist/commands/workflow/schemas.js +38 -1
  45. package/dist/commands/workflow/schemas.js.map +1 -1
  46. package/dist/commands/workflow/shared.d.ts +34 -2
  47. package/dist/commands/workflow/shared.d.ts.map +1 -1
  48. package/dist/commands/workflow/shared.js +37 -3
  49. package/dist/commands/workflow/shared.js.map +1 -1
  50. package/dist/commands/workflow/status.d.ts +14 -0
  51. package/dist/commands/workflow/status.d.ts.map +1 -1
  52. package/dist/commands/workflow/status.js +62 -8
  53. package/dist/commands/workflow/status.js.map +1 -1
  54. package/dist/commands/workflow/templates.d.ts +7 -0
  55. package/dist/commands/workflow/templates.d.ts.map +1 -1
  56. package/dist/commands/workflow/templates.js +13 -0
  57. package/dist/commands/workflow/templates.js.map +1 -1
  58. package/dist/core/archive.d.ts +14 -0
  59. package/dist/core/archive.d.ts.map +1 -1
  60. package/dist/core/archive.js +151 -21
  61. package/dist/core/archive.js.map +1 -1
  62. package/dist/core/artifact-graph/index.d.ts +1 -1
  63. package/dist/core/artifact-graph/index.d.ts.map +1 -1
  64. package/dist/core/artifact-graph/index.js +1 -1
  65. package/dist/core/artifact-graph/index.js.map +1 -1
  66. package/dist/core/artifact-graph/instruction-loader.d.ts +63 -3
  67. package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
  68. package/dist/core/artifact-graph/instruction-loader.js +35 -26
  69. package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
  70. package/dist/core/artifact-graph/resolver.d.ts +26 -0
  71. package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
  72. package/dist/core/artifact-graph/resolver.js +44 -4
  73. package/dist/core/artifact-graph/resolver.js.map +1 -1
  74. package/dist/core/artifact-graph/stub-detection.d.ts +20 -0
  75. package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -0
  76. package/dist/core/artifact-graph/stub-detection.js +42 -0
  77. package/dist/core/artifact-graph/stub-detection.js.map +1 -0
  78. package/dist/core/change-presenter.d.ts +16 -0
  79. package/dist/core/change-presenter.d.ts.map +1 -1
  80. package/dist/core/change-presenter.js +68 -9
  81. package/dist/core/change-presenter.js.map +1 -1
  82. package/dist/core/change-status-policy.d.ts +12 -1
  83. package/dist/core/change-status-policy.d.ts.map +1 -1
  84. package/dist/core/change-status-policy.js +33 -1
  85. package/dist/core/change-status-policy.js.map +1 -1
  86. package/dist/core/codex-residue.js +1 -1
  87. package/dist/core/config-schema.d.ts +1 -12
  88. package/dist/core/config-schema.d.ts.map +1 -1
  89. package/dist/core/config-schema.js +27 -1
  90. package/dist/core/config-schema.js.map +1 -1
  91. package/dist/core/config.d.ts +37 -0
  92. package/dist/core/config.d.ts.map +1 -1
  93. package/dist/core/config.js +37 -0
  94. package/dist/core/config.js.map +1 -1
  95. package/dist/core/dashboard-activity.js +2 -2
  96. package/dist/core/dashboard-activity.js.map +1 -1
  97. package/dist/core/dashboard-data.d.ts +5 -0
  98. package/dist/core/dashboard-data.d.ts.map +1 -1
  99. package/dist/core/dashboard-data.js +15 -8
  100. package/dist/core/dashboard-data.js.map +1 -1
  101. package/dist/core/init.d.ts +22 -0
  102. package/dist/core/init.d.ts.map +1 -1
  103. package/dist/core/init.js +107 -42
  104. package/dist/core/init.js.map +1 -1
  105. package/dist/core/list.d.ts +1 -1
  106. package/dist/core/list.d.ts.map +1 -1
  107. package/dist/core/list.js +68 -17
  108. package/dist/core/list.js.map +1 -1
  109. package/dist/core/markdown-render.d.ts +33 -0
  110. package/dist/core/markdown-render.d.ts.map +1 -0
  111. package/dist/core/markdown-render.js +103 -0
  112. package/dist/core/markdown-render.js.map +1 -0
  113. package/dist/core/migrate.d.ts +17 -5
  114. package/dist/core/migrate.d.ts.map +1 -1
  115. package/dist/core/migrate.js +48 -2
  116. package/dist/core/migrate.js.map +1 -1
  117. package/dist/core/parsers/change-parser.js +1 -1
  118. package/dist/core/parsers/change-parser.js.map +1 -1
  119. package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
  120. package/dist/core/parsers/markdown-parser.js +16 -0
  121. package/dist/core/parsers/markdown-parser.js.map +1 -1
  122. package/dist/core/root-selection.d.ts +11 -1
  123. package/dist/core/root-selection.d.ts.map +1 -1
  124. package/dist/core/root-selection.js +4 -2
  125. package/dist/core/root-selection.js.map +1 -1
  126. package/dist/core/rules.d.ts +6 -1
  127. package/dist/core/rules.d.ts.map +1 -1
  128. package/dist/core/rules.js +24 -2
  129. package/dist/core/rules.js.map +1 -1
  130. package/dist/core/schemas/base.schema.d.ts +3 -0
  131. package/dist/core/schemas/base.schema.d.ts.map +1 -1
  132. package/dist/core/schemas/base.schema.js +22 -0
  133. package/dist/core/schemas/base.schema.js.map +1 -1
  134. package/dist/core/schemas/change.schema.d.ts +8 -0
  135. package/dist/core/schemas/change.schema.d.ts.map +1 -1
  136. package/dist/core/schemas/spec.schema.d.ts +2 -0
  137. package/dist/core/schemas/spec.schema.d.ts.map +1 -1
  138. package/dist/core/shared/index.d.ts +1 -1
  139. package/dist/core/shared/index.d.ts.map +1 -1
  140. package/dist/core/shared/index.js +1 -1
  141. package/dist/core/shared/index.js.map +1 -1
  142. package/dist/core/shared/rules-generation.d.ts +27 -6
  143. package/dist/core/shared/rules-generation.d.ts.map +1 -1
  144. package/dist/core/shared/rules-generation.js +115 -44
  145. package/dist/core/shared/rules-generation.js.map +1 -1
  146. package/dist/core/shared/tool-detection.d.ts +19 -0
  147. package/dist/core/shared/tool-detection.d.ts.map +1 -1
  148. package/dist/core/shared/tool-detection.js +30 -2
  149. package/dist/core/shared/tool-detection.js.map +1 -1
  150. package/dist/core/spec-presenter.d.ts.map +1 -1
  151. package/dist/core/spec-presenter.js +5 -0
  152. package/dist/core/spec-presenter.js.map +1 -1
  153. package/dist/core/specs-apply.d.ts +15 -1
  154. package/dist/core/specs-apply.d.ts.map +1 -1
  155. package/dist/core/specs-apply.js +33 -11
  156. package/dist/core/specs-apply.js.map +1 -1
  157. package/dist/core/templates/workflows/apply.js +1 -1
  158. package/dist/core/templates/workflows/apply.js.map +1 -1
  159. package/dist/core/templates/workflows/archive.d.ts.map +1 -1
  160. package/dist/core/templates/workflows/archive.js +4 -2
  161. package/dist/core/templates/workflows/archive.js.map +1 -1
  162. package/dist/core/templates/workflows/decision.js +1 -1
  163. package/dist/core/update.d.ts +26 -0
  164. package/dist/core/update.d.ts.map +1 -1
  165. package/dist/core/update.js +111 -23
  166. package/dist/core/update.js.map +1 -1
  167. package/dist/core/validation/constants.d.ts +1 -1
  168. package/dist/core/validation/constants.d.ts.map +1 -1
  169. package/dist/core/validation/constants.js +6 -1
  170. package/dist/core/validation/constants.js.map +1 -1
  171. package/dist/core/validation/section-validator.d.ts.map +1 -1
  172. package/dist/core/validation/section-validator.js +21 -3
  173. package/dist/core/validation/section-validator.js.map +1 -1
  174. package/dist/core/validation/validator.d.ts +9 -3
  175. package/dist/core/validation/validator.d.ts.map +1 -1
  176. package/dist/core/validation/validator.js +58 -8
  177. package/dist/core/validation/validator.js.map +1 -1
  178. package/dist/utils/change-utils.d.ts +28 -0
  179. package/dist/utils/change-utils.d.ts.map +1 -1
  180. package/dist/utils/change-utils.js +115 -26
  181. package/dist/utils/change-utils.js.map +1 -1
  182. package/dist/utils/file-system.d.ts +1 -1
  183. package/dist/utils/file-system.js +1 -1
  184. package/dist/utils/item-discovery.d.ts +20 -5
  185. package/dist/utils/item-discovery.d.ts.map +1 -1
  186. package/dist/utils/item-discovery.js +28 -9
  187. package/dist/utils/item-discovery.js.map +1 -1
  188. package/dist/utils/task-progress.js +1 -1
  189. package/package.json +1 -1
  190. package/schemas/decision/templates/decision.md +3 -1
  191. package/schemas/decision/templates/index.md +2 -2
  192. package/schemas/issue/templates/spec.md +8 -0
  193. package/schemas/sdd/templates/spec.md +8 -0
  194. /package/assets/rules/tospec/{single-sourc-of-truth.md → single-source-of-truth.md} +0 -0
@@ -16,15 +16,51 @@ import { getAvailableTools } from './available-tools.js';
16
16
  import { copyDir } from '../utils/link.js';
17
17
  import { planWorkflowRules, writeWorkflowRules } from './shared/rules-generation.js';
18
18
  import { hasResidualCodexOutput, RESIDUAL_CODEX_NOTICE } from './codex-residue.js';
19
+ import { emitSuccess } from '../commands/shared-output.js';
19
20
  const require = createRequire(import.meta.url);
20
21
  const { version: TOSPEC_VERSION } = require('../../package.json');
21
22
  const OLD_CORE_WORKFLOWS = ['propose', 'explore', 'apply', 'archive'];
22
23
  const WORKFLOW_TO_SKILL_DIR = Object.fromEntries(getSkillTemplates().map(({ workflowId, dirName }) => [workflowId, dirName]));
24
+ /** The `--json` null-shape; mirrors the success payload with `update` nulled. */
25
+ export const UPDATE_FAILURE_PAYLOAD = { update: null, root: null };
23
26
  export class UpdateCommand {
24
27
  force;
28
+ json;
25
29
  constructor(options = {}) {
26
30
  this.force = options.force ?? false;
31
+ this.json = options.json ?? false;
27
32
  }
33
+ /**
34
+ * Progress prose, suppressed under `--json`.
35
+ *
36
+ * Every line this command prints is a running commentary on work the final
37
+ * JSON document already reports; on stdout beside that document it would
38
+ * break the one-envelope contract.
39
+ */
40
+ say(...args) {
41
+ if (!this.json)
42
+ console.log(...args);
43
+ }
44
+ /**
45
+ * A non-fatal finding about the run, recorded for `status[]` and printed for
46
+ * a human reader. Warnings must not go through `say()`: that channel is
47
+ * running commentary on work the JSON document already reports, so silencing
48
+ * it under `--json` loses nothing — but a warning has no other carrier, and
49
+ * dropping it leaves the agent-facing mode strictly less informed than the
50
+ * human one about the very runs that need explaining.
51
+ *
52
+ * One helper both records and prints, so no call site can do half of it.
53
+ */
54
+ warn(code, message, fix) {
55
+ this.jsonWarnings.push({ severity: 'warning', code, message, ...(fix ? { fix } : {}) });
56
+ if (!this.json) {
57
+ console.log(`Warning: ${message}`);
58
+ if (fix)
59
+ console.log(fix);
60
+ }
61
+ }
62
+ /** Emitted alongside the success payload; empty means the key is omitted. */
63
+ jsonWarnings = [];
28
64
  async execute(projectPath) {
29
65
  const resolvedProjectPath = path.resolve(projectPath);
30
66
  const tospecPath = path.join(resolvedProjectPath, TOSPEC_DIR_NAME);
@@ -42,12 +78,45 @@ export class UpdateCommand {
42
78
  const profile = globalConfig.profile ?? 'core';
43
79
  const profileWorkflows = getProfileWorkflows(profile, globalConfig.workflows);
44
80
  const desiredWorkflows = profileWorkflows.filter((workflow) => ALL_WORKFLOWS.includes(workflow));
81
+ // An empty selection is a legitimate instruction ("install no workflows"),
82
+ // but it is far more often a profile left half-configured — `config profile
83
+ // custom` with nothing picked resolves to zero workflows. Either way this run
84
+ // is about to remove every skill dir, so it says which setting caused that
85
+ // and how to reverse it, rather than reporting the deletion after the fact.
86
+ if (desiredWorkflows.length === 0) {
87
+ this.warn('update_profile_selects_no_workflows', `Profile '${profile}' selects no workflows, so this update removes every tospec skill.`, 'Run "tospec config profile core" then "tospec update" to restore them.');
88
+ }
89
+ // The mirror of the case above: a `workflows` list that exists and is not
90
+ // read, because only the `custom` profile consults it. `config set workflows`
91
+ // accepts the list, validates every id in it, and `config list` displays it,
92
+ // so nothing up to this point contradicts the belief that it applies — and
93
+ // this run then installs a different set without comment.
94
+ if (profile !== 'custom' && globalConfig.workflows && globalConfig.workflows.length > 0) {
95
+ this.warn('update_workflows_ignored', `Profile '${profile}' installs every workflow, so the configured workflows list is not used.`, 'Run "tospec config profile custom" to apply it, or "tospec config unset workflows" to drop it.');
96
+ }
45
97
  if (configuredTools.length === 0) {
46
- console.log('No configured tools found.');
47
- console.log('Run "tospec init" to set up tools.');
98
+ this.say('No configured tools found.');
99
+ this.say('Run "tospec init" to set up tools.');
48
100
  // A project whose only agent directory was `.codex` lands here, and it is
49
101
  // the exact case the notice exists for — so it must not be skipped.
50
102
  this.reportResidualCodexOutput(resolvedProjectPath);
103
+ // Not an error — nothing was asked for that could not be done — but the
104
+ // empty tool list has to reach a JSON caller, which would otherwise read
105
+ // a bare success and assume the update ran.
106
+ if (this.json) {
107
+ emitSuccess({
108
+ update: {
109
+ version: TOSPEC_VERSION,
110
+ tools: [],
111
+ failed: [],
112
+ workflows: desiredWorkflows,
113
+ removedSkillDirs: 0,
114
+ rules: [],
115
+ message: 'No configured tools found.',
116
+ },
117
+ ...(this.jsonWarnings.length ? { status: this.jsonWarnings } : {}),
118
+ }, { path: resolvedProjectPath, source: 'explicit' });
119
+ }
51
120
  return;
52
121
  }
53
122
  // 6. Check version status for all configured tools
@@ -73,18 +142,18 @@ export class UpdateCommand {
73
142
  // The generated version is current, but update is also the repair path
74
143
  // for canonical .agents content and broken/stale links. Continue through
75
144
  // generation instead of returning early.
76
- console.log(`All ${configuredTools.length} configured tool(s) are version-current; refreshing generated skills.`);
145
+ this.say(`All ${configuredTools.length} configured tool(s) are version-current; refreshing generated skills.`);
77
146
  this.detectNewTools(resolvedProjectPath, configuredTools);
78
147
  this.displayOldCoreCustomProfileNote(profile, globalConfig.workflows);
79
148
  }
80
149
  // 8. Display update plan
81
150
  if (this.force) {
82
- console.log(`Force updating ${configuredTools.length} tool(s): ${configuredTools.join(', ')}`);
151
+ this.say(`Force updating ${configuredTools.length} tool(s): ${configuredTools.join(', ')}`);
83
152
  }
84
153
  else if (toolsToUpdateSet.size > 0) {
85
154
  this.displayUpdatePlan([...toolsToUpdateSet], statusByTool, toolsUpToDate);
86
155
  }
87
- console.log();
156
+ this.say();
88
157
  // 9. Determine what to generate
89
158
  const skillTemplates = getSkillTemplates(desiredWorkflows);
90
159
  // 9b. Refresh canonical .agents/ content — the single source of truth
@@ -125,7 +194,7 @@ export class UpdateCommand {
125
194
  const tool = AI_TOOLS.find((t) => t.value === toolId);
126
195
  if (!tool?.skillsDir)
127
196
  continue;
128
- console.log(`Updating ${tool.name}...`);
197
+ this.say(`Updating ${tool.name}...`);
129
198
  try {
130
199
  const skillsDir = path.join(resolvedProjectPath, tool.skillsDir, 'skills');
131
200
  await removeLegacyToolSkillLayout(path.join(resolvedProjectPath, tool.skillsDir));
@@ -147,28 +216,28 @@ export class UpdateCommand {
147
216
  // Refresh slash commands for tools with an adapter (Claude Code):
148
217
  // `.claude/commands/tosx/<id>.md`, invocable as `/tosx:<id>`.
149
218
  await writeToolCommands(resolvedProjectPath, tool.value, desiredWorkflows);
150
- console.log(`Updated ${tool.name}`);
219
+ this.say(`Updated ${tool.name}`);
151
220
  updatedTools.push(tool.name);
152
221
  }
153
222
  catch (error) {
154
- console.log(`Failed to update ${tool.name}`);
223
+ this.say(`Failed to update ${tool.name}`);
155
224
  failedTools.push({
156
225
  name: tool.name,
157
226
  error: error instanceof Error ? error.message : String(error)
158
227
  });
159
228
  }
160
229
  }
161
- await writeWorkflowRules(rulePlan);
230
+ await writeWorkflowRules(rulePlan, { silent: this.json });
162
231
  // 11. Summary
163
- console.log();
232
+ this.say();
164
233
  if (updatedTools.length > 0) {
165
- console.log(`Updated: ${updatedTools.join(', ')} (v${TOSPEC_VERSION})`);
234
+ this.say(`Updated: ${updatedTools.join(', ')} (v${TOSPEC_VERSION})`);
166
235
  }
167
236
  if (failedTools.length > 0) {
168
- console.log(`Failed: ${failedTools.map(f => `${f.name} (${f.error})`).join(', ')}`);
237
+ this.say(`Failed: ${failedTools.map(f => `${f.name} (${f.error})`).join(', ')}`);
169
238
  }
170
239
  if (removedDeselectedSkillCount > 0) {
171
- console.log(`Removed: ${removedDeselectedSkillCount} skill directories (deselected workflows)`);
240
+ this.say(`Removed: ${removedDeselectedSkillCount} skill directories (deselected workflows)`);
172
241
  }
173
242
  // 13. Detect new tool directories not currently configured
174
243
  this.detectNewTools(resolvedProjectPath, configuredTools);
@@ -177,11 +246,30 @@ export class UpdateCommand {
177
246
  // 15. List affected tools
178
247
  if (updatedTools.length > 0) {
179
248
  const toolDisplayNames = updatedTools;
180
- console.log(`Tools: ${toolDisplayNames.join(', ')}`);
249
+ this.say(`Tools: ${toolDisplayNames.join(', ')}`);
181
250
  }
182
- console.log();
183
- console.log('Restart your agent for skills to take effect.');
251
+ this.say();
252
+ this.say('Restart your agent for skills to take effect.');
184
253
  this.reportResidualCodexOutput(resolvedProjectPath);
254
+ if (this.json) {
255
+ emitSuccess({
256
+ update: {
257
+ version: TOSPEC_VERSION,
258
+ tools: updatedTools,
259
+ failed: failedTools,
260
+ workflows: desiredWorkflows,
261
+ removedSkillDirs: removedDeselectedSkillCount,
262
+ rules: rulePlan.map((entry) => ({
263
+ tool: entry.toolId,
264
+ rule: entry.rule,
265
+ path: entry.destination,
266
+ action: entry.action,
267
+ ...(entry.retire ? { retiredPath: entry.retire } : {}),
268
+ })),
269
+ },
270
+ ...(this.jsonWarnings.length ? { status: this.jsonWarnings } : {}),
271
+ }, { path: resolvedProjectPath, source: 'explicit' });
272
+ }
185
273
  }
186
274
  /**
187
275
  * Read-only, and called only once a run has otherwise finished: a run that
@@ -189,7 +277,7 @@ export class UpdateCommand {
189
277
  */
190
278
  reportResidualCodexOutput(projectPath) {
191
279
  if (hasResidualCodexOutput(projectPath)) {
192
- console.log(RESIDUAL_CODEX_NOTICE);
280
+ this.say(RESIDUAL_CODEX_NOTICE);
193
281
  }
194
282
  }
195
283
  /**
@@ -202,10 +290,10 @@ export class UpdateCommand {
202
290
  const fromVersion = statusByTool.get(toolId)?.generatedByVersion ?? 'unknown';
203
291
  return `${toolId} (${fromVersion} → ${TOSPEC_VERSION})`;
204
292
  });
205
- console.log(`Updating ${toolsToUpdate.length} tool(s): ${updates.join(', ')}`);
293
+ this.say(`Updating ${toolsToUpdate.length} tool(s): ${updates.join(', ')}`);
206
294
  if (upToDate.length > 0) {
207
295
  const upToDateNames = upToDate.map((s) => s.toolId);
208
- console.log(`Already up to date: ${upToDateNames.join(', ')}`);
296
+ this.say(`Already up to date: ${upToDateNames.join(', ')}`);
209
297
  }
210
298
  }
211
299
  /**
@@ -220,8 +308,8 @@ export class UpdateCommand {
220
308
  const isSingleTool = newToolNames.length === 1;
221
309
  const toolNoun = isSingleTool ? 'tool' : 'tools';
222
310
  const pronoun = isSingleTool ? 'it' : 'them';
223
- console.log();
224
- console.log(`Detected new ${toolNoun}: ${newToolNames.join(', ')}. Run 'tospec init' to add ${pronoun}.`);
311
+ this.say();
312
+ this.say(`Detected new ${toolNoun}: ${newToolNames.join(', ')}. Run 'tospec init' to add ${pronoun}.`);
225
313
  }
226
314
  }
227
315
  /**
@@ -238,8 +326,8 @@ export class UpdateCommand {
238
326
  if (!matchesOldCore) {
239
327
  return;
240
328
  }
241
- console.log('Note: The core profile now includes issue and update. Your custom profile is preserving the old core workflow set.');
242
- console.log('Run `tospec config profile core` and then `tospec update` to add them.');
329
+ this.say('Note: The core profile now includes issue and update. Your custom profile is preserving the old core workflow set.');
330
+ this.say('Run `tospec config profile core` and then `tospec update` to add them.');
243
331
  }
244
332
  /**
245
333
  * Removes skill directories for workflows that are no longer selected in the
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,2BAA2B,EAC3B,iBAAiB,GAElB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAgB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,O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pE,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,oHAAoH,CAAC,CAAC;QAC/H,IAAI,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,yBAAyB,CACrC,SAAiB,EACjB,gBAA2D;QAE3D,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC7C,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;YACrC,IAAI,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAAE,SAAS;YACvC,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;YAChD,IAAI,CAAC,OAAO;gBAAE,SAAS;YAEvB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC/C,IAAI,CAAC;gBACH,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC5B,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;oBACjE,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,gBAAgB;YAClB,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CAEF"}
@@ -29,7 +29,7 @@ export declare const VALIDATION_MESSAGES: {
29
29
  readonly REQUIREMENT_TOO_LONG: "Requirement text is very long (>500 characters). Consider breaking it down.";
30
30
  readonly DELTA_DESCRIPTION_TOO_BRIEF: 'Delta description is too brief';
31
31
  readonly DELTA_MISSING_REQUIREMENTS: 'Delta should include requirements';
32
- readonly GUIDE_NO_DELTAS: 'No deltas found. Ensure your change has a specs/ directory with capability folders (e.g. specs/http-server/spec.md) containing .md files that use delta headers (## ADDED/MODIFIED/REMOVED/RENAMED Requirements) and that each requirement includes at least one "#### Scenario:" block. Tip: run "tospec show <change-id> --json --deltas-only" to inspect parsed deltas.';
32
+ readonly GUIDE_NO_DELTAS: 'No deltas found. Ensure your change has a specs/ directory with capability folders (e.g. specs/http-server/spec.md) containing .md files that use delta headers (## ADDED/MODIFIED/REMOVED/RENAMED Requirements) and that each requirement includes at least one "#### Scenario:" block. Tip: run "tospec show <change-id> --json --deltas-only" to inspect parsed deltas. If this change genuinely has no externally observable effect (tooling, CI, docs-only), set `skip_specs: true` in its .tospec.yaml instead — never invent a Requirement to satisfy this check.';
33
33
  readonly GUIDE_MISSING_SPEC_SECTIONS: 'Missing required sections. Expected headers: "## Purpose" and "## Requirements". Example:\n## Purpose\n[brief purpose]\n\n## Requirements\n### Requirement: Clear requirement statement\nUsers SHALL ...\n\n#### Scenario: Descriptive name\n- **WHEN** ...\n- **THEN** ...';
34
34
  readonly GUIDE_MISSING_CHANGE_SECTIONS: 'Missing required sections. Expected headers: "## Why" and "## What Changes". Ensure deltas are documented in specs/ using delta headers.';
35
35
  readonly GUIDE_SCENARIO_FORMAT: 'Scenarios must use level-4 headers. Convert bullet lists into:\n#### Scenario: Short name\n- **WHEN** ...\n- **THEN** ...\n- **AND** ...';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/validation/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAGrC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAQxC,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAC/E,eAAO,MAAM,0BAA0B,oCAAoC,CAAC;AAG5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AoB,EAAE,yCAAyC;aAC/D,iBAAiB,EAAE,6BAA6B;aAChD,oBAAoB;aACpB,mBAAmB;aACnB,iBAAiB,EAAE,sCAAsC;aACzD,gBAAgB,EAAE,qCAAqC;aACvD,sBAAsB;aACtB,gBAAgB,EAAE,2BAA2B;aAC7C,uBAAuB,EAAE,mCAAmC;aAG5D,iBAAiB;aACjB,sBAAsB;aAKtB,oBAAoB;aACpB,2BAA2B,EAAE,gCAAgC;aAC7D,0BAA0B,EAAE,mCAAmC;aAQ/D,eAAe,EACb,0iBAA0iB;aAC5iB,2BAA2B,EACzB,6QAA6Q;aAC/Q,6BAA6B,EAC3B,0IAA0I;aAC5I,qBAAqB,EACnB,0IAA0I;CACpI,CAAC"}
@@ -44,7 +44,12 @@ export const VALIDATION_MESSAGES = {
44
44
  DELTA_DESCRIPTION_TOO_BRIEF: 'Delta description is too brief',
45
45
  DELTA_MISSING_REQUIREMENTS: 'Delta should include requirements',
46
46
  // Guidance snippets (appended to primary messages for remediation)
47
- GUIDE_NO_DELTAS: 'No deltas found. Ensure your change has a specs/ directory with capability folders (e.g. specs/http-server/spec.md) containing .md files that use delta headers (## ADDED/MODIFIED/REMOVED/RENAMED Requirements) and that each requirement includes at least one "#### Scenario:" block. Tip: run "tospec show <change-id> --json --deltas-only" to inspect parsed deltas.',
47
+ // The skip_specs sentence is not an aside. Without it this message offers one
48
+ // way out — write a delta — to a change that may genuinely have no observable
49
+ // behaviour, which is exactly the pressure the schema warns against when it
50
+ // says "never invent a Requirement to get past validation". Naming the second,
51
+ // legitimate exit is what stops the first from being taken dishonestly.
52
+ GUIDE_NO_DELTAS: 'No deltas found. Ensure your change has a specs/ directory with capability folders (e.g. specs/http-server/spec.md) containing .md files that use delta headers (## ADDED/MODIFIED/REMOVED/RENAMED Requirements) and that each requirement includes at least one "#### Scenario:" block. Tip: run "tospec show <change-id> --json --deltas-only" to inspect parsed deltas. If this change genuinely has no externally observable effect (tooling, CI, docs-only), set `skip_specs: true` in its .tospec.yaml instead — never invent a Requirement to satisfy this check.',
48
53
  GUIDE_MISSING_SPEC_SECTIONS: 'Missing required sections. Expected headers: "## Purpose" and "## Requirements". Example:\n## Purpose\n[brief purpose]\n\n## Requirements\n### Requirement: Clear requirement statement\nUsers SHALL ...\n\n#### Scenario: Descriptive name\n- **WHEN** ...\n- **THEN** ...',
49
54
  GUIDE_MISSING_CHANGE_SECTIONS: 'Missing required sections. Expected headers: "## Why" and "## What Changes". Ensure deltas are documented in specs/ using delta headers.',
50
55
  GUIDE_SCENARIO_FORMAT: 'Scenarios must use level-4 headers. Convert bullet lists into:\n#### Scenario: Short name\n- **WHEN** ...\n- **THEN** ...\n- **AND** ...',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/validation/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,gCAAgC;AAChC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,iFAAiF;AACjF,0EAA0E;AAC1E,gFAAgF;AAChF,kFAAkF;AAClF,gFAAgF;AAChF,yDAAyD;AACzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,oCAAoC,CAAC;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE5E,sBAAsB;AACtB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,mBAAmB;IACnB,cAAc,EAAE,+BAA+B;IAC/C,iBAAiB,EAAE,kCAAkC;IACrD,oBAAoB,EAAE,gDAAgD;IACtE,wBAAwB,EAAE,6CAA6C;IACvE,eAAe,EAAE,2BAA2B;IAC5C,kBAAkB,EAAE,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AM,0BAA0B,GAAG,iCAAiC,CAAC;AAE5E,sBAAsB;AACtB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,mBAAmB;IACnB,cAAc,EAAE,+BAA+B;IAC/C,iBAAiB,EAAE,kCAAkC;IACrD,oBAAoB,EAAE,gDAAgD;IACtE,wBAAwB,EAAE,6CAA6C;IACvE,eAAe,EAAE,2BAA2B;IAC5C,kBAAkB,EAAE,iCAAiC;IACrD,oBAAoB,EAAE,yCAAyC;IAC/D,iBAAiB,EAAE,6BAA6B;IAChD,oBAAoB,EAAE,gCAAgC,sBAAsB,aAAa;IACzF,mBAAmB,EAAE,iCAAiC,sBAAsB,aAAa;IACzF,iBAAiB,EAAE,sCAAsC;IACzD,gBAAgB,EAAE,qCAAqC;IACvD,sBAAsB,EAAE,6CAA6C,qBAAqB,SAAS;IACnG,gBAAgB,EAAE,2BAA2B;IAC7C,uBAAuB,EAAE,mCAAmC;IAE5D,WAAW;IACX,iBAAiB,EAAE,2CAA2C,kBAAkB,cAAc;IAC9F,sBAAsB,EACpB,2GAA2G;QAC3G,sGAAsG;QACtG,qGAAqG;QACrG,uDAAuD;IACzD,oBAAoB,EAAE,mCAAmC,2BAA2B,0CAA0C;IAC9H,2BAA2B,EAAE,gCAAgC;IAC7D,0BAA0B,EAAE,mCAAmC;IAE/D,mEAAmE;IACnE,8EAA8E;IAC9E,8EAA8E;IAC9E,4EAA4E;IAC5E,+EAA+E;IAC/E,wEAAwE;IACxE,eAAe,EACb,0iBAA0iB;IAC5iB,2BAA2B,EACzB,6QAA6Q;IAC/Q,6BAA6B,EAC3B,0IAA0I;IAC5I,qBAAqB,EACnB,0IAA0I;CACpI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"section-validator.d.ts","sourceRoot":"","sources":["../../../src/core/validation/section-validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,wBAAwB,GAChC,eAAe,EAAE,CAwCnB"}
1
+ {"version":3,"file":"section-validator.d.ts","sourceRoot":"","sources":["../../../src/core/validation/section-validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAeD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,sBAAsB,EAC7B,OAAO,EAAE,wBAAwB,GAChC,eAAe,EAAE,CA8CnB"}
@@ -1,4 +1,16 @@
1
1
  import { MarkdownParser, findSection } from '../parsers/markdown-parser.js';
2
+ /**
3
+ * The prose a section actually carries, with HTML comments removed.
4
+ *
5
+ * Templates put their guidance in `<!-- ... -->`, which counts as text to a
6
+ * naive length check. The proposal template's Why hint is 71 characters and the
7
+ * rule it is hinting at is a 50-character minimum, so an untouched template
8
+ * satisfied its own threshold while a real ten-word answer was warned about
9
+ * (round 4 report 4). What is measured has to be what the author wrote.
10
+ */
11
+ function authoredContent(sectionContent) {
12
+ return sectionContent.replace(/<!--[\s\S]*?-->/g, '').trim();
13
+ }
2
14
  /**
3
15
  * Validates a document's headings against schema-declared rules, for
4
16
  * artifacts (ticket.md, design.md, task.md, ...) that have no Requirement
@@ -19,11 +31,17 @@ export function validateSections(content, rules, context) {
19
31
  });
20
32
  continue;
21
33
  }
22
- if (!section.content.trim()) {
34
+ if (!authoredContent(section.content)) {
35
+ // Distinguish the two, because the fix differs: a blank section needs
36
+ // writing, a comment-only one needs the placeholder replaced — and a
37
+ // reader who can see text under the heading would not believe "is empty".
38
+ const onlyComments = section.content.trim().length > 0;
23
39
  issues.push({
24
40
  level: 'WARNING',
25
41
  path: context.path,
26
- message: `Section "${requiredTitle}" is empty`,
42
+ message: onlyComments
43
+ ? `Section "${requiredTitle}" still holds only the template's guidance comment`
44
+ : `Section "${requiredTitle}" is empty`,
27
45
  });
28
46
  }
29
47
  }
@@ -32,7 +50,7 @@ export function validateSections(content, rules, context) {
32
50
  if (!section) {
33
51
  continue; // absence is already reported above when also required
34
52
  }
35
- const length = section.content.trim().length;
53
+ const length = authoredContent(section.content).length;
36
54
  if (length > 0 && length < minLength) {
37
55
  issues.push({
38
56
  level: 'WARNING',
@@ -1 +1 @@
1
- {"version":3,"file":"section-validator.js","sourceRoot":"","sources":["../../../src/core/validation/section-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAe5E;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,KAA6B,EAC7B,OAAiC;IAEjC,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAE3D,KAAK,MAAM,aAAa,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACnD,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACrD,IAAI,CAA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,EAAE,YAAY;oBACnB,CAAC,CAAC,YAAY,aAAa,oDAAoD;oBAC/E,CAAC,CAAC,YAAY,aAAa,YAAY;aAC1C,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC/E,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,SAAS,CAAC,uDAAuD;QACnE,CAAC;QACD,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;QACvD,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;YACrC,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE,YAAY,YAAY,qCAAqC,SAAS,sBAAsB,MAAM,GAAG;aAC/G,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -81,9 +81,15 @@ export declare class Validator {
81
81
  * would be free to drift — which shows up as validate and archive disagreeing,
82
82
  * the one thing this check exists to prevent.
83
83
  *
84
- * INFO leaves the verdict alone. A MODIFIED whose target is missing is also
85
- * what a change modifying a sibling's unarchived requirement looks like, and
86
- * that is valid today; what is missing is the information, not the verdict.
84
+ * WARNING, not ERROR and no longer INFO. ERROR is wrong because a MODIFIED
85
+ * whose target is missing is also what a change modifying a sibling's
86
+ * unarchived requirement looks like, and that is valid today — the ordinary
87
+ * run must still pass. INFO was wrong for the opposite reason: `--strict`
88
+ * counts warnings as fatal and ignores INFO, so the one gate built to be a
89
+ * pre-archive check waved through changes this very dry run had just proved
90
+ * archive would refuse. WARNING keeps the default verdict and gives `--strict`
91
+ * something to refuse. See
92
+ * tospec/decisions/20260916_154000-archive-dry-run-findings-are-warnings.md
87
93
  */
88
94
  private findArchiveBlockers;
89
95
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/core/validation/validator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,YAAY,CAAC;AAqBhF,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAU;IAE5B,YAAY,UAAU,GAAE,OAAe,EAEtC;IAEK,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAe9D;IAED;;OAEG;IACG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgBtF;IAEK,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6BhE;IAED;;;;;;;;;;;;;;;OAeG;IACH;;;;;;;;;OASG;IACG,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAO,GAC3C,OAAO,CAAC,gBAAgB,CAAC,CAkV3B;IAED,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,cAAc;IA6FtB,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,mBAAmB;IAI3B;;;;;;;;;OASG;IACH,OAAO,CAAC,8BAA8B;IAQtC;;;;;;;;;;;;;;;OAeG;YACW,4BAA4B;IAqD1C;;;;;;;;;;;;OAYG;YACW,mBAAmB;IA4DjC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IA2C7B;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;CAalC"}
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../src/core/validation/validator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,YAAY,CAAC;AAqBhF,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAU;IAE5B,YAAY,UAAU,GAAE,OAAe,EAEtC;IAEK,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAe9D;IAED;;OAEG;IACG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgBtF;IAEK,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6BhE;IAED;;;;;;;;;;;;;;;OAeG;IACH;;;;;;;;;OASG;IACG,wBAAwB,CAC5B,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,GAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAO,GAC3C,OAAO,CAAC,gBAAgB,CAAC,CAuV3B;IAED,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,cAAc;IA6FtB,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,mBAAmB;IAI3B;;;;;;;;;OASG;IACH,OAAO,CAAC,8BAA8B;IAQtC;;;;;;;;;;;;;;;OAeG;YACW,4BAA4B;IAwE1C;;;;;;;;;;;;;;;;;;OAkBG;YACW,mBAAmB;IA4DjC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAgE7B;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;CAalC"}
@@ -291,9 +291,13 @@ export class Validator {
291
291
  }
292
292
  }
293
293
  if (mainSpecsDir !== undefined && plan.modified.length > 0) {
294
+ const renamedToFrom = new Map();
295
+ for (const { from, to } of plan.renamed) {
296
+ renamedToFrom.set(normalizeRequirementName(to), from);
297
+ }
294
298
  // entryPath is always "<capability>/spec.md" here — misplaced and
295
299
  // dot-prefixed files were reported and dropped above.
296
- issues.push(...(await this.collectDroppedScenarioIssues(mainSpecsDir, entryPath.split('/')[0], plan.modified, entryPath)));
300
+ issues.push(...(await this.collectDroppedScenarioIssues(mainSpecsDir, entryPath.split('/')[0], plan.modified, entryPath, renamedToFrom)));
297
301
  }
298
302
  // Validate REMOVED — the template requires Reason and Migration
299
303
  // fields on every entry (report 2.4).
@@ -612,7 +616,17 @@ export class Validator {
612
616
  * - the requirement header is absent from it (a MODIFIED written against a
613
617
  * sister change still in flight)
614
618
  */
615
- async collectDroppedScenarioIssues(mainSpecsDir, capability, modified, entryPath) {
619
+ async collectDroppedScenarioIssues(mainSpecsDir, capability, modified, entryPath,
620
+ /**
621
+ * New name → old name, for requirements this change also renames. Round 4
622
+ * report 8: a MODIFIED under the post-rename header found nothing in the
623
+ * main spec and was skipped, so dropping a scenario was an ERROR here
624
+ * normally but slipped through to a merge-dry-run WARNING whenever the same
625
+ * change happened to rename the requirement — and archive then refused what
626
+ * validate had called valid. Resolving through the rename makes one
627
+ * condition report one severity.
628
+ */
629
+ renamedToFrom) {
616
630
  let content;
617
631
  try {
618
632
  content = await fs.readFile(path.join(mainSpecsDir, capability, 'spec.md'), 'utf-8');
@@ -643,16 +657,24 @@ export class Validator {
643
657
  }
644
658
  const issues = [];
645
659
  for (const block of modified) {
646
- const current = currentByName.get(normalizeRequirementName(block.name));
660
+ const key = normalizeRequirementName(block.name);
661
+ // Direct hit first; only fall back to the pre-rename name when this change
662
+ // renames the requirement, so an unrelated MODIFIED is unaffected.
663
+ const renamedFrom = renamedToFrom.get(key);
664
+ const current = currentByName.get(key) ??
665
+ (renamedFrom === undefined ? undefined : currentByName.get(normalizeRequirementName(renamedFrom)));
647
666
  if (!current)
648
667
  continue;
649
668
  const missing = findMissingScenarios(current.raw, block.raw);
650
669
  if (missing.length === 0)
651
670
  continue;
671
+ // Named by its spec header, not its new one: that is the block the reader
672
+ // has to open to see the scenarios at risk.
673
+ const target = renamedFrom !== undefined && !currentByName.has(key) ? ` (renamed from "${renamedFrom}")` : '';
652
674
  issues.push({
653
675
  level: 'ERROR',
654
676
  path: entryPath,
655
- message: `MODIFIED "${block.name}" omits scenario(s) the current spec still has: ${missing
677
+ message: `MODIFIED "${block.name}"${target} omits scenario(s) the current spec still has: ${missing
656
678
  .map((name) => `"${name}"`)
657
679
  .join(', ')}. A MODIFIED block replaces the whole requirement, so archiving would delete them — restate them in the block.`,
658
680
  });
@@ -668,9 +690,15 @@ export class Validator {
668
690
  * would be free to drift — which shows up as validate and archive disagreeing,
669
691
  * the one thing this check exists to prevent.
670
692
  *
671
- * INFO leaves the verdict alone. A MODIFIED whose target is missing is also
672
- * what a change modifying a sibling's unarchived requirement looks like, and
673
- * that is valid today; what is missing is the information, not the verdict.
693
+ * WARNING, not ERROR and no longer INFO. ERROR is wrong because a MODIFIED
694
+ * whose target is missing is also what a change modifying a sibling's
695
+ * unarchived requirement looks like, and that is valid today — the ordinary
696
+ * run must still pass. INFO was wrong for the opposite reason: `--strict`
697
+ * counts warnings as fatal and ignores INFO, so the one gate built to be a
698
+ * pre-archive check waved through changes this very dry run had just proved
699
+ * archive would refuse. WARNING keeps the default verdict and gives `--strict`
700
+ * something to refuse. See
701
+ * tospec/decisions/20260916_154000-archive-dry-run-findings-are-warnings.md
674
702
  */
675
703
  async findArchiveBlockers(changeDir, mainSpecsDir, alreadyReportedPaths) {
676
704
  const alreadyReported = new Set(alreadyReportedPaths);
@@ -715,7 +743,7 @@ export class Validator {
715
743
  if (error?.code !== undefined)
716
744
  continue;
717
745
  issues.push({
718
- level: 'INFO',
746
+ level: 'WARNING',
719
747
  path: entryPath,
720
748
  message: `Archive would refuse this delta: ${error instanceof Error ? error.message : String(error)}`,
721
749
  });
@@ -742,6 +770,28 @@ export class Validator {
742
770
  message: `${section} "${block.name}" must include at least one "#### Scenario:" block`,
743
771
  });
744
772
  }
773
+ // Round 4 report 3. Scenario names are the only handle the MODIFIED
774
+ // scenario-loss guard has: it counts how many times each name appears on
775
+ // each side. Two scenarios sharing a name are therefore interchangeable to
776
+ // it — restating one of them twice keeps the count and silently deletes the
777
+ // other's body on archive. Refusing the duplicate here is what keeps that
778
+ // guard meaningful, and this is the only door a duplicate enters through:
779
+ // main specs are only ever written by merging these blocks.
780
+ const scenarioNames = new Set();
781
+ for (const scenario of analysis.scenarios) {
782
+ const key = scenario.title.trim().toLowerCase();
783
+ if (scenarioNames.has(key)) {
784
+ issues.push({
785
+ level: 'ERROR',
786
+ path: entryPath,
787
+ line: toLine(scenario.relLine),
788
+ message: `${section} "${block.name}" repeats scenario name "${scenario.title}" (line ${toLine(scenario.relLine)}). Scenario names identify a scenario when a later MODIFIED restates this requirement, so two with the same name cannot be told apart — give each one a distinct name.`,
789
+ });
790
+ }
791
+ else {
792
+ scenarioNames.add(key);
793
+ }
794
+ }
745
795
  for (const scenario of analysis.scenarios) {
746
796
  const missing = [
747
797
  ...(scenario.hasWhen ? [] : ['WHEN']),