@specatlas/core 0.1.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/LICENSE +21 -0
- package/dist/approvals-HCBC7QDM.js +7 -0
- package/dist/chunk-2BFXQ65Q.js +239 -0
- package/dist/chunk-5RKNY2ZC.js +94 -0
- package/dist/fsx-VF2P7ALA.js +26 -0
- package/dist/index.d.ts +1656 -0
- package/dist/index.js +4008 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1656 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { defaultTokens, renderDocument, renderStyles } from '@specatlas/render';
|
|
3
|
+
|
|
4
|
+
declare const CORE_VERSION = "0.0.1";
|
|
5
|
+
|
|
6
|
+
type Severity = 'error' | 'warning' | 'info';
|
|
7
|
+
interface Diagnostic {
|
|
8
|
+
code: string;
|
|
9
|
+
severity: Severity;
|
|
10
|
+
message: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
line?: number;
|
|
13
|
+
suggestion?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function diag(code: string, severity: Severity, message: string, opts?: {
|
|
16
|
+
path?: string;
|
|
17
|
+
line?: number;
|
|
18
|
+
suggestion?: string;
|
|
19
|
+
}): Diagnostic;
|
|
20
|
+
declare function countBySeverity(diags: readonly Diagnostic[]): {
|
|
21
|
+
errors: number;
|
|
22
|
+
warnings: number;
|
|
23
|
+
infos: number;
|
|
24
|
+
};
|
|
25
|
+
declare function hasErrors(diags: readonly Diagnostic[]): boolean;
|
|
26
|
+
|
|
27
|
+
type Lane = 'fix' | 'standard' | 'full';
|
|
28
|
+
type RiskLevel = 'low' | 'medium' | 'high';
|
|
29
|
+
type Domain = 'frontend' | 'backend' | 'database' | 'mobile' | 'reports' | 'testing' | 'infra' | 'fullstack' | 'other';
|
|
30
|
+
type Language = 'es' | 'en';
|
|
31
|
+
declare const REQ_ID_RE: RegExp;
|
|
32
|
+
declare const SCENARIO_ID_RE: RegExp;
|
|
33
|
+
declare const RULE_ID_RE: RegExp;
|
|
34
|
+
declare const TASK_ID_RE: RegExp;
|
|
35
|
+
interface Rule {
|
|
36
|
+
id: string;
|
|
37
|
+
text: string;
|
|
38
|
+
line: number;
|
|
39
|
+
}
|
|
40
|
+
interface Scenario {
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
reqId: string;
|
|
44
|
+
when: string[];
|
|
45
|
+
then: string[];
|
|
46
|
+
line: number;
|
|
47
|
+
}
|
|
48
|
+
interface Requirement {
|
|
49
|
+
id: string;
|
|
50
|
+
title: string;
|
|
51
|
+
prose: string;
|
|
52
|
+
rules: Rule[];
|
|
53
|
+
scenarios: Scenario[];
|
|
54
|
+
line: number;
|
|
55
|
+
}
|
|
56
|
+
interface SpecFile {
|
|
57
|
+
path: string;
|
|
58
|
+
frontmatter: Record<string, unknown>;
|
|
59
|
+
domain?: string;
|
|
60
|
+
title?: string;
|
|
61
|
+
version?: number;
|
|
62
|
+
requirements: Requirement[];
|
|
63
|
+
diagnostics: Diagnostic[];
|
|
64
|
+
}
|
|
65
|
+
type DeltaOp = 'added' | 'modified' | 'removed' | 'renamed';
|
|
66
|
+
interface Rename {
|
|
67
|
+
from: {
|
|
68
|
+
id: string;
|
|
69
|
+
title: string;
|
|
70
|
+
};
|
|
71
|
+
to: {
|
|
72
|
+
id: string;
|
|
73
|
+
title: string;
|
|
74
|
+
};
|
|
75
|
+
line: number;
|
|
76
|
+
}
|
|
77
|
+
interface Delta {
|
|
78
|
+
path: string;
|
|
79
|
+
added: Requirement[];
|
|
80
|
+
modified: Requirement[];
|
|
81
|
+
removed: Requirement[];
|
|
82
|
+
renamed: Rename[];
|
|
83
|
+
sectionsFound: DeltaOp[];
|
|
84
|
+
diagnostics: Diagnostic[];
|
|
85
|
+
}
|
|
86
|
+
interface Task {
|
|
87
|
+
id: string;
|
|
88
|
+
block: string;
|
|
89
|
+
text: string;
|
|
90
|
+
done: boolean;
|
|
91
|
+
files: string[];
|
|
92
|
+
covers: string[];
|
|
93
|
+
dependsOn: string[];
|
|
94
|
+
rollback?: string;
|
|
95
|
+
infra: boolean;
|
|
96
|
+
line: number;
|
|
97
|
+
}
|
|
98
|
+
interface TaskBlock {
|
|
99
|
+
id: string;
|
|
100
|
+
title: string;
|
|
101
|
+
line: number;
|
|
102
|
+
tasks: Task[];
|
|
103
|
+
}
|
|
104
|
+
interface TasksFile {
|
|
105
|
+
path: string;
|
|
106
|
+
blocks: TaskBlock[];
|
|
107
|
+
diagnostics: Diagnostic[];
|
|
108
|
+
counts: {
|
|
109
|
+
done: number;
|
|
110
|
+
total: number;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
type EvidenceMethod = 'executable' | 'automatic' | 'semi' | 'manual';
|
|
114
|
+
type EvidenceResult = 'pass' | 'fail' | 'skipped';
|
|
115
|
+
interface Evidence {
|
|
116
|
+
scenario: string;
|
|
117
|
+
method: EvidenceMethod;
|
|
118
|
+
command?: string;
|
|
119
|
+
result: EvidenceResult;
|
|
120
|
+
outputHash?: string;
|
|
121
|
+
date: string;
|
|
122
|
+
by: string;
|
|
123
|
+
notes?: string;
|
|
124
|
+
line: number;
|
|
125
|
+
}
|
|
126
|
+
interface VerifyFile {
|
|
127
|
+
path: string;
|
|
128
|
+
evidence: Evidence[];
|
|
129
|
+
diagnostics: Diagnostic[];
|
|
130
|
+
}
|
|
131
|
+
interface Override {
|
|
132
|
+
gate: string;
|
|
133
|
+
reason: string;
|
|
134
|
+
by: string;
|
|
135
|
+
at: string;
|
|
136
|
+
}
|
|
137
|
+
interface ChangeMeta {
|
|
138
|
+
schemaVersion: number;
|
|
139
|
+
slug: string;
|
|
140
|
+
title?: string;
|
|
141
|
+
domain?: string;
|
|
142
|
+
lane: Lane;
|
|
143
|
+
risk?: RiskLevel;
|
|
144
|
+
created?: string;
|
|
145
|
+
owner?: string;
|
|
146
|
+
tracker?: {
|
|
147
|
+
provider: string;
|
|
148
|
+
id: string;
|
|
149
|
+
url?: string;
|
|
150
|
+
};
|
|
151
|
+
paused?: {
|
|
152
|
+
reason: string;
|
|
153
|
+
at: string;
|
|
154
|
+
by: string;
|
|
155
|
+
};
|
|
156
|
+
laneHistory?: Array<{
|
|
157
|
+
from: Lane;
|
|
158
|
+
to: Lane;
|
|
159
|
+
at: string;
|
|
160
|
+
by: string;
|
|
161
|
+
}>;
|
|
162
|
+
diagramExceptions?: string[];
|
|
163
|
+
overrides?: Override[];
|
|
164
|
+
}
|
|
165
|
+
interface Approval {
|
|
166
|
+
artifact: string;
|
|
167
|
+
artifactHash: string;
|
|
168
|
+
approvedBy: string;
|
|
169
|
+
approvedAt: string;
|
|
170
|
+
channel: 'presentation' | 'editor' | 'pr' | 'tracker' | 'cli';
|
|
171
|
+
note?: string;
|
|
172
|
+
}
|
|
173
|
+
interface ApprovalsFile {
|
|
174
|
+
schemaVersion: number;
|
|
175
|
+
approvals: Approval[];
|
|
176
|
+
}
|
|
177
|
+
interface MockupScreen {
|
|
178
|
+
id: string;
|
|
179
|
+
file: string;
|
|
180
|
+
title?: string;
|
|
181
|
+
illustrates?: string[];
|
|
182
|
+
states?: string[];
|
|
183
|
+
breakpoints?: number[];
|
|
184
|
+
themes?: string[];
|
|
185
|
+
}
|
|
186
|
+
interface MockupManifest {
|
|
187
|
+
schemaVersion: number;
|
|
188
|
+
version: number;
|
|
189
|
+
level: 'sketch' | 'hifi';
|
|
190
|
+
platform: 'web' | 'mobile' | 'desktop';
|
|
191
|
+
inputsHash?: string;
|
|
192
|
+
generatedAt?: string;
|
|
193
|
+
tokens?: string;
|
|
194
|
+
screens: MockupScreen[];
|
|
195
|
+
}
|
|
196
|
+
interface Change {
|
|
197
|
+
slug: string;
|
|
198
|
+
dir: string;
|
|
199
|
+
meta?: ChangeMeta;
|
|
200
|
+
delta?: Delta;
|
|
201
|
+
tasks?: TasksFile;
|
|
202
|
+
verify?: VerifyFile;
|
|
203
|
+
fix?: VerifyFile;
|
|
204
|
+
planPath?: string;
|
|
205
|
+
mockupManifestPath?: string;
|
|
206
|
+
diagnostics: Diagnostic[];
|
|
207
|
+
}
|
|
208
|
+
interface SpecRef {
|
|
209
|
+
domain: string;
|
|
210
|
+
path: string;
|
|
211
|
+
spec: SpecFile;
|
|
212
|
+
}
|
|
213
|
+
interface Workspace {
|
|
214
|
+
root: string;
|
|
215
|
+
sddDir: string;
|
|
216
|
+
specs: SpecRef[];
|
|
217
|
+
changes: Change[];
|
|
218
|
+
diagnostics: Diagnostic[];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare function exists(p: string): Promise<boolean>;
|
|
222
|
+
declare function isDirectory(p: string): Promise<boolean>;
|
|
223
|
+
declare function readText(p: string): Promise<string>;
|
|
224
|
+
declare function readTextIfExists(p: string): Promise<string | undefined>;
|
|
225
|
+
declare function writeText(p: string, content: string): Promise<void>;
|
|
226
|
+
declare function ensureDir(p: string): Promise<void>;
|
|
227
|
+
declare function copyFile(from: string, to: string): Promise<void>;
|
|
228
|
+
declare function listDir(p: string): Promise<string[]>;
|
|
229
|
+
declare function listDirs(p: string): Promise<string[]>;
|
|
230
|
+
interface WalkEntry {
|
|
231
|
+
path: string;
|
|
232
|
+
name: string;
|
|
233
|
+
}
|
|
234
|
+
declare function walkFiles(root: string, opts?: {
|
|
235
|
+
skipDirs?: string[];
|
|
236
|
+
}): Promise<WalkEntry[]>;
|
|
237
|
+
declare function toPosix(p: string): string;
|
|
238
|
+
|
|
239
|
+
declare const CONFIG_FILE = "config.yaml";
|
|
240
|
+
declare const atlasConfigSchema: z.ZodObject<{
|
|
241
|
+
schema_version: z.ZodDefault<z.ZodNumber>;
|
|
242
|
+
project: z.ZodDefault<z.ZodObject<{
|
|
243
|
+
name: z.ZodDefault<z.ZodString>;
|
|
244
|
+
language: z.ZodDefault<z.ZodEnum<["es", "en"]>>;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
name: string;
|
|
247
|
+
language: "es" | "en";
|
|
248
|
+
}, {
|
|
249
|
+
name?: string | undefined;
|
|
250
|
+
language?: "es" | "en" | undefined;
|
|
251
|
+
}>>;
|
|
252
|
+
lanes: z.ZodDefault<z.ZodObject<{
|
|
253
|
+
default: z.ZodDefault<z.ZodEnum<["fix", "standard", "full"]>>;
|
|
254
|
+
allowed: z.ZodDefault<z.ZodArray<z.ZodEnum<["fix", "standard", "full"]>, "many">>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
default: "fix" | "standard" | "full";
|
|
257
|
+
allowed: ("fix" | "standard" | "full")[];
|
|
258
|
+
}, {
|
|
259
|
+
default?: "fix" | "standard" | "full" | undefined;
|
|
260
|
+
allowed?: ("fix" | "standard" | "full")[] | undefined;
|
|
261
|
+
}>>;
|
|
262
|
+
gates: z.ZodDefault<z.ZodObject<{
|
|
263
|
+
approval: z.ZodDefault<z.ZodEnum<["file", "none", "github-label"]>>;
|
|
264
|
+
approval_label: z.ZodDefault<z.ZodString>;
|
|
265
|
+
analyze: z.ZodDefault<z.ZodObject<{
|
|
266
|
+
mode: z.ZodDefault<z.ZodEnum<["off", "advisory", "blocking"]>>;
|
|
267
|
+
min_severity: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
mode: "off" | "advisory" | "blocking";
|
|
270
|
+
min_severity: "low" | "medium" | "high";
|
|
271
|
+
}, {
|
|
272
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
273
|
+
min_severity?: "low" | "medium" | "high" | undefined;
|
|
274
|
+
}>>;
|
|
275
|
+
verify: z.ZodDefault<z.ZodObject<{
|
|
276
|
+
mode: z.ZodDefault<z.ZodEnum<["off", "advisory", "blocking"]>>;
|
|
277
|
+
require_evidence: z.ZodDefault<z.ZodBoolean>;
|
|
278
|
+
}, "strip", z.ZodTypeAny, {
|
|
279
|
+
mode: "off" | "advisory" | "blocking";
|
|
280
|
+
require_evidence: boolean;
|
|
281
|
+
}, {
|
|
282
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
283
|
+
require_evidence?: boolean | undefined;
|
|
284
|
+
}>>;
|
|
285
|
+
review: z.ZodDefault<z.ZodObject<{
|
|
286
|
+
mode: z.ZodDefault<z.ZodEnum<["off", "advisory", "blocking"]>>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
mode: "off" | "advisory" | "blocking";
|
|
289
|
+
}, {
|
|
290
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
291
|
+
}>>;
|
|
292
|
+
mockup: z.ZodDefault<z.ZodObject<{
|
|
293
|
+
require_approval: z.ZodDefault<z.ZodBoolean>;
|
|
294
|
+
compare_in_verify: z.ZodDefault<z.ZodBoolean>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
require_approval: boolean;
|
|
297
|
+
compare_in_verify: boolean;
|
|
298
|
+
}, {
|
|
299
|
+
require_approval?: boolean | undefined;
|
|
300
|
+
compare_in_verify?: boolean | undefined;
|
|
301
|
+
}>>;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
approval: "file" | "none" | "github-label";
|
|
304
|
+
approval_label: string;
|
|
305
|
+
analyze: {
|
|
306
|
+
mode: "off" | "advisory" | "blocking";
|
|
307
|
+
min_severity: "low" | "medium" | "high";
|
|
308
|
+
};
|
|
309
|
+
verify: {
|
|
310
|
+
mode: "off" | "advisory" | "blocking";
|
|
311
|
+
require_evidence: boolean;
|
|
312
|
+
};
|
|
313
|
+
review: {
|
|
314
|
+
mode: "off" | "advisory" | "blocking";
|
|
315
|
+
};
|
|
316
|
+
mockup: {
|
|
317
|
+
require_approval: boolean;
|
|
318
|
+
compare_in_verify: boolean;
|
|
319
|
+
};
|
|
320
|
+
}, {
|
|
321
|
+
approval?: "file" | "none" | "github-label" | undefined;
|
|
322
|
+
approval_label?: string | undefined;
|
|
323
|
+
analyze?: {
|
|
324
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
325
|
+
min_severity?: "low" | "medium" | "high" | undefined;
|
|
326
|
+
} | undefined;
|
|
327
|
+
verify?: {
|
|
328
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
329
|
+
require_evidence?: boolean | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
review?: {
|
|
332
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
333
|
+
} | undefined;
|
|
334
|
+
mockup?: {
|
|
335
|
+
require_approval?: boolean | undefined;
|
|
336
|
+
compare_in_verify?: boolean | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
}>>;
|
|
339
|
+
trace: z.ZodDefault<z.ZodObject<{
|
|
340
|
+
mode: z.ZodDefault<z.ZodEnum<["off", "advisory", "blocking"]>>;
|
|
341
|
+
prefix: z.ZodDefault<z.ZodString>;
|
|
342
|
+
}, "strip", z.ZodTypeAny, {
|
|
343
|
+
mode: "off" | "advisory" | "blocking";
|
|
344
|
+
prefix: string;
|
|
345
|
+
}, {
|
|
346
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
347
|
+
prefix?: string | undefined;
|
|
348
|
+
}>>;
|
|
349
|
+
waves: z.ZodDefault<z.ZodObject<{
|
|
350
|
+
max_parallel: z.ZodDefault<z.ZodNumber>;
|
|
351
|
+
}, "strip", z.ZodTypeAny, {
|
|
352
|
+
max_parallel: number;
|
|
353
|
+
}, {
|
|
354
|
+
max_parallel?: number | undefined;
|
|
355
|
+
}>>;
|
|
356
|
+
ci: z.ZodDefault<z.ZodObject<{
|
|
357
|
+
drift: z.ZodDefault<z.ZodEnum<["advisory", "strict"]>>;
|
|
358
|
+
}, "strip", z.ZodTypeAny, {
|
|
359
|
+
drift: "advisory" | "strict";
|
|
360
|
+
}, {
|
|
361
|
+
drift?: "advisory" | "strict" | undefined;
|
|
362
|
+
}>>;
|
|
363
|
+
spec: z.ZodDefault<z.ZodObject<{
|
|
364
|
+
language: z.ZodDefault<z.ZodEnum<["es", "en"]>>;
|
|
365
|
+
business_only: z.ZodDefault<z.ZodBoolean>;
|
|
366
|
+
glossary: z.ZodDefault<z.ZodString>;
|
|
367
|
+
}, "strip", z.ZodTypeAny, {
|
|
368
|
+
language: "es" | "en";
|
|
369
|
+
business_only: boolean;
|
|
370
|
+
glossary: string;
|
|
371
|
+
}, {
|
|
372
|
+
language?: "es" | "en" | undefined;
|
|
373
|
+
business_only?: boolean | undefined;
|
|
374
|
+
glossary?: string | undefined;
|
|
375
|
+
}>>;
|
|
376
|
+
syntax: z.ZodDefault<z.ZodObject<{
|
|
377
|
+
headers: z.ZodOptional<z.ZodEnum<["es", "en"]>>;
|
|
378
|
+
}, "strip", z.ZodTypeAny, {
|
|
379
|
+
headers?: "es" | "en" | undefined;
|
|
380
|
+
}, {
|
|
381
|
+
headers?: "es" | "en" | undefined;
|
|
382
|
+
}>>;
|
|
383
|
+
mockups: z.ZodDefault<z.ZodObject<{
|
|
384
|
+
level: z.ZodDefault<z.ZodEnum<["sketch", "hifi"]>>;
|
|
385
|
+
platform: z.ZodDefault<z.ZodEnum<["auto", "web", "mobile", "desktop"]>>;
|
|
386
|
+
a11y: z.ZodDefault<z.ZodEnum<["off", "A", "AA", "AAA"]>>;
|
|
387
|
+
}, "strip", z.ZodTypeAny, {
|
|
388
|
+
level: "sketch" | "hifi";
|
|
389
|
+
platform: "mobile" | "web" | "desktop" | "auto";
|
|
390
|
+
a11y: "off" | "A" | "AA" | "AAA";
|
|
391
|
+
}, {
|
|
392
|
+
level?: "sketch" | "hifi" | undefined;
|
|
393
|
+
platform?: "mobile" | "web" | "desktop" | "auto" | undefined;
|
|
394
|
+
a11y?: "off" | "A" | "AA" | "AAA" | undefined;
|
|
395
|
+
}>>;
|
|
396
|
+
editor: z.ZodDefault<z.ZodObject<{
|
|
397
|
+
vscode: z.ZodDefault<z.ZodBoolean>;
|
|
398
|
+
lsp: z.ZodDefault<z.ZodBoolean>;
|
|
399
|
+
}, "strip", z.ZodTypeAny, {
|
|
400
|
+
vscode: boolean;
|
|
401
|
+
lsp: boolean;
|
|
402
|
+
}, {
|
|
403
|
+
vscode?: boolean | undefined;
|
|
404
|
+
lsp?: boolean | undefined;
|
|
405
|
+
}>>;
|
|
406
|
+
adapters: z.ZodDefault<z.ZodObject<{
|
|
407
|
+
targets: z.ZodDefault<z.ZodArray<z.ZodEnum<["opencode", "claude-code", "cursor", "copilot", "gemini", "codex", "generic"]>, "many">>;
|
|
408
|
+
}, "strip", z.ZodTypeAny, {
|
|
409
|
+
targets: ("opencode" | "claude-code" | "cursor" | "copilot" | "gemini" | "codex" | "generic")[];
|
|
410
|
+
}, {
|
|
411
|
+
targets?: ("opencode" | "claude-code" | "cursor" | "copilot" | "gemini" | "codex" | "generic")[] | undefined;
|
|
412
|
+
}>>;
|
|
413
|
+
packs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
414
|
+
integrations: z.ZodDefault<z.ZodObject<{
|
|
415
|
+
tracker: z.ZodDefault<z.ZodEnum<["none", "github", "jira", "linear", "clickup"]>>;
|
|
416
|
+
}, "strip", z.ZodTypeAny, {
|
|
417
|
+
tracker: "none" | "github" | "jira" | "linear" | "clickup";
|
|
418
|
+
}, {
|
|
419
|
+
tracker?: "none" | "github" | "jira" | "linear" | "clickup" | undefined;
|
|
420
|
+
}>>;
|
|
421
|
+
}, "strip", z.ZodTypeAny, {
|
|
422
|
+
editor: {
|
|
423
|
+
vscode: boolean;
|
|
424
|
+
lsp: boolean;
|
|
425
|
+
};
|
|
426
|
+
schema_version: number;
|
|
427
|
+
project: {
|
|
428
|
+
name: string;
|
|
429
|
+
language: "es" | "en";
|
|
430
|
+
};
|
|
431
|
+
lanes: {
|
|
432
|
+
default: "fix" | "standard" | "full";
|
|
433
|
+
allowed: ("fix" | "standard" | "full")[];
|
|
434
|
+
};
|
|
435
|
+
gates: {
|
|
436
|
+
approval: "file" | "none" | "github-label";
|
|
437
|
+
approval_label: string;
|
|
438
|
+
analyze: {
|
|
439
|
+
mode: "off" | "advisory" | "blocking";
|
|
440
|
+
min_severity: "low" | "medium" | "high";
|
|
441
|
+
};
|
|
442
|
+
verify: {
|
|
443
|
+
mode: "off" | "advisory" | "blocking";
|
|
444
|
+
require_evidence: boolean;
|
|
445
|
+
};
|
|
446
|
+
review: {
|
|
447
|
+
mode: "off" | "advisory" | "blocking";
|
|
448
|
+
};
|
|
449
|
+
mockup: {
|
|
450
|
+
require_approval: boolean;
|
|
451
|
+
compare_in_verify: boolean;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
trace: {
|
|
455
|
+
mode: "off" | "advisory" | "blocking";
|
|
456
|
+
prefix: string;
|
|
457
|
+
};
|
|
458
|
+
waves: {
|
|
459
|
+
max_parallel: number;
|
|
460
|
+
};
|
|
461
|
+
ci: {
|
|
462
|
+
drift: "advisory" | "strict";
|
|
463
|
+
};
|
|
464
|
+
spec: {
|
|
465
|
+
language: "es" | "en";
|
|
466
|
+
business_only: boolean;
|
|
467
|
+
glossary: string;
|
|
468
|
+
};
|
|
469
|
+
syntax: {
|
|
470
|
+
headers?: "es" | "en" | undefined;
|
|
471
|
+
};
|
|
472
|
+
mockups: {
|
|
473
|
+
level: "sketch" | "hifi";
|
|
474
|
+
platform: "mobile" | "web" | "desktop" | "auto";
|
|
475
|
+
a11y: "off" | "A" | "AA" | "AAA";
|
|
476
|
+
};
|
|
477
|
+
adapters: {
|
|
478
|
+
targets: ("opencode" | "claude-code" | "cursor" | "copilot" | "gemini" | "codex" | "generic")[];
|
|
479
|
+
};
|
|
480
|
+
packs: string[];
|
|
481
|
+
integrations: {
|
|
482
|
+
tracker: "none" | "github" | "jira" | "linear" | "clickup";
|
|
483
|
+
};
|
|
484
|
+
}, {
|
|
485
|
+
editor?: {
|
|
486
|
+
vscode?: boolean | undefined;
|
|
487
|
+
lsp?: boolean | undefined;
|
|
488
|
+
} | undefined;
|
|
489
|
+
schema_version?: number | undefined;
|
|
490
|
+
project?: {
|
|
491
|
+
name?: string | undefined;
|
|
492
|
+
language?: "es" | "en" | undefined;
|
|
493
|
+
} | undefined;
|
|
494
|
+
lanes?: {
|
|
495
|
+
default?: "fix" | "standard" | "full" | undefined;
|
|
496
|
+
allowed?: ("fix" | "standard" | "full")[] | undefined;
|
|
497
|
+
} | undefined;
|
|
498
|
+
gates?: {
|
|
499
|
+
approval?: "file" | "none" | "github-label" | undefined;
|
|
500
|
+
approval_label?: string | undefined;
|
|
501
|
+
analyze?: {
|
|
502
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
503
|
+
min_severity?: "low" | "medium" | "high" | undefined;
|
|
504
|
+
} | undefined;
|
|
505
|
+
verify?: {
|
|
506
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
507
|
+
require_evidence?: boolean | undefined;
|
|
508
|
+
} | undefined;
|
|
509
|
+
review?: {
|
|
510
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
511
|
+
} | undefined;
|
|
512
|
+
mockup?: {
|
|
513
|
+
require_approval?: boolean | undefined;
|
|
514
|
+
compare_in_verify?: boolean | undefined;
|
|
515
|
+
} | undefined;
|
|
516
|
+
} | undefined;
|
|
517
|
+
trace?: {
|
|
518
|
+
mode?: "off" | "advisory" | "blocking" | undefined;
|
|
519
|
+
prefix?: string | undefined;
|
|
520
|
+
} | undefined;
|
|
521
|
+
waves?: {
|
|
522
|
+
max_parallel?: number | undefined;
|
|
523
|
+
} | undefined;
|
|
524
|
+
ci?: {
|
|
525
|
+
drift?: "advisory" | "strict" | undefined;
|
|
526
|
+
} | undefined;
|
|
527
|
+
spec?: {
|
|
528
|
+
language?: "es" | "en" | undefined;
|
|
529
|
+
business_only?: boolean | undefined;
|
|
530
|
+
glossary?: string | undefined;
|
|
531
|
+
} | undefined;
|
|
532
|
+
syntax?: {
|
|
533
|
+
headers?: "es" | "en" | undefined;
|
|
534
|
+
} | undefined;
|
|
535
|
+
mockups?: {
|
|
536
|
+
level?: "sketch" | "hifi" | undefined;
|
|
537
|
+
platform?: "mobile" | "web" | "desktop" | "auto" | undefined;
|
|
538
|
+
a11y?: "off" | "A" | "AA" | "AAA" | undefined;
|
|
539
|
+
} | undefined;
|
|
540
|
+
adapters?: {
|
|
541
|
+
targets?: ("opencode" | "claude-code" | "cursor" | "copilot" | "gemini" | "codex" | "generic")[] | undefined;
|
|
542
|
+
} | undefined;
|
|
543
|
+
packs?: string[] | undefined;
|
|
544
|
+
integrations?: {
|
|
545
|
+
tracker?: "none" | "github" | "jira" | "linear" | "clickup" | undefined;
|
|
546
|
+
} | undefined;
|
|
547
|
+
}>;
|
|
548
|
+
type AtlasConfig = z.infer<typeof atlasConfigSchema>;
|
|
549
|
+
declare function defaultConfig(overrides?: {
|
|
550
|
+
name?: string;
|
|
551
|
+
language?: Language;
|
|
552
|
+
}): AtlasConfig;
|
|
553
|
+
declare function configToYaml(cfg: AtlasConfig): string;
|
|
554
|
+
interface LoadedConfig {
|
|
555
|
+
config: AtlasConfig;
|
|
556
|
+
diagnostics: Diagnostic[];
|
|
557
|
+
}
|
|
558
|
+
declare function parseConfig(raw: string, configPath?: string): LoadedConfig;
|
|
559
|
+
declare function loadConfig(sddDir: string): Promise<LoadedConfig>;
|
|
560
|
+
declare function writeConfig(sddDir: string, cfg: AtlasConfig): Promise<void>;
|
|
561
|
+
declare function laneOrDefault(cfg: AtlasConfig, lane?: string): Lane;
|
|
562
|
+
|
|
563
|
+
interface FrontmatterResult {
|
|
564
|
+
data: Record<string, unknown>;
|
|
565
|
+
body: string;
|
|
566
|
+
bodyStartLine: number;
|
|
567
|
+
diagnostics: Diagnostic[];
|
|
568
|
+
}
|
|
569
|
+
declare function parseFrontmatter(content: string, filePath?: string): FrontmatterResult;
|
|
570
|
+
declare function emitFrontmatter(data: Record<string, unknown>, body: string): string;
|
|
571
|
+
declare function getString(data: Record<string, unknown>, key: string): string | undefined;
|
|
572
|
+
declare function getNumber(data: Record<string, unknown>, key: string): number | undefined;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Canonicaliza markdown para hashing estable entre sistemas:
|
|
576
|
+
* - EOL siempre \n (clave en Windows)
|
|
577
|
+
* - sin BOM
|
|
578
|
+
* - sin espacios finales de línea
|
|
579
|
+
* - máximo una línea vacía consecutiva
|
|
580
|
+
* - sin líneas vacías al inicio o al final
|
|
581
|
+
*/
|
|
582
|
+
declare function canonicalizeMarkdown(md: string): string;
|
|
583
|
+
declare function sha256(content: string | Uint8Array): string;
|
|
584
|
+
declare function artifactHash(markdown: string): string;
|
|
585
|
+
declare function shortHash(hash: string): string;
|
|
586
|
+
|
|
587
|
+
declare const REQ_HEAD_RE: RegExp;
|
|
588
|
+
declare const SCENARIO_HEAD_RE: RegExp;
|
|
589
|
+
declare const RULE_RE: RegExp;
|
|
590
|
+
/**
|
|
591
|
+
* Extrae requisitos de un cuerpo markdown (sirve para specs vivas y para
|
|
592
|
+
* bloques dentro de un delta). Los encabezados aceptan español e inglés.
|
|
593
|
+
*/
|
|
594
|
+
declare function parseRequirementBlocks(body: string, startLine?: number, filePath?: string): {
|
|
595
|
+
requirements: Requirement[];
|
|
596
|
+
diagnostics: Diagnostic[];
|
|
597
|
+
};
|
|
598
|
+
declare function parseSpecFile(content: string, filePath: string): SpecFile;
|
|
599
|
+
declare function renderRequirement(req: Requirement, language?: 'es' | 'en'): string;
|
|
600
|
+
|
|
601
|
+
declare function parseDelta(content: string, filePath: string): Delta;
|
|
602
|
+
|
|
603
|
+
declare const BLOCK_HEAD_RE: RegExp;
|
|
604
|
+
declare const TASK_LINE_RE: RegExp;
|
|
605
|
+
declare function parseTasksFile(content: string, filePath: string): TasksFile;
|
|
606
|
+
|
|
607
|
+
declare function parseVerifyFile(content: string, filePath: string): VerifyFile;
|
|
608
|
+
|
|
609
|
+
declare const changeMetaSchema: z.ZodObject<{
|
|
610
|
+
schema_version: z.ZodDefault<z.ZodNumber>;
|
|
611
|
+
slug: z.ZodString;
|
|
612
|
+
title: z.ZodOptional<z.ZodString>;
|
|
613
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
614
|
+
lane: z.ZodDefault<z.ZodEnum<["fix", "standard", "full"]>>;
|
|
615
|
+
risk: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
616
|
+
created: z.ZodOptional<z.ZodString>;
|
|
617
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
618
|
+
tracker: z.ZodOptional<z.ZodObject<{
|
|
619
|
+
provider: z.ZodString;
|
|
620
|
+
id: z.ZodString;
|
|
621
|
+
}, "strip", z.ZodTypeAny, {
|
|
622
|
+
id: string;
|
|
623
|
+
provider: string;
|
|
624
|
+
}, {
|
|
625
|
+
id: string;
|
|
626
|
+
provider: string;
|
|
627
|
+
}>>;
|
|
628
|
+
paused: z.ZodOptional<z.ZodObject<{
|
|
629
|
+
reason: z.ZodString;
|
|
630
|
+
at: z.ZodString;
|
|
631
|
+
by: z.ZodString;
|
|
632
|
+
}, "strip", z.ZodTypeAny, {
|
|
633
|
+
at: string;
|
|
634
|
+
by: string;
|
|
635
|
+
reason: string;
|
|
636
|
+
}, {
|
|
637
|
+
at: string;
|
|
638
|
+
by: string;
|
|
639
|
+
reason: string;
|
|
640
|
+
}>>;
|
|
641
|
+
lane_history: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
642
|
+
from: z.ZodEnum<["fix", "standard", "full"]>;
|
|
643
|
+
to: z.ZodEnum<["fix", "standard", "full"]>;
|
|
644
|
+
at: z.ZodString;
|
|
645
|
+
by: z.ZodString;
|
|
646
|
+
}, "strip", z.ZodTypeAny, {
|
|
647
|
+
at: string;
|
|
648
|
+
by: string;
|
|
649
|
+
from: "fix" | "standard" | "full";
|
|
650
|
+
to: "fix" | "standard" | "full";
|
|
651
|
+
}, {
|
|
652
|
+
at: string;
|
|
653
|
+
by: string;
|
|
654
|
+
from: "fix" | "standard" | "full";
|
|
655
|
+
to: "fix" | "standard" | "full";
|
|
656
|
+
}>, "many">>;
|
|
657
|
+
diagram_exceptions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
658
|
+
overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
659
|
+
gate: z.ZodString;
|
|
660
|
+
reason: z.ZodString;
|
|
661
|
+
by: z.ZodString;
|
|
662
|
+
at: z.ZodString;
|
|
663
|
+
}, "strip", z.ZodTypeAny, {
|
|
664
|
+
at: string;
|
|
665
|
+
by: string;
|
|
666
|
+
reason: string;
|
|
667
|
+
gate: string;
|
|
668
|
+
}, {
|
|
669
|
+
at: string;
|
|
670
|
+
by: string;
|
|
671
|
+
reason: string;
|
|
672
|
+
gate: string;
|
|
673
|
+
}>, "many">>;
|
|
674
|
+
}, "strip", z.ZodTypeAny, {
|
|
675
|
+
schema_version: number;
|
|
676
|
+
slug: string;
|
|
677
|
+
lane: "fix" | "standard" | "full";
|
|
678
|
+
tracker?: {
|
|
679
|
+
id: string;
|
|
680
|
+
provider: string;
|
|
681
|
+
} | undefined;
|
|
682
|
+
domain?: string | undefined;
|
|
683
|
+
title?: string | undefined;
|
|
684
|
+
risk?: "low" | "medium" | "high" | undefined;
|
|
685
|
+
created?: string | undefined;
|
|
686
|
+
owner?: string | undefined;
|
|
687
|
+
paused?: {
|
|
688
|
+
at: string;
|
|
689
|
+
by: string;
|
|
690
|
+
reason: string;
|
|
691
|
+
} | undefined;
|
|
692
|
+
lane_history?: {
|
|
693
|
+
at: string;
|
|
694
|
+
by: string;
|
|
695
|
+
from: "fix" | "standard" | "full";
|
|
696
|
+
to: "fix" | "standard" | "full";
|
|
697
|
+
}[] | undefined;
|
|
698
|
+
diagram_exceptions?: string[] | undefined;
|
|
699
|
+
overrides?: {
|
|
700
|
+
at: string;
|
|
701
|
+
by: string;
|
|
702
|
+
reason: string;
|
|
703
|
+
gate: string;
|
|
704
|
+
}[] | undefined;
|
|
705
|
+
}, {
|
|
706
|
+
slug: string;
|
|
707
|
+
tracker?: {
|
|
708
|
+
id: string;
|
|
709
|
+
provider: string;
|
|
710
|
+
} | undefined;
|
|
711
|
+
schema_version?: number | undefined;
|
|
712
|
+
domain?: string | undefined;
|
|
713
|
+
title?: string | undefined;
|
|
714
|
+
lane?: "fix" | "standard" | "full" | undefined;
|
|
715
|
+
risk?: "low" | "medium" | "high" | undefined;
|
|
716
|
+
created?: string | undefined;
|
|
717
|
+
owner?: string | undefined;
|
|
718
|
+
paused?: {
|
|
719
|
+
at: string;
|
|
720
|
+
by: string;
|
|
721
|
+
reason: string;
|
|
722
|
+
} | undefined;
|
|
723
|
+
lane_history?: {
|
|
724
|
+
at: string;
|
|
725
|
+
by: string;
|
|
726
|
+
from: "fix" | "standard" | "full";
|
|
727
|
+
to: "fix" | "standard" | "full";
|
|
728
|
+
}[] | undefined;
|
|
729
|
+
diagram_exceptions?: string[] | undefined;
|
|
730
|
+
overrides?: {
|
|
731
|
+
at: string;
|
|
732
|
+
by: string;
|
|
733
|
+
reason: string;
|
|
734
|
+
gate: string;
|
|
735
|
+
}[] | undefined;
|
|
736
|
+
}>;
|
|
737
|
+
declare function parseChangeMeta(raw: string, filePath: string): {
|
|
738
|
+
meta?: ChangeMeta;
|
|
739
|
+
diagnostics: Diagnostic[];
|
|
740
|
+
};
|
|
741
|
+
declare const approvalsSchema: z.ZodObject<{
|
|
742
|
+
schema_version: z.ZodDefault<z.ZodNumber>;
|
|
743
|
+
approvals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
744
|
+
artifact: z.ZodString;
|
|
745
|
+
artifact_hash: z.ZodString;
|
|
746
|
+
approved_by: z.ZodString;
|
|
747
|
+
approved_at: z.ZodString;
|
|
748
|
+
channel: z.ZodDefault<z.ZodEnum<["presentation", "editor", "pr", "tracker", "cli"]>>;
|
|
749
|
+
note: z.ZodOptional<z.ZodString>;
|
|
750
|
+
}, "strip", z.ZodTypeAny, {
|
|
751
|
+
artifact: string;
|
|
752
|
+
artifact_hash: string;
|
|
753
|
+
approved_by: string;
|
|
754
|
+
approved_at: string;
|
|
755
|
+
channel: "presentation" | "editor" | "pr" | "tracker" | "cli";
|
|
756
|
+
note?: string | undefined;
|
|
757
|
+
}, {
|
|
758
|
+
artifact: string;
|
|
759
|
+
artifact_hash: string;
|
|
760
|
+
approved_by: string;
|
|
761
|
+
approved_at: string;
|
|
762
|
+
channel?: "presentation" | "editor" | "pr" | "tracker" | "cli" | undefined;
|
|
763
|
+
note?: string | undefined;
|
|
764
|
+
}>, "many">>;
|
|
765
|
+
}, "strip", z.ZodTypeAny, {
|
|
766
|
+
schema_version: number;
|
|
767
|
+
approvals: {
|
|
768
|
+
artifact: string;
|
|
769
|
+
artifact_hash: string;
|
|
770
|
+
approved_by: string;
|
|
771
|
+
approved_at: string;
|
|
772
|
+
channel: "presentation" | "editor" | "pr" | "tracker" | "cli";
|
|
773
|
+
note?: string | undefined;
|
|
774
|
+
}[];
|
|
775
|
+
}, {
|
|
776
|
+
schema_version?: number | undefined;
|
|
777
|
+
approvals?: {
|
|
778
|
+
artifact: string;
|
|
779
|
+
artifact_hash: string;
|
|
780
|
+
approved_by: string;
|
|
781
|
+
approved_at: string;
|
|
782
|
+
channel?: "presentation" | "editor" | "pr" | "tracker" | "cli" | undefined;
|
|
783
|
+
note?: string | undefined;
|
|
784
|
+
}[] | undefined;
|
|
785
|
+
}>;
|
|
786
|
+
declare function parseApprovals(raw: string, filePath: string): {
|
|
787
|
+
approvals?: ApprovalsFile;
|
|
788
|
+
diagnostics: Diagnostic[];
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
interface LintOptions {
|
|
792
|
+
language?: 'es' | 'en';
|
|
793
|
+
businessOnly?: boolean;
|
|
794
|
+
}
|
|
795
|
+
declare function lintRequirement(req: Requirement, path: string, opts?: LintOptions): Diagnostic[];
|
|
796
|
+
declare function lintDelta(delta: Delta, livingRequirements: Map<string, Requirement>, path: string, opts?: LintOptions): Diagnostic[];
|
|
797
|
+
declare function lintTasks(_tasks: TasksFile): Diagnostic[];
|
|
798
|
+
declare function lintVerify(_verify: VerifyFile): Diagnostic[];
|
|
799
|
+
declare function lintSpec(spec: SpecFile, opts?: LintOptions): Diagnostic[];
|
|
800
|
+
|
|
801
|
+
interface TraceNode {
|
|
802
|
+
kind: 'requirement' | 'scenario' | 'task' | 'evidence';
|
|
803
|
+
id: string;
|
|
804
|
+
}
|
|
805
|
+
interface TraceEdge {
|
|
806
|
+
from: string;
|
|
807
|
+
to: string;
|
|
808
|
+
kind: 'covers' | 'evidences' | 'depends';
|
|
809
|
+
}
|
|
810
|
+
interface TraceGraph {
|
|
811
|
+
nodes: TraceNode[];
|
|
812
|
+
edges: TraceEdge[];
|
|
813
|
+
}
|
|
814
|
+
interface TraceFinding extends Diagnostic {
|
|
815
|
+
target?: string;
|
|
816
|
+
}
|
|
817
|
+
interface TraceResult {
|
|
818
|
+
graph: TraceGraph;
|
|
819
|
+
findings: TraceFinding[];
|
|
820
|
+
summary: {
|
|
821
|
+
errors: number;
|
|
822
|
+
warnings: number;
|
|
823
|
+
infos: number;
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
interface TraceInput {
|
|
827
|
+
specs: SpecRef[];
|
|
828
|
+
change: Change;
|
|
829
|
+
requireEvidence: boolean;
|
|
830
|
+
}
|
|
831
|
+
declare function buildTraceGraph(input: TraceInput): TraceGraph;
|
|
832
|
+
declare function checkTrace(input: TraceInput): TraceResult;
|
|
833
|
+
|
|
834
|
+
interface BlockWavePlan {
|
|
835
|
+
block: string;
|
|
836
|
+
title: string;
|
|
837
|
+
waves: Task[][];
|
|
838
|
+
degraded: Array<{
|
|
839
|
+
task: string;
|
|
840
|
+
reason: 'file-collision' | 'orphan-dependency';
|
|
841
|
+
movedToWave: number;
|
|
842
|
+
}>;
|
|
843
|
+
diagnostics: Diagnostic[];
|
|
844
|
+
}
|
|
845
|
+
interface WavePlan {
|
|
846
|
+
maxParallel: number;
|
|
847
|
+
blocks: BlockWavePlan[];
|
|
848
|
+
summary: {
|
|
849
|
+
blocks: number;
|
|
850
|
+
waves: number;
|
|
851
|
+
tasks: number;
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
declare function compareTaskIds(a: string, b: string): number;
|
|
855
|
+
declare function planWaves(tasks: TasksFile, opts?: {
|
|
856
|
+
maxParallel?: number;
|
|
857
|
+
}): WavePlan;
|
|
858
|
+
declare function planBlock(block: TaskBlock, maxParallel: number): BlockWavePlan;
|
|
859
|
+
|
|
860
|
+
type ChangeState = 'draft' | 'spec_draft' | 'awaiting_approval' | 'approved' | 'planned' | 'building' | 'built' | 'verified' | 'ready' | 'archived';
|
|
861
|
+
interface NextAction {
|
|
862
|
+
command: string;
|
|
863
|
+
description: string;
|
|
864
|
+
requiresAgent: boolean;
|
|
865
|
+
}
|
|
866
|
+
interface DerivedState {
|
|
867
|
+
state: ChangeState;
|
|
868
|
+
blockedBy: string[];
|
|
869
|
+
nextAction: NextAction;
|
|
870
|
+
progress: {
|
|
871
|
+
tasksDone: number;
|
|
872
|
+
tasksTotal: number;
|
|
873
|
+
scenariosEvidenced: number;
|
|
874
|
+
scenariosTotal: number;
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
interface ApprovalStatus {
|
|
878
|
+
status: 'valid' | 'stale' | 'missing' | 'not_required' | 'overridden';
|
|
879
|
+
approvedBy?: string;
|
|
880
|
+
approvedAt?: string;
|
|
881
|
+
}
|
|
882
|
+
declare function verifyApproval(change: Change, approvals: Map<string, {
|
|
883
|
+
hash: string;
|
|
884
|
+
by: string;
|
|
885
|
+
at: string;
|
|
886
|
+
}>, cfg: AtlasConfig, specContent?: string): ApprovalStatus;
|
|
887
|
+
interface DeriveInput {
|
|
888
|
+
change: Change;
|
|
889
|
+
cfg: AtlasConfig;
|
|
890
|
+
approval: ApprovalStatus;
|
|
891
|
+
blockingFindings: number;
|
|
892
|
+
specContent?: string;
|
|
893
|
+
}
|
|
894
|
+
declare function deriveState(input: DeriveInput): DerivedState;
|
|
895
|
+
declare function stateLabel(state: ChangeState): string;
|
|
896
|
+
|
|
897
|
+
declare const profileSchema: z.ZodObject<{
|
|
898
|
+
name: z.ZodString;
|
|
899
|
+
display_name: z.ZodDefault<z.ZodString>;
|
|
900
|
+
detection: z.ZodDefault<z.ZodObject<{
|
|
901
|
+
files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
902
|
+
manifests: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
903
|
+
file: z.ZodString;
|
|
904
|
+
contains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
905
|
+
}, "strip", z.ZodTypeAny, {
|
|
906
|
+
file: string;
|
|
907
|
+
contains: string[];
|
|
908
|
+
}, {
|
|
909
|
+
file: string;
|
|
910
|
+
contains?: string[] | undefined;
|
|
911
|
+
}>, "many">>;
|
|
912
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
913
|
+
}, "strip", z.ZodTypeAny, {
|
|
914
|
+
files: string[];
|
|
915
|
+
manifests: {
|
|
916
|
+
file: string;
|
|
917
|
+
contains: string[];
|
|
918
|
+
}[];
|
|
919
|
+
priority: number;
|
|
920
|
+
}, {
|
|
921
|
+
files?: string[] | undefined;
|
|
922
|
+
manifests?: {
|
|
923
|
+
file: string;
|
|
924
|
+
contains?: string[] | undefined;
|
|
925
|
+
}[] | undefined;
|
|
926
|
+
priority?: number | undefined;
|
|
927
|
+
}>>;
|
|
928
|
+
domains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
929
|
+
commands: z.ZodDefault<z.ZodObject<{
|
|
930
|
+
build: z.ZodOptional<z.ZodString>;
|
|
931
|
+
lint: z.ZodOptional<z.ZodString>;
|
|
932
|
+
test: z.ZodOptional<z.ZodString>;
|
|
933
|
+
format: z.ZodOptional<z.ZodString>;
|
|
934
|
+
}, "strip", z.ZodTypeAny, {
|
|
935
|
+
build?: string | undefined;
|
|
936
|
+
lint?: string | undefined;
|
|
937
|
+
test?: string | undefined;
|
|
938
|
+
format?: string | undefined;
|
|
939
|
+
}, {
|
|
940
|
+
build?: string | undefined;
|
|
941
|
+
lint?: string | undefined;
|
|
942
|
+
test?: string | undefined;
|
|
943
|
+
format?: string | undefined;
|
|
944
|
+
}>>;
|
|
945
|
+
verify: z.ZodDefault<z.ZodObject<{
|
|
946
|
+
executable: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
947
|
+
automatic: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
948
|
+
manual: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
949
|
+
}, "strip", z.ZodTypeAny, {
|
|
950
|
+
executable: string[];
|
|
951
|
+
automatic: string[];
|
|
952
|
+
manual: string[];
|
|
953
|
+
}, {
|
|
954
|
+
executable?: string[] | undefined;
|
|
955
|
+
automatic?: string[] | undefined;
|
|
956
|
+
manual?: string[] | undefined;
|
|
957
|
+
}>>;
|
|
958
|
+
rollback: z.ZodDefault<z.ZodString>;
|
|
959
|
+
antipatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
960
|
+
assumptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
961
|
+
}, "strip", z.ZodTypeAny, {
|
|
962
|
+
name: string;
|
|
963
|
+
verify: {
|
|
964
|
+
executable: string[];
|
|
965
|
+
automatic: string[];
|
|
966
|
+
manual: string[];
|
|
967
|
+
};
|
|
968
|
+
rollback: string;
|
|
969
|
+
display_name: string;
|
|
970
|
+
detection: {
|
|
971
|
+
files: string[];
|
|
972
|
+
manifests: {
|
|
973
|
+
file: string;
|
|
974
|
+
contains: string[];
|
|
975
|
+
}[];
|
|
976
|
+
priority: number;
|
|
977
|
+
};
|
|
978
|
+
domains: string[];
|
|
979
|
+
commands: {
|
|
980
|
+
build?: string | undefined;
|
|
981
|
+
lint?: string | undefined;
|
|
982
|
+
test?: string | undefined;
|
|
983
|
+
format?: string | undefined;
|
|
984
|
+
};
|
|
985
|
+
antipatterns: string[];
|
|
986
|
+
assumptions: string[];
|
|
987
|
+
}, {
|
|
988
|
+
name: string;
|
|
989
|
+
verify?: {
|
|
990
|
+
executable?: string[] | undefined;
|
|
991
|
+
automatic?: string[] | undefined;
|
|
992
|
+
manual?: string[] | undefined;
|
|
993
|
+
} | undefined;
|
|
994
|
+
rollback?: string | undefined;
|
|
995
|
+
display_name?: string | undefined;
|
|
996
|
+
detection?: {
|
|
997
|
+
files?: string[] | undefined;
|
|
998
|
+
manifests?: {
|
|
999
|
+
file: string;
|
|
1000
|
+
contains?: string[] | undefined;
|
|
1001
|
+
}[] | undefined;
|
|
1002
|
+
priority?: number | undefined;
|
|
1003
|
+
} | undefined;
|
|
1004
|
+
domains?: string[] | undefined;
|
|
1005
|
+
commands?: {
|
|
1006
|
+
build?: string | undefined;
|
|
1007
|
+
lint?: string | undefined;
|
|
1008
|
+
test?: string | undefined;
|
|
1009
|
+
format?: string | undefined;
|
|
1010
|
+
} | undefined;
|
|
1011
|
+
antipatterns?: string[] | undefined;
|
|
1012
|
+
assumptions?: string[] | undefined;
|
|
1013
|
+
}>;
|
|
1014
|
+
type StackProfile = z.infer<typeof profileSchema>;
|
|
1015
|
+
interface ProfileMatch {
|
|
1016
|
+
name: string;
|
|
1017
|
+
displayName: string;
|
|
1018
|
+
score: number;
|
|
1019
|
+
domains: string[];
|
|
1020
|
+
path: string;
|
|
1021
|
+
}
|
|
1022
|
+
interface DetectionResult {
|
|
1023
|
+
matches: ProfileMatch[];
|
|
1024
|
+
best?: ProfileMatch;
|
|
1025
|
+
}
|
|
1026
|
+
declare function matchGlob(pattern: string, filePath: string): boolean;
|
|
1027
|
+
declare function loadProfileFile(filePath: string): Promise<StackProfile | undefined>;
|
|
1028
|
+
declare function loadProfilesFromDir(dir: string): Promise<StackProfile[]>;
|
|
1029
|
+
declare function detectProfiles(root: string, profiles: StackProfile[]): Promise<DetectionResult>;
|
|
1030
|
+
declare function loadDetectedBest(sddDir: string): Promise<string | undefined>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Devuelve el perfil activo del proyecto (el "best" de detected.yaml) buscándolo
|
|
1033
|
+
* en los directorios de perfiles dados; fallback al perfil genérico si existe.
|
|
1034
|
+
*/
|
|
1035
|
+
declare function loadActiveProfile(sddDir: string, dirs: string[]): Promise<StackProfile | undefined>;
|
|
1036
|
+
declare function detectionToYaml(result: DetectionResult, generatedAt: string): string;
|
|
1037
|
+
|
|
1038
|
+
declare const SDD_DIR = ".sdd";
|
|
1039
|
+
declare function findWorkspaceRoot(start: string): Promise<string | undefined>;
|
|
1040
|
+
interface ApprovalsIndex {
|
|
1041
|
+
byArtifact: Map<string, {
|
|
1042
|
+
hash: string;
|
|
1043
|
+
by: string;
|
|
1044
|
+
at: string;
|
|
1045
|
+
}>;
|
|
1046
|
+
diagnostics: Diagnostic[];
|
|
1047
|
+
}
|
|
1048
|
+
declare function loadApprovals(sddDir: string): Promise<ApprovalsIndex>;
|
|
1049
|
+
declare function loadSpecs(sddDir: string): Promise<SpecRef[]>;
|
|
1050
|
+
declare function loadChange(root: string, slug: string): Promise<Change>;
|
|
1051
|
+
declare function listChangeSlugs(root: string, opts?: {
|
|
1052
|
+
includeArchived?: boolean;
|
|
1053
|
+
}): Promise<string[]>;
|
|
1054
|
+
declare function loadWorkspace(root: string): Promise<{
|
|
1055
|
+
workspace: Workspace;
|
|
1056
|
+
config: AtlasConfig;
|
|
1057
|
+
}>;
|
|
1058
|
+
declare function ensureSddDirs(sddDir: string): Promise<string[]>;
|
|
1059
|
+
|
|
1060
|
+
interface TemplateSet {
|
|
1061
|
+
constitution: string;
|
|
1062
|
+
glossary: string;
|
|
1063
|
+
proposal: string;
|
|
1064
|
+
specDelta: (vars: {
|
|
1065
|
+
title: string;
|
|
1066
|
+
domainUpper: string;
|
|
1067
|
+
domain: string;
|
|
1068
|
+
}) => string;
|
|
1069
|
+
plan: string;
|
|
1070
|
+
tasks: string;
|
|
1071
|
+
verify: string;
|
|
1072
|
+
fix: string;
|
|
1073
|
+
}
|
|
1074
|
+
declare function templatesFor(language: Language): TemplateSet;
|
|
1075
|
+
declare function renderTemplate(template: string, vars: Record<string, string>): string;
|
|
1076
|
+
declare function changeMetaYaml(meta: ChangeMeta): string;
|
|
1077
|
+
declare function indexMarkdown(input: {
|
|
1078
|
+
projectName: string;
|
|
1079
|
+
language: Language;
|
|
1080
|
+
specs: Array<{
|
|
1081
|
+
domain: string;
|
|
1082
|
+
requirements: number;
|
|
1083
|
+
}>;
|
|
1084
|
+
changes: Array<{
|
|
1085
|
+
slug: string;
|
|
1086
|
+
lane: Lane;
|
|
1087
|
+
}>;
|
|
1088
|
+
archived: number;
|
|
1089
|
+
}): string;
|
|
1090
|
+
|
|
1091
|
+
interface SignApprovalOptions {
|
|
1092
|
+
root: string;
|
|
1093
|
+
artifact: string;
|
|
1094
|
+
by: string;
|
|
1095
|
+
channel?: Approval['channel'];
|
|
1096
|
+
note?: string;
|
|
1097
|
+
now?: Date;
|
|
1098
|
+
dryRun?: boolean;
|
|
1099
|
+
}
|
|
1100
|
+
interface SignApprovalResult {
|
|
1101
|
+
approval?: Approval;
|
|
1102
|
+
file: string;
|
|
1103
|
+
diagnostics: Diagnostic[];
|
|
1104
|
+
}
|
|
1105
|
+
declare function signApproval(opts: SignApprovalOptions): Promise<SignApprovalResult>;
|
|
1106
|
+
|
|
1107
|
+
interface ExecResult {
|
|
1108
|
+
ok: boolean;
|
|
1109
|
+
exitCode: number;
|
|
1110
|
+
stdout: string;
|
|
1111
|
+
stderr: string;
|
|
1112
|
+
durationMs: number;
|
|
1113
|
+
command: string;
|
|
1114
|
+
resolvedBinary: string;
|
|
1115
|
+
}
|
|
1116
|
+
interface ExecOptions {
|
|
1117
|
+
cwd?: string;
|
|
1118
|
+
timeoutMs?: number;
|
|
1119
|
+
maxBytes?: number;
|
|
1120
|
+
input?: string;
|
|
1121
|
+
}
|
|
1122
|
+
declare function hasShellMetacharacters(command: string): boolean;
|
|
1123
|
+
declare function splitCommand(command: string): string[];
|
|
1124
|
+
declare function firstToken(command: string): string;
|
|
1125
|
+
/**
|
|
1126
|
+
* Ejecuta un comando sin shell, con timeout y sin interpretar metacaracteres.
|
|
1127
|
+
* En Windows prueba el sufijo .cmd para binarios de npm cuando hace falta.
|
|
1128
|
+
*/
|
|
1129
|
+
declare function runProcess(command: string, opts?: ExecOptions): Promise<ExecResult>;
|
|
1130
|
+
declare function isCommandAllowed(command: string, allowedPrefixes: string[]): boolean;
|
|
1131
|
+
|
|
1132
|
+
type GhRunner = (command: string, opts?: ExecOptions) => Promise<ExecResult>;
|
|
1133
|
+
interface GitHubRepo {
|
|
1134
|
+
owner: string;
|
|
1135
|
+
name: string;
|
|
1136
|
+
}
|
|
1137
|
+
declare function parseGitHubRemote(url: string): GitHubRepo | undefined;
|
|
1138
|
+
declare function changeMarker(slug: string): string;
|
|
1139
|
+
declare function ghAvailable(runner?: GhRunner): Promise<boolean>;
|
|
1140
|
+
declare function ghAuthStatus(runner?: GhRunner): Promise<boolean>;
|
|
1141
|
+
declare function detectRepo(root: string, runner?: GhRunner): Promise<GitHubRepo | undefined>;
|
|
1142
|
+
interface IssueBodyInput {
|
|
1143
|
+
change: Change;
|
|
1144
|
+
next: string;
|
|
1145
|
+
nextDescription: string;
|
|
1146
|
+
scenarios: number;
|
|
1147
|
+
}
|
|
1148
|
+
declare function issueBody(input: IssueBodyInput): string;
|
|
1149
|
+
interface LinkedIssue {
|
|
1150
|
+
number: number;
|
|
1151
|
+
url: string;
|
|
1152
|
+
title: string;
|
|
1153
|
+
state: string;
|
|
1154
|
+
}
|
|
1155
|
+
declare function findLinkedIssue(root: string, slug: string, runner?: GhRunner): Promise<LinkedIssue | undefined>;
|
|
1156
|
+
declare function parseIssueUrl(url: string): LinkedIssue | undefined;
|
|
1157
|
+
declare function createIssue(root: string, opts: {
|
|
1158
|
+
title: string;
|
|
1159
|
+
body: string;
|
|
1160
|
+
labels?: string[];
|
|
1161
|
+
}, runner?: GhRunner): Promise<{
|
|
1162
|
+
issue?: LinkedIssue;
|
|
1163
|
+
diagnostics: Diagnostic[];
|
|
1164
|
+
}>;
|
|
1165
|
+
declare function editIssue(root: string, number: number, opts: {
|
|
1166
|
+
title?: string;
|
|
1167
|
+
body?: string;
|
|
1168
|
+
}, runner?: GhRunner): Promise<Diagnostic[]>;
|
|
1169
|
+
declare function issueLabels(root: string, number: number, runner?: GhRunner): Promise<{
|
|
1170
|
+
labels: string[];
|
|
1171
|
+
diagnostics: Diagnostic[];
|
|
1172
|
+
}>;
|
|
1173
|
+
declare function commentIssue(root: string, number: number, body: string, runner?: GhRunner): Promise<Diagnostic[]>;
|
|
1174
|
+
declare function patchChangeMeta(root: string, slug: string, patch: Record<string, unknown>): Promise<{
|
|
1175
|
+
path: string;
|
|
1176
|
+
diagnostics: Diagnostic[];
|
|
1177
|
+
}>;
|
|
1178
|
+
interface ApproveFromGithubOptions {
|
|
1179
|
+
root: string;
|
|
1180
|
+
slug: string;
|
|
1181
|
+
label?: string;
|
|
1182
|
+
by?: string;
|
|
1183
|
+
runner?: GhRunner;
|
|
1184
|
+
}
|
|
1185
|
+
interface ApproveFromGithubResult {
|
|
1186
|
+
approved: boolean;
|
|
1187
|
+
label: string;
|
|
1188
|
+
issueNumber?: number;
|
|
1189
|
+
approvedBy?: string;
|
|
1190
|
+
diagnostics: Diagnostic[];
|
|
1191
|
+
}
|
|
1192
|
+
declare function approveFromGithub(opts: ApproveFromGithubOptions): Promise<ApproveFromGithubResult>;
|
|
1193
|
+
interface SyncGithubOptions {
|
|
1194
|
+
labels?: string[];
|
|
1195
|
+
next?: {
|
|
1196
|
+
command: string;
|
|
1197
|
+
description: string;
|
|
1198
|
+
};
|
|
1199
|
+
runner?: GhRunner;
|
|
1200
|
+
}
|
|
1201
|
+
interface SyncGithubResult {
|
|
1202
|
+
slug: string;
|
|
1203
|
+
created: boolean;
|
|
1204
|
+
issue?: LinkedIssue;
|
|
1205
|
+
diagnostics: Diagnostic[];
|
|
1206
|
+
}
|
|
1207
|
+
declare function syncGithubIssue(root: string, slug: string, opts?: SyncGithubOptions): Promise<SyncGithubResult>;
|
|
1208
|
+
|
|
1209
|
+
interface RecordEvidenceOptions {
|
|
1210
|
+
root: string;
|
|
1211
|
+
slug: string;
|
|
1212
|
+
scenario: string;
|
|
1213
|
+
command?: string;
|
|
1214
|
+
method?: EvidenceMethod;
|
|
1215
|
+
result?: EvidenceResult;
|
|
1216
|
+
by: string;
|
|
1217
|
+
notes?: string;
|
|
1218
|
+
allowCommand?: boolean;
|
|
1219
|
+
allowedPrefixes?: string[];
|
|
1220
|
+
timeoutMs?: number;
|
|
1221
|
+
now?: Date;
|
|
1222
|
+
dryRun?: boolean;
|
|
1223
|
+
file?: 'verify' | 'fix';
|
|
1224
|
+
}
|
|
1225
|
+
interface RecordEvidenceResult {
|
|
1226
|
+
evidence?: Evidence;
|
|
1227
|
+
exitCode: number;
|
|
1228
|
+
stdout?: string;
|
|
1229
|
+
stderr?: string;
|
|
1230
|
+
path: string;
|
|
1231
|
+
diagnostics: Diagnostic[];
|
|
1232
|
+
}
|
|
1233
|
+
declare function recordEvidence(opts: RecordEvidenceOptions): Promise<RecordEvidenceResult>;
|
|
1234
|
+
declare function evidenceSummary(content: string): Map<string, EvidenceResult>;
|
|
1235
|
+
|
|
1236
|
+
type RunStatus = 'active' | 'paused' | 'completed' | 'aborted';
|
|
1237
|
+
declare const RUN_EVENT_TYPES: readonly ["run_started", "task_started", "task_completed", "wave_started", "wave_completed", "block_started", "block_completed", "validate_run", "trace_run", "analyze_run", "verify_run", "mockup_checked", "presentation_generated", "override_applied", "paused", "resumed", "run_completed"];
|
|
1238
|
+
type RunEventType = (typeof RUN_EVENT_TYPES)[number];
|
|
1239
|
+
interface RunState {
|
|
1240
|
+
runId: string;
|
|
1241
|
+
slug: string;
|
|
1242
|
+
phase: string;
|
|
1243
|
+
status: RunStatus;
|
|
1244
|
+
startedAt: string;
|
|
1245
|
+
updatedAt: string;
|
|
1246
|
+
inputs?: Record<string, unknown>;
|
|
1247
|
+
}
|
|
1248
|
+
interface RunEvent {
|
|
1249
|
+
eventId: string;
|
|
1250
|
+
at: string;
|
|
1251
|
+
type: string;
|
|
1252
|
+
data?: Record<string, unknown>;
|
|
1253
|
+
}
|
|
1254
|
+
interface RunRecord {
|
|
1255
|
+
state: RunState;
|
|
1256
|
+
events: RunEvent[];
|
|
1257
|
+
}
|
|
1258
|
+
declare function generateRunId(now?: Date): string;
|
|
1259
|
+
declare function createRun(root: string, slug: string, phase: string, inputs?: Record<string, unknown>, now?: Date): Promise<RunState>;
|
|
1260
|
+
declare function appendRunEvent(root: string, runId: string, type: string, data?: Record<string, unknown>, now?: Date): Promise<RunEvent>;
|
|
1261
|
+
declare function updateRunStatus(root: string, runId: string, status: RunStatus, now?: Date): Promise<void>;
|
|
1262
|
+
declare function readRun(root: string, runId: string): Promise<{
|
|
1263
|
+
record?: RunRecord;
|
|
1264
|
+
diagnostics: Diagnostic[];
|
|
1265
|
+
}>;
|
|
1266
|
+
declare function listRuns(root: string, filter?: {
|
|
1267
|
+
slug?: string;
|
|
1268
|
+
status?: RunStatus;
|
|
1269
|
+
}): Promise<RunState[]>;
|
|
1270
|
+
|
|
1271
|
+
interface AnalyzeOptions {
|
|
1272
|
+
root: string;
|
|
1273
|
+
slug: string;
|
|
1274
|
+
now?: Date;
|
|
1275
|
+
write?: boolean;
|
|
1276
|
+
}
|
|
1277
|
+
interface AnalyzePackSummary {
|
|
1278
|
+
id: string;
|
|
1279
|
+
title: string;
|
|
1280
|
+
status: 'ok' | 'fail' | 'n/a';
|
|
1281
|
+
passed: number;
|
|
1282
|
+
failed: number;
|
|
1283
|
+
}
|
|
1284
|
+
interface AnalyzeResult {
|
|
1285
|
+
slug: string;
|
|
1286
|
+
status: 'passed' | 'passed_with_debt' | 'blocked';
|
|
1287
|
+
findings: Diagnostic[];
|
|
1288
|
+
path?: string;
|
|
1289
|
+
summary: {
|
|
1290
|
+
errors: number;
|
|
1291
|
+
warnings: number;
|
|
1292
|
+
infos: number;
|
|
1293
|
+
};
|
|
1294
|
+
waves?: {
|
|
1295
|
+
blocks: number;
|
|
1296
|
+
waves: number;
|
|
1297
|
+
tasks: number;
|
|
1298
|
+
};
|
|
1299
|
+
evidence: {
|
|
1300
|
+
done: number;
|
|
1301
|
+
total: number;
|
|
1302
|
+
};
|
|
1303
|
+
mockups?: {
|
|
1304
|
+
screens: number;
|
|
1305
|
+
stale: boolean;
|
|
1306
|
+
};
|
|
1307
|
+
packs?: AnalyzePackSummary[];
|
|
1308
|
+
}
|
|
1309
|
+
declare function runAnalyze(opts: AnalyzeOptions): Promise<AnalyzeResult>;
|
|
1310
|
+
|
|
1311
|
+
interface ChangeMetrics {
|
|
1312
|
+
slug: string;
|
|
1313
|
+
title?: string;
|
|
1314
|
+
domain?: string;
|
|
1315
|
+
lane: string;
|
|
1316
|
+
state: ChangeState;
|
|
1317
|
+
stateLabel: string;
|
|
1318
|
+
tasksDone: number;
|
|
1319
|
+
tasksTotal: number;
|
|
1320
|
+
scenariosTotal: number;
|
|
1321
|
+
scenariosPassed: number;
|
|
1322
|
+
findingsErrors: number;
|
|
1323
|
+
findingsWarnings: number;
|
|
1324
|
+
blockedBy: string[];
|
|
1325
|
+
next: string;
|
|
1326
|
+
ageDays?: number;
|
|
1327
|
+
}
|
|
1328
|
+
interface AgingBucket {
|
|
1329
|
+
label: string;
|
|
1330
|
+
value: number;
|
|
1331
|
+
}
|
|
1332
|
+
interface AttentionItem {
|
|
1333
|
+
slug: string;
|
|
1334
|
+
kind: 'blocked' | 'aging' | 'missing-evidence';
|
|
1335
|
+
detail: string;
|
|
1336
|
+
}
|
|
1337
|
+
interface WorkspaceMetrics {
|
|
1338
|
+
generatedAt: string;
|
|
1339
|
+
project: string;
|
|
1340
|
+
root: string;
|
|
1341
|
+
changes: ChangeMetrics[];
|
|
1342
|
+
totals: {
|
|
1343
|
+
changes: number;
|
|
1344
|
+
tasks: number;
|
|
1345
|
+
tasksDone: number;
|
|
1346
|
+
scenarios: number;
|
|
1347
|
+
scenariosPassed: number;
|
|
1348
|
+
errors: number;
|
|
1349
|
+
warnings: number;
|
|
1350
|
+
archived: number;
|
|
1351
|
+
};
|
|
1352
|
+
wipByState: Record<string, {
|
|
1353
|
+
label: string;
|
|
1354
|
+
count: number;
|
|
1355
|
+
}>;
|
|
1356
|
+
throughputByMonth: Record<string, number>;
|
|
1357
|
+
evidenceByMethod: Record<string, number>;
|
|
1358
|
+
blocked: Array<{
|
|
1359
|
+
slug: string;
|
|
1360
|
+
reason: string;
|
|
1361
|
+
}>;
|
|
1362
|
+
aging: {
|
|
1363
|
+
averageDays?: number;
|
|
1364
|
+
oldest?: {
|
|
1365
|
+
slug: string;
|
|
1366
|
+
ageDays: number;
|
|
1367
|
+
};
|
|
1368
|
+
buckets: AgingBucket[];
|
|
1369
|
+
};
|
|
1370
|
+
byLane: Array<{
|
|
1371
|
+
label: string;
|
|
1372
|
+
value: number;
|
|
1373
|
+
}>;
|
|
1374
|
+
attention: AttentionItem[];
|
|
1375
|
+
}
|
|
1376
|
+
declare function collectMetrics(root: string, now?: Date): Promise<WorkspaceMetrics>;
|
|
1377
|
+
|
|
1378
|
+
type PackCheckType = 'task-rollback' | 'evidence-strong' | 'spec-terms' | 'rule-terms' | 'nfr-measurable' | 'approval-provider';
|
|
1379
|
+
interface PackCheck {
|
|
1380
|
+
id: string;
|
|
1381
|
+
title: string;
|
|
1382
|
+
type: PackCheckType;
|
|
1383
|
+
severity: Severity;
|
|
1384
|
+
appliesTo?: {
|
|
1385
|
+
domains?: string[];
|
|
1386
|
+
lanes?: Lane[];
|
|
1387
|
+
};
|
|
1388
|
+
params?: {
|
|
1389
|
+
terms?: string[];
|
|
1390
|
+
};
|
|
1391
|
+
hint?: string;
|
|
1392
|
+
}
|
|
1393
|
+
interface Pack {
|
|
1394
|
+
id: string;
|
|
1395
|
+
title: string;
|
|
1396
|
+
description: string;
|
|
1397
|
+
source: 'builtin' | 'project';
|
|
1398
|
+
checks: PackCheck[];
|
|
1399
|
+
}
|
|
1400
|
+
declare const BUILTIN_PACKS: Pack[];
|
|
1401
|
+
interface PackCheckResult {
|
|
1402
|
+
packId: string;
|
|
1403
|
+
checkId: string;
|
|
1404
|
+
title: string;
|
|
1405
|
+
severity: Severity;
|
|
1406
|
+
status: 'ok' | 'fail' | 'n/a';
|
|
1407
|
+
message?: string;
|
|
1408
|
+
hint?: string;
|
|
1409
|
+
}
|
|
1410
|
+
interface PackEvaluation {
|
|
1411
|
+
pack: Pack;
|
|
1412
|
+
status: 'ok' | 'fail' | 'n/a';
|
|
1413
|
+
results: PackCheckResult[];
|
|
1414
|
+
passed: number;
|
|
1415
|
+
failed: number;
|
|
1416
|
+
}
|
|
1417
|
+
declare function loadProjectPacks(sddDir: string): Promise<{
|
|
1418
|
+
packs: Pack[];
|
|
1419
|
+
diagnostics: Diagnostic[];
|
|
1420
|
+
}>;
|
|
1421
|
+
declare function resolvePacks(sddDir: string, config: AtlasConfig): Promise<{
|
|
1422
|
+
packs: Pack[];
|
|
1423
|
+
diagnostics: Diagnostic[];
|
|
1424
|
+
}>;
|
|
1425
|
+
declare function evaluatePacks(packs: Pack[], change: Change, config: AtlasConfig): PackEvaluation[];
|
|
1426
|
+
declare function packFindings(evaluations: PackEvaluation[], change: Change): Diagnostic[];
|
|
1427
|
+
|
|
1428
|
+
interface PresentOptions {
|
|
1429
|
+
root: string;
|
|
1430
|
+
slug: string;
|
|
1431
|
+
now?: Date;
|
|
1432
|
+
}
|
|
1433
|
+
interface PresentResult {
|
|
1434
|
+
slug: string;
|
|
1435
|
+
path?: string;
|
|
1436
|
+
hash?: string;
|
|
1437
|
+
diagnostics: Diagnostic[];
|
|
1438
|
+
}
|
|
1439
|
+
declare function generatePresentation(opts: PresentOptions): Promise<PresentResult>;
|
|
1440
|
+
declare function esc(text: string): string;
|
|
1441
|
+
declare function inline(text: string): string;
|
|
1442
|
+
declare function renderMarkdown(markdown: string): string;
|
|
1443
|
+
|
|
1444
|
+
declare const mockupManifestSchema: z.ZodObject<{
|
|
1445
|
+
schema_version: z.ZodDefault<z.ZodNumber>;
|
|
1446
|
+
version: z.ZodDefault<z.ZodNumber>;
|
|
1447
|
+
level: z.ZodDefault<z.ZodEnum<["sketch", "hifi"]>>;
|
|
1448
|
+
platform: z.ZodDefault<z.ZodEnum<["web", "mobile", "desktop"]>>;
|
|
1449
|
+
inputs_hash: z.ZodOptional<z.ZodString>;
|
|
1450
|
+
generated_at: z.ZodOptional<z.ZodString>;
|
|
1451
|
+
tokens: z.ZodOptional<z.ZodString>;
|
|
1452
|
+
screens: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1453
|
+
id: z.ZodString;
|
|
1454
|
+
file: z.ZodString;
|
|
1455
|
+
title: z.ZodOptional<z.ZodString>;
|
|
1456
|
+
illustrates: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1457
|
+
states: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1458
|
+
breakpoints: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
1459
|
+
themes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1460
|
+
}, "strip", z.ZodTypeAny, {
|
|
1461
|
+
file: string;
|
|
1462
|
+
id: string;
|
|
1463
|
+
illustrates: string[];
|
|
1464
|
+
states: string[];
|
|
1465
|
+
breakpoints: number[];
|
|
1466
|
+
themes: string[];
|
|
1467
|
+
title?: string | undefined;
|
|
1468
|
+
}, {
|
|
1469
|
+
file: string;
|
|
1470
|
+
id: string;
|
|
1471
|
+
title?: string | undefined;
|
|
1472
|
+
illustrates?: string[] | undefined;
|
|
1473
|
+
states?: string[] | undefined;
|
|
1474
|
+
breakpoints?: number[] | undefined;
|
|
1475
|
+
themes?: string[] | undefined;
|
|
1476
|
+
}>, "many">>;
|
|
1477
|
+
screenshots: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1478
|
+
}, "strip", z.ZodTypeAny, {
|
|
1479
|
+
schema_version: number;
|
|
1480
|
+
level: "sketch" | "hifi";
|
|
1481
|
+
platform: "mobile" | "web" | "desktop";
|
|
1482
|
+
version: number;
|
|
1483
|
+
screens: {
|
|
1484
|
+
file: string;
|
|
1485
|
+
id: string;
|
|
1486
|
+
illustrates: string[];
|
|
1487
|
+
states: string[];
|
|
1488
|
+
breakpoints: number[];
|
|
1489
|
+
themes: string[];
|
|
1490
|
+
title?: string | undefined;
|
|
1491
|
+
}[];
|
|
1492
|
+
screenshots: string[];
|
|
1493
|
+
inputs_hash?: string | undefined;
|
|
1494
|
+
generated_at?: string | undefined;
|
|
1495
|
+
tokens?: string | undefined;
|
|
1496
|
+
}, {
|
|
1497
|
+
schema_version?: number | undefined;
|
|
1498
|
+
level?: "sketch" | "hifi" | undefined;
|
|
1499
|
+
platform?: "mobile" | "web" | "desktop" | undefined;
|
|
1500
|
+
version?: number | undefined;
|
|
1501
|
+
inputs_hash?: string | undefined;
|
|
1502
|
+
generated_at?: string | undefined;
|
|
1503
|
+
tokens?: string | undefined;
|
|
1504
|
+
screens?: {
|
|
1505
|
+
file: string;
|
|
1506
|
+
id: string;
|
|
1507
|
+
title?: string | undefined;
|
|
1508
|
+
illustrates?: string[] | undefined;
|
|
1509
|
+
states?: string[] | undefined;
|
|
1510
|
+
breakpoints?: number[] | undefined;
|
|
1511
|
+
themes?: string[] | undefined;
|
|
1512
|
+
}[] | undefined;
|
|
1513
|
+
screenshots?: string[] | undefined;
|
|
1514
|
+
}>;
|
|
1515
|
+
interface MockupPlanScreen {
|
|
1516
|
+
id: string;
|
|
1517
|
+
title: string;
|
|
1518
|
+
file: string;
|
|
1519
|
+
illustrates: string[];
|
|
1520
|
+
states: string[];
|
|
1521
|
+
breakpoints: number[];
|
|
1522
|
+
}
|
|
1523
|
+
interface MockupPlan {
|
|
1524
|
+
platform: 'web' | 'mobile' | 'desktop';
|
|
1525
|
+
screens: MockupPlanScreen[];
|
|
1526
|
+
}
|
|
1527
|
+
interface MockupCheckResult {
|
|
1528
|
+
findings: Diagnostic[];
|
|
1529
|
+
stale: boolean;
|
|
1530
|
+
manifest?: MockupManifest;
|
|
1531
|
+
manifestPath?: string;
|
|
1532
|
+
}
|
|
1533
|
+
declare function mockupsDir(root: string, slug: string): string;
|
|
1534
|
+
declare function tokensFile(root: string): Promise<string | undefined>;
|
|
1535
|
+
declare function computeInputsHash(root: string, change: Change): Promise<string>;
|
|
1536
|
+
declare function planMockups(change: Change, platform?: 'web' | 'mobile' | 'desktop'): MockupPlan;
|
|
1537
|
+
declare function readMockupManifest(root: string, slug: string): Promise<{
|
|
1538
|
+
manifest?: MockupManifest;
|
|
1539
|
+
path?: string;
|
|
1540
|
+
diagnostics: Diagnostic[];
|
|
1541
|
+
}>;
|
|
1542
|
+
declare function lintMockupHtml(html: string, file: string): Diagnostic[];
|
|
1543
|
+
declare function lintMockupManifest(manifest: MockupManifest, knownScenarios: Set<string>, file: string): Diagnostic[];
|
|
1544
|
+
declare function checkMockups(root: string, slug: string, change: Change): Promise<MockupCheckResult>;
|
|
1545
|
+
declare function writeMockupPlan(root: string, slug: string, plan: MockupPlan, now?: Date): Promise<string>;
|
|
1546
|
+
declare function writeMockupManifest(root: string, slug: string, plan: MockupPlan, inputsHash: string, now?: Date): Promise<string>;
|
|
1547
|
+
declare function updateMockupScreenshots(root: string, slug: string, screenshots: string[]): Promise<string | undefined>;
|
|
1548
|
+
interface CaptureResult {
|
|
1549
|
+
screenshots: string[];
|
|
1550
|
+
diagnostics: Diagnostic[];
|
|
1551
|
+
}
|
|
1552
|
+
declare function captureMockups(root: string, slug: string, manifest: MockupManifest, now?: Date): Promise<CaptureResult>;
|
|
1553
|
+
|
|
1554
|
+
interface AdoptOptions {
|
|
1555
|
+
root: string;
|
|
1556
|
+
domains?: string[];
|
|
1557
|
+
dryRun?: boolean;
|
|
1558
|
+
profilesDirs?: string[];
|
|
1559
|
+
now?: Date;
|
|
1560
|
+
}
|
|
1561
|
+
interface AdoptDomain {
|
|
1562
|
+
name: string;
|
|
1563
|
+
files: number;
|
|
1564
|
+
samples: string[];
|
|
1565
|
+
existingSpec: boolean;
|
|
1566
|
+
}
|
|
1567
|
+
interface AdoptResult {
|
|
1568
|
+
root: string;
|
|
1569
|
+
domains: AdoptDomain[];
|
|
1570
|
+
createdSpecs: string[];
|
|
1571
|
+
reportPath?: string;
|
|
1572
|
+
stack?: {
|
|
1573
|
+
name: string;
|
|
1574
|
+
score: number;
|
|
1575
|
+
};
|
|
1576
|
+
diagnostics: Diagnostic[];
|
|
1577
|
+
dryRun: boolean;
|
|
1578
|
+
}
|
|
1579
|
+
declare function adoptWorkspace(opts: AdoptOptions): Promise<AdoptResult>;
|
|
1580
|
+
|
|
1581
|
+
interface InitOptions {
|
|
1582
|
+
root: string;
|
|
1583
|
+
name?: string;
|
|
1584
|
+
language?: Language;
|
|
1585
|
+
local?: boolean;
|
|
1586
|
+
profilesDir?: string;
|
|
1587
|
+
now?: Date;
|
|
1588
|
+
}
|
|
1589
|
+
interface InitResult {
|
|
1590
|
+
sddDir: string;
|
|
1591
|
+
created: string[];
|
|
1592
|
+
detected?: DetectionResult;
|
|
1593
|
+
diagnostics: Diagnostic[];
|
|
1594
|
+
}
|
|
1595
|
+
declare function initWorkspace(opts: InitOptions): Promise<InitResult>;
|
|
1596
|
+
|
|
1597
|
+
declare const SLUG_RE: RegExp;
|
|
1598
|
+
interface NewChangeOptions {
|
|
1599
|
+
root: string;
|
|
1600
|
+
slug: string;
|
|
1601
|
+
lane?: Lane;
|
|
1602
|
+
domain?: string;
|
|
1603
|
+
title?: string;
|
|
1604
|
+
language?: Language;
|
|
1605
|
+
cfg?: AtlasConfig;
|
|
1606
|
+
now?: Date;
|
|
1607
|
+
}
|
|
1608
|
+
interface NewChangeResult {
|
|
1609
|
+
slug: string;
|
|
1610
|
+
dir: string;
|
|
1611
|
+
files: string[];
|
|
1612
|
+
diagnostics: Diagnostic[];
|
|
1613
|
+
}
|
|
1614
|
+
declare function createChange(opts: NewChangeOptions): Promise<NewChangeResult>;
|
|
1615
|
+
|
|
1616
|
+
interface FoldOutcome {
|
|
1617
|
+
content: string;
|
|
1618
|
+
applied: {
|
|
1619
|
+
added: string[];
|
|
1620
|
+
modified: string[];
|
|
1621
|
+
removed: string[];
|
|
1622
|
+
renamed: string[];
|
|
1623
|
+
};
|
|
1624
|
+
diagnostics: Diagnostic[];
|
|
1625
|
+
}
|
|
1626
|
+
declare function foldDelta(livingBody: string, delta: Delta, language?: Language): FoldOutcome;
|
|
1627
|
+
interface ArchiveOptions {
|
|
1628
|
+
root: string;
|
|
1629
|
+
slug: string;
|
|
1630
|
+
language?: Language;
|
|
1631
|
+
now?: Date;
|
|
1632
|
+
dryRun?: boolean;
|
|
1633
|
+
}
|
|
1634
|
+
interface ArchiveResult {
|
|
1635
|
+
slug: string;
|
|
1636
|
+
domain?: string;
|
|
1637
|
+
archivedTo?: string;
|
|
1638
|
+
fold: FoldOutcome;
|
|
1639
|
+
diagnostics: Diagnostic[];
|
|
1640
|
+
dryRun: boolean;
|
|
1641
|
+
}
|
|
1642
|
+
declare function archiveChange(opts: ArchiveOptions): Promise<ArchiveResult>;
|
|
1643
|
+
declare function regenerateIndex(root: string, cfg?: AtlasConfig, now?: Date): Promise<void>;
|
|
1644
|
+
|
|
1645
|
+
interface DoctorReport {
|
|
1646
|
+
findings: Diagnostic[];
|
|
1647
|
+
summary: {
|
|
1648
|
+
errors: number;
|
|
1649
|
+
warnings: number;
|
|
1650
|
+
infos: number;
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
declare function runDoctor(root: string): Promise<DoctorReport>;
|
|
1654
|
+
declare function specHashOf(filePath: string): Promise<string | undefined>;
|
|
1655
|
+
|
|
1656
|
+
export { type AdoptDomain, type AdoptOptions, type AdoptResult, type AgingBucket, type AnalyzeOptions, type AnalyzePackSummary, type AnalyzeResult, type Approval, type ApprovalStatus, type ApprovalsFile, type ApprovalsIndex, type ApproveFromGithubOptions, type ApproveFromGithubResult, type ArchiveOptions, type ArchiveResult, type AtlasConfig, type AttentionItem, BLOCK_HEAD_RE, BUILTIN_PACKS, type BlockWavePlan, CONFIG_FILE, CORE_VERSION, type CaptureResult, type Change, type ChangeMeta, type ChangeMetrics, type ChangeState, type Delta, type DeltaOp, type DeriveInput, type DerivedState, type DetectionResult, type Diagnostic, type DoctorReport, type Domain, type Evidence, type EvidenceMethod, type EvidenceResult, type ExecOptions, type ExecResult, type FoldOutcome, type FrontmatterResult, type GhRunner, type GitHubRepo, type InitOptions, type InitResult, type IssueBodyInput, type Lane, type Language, type LinkedIssue, type LintOptions, type LoadedConfig, type MockupCheckResult, type MockupManifest, type MockupPlan, type MockupPlanScreen, type MockupScreen, type NewChangeOptions, type NewChangeResult, type NextAction, type Override, type Pack, type PackCheck, type PackCheckResult, type PackCheckType, type PackEvaluation, type PresentOptions, type PresentResult, type ProfileMatch, REQ_HEAD_RE, REQ_ID_RE, RULE_ID_RE, RULE_RE, RUN_EVENT_TYPES, type RecordEvidenceOptions, type RecordEvidenceResult, type Rename, type Requirement, type RiskLevel, type Rule, type RunEvent, type RunEventType, type RunRecord, type RunState, type RunStatus, SCENARIO_HEAD_RE, SCENARIO_ID_RE, SDD_DIR, SLUG_RE, type Scenario, type Severity, type SignApprovalOptions, type SignApprovalResult, type SpecFile, type SpecRef, type StackProfile, type SyncGithubOptions, type SyncGithubResult, TASK_ID_RE, TASK_LINE_RE, type Task, type TaskBlock, type TasksFile, type TemplateSet, type TraceEdge, type TraceFinding, type TraceGraph, type TraceInput, type TraceNode, type TraceResult, type VerifyFile, type WalkEntry, type WavePlan, type Workspace, type WorkspaceMetrics, adoptWorkspace, appendRunEvent, approvalsSchema, approveFromGithub, archiveChange, artifactHash, atlasConfigSchema, buildTraceGraph, canonicalizeMarkdown, captureMockups, changeMarker, changeMetaSchema, changeMetaYaml, checkMockups, checkTrace, collectMetrics, commentIssue, compareTaskIds, computeInputsHash, configToYaml, copyFile, countBySeverity, createChange, createIssue, createRun, defaultConfig, deriveState, detectProfiles, detectRepo, detectionToYaml, diag, editIssue, emitFrontmatter, ensureDir, ensureSddDirs, esc, evaluatePacks, evidenceSummary, exists, findLinkedIssue, findWorkspaceRoot, firstToken, foldDelta, generatePresentation, generateRunId, getNumber, getString, ghAuthStatus, ghAvailable, hasErrors, hasShellMetacharacters, indexMarkdown, initWorkspace, inline, isCommandAllowed, isDirectory, issueBody, issueLabels, laneOrDefault, lintDelta, lintMockupHtml, lintMockupManifest, lintRequirement, lintSpec, lintTasks, lintVerify, listChangeSlugs, listDir, listDirs, listRuns, loadActiveProfile, loadApprovals, loadChange, loadConfig, loadDetectedBest, loadProfileFile, loadProfilesFromDir, loadProjectPacks, loadSpecs, loadWorkspace, matchGlob, mockupManifestSchema, mockupsDir, packFindings, parseApprovals, parseChangeMeta, parseConfig, parseDelta, parseFrontmatter, parseGitHubRemote, parseIssueUrl, parseRequirementBlocks, parseSpecFile, parseTasksFile, parseVerifyFile, patchChangeMeta, planBlock, planMockups, planWaves, profileSchema, readMockupManifest, readRun, readText, readTextIfExists, recordEvidence, regenerateIndex, renderMarkdown, renderRequirement, renderTemplate, resolvePacks, runAnalyze, runDoctor, runProcess, sha256, shortHash, signApproval, specHashOf, splitCommand, stateLabel, syncGithubIssue, templatesFor, toPosix, tokensFile, updateMockupScreenshots, updateRunStatus, verifyApproval, walkFiles, writeConfig, writeMockupManifest, writeMockupPlan, writeText };
|