specweave 0.28.67 → 0.29.0
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/CLAUDE.md +3 -2
- package/README.md +19 -2
- package/dist/src/cli/commands/discrepancies.d.ts +89 -0
- package/dist/src/cli/commands/discrepancies.d.ts.map +1 -0
- package/dist/src/cli/commands/discrepancies.js +385 -0
- package/dist/src/cli/commands/discrepancies.js.map +1 -0
- package/dist/src/cli/commands/notifications.d.ts +70 -0
- package/dist/src/cli/commands/notifications.d.ts.map +1 -0
- package/dist/src/cli/commands/notifications.js +236 -0
- package/dist/src/cli/commands/notifications.js.map +1 -0
- package/dist/src/cli/commands/sync-logs.d.ts +54 -0
- package/dist/src/cli/commands/sync-logs.d.ts.map +1 -0
- package/dist/src/cli/commands/sync-logs.js +240 -0
- package/dist/src/cli/commands/sync-logs.js.map +1 -0
- package/dist/src/cli/commands/sync-monitor.d.ts +42 -0
- package/dist/src/cli/commands/sync-monitor.d.ts.map +1 -0
- package/dist/src/cli/commands/sync-monitor.js +191 -0
- package/dist/src/cli/commands/sync-monitor.js.map +1 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.d.ts +45 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.js +431 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.js.map +1 -0
- package/dist/src/cli/helpers/init/index.d.ts +1 -0
- package/dist/src/cli/helpers/init/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/index.js +2 -0
- package/dist/src/cli/helpers/init/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +14 -5
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/workers/brownfield-worker.d.ts +66 -0
- package/dist/src/cli/workers/brownfield-worker.d.ts.map +1 -0
- package/dist/src/cli/workers/brownfield-worker.js +417 -0
- package/dist/src/cli/workers/brownfield-worker.js.map +1 -0
- package/dist/src/core/background/brownfield-launcher.d.ts +86 -0
- package/dist/src/core/background/brownfield-launcher.d.ts.map +1 -0
- package/dist/src/core/background/brownfield-launcher.js +295 -0
- package/dist/src/core/background/brownfield-launcher.js.map +1 -0
- package/dist/src/core/background/index.d.ts +2 -0
- package/dist/src/core/background/index.d.ts.map +1 -1
- package/dist/src/core/background/index.js +2 -0
- package/dist/src/core/background/index.js.map +1 -1
- package/dist/src/core/background/types.d.ts +23 -2
- package/dist/src/core/background/types.d.ts.map +1 -1
- package/dist/src/core/config/index.d.ts +1 -0
- package/dist/src/core/config/index.d.ts.map +1 -1
- package/dist/src/core/config/index.js +1 -0
- package/dist/src/core/config/index.js.map +1 -1
- package/dist/src/core/config/types.d.ts +6 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/dashboard/dashboard-data.d.ts +156 -0
- package/dist/src/core/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/src/core/dashboard/dashboard-data.js +191 -0
- package/dist/src/core/dashboard/dashboard-data.js.map +1 -0
- package/dist/src/core/dashboard/index.d.ts +9 -0
- package/dist/src/core/dashboard/index.d.ts.map +1 -0
- package/dist/src/core/dashboard/index.js +9 -0
- package/dist/src/core/dashboard/index.js.map +1 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts +77 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts.map +1 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js +286 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js.map +1 -0
- package/dist/src/core/discrepancy/analyzers/index.d.ts +8 -0
- package/dist/src/core/discrepancy/analyzers/index.d.ts.map +1 -0
- package/dist/src/core/discrepancy/analyzers/index.js +8 -0
- package/dist/src/core/discrepancy/analyzers/index.js.map +1 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts +96 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts.map +1 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js +247 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js.map +1 -0
- package/dist/src/core/discrepancy/brownfield-manager.d.ts +88 -0
- package/dist/src/core/discrepancy/brownfield-manager.d.ts.map +1 -0
- package/dist/src/core/discrepancy/brownfield-manager.js +520 -0
- package/dist/src/core/discrepancy/brownfield-manager.js.map +1 -0
- package/dist/src/core/discrepancy/brownfield-types.d.ts +174 -0
- package/dist/src/core/discrepancy/brownfield-types.d.ts.map +1 -0
- package/dist/src/core/discrepancy/brownfield-types.js +11 -0
- package/dist/src/core/discrepancy/brownfield-types.js.map +1 -0
- package/dist/src/core/discrepancy/detector.d.ts +92 -0
- package/dist/src/core/discrepancy/detector.d.ts.map +1 -0
- package/dist/src/core/discrepancy/detector.js +346 -0
- package/dist/src/core/discrepancy/detector.js.map +1 -0
- package/dist/src/core/discrepancy/increment-generator.d.ts +51 -0
- package/dist/src/core/discrepancy/increment-generator.d.ts.map +1 -0
- package/dist/src/core/discrepancy/increment-generator.js +234 -0
- package/dist/src/core/discrepancy/increment-generator.js.map +1 -0
- package/dist/src/core/discrepancy/index.d.ts +18 -0
- package/dist/src/core/discrepancy/index.d.ts.map +1 -0
- package/dist/src/core/discrepancy/index.js +24 -0
- package/dist/src/core/discrepancy/index.js.map +1 -0
- package/dist/src/core/discrepancy/severity-classifier.d.ts +81 -0
- package/dist/src/core/discrepancy/severity-classifier.d.ts.map +1 -0
- package/dist/src/core/discrepancy/severity-classifier.js +289 -0
- package/dist/src/core/discrepancy/severity-classifier.js.map +1 -0
- package/dist/src/core/discrepancy/spec-parser.d.ts +74 -0
- package/dist/src/core/discrepancy/spec-parser.d.ts.map +1 -0
- package/dist/src/core/discrepancy/spec-parser.js +213 -0
- package/dist/src/core/discrepancy/spec-parser.js.map +1 -0
- package/dist/src/core/discrepancy/update-recommender.d.ts +77 -0
- package/dist/src/core/discrepancy/update-recommender.d.ts.map +1 -0
- package/dist/src/core/discrepancy/update-recommender.js +323 -0
- package/dist/src/core/discrepancy/update-recommender.js.map +1 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -16
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +31 -112
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/logs/index.d.ts +10 -0
- package/dist/src/core/logs/index.d.ts.map +1 -0
- package/dist/src/core/logs/index.js +10 -0
- package/dist/src/core/logs/index.js.map +1 -0
- package/dist/src/core/logs/log-aggregator.d.ts +130 -0
- package/dist/src/core/logs/log-aggregator.d.ts.map +1 -0
- package/dist/src/core/logs/log-aggregator.js +206 -0
- package/dist/src/core/logs/log-aggregator.js.map +1 -0
- package/dist/src/core/logs/log-exporter.d.ts +81 -0
- package/dist/src/core/logs/log-exporter.d.ts.map +1 -0
- package/dist/src/core/logs/log-exporter.js +141 -0
- package/dist/src/core/logs/log-exporter.js.map +1 -0
- package/dist/src/core/notifications/command-integration.d.ts +82 -0
- package/dist/src/core/notifications/command-integration.d.ts.map +1 -0
- package/dist/src/core/notifications/command-integration.js +80 -0
- package/dist/src/core/notifications/command-integration.js.map +1 -0
- package/dist/src/core/notifications/index.d.ts +12 -0
- package/dist/src/core/notifications/index.d.ts.map +1 -0
- package/dist/src/core/notifications/index.js +12 -0
- package/dist/src/core/notifications/index.js.map +1 -0
- package/dist/src/core/notifications/notification-display.d.ts +70 -0
- package/dist/src/core/notifications/notification-display.d.ts.map +1 -0
- package/dist/src/core/notifications/notification-display.js +177 -0
- package/dist/src/core/notifications/notification-display.js.map +1 -0
- package/dist/src/core/notifications/notification-manager.d.ts +126 -0
- package/dist/src/core/notifications/notification-manager.d.ts.map +1 -0
- package/dist/src/core/notifications/notification-manager.js +287 -0
- package/dist/src/core/notifications/notification-manager.js.map +1 -0
- package/dist/src/core/notifications/notification-types.d.ts +159 -0
- package/dist/src/core/notifications/notification-types.d.ts.map +1 -0
- package/dist/src/core/notifications/notification-types.js +93 -0
- package/dist/src/core/notifications/notification-types.js.map +1 -0
- package/dist/src/core/scheduler/index.d.ts +11 -0
- package/dist/src/core/scheduler/index.d.ts.map +1 -0
- package/dist/src/core/scheduler/index.js +11 -0
- package/dist/src/core/scheduler/index.js.map +1 -0
- package/dist/src/core/scheduler/job-scheduler.d.ts +179 -0
- package/dist/src/core/scheduler/job-scheduler.d.ts.map +1 -0
- package/dist/src/core/scheduler/job-scheduler.js +282 -0
- package/dist/src/core/scheduler/job-scheduler.js.map +1 -0
- package/dist/src/core/scheduler/schedule-persistence.d.ts +83 -0
- package/dist/src/core/scheduler/schedule-persistence.d.ts.map +1 -0
- package/dist/src/core/scheduler/schedule-persistence.js +180 -0
- package/dist/src/core/scheduler/schedule-persistence.js.map +1 -0
- package/dist/src/core/scheduler/scheduled-job.d.ts +188 -0
- package/dist/src/core/scheduler/scheduled-job.d.ts.map +1 -0
- package/dist/src/core/scheduler/scheduled-job.js +182 -0
- package/dist/src/core/scheduler/scheduled-job.js.map +1 -0
- package/dist/src/core/sync/permission-enforcer.d.ts +206 -0
- package/dist/src/core/sync/permission-enforcer.d.ts.map +1 -0
- package/dist/src/core/sync/permission-enforcer.js +268 -0
- package/dist/src/core/sync/permission-enforcer.js.map +1 -0
- package/dist/src/core/sync/sync-audit-logger.d.ts +217 -0
- package/dist/src/core/sync/sync-audit-logger.d.ts.map +1 -0
- package/dist/src/core/sync/sync-audit-logger.js +327 -0
- package/dist/src/core/sync/sync-audit-logger.js.map +1 -0
- package/dist/src/core/sync/sync-interceptor.d.ts +190 -0
- package/dist/src/core/sync/sync-interceptor.d.ts.map +1 -0
- package/dist/src/core/sync/sync-interceptor.js +224 -0
- package/dist/src/core/sync/sync-interceptor.js.map +1 -0
- package/dist/src/core/types/increment-metadata.d.ts +5 -2
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/sync-config.d.ts +267 -0
- package/dist/src/core/types/sync-config.d.ts.map +1 -0
- package/dist/src/core/types/sync-config.js +304 -0
- package/dist/src/core/types/sync-config.js.map +1 -0
- package/dist/src/hooks/index.d.ts +11 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/index.js +11 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/platform.d.ts +125 -0
- package/dist/src/hooks/platform.d.ts.map +1 -0
- package/dist/src/hooks/platform.js +325 -0
- package/dist/src/hooks/platform.js.map +1 -0
- package/dist/src/hooks/processor.d.ts +20 -0
- package/dist/src/hooks/processor.d.ts.map +1 -0
- package/dist/src/hooks/processor.js +317 -0
- package/dist/src/hooks/processor.js.map +1 -0
- package/dist/src/hooks/scheduler-startup.d.ts +19 -0
- package/dist/src/hooks/scheduler-startup.d.ts.map +1 -0
- package/dist/src/hooks/scheduler-startup.js +92 -0
- package/dist/src/hooks/scheduler-startup.js.map +1 -0
- package/dist/src/hooks/session-start.d.ts +16 -0
- package/dist/src/hooks/session-start.d.ts.map +1 -0
- package/dist/src/hooks/session-start.js +92 -0
- package/dist/src/hooks/session-start.js.map +1 -0
- package/dist/src/importers/duplicate-detector.d.ts +13 -2
- package/dist/src/importers/duplicate-detector.d.ts.map +1 -1
- package/dist/src/importers/duplicate-detector.js +21 -2
- package/dist/src/importers/duplicate-detector.js.map +1 -1
- package/dist/src/importers/item-converter.d.ts +41 -2
- package/dist/src/importers/item-converter.d.ts.map +1 -1
- package/dist/src/importers/item-converter.js +231 -45
- package/dist/src/importers/item-converter.js.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.d.ts +7 -0
- package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.js +30 -4
- package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
- package/dist/src/sync/ado-sync-wrapper.d.ts +137 -0
- package/dist/src/sync/ado-sync-wrapper.d.ts.map +1 -0
- package/dist/src/sync/ado-sync-wrapper.js +148 -0
- package/dist/src/sync/ado-sync-wrapper.js.map +1 -0
- package/dist/src/sync/github-sync-wrapper.d.ts +195 -0
- package/dist/src/sync/github-sync-wrapper.d.ts.map +1 -0
- package/dist/src/sync/github-sync-wrapper.js +220 -0
- package/dist/src/sync/github-sync-wrapper.js.map +1 -0
- package/dist/src/sync/jira-sync-wrapper.d.ts +155 -0
- package/dist/src/sync/jira-sync-wrapper.d.ts.map +1 -0
- package/dist/src/sync/jira-sync-wrapper.js +175 -0
- package/dist/src/sync/jira-sync-wrapper.js.map +1 -0
- package/dist/src/utils/feature-id-derivation.d.ts +58 -0
- package/dist/src/utils/feature-id-derivation.d.ts.map +1 -0
- package/dist/src/utils/feature-id-derivation.js +77 -0
- package/dist/src/utils/feature-id-derivation.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/commands/specweave-discrepancies.md +141 -0
- package/plugins/specweave/commands/specweave-discrepancy-to-increment.md +160 -0
- package/plugins/specweave/commands/specweave-jobs.md +45 -2
- package/plugins/specweave/commands/specweave-notifications.md +92 -0
- package/plugins/specweave/commands/specweave-sync-logs.md +131 -0
- package/plugins/specweave/commands/specweave-sync-monitor.md +57 -0
- package/plugins/specweave/hooks/hooks.json +3 -3
- package/plugins/specweave/hooks/lib/scheduler-startup.sh +72 -0
- package/plugins/specweave/hooks/universal/dispatcher.mjs +246 -0
- package/plugins/specweave/hooks/universal/session-start.cmd +16 -0
- package/plugins/specweave/hooks/universal/session-start.ps1 +16 -0
- package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +14 -5
- package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +5 -2
- package/plugins/specweave/skills/discrepancy-viewer.md +154 -0
- package/plugins/specweave-ado/lib/ado-project-detector.js +11 -5
- package/plugins/specweave-ado/lib/ado-project-detector.ts +16 -5
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +34 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +51 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature ID Derivation Utility
|
|
3
|
+
*
|
|
4
|
+
* Derives feature ID from increment ID using the 1:1 mapping principle:
|
|
5
|
+
* - Each increment maps to exactly one feature folder
|
|
6
|
+
* - Feature ID = FS-{increment_number}
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* deriveFeatureId('0081-ado-repo-cloning') → 'FS-081'
|
|
10
|
+
* deriveFeatureId('0100-some-feature') → 'FS-100'
|
|
11
|
+
* deriveFeatureId('1000-future-feature') → 'FS-1000'
|
|
12
|
+
*
|
|
13
|
+
* @see ADR-0140 for the decision rationale
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Derive feature ID from increment ID
|
|
17
|
+
*
|
|
18
|
+
* The feature ID is derived directly from the increment number:
|
|
19
|
+
* - Extract leading digits from increment ID
|
|
20
|
+
* - Format as FS-XXX (minimum 3 digits, more if needed)
|
|
21
|
+
*
|
|
22
|
+
* This eliminates the need to store feature_id in metadata.json,
|
|
23
|
+
* as it's 100% derivable from the increment ID.
|
|
24
|
+
*
|
|
25
|
+
* @param incrementId - Increment ID (e.g., "0081-ado-repo-cloning")
|
|
26
|
+
* @returns Feature ID (e.g., "FS-081")
|
|
27
|
+
* @throws Error if increment ID format is invalid
|
|
28
|
+
*/
|
|
29
|
+
export function deriveFeatureId(incrementId) {
|
|
30
|
+
const match = incrementId.match(/^(\d+)/);
|
|
31
|
+
if (!match) {
|
|
32
|
+
throw new Error(`Invalid increment ID format: ${incrementId}. Expected format: NNNN-name`);
|
|
33
|
+
}
|
|
34
|
+
const num = parseInt(match[1], 10);
|
|
35
|
+
// padStart(3, '0') ensures minimum 3 digits (FS-001 to FS-999)
|
|
36
|
+
// Numbers 1000+ naturally have 4+ digits (FS-1000, FS-1001, etc.)
|
|
37
|
+
return `FS-${String(num).padStart(3, '0')}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Extract increment number from increment ID
|
|
41
|
+
*
|
|
42
|
+
* @param incrementId - Increment ID (e.g., "0081-ado-repo-cloning")
|
|
43
|
+
* @returns Increment number (e.g., 81)
|
|
44
|
+
* @throws Error if increment ID format is invalid
|
|
45
|
+
*/
|
|
46
|
+
export function extractIncrementNumber(incrementId) {
|
|
47
|
+
const match = incrementId.match(/^(\d+)/);
|
|
48
|
+
if (!match) {
|
|
49
|
+
throw new Error(`Invalid increment ID format: ${incrementId}. Expected format: NNNN-name`);
|
|
50
|
+
}
|
|
51
|
+
return parseInt(match[1], 10);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Validate feature ID format
|
|
55
|
+
*
|
|
56
|
+
* Valid formats:
|
|
57
|
+
* - FS-XXX (internal, 3+ digits)
|
|
58
|
+
* - FS-XXXE (external, 3+ digits with E suffix)
|
|
59
|
+
*
|
|
60
|
+
* @param featureId - Feature ID to validate
|
|
61
|
+
* @returns true if valid, false otherwise
|
|
62
|
+
*/
|
|
63
|
+
export function isValidFeatureId(featureId) {
|
|
64
|
+
return /^FS-\d{3,}E?$/.test(featureId);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Check if feature ID is external (imported)
|
|
68
|
+
*
|
|
69
|
+
* External features have an 'E' suffix: FS-042E
|
|
70
|
+
*
|
|
71
|
+
* @param featureId - Feature ID to check
|
|
72
|
+
* @returns true if external, false if internal
|
|
73
|
+
*/
|
|
74
|
+
export function isExternalFeatureId(featureId) {
|
|
75
|
+
return featureId.endsWith('E');
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=feature-id-derivation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-id-derivation.js","sourceRoot":"","sources":["../../../src/utils/feature-id-derivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAAC,WAAmB;IACjD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAgC,WAAW,8BAA8B,CAAC,CAAC;IAC7F,CAAC;IAED,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnC,+DAA+D;IAC/D,kEAAkE;IAClE,OAAO,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAgC,WAAW,8BAA8B,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specweave",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Spec-driven development framework for Claude Code. AI-native workflow with living documentation, intelligent agents, and multilingual support (9 languages). Enterprise-grade traceability with permanent specs and temporary increments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Discrepancies Command
|
|
2
|
+
|
|
3
|
+
View and manage documentation discrepancies. Supports two modes:
|
|
4
|
+
1. **Code-to-Spec**: Real-time discrepancies between code and specs
|
|
5
|
+
2. **Brownfield**: Documentation gaps detected by brownfield analysis
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Brownfield discrepancies (documentation gaps)
|
|
11
|
+
/specweave:discrepancies # List pending brownfield discrepancies
|
|
12
|
+
/specweave:discrepancies --module payment # Filter by module name
|
|
13
|
+
/specweave:discrepancies --type missing-docs # Filter by type
|
|
14
|
+
/specweave:discrepancies --priority critical # Filter by priority
|
|
15
|
+
/specweave:discrepancies show DISC-0001 # View details
|
|
16
|
+
/specweave:discrepancies ignore DISC-0001 "False positive" # Ignore with reason
|
|
17
|
+
|
|
18
|
+
# Code-to-spec discrepancies (legacy)
|
|
19
|
+
/specweave:discrepancies --check # Run code-spec check now
|
|
20
|
+
/specweave:discrepancies --severity major # Filter by severity
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Arguments
|
|
24
|
+
|
|
25
|
+
**Brownfield mode (default)**:
|
|
26
|
+
- `--module <name>`: Filter by module name (e.g., "payment-service")
|
|
27
|
+
- `--type <type>`: Filter by type: `missing-docs`, `stale-docs`, `knowledge-gap`, `orphan-doc`, `missing-adr`
|
|
28
|
+
- `--priority <level>`: Filter by priority: `critical`, `high`, `medium`, `low`
|
|
29
|
+
- `--status <status>`: Filter by status: `pending`, `in-progress`, `resolved`, `ignored`
|
|
30
|
+
|
|
31
|
+
**Code-to-spec mode**:
|
|
32
|
+
- `--check`: Run discrepancy detection now
|
|
33
|
+
- `--severity <level>`: Filter by severity: `trivial`, `minor`, `major`, `breaking`
|
|
34
|
+
|
|
35
|
+
**Common**:
|
|
36
|
+
- `--json`: Output as JSON for scripting
|
|
37
|
+
|
|
38
|
+
## Subcommands
|
|
39
|
+
|
|
40
|
+
### list (default)
|
|
41
|
+
|
|
42
|
+
Lists detected discrepancies with severity, type, and description.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
🔍 DETECTED DISCREPANCIES (5)
|
|
46
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
+
|
|
48
|
+
DISC-0001 ❌ BREAKING api-route POST /api/users removed
|
|
49
|
+
DISC-0002 ⚠️ MAJOR function-signature getUserById params changed
|
|
50
|
+
DISC-0003 ⚠️ MINOR api-route GET /api/orders path changed
|
|
51
|
+
DISC-0004 ✅ TRIVIAL type-definition User type updated
|
|
52
|
+
DISC-0005 ⚠️ MAJOR api-route New DELETE /api/users/:id
|
|
53
|
+
|
|
54
|
+
Use '/specweave:discrepancies show <id>' to view details
|
|
55
|
+
Use '/specweave:discrepancies accept <id>' to apply patch
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### show <id>
|
|
59
|
+
|
|
60
|
+
Shows full discrepancy details with recommended action and patch.
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
🔍 DISCREPANCY DETAILS
|
|
64
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
|
|
66
|
+
ID: DISC-0002
|
|
67
|
+
Type: function-signature
|
|
68
|
+
Category: modified
|
|
69
|
+
Severity: ⚠️ major
|
|
70
|
+
Risk: medium
|
|
71
|
+
|
|
72
|
+
Spec Value: getUserById(id: string): User
|
|
73
|
+
Code Value: getUserById(id: string, options?: Options): User | null
|
|
74
|
+
|
|
75
|
+
Spec File: docs/api.md:45
|
|
76
|
+
Code File: src/services/user.ts:123
|
|
77
|
+
|
|
78
|
+
Description: Function signature has changed from documented version.
|
|
79
|
+
Code is the source of truth - specs should be updated.
|
|
80
|
+
|
|
81
|
+
Recommended: 👀 review-required
|
|
82
|
+
Patch Available: Yes
|
|
83
|
+
|
|
84
|
+
Use '/specweave:discrepancies accept DISC-0002' to apply patch
|
|
85
|
+
Use '/specweave:discrepancies dismiss DISC-0002' to mark intentional
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### check
|
|
89
|
+
|
|
90
|
+
Run discrepancy detection immediately.
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
🔍 Running discrepancy check...
|
|
94
|
+
|
|
95
|
+
Analyzing:
|
|
96
|
+
✓ TypeScript functions: 156 exported
|
|
97
|
+
✓ Type definitions: 89 exported
|
|
98
|
+
✓ API routes: 34 detected
|
|
99
|
+
|
|
100
|
+
Comparing against specs:
|
|
101
|
+
✓ Parsed 12 spec files
|
|
102
|
+
|
|
103
|
+
Results:
|
|
104
|
+
Found 5 discrepancies
|
|
105
|
+
- Breaking: 1
|
|
106
|
+
- Major: 2
|
|
107
|
+
- Minor: 1
|
|
108
|
+
- Trivial: 1
|
|
109
|
+
|
|
110
|
+
Use '/specweave:discrepancies' to view list
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### accept <id>
|
|
114
|
+
|
|
115
|
+
Apply the recommended patch to update specs.
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
🔧 Applying patch for DISC-0002...
|
|
119
|
+
|
|
120
|
+
File: docs/api.md
|
|
121
|
+
Line: 45
|
|
122
|
+
Change: getUserById(id: string): User
|
|
123
|
+
→ getUserById(id: string, options?: Options): User | null
|
|
124
|
+
|
|
125
|
+
✅ Patch applied successfully
|
|
126
|
+
Remaining: 4 discrepancies
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### dismiss <id>
|
|
130
|
+
|
|
131
|
+
Mark a discrepancy as intentional (won't be flagged again).
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
✅ Dismissed DISC-0002 (marked as intentional)
|
|
135
|
+
Remaining: 4 discrepancies
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Related
|
|
139
|
+
|
|
140
|
+
- `/specweave:sync-monitor`: Dashboard showing discrepancy count
|
|
141
|
+
- `/specweave:notifications`: View discrepancy notifications
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Discrepancy to Increment Command
|
|
2
|
+
|
|
3
|
+
Convert one or more brownfield discrepancies into a new increment for systematic documentation improvement.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
/specweave:discrepancy-to-increment DISC-0001
|
|
9
|
+
/specweave:discrepancy-to-increment DISC-0001 DISC-0002 DISC-0003
|
|
10
|
+
/specweave:discrepancy-to-increment --module payment-service
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Arguments
|
|
14
|
+
|
|
15
|
+
- `<discrepancy-ids>`: One or more discrepancy IDs to convert (e.g., DISC-0001 DISC-0002)
|
|
16
|
+
- `--module <name>`: Convert all pending discrepancies for a specific module
|
|
17
|
+
- `--type <type>`: Convert all discrepancies of a specific type
|
|
18
|
+
- `--priority <level>`: Convert all discrepancies at or above a priority level
|
|
19
|
+
- `--dry-run`: Preview what would be created without making changes
|
|
20
|
+
|
|
21
|
+
## Process
|
|
22
|
+
|
|
23
|
+
1. **Read Discrepancy Details**
|
|
24
|
+
- Load specified discrepancies from `.specweave/discrepancies/`
|
|
25
|
+
- Verify all discrepancies exist and are in `pending` status
|
|
26
|
+
|
|
27
|
+
2. **Group by Module** (if multiple)
|
|
28
|
+
- If discrepancies span multiple modules, ask if user wants:
|
|
29
|
+
- Single increment covering all modules
|
|
30
|
+
- Separate increments per module
|
|
31
|
+
|
|
32
|
+
3. **Generate Increment Spec**
|
|
33
|
+
- Create increment with auto-generated ID
|
|
34
|
+
- Include discrepancy context in spec.md
|
|
35
|
+
- Generate user stories from discrepancies
|
|
36
|
+
- Link code/doc locations
|
|
37
|
+
|
|
38
|
+
4. **Update Discrepancy Status**
|
|
39
|
+
- Change status from `pending` to `in-progress`
|
|
40
|
+
- Add `incrementId` reference
|
|
41
|
+
|
|
42
|
+
5. **On Increment Completion**
|
|
43
|
+
- When increment closes via `/specweave:done`
|
|
44
|
+
- All linked discrepancies auto-marked `resolved`
|
|
45
|
+
- Archived to `resolved/YYYY-MM/`
|
|
46
|
+
|
|
47
|
+
## Example Output
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
🔄 Converting discrepancies to increment...
|
|
51
|
+
|
|
52
|
+
Selected discrepancies:
|
|
53
|
+
├─ DISC-0001: missing-docs (payment-service)
|
|
54
|
+
├─ DISC-0002: missing-docs (payment-service)
|
|
55
|
+
└─ DISC-0003: stale-docs (payment-service)
|
|
56
|
+
|
|
57
|
+
Module: payment-service
|
|
58
|
+
Total: 3 discrepancies
|
|
59
|
+
|
|
60
|
+
Generated increment: 0087-payment-docs-improvement
|
|
61
|
+
|
|
62
|
+
📝 spec.md created with:
|
|
63
|
+
• 1 user story: Document payment-service module
|
|
64
|
+
• 3 acceptance criteria (one per discrepancy)
|
|
65
|
+
• Links to affected code locations
|
|
66
|
+
|
|
67
|
+
Updated discrepancy status:
|
|
68
|
+
├─ DISC-0001: pending → in-progress
|
|
69
|
+
├─ DISC-0002: pending → in-progress
|
|
70
|
+
└─ DISC-0003: pending → in-progress
|
|
71
|
+
|
|
72
|
+
Next steps:
|
|
73
|
+
1. Review: .specweave/increments/0087-payment-docs-improvement/spec.md
|
|
74
|
+
2. Plan: /specweave:plan 0087
|
|
75
|
+
3. Execute: /specweave:do 0087
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Generated Spec Structure
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
---
|
|
82
|
+
increment: 0087-payment-docs-improvement
|
|
83
|
+
status: planning
|
|
84
|
+
type: documentation
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
# Documentation Improvement: payment-service
|
|
88
|
+
|
|
89
|
+
## Context
|
|
90
|
+
|
|
91
|
+
This increment addresses documentation gaps detected during brownfield analysis.
|
|
92
|
+
|
|
93
|
+
### Source Discrepancies
|
|
94
|
+
|
|
95
|
+
| ID | Type | Priority | Summary |
|
|
96
|
+
|----|------|----------|---------|
|
|
97
|
+
| DISC-0001 | missing-docs | high | 12 undocumented exports |
|
|
98
|
+
| DISC-0002 | missing-docs | medium | processPayment function lacks docs |
|
|
99
|
+
| DISC-0003 | stale-docs | high | Payment flow diagram outdated |
|
|
100
|
+
|
|
101
|
+
## User Story
|
|
102
|
+
|
|
103
|
+
### US-001: Document payment-service Module
|
|
104
|
+
|
|
105
|
+
**As a** new developer joining the team,
|
|
106
|
+
**I want** comprehensive documentation for the payment-service module,
|
|
107
|
+
**So that** I can understand and contribute to the payment flow.
|
|
108
|
+
|
|
109
|
+
#### Acceptance Criteria
|
|
110
|
+
|
|
111
|
+
- [ ] **AC-US1-01**: Document all 12 undocumented exports (DISC-0001)
|
|
112
|
+
- [ ] **AC-US1-02**: Add JSDoc to processPayment function (DISC-0002)
|
|
113
|
+
- [ ] **AC-US1-03**: Update payment flow diagram to match current implementation (DISC-0003)
|
|
114
|
+
|
|
115
|
+
## Technical Notes
|
|
116
|
+
|
|
117
|
+
### Affected Files
|
|
118
|
+
|
|
119
|
+
From DISC-0001:
|
|
120
|
+
- `src/payment/processor.ts`
|
|
121
|
+
- `src/payment/validator.ts`
|
|
122
|
+
- `src/payment/types.ts`
|
|
123
|
+
|
|
124
|
+
From DISC-0003:
|
|
125
|
+
- `docs/modules/payment.md` (diagram needs update)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Completion Hook
|
|
129
|
+
|
|
130
|
+
When the increment is closed with `/specweave:done`:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
// Automatically triggered by increment completion
|
|
134
|
+
async function onIncrementComplete(incrementId: string) {
|
|
135
|
+
const manager = new BrownfieldDiscrepancyManager(projectPath);
|
|
136
|
+
|
|
137
|
+
// Find all discrepancies linked to this increment
|
|
138
|
+
const discrepancies = await manager.listDiscrepancies({
|
|
139
|
+
incrementId,
|
|
140
|
+
status: 'in-progress'
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Resolve each discrepancy
|
|
144
|
+
for (const disc of discrepancies) {
|
|
145
|
+
await manager.resolveDiscrepancy(disc.id, {
|
|
146
|
+
type: 'doc-updated',
|
|
147
|
+
resolvedAt: new Date().toISOString(),
|
|
148
|
+
resolvedBy: 'increment-completion'
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
console.log(`✅ Resolved ${discrepancies.length} discrepancies`);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Related
|
|
157
|
+
|
|
158
|
+
- `/specweave:discrepancies` - View pending discrepancies
|
|
159
|
+
- `/specweave:increment` - Create new increment manually
|
|
160
|
+
- `/specweave:done` - Complete increment (triggers resolution)
|
|
@@ -16,6 +16,7 @@ Monitor and manage long-running background operations:
|
|
|
16
16
|
- **Repository cloning** (multi-repo/umbrella setup)
|
|
17
17
|
- **Issue import** (10K+ items from GitHub/JIRA/ADO)
|
|
18
18
|
- **External sync** operations
|
|
19
|
+
- **Brownfield analysis** (codebase documentation gap detection)
|
|
19
20
|
|
|
20
21
|
**ASYNC ARCHITECTURE (2025-12-01)**:
|
|
21
22
|
- Jobs run as **detached processes** that survive terminal close
|
|
@@ -58,21 +59,27 @@ STATE_FILE=".specweave/state/background-jobs.json"
|
|
|
58
59
|
```
|
|
59
60
|
📋 Background Jobs
|
|
60
61
|
|
|
61
|
-
🔄 Running (
|
|
62
|
+
🔄 Running (2):
|
|
62
63
|
[abc12345] import-issues (ADO)
|
|
63
64
|
Progress: 2,500/10,000 (25%)
|
|
64
65
|
Rate: 15.2/s | ETA: ~8m 14s
|
|
65
66
|
PID: 45678 | Started: 2 mins ago
|
|
66
67
|
|
|
68
|
+
[bfa99001] brownfield-analysis
|
|
69
|
+
Phase: 3/5 (doc-matching)
|
|
70
|
+
Files scanned: 1,234 | Discrepancies: 45
|
|
71
|
+
PID: 45680 | Started: 5 mins ago
|
|
72
|
+
|
|
67
73
|
⏸️ Paused (1):
|
|
68
74
|
[def67890] import-issues (GitHub)
|
|
69
75
|
Progress: 1,234/10,000 (12%)
|
|
70
76
|
Reason: Rate limited (resumes in 45s)
|
|
71
77
|
Resume: /specweave:jobs --resume def67890
|
|
72
78
|
|
|
73
|
-
✅ Completed (
|
|
79
|
+
✅ Completed (3):
|
|
74
80
|
[ghi11111] import-issues - 4,500 items - 5 mins ago
|
|
75
81
|
[jkl22222] clone-repos - 4/4 repos - 1 hour ago
|
|
82
|
+
[bfa88001] brownfield-analysis - 127 discrepancies - 2 hours ago
|
|
76
83
|
|
|
77
84
|
💡 Commands:
|
|
78
85
|
/specweave:jobs --id abc12345 → Details for specific job
|
|
@@ -231,6 +238,7 @@ const result = await launchImportJob({
|
|
|
231
238
|
| `clone-repos` | Multi-repo cloning | 1-5 mins |
|
|
232
239
|
| `import-issues` | Issue import from external | 5-60 mins |
|
|
233
240
|
| `sync-external` | Bidirectional sync | 1-10 mins |
|
|
241
|
+
| `brownfield-analysis` | Doc gap detection | 2-30 mins |
|
|
234
242
|
|
|
235
243
|
---
|
|
236
244
|
|
|
@@ -240,6 +248,41 @@ const result = await launchImportJob({
|
|
|
240
248
|
- Called after `/specweave:import-external` starts background import
|
|
241
249
|
- Called after `/specweave-github:sync` for large syncs
|
|
242
250
|
- Called after `/specweave-jira:sync` for large syncs
|
|
251
|
+
- Called after `specweave init` brownfield analysis prompt
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Brownfield Analysis Completion
|
|
256
|
+
|
|
257
|
+
When a brownfield-analysis job completes, it shows a summary:
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
✅ Brownfield Analysis Complete (bfa88001)
|
|
261
|
+
|
|
262
|
+
📊 Results Summary:
|
|
263
|
+
Files analyzed: 2,456
|
|
264
|
+
Modules detected: 18
|
|
265
|
+
Duration: 12m 34s
|
|
266
|
+
|
|
267
|
+
📋 Discrepancies Found: 127
|
|
268
|
+
By Type:
|
|
269
|
+
missing-docs: 72 (57%)
|
|
270
|
+
stale-docs: 28 (22%)
|
|
271
|
+
knowledge-gap: 15 (12%)
|
|
272
|
+
orphan-doc: 8 (6%)
|
|
273
|
+
missing-adr: 4 (3%)
|
|
274
|
+
|
|
275
|
+
By Priority:
|
|
276
|
+
🔴 Critical: 3
|
|
277
|
+
🟠 High: 24
|
|
278
|
+
🟡 Medium: 68
|
|
279
|
+
🟢 Low: 32
|
|
280
|
+
|
|
281
|
+
💡 Next Steps:
|
|
282
|
+
/specweave:discrepancies → View all pending discrepancies
|
|
283
|
+
/specweave:discrepancies --module auth → Filter by module
|
|
284
|
+
/specweave:discrepancy-to-increment DISC-0001 DISC-0002 → Create increment
|
|
285
|
+
```
|
|
243
286
|
|
|
244
287
|
---
|
|
245
288
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Notifications Command
|
|
2
|
+
|
|
3
|
+
View and manage sync notifications - import completions, discrepancies, sync failures, and more.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
/specweave:notifications # List pending notifications
|
|
9
|
+
/specweave:notifications --all # Include dismissed notifications
|
|
10
|
+
/specweave:notifications --type sync-failure # Filter by type
|
|
11
|
+
/specweave:notifications --severity warning # Filter by severity
|
|
12
|
+
/specweave:notifications show <id> # Show notification details
|
|
13
|
+
/specweave:notifications dismiss <id> # Dismiss a notification
|
|
14
|
+
/specweave:notifications dismiss-all # Dismiss all pending notifications
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Arguments
|
|
18
|
+
|
|
19
|
+
- `--all`: Include dismissed notifications in the list
|
|
20
|
+
- `--type <type>`: Filter by notification type:
|
|
21
|
+
- `import-complete`: Import job finished
|
|
22
|
+
- `discrepancy`: Code-spec discrepancy detected
|
|
23
|
+
- `sync-failure`: Sync operation failed
|
|
24
|
+
- `drift`: Status drift detected
|
|
25
|
+
- `job-complete`: Scheduled job finished
|
|
26
|
+
- `--severity <level>`: Filter by severity: `info`, `warning`, `critical`
|
|
27
|
+
- `--json`: Output as JSON for scripting
|
|
28
|
+
|
|
29
|
+
## Subcommands
|
|
30
|
+
|
|
31
|
+
### list (default)
|
|
32
|
+
|
|
33
|
+
Lists notifications with severity emoji, title, and age.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
📬 PENDING NOTIFICATIONS (3)
|
|
37
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
38
|
+
|
|
39
|
+
notif-abc123 ❗ CRITICAL GitHub sync failed 2m ago
|
|
40
|
+
notif-def456 ⚠️ WARNING 2 discrepancies in FS-045 1h ago
|
|
41
|
+
notif-ghi789 ℹ️ INFO 107 items imported 3h ago
|
|
42
|
+
|
|
43
|
+
Use '/specweave:notifications show <id>' to view details
|
|
44
|
+
Use '/specweave:notifications dismiss <id>' to dismiss
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### show <id>
|
|
48
|
+
|
|
49
|
+
Shows full notification details including data payload.
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
📬 NOTIFICATION DETAILS
|
|
53
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
54
|
+
|
|
55
|
+
ID: notif-abc123
|
|
56
|
+
Type: sync-failure
|
|
57
|
+
Severity: ❗ critical
|
|
58
|
+
Title: GitHub sync failed
|
|
59
|
+
Message: Rate limit exceeded. Retry in 15 minutes.
|
|
60
|
+
Created: 2025-12-01 12:00:00 (2m ago)
|
|
61
|
+
|
|
62
|
+
Data:
|
|
63
|
+
platform: github
|
|
64
|
+
error: Rate limit exceeded
|
|
65
|
+
retryAfter: 900
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### dismiss <id>
|
|
69
|
+
|
|
70
|
+
Dismisses a single notification.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
✅ Dismissed notification notif-abc123
|
|
74
|
+
|
|
75
|
+
Remaining: 2 pending notifications
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### dismiss-all
|
|
79
|
+
|
|
80
|
+
Dismisses all pending notifications with confirmation.
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
⚠️ This will dismiss 3 pending notifications.
|
|
84
|
+
Proceed? [y/N]: y
|
|
85
|
+
|
|
86
|
+
✅ Dismissed 3 notifications
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Related
|
|
90
|
+
|
|
91
|
+
- `/specweave:sync-monitor`: Dashboard showing notification summary
|
|
92
|
+
- `/specweave:discrepancies`: View and act on discrepancy notifications
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Sync Logs Command
|
|
2
|
+
|
|
3
|
+
Query and export sync audit logs. Supports date range, platform, and result filtering.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
/specweave:sync-logs # Last 24 hours
|
|
9
|
+
/specweave:sync-logs --since "2025-12-01" # Since specific date
|
|
10
|
+
/specweave:sync-logs --platform github # Filter by platform
|
|
11
|
+
/specweave:sync-logs --result denied # Filter by result
|
|
12
|
+
/specweave:sync-logs --export logs.json # Export to file
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Arguments
|
|
16
|
+
|
|
17
|
+
- `--since <date>`: Start date (ISO 8601 or YYYY-MM-DD)
|
|
18
|
+
- `--until <date>`: End date (ISO 8601 or YYYY-MM-DD)
|
|
19
|
+
- `--platform <name>`: Filter by platform: `github`, `jira`, `ado`
|
|
20
|
+
- `--operation <type>`: Filter by operation type
|
|
21
|
+
- `--result <result>`: Filter by result: `success`, `denied`, `error`
|
|
22
|
+
- `--limit <n>`: Maximum entries to return (default: 100)
|
|
23
|
+
- `--export <path>`: Export to file (JSON, JSONL, or CSV based on extension)
|
|
24
|
+
- `--json`: Output as JSON to stdout
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### View Recent Logs
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
/specweave:sync-logs
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Output:
|
|
35
|
+
```
|
|
36
|
+
📋 SYNC LOGS (last 24 hours)
|
|
37
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
38
|
+
|
|
39
|
+
2025-12-01 12:00:05 github upsert-internal FS-001 ✅ success 150ms
|
|
40
|
+
2025-12-01 12:00:04 jira update-status US-001 ✅ success 200ms
|
|
41
|
+
2025-12-01 12:00:03 github upsert-external EXT-001 🚫 denied -
|
|
42
|
+
2025-12-01 12:00:02 ado read WI-001 ❌ error -
|
|
43
|
+
2025-12-01 12:00:01 github upsert-internal FS-002 ✅ success 100ms
|
|
44
|
+
|
|
45
|
+
Showing 5 of 57 entries
|
|
46
|
+
Use --limit to show more, --export to save all
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Filter by Platform
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
/specweave:sync-logs --platform github
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Filter by Result
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
/specweave:sync-logs --result denied
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Shows only denied operations (permission enforcement in action):
|
|
62
|
+
```
|
|
63
|
+
📋 SYNC LOGS (denied only)
|
|
64
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
|
|
66
|
+
2025-12-01 12:00:03 github upsert-external EXT-001 🚫 denied
|
|
67
|
+
Reason: External updates disabled in config
|
|
68
|
+
|
|
69
|
+
2025-12-01 11:45:00 jira delete JIRA-123 🚫 denied
|
|
70
|
+
Reason: Delete operations not permitted
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Date Range Query
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
/specweave:sync-logs --since "2025-12-01" --until "2025-12-02"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Export to File
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Export to JSON
|
|
83
|
+
/specweave:sync-logs --export logs.json
|
|
84
|
+
|
|
85
|
+
# Export to CSV (for spreadsheets)
|
|
86
|
+
/specweave:sync-logs --export logs.csv
|
|
87
|
+
|
|
88
|
+
# Export to JSONL (for processing)
|
|
89
|
+
/specweave:sync-logs --export logs.jsonl
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Output Formats
|
|
93
|
+
|
|
94
|
+
### Default (Human-readable)
|
|
95
|
+
|
|
96
|
+
Tabular format with timestamps, platforms, operations, items, results, and durations.
|
|
97
|
+
|
|
98
|
+
### JSON (`--json` or `.json` export)
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"metadata": {
|
|
103
|
+
"exportedAt": "2025-12-01T12:00:00Z",
|
|
104
|
+
"total": 57,
|
|
105
|
+
"hasMore": false,
|
|
106
|
+
"query": { "limit": 100 }
|
|
107
|
+
},
|
|
108
|
+
"entries": [
|
|
109
|
+
{
|
|
110
|
+
"timestamp": "2025-12-01T12:00:05Z",
|
|
111
|
+
"platform": "github",
|
|
112
|
+
"operation": "upsert-internal",
|
|
113
|
+
"itemId": "FS-001",
|
|
114
|
+
"result": "success",
|
|
115
|
+
"durationMs": 150
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### CSV (`.csv` export)
|
|
122
|
+
|
|
123
|
+
```csv
|
|
124
|
+
timestamp,platform,operation,itemId,result,reason,error,durationMs
|
|
125
|
+
2025-12-01T12:00:05Z,github,upsert-internal,FS-001,success,,,150
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Related
|
|
129
|
+
|
|
130
|
+
- `/specweave:sync-monitor`: Dashboard with activity summary
|
|
131
|
+
- `/specweave:notifications`: View sync failure notifications
|