@paths.design/caws-cli 4.1.0 → 5.0.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.
- package/dist/commands/waivers.js +101 -26
- package/dist/waivers-manager.js +49 -4
- package/package.json +1 -1
- package/dist/budget-derivation.d.ts +0 -74
- package/dist/budget-derivation.d.ts.map +0 -1
- package/dist/cicd-optimizer.d.ts +0 -142
- package/dist/cicd-optimizer.d.ts.map +0 -1
- package/dist/commands/archive.d.ts +0 -50
- package/dist/commands/archive.d.ts.map +0 -1
- package/dist/commands/burnup.d.ts +0 -6
- package/dist/commands/burnup.d.ts.map +0 -1
- package/dist/commands/diagnose.d.ts +0 -52
- package/dist/commands/diagnose.d.ts.map +0 -1
- package/dist/commands/evaluate.d.ts +0 -8
- package/dist/commands/evaluate.d.ts.map +0 -1
- package/dist/commands/init.d.ts +0 -5
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/iterate.d.ts +0 -8
- package/dist/commands/iterate.d.ts.map +0 -1
- package/dist/commands/mode.d.ts +0 -24
- package/dist/commands/mode.d.ts.map +0 -1
- package/dist/commands/plan.d.ts +0 -49
- package/dist/commands/plan.d.ts.map +0 -1
- package/dist/commands/provenance.d.ts +0 -32
- package/dist/commands/provenance.d.ts.map +0 -1
- package/dist/commands/quality-gates.d.ts +0 -52
- package/dist/commands/quality-gates.d.ts.map +0 -1
- package/dist/commands/quality-monitor.d.ts +0 -17
- package/dist/commands/quality-monitor.d.ts.map +0 -1
- package/dist/commands/specs.d.ts +0 -71
- package/dist/commands/specs.d.ts.map +0 -1
- package/dist/commands/status.d.ts +0 -44
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/templates.d.ts +0 -74
- package/dist/commands/templates.d.ts.map +0 -1
- package/dist/commands/tool.d.ts +0 -13
- package/dist/commands/tool.d.ts.map +0 -1
- package/dist/commands/troubleshoot.d.ts +0 -8
- package/dist/commands/troubleshoot.d.ts.map +0 -1
- package/dist/commands/tutorial.d.ts +0 -55
- package/dist/commands/tutorial.d.ts.map +0 -1
- package/dist/commands/validate.d.ts +0 -15
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/waivers.d.ts +0 -8
- package/dist/commands/waivers.d.ts.map +0 -1
- package/dist/commands/workflow.d.ts +0 -85
- package/dist/commands/workflow.d.ts.map +0 -1
- package/dist/config/index.d.ts +0 -29
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/modes.d.ts +0 -225
- package/dist/config/modes.d.ts.map +0 -1
- package/dist/constants/spec-types.d.ts +0 -41
- package/dist/constants/spec-types.d.ts.map +0 -1
- package/dist/error-handler.d.ts +0 -164
- package/dist/error-handler.d.ts.map +0 -1
- package/dist/generators/jest-config.d.ts +0 -32
- package/dist/generators/jest-config.d.ts.map +0 -1
- package/dist/generators/working-spec.d.ts +0 -13
- package/dist/generators/working-spec.d.ts.map +0 -1
- package/dist/index-new.d.ts +0 -5
- package/dist/index-new.d.ts.map +0 -1
- package/dist/index-new.js +0 -317
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.backup +0 -4711
- package/dist/minimal-cli.d.ts +0 -3
- package/dist/minimal-cli.d.ts.map +0 -1
- package/dist/policy/PolicyManager.d.ts +0 -104
- package/dist/policy/PolicyManager.d.ts.map +0 -1
- package/dist/scaffold/cursor-hooks.d.ts +0 -7
- package/dist/scaffold/cursor-hooks.d.ts.map +0 -1
- package/dist/scaffold/git-hooks.d.ts +0 -20
- package/dist/scaffold/git-hooks.d.ts.map +0 -1
- package/dist/scaffold/index.d.ts +0 -20
- package/dist/scaffold/index.d.ts.map +0 -1
- package/dist/spec/SpecFileManager.d.ts +0 -146
- package/dist/spec/SpecFileManager.d.ts.map +0 -1
- package/dist/test-analysis.d.ts +0 -182
- package/dist/test-analysis.d.ts.map +0 -1
- package/dist/tool-interface.d.ts +0 -236
- package/dist/tool-interface.d.ts.map +0 -1
- package/dist/tool-loader.d.ts +0 -77
- package/dist/tool-loader.d.ts.map +0 -1
- package/dist/tool-validator.d.ts +0 -72
- package/dist/tool-validator.d.ts.map +0 -1
- package/dist/utils/detection.d.ts +0 -7
- package/dist/utils/detection.d.ts.map +0 -1
- package/dist/utils/finalization.d.ts +0 -17
- package/dist/utils/finalization.d.ts.map +0 -1
- package/dist/utils/project-analysis.d.ts +0 -14
- package/dist/utils/project-analysis.d.ts.map +0 -1
- package/dist/utils/quality-gates.d.ts +0 -49
- package/dist/utils/quality-gates.d.ts.map +0 -1
- package/dist/utils/spec-resolver.d.ts +0 -88
- package/dist/utils/spec-resolver.d.ts.map +0 -1
- package/dist/utils/typescript-detector.d.ts +0 -63
- package/dist/utils/typescript-detector.d.ts.map +0 -1
- package/dist/validation/spec-validation.d.ts +0 -43
- package/dist/validation/spec-validation.d.ts.map +0 -1
- package/dist/waivers-manager.d.ts +0 -167
- package/dist/waivers-manager.d.ts.map +0 -1
- package/templates/apps/tools/caws/prompt-lint.js.backup +0 -274
- package/templates/apps/tools/caws/provenance.js.backup +0 -73
package/dist/commands/waivers.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CAWS Waivers Command
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Manage quality gate waivers for exceptional circumstances.
|
|
5
5
|
* Waivers allow temporary exceptions to quality requirements
|
|
6
6
|
* with proper documentation and approval.
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
8
|
* @author @darianrosebrook
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -13,12 +13,13 @@ const path = require('path');
|
|
|
13
13
|
const yaml = require('js-yaml');
|
|
14
14
|
const chalk = require('chalk');
|
|
15
15
|
const { initializeGlobalSetup } = require('../config');
|
|
16
|
+
const WaiversManager = require('../waivers-manager');
|
|
16
17
|
|
|
17
18
|
const WAIVER_DIR = '.caws/waivers';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Waivers command handler
|
|
21
|
-
*
|
|
22
|
+
*
|
|
22
23
|
* @param {string} subcommand - create, list, show, revoke
|
|
23
24
|
* @param {object} options - Command options
|
|
24
25
|
*/
|
|
@@ -26,7 +27,7 @@ async function waiversCommand(subcommand = 'list', options = {}) {
|
|
|
26
27
|
try {
|
|
27
28
|
console.log('🔍 Detecting CAWS setup...');
|
|
28
29
|
const setup = initializeGlobalSetup();
|
|
29
|
-
|
|
30
|
+
|
|
30
31
|
if (setup.hasWorkingSpec) {
|
|
31
32
|
console.log(`✅ Detected ${setup.setupType} CAWS setup`);
|
|
32
33
|
console.log(` Capabilities: ${setup.capabilities.join(', ')}`);
|
|
@@ -70,9 +71,18 @@ async function waiversCommand(subcommand = 'list', options = {}) {
|
|
|
70
71
|
*/
|
|
71
72
|
async function createWaiver(options) {
|
|
72
73
|
// Validate required fields
|
|
73
|
-
const required = [
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const required = [
|
|
75
|
+
'title',
|
|
76
|
+
'reason',
|
|
77
|
+
'description',
|
|
78
|
+
'gates',
|
|
79
|
+
'expiresAt',
|
|
80
|
+
'approvedBy',
|
|
81
|
+
'impactLevel',
|
|
82
|
+
'mitigationPlan',
|
|
83
|
+
];
|
|
84
|
+
const missing = required.filter((field) => !options[field]);
|
|
85
|
+
|
|
76
86
|
if (missing.length > 0) {
|
|
77
87
|
console.error(chalk.red(`\n❌ Missing required fields: ${missing.join(', ')}`));
|
|
78
88
|
console.log(chalk.yellow('\n💡 Example:'));
|
|
@@ -93,9 +103,10 @@ async function createWaiver(options) {
|
|
|
93
103
|
const timestamp = new Date().toISOString();
|
|
94
104
|
|
|
95
105
|
// Parse gates
|
|
96
|
-
const gates =
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
const gates =
|
|
107
|
+
typeof options.gates === 'string'
|
|
108
|
+
? options.gates.split(',').map((g) => g.trim())
|
|
109
|
+
: options.gates;
|
|
99
110
|
|
|
100
111
|
// Create waiver object
|
|
101
112
|
const waiver = {
|
|
@@ -112,10 +123,18 @@ async function createWaiver(options) {
|
|
|
112
123
|
status: 'active',
|
|
113
124
|
};
|
|
114
125
|
|
|
115
|
-
// Save waiver
|
|
126
|
+
// Save individual waiver file
|
|
116
127
|
const waiverPath = path.join(process.cwd(), WAIVER_DIR, `${waiverId}.yaml`);
|
|
117
128
|
fs.writeFileSync(waiverPath, yaml.dump(waiver, { lineWidth: -1 }));
|
|
118
129
|
|
|
130
|
+
// Also add to active waivers file
|
|
131
|
+
try {
|
|
132
|
+
await addToActiveWaivers(waiver);
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error(`Failed to add waiver to active waivers: ${error.message}`);
|
|
135
|
+
console.error(error.stack);
|
|
136
|
+
}
|
|
137
|
+
|
|
119
138
|
console.log(chalk.green(`\n✅ Waiver created: ${waiverId}`));
|
|
120
139
|
console.log(` Title: ${waiver.title}`);
|
|
121
140
|
console.log(` Reason: ${waiver.reason}`);
|
|
@@ -132,36 +151,42 @@ async function createWaiver(options) {
|
|
|
132
151
|
*/
|
|
133
152
|
async function listWaivers(_options) {
|
|
134
153
|
const waiversDir = path.join(process.cwd(), WAIVER_DIR);
|
|
135
|
-
|
|
154
|
+
|
|
136
155
|
if (!fs.existsSync(waiversDir)) {
|
|
137
156
|
console.log(chalk.yellow('\nℹ️ No waivers found\n'));
|
|
138
157
|
return;
|
|
139
158
|
}
|
|
140
159
|
|
|
141
|
-
const waiverFiles = fs.readdirSync(waiversDir).filter(f => f.endsWith('.yaml'));
|
|
160
|
+
const waiverFiles = fs.readdirSync(waiversDir).filter((f) => f.endsWith('.yaml'));
|
|
142
161
|
|
|
143
162
|
if (waiverFiles.length === 0) {
|
|
144
163
|
console.log(chalk.yellow('\nℹ️ No waivers found\n'));
|
|
145
164
|
return;
|
|
146
165
|
}
|
|
147
166
|
|
|
148
|
-
const waivers = waiverFiles.map(file => {
|
|
167
|
+
const waivers = waiverFiles.map((file) => {
|
|
149
168
|
const content = fs.readFileSync(path.join(waiversDir, file), 'utf8');
|
|
150
169
|
return yaml.load(content);
|
|
151
170
|
});
|
|
152
171
|
|
|
153
172
|
// Filter by status
|
|
154
|
-
const activeWaivers = waivers.filter(
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
const activeWaivers = waivers.filter(
|
|
174
|
+
(w) => w.status === 'active' && new Date(w.expires_at) > new Date()
|
|
175
|
+
);
|
|
176
|
+
const expiredWaivers = waivers.filter(
|
|
177
|
+
(w) => w.status === 'active' && new Date(w.expires_at) <= new Date()
|
|
178
|
+
);
|
|
179
|
+
const revokedWaivers = waivers.filter((w) => w.status === 'revoked');
|
|
157
180
|
|
|
158
181
|
console.log(chalk.blue('\n🔖 CAWS Quality Gate Waivers\n'));
|
|
159
182
|
console.log('─'.repeat(60));
|
|
160
183
|
|
|
161
184
|
if (activeWaivers.length > 0) {
|
|
162
185
|
console.log(chalk.green('\n✅ Active Waivers:\n'));
|
|
163
|
-
activeWaivers.forEach(waiver => {
|
|
164
|
-
const daysLeft = Math.ceil(
|
|
186
|
+
activeWaivers.forEach((waiver) => {
|
|
187
|
+
const daysLeft = Math.ceil(
|
|
188
|
+
(new Date(waiver.expires_at) - new Date()) / (1000 * 60 * 60 * 24)
|
|
189
|
+
);
|
|
165
190
|
console.log(`🔖 ${chalk.bold(waiver.id)}: ${waiver.title}`);
|
|
166
191
|
console.log(` Reason: ${waiver.reason}`);
|
|
167
192
|
console.log(` Gates: ${waiver.gates.join(', ')}`);
|
|
@@ -173,7 +198,7 @@ async function listWaivers(_options) {
|
|
|
173
198
|
|
|
174
199
|
if (expiredWaivers.length > 0) {
|
|
175
200
|
console.log(chalk.yellow('\n⚠️ Expired Waivers:\n'));
|
|
176
|
-
expiredWaivers.forEach(waiver => {
|
|
201
|
+
expiredWaivers.forEach((waiver) => {
|
|
177
202
|
console.log(`🔖 ${chalk.bold(waiver.id)}: ${waiver.title}`);
|
|
178
203
|
console.log(` Expired: ${waiver.expires_at}`);
|
|
179
204
|
console.log();
|
|
@@ -182,7 +207,7 @@ async function listWaivers(_options) {
|
|
|
182
207
|
|
|
183
208
|
if (revokedWaivers.length > 0) {
|
|
184
209
|
console.log(chalk.red('\n❌ Revoked Waivers:\n'));
|
|
185
|
-
revokedWaivers.forEach(waiver => {
|
|
210
|
+
revokedWaivers.forEach((waiver) => {
|
|
186
211
|
console.log(`🔖 ${chalk.bold(waiver.id)}: ${waiver.title}`);
|
|
187
212
|
console.log(` Revoked: ${waiver.revoked_at}`);
|
|
188
213
|
console.log();
|
|
@@ -207,7 +232,7 @@ async function showWaiver(waiverId, _options) {
|
|
|
207
232
|
}
|
|
208
233
|
|
|
209
234
|
const waiverPath = path.join(process.cwd(), WAIVER_DIR, `${waiverId}.yaml`);
|
|
210
|
-
|
|
235
|
+
|
|
211
236
|
if (!fs.existsSync(waiverPath)) {
|
|
212
237
|
console.error(chalk.red(`\n❌ Waiver not found: ${waiverId}\n`));
|
|
213
238
|
process.exit(1);
|
|
@@ -222,7 +247,9 @@ async function showWaiver(waiverId, _options) {
|
|
|
222
247
|
|
|
223
248
|
console.log(chalk.blue('\n🔖 Waiver Details\n'));
|
|
224
249
|
console.log('─'.repeat(60));
|
|
225
|
-
console.log(
|
|
250
|
+
console.log(
|
|
251
|
+
`\n${statusIcon} Status: ${chalk.bold(isActive ? 'Active' : isExpired ? 'Expired' : waiver.status)}`
|
|
252
|
+
);
|
|
226
253
|
console.log(`\n📋 ${chalk.bold(waiver.title)}`);
|
|
227
254
|
console.log(` ID: ${waiver.id}`);
|
|
228
255
|
console.log(` Reason: ${waiver.reason}`);
|
|
@@ -230,7 +257,7 @@ async function showWaiver(waiverId, _options) {
|
|
|
230
257
|
console.log(`\n📝 Description:`);
|
|
231
258
|
console.log(` ${waiver.description}`);
|
|
232
259
|
console.log(`\n🔒 Waived Quality Gates:`);
|
|
233
|
-
waiver.gates.forEach(gate => {
|
|
260
|
+
waiver.gates.forEach((gate) => {
|
|
234
261
|
console.log(` • ${gate}`);
|
|
235
262
|
});
|
|
236
263
|
console.log(`\n🛡️ Mitigation Plan:`);
|
|
@@ -259,7 +286,7 @@ async function revokeWaiver(waiverId, options) {
|
|
|
259
286
|
}
|
|
260
287
|
|
|
261
288
|
const waiverPath = path.join(process.cwd(), WAIVER_DIR, `${waiverId}.yaml`);
|
|
262
|
-
|
|
289
|
+
|
|
263
290
|
if (!fs.existsSync(waiverPath)) {
|
|
264
291
|
console.error(chalk.red(`\n❌ Waiver not found: ${waiverId}\n`));
|
|
265
292
|
process.exit(1);
|
|
@@ -289,5 +316,53 @@ async function revokeWaiver(waiverId, options) {
|
|
|
289
316
|
console.log(` Reason: ${waiver.revocation_reason}\n`);
|
|
290
317
|
}
|
|
291
318
|
|
|
292
|
-
|
|
319
|
+
/**
|
|
320
|
+
* Add waiver to active waivers file for quality gates integration
|
|
321
|
+
*/
|
|
322
|
+
async function addToActiveWaivers(waiver) {
|
|
323
|
+
try {
|
|
324
|
+
const waiversManager = new WaiversManager();
|
|
325
|
+
|
|
326
|
+
// Load existing active waivers
|
|
327
|
+
const activeWaivers = await waiversManager.loadActiveWaivers();
|
|
328
|
+
|
|
329
|
+
// Check if waiver already exists
|
|
330
|
+
const existingIndex = activeWaivers.findIndex((w) => w.id === waiver.id);
|
|
331
|
+
|
|
332
|
+
// Normalize waiver format
|
|
333
|
+
const normalizedWaiver = {
|
|
334
|
+
id: waiver.id,
|
|
335
|
+
title: waiver.title || waiver.description || waiver.id,
|
|
336
|
+
reason: waiver.reason || waiver.reason_code || 'unknown',
|
|
337
|
+
description: waiver.description || waiver.title || waiver.id,
|
|
338
|
+
gates: Array.isArray(waiver.gates) ? waiver.gates : [waiver.gates],
|
|
339
|
+
expires_at: waiver.expires_at,
|
|
340
|
+
approved_by: waiver.approved_by || waiver.risk_owner || 'unknown',
|
|
341
|
+
created_at: waiver.created_at || waiver.approved_at || new Date().toISOString(),
|
|
342
|
+
risk_assessment: waiver.risk_assessment || {
|
|
343
|
+
impact_level: waiver.impact_level || 'medium',
|
|
344
|
+
mitigation_plan: waiver.mitigation || waiver.mitigation_plan || 'Unknown mitigation',
|
|
345
|
+
},
|
|
346
|
+
metadata: waiver.metadata || {},
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
if (existingIndex >= 0) {
|
|
350
|
+
// Update existing waiver
|
|
351
|
+
activeWaivers[existingIndex] = normalizedWaiver;
|
|
352
|
+
} else {
|
|
353
|
+
// Add new waiver
|
|
354
|
+
activeWaivers.push(normalizedWaiver);
|
|
355
|
+
}
|
|
293
356
|
|
|
357
|
+
// Save updated active waivers
|
|
358
|
+
await waiversManager.saveActiveWaivers(activeWaivers);
|
|
359
|
+
} catch (error) {
|
|
360
|
+
// Enhanced error logging
|
|
361
|
+
console.error(`Error adding waiver to active waivers: ${error.message}`);
|
|
362
|
+
console.error(error.stack);
|
|
363
|
+
console.warn(`Warning: Could not add waiver to active waivers file: ${error.message}`);
|
|
364
|
+
// Don't fail the waiver creation if this fails
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
module.exports = { waiversCommand };
|
package/dist/waivers-manager.js
CHANGED
|
@@ -469,7 +469,36 @@ class WaiversManager {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
const content = fs.readFileSync(this.waiversFile, 'utf8');
|
|
472
|
-
|
|
472
|
+
const data = yaml.load(content) || {};
|
|
473
|
+
|
|
474
|
+
// Handle both formats: direct array or {waivers: {...}} structure
|
|
475
|
+
if (Array.isArray(data)) {
|
|
476
|
+
return data;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (data.waivers && typeof data.waivers === 'object') {
|
|
480
|
+
// Convert the waivers object to an array
|
|
481
|
+
return Object.values(data.waivers).map((waiver) => {
|
|
482
|
+
// Normalize waiver format for quality gates
|
|
483
|
+
return {
|
|
484
|
+
id: waiver.id,
|
|
485
|
+
title: waiver.title || waiver.description || waiver.id,
|
|
486
|
+
reason: waiver.reason || waiver.reason_code || 'unknown',
|
|
487
|
+
description: waiver.description || waiver.title || waiver.id,
|
|
488
|
+
gates: Array.isArray(waiver.gates) ? waiver.gates : [waiver.gates],
|
|
489
|
+
expires_at: waiver.expires_at,
|
|
490
|
+
approved_by: waiver.approved_by || waiver.risk_owner || 'unknown',
|
|
491
|
+
created_at: waiver.created_at || waiver.approved_at || new Date().toISOString(),
|
|
492
|
+
risk_assessment: waiver.risk_assessment || {
|
|
493
|
+
impact_level: waiver.impact_level || 'medium',
|
|
494
|
+
mitigation_plan: waiver.mitigation || waiver.mitigation_plan || 'Unknown mitigation',
|
|
495
|
+
},
|
|
496
|
+
metadata: waiver.metadata || {},
|
|
497
|
+
};
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return [];
|
|
473
502
|
} catch (error) {
|
|
474
503
|
console.warn(`Warning: Could not load waivers file: ${error.message}`);
|
|
475
504
|
return [];
|
|
@@ -477,11 +506,27 @@ class WaiversManager {
|
|
|
477
506
|
}
|
|
478
507
|
|
|
479
508
|
async saveActiveWaivers(waivers) {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
509
|
+
// Convert array back to object format for compatibility
|
|
510
|
+
const waiversObj = {};
|
|
511
|
+
waivers.forEach((waiver) => {
|
|
512
|
+
waiversObj[waiver.id] = waiver;
|
|
483
513
|
});
|
|
484
514
|
|
|
515
|
+
const data = {
|
|
516
|
+
waivers: waiversObj,
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
const content = [
|
|
520
|
+
'# CAWS Active Waivers',
|
|
521
|
+
'# This file contains all currently active waivers that temporarily bypass quality gates',
|
|
522
|
+
'# Waivers are automatically cleaned up when they expire',
|
|
523
|
+
'',
|
|
524
|
+
yaml.dump(data, {
|
|
525
|
+
indent: 2,
|
|
526
|
+
sortKeys: true,
|
|
527
|
+
}),
|
|
528
|
+
].join('\n');
|
|
529
|
+
|
|
485
530
|
fs.writeFileSync(this.waiversFile, content, 'utf8');
|
|
486
531
|
}
|
|
487
532
|
|
package/package.json
CHANGED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Derive budget for a working spec based on policy and waivers
|
|
3
|
-
* Enhanced to use PolicyManager for caching
|
|
4
|
-
* @param {Object} spec - Working spec object
|
|
5
|
-
* @param {string} projectRoot - Project root directory
|
|
6
|
-
* @param {Object} options - Derivation options
|
|
7
|
-
* @param {boolean} options.useCache - Use cached policy (default: true)
|
|
8
|
-
* @returns {Object} Derived budget with baseline and effective limits
|
|
9
|
-
*/
|
|
10
|
-
export function deriveBudget(spec: any, projectRoot?: string, options?: {
|
|
11
|
-
useCache: boolean;
|
|
12
|
-
}): any;
|
|
13
|
-
/**
|
|
14
|
-
* Load a waiver by ID
|
|
15
|
-
* Enhanced with structure validation and detailed error reporting
|
|
16
|
-
* @param {string} waiverId - Waiver ID (e.g., WV-0001)
|
|
17
|
-
* @param {string} projectRoot - Project root directory
|
|
18
|
-
* @returns {Object|null} Waiver object or null if not found
|
|
19
|
-
*/
|
|
20
|
-
export function loadWaiver(waiverId: string, projectRoot: string): any | null;
|
|
21
|
-
/**
|
|
22
|
-
* Check if a waiver is currently valid
|
|
23
|
-
* Enhanced with proper expiry and approval validation
|
|
24
|
-
* @param {Object} waiver - Waiver object
|
|
25
|
-
* @param {Object} policy - Policy configuration (optional)
|
|
26
|
-
* @returns {boolean} Whether waiver is valid and active
|
|
27
|
-
*/
|
|
28
|
-
export function isWaiverValid(waiver: any, policy?: any): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Check if current changes exceed derived budget
|
|
31
|
-
* @param {Object} derivedBudget - Budget from deriveBudget()
|
|
32
|
-
* @param {Object} currentStats - Current change statistics
|
|
33
|
-
* @returns {Object} Budget check result
|
|
34
|
-
*/
|
|
35
|
-
export function checkBudgetCompliance(derivedBudget: any, currentStats: any): any;
|
|
36
|
-
/**
|
|
37
|
-
* Generate burn-up report for scope visibility
|
|
38
|
-
* Enhanced with utilization metrics and warnings
|
|
39
|
-
* @param {Object} derivedBudget - Budget from deriveBudget()
|
|
40
|
-
* @param {Object} currentStats - Current change statistics
|
|
41
|
-
* @returns {string} Human-readable burn-up report
|
|
42
|
-
*/
|
|
43
|
-
export function generateBurnupReport(derivedBudget: any, currentStats: any): string;
|
|
44
|
-
/**
|
|
45
|
-
* Calculate budget utilization percentages
|
|
46
|
-
* @param {Object} budgetCompliance - Budget compliance result
|
|
47
|
-
* @returns {Object} Utilization percentages
|
|
48
|
-
*/
|
|
49
|
-
export function calculateBudgetUtilization(budgetCompliance: any): any;
|
|
50
|
-
/**
|
|
51
|
-
* Check if changes are approaching budget limit
|
|
52
|
-
* @param {Object} budgetCompliance - Budget compliance result
|
|
53
|
-
* @param {number} threshold - Warning threshold (default 80)
|
|
54
|
-
* @returns {boolean} Whether approaching limit
|
|
55
|
-
*/
|
|
56
|
-
export function isApproachingBudgetLimit(budgetCompliance: any, threshold?: number): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Validate policy structure and content
|
|
59
|
-
* @param {Object} policy - Policy object from policy.yaml
|
|
60
|
-
* @throws {Error} If policy is invalid
|
|
61
|
-
*/
|
|
62
|
-
export function validatePolicy(policy: any): void;
|
|
63
|
-
/**
|
|
64
|
-
* Get default policy as fallback
|
|
65
|
-
* @returns {Object} Default CAWS policy
|
|
66
|
-
*/
|
|
67
|
-
export function getDefaultPolicy(): any;
|
|
68
|
-
/**
|
|
69
|
-
* Validate waiver document structure
|
|
70
|
-
* @param {Object} waiver - Waiver document to validate
|
|
71
|
-
* @throws {Error} If waiver structure is invalid
|
|
72
|
-
*/
|
|
73
|
-
export function validateWaiverStructure(waiver: any): void;
|
|
74
|
-
//# sourceMappingURL=budget-derivation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"budget-derivation.d.ts","sourceRoot":"","sources":["../src/budget-derivation.js"],"names":[],"mappings":"AA8JA;;;;;;;;GAQG;AACH,sDALW,MAAM,YAEd;IAAyB,QAAQ,EAAzB,OAAO;CACf,OA+FF;AA4FD;;;;;;GAMG;AACH,qCAJW,MAAM,eACN,MAAM,GACJ,MAAO,IAAI,CAuCvB;AAED;;;;;;GAMG;AACH,0DAFa,OAAO,CAgDnB;AAED;;;;;GAKG;AACH,kFA8BC;AAqCD;;;;;;GAMG;AACH,6EAFa,MAAM,CA8ClB;AAtFD;;;;GAIG;AACH,uEAiBC;AAED;;;;;GAKG;AACH,4EAHW,MAAM,GACJ,OAAO,CAKnB;AAhgBD;;;;GAIG;AACH,kDA+FC;AAED;;;GAGG;AACH,wCAsCC;AA0GD;;;;GAIG;AACH,2DAmFC"}
|
package/dist/cicd-optimizer.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
export = CICDOptimizer;
|
|
2
|
-
declare class CICDOptimizer {
|
|
3
|
-
constructor(options?: {});
|
|
4
|
-
projectRoot: any;
|
|
5
|
-
cacheDir: string;
|
|
6
|
-
optimizationConfig: string;
|
|
7
|
-
/**
|
|
8
|
-
* Analyze project and generate CI/CD optimization recommendations
|
|
9
|
-
*/
|
|
10
|
-
analyzeProject(specPath?: string): Promise<{
|
|
11
|
-
project_tier: string;
|
|
12
|
-
recommended_optimizations: any[];
|
|
13
|
-
cache_strategy: {};
|
|
14
|
-
parallel_groups: any[];
|
|
15
|
-
conditional_execution: {};
|
|
16
|
-
estimated_savings: {};
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Generate tier-based conditional execution rules
|
|
20
|
-
*/
|
|
21
|
-
generateConditionalExecutionRules(tier: any): {
|
|
22
|
-
coverage_required: boolean;
|
|
23
|
-
mutation_required: boolean;
|
|
24
|
-
contract_testing: boolean;
|
|
25
|
-
accessibility_check: boolean;
|
|
26
|
-
performance_budget: boolean;
|
|
27
|
-
security_scan: boolean;
|
|
28
|
-
lint_strict: boolean;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Analyze what optimizations are beneficial for this tier
|
|
32
|
-
*/
|
|
33
|
-
analyzeOptimizationOpportunities(tier: any): Promise<{
|
|
34
|
-
type: string;
|
|
35
|
-
description: string;
|
|
36
|
-
impact: string;
|
|
37
|
-
effort: string;
|
|
38
|
-
}[]>;
|
|
39
|
-
/**
|
|
40
|
-
* Generate intelligent caching strategy
|
|
41
|
-
*/
|
|
42
|
-
generateCacheStrategy(): Promise<{
|
|
43
|
-
node_modules: {
|
|
44
|
-
key: string;
|
|
45
|
-
paths: string[];
|
|
46
|
-
restore_keys: string[];
|
|
47
|
-
};
|
|
48
|
-
build_artifacts: {
|
|
49
|
-
key: string;
|
|
50
|
-
paths: string[];
|
|
51
|
-
restore_keys: any[];
|
|
52
|
-
};
|
|
53
|
-
test_cache: {
|
|
54
|
-
key: string;
|
|
55
|
-
paths: string[];
|
|
56
|
-
restore_keys: string[];
|
|
57
|
-
};
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Create parallel execution groups for quality gates
|
|
61
|
-
*/
|
|
62
|
-
createParallelGroups(): Promise<{
|
|
63
|
-
name: string;
|
|
64
|
-
description: string;
|
|
65
|
-
jobs: string[];
|
|
66
|
-
max_parallel: number;
|
|
67
|
-
timeout: number;
|
|
68
|
-
}[]>;
|
|
69
|
-
/**
|
|
70
|
-
* Analyze changed files to determine what tests to run
|
|
71
|
-
*/
|
|
72
|
-
analyzeChangedFiles(changedFiles?: any[]): Promise<{
|
|
73
|
-
unit: any[];
|
|
74
|
-
integration: any[];
|
|
75
|
-
contract: any[];
|
|
76
|
-
e2e: any[];
|
|
77
|
-
}>;
|
|
78
|
-
/**
|
|
79
|
-
* Estimate time savings from optimizations
|
|
80
|
-
*/
|
|
81
|
-
estimateTimeSavings(analysis: any): {
|
|
82
|
-
original_minutes: any;
|
|
83
|
-
optimized_minutes: number;
|
|
84
|
-
savings_percent: number;
|
|
85
|
-
monthly_savings_hours: number;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Generate optimized CI/CD configuration
|
|
89
|
-
*/
|
|
90
|
-
generateOptimizedConfig(platform?: string): Promise<string | {
|
|
91
|
-
name: string;
|
|
92
|
-
on: {
|
|
93
|
-
push: {
|
|
94
|
-
branches: string[];
|
|
95
|
-
};
|
|
96
|
-
pull_request: {
|
|
97
|
-
branches: string[];
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
jobs: {};
|
|
101
|
-
} | {
|
|
102
|
-
stages: string[];
|
|
103
|
-
cache: {
|
|
104
|
-
key: string;
|
|
105
|
-
paths: string[];
|
|
106
|
-
};
|
|
107
|
-
}>;
|
|
108
|
-
/**
|
|
109
|
-
* Generate optimized GitHub Actions workflow
|
|
110
|
-
*/
|
|
111
|
-
generateGitHubActionsConfig(analysis: any): {
|
|
112
|
-
name: string;
|
|
113
|
-
on: {
|
|
114
|
-
push: {
|
|
115
|
-
branches: string[];
|
|
116
|
-
};
|
|
117
|
-
pull_request: {
|
|
118
|
-
branches: string[];
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
jobs: {};
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Generate GitLab CI configuration
|
|
125
|
-
*/
|
|
126
|
-
generateGitLabCIConfig(analysis: any): {
|
|
127
|
-
stages: string[];
|
|
128
|
-
cache: {
|
|
129
|
-
key: string;
|
|
130
|
-
paths: string[];
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Generate Jenkins pipeline configuration
|
|
135
|
-
*/
|
|
136
|
-
generateJenkinsConfig(analysis: any): string;
|
|
137
|
-
/**
|
|
138
|
-
* Create hash for cache invalidation
|
|
139
|
-
*/
|
|
140
|
-
createCacheHash(files: any): string;
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=cicd-optimizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cicd-optimizer.d.ts","sourceRoot":"","sources":["../src/cicd-optimizer.js"],"names":[],"mappings":";AAaA;IACE,0BASC;IARC,iBAAuD;IACvD,iBAA6D;IAC7D,2BAAkF;IAQpF;;OAEG;IACH;;;;;;;OAyCC;IAED;;OAEG;IACH;;;;;;;;MAyBC;IAED;;OAEG;IACH;;;;;SA6CC;IAED;;OAEG;IACH;;;;;;;;;;;;;;;;OA8CC;IAED;;OAEG;IACH;;;;;;SA0BC;IAED;;OAEG;IACH;;;;;OA2BC;IAED;;OAEG;IACH;;;;;MA+BC;IAED;;OAEG;IACH;;;;;;;;;;;;;;;;;OAYC;IAED;;OAEG;IACH;;;;;;;;;;;MA4EC;IAED;;OAEG;IACH;;;;;;MAiCC;IAED;;OAEG;IACH,6CA+CC;IAED;;OAEG;IACH,oCAQC;CACF"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Archive command handler
|
|
3
|
-
* @param {string} changeId - Change identifier to archive
|
|
4
|
-
* @param {Object} options - Command options
|
|
5
|
-
*/
|
|
6
|
-
export function archiveCommand(changeId: string, options?: any): Promise<any>;
|
|
7
|
-
/**
|
|
8
|
-
* Load change folder structure
|
|
9
|
-
* @param {string} changeId - Change identifier
|
|
10
|
-
* @returns {Promise<Object|null>} Change data or null
|
|
11
|
-
*/
|
|
12
|
-
export function loadChange(changeId: string): Promise<any | null>;
|
|
13
|
-
/**
|
|
14
|
-
* Validate all acceptance criteria are met
|
|
15
|
-
* @param {Object} workingSpec - Working specification
|
|
16
|
-
* @returns {Promise<Object>} Validation result
|
|
17
|
-
*/
|
|
18
|
-
export function validateAcceptanceCriteria(workingSpec: any): Promise<any>;
|
|
19
|
-
/**
|
|
20
|
-
* Validate change meets quality gates
|
|
21
|
-
* @param {string} changeId - Change identifier
|
|
22
|
-
* @returns {Promise<Object>} Quality gate result
|
|
23
|
-
*/
|
|
24
|
-
export function validateQualityGates(_changeId: any): Promise<any>;
|
|
25
|
-
/**
|
|
26
|
-
* Generate change summary for archival
|
|
27
|
-
* @param {Object} change - Change data
|
|
28
|
-
* @returns {Promise<string>} Summary text
|
|
29
|
-
*/
|
|
30
|
-
export function generateChangeSummary(change: any): Promise<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Archive change folder to archive directory
|
|
33
|
-
* @param {Object} change - Change data
|
|
34
|
-
* @returns {Promise<void>}
|
|
35
|
-
*/
|
|
36
|
-
export function archiveChange(change: any): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Update provenance with completion
|
|
39
|
-
* @param {Object} change - Change data
|
|
40
|
-
* @returns {Promise<void>}
|
|
41
|
-
*/
|
|
42
|
-
export function updateProvenance(change: any): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Display archive results
|
|
45
|
-
* @param {Object} change - Change data
|
|
46
|
-
* @param {Object} validation - Validation result
|
|
47
|
-
* @param {Object} qualityGates - Quality gates result
|
|
48
|
-
*/
|
|
49
|
-
export function displayArchiveResults(change: any, validation: any, qualityGates: any): void;
|
|
50
|
-
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/commands/archive.js"],"names":[],"mappings":"AA8OA;;;;GAIG;AACH,yCAHW,MAAM,+BAqGhB;AAtUD;;;;GAIG;AACH,qCAHW,MAAM,GACJ,OAAO,CAAC,MAAO,IAAI,CAAC,CAgChC;AAED;;;;GAIG;AACH,8DAFa,OAAO,KAAQ,CA8B3B;AAED;;;;GAIG;AACH,sDAFa,OAAO,KAAQ,CAS3B;AAED;;;;GAIG;AACH,oDAFa,OAAO,CAAC,MAAM,CAAC,CAgC3B;AAED;;;;GAIG;AACH,4CAFa,OAAO,CAAC,IAAI,CAAC,CAazB;AAED;;;;GAIG;AACH,+CAFa,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAED;;;;;GAKG;AACH,6FAiCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"burnup.d.ts","sourceRoot":"","sources":["../../src/commands/burnup.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wCAFW,MAAM,iBAsEhB"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Diagnose command handler
|
|
3
|
-
* @param {Object} options - Command options
|
|
4
|
-
*/
|
|
5
|
-
export function diagnoseCommand(options?: any): Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* Run all health checks
|
|
8
|
-
* @returns {Promise<Object>} Diagnosis results
|
|
9
|
-
*/
|
|
10
|
-
export function runDiagnosis(): Promise<any>;
|
|
11
|
-
/**
|
|
12
|
-
* Display diagnosis results
|
|
13
|
-
* @param {Object[]} results - Diagnosis results
|
|
14
|
-
*/
|
|
15
|
-
export function displayResults(results: any[]): void;
|
|
16
|
-
/**
|
|
17
|
-
* Apply automatic fixes
|
|
18
|
-
* @param {Object[]} results - Diagnosis results
|
|
19
|
-
* @returns {Promise<Object>} Fix results
|
|
20
|
-
*/
|
|
21
|
-
export function applyAutoFixes(results: any[]): Promise<any>;
|
|
22
|
-
/**
|
|
23
|
-
* Health check: Working spec validity
|
|
24
|
-
* @returns {Promise<Object>} Check result
|
|
25
|
-
*/
|
|
26
|
-
export function checkWorkingSpec(): Promise<any>;
|
|
27
|
-
/**
|
|
28
|
-
* Health check: Git repository
|
|
29
|
-
* @returns {Promise<Object>} Check result
|
|
30
|
-
*/
|
|
31
|
-
export function checkGitSetup(): Promise<any>;
|
|
32
|
-
/**
|
|
33
|
-
* Health check: Git hooks
|
|
34
|
-
* @returns {Promise<Object>} Check result
|
|
35
|
-
*/
|
|
36
|
-
export function checkGitHooks(): Promise<any>;
|
|
37
|
-
/**
|
|
38
|
-
* Health check: TypeScript configuration
|
|
39
|
-
* @returns {Promise<Object>} Check result
|
|
40
|
-
*/
|
|
41
|
-
export function checkTypeScriptConfig(): Promise<any>;
|
|
42
|
-
/**
|
|
43
|
-
* Health check: Test files exist
|
|
44
|
-
* @returns {Promise<Object>} Check result
|
|
45
|
-
*/
|
|
46
|
-
export function checkTestFiles(): Promise<any>;
|
|
47
|
-
/**
|
|
48
|
-
* Health check: CAWS tools directory
|
|
49
|
-
* @returns {Promise<Object>} Check result
|
|
50
|
-
*/
|
|
51
|
-
export function checkCAWSTools(): Promise<any>;
|
|
52
|
-
//# sourceMappingURL=diagnose.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.js"],"names":[],"mappings":"AAubA;;;GAGG;AACH,8DAiDC;AApND;;;GAGG;AACH,gCAFa,OAAO,KAAQ,CAkD3B;AAED;;;GAGG;AACH,wCAFW,KAAQ,QA4ClB;AAED;;;;GAIG;AACH,wCAHW,KAAQ,GACN,OAAO,KAAQ,CAoD3B;AAtaD;;;GAGG;AACH,oCAFa,OAAO,KAAQ,CA2C3B;AAED;;;GAGG;AACH,iCAFa,OAAO,KAAQ,CAiB3B;AAED;;;GAGG;AACH,iCAFa,OAAO,KAAQ,CA0C3B;AAED;;;GAGG;AACH,yCAFa,OAAO,KAAQ,CAgE3B;AAED;;;GAGG;AACH,kCAFa,OAAO,KAAQ,CAoC3B;AAED;;;GAGG;AACH,kCAFa,OAAO,KAAQ,CAuC3B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Evaluate command handler
|
|
3
|
-
*
|
|
4
|
-
* @param {string} specFile - Path to working spec file
|
|
5
|
-
* @param {object} options - Command options
|
|
6
|
-
*/
|
|
7
|
-
export function evaluateCommand(specFile?: string, options?: object): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=evaluate.d.ts.map
|