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,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Interceptor
|
|
3
|
+
*
|
|
4
|
+
* Central control point for all sync operations. Wraps sync operations with
|
|
5
|
+
* permission checks and audit logging. Implements the interceptor pattern to
|
|
6
|
+
* ensure consistent enforcement across all platforms (GitHub, JIRA, ADO).
|
|
7
|
+
*
|
|
8
|
+
* Pattern:
|
|
9
|
+
* Request → Interceptor → Permission Check → Execute/Deny → Log → Response
|
|
10
|
+
*
|
|
11
|
+
* @module core/sync/sync-interceptor
|
|
12
|
+
*/
|
|
13
|
+
import { PermissionEnforcer, SyncOperation, ItemOrigin, PermissionResult } from './permission-enforcer.js';
|
|
14
|
+
import { SyncAuditLogger } from './sync-audit-logger.js';
|
|
15
|
+
import { SyncPlatform } from '../types/sync-config.js';
|
|
16
|
+
import { Logger } from '../../utils/logger.js';
|
|
17
|
+
/**
|
|
18
|
+
* Interceptor result - wraps the operation result with metadata
|
|
19
|
+
*/
|
|
20
|
+
export interface InterceptorResult<T> {
|
|
21
|
+
/**
|
|
22
|
+
* Whether the operation was allowed
|
|
23
|
+
*/
|
|
24
|
+
allowed: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The result of the operation (null if denied or error)
|
|
27
|
+
*/
|
|
28
|
+
result: T | null;
|
|
29
|
+
/**
|
|
30
|
+
* Permission check result
|
|
31
|
+
*/
|
|
32
|
+
permission: PermissionResult;
|
|
33
|
+
/**
|
|
34
|
+
* Duration of the operation in milliseconds
|
|
35
|
+
*/
|
|
36
|
+
durationMs: number;
|
|
37
|
+
/**
|
|
38
|
+
* Error if operation failed
|
|
39
|
+
*/
|
|
40
|
+
error?: Error;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sync interceptor options
|
|
44
|
+
*/
|
|
45
|
+
export interface SyncInterceptorOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Permission enforcer instance
|
|
48
|
+
*/
|
|
49
|
+
permissionEnforcer: PermissionEnforcer;
|
|
50
|
+
/**
|
|
51
|
+
* Audit logger instance
|
|
52
|
+
*/
|
|
53
|
+
auditLogger: SyncAuditLogger;
|
|
54
|
+
/**
|
|
55
|
+
* Logger instance
|
|
56
|
+
*/
|
|
57
|
+
logger?: Logger;
|
|
58
|
+
/**
|
|
59
|
+
* Enable strict mode - throw on permission denial instead of returning null
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
strictMode?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Permission denied error
|
|
66
|
+
*/
|
|
67
|
+
export declare class PermissionDeniedError extends Error {
|
|
68
|
+
readonly permission: PermissionResult;
|
|
69
|
+
readonly platform: SyncPlatform;
|
|
70
|
+
readonly operation: SyncOperation;
|
|
71
|
+
constructor(permission: PermissionResult, platform: SyncPlatform, operation: SyncOperation);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* SyncInterceptor - Central control point for sync operations
|
|
75
|
+
*
|
|
76
|
+
* All sync operations must pass through this interceptor to ensure:
|
|
77
|
+
* 1. Permissions are checked before execution
|
|
78
|
+
* 2. All attempts are logged (success, denied, error)
|
|
79
|
+
* 3. Consistent behavior across all platforms
|
|
80
|
+
*
|
|
81
|
+
* Usage:
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const result = await interceptor.intercept(
|
|
84
|
+
* 'github',
|
|
85
|
+
* 'upsert-internal',
|
|
86
|
+
* 'FS-001',
|
|
87
|
+
* 'internal',
|
|
88
|
+
* () => this.githubClient.createIssue(item)
|
|
89
|
+
* );
|
|
90
|
+
*
|
|
91
|
+
* if (result.allowed) {
|
|
92
|
+
* return result.result;
|
|
93
|
+
* } else {
|
|
94
|
+
* console.log(`Denied: ${result.permission.reason}`);
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare class SyncInterceptor {
|
|
99
|
+
private readonly permissionEnforcer;
|
|
100
|
+
private readonly auditLogger;
|
|
101
|
+
private readonly logger;
|
|
102
|
+
private readonly strictMode;
|
|
103
|
+
constructor(options: SyncInterceptorOptions);
|
|
104
|
+
/**
|
|
105
|
+
* Intercept a sync operation
|
|
106
|
+
*
|
|
107
|
+
* Checks permissions, executes if allowed, logs the result.
|
|
108
|
+
*
|
|
109
|
+
* @param platform - Target platform (github, jira, ado)
|
|
110
|
+
* @param operation - Operation type (read, update-status, upsert-internal, upsert-external)
|
|
111
|
+
* @param itemId - Item ID being operated on
|
|
112
|
+
* @param origin - Item origin (internal or external)
|
|
113
|
+
* @param execute - Function to execute if permitted
|
|
114
|
+
* @returns Interceptor result with operation outcome
|
|
115
|
+
*/
|
|
116
|
+
intercept<T>(platform: SyncPlatform, operation: SyncOperation, itemId: string, origin: ItemOrigin, execute: () => Promise<T>): Promise<InterceptorResult<T>>;
|
|
117
|
+
/**
|
|
118
|
+
* Intercept with automatic origin detection
|
|
119
|
+
*
|
|
120
|
+
* Convenience method that auto-detects item origin from itemId.
|
|
121
|
+
* External items end with 'E' or contain '-E-'.
|
|
122
|
+
*
|
|
123
|
+
* @param platform - Target platform
|
|
124
|
+
* @param operation - Operation type
|
|
125
|
+
* @param itemId - Item ID (origin auto-detected)
|
|
126
|
+
* @param execute - Function to execute
|
|
127
|
+
*/
|
|
128
|
+
interceptAuto<T>(platform: SyncPlatform, operation: SyncOperation, itemId: string, execute: () => Promise<T>): Promise<InterceptorResult<T>>;
|
|
129
|
+
/**
|
|
130
|
+
* Intercept a read operation (always allowed)
|
|
131
|
+
*
|
|
132
|
+
* Convenience method for read operations. Still logs for audit.
|
|
133
|
+
*
|
|
134
|
+
* @param platform - Target platform
|
|
135
|
+
* @param itemId - Item ID
|
|
136
|
+
* @param execute - Function to execute
|
|
137
|
+
*/
|
|
138
|
+
interceptRead<T>(platform: SyncPlatform, itemId: string, execute: () => Promise<T>): Promise<InterceptorResult<T>>;
|
|
139
|
+
/**
|
|
140
|
+
* Intercept a status update operation
|
|
141
|
+
*
|
|
142
|
+
* @param platform - Target platform
|
|
143
|
+
* @param itemId - Item ID
|
|
144
|
+
* @param execute - Function to execute
|
|
145
|
+
*/
|
|
146
|
+
interceptStatusUpdate<T>(platform: SyncPlatform, itemId: string, execute: () => Promise<T>): Promise<InterceptorResult<T>>;
|
|
147
|
+
/**
|
|
148
|
+
* Intercept an upsert operation
|
|
149
|
+
*
|
|
150
|
+
* Automatically determines operation type based on item origin.
|
|
151
|
+
*
|
|
152
|
+
* @param platform - Target platform
|
|
153
|
+
* @param itemId - Item ID
|
|
154
|
+
* @param execute - Function to execute
|
|
155
|
+
*/
|
|
156
|
+
interceptUpsert<T>(platform: SyncPlatform, itemId: string, execute: () => Promise<T>): Promise<InterceptorResult<T>>;
|
|
157
|
+
/**
|
|
158
|
+
* Check if an operation would be allowed (without executing)
|
|
159
|
+
*
|
|
160
|
+
* Useful for pre-flight checks before expensive operations.
|
|
161
|
+
*
|
|
162
|
+
* @param platform - Target platform
|
|
163
|
+
* @param operation - Operation type
|
|
164
|
+
* @param itemId - Item ID
|
|
165
|
+
* @returns true if operation would be allowed
|
|
166
|
+
*/
|
|
167
|
+
wouldAllow(platform: SyncPlatform, operation: SyncOperation, itemId: string): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Get permission summary for a platform
|
|
170
|
+
*
|
|
171
|
+
* @param platform - Target platform
|
|
172
|
+
* @returns Human-readable summary
|
|
173
|
+
*/
|
|
174
|
+
getPermissionsSummary(): string;
|
|
175
|
+
/**
|
|
176
|
+
* Detect item origin from ID
|
|
177
|
+
*
|
|
178
|
+
* External items end with 'E' or contain '-E-'.
|
|
179
|
+
*/
|
|
180
|
+
private detectOrigin;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Create a SyncInterceptor with default configuration
|
|
184
|
+
*
|
|
185
|
+
* @param permissionEnforcer - Permission enforcer instance
|
|
186
|
+
* @param specweavePath - Path to .specweave directory
|
|
187
|
+
* @param logger - Optional logger
|
|
188
|
+
*/
|
|
189
|
+
export declare function createSyncInterceptor(permissionEnforcer: PermissionEnforcer, specweavePath: string, logger?: Logger): Promise<SyncInterceptor>;
|
|
190
|
+
//# sourceMappingURL=sync-interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-interceptor.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/sync-interceptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAiB,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAiB,MAAM,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,gBAAgB,CAAC;IAE7B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC;;OAEG;IACH,WAAW,EAAE,eAAe,CAAC;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,UAAU,EAAE,gBAAgB;aAC5B,QAAQ,EAAE,YAAY;aACtB,SAAS,EAAE,aAAa;gBAFxB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa;CAK3C;AAED;;;;;;;;;;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AAC,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAOhC;;;;;;;;;OASG;IACH,UAAU,CACR,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACb,OAAO;IAWV;;;;;OAKG;IACH,qBAAqB,IAAI,MAAM;IAI/B;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAMrB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,MAAM,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,eAAe,CAAC,CAa1B"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Interceptor
|
|
3
|
+
*
|
|
4
|
+
* Central control point for all sync operations. Wraps sync operations with
|
|
5
|
+
* permission checks and audit logging. Implements the interceptor pattern to
|
|
6
|
+
* ensure consistent enforcement across all platforms (GitHub, JIRA, ADO).
|
|
7
|
+
*
|
|
8
|
+
* Pattern:
|
|
9
|
+
* Request → Interceptor → Permission Check → Execute/Deny → Log → Response
|
|
10
|
+
*
|
|
11
|
+
* @module core/sync/sync-interceptor
|
|
12
|
+
*/
|
|
13
|
+
import { consoleLogger } from '../../utils/logger.js';
|
|
14
|
+
/**
|
|
15
|
+
* Permission denied error
|
|
16
|
+
*/
|
|
17
|
+
export class PermissionDeniedError extends Error {
|
|
18
|
+
constructor(permission, platform, operation) {
|
|
19
|
+
super(`Permission denied: ${permission.reason}`);
|
|
20
|
+
this.permission = permission;
|
|
21
|
+
this.platform = platform;
|
|
22
|
+
this.operation = operation;
|
|
23
|
+
this.name = 'PermissionDeniedError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* SyncInterceptor - Central control point for sync operations
|
|
28
|
+
*
|
|
29
|
+
* All sync operations must pass through this interceptor to ensure:
|
|
30
|
+
* 1. Permissions are checked before execution
|
|
31
|
+
* 2. All attempts are logged (success, denied, error)
|
|
32
|
+
* 3. Consistent behavior across all platforms
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const result = await interceptor.intercept(
|
|
37
|
+
* 'github',
|
|
38
|
+
* 'upsert-internal',
|
|
39
|
+
* 'FS-001',
|
|
40
|
+
* 'internal',
|
|
41
|
+
* () => this.githubClient.createIssue(item)
|
|
42
|
+
* );
|
|
43
|
+
*
|
|
44
|
+
* if (result.allowed) {
|
|
45
|
+
* return result.result;
|
|
46
|
+
* } else {
|
|
47
|
+
* console.log(`Denied: ${result.permission.reason}`);
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export class SyncInterceptor {
|
|
52
|
+
constructor(options) {
|
|
53
|
+
this.permissionEnforcer = options.permissionEnforcer;
|
|
54
|
+
this.auditLogger = options.auditLogger;
|
|
55
|
+
this.logger = options.logger ?? consoleLogger;
|
|
56
|
+
this.strictMode = options.strictMode ?? false;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Intercept a sync operation
|
|
60
|
+
*
|
|
61
|
+
* Checks permissions, executes if allowed, logs the result.
|
|
62
|
+
*
|
|
63
|
+
* @param platform - Target platform (github, jira, ado)
|
|
64
|
+
* @param operation - Operation type (read, update-status, upsert-internal, upsert-external)
|
|
65
|
+
* @param itemId - Item ID being operated on
|
|
66
|
+
* @param origin - Item origin (internal or external)
|
|
67
|
+
* @param execute - Function to execute if permitted
|
|
68
|
+
* @returns Interceptor result with operation outcome
|
|
69
|
+
*/
|
|
70
|
+
async intercept(platform, operation, itemId, origin, execute) {
|
|
71
|
+
const startTime = Date.now();
|
|
72
|
+
// Check permission
|
|
73
|
+
const permission = await this.permissionEnforcer.checkAndLog(platform, operation, itemId, origin);
|
|
74
|
+
// Handle denial
|
|
75
|
+
if (!permission.allowed) {
|
|
76
|
+
const durationMs = Date.now() - startTime;
|
|
77
|
+
await this.auditLogger.logDenied(platform, operation, itemId, permission.reason);
|
|
78
|
+
this.logger.debug(`[SyncInterceptor] Denied: ${platform}/${operation} for ${itemId} - ${permission.reason}`);
|
|
79
|
+
// Strict mode throws instead of returning
|
|
80
|
+
if (this.strictMode) {
|
|
81
|
+
throw new PermissionDeniedError(permission, platform, operation);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
allowed: false,
|
|
85
|
+
result: null,
|
|
86
|
+
permission,
|
|
87
|
+
durationMs,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// Execute the operation
|
|
91
|
+
try {
|
|
92
|
+
const result = await execute();
|
|
93
|
+
const durationMs = Date.now() - startTime;
|
|
94
|
+
await this.auditLogger.logSuccess(platform, operation, itemId, durationMs);
|
|
95
|
+
this.logger.debug(`[SyncInterceptor] Success: ${platform}/${operation} for ${itemId} (${durationMs}ms)`);
|
|
96
|
+
return {
|
|
97
|
+
allowed: true,
|
|
98
|
+
result,
|
|
99
|
+
permission,
|
|
100
|
+
durationMs,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
const durationMs = Date.now() - startTime;
|
|
105
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
106
|
+
await this.auditLogger.logError(platform, operation, itemId, err);
|
|
107
|
+
this.logger.debug(`[SyncInterceptor] Error: ${platform}/${operation} for ${itemId} - ${err.message}`);
|
|
108
|
+
return {
|
|
109
|
+
allowed: true, // Was allowed, but failed
|
|
110
|
+
result: null,
|
|
111
|
+
permission,
|
|
112
|
+
durationMs,
|
|
113
|
+
error: err,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Intercept with automatic origin detection
|
|
119
|
+
*
|
|
120
|
+
* Convenience method that auto-detects item origin from itemId.
|
|
121
|
+
* External items end with 'E' or contain '-E-'.
|
|
122
|
+
*
|
|
123
|
+
* @param platform - Target platform
|
|
124
|
+
* @param operation - Operation type
|
|
125
|
+
* @param itemId - Item ID (origin auto-detected)
|
|
126
|
+
* @param execute - Function to execute
|
|
127
|
+
*/
|
|
128
|
+
async interceptAuto(platform, operation, itemId, execute) {
|
|
129
|
+
const origin = this.detectOrigin(itemId);
|
|
130
|
+
return this.intercept(platform, operation, itemId, origin, execute);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Intercept a read operation (always allowed)
|
|
134
|
+
*
|
|
135
|
+
* Convenience method for read operations. Still logs for audit.
|
|
136
|
+
*
|
|
137
|
+
* @param platform - Target platform
|
|
138
|
+
* @param itemId - Item ID
|
|
139
|
+
* @param execute - Function to execute
|
|
140
|
+
*/
|
|
141
|
+
async interceptRead(platform, itemId, execute) {
|
|
142
|
+
return this.intercept(platform, 'read', itemId, 'internal', execute);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Intercept a status update operation
|
|
146
|
+
*
|
|
147
|
+
* @param platform - Target platform
|
|
148
|
+
* @param itemId - Item ID
|
|
149
|
+
* @param execute - Function to execute
|
|
150
|
+
*/
|
|
151
|
+
async interceptStatusUpdate(platform, itemId, execute) {
|
|
152
|
+
const origin = this.detectOrigin(itemId);
|
|
153
|
+
return this.intercept(platform, 'update-status', itemId, origin, execute);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Intercept an upsert operation
|
|
157
|
+
*
|
|
158
|
+
* Automatically determines operation type based on item origin.
|
|
159
|
+
*
|
|
160
|
+
* @param platform - Target platform
|
|
161
|
+
* @param itemId - Item ID
|
|
162
|
+
* @param execute - Function to execute
|
|
163
|
+
*/
|
|
164
|
+
async interceptUpsert(platform, itemId, execute) {
|
|
165
|
+
const origin = this.detectOrigin(itemId);
|
|
166
|
+
const operation = origin === 'external' ? 'upsert-external' : 'upsert-internal';
|
|
167
|
+
return this.intercept(platform, operation, itemId, origin, execute);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Check if an operation would be allowed (without executing)
|
|
171
|
+
*
|
|
172
|
+
* Useful for pre-flight checks before expensive operations.
|
|
173
|
+
*
|
|
174
|
+
* @param platform - Target platform
|
|
175
|
+
* @param operation - Operation type
|
|
176
|
+
* @param itemId - Item ID
|
|
177
|
+
* @returns true if operation would be allowed
|
|
178
|
+
*/
|
|
179
|
+
wouldAllow(platform, operation, itemId) {
|
|
180
|
+
const origin = this.detectOrigin(itemId);
|
|
181
|
+
const permission = this.permissionEnforcer.checkPermission(platform, operation, itemId, origin);
|
|
182
|
+
return permission.allowed;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get permission summary for a platform
|
|
186
|
+
*
|
|
187
|
+
* @param platform - Target platform
|
|
188
|
+
* @returns Human-readable summary
|
|
189
|
+
*/
|
|
190
|
+
getPermissionsSummary() {
|
|
191
|
+
return this.permissionEnforcer.getPermissionsSummary().summary;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Detect item origin from ID
|
|
195
|
+
*
|
|
196
|
+
* External items end with 'E' or contain '-E-'.
|
|
197
|
+
*/
|
|
198
|
+
detectOrigin(itemId) {
|
|
199
|
+
if (itemId.endsWith('E') || itemId.includes('-E-')) {
|
|
200
|
+
return 'external';
|
|
201
|
+
}
|
|
202
|
+
return 'internal';
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Create a SyncInterceptor with default configuration
|
|
207
|
+
*
|
|
208
|
+
* @param permissionEnforcer - Permission enforcer instance
|
|
209
|
+
* @param specweavePath - Path to .specweave directory
|
|
210
|
+
* @param logger - Optional logger
|
|
211
|
+
*/
|
|
212
|
+
export async function createSyncInterceptor(permissionEnforcer, specweavePath, logger) {
|
|
213
|
+
const { SyncAuditLogger: AuditLoggerClass } = await import('./sync-audit-logger.js');
|
|
214
|
+
const auditLogger = new AuditLoggerClass({
|
|
215
|
+
specweavePath,
|
|
216
|
+
logger,
|
|
217
|
+
});
|
|
218
|
+
return new SyncInterceptor({
|
|
219
|
+
permissionEnforcer,
|
|
220
|
+
auditLogger,
|
|
221
|
+
logger,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=sync-interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-interceptor.js","sourceRoot":"","sources":["../../../../src/core/sync/sync-interceptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,OAAO,EAAU,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA0D9D;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YACkB,UAA4B,EAC5B,QAAsB,EACtB,SAAwB;QAExC,KAAK,CAAC,sBAAsB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAJjC,eAAU,GAAV,UAAU,CAAkB;QAC5B,aAAQ,GAAR,QAAQ,CAAc;QACtB,cAAS,GAAT,SAAS,CAAe;QAGxC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,eAAe;IAM1B,YAAY,OAA+B;QACzC,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,SAAS,CACb,QAAsB,EACtB,SAAwB,EACxB,MAAc,EACd,MAAkB,EAClB,OAAyB;QAEzB,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,mBAAmB;QACnB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAC1D,QAAQ,EACR,SAAS,EACT,MAAM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AAM;KACP,CAAC,CAAC;IAEH,OAAO,IAAI,eAAe,CAAC;QACzB,kBAAkB;QAClB,WAAW;QACX,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -247,6 +247,11 @@ export interface ExternalContainerContext {
|
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Extended increment metadata with multi-project support (v0.29.0+)
|
|
250
|
+
*
|
|
251
|
+
* NOTE (v0.29.0): featureId field was REMOVED
|
|
252
|
+
* Feature ID is derived from increment number: 0081 → FS-081
|
|
253
|
+
* Use deriveFeatureId() from src/utils/feature-id-derivation.ts
|
|
254
|
+
* See ADR-0140 for rationale
|
|
250
255
|
*/
|
|
251
256
|
export interface IncrementMetadataV2 extends IncrementMetadata {
|
|
252
257
|
/** Single project ID (backward compatible) */
|
|
@@ -255,8 +260,6 @@ export interface IncrementMetadataV2 extends IncrementMetadata {
|
|
|
255
260
|
multiProject?: MultiProjectUserStory;
|
|
256
261
|
/** External container context for 2-level directory structure */
|
|
257
262
|
externalContainer?: ExternalContainerContext;
|
|
258
|
-
/** Feature ID this increment belongs to */
|
|
259
|
-
featureId?: string;
|
|
260
263
|
/** Epic ID if part of an epic */
|
|
261
264
|
epicId?: string;
|
|
262
265
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"increment-metadata.d.ts","sourceRoot":"","sources":["../../../../src/core/types/increment-metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,oBAAY,eAAe;IACzB,yFAAyF;IACzF,QAAQ,aAAa;IAErB,gCAAgC;IAChC,MAAM,WAAW;IAEjB,6EAA6E;IAC7E,OAAO,YAAY;IAEnB,0EAA0E;IAC1E,MAAM,WAAW;IAEjB;;;;;;;;;;;OAWG;IACH,gBAAgB,qBAAqB;IAErC,gEAAgE;IAChE,SAAS,cAAc;IAEvB,4DAA4D;IAC5D,SAAS,cAAc;CACxB;AAED;;;GAGG;AACH,oBAAY,aAAa;IACvB,o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AA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IAEX,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IAEf,yBAAyB;IACzB,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAE9B,+CAA+C;IAC/C,YAAY,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAExC,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gFAAgF;IAChF,YAAY,CAAC,EAAE,QAAQ,GAAG,cAAc,GAAG,KAAK,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,IAAI,EAAE,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;IAEpD,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IAEpB,mBAAmB;IACnB,aAAa,EAAE,MAAM,CAAC;IAEtB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED
|
|
1
|
+
{"version":3,"file":"increment-metadata.d.ts","sourceRoot":"","sources":["../../../../src/core/types/increment-metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,oBAAY,eAAe;IACzB,yFAAyF;IACzF,QAAQ,aAAa;IAErB,gCAAgC;IAChC,MAAM,WAAW;IAEjB,6EAA6E;IAC7E,OAAO,YAAY;IAEnB,0EAA0E;IAC1E,M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