@paths.design/caws-cli 9.1.0 → 9.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../src/commands/tutorial.js"],"names":[],"mappings":"AA4aA;;;;GAIG;AACH,8CAHW,MAAM,+BA4ChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/FD;;;;GAIG;AACH,qDAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CA4CzB"}
1
+ {"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../src/commands/tutorial.js"],"names":[],"mappings":"AA0aA;;;;GAIG;AACH,8CAHW,MAAM,+BA4ChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/FD;;;;GAIG;AACH,qDAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CA4CzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,0CANW,MAAM,YAEd;IAAyB,MAAM,GAAvB,MAAM;IACY,WAAW,GAA7B,OAAO;IACW,MAAM,GAAxB,OAAO;CACjB,iBA6NA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.js"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,0CANW,MAAM,YAEd;IAAyB,MAAM,GAAvB,MAAM;IACY,WAAW,GAA7B,OAAO;IACW,MAAM,GAAxB,OAAO;CACjB,iBAsQA"}
@@ -49,12 +49,19 @@ async function validateCommand(specFile, options = {}) {
49
49
  console.log(chalk.gray(` Spec: ${path.relative(process.cwd(), specPath)}`));
50
50
  }
51
51
 
52
+ // For feature specs (.caws/specs/<id>.yaml), path.dirname(specPath) resolves
53
+ // to .caws/specs/ — not the project root. Use process.cwd() which is always
54
+ // the project root when the CLI is invoked.
55
+ const projectRoot = specType === 'feature'
56
+ ? process.cwd()
57
+ : path.dirname(specPath);
58
+
52
59
  const result = validateWorkingSpecWithSuggestions(spec, {
53
60
  autoFix: options.autoFix,
54
61
  dryRun: options.dryRun,
55
62
  suggestions: !options.quiet,
56
63
  checkBudget: true,
57
- projectRoot: path.dirname(specPath),
64
+ projectRoot,
58
65
  specType,
59
66
  });
60
67
 
@@ -225,6 +232,40 @@ async function validateCommand(specFile, options = {}) {
225
232
  }
226
233
  }
227
234
  } catch (error) {
235
+ // Multi-spec project without --spec-id: auto-validate all open specs
236
+ if (error.message === 'Spec ID required when multiple specs exist' && !options.specId) {
237
+ const { checkMultiSpecStatus } = require('../utils/spec-resolver');
238
+ const status = await checkMultiSpecStatus();
239
+ const specIds = Object.keys(status.registry?.specs || {});
240
+
241
+ if (specIds.length === 0) {
242
+ console.error(chalk.red('No specs found in registry'));
243
+ if (process.env.NODE_ENV !== 'test' && !process.env.JEST_WORKER_ID) {
244
+ process.exit(1);
245
+ }
246
+ return;
247
+ }
248
+
249
+ console.log(chalk.cyan(`Validating all ${specIds.length} specs...\n`));
250
+ let allPassed = true;
251
+
252
+ for (const sid of specIds) {
253
+ try {
254
+ await validateCommand(specFile, { ...options, specId: sid });
255
+ } catch {
256
+ allPassed = false;
257
+ }
258
+ console.log(''); // blank line between specs
259
+ }
260
+
261
+ if (!allPassed) {
262
+ if (process.env.NODE_ENV !== 'test' && !process.env.JEST_WORKER_ID) {
263
+ process.exit(1);
264
+ }
265
+ }
266
+ return;
267
+ }
268
+
228
269
  if (options.format === 'json') {
229
270
  console.log(
230
271
  JSON.stringify(
package/dist/index.js CHANGED
@@ -127,6 +127,7 @@ program
127
127
  // Validate command
128
128
  program
129
129
  .command('validate')
130
+ .alias('verify')
130
131
  .description('Validate CAWS spec with suggestions')
131
132
  .argument('[spec-file]', 'Path to spec file (optional, uses spec resolution)')
132
133
  .option('--spec-id <id>', 'Feature-specific spec ID (e.g., user-auth, FEAT-001)')
@@ -1 +1 @@
1
- {"version":3,"file":"parallel-manager.d.ts","sourceRoot":"","sources":["../../src/parallel/parallel-manager.js"],"names":[],"mappings":"AA6EA;;;;GAIG;AACH,mCAHW,MAAM,OAoDhB;AAED;;;;GAIG;AACH,0CAFa,KAAQ,CAyCpB;AAED;;;GAGG;AACH,qCAFa,MAAO,IAAI,CA2DvB;AA2CD;;;;;;;GAOG;AACH,wCALG;IAAyB,QAAQ,GAAzB,MAAM;IACY,MAAM,GAAxB,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,OA2GF;AAED;;;;;;GAMG;AACH,2CAJG;IAA0B,cAAc,GAAhC,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,OA0BF;AA3LD;;;;;GAKG;AACH,gDAJW,MAAM,iBACN,KAAQ,GACN,KAAQ,CAmCpB;AAnPD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAO,IAAI,CAYvB;AAED;;;;GAIG;AACH,2CAHW,MAAM,mBAOhB;AAED;;;GAGG;AACH,6CAFW,MAAM,QAOhB;AAnDD,gCAA0B,qBAAqB,CAAC"}
1
+ {"version":3,"file":"parallel-manager.d.ts","sourceRoot":"","sources":["../../src/parallel/parallel-manager.js"],"names":[],"mappings":"AA0EA;;;;GAIG;AACH,mCAHW,MAAM,OAoDhB;AAED;;;;GAIG;AACH,0CAFa,KAAQ,CAyCpB;AAED;;;GAGG;AACH,qCAFa,MAAO,IAAI,CA2DvB;AA2CD;;;;;;;GAOG;AACH,wCALG;IAAyB,QAAQ,GAAzB,MAAM;IACY,MAAM,GAAxB,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,OA2GF;AAED;;;;;;GAMG;AACH,2CAJG;IAA0B,cAAc,GAAhC,OAAO;IACW,KAAK,GAAvB,OAAO;CACf,OA0BF;AA3LD;;;;;GAKG;AACH,gDAJW,MAAM,iBACN,KAAQ,GACN,KAAQ,CAmCpB;AAnPD;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAO,IAAI,CAYvB;AAED;;;;GAIG;AACH,2CAHW,MAAM,mBAOhB;AAED;;;GAGG;AACH,6CAFW,MAAM,QAOhB;AAnDD,gCAA0B,qBAAqB,CAAC"}
@@ -38,15 +38,19 @@ caws agent evaluate
38
38
 
39
39
  ### Working Spec
40
40
 
41
- The project spec lives at `.caws/working-spec.yaml`. It defines:
41
+ The project spec lives at `.caws/working-spec.yaml`. Feature specs live at `.caws/specs/<ID>.yaml`. It defines:
42
42
 
43
43
  - **Risk tier**: Quality requirements (T1: critical, T2: standard, T3: low risk)
44
44
  - **Scope**: Which files you can edit (`scope.in`) and which are off-limits (`scope.out`)
45
- - **Change budget**: Max files and lines of code per change
46
- - **Acceptance criteria**: What "done" means
45
+ - **Change budget**: Max files and lines of code per change (see note below)
46
+ - **Acceptance criteria**: What "done" means — IDs must match `^A\d+$` (e.g. `A1`, `A12`)
47
47
 
48
48
  Always stay within scope boundaries and change budgets.
49
49
 
50
+ > **Budget note**: `change_budget:` in a spec is informational documentation only. CAWS
51
+ > derives the enforced budget from `policy.yaml` keyed on `risk_tier`. The field in the
52
+ > spec is not used by `caws validate` for enforcement.
53
+
50
54
  ### Quality Gates
51
55
 
52
56
  Quality requirements are tiered:
@@ -1 +1 @@
1
- {"version":3,"file":"spec-validation.d.ts","sourceRoot":"","sources":["../../src/validation/spec-validation.js"],"names":[],"mappings":"AA6DA;;;;;GAKG;AACH,mEA8IC;AAED;;;;;GAKG;AACH,kFAgdC;AAoCD;;;;;GAKG;AACH,0CAJW,MAAM,eAEJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,eAEJ,OAAO,CAKnB;AAnED;;;;;;GAMG;AACH,0EAFa,MAAM,CAclB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,CAQlB"}
1
+ {"version":3,"file":"spec-validation.d.ts","sourceRoot":"","sources":["../../src/validation/spec-validation.js"],"names":[],"mappings":"AA6DA;;;;;GAKG;AACH,mEA8IC;AAED;;;;;GAKG;AACH,kFAycC;AAoCD;;;;;GAKG;AACH,0CAJW,MAAM,eAEJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,uCAJW,MAAM,eAEJ,OAAO,CAKnB;AAnED;;;;;;GAMG;AACH,0EAFa,MAAM,CAclB;AAED;;;;GAIG;AACH,0CAHW,MAAM,GACJ,MAAM,CAQlB"}
@@ -563,16 +563,9 @@ function validateWorkingSpecWithSuggestions(spec, options = {}) {
563
563
  }
564
564
  }
565
565
 
566
- // Warn if change_budget is present (deprecated/informational only)
567
- if (spec.change_budget) {
568
- warnings.push({
569
- instancePath: '/change_budget',
570
- message:
571
- 'change_budget field in working spec is informational only and not used for validation',
572
- suggestion:
573
- 'Budget is derived from policy.yaml risk_tier + waivers. This field is auto-calculated.',
574
- });
575
- }
566
+ // Note: change_budget in specs is informational documentation only.
567
+ // Budget enforcement is derived from policy.yaml risk_tier + waivers.
568
+ // No warning emitted — the field is valid and expected.
576
569
 
577
570
  // Derive and check budget if requested
578
571
  let budgetCheck = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paths.design/caws-cli",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "description": "CAWS CLI - Coding Agent Workflow System command-line tools for spec management, quality gates, and AI-assisted development",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -38,15 +38,19 @@ caws agent evaluate
38
38
 
39
39
  ### Working Spec
40
40
 
41
- The project spec lives at `.caws/working-spec.yaml`. It defines:
41
+ The project spec lives at `.caws/working-spec.yaml`. Feature specs live at `.caws/specs/<ID>.yaml`. It defines:
42
42
 
43
43
  - **Risk tier**: Quality requirements (T1: critical, T2: standard, T3: low risk)
44
44
  - **Scope**: Which files you can edit (`scope.in`) and which are off-limits (`scope.out`)
45
- - **Change budget**: Max files and lines of code per change
46
- - **Acceptance criteria**: What "done" means
45
+ - **Change budget**: Max files and lines of code per change (see note below)
46
+ - **Acceptance criteria**: What "done" means — IDs must match `^A\d+$` (e.g. `A1`, `A12`)
47
47
 
48
48
  Always stay within scope boundaries and change budgets.
49
49
 
50
+ > **Budget note**: `change_budget:` in a spec is informational documentation only. CAWS
51
+ > derives the enforced budget from `policy.yaml` keyed on `risk_tier`. The field in the
52
+ > spec is not used by `caws validate` for enforcement.
53
+
50
54
  ### Quality Gates
51
55
 
52
56
  Quality requirements are tiered: