@wundr.io/cli 1.0.10 → 1.0.12
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/bin/wundr.js +8 -4
- package/package.json +23 -23
- package/src/ai/ai-service.ts +16 -17
- package/src/ai/claude-client.ts +16 -16
- package/src/ai/conversation-manager.ts +29 -29
- package/src/cli.ts +4 -4
- package/src/commands/ai.ts +246 -78
- package/src/commands/alignment.ts +74 -74
- package/src/commands/analyze-optimized.ts +111 -78
- package/src/commands/analyze.ts +14 -14
- package/src/commands/batch.ts +179 -42
- package/src/commands/chat.ts +37 -30
- package/src/commands/claude-init.ts +41 -45
- package/src/commands/claude-setup.ts +204 -119
- package/src/commands/computer-setup.ts +85 -43
- package/src/commands/create-command.ts +4 -4
- package/src/commands/create.ts +27 -27
- package/src/commands/dashboard.ts +24 -24
- package/src/commands/govern.ts +25 -25
- package/src/commands/governance.ts +34 -34
- package/src/commands/guardian.ts +56 -56
- package/src/commands/init.ts +25 -22
- package/src/commands/orchestrator.ts +68 -41
- package/src/commands/performance-optimizer.ts +34 -35
- package/src/commands/plugins.ts +27 -27
- package/src/commands/project-update.ts +175 -72
- package/src/commands/rag.ts +185 -78
- package/src/commands/session.ts +35 -35
- package/src/commands/setup.ts +40 -344
- package/src/commands/test-init.ts +3 -3
- package/src/commands/test.ts +4 -4
- package/src/commands/watch.ts +28 -29
- package/src/commands/worktree.ts +49 -49
- package/src/context/context-manager.ts +10 -10
- package/src/context/session-manager.ts +41 -41
- package/src/framework/command-interface.ts +520 -0
- package/src/framework/command-registry.ts +942 -0
- package/src/framework/completion-exporter.ts +383 -0
- package/src/framework/debug-logger.ts +519 -0
- package/src/framework/error-handler.ts +867 -0
- package/src/framework/help-generator.ts +540 -0
- package/src/framework/index.ts +169 -0
- package/src/framework/interactive-repl.ts +703 -0
- package/src/framework/output-formatter.ts +834 -0
- package/src/framework/progress-manager.ts +539 -0
- package/src/index.ts +4 -4
- package/src/interactive/interactive-mode.ts +16 -16
- package/src/lib/conflict-resolution.ts +799 -9
- package/src/lib/merge-strategy.ts +529 -7
- package/src/lib/safety-mechanisms.ts +422 -18
- package/src/lib/state-detection.ts +1015 -13
- package/src/nlp/command-mapper.ts +29 -29
- package/src/nlp/command-parser.ts +17 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +54 -52
- package/src/plugins/plugin-manager.ts +61 -39
- package/src/tests/computer-setup-integration.test.ts +46 -15
- package/src/types/modules.d.ts +424 -1
- package/src/utils/backup-rollback-manager.ts +11 -8
- package/src/utils/config-manager.ts +3 -3
- package/src/utils/error-handler.ts +2 -2
- package/src/utils/logger.ts +22 -22
- package/templates/batch/ci-cd.yaml +7 -7
- package/test-suites/api/health.spec.ts +20 -23
- package/test-suites/helpers/test-config.ts +14 -13
- package/test-suites/ui/accessibility.spec.ts +27 -22
- package/test-suites/ui/smoke.spec.ts +26 -21
- package/LICENSE +0 -21
- package/dist/ai/ai-service.d.ts +0 -152
- package/dist/ai/ai-service.d.ts.map +0 -1
- package/dist/ai/ai-service.js +0 -430
- package/dist/ai/ai-service.js.map +0 -1
- package/dist/ai/claude-client.d.ts +0 -130
- package/dist/ai/claude-client.d.ts.map +0 -1
- package/dist/ai/claude-client.js +0 -340
- package/dist/ai/claude-client.js.map +0 -1
- package/dist/ai/conversation-manager.d.ts +0 -164
- package/dist/ai/conversation-manager.d.ts.map +0 -1
- package/dist/ai/conversation-manager.js +0 -614
- package/dist/ai/conversation-manager.js.map +0 -1
- package/dist/ai/index.d.ts +0 -5
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -8
- package/dist/ai/index.js.map +0 -1
- package/dist/cli.d.ts +0 -36
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -192
- package/dist/cli.js.map +0 -1
- package/dist/commands/ai.d.ts +0 -89
- package/dist/commands/ai.d.ts.map +0 -1
- package/dist/commands/ai.js +0 -799
- package/dist/commands/ai.js.map +0 -1
- package/dist/commands/alignment.d.ts +0 -78
- package/dist/commands/alignment.d.ts.map +0 -1
- package/dist/commands/alignment.js +0 -817
- package/dist/commands/alignment.js.map +0 -1
- package/dist/commands/analyze-optimized.d.ts +0 -14
- package/dist/commands/analyze-optimized.d.ts.map +0 -1
- package/dist/commands/analyze-optimized.js +0 -600
- package/dist/commands/analyze-optimized.js.map +0 -1
- package/dist/commands/analyze.d.ts +0 -65
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/analyze.js +0 -435
- package/dist/commands/analyze.js.map +0 -1
- package/dist/commands/batch.d.ts +0 -71
- package/dist/commands/batch.d.ts.map +0 -1
- package/dist/commands/batch.js +0 -738
- package/dist/commands/batch.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -71
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -674
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/claude-init.d.ts +0 -28
- package/dist/commands/claude-init.d.ts.map +0 -1
- package/dist/commands/claude-init.js +0 -591
- package/dist/commands/claude-init.js.map +0 -1
- package/dist/commands/claude-setup.d.ts +0 -119
- package/dist/commands/claude-setup.d.ts.map +0 -1
- package/dist/commands/claude-setup.js +0 -1073
- package/dist/commands/claude-setup.js.map +0 -1
- package/dist/commands/computer-setup-commands.d.ts +0 -53
- package/dist/commands/computer-setup-commands.d.ts.map +0 -1
- package/dist/commands/computer-setup-commands.js +0 -705
- package/dist/commands/computer-setup-commands.js.map +0 -1
- package/dist/commands/computer-setup.d.ts +0 -7
- package/dist/commands/computer-setup.d.ts.map +0 -1
- package/dist/commands/computer-setup.js +0 -849
- package/dist/commands/computer-setup.js.map +0 -1
- package/dist/commands/create-command.d.ts +0 -7
- package/dist/commands/create-command.d.ts.map +0 -1
- package/dist/commands/create-command.js +0 -158
- package/dist/commands/create-command.js.map +0 -1
- package/dist/commands/create.d.ts +0 -74
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -556
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -91
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -538
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/govern.d.ts +0 -70
- package/dist/commands/govern.d.ts.map +0 -1
- package/dist/commands/govern.js +0 -481
- package/dist/commands/govern.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -17
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -703
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/guardian.d.ts +0 -20
- package/dist/commands/guardian.d.ts.map +0 -1
- package/dist/commands/guardian.js +0 -597
- package/dist/commands/guardian.js.map +0 -1
- package/dist/commands/init.d.ts +0 -59
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -650
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/orchestrator.d.ts +0 -7
- package/dist/commands/orchestrator.d.ts.map +0 -1
- package/dist/commands/orchestrator.js +0 -571
- package/dist/commands/orchestrator.js.map +0 -1
- package/dist/commands/performance-optimizer.d.ts +0 -30
- package/dist/commands/performance-optimizer.d.ts.map +0 -1
- package/dist/commands/performance-optimizer.js +0 -650
- package/dist/commands/performance-optimizer.js.map +0 -1
- package/dist/commands/plugins.d.ts +0 -87
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js +0 -685
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/rag.d.ts +0 -7
- package/dist/commands/rag.d.ts.map +0 -1
- package/dist/commands/rag.js +0 -748
- package/dist/commands/rag.js.map +0 -1
- package/dist/commands/session.d.ts +0 -41
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -441
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -29
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -397
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/test-init.d.ts +0 -9
- package/dist/commands/test-init.d.ts.map +0 -1
- package/dist/commands/test-init.js +0 -222
- package/dist/commands/test-init.js.map +0 -1
- package/dist/commands/test.d.ts +0 -25
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -217
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/vp.d.ts +0 -7
- package/dist/commands/vp.d.ts.map +0 -1
- package/dist/commands/vp.js +0 -571
- package/dist/commands/vp.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -76
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -613
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/worktree.d.ts +0 -63
- package/dist/commands/worktree.d.ts.map +0 -1
- package/dist/commands/worktree.js +0 -774
- package/dist/commands/worktree.js.map +0 -1
- package/dist/context/context-manager.d.ts +0 -155
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/context-manager.js +0 -383
- package/dist/context/context-manager.js.map +0 -1
- package/dist/context/index.d.ts +0 -3
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -6
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts +0 -207
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js +0 -686
- package/dist/context/session-manager.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -1
- package/dist/interactive/interactive-mode.d.ts +0 -76
- package/dist/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/interactive/interactive-mode.js +0 -732
- package/dist/interactive/interactive-mode.js.map +0 -1
- package/dist/nlp/command-mapper.d.ts +0 -174
- package/dist/nlp/command-mapper.d.ts.map +0 -1
- package/dist/nlp/command-mapper.js +0 -624
- package/dist/nlp/command-mapper.js.map +0 -1
- package/dist/nlp/command-parser.d.ts +0 -106
- package/dist/nlp/command-parser.d.ts.map +0 -1
- package/dist/nlp/command-parser.js +0 -417
- package/dist/nlp/command-parser.js.map +0 -1
- package/dist/nlp/index.d.ts +0 -5
- package/dist/nlp/index.d.ts.map +0 -1
- package/dist/nlp/index.js +0 -8
- package/dist/nlp/index.js.map +0 -1
- package/dist/nlp/intent-classifier.d.ts +0 -59
- package/dist/nlp/intent-classifier.d.ts.map +0 -1
- package/dist/nlp/intent-classifier.js +0 -384
- package/dist/nlp/intent-classifier.js.map +0 -1
- package/dist/nlp/intent-parser.d.ts +0 -152
- package/dist/nlp/intent-parser.d.ts.map +0 -1
- package/dist/nlp/intent-parser.js +0 -744
- package/dist/nlp/intent-parser.js.map +0 -1
- package/dist/plugins/plugin-manager.d.ts +0 -120
- package/dist/plugins/plugin-manager.d.ts.map +0 -1
- package/dist/plugins/plugin-manager.js +0 -595
- package/dist/plugins/plugin-manager.js.map +0 -1
- package/dist/types/index.d.ts +0 -224
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/backup-rollback-manager.d.ts +0 -72
- package/dist/utils/backup-rollback-manager.d.ts.map +0 -1
- package/dist/utils/backup-rollback-manager.js +0 -289
- package/dist/utils/backup-rollback-manager.js.map +0 -1
- package/dist/utils/claude-config-installer.d.ts +0 -98
- package/dist/utils/claude-config-installer.d.ts.map +0 -1
- package/dist/utils/claude-config-installer.js +0 -678
- package/dist/utils/claude-config-installer.js.map +0 -1
- package/dist/utils/config-manager.d.ts +0 -73
- package/dist/utils/config-manager.d.ts.map +0 -1
- package/dist/utils/config-manager.js +0 -339
- package/dist/utils/config-manager.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -46
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -169
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -25
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -105
- package/dist/utils/logger.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
|
@@ -189,11 +189,11 @@ class AlignmentDriftDetector {
|
|
|
189
189
|
return history.entries
|
|
190
190
|
.filter(
|
|
191
191
|
(entry: AlignmentHistoryEntry) =>
|
|
192
|
-
new Date(entry.timestamp) >= cutoffDate
|
|
192
|
+
new Date(entry.timestamp) >= cutoffDate
|
|
193
193
|
)
|
|
194
194
|
.sort(
|
|
195
195
|
(a: AlignmentHistoryEntry, b: AlignmentHistoryEntry) =>
|
|
196
|
-
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
196
|
+
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
197
197
|
);
|
|
198
198
|
}
|
|
199
199
|
|
|
@@ -205,7 +205,7 @@ class AlignmentDriftDetector {
|
|
|
205
205
|
async generateDebtReport(
|
|
206
206
|
days: number = 7,
|
|
207
207
|
sessionId?: string,
|
|
208
|
-
outputFile?: string
|
|
208
|
+
outputFile?: string
|
|
209
209
|
): Promise<AlignmentDebtReport> {
|
|
210
210
|
await this.initialize();
|
|
211
211
|
|
|
@@ -286,13 +286,13 @@ class AlignmentDriftDetector {
|
|
|
286
286
|
// Calculate total violations
|
|
287
287
|
const totalViolations = Object.values(dimensionAnalysis).reduce(
|
|
288
288
|
(sum, dim) => sum + dim.exceedances,
|
|
289
|
-
0
|
|
289
|
+
0
|
|
290
290
|
);
|
|
291
291
|
|
|
292
292
|
// Generate recommendations
|
|
293
293
|
const recommendations = this.generateDebtRecommendations(
|
|
294
294
|
dimensionAnalysis,
|
|
295
|
-
trend
|
|
295
|
+
trend
|
|
296
296
|
);
|
|
297
297
|
|
|
298
298
|
const report: AlignmentDebtReport = {
|
|
@@ -326,7 +326,7 @@ class AlignmentDriftDetector {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
private async collectMetrics(
|
|
329
|
-
sessionId?: string
|
|
329
|
+
sessionId?: string
|
|
330
330
|
): Promise<AlignmentDriftMetrics> {
|
|
331
331
|
const sessionMetricsFile = sessionId
|
|
332
332
|
? path.join(this.dataDir, 'sessions', `${sessionId}.json`)
|
|
@@ -359,23 +359,23 @@ class AlignmentDriftDetector {
|
|
|
359
359
|
private calculateScore(metrics: AlignmentDriftMetrics): number {
|
|
360
360
|
const normalizedPolicyViolation = Math.min(
|
|
361
361
|
metrics.policyViolationRate / this.thresholds.policyViolation,
|
|
362
|
-
2
|
|
362
|
+
2
|
|
363
363
|
);
|
|
364
364
|
const normalizedIntentGap = Math.min(
|
|
365
365
|
metrics.intentOutcomeGap / this.thresholds.intentOutcomeGap,
|
|
366
|
-
2
|
|
366
|
+
2
|
|
367
367
|
);
|
|
368
368
|
const normalizedEvaluatorDisagreement = Math.min(
|
|
369
369
|
metrics.evaluatorDisagreement / this.thresholds.evaluatorDisagreement,
|
|
370
|
-
2
|
|
370
|
+
2
|
|
371
371
|
);
|
|
372
372
|
const normalizedEscalationSuppression = Math.min(
|
|
373
373
|
metrics.escalationSuppression / this.thresholds.escalationSuppression,
|
|
374
|
-
2
|
|
374
|
+
2
|
|
375
375
|
);
|
|
376
376
|
const normalizedRewardHacking = Math.min(
|
|
377
377
|
metrics.rewardHacking / this.thresholds.rewardHacking,
|
|
378
|
-
2
|
|
378
|
+
2
|
|
379
379
|
);
|
|
380
380
|
|
|
381
381
|
const weights = {
|
|
@@ -408,7 +408,7 @@ class AlignmentDriftDetector {
|
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
private analyzeDimensions(
|
|
411
|
-
metrics: AlignmentDriftMetrics
|
|
411
|
+
metrics: AlignmentDriftMetrics
|
|
412
412
|
): AlignmentDimension[] {
|
|
413
413
|
return [
|
|
414
414
|
{
|
|
@@ -419,7 +419,7 @@ class AlignmentDriftDetector {
|
|
|
419
419
|
currentValue: metrics.policyViolationRate,
|
|
420
420
|
status: this.getDimensionStatus(
|
|
421
421
|
metrics.policyViolationRate,
|
|
422
|
-
this.thresholds.policyViolation
|
|
422
|
+
this.thresholds.policyViolation
|
|
423
423
|
),
|
|
424
424
|
},
|
|
425
425
|
{
|
|
@@ -430,7 +430,7 @@ class AlignmentDriftDetector {
|
|
|
430
430
|
currentValue: metrics.intentOutcomeGap,
|
|
431
431
|
status: this.getDimensionStatus(
|
|
432
432
|
metrics.intentOutcomeGap,
|
|
433
|
-
this.thresholds.intentOutcomeGap
|
|
433
|
+
this.thresholds.intentOutcomeGap
|
|
434
434
|
),
|
|
435
435
|
},
|
|
436
436
|
{
|
|
@@ -441,7 +441,7 @@ class AlignmentDriftDetector {
|
|
|
441
441
|
currentValue: metrics.evaluatorDisagreement,
|
|
442
442
|
status: this.getDimensionStatus(
|
|
443
443
|
metrics.evaluatorDisagreement,
|
|
444
|
-
this.thresholds.evaluatorDisagreement
|
|
444
|
+
this.thresholds.evaluatorDisagreement
|
|
445
445
|
),
|
|
446
446
|
},
|
|
447
447
|
{
|
|
@@ -452,7 +452,7 @@ class AlignmentDriftDetector {
|
|
|
452
452
|
currentValue: metrics.escalationSuppression,
|
|
453
453
|
status: this.getDimensionStatus(
|
|
454
454
|
metrics.escalationSuppression,
|
|
455
|
-
this.thresholds.escalationSuppression
|
|
455
|
+
this.thresholds.escalationSuppression
|
|
456
456
|
),
|
|
457
457
|
},
|
|
458
458
|
{
|
|
@@ -463,7 +463,7 @@ class AlignmentDriftDetector {
|
|
|
463
463
|
currentValue: metrics.rewardHacking,
|
|
464
464
|
status: this.getDimensionStatus(
|
|
465
465
|
metrics.rewardHacking,
|
|
466
|
-
this.thresholds.rewardHacking
|
|
466
|
+
this.thresholds.rewardHacking
|
|
467
467
|
),
|
|
468
468
|
},
|
|
469
469
|
];
|
|
@@ -471,7 +471,7 @@ class AlignmentDriftDetector {
|
|
|
471
471
|
|
|
472
472
|
private getDimensionStatus(
|
|
473
473
|
value: number,
|
|
474
|
-
threshold: number
|
|
474
|
+
threshold: number
|
|
475
475
|
): 'healthy' | 'warning' | 'critical' {
|
|
476
476
|
if (value <= threshold) {
|
|
477
477
|
return 'healthy';
|
|
@@ -495,39 +495,39 @@ class AlignmentDriftDetector {
|
|
|
495
495
|
|
|
496
496
|
private generateRecommendations(
|
|
497
497
|
dimensions: AlignmentDimension[],
|
|
498
|
-
status: string
|
|
498
|
+
status: string
|
|
499
499
|
): string[] {
|
|
500
500
|
const recommendations: string[] = [];
|
|
501
501
|
|
|
502
502
|
for (const dim of dimensions) {
|
|
503
503
|
if (dim.status === 'critical') {
|
|
504
504
|
recommendations.push(
|
|
505
|
-
`CRITICAL: ${dim.name} at ${this.formatValue(dim.currentValue, dim.key)} exceeds threshold (${this.formatValue(dim.threshold, dim.key)}). Immediate action required
|
|
505
|
+
`CRITICAL: ${dim.name} at ${this.formatValue(dim.currentValue, dim.key)} exceeds threshold (${this.formatValue(dim.threshold, dim.key)}). Immediate action required.`
|
|
506
506
|
);
|
|
507
507
|
} else if (dim.status === 'warning') {
|
|
508
508
|
recommendations.push(
|
|
509
|
-
`WARNING: ${dim.name} at ${this.formatValue(dim.currentValue, dim.key)} approaching threshold (${this.formatValue(dim.threshold, dim.key)}). Monitor closely
|
|
509
|
+
`WARNING: ${dim.name} at ${this.formatValue(dim.currentValue, dim.key)} approaching threshold (${this.formatValue(dim.threshold, dim.key)}). Monitor closely.`
|
|
510
510
|
);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
|
|
514
514
|
if (status === 'critical') {
|
|
515
515
|
recommendations.push(
|
|
516
|
-
'Consider pausing autonomous operations until alignment issues are resolved.'
|
|
516
|
+
'Consider pausing autonomous operations until alignment issues are resolved.'
|
|
517
517
|
);
|
|
518
518
|
recommendations.push('Schedule immediate review with Guardian role.');
|
|
519
519
|
} else if (status === 'warning') {
|
|
520
520
|
recommendations.push(
|
|
521
|
-
'Review recent agent decisions for potential alignment drift.'
|
|
521
|
+
'Review recent agent decisions for potential alignment drift.'
|
|
522
522
|
);
|
|
523
523
|
recommendations.push(
|
|
524
|
-
'Consider tightening constraints or adding checkpoints.'
|
|
524
|
+
'Consider tightening constraints or adding checkpoints.'
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
if (recommendations.length === 0) {
|
|
529
529
|
recommendations.push(
|
|
530
|
-
'All alignment metrics within acceptable thresholds.'
|
|
530
|
+
'All alignment metrics within acceptable thresholds.'
|
|
531
531
|
);
|
|
532
532
|
}
|
|
533
533
|
|
|
@@ -536,17 +536,17 @@ class AlignmentDriftDetector {
|
|
|
536
536
|
|
|
537
537
|
private generateDebtRecommendations(
|
|
538
538
|
dimensionAnalysis: AlignmentDebtReport['dimensionAnalysis'],
|
|
539
|
-
trend: 'improving' | 'stable' | 'degrading'
|
|
539
|
+
trend: 'improving' | 'stable' | 'degrading'
|
|
540
540
|
): string[] {
|
|
541
541
|
const recommendations: string[] = [];
|
|
542
542
|
|
|
543
543
|
if (trend === 'degrading') {
|
|
544
544
|
recommendations.push(
|
|
545
|
-
'Alignment score is degrading over time. Review recent changes to agent configurations.'
|
|
545
|
+
'Alignment score is degrading over time. Review recent changes to agent configurations.'
|
|
546
546
|
);
|
|
547
547
|
} else if (trend === 'improving') {
|
|
548
548
|
recommendations.push(
|
|
549
|
-
'Alignment score is improving. Continue current governance practices.'
|
|
549
|
+
'Alignment score is improving. Continue current governance practices.'
|
|
550
550
|
);
|
|
551
551
|
}
|
|
552
552
|
|
|
@@ -555,7 +555,7 @@ class AlignmentDriftDetector {
|
|
|
555
555
|
const friendlyName = this.getFriendlyDimensionName(key);
|
|
556
556
|
const entry = analysis as DimensionAnalysisEntry;
|
|
557
557
|
recommendations.push(
|
|
558
|
-
`${friendlyName}: ${entry.exceedances} threshold exceedance(s) detected. Average: ${entry.average.toFixed(3)}
|
|
558
|
+
`${friendlyName}: ${entry.exceedances} threshold exceedance(s) detected. Average: ${entry.average.toFixed(3)}`
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
561
|
}
|
|
@@ -615,7 +615,7 @@ function padRight(str: string, length: number): string {
|
|
|
615
615
|
}
|
|
616
616
|
|
|
617
617
|
function getStatusColor(
|
|
618
|
-
status: 'healthy' | 'warning' | 'critical'
|
|
618
|
+
status: 'healthy' | 'warning' | 'critical'
|
|
619
619
|
): (str: string) => string {
|
|
620
620
|
switch (status) {
|
|
621
621
|
case 'healthy':
|
|
@@ -694,7 +694,7 @@ Examples:
|
|
|
694
694
|
${chalk.green('wundr alignment score')} Get current alignment score
|
|
695
695
|
${chalk.green('wundr alignment history --days 7')} Show alignment history for past week
|
|
696
696
|
${chalk.green('wundr alignment dimensions')} Show breakdown by dimension
|
|
697
|
-
`)
|
|
697
|
+
`)
|
|
698
698
|
);
|
|
699
699
|
|
|
700
700
|
// Report subcommand
|
|
@@ -725,7 +725,7 @@ Examples:
|
|
|
725
725
|
.option(
|
|
726
726
|
'-f, --format <type>',
|
|
727
727
|
'Output format (table, json, chart)',
|
|
728
|
-
'table'
|
|
728
|
+
'table'
|
|
729
729
|
)
|
|
730
730
|
.action(async options => {
|
|
731
731
|
await showAlignmentHistory(options);
|
|
@@ -762,7 +762,7 @@ async function generateAlignmentReport(options: {
|
|
|
762
762
|
const report = await detector.generateDebtReport(
|
|
763
763
|
days,
|
|
764
764
|
options.session,
|
|
765
|
-
options.output
|
|
765
|
+
options.output
|
|
766
766
|
);
|
|
767
767
|
|
|
768
768
|
spinner.stop();
|
|
@@ -772,13 +772,13 @@ async function generateAlignmentReport(options: {
|
|
|
772
772
|
console.log(chalk.gray('='.repeat(70)));
|
|
773
773
|
console.log(
|
|
774
774
|
chalk.white('Generated: ') +
|
|
775
|
-
chalk.gray(new Date(report.generatedAt).toLocaleString())
|
|
775
|
+
chalk.gray(new Date(report.generatedAt).toLocaleString())
|
|
776
776
|
);
|
|
777
777
|
console.log(
|
|
778
778
|
chalk.white('Period: ') +
|
|
779
779
|
chalk.gray(
|
|
780
|
-
`${days} days (${new Date(report.period.start).toLocaleDateString()} - ${new Date(report.period.end).toLocaleDateString()})
|
|
781
|
-
)
|
|
780
|
+
`${days} days (${new Date(report.period.start).toLocaleDateString()} - ${new Date(report.period.end).toLocaleDateString()})`
|
|
781
|
+
)
|
|
782
782
|
);
|
|
783
783
|
|
|
784
784
|
if (options.session) {
|
|
@@ -790,24 +790,24 @@ async function generateAlignmentReport(options: {
|
|
|
790
790
|
console.log(chalk.cyan('Summary'));
|
|
791
791
|
console.log(
|
|
792
792
|
chalk.white('Average Score: ') +
|
|
793
|
-
formatScore(report.summary.averageScore)
|
|
793
|
+
formatScore(report.summary.averageScore)
|
|
794
794
|
);
|
|
795
795
|
console.log(
|
|
796
796
|
chalk.white('Lowest Score: ') +
|
|
797
|
-
formatScore(report.summary.lowestScore)
|
|
797
|
+
formatScore(report.summary.lowestScore)
|
|
798
798
|
);
|
|
799
799
|
console.log(
|
|
800
800
|
chalk.white('Highest Score: ') +
|
|
801
|
-
formatScore(report.summary.highestScore)
|
|
801
|
+
formatScore(report.summary.highestScore)
|
|
802
802
|
);
|
|
803
803
|
console.log(
|
|
804
|
-
chalk.white('Trend: ') + formatTrend(report.summary.trend)
|
|
804
|
+
chalk.white('Trend: ') + formatTrend(report.summary.trend)
|
|
805
805
|
);
|
|
806
806
|
console.log(
|
|
807
807
|
chalk.white('Total Violations: ') +
|
|
808
808
|
(report.summary.totalViolations > 0
|
|
809
809
|
? chalk.red(String(report.summary.totalViolations))
|
|
810
|
-
: chalk.green('0'))
|
|
810
|
+
: chalk.green('0'))
|
|
811
811
|
);
|
|
812
812
|
|
|
813
813
|
// Dimension analysis section
|
|
@@ -818,8 +818,8 @@ async function generateAlignmentReport(options: {
|
|
|
818
818
|
padRight('Dimension', 25) +
|
|
819
819
|
padRight('Average', 12) +
|
|
820
820
|
padRight('Max', 12) +
|
|
821
|
-
padRight('Exceedances', 12)
|
|
822
|
-
)
|
|
821
|
+
padRight('Exceedances', 12)
|
|
822
|
+
)
|
|
823
823
|
);
|
|
824
824
|
console.log(chalk.gray('-'.repeat(61)));
|
|
825
825
|
|
|
@@ -840,7 +840,7 @@ async function generateAlignmentReport(options: {
|
|
|
840
840
|
padRight(name, 25) +
|
|
841
841
|
padRight(formatDimensionValue(entry.average, key), 12) +
|
|
842
842
|
padRight(formatDimensionValue(entry.max, key), 12) +
|
|
843
|
-
exceedanceColor(padRight(String(entry.exceedances), 12))
|
|
843
|
+
exceedanceColor(padRight(String(entry.exceedances), 12))
|
|
844
844
|
);
|
|
845
845
|
}
|
|
846
846
|
|
|
@@ -856,13 +856,13 @@ async function generateAlignmentReport(options: {
|
|
|
856
856
|
chalk.white(` ${dimName}: `) +
|
|
857
857
|
chalk.red(formatDimensionValue(event.value, event.dimension)) +
|
|
858
858
|
chalk.gray(
|
|
859
|
-
` (threshold: ${formatDimensionValue(event.threshold, event.dimension)})
|
|
860
|
-
)
|
|
859
|
+
` (threshold: ${formatDimensionValue(event.threshold, event.dimension)})`
|
|
860
|
+
)
|
|
861
861
|
);
|
|
862
862
|
}
|
|
863
863
|
if (report.criticalEvents.length > 5) {
|
|
864
864
|
console.log(
|
|
865
|
-
chalk.gray(` ... and ${report.criticalEvents.length - 5} more`)
|
|
865
|
+
chalk.gray(` ... and ${report.criticalEvents.length - 5} more`)
|
|
866
866
|
);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
@@ -890,7 +890,7 @@ async function generateAlignmentReport(options: {
|
|
|
890
890
|
} catch (error) {
|
|
891
891
|
spinner.fail('Failed to generate alignment report');
|
|
892
892
|
console.error(
|
|
893
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
893
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
894
894
|
);
|
|
895
895
|
}
|
|
896
896
|
}
|
|
@@ -931,7 +931,7 @@ async function showAlignmentScore(options: {
|
|
|
931
931
|
|
|
932
932
|
const statusColor = getStatusColor(result.status);
|
|
933
933
|
console.log(
|
|
934
|
-
chalk.white('Status: ') + statusColor(getStatusIcon(result.status))
|
|
934
|
+
chalk.white('Status: ') + statusColor(getStatusIcon(result.status))
|
|
935
935
|
);
|
|
936
936
|
|
|
937
937
|
if (options.session) {
|
|
@@ -954,7 +954,7 @@ async function showAlignmentScore(options: {
|
|
|
954
954
|
console.log(
|
|
955
955
|
dimStatusColor(` ${icon} `) +
|
|
956
956
|
chalk.white(padRight(dim.name, 25)) +
|
|
957
|
-
dimStatusColor(formatDimensionValue(dim.currentValue, dim.key))
|
|
957
|
+
dimStatusColor(formatDimensionValue(dim.currentValue, dim.key))
|
|
958
958
|
);
|
|
959
959
|
}
|
|
960
960
|
|
|
@@ -963,7 +963,7 @@ async function showAlignmentScore(options: {
|
|
|
963
963
|
} catch (error) {
|
|
964
964
|
spinner.fail('Failed to get alignment score');
|
|
965
965
|
console.error(
|
|
966
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
966
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
967
967
|
);
|
|
968
968
|
}
|
|
969
969
|
}
|
|
@@ -993,8 +993,8 @@ async function showAlignmentHistory(options: {
|
|
|
993
993
|
entries: history,
|
|
994
994
|
},
|
|
995
995
|
null,
|
|
996
|
-
2
|
|
997
|
-
)
|
|
996
|
+
2
|
|
997
|
+
)
|
|
998
998
|
);
|
|
999
999
|
return;
|
|
1000
1000
|
}
|
|
@@ -1002,7 +1002,7 @@ async function showAlignmentHistory(options: {
|
|
|
1002
1002
|
console.log(chalk.cyan('\nAlignment History'));
|
|
1003
1003
|
console.log(chalk.gray('='.repeat(80)));
|
|
1004
1004
|
console.log(
|
|
1005
|
-
chalk.gray(`Showing last ${days} days (${history.length} entries)`)
|
|
1005
|
+
chalk.gray(`Showing last ${days} days (${history.length} entries)`)
|
|
1006
1006
|
);
|
|
1007
1007
|
|
|
1008
1008
|
if (history.length === 0) {
|
|
@@ -1023,8 +1023,8 @@ async function showAlignmentHistory(options: {
|
|
|
1023
1023
|
padRight('Score', 10) +
|
|
1024
1024
|
padRight('Status', 12) +
|
|
1025
1025
|
padRight('Session', 20) +
|
|
1026
|
-
padRight('Policy', 10)
|
|
1027
|
-
)
|
|
1026
|
+
padRight('Policy', 10)
|
|
1027
|
+
)
|
|
1028
1028
|
);
|
|
1029
1029
|
console.log(chalk.gray('-'.repeat(80)));
|
|
1030
1030
|
|
|
@@ -1037,7 +1037,7 @@ async function showAlignmentHistory(options: {
|
|
|
1037
1037
|
formatScore(entry.score).padEnd(19) + // Account for ANSI codes
|
|
1038
1038
|
statusColor(padRight(getStatusIcon(entry.status), 12)) +
|
|
1039
1039
|
chalk.gray(padRight(entry.sessionId || '-', 20)) +
|
|
1040
|
-
padRight(formatPercentage(entry.metrics.policyViolationRate), 10)
|
|
1040
|
+
padRight(formatPercentage(entry.metrics.policyViolationRate), 10)
|
|
1041
1041
|
);
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
@@ -1051,7 +1051,7 @@ async function showAlignmentHistory(options: {
|
|
|
1051
1051
|
} catch (error) {
|
|
1052
1052
|
spinner.fail('Failed to load alignment history');
|
|
1053
1053
|
console.error(
|
|
1054
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
1054
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
1055
1055
|
);
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
@@ -1099,8 +1099,8 @@ function displayHistoryChart(history: AlignmentHistoryEntry[]): void {
|
|
|
1099
1099
|
chalk.gray(
|
|
1100
1100
|
' ' +
|
|
1101
1101
|
'oldest'.padEnd(chartWidth / 2) +
|
|
1102
|
-
'newest'.padStart(chartWidth / 2)
|
|
1103
|
-
)
|
|
1102
|
+
'newest'.padStart(chartWidth / 2)
|
|
1103
|
+
)
|
|
1104
1104
|
);
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
@@ -1145,7 +1145,7 @@ async function showDimensionBreakdown(options: {
|
|
|
1145
1145
|
const barWidth = 40;
|
|
1146
1146
|
const valueRatio = Math.min(dim.currentValue / (dim.threshold * 3), 1);
|
|
1147
1147
|
const thresholdPos = Math.floor(
|
|
1148
|
-
(dim.threshold / (dim.threshold * 3)) * barWidth
|
|
1148
|
+
(dim.threshold / (dim.threshold * 3)) * barWidth
|
|
1149
1149
|
);
|
|
1150
1150
|
const valuePos = Math.floor(valueRatio * barWidth);
|
|
1151
1151
|
|
|
@@ -1162,10 +1162,10 @@ async function showDimensionBreakdown(options: {
|
|
|
1162
1162
|
|
|
1163
1163
|
console.log(` [${bar}]`);
|
|
1164
1164
|
console.log(
|
|
1165
|
-
` ${chalk.white('Current:')} ${statusColor(formatDimensionValue(dim.currentValue, dim.key))} ${chalk.white('Threshold:')} ${chalk.yellow(formatDimensionValue(dim.threshold, dim.key))}
|
|
1165
|
+
` ${chalk.white('Current:')} ${statusColor(formatDimensionValue(dim.currentValue, dim.key))} ${chalk.white('Threshold:')} ${chalk.yellow(formatDimensionValue(dim.threshold, dim.key))}`
|
|
1166
1166
|
);
|
|
1167
1167
|
console.log(
|
|
1168
|
-
` ${chalk.white('Status:')} ${statusColor(dim.status.toUpperCase())}
|
|
1168
|
+
` ${chalk.white('Status:')} ${statusColor(dim.status.toUpperCase())}`
|
|
1169
1169
|
);
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
@@ -1174,28 +1174,28 @@ async function showDimensionBreakdown(options: {
|
|
|
1174
1174
|
console.log(chalk.cyan('Threshold Reference'));
|
|
1175
1175
|
console.log(
|
|
1176
1176
|
chalk.gray(
|
|
1177
|
-
` Policy Violation: >${formatPercentage(thresholds.policyViolation)} daily violations
|
|
1178
|
-
)
|
|
1177
|
+
` Policy Violation: >${formatPercentage(thresholds.policyViolation)} daily violations`
|
|
1178
|
+
)
|
|
1179
1179
|
);
|
|
1180
1180
|
console.log(
|
|
1181
1181
|
chalk.gray(
|
|
1182
|
-
` Intent-Outcome Gap: >${formatPercentage(thresholds.intentOutcomeGap)} divergence
|
|
1183
|
-
)
|
|
1182
|
+
` Intent-Outcome Gap: >${formatPercentage(thresholds.intentOutcomeGap)} divergence`
|
|
1183
|
+
)
|
|
1184
1184
|
);
|
|
1185
1185
|
console.log(
|
|
1186
1186
|
chalk.gray(
|
|
1187
|
-
` Evaluator Disagreement:>${formatPercentage(thresholds.evaluatorDisagreement)} monthly overrides
|
|
1188
|
-
)
|
|
1187
|
+
` Evaluator Disagreement:>${formatPercentage(thresholds.evaluatorDisagreement)} monthly overrides`
|
|
1188
|
+
)
|
|
1189
1189
|
);
|
|
1190
1190
|
console.log(
|
|
1191
1191
|
chalk.gray(
|
|
1192
|
-
` Escalation Suppression:>${formatPercentage(thresholds.escalationSuppression)} drop from baseline
|
|
1193
|
-
)
|
|
1192
|
+
` Escalation Suppression:>${formatPercentage(thresholds.escalationSuppression)} drop from baseline`
|
|
1193
|
+
)
|
|
1194
1194
|
);
|
|
1195
1195
|
console.log(
|
|
1196
1196
|
chalk.gray(
|
|
1197
|
-
` Reward Hacking: >${thresholds.rewardHacking} instances/month
|
|
1198
|
-
)
|
|
1197
|
+
` Reward Hacking: >${thresholds.rewardHacking} instances/month`
|
|
1198
|
+
)
|
|
1199
1199
|
);
|
|
1200
1200
|
|
|
1201
1201
|
console.log(chalk.gray('='.repeat(90)));
|
|
@@ -1203,7 +1203,7 @@ async function showDimensionBreakdown(options: {
|
|
|
1203
1203
|
} catch (error) {
|
|
1204
1204
|
spinner.fail('Failed to load dimension breakdown');
|
|
1205
1205
|
console.error(
|
|
1206
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
1206
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
1207
1207
|
);
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|