@maycombhq/sdk 2.0.0-beta.18 → 2.0.0-beta.21
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/npm/core/ai-decisions.d.ts +360 -0
- package/npm/core/api.d.ts +2811 -122
- package/npm/core/audit.d.ts +16 -4
- package/npm/core/catalog.d.ts +218 -66
- package/npm/core/decision-batches.d.ts +29 -0
- package/npm/core/declared-links.d.ts +62 -0
- package/npm/core/eol.d.ts +5 -0
- package/npm/core/facts-join.d.ts +66 -1
- package/npm/core/fs.d.ts +22 -3
- package/npm/core/host-questions.d.ts +5 -0
- package/npm/core/index.d.ts +7 -0
- package/npm/core/link-candidates.d.ts +103 -0
- package/npm/core/manifest-edit.d.ts +40 -0
- package/npm/core/merge.d.ts +19 -0
- package/npm/core/metarepo.d.ts +9 -0
- package/npm/core/orgpack-defaults.d.ts +7 -2
- package/npm/core/orgpack-load.d.ts +3 -0
- package/npm/core/question-roles.d.ts +24 -0
- package/npm/core/questions.d.ts +25 -2
- package/npm/core/runtime-migrate.d.ts +9 -0
- package/npm/core/schema/ai.d.ts +28 -7
- package/npm/core/schema/common.d.ts +32 -8
- package/npm/core/schema/component-type.d.ts +193 -0
- package/npm/core/schema/fact-corrections.d.ts +95 -2
- package/npm/core/schema/facts.d.ts +114 -2
- package/npm/core/schema/kinds.d.ts +228 -66
- package/npm/core/schema/orgpack.d.ts +43 -5
- package/npm/core/schema/question.d.ts +151 -6
- package/npm/core/schema/reading-rules.d.ts +51 -0
- package/npm/core/schema/review.d.ts +7 -7
- package/npm/core/schema/scan-verify.d.ts +42 -0
- package/npm/core/schema/version.d.ts +3 -1
- package/npm/index.js +4679 -2672
- package/package.json +1 -1
package/npm/core/schema/ai.d.ts
CHANGED
|
@@ -169,10 +169,20 @@ export type RunState = z.infer<typeof RunState>;
|
|
|
169
169
|
* its context was retrieved (ADR 0116): the model's expansion of the input and its order of the
|
|
170
170
|
* candidates; 4 the step's class and the model that ran it (ADR 0121 addendum, per-step models);
|
|
171
171
|
* 5 the assistant program that ran it and its version (ADR 0171: the Copilot language server a
|
|
172
|
-
* copilot-acp run talked to)
|
|
173
|
-
*
|
|
172
|
+
* copilot-acp run talked to); 6 the batch a hand-off was asked in and a batch's parts (ADR 0185:
|
|
173
|
+
* a stage's critic lenses in one prompt). A version 1 to 5 record is read through
|
|
174
|
+
* `migrateRunSummary`, without what came later.
|
|
174
175
|
*/
|
|
175
|
-
export declare const RUN_SCHEMA_VERSION:
|
|
176
|
+
export declare const RUN_SCHEMA_VERSION: 6;
|
|
177
|
+
/**
|
|
178
|
+
* One part of a batched hand-off (version 6, ADR 0185): its name (the section that answers it,
|
|
179
|
+
* `=== <name>`, a critic lens's name) and its own run, which keeps its own prompt, pack and answer.
|
|
180
|
+
*/
|
|
181
|
+
export declare const RunPart: z.ZodObject<{
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
runId: z.ZodString;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
export type RunPart = z.infer<typeof RunPart>;
|
|
176
186
|
/**
|
|
177
187
|
* The assistant program a run talked to (version 5, ADR 0171), as it named itself: the agent's
|
|
178
188
|
* name and version from the Agent Client Protocol's initialize answer, the protocol version both
|
|
@@ -253,7 +263,7 @@ export declare const RunTools: z.ZodObject<{
|
|
|
253
263
|
export type RunTools = z.infer<typeof RunTools>;
|
|
254
264
|
/** What goes into review/ for every run; full packs and transcripts stay in git-ignored .runs/. */
|
|
255
265
|
export declare const RunSummary: z.ZodObject<{
|
|
256
|
-
schemaVersion: z.ZodLiteral<
|
|
266
|
+
schemaVersion: z.ZodLiteral<6>;
|
|
257
267
|
runId: z.ZodString;
|
|
258
268
|
change: z.ZodString;
|
|
259
269
|
agent: z.ZodString;
|
|
@@ -335,17 +345,23 @@ export declare const RunSummary: z.ZodObject<{
|
|
|
335
345
|
version: z.ZodOptional<z.ZodString>;
|
|
336
346
|
protocolVersion: z.ZodOptional<z.ZodNumber>;
|
|
337
347
|
}, z.core.$strict>>;
|
|
348
|
+
batch: z.ZodOptional<z.ZodString>;
|
|
349
|
+
parts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
350
|
+
name: z.ZodString;
|
|
351
|
+
runId: z.ZodString;
|
|
352
|
+
}, z.core.$strict>>>;
|
|
338
353
|
}, z.core.$strict>;
|
|
339
354
|
export type RunSummary = z.infer<typeof RunSummary>;
|
|
340
355
|
/**
|
|
341
356
|
* A stored run record at the current version: version 1 (before tools), 2 (before retrieval), 3
|
|
342
|
-
* (before the step's class and model)
|
|
343
|
-
* version
|
|
357
|
+
* (before the step's class and model), 4 (before the assistant program, ADR 0171) and 5 (before
|
|
358
|
+
* batches, ADR 0185) read as version 6 without them; anything else is returned as it is, for the
|
|
359
|
+
* schema to judge.
|
|
344
360
|
*/
|
|
345
361
|
export declare function migrateRunSummary(raw: unknown): unknown;
|
|
346
362
|
/** Read a stored run record of any version (ADR 0107 addendum). */
|
|
347
363
|
export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
|
|
348
|
-
schemaVersion:
|
|
364
|
+
schemaVersion: 6;
|
|
349
365
|
runId: string;
|
|
350
366
|
change: string;
|
|
351
367
|
agent: string;
|
|
@@ -407,6 +423,11 @@ export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
|
|
|
407
423
|
version?: string | undefined;
|
|
408
424
|
protocolVersion?: number | undefined;
|
|
409
425
|
} | undefined;
|
|
426
|
+
batch?: string | undefined;
|
|
427
|
+
parts?: {
|
|
428
|
+
name: string;
|
|
429
|
+
runId: string;
|
|
430
|
+
}[] | undefined;
|
|
410
431
|
}>;
|
|
411
432
|
/** A recorded model output for the replay runtime, keyed by agent and prompt hash. */
|
|
412
433
|
export declare const Recording: z.ZodObject<{
|
|
@@ -3,15 +3,16 @@ import { SCHEMA_VERSION } from "./version.js";
|
|
|
3
3
|
/** Current catalog schema version (defined in ./version.js, which loads no schema). */
|
|
4
4
|
export { SCHEMA_VERSION };
|
|
5
5
|
/** Every catalog schema version a reader accepts, oldest first. */
|
|
6
|
-
export declare const SUPPORTED_SCHEMA_VERSIONS: readonly [1, 2, 3, 4];
|
|
6
|
+
export declare const SUPPORTED_SCHEMA_VERSIONS: readonly [1, 2, 3, 4, 5];
|
|
7
7
|
/**
|
|
8
|
-
* A record's schema version. Version-1
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `1 | 2 | 3 | 4` so code
|
|
8
|
+
* A record's schema version. Version-1 to -4 files differ from version 5 only in this number
|
|
9
|
+
* (nothing they hold changed meaning: version 4, ADR 0164, only added `protobuf` to a Schema's
|
|
10
|
+
* formats; version 5, ADR 0181, only added the evidence source `ai` and its `run`), so they are
|
|
11
|
+
* read as they are and come back as version 5 in memory; writers always write the current
|
|
12
|
+
* version, and `migrateCatalog` rewrites old files. The type stays `1 | 2 | 3 | 4 | 5` so code
|
|
13
|
+
* that builds older records in memory keeps compiling until it is updated.
|
|
13
14
|
*/
|
|
14
|
-
export declare const SchemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
|
|
15
|
+
export declare const SchemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
|
|
15
16
|
/**
|
|
16
17
|
* Stable record id. Lowercase slug, safe as a file name on Linux, macOS and Windows
|
|
17
18
|
* (no ":" or "/"), so every record can live in its own file named by its id.
|
|
@@ -49,6 +50,25 @@ export declare const EvidenceSource: z.ZodEnum<{
|
|
|
49
50
|
document: "document";
|
|
50
51
|
export: "export";
|
|
51
52
|
manual: "manual";
|
|
53
|
+
ai: "ai";
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* The evidence sources a dialect (C2) or a finding (C3) may name: every source but `ai` (ADR 0181),
|
|
57
|
+
* which only Atticus writes, for a link the AI decided. C2 and C3 are unchanged by it.
|
|
58
|
+
*/
|
|
59
|
+
export declare const RuleEvidenceSource: z.ZodEnum<{
|
|
60
|
+
code: "code";
|
|
61
|
+
config: "config";
|
|
62
|
+
spec: "spec";
|
|
63
|
+
gateway: "gateway";
|
|
64
|
+
"event-config": "event-config";
|
|
65
|
+
infrastructure: "infrastructure";
|
|
66
|
+
pipeline: "pipeline";
|
|
67
|
+
migration: "migration";
|
|
68
|
+
diagram: "diagram";
|
|
69
|
+
document: "document";
|
|
70
|
+
export: "export";
|
|
71
|
+
manual: "manual";
|
|
52
72
|
}>;
|
|
53
73
|
export declare const Evidence: z.ZodObject<{
|
|
54
74
|
source: z.ZodEnum<{
|
|
@@ -64,6 +84,7 @@ export declare const Evidence: z.ZodObject<{
|
|
|
64
84
|
document: "document";
|
|
65
85
|
export: "export";
|
|
66
86
|
manual: "manual";
|
|
87
|
+
ai: "ai";
|
|
67
88
|
}>;
|
|
68
89
|
repo: z.ZodOptional<z.ZodString>;
|
|
69
90
|
path: z.ZodOptional<z.ZodString>;
|
|
@@ -80,12 +101,13 @@ export declare const Evidence: z.ZodObject<{
|
|
|
80
101
|
definition: "definition";
|
|
81
102
|
}>>;
|
|
82
103
|
by: z.ZodOptional<z.ZodString>;
|
|
104
|
+
run: z.ZodOptional<z.ZodString>;
|
|
83
105
|
}, z.core.$strict>;
|
|
84
106
|
export declare const IsoDate: z.ZodISODate;
|
|
85
107
|
export declare const IsoDateTime: z.ZodISODateTime;
|
|
86
108
|
/** Fields every record carries. `kind` is added per record type. */
|
|
87
109
|
export declare const commonFields: {
|
|
88
|
-
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
|
|
110
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
|
|
89
111
|
id: z.ZodString;
|
|
90
112
|
status: z.ZodEnum<{
|
|
91
113
|
current: "current";
|
|
@@ -113,6 +135,7 @@ export declare const commonFields: {
|
|
|
113
135
|
document: "document";
|
|
114
136
|
export: "export";
|
|
115
137
|
manual: "manual";
|
|
138
|
+
ai: "ai";
|
|
116
139
|
}>;
|
|
117
140
|
repo: z.ZodOptional<z.ZodString>;
|
|
118
141
|
path: z.ZodOptional<z.ZodString>;
|
|
@@ -129,6 +152,7 @@ export declare const commonFields: {
|
|
|
129
152
|
definition: "definition";
|
|
130
153
|
}>>;
|
|
131
154
|
by: z.ZodOptional<z.ZodString>;
|
|
155
|
+
run: z.ZodOptional<z.ZodString>;
|
|
132
156
|
}, z.core.$strict>>;
|
|
133
157
|
flags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
158
|
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* A component type (ADR 0180, C6): org-pack/component-types/<id>/type.yaml, with an optional
|
|
4
|
+
* notes.md beside it. What a kind of component in the organisation is (a BFF, a gateway proxy,
|
|
5
|
+
* a mainframe program, a kind of its own), how the assistant recognises one when it reads a
|
|
6
|
+
* repo (signals it cites), where one usually runs, how the canvas draws it, and what one must
|
|
7
|
+
* and must not do. Atticus's own types (`Component.type`'s documented values, ADR 0040) are the
|
|
8
|
+
* default set in the same shape; an organisation adds types, rewords a built-in under its own
|
|
9
|
+
* id, or switches one off. A type's notes are data in prompts, never instructions.
|
|
10
|
+
*/
|
|
11
|
+
export declare const COMPONENT_TYPE_SCHEMA_VERSION: 1;
|
|
12
|
+
/** How a read recognises a component of the type: something on a line the assistant can cite. */
|
|
13
|
+
export declare const TypeSignal: z.ZodObject<{
|
|
14
|
+
kind: z.ZodEnum<{
|
|
15
|
+
file: "file";
|
|
16
|
+
path: "path";
|
|
17
|
+
dependency: "dependency";
|
|
18
|
+
framework: "framework";
|
|
19
|
+
annotation: "annotation";
|
|
20
|
+
"repo-type": "repo-type";
|
|
21
|
+
words: "words";
|
|
22
|
+
}>;
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
why: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type TypeSignal = z.infer<typeof TypeSignal>;
|
|
27
|
+
export declare const TYPE_SHAPES: readonly ["box", "rounded", "hexagon", "cylinder", "diamond", "parallelogram", "circle"];
|
|
28
|
+
/** The file's fields as written (ComponentType checks them and fills in a switched-off type's words). */
|
|
29
|
+
export declare const ComponentTypeShape: z.ZodObject<{
|
|
30
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
name: z.ZodOptional<z.ZodString>;
|
|
33
|
+
description: z.ZodOptional<z.ZodString>;
|
|
34
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
35
|
+
signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
36
|
+
kind: z.ZodEnum<{
|
|
37
|
+
file: "file";
|
|
38
|
+
path: "path";
|
|
39
|
+
dependency: "dependency";
|
|
40
|
+
framework: "framework";
|
|
41
|
+
annotation: "annotation";
|
|
42
|
+
"repo-type": "repo-type";
|
|
43
|
+
words: "words";
|
|
44
|
+
}>;
|
|
45
|
+
value: z.ZodString;
|
|
46
|
+
why: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>>>;
|
|
48
|
+
runsOn: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
50
|
+
cloud: z.ZodOptional<z.ZodString>;
|
|
51
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
draws: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
55
|
+
box: "box";
|
|
56
|
+
rounded: "rounded";
|
|
57
|
+
hexagon: "hexagon";
|
|
58
|
+
cylinder: "cylinder";
|
|
59
|
+
diamond: "diamond";
|
|
60
|
+
parallelogram: "parallelogram";
|
|
61
|
+
circle: "circle";
|
|
62
|
+
}>>;
|
|
63
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
64
|
+
badge: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
must: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
mustNot: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
off: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
/**
|
|
72
|
+
* A kind of component, in the organisation's words: org-pack/component-types/<id>/type.yaml.
|
|
73
|
+
* `name` and `description` are required unless the file switches a built-in off.
|
|
74
|
+
*/
|
|
75
|
+
export declare const ComponentType: z.ZodPipe<z.ZodObject<{
|
|
76
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
name: z.ZodOptional<z.ZodString>;
|
|
79
|
+
description: z.ZodOptional<z.ZodString>;
|
|
80
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
81
|
+
signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
82
|
+
kind: z.ZodEnum<{
|
|
83
|
+
file: "file";
|
|
84
|
+
path: "path";
|
|
85
|
+
dependency: "dependency";
|
|
86
|
+
framework: "framework";
|
|
87
|
+
annotation: "annotation";
|
|
88
|
+
"repo-type": "repo-type";
|
|
89
|
+
words: "words";
|
|
90
|
+
}>;
|
|
91
|
+
value: z.ZodString;
|
|
92
|
+
why: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strict>>>;
|
|
94
|
+
runsOn: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
96
|
+
cloud: z.ZodOptional<z.ZodString>;
|
|
97
|
+
framework: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
draws: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
box: "box";
|
|
102
|
+
rounded: "rounded";
|
|
103
|
+
hexagon: "hexagon";
|
|
104
|
+
cylinder: "cylinder";
|
|
105
|
+
diamond: "diamond";
|
|
106
|
+
parallelogram: "parallelogram";
|
|
107
|
+
circle: "circle";
|
|
108
|
+
}>>;
|
|
109
|
+
colour: z.ZodOptional<z.ZodString>;
|
|
110
|
+
badge: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
must: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
mustNot: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
+
off: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
117
|
+
name: string;
|
|
118
|
+
description: string;
|
|
119
|
+
schemaVersion: 1;
|
|
120
|
+
id: string;
|
|
121
|
+
signals: {
|
|
122
|
+
kind: "file" | "path" | "dependency" | "framework" | "annotation" | "repo-type" | "words";
|
|
123
|
+
value: string;
|
|
124
|
+
why?: string | undefined;
|
|
125
|
+
}[];
|
|
126
|
+
owner?: string | undefined;
|
|
127
|
+
runsOn?: {
|
|
128
|
+
platform?: string | undefined;
|
|
129
|
+
cloud?: string | undefined;
|
|
130
|
+
framework?: string | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
draws?: {
|
|
133
|
+
shape?: "box" | "rounded" | "hexagon" | "cylinder" | "diamond" | "parallelogram" | "circle" | undefined;
|
|
134
|
+
colour?: string | undefined;
|
|
135
|
+
badge?: string | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
must?: string[] | undefined;
|
|
138
|
+
mustNot?: string[] | undefined;
|
|
139
|
+
off?: boolean | undefined;
|
|
140
|
+
notes?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
schemaVersion: 1;
|
|
143
|
+
id: string;
|
|
144
|
+
signals: {
|
|
145
|
+
kind: "file" | "path" | "dependency" | "framework" | "annotation" | "repo-type" | "words";
|
|
146
|
+
value: string;
|
|
147
|
+
why?: string | undefined;
|
|
148
|
+
}[];
|
|
149
|
+
name?: string | undefined;
|
|
150
|
+
description?: string | undefined;
|
|
151
|
+
owner?: string | undefined;
|
|
152
|
+
runsOn?: {
|
|
153
|
+
platform?: string | undefined;
|
|
154
|
+
cloud?: string | undefined;
|
|
155
|
+
framework?: string | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
draws?: {
|
|
158
|
+
shape?: "box" | "rounded" | "hexagon" | "cylinder" | "diamond" | "parallelogram" | "circle" | undefined;
|
|
159
|
+
colour?: string | undefined;
|
|
160
|
+
badge?: string | undefined;
|
|
161
|
+
} | undefined;
|
|
162
|
+
must?: string[] | undefined;
|
|
163
|
+
mustNot?: string[] | undefined;
|
|
164
|
+
off?: boolean | undefined;
|
|
165
|
+
notes?: string | undefined;
|
|
166
|
+
}>>;
|
|
167
|
+
export type ComponentType = z.infer<typeof ComponentType>;
|
|
168
|
+
/** A type as loaded: the file's words, and the notes.md body when there is one. */
|
|
169
|
+
export interface LoadedComponentType extends ComponentType {
|
|
170
|
+
/** The notes file's text, as written (Markdown). */
|
|
171
|
+
notesText?: string;
|
|
172
|
+
/** `builtin`, or the org pack. */
|
|
173
|
+
source: "builtin" | "org-pack";
|
|
174
|
+
}
|
|
175
|
+
/** Atticus's own component types (ADR 0040's documented values), in the org pack's shape. */
|
|
176
|
+
export declare const BUILTIN_COMPONENT_TYPES: readonly LoadedComponentType[];
|
|
177
|
+
/**
|
|
178
|
+
* The organisation's set: Atticus's built-ins, each replaced by an org-pack type of the same id
|
|
179
|
+
* (its words win) or taken out by one with `off`, then the organisation's own types, in id order.
|
|
180
|
+
*/
|
|
181
|
+
export declare function effectiveComponentTypes(pack: readonly LoadedComponentType[]): LoadedComponentType[];
|
|
182
|
+
/**
|
|
183
|
+
* The types as `atticus map <repo> --estimate` lists them for the reader: each with its id, its
|
|
184
|
+
* description and the signals it rests on, in a data block. The reader writes one `component`
|
|
185
|
+
* fact per component with the type it fits, citing the line that shows a signal.
|
|
186
|
+
*/
|
|
187
|
+
export declare function componentTypesText(types: readonly LoadedComponentType[]): string;
|
|
188
|
+
/**
|
|
189
|
+
* What a type must and must not do, for a stage drafting a new component or a review: each
|
|
190
|
+
* line quoted, in a data block, with the type's notes file named (not read into the prompt whole:
|
|
191
|
+
* a person's write-up can be long; the stage reads it from the file when it needs it).
|
|
192
|
+
*/
|
|
193
|
+
export declare function componentTypeRulesText(types: readonly LoadedComponentType[], packRel: string): string;
|
|
@@ -11,15 +11,53 @@ import { z } from "zod";
|
|
|
11
11
|
* file, line and value), so a read that gives the same fact another id still meets it. One that
|
|
12
12
|
* meets no fact is stale: the verifier says so and applies nothing.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Version 2 (ADR 0181) adds what AI deciding needs, all optional: `ai` (a pairing Atticus applied
|
|
16
|
+
* from an AI run: by `atticus`, never the person, joined `joined-by-ai`), `batch` (the batch that
|
|
17
|
+
* wrote a line, so Undo removes exactly its lines), `rule` (a line a person's rule wrote, from
|
|
18
|
+
* which correction), `match` (the rule a person's correction spreads, "Apply to similar") and the
|
|
19
|
+
* action `unlink` (a person says the call reaches none of these). A version 1 line reads as it
|
|
20
|
+
* is and means the same; a line that uses any of them says version 2.
|
|
21
|
+
*/
|
|
22
|
+
export declare const FACT_CORRECTIONS_SCHEMA_VERSION: 2;
|
|
23
|
+
/** ADR 0181: who writes an AI pairing's line: Atticus, from the run, never the session or a person. */
|
|
24
|
+
export declare const AI_LINE_BY = "atticus";
|
|
25
|
+
/** ADR 0181: the AI run a pairing came from, and the bar it met to be applied. */
|
|
26
|
+
export declare const CorrectionAi: z.ZodObject<{
|
|
27
|
+
runtime: z.ZodEnum<{
|
|
28
|
+
"hand-off": "hand-off";
|
|
29
|
+
"copilot-acp": "copilot-acp";
|
|
30
|
+
}>;
|
|
31
|
+
run: z.ZodString;
|
|
32
|
+
bar: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
confident: "confident";
|
|
34
|
+
"agrees-with-shapes": "agrees-with-shapes";
|
|
35
|
+
"person-rule": "person-rule";
|
|
36
|
+
}>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type CorrectionAi = z.infer<typeof CorrectionAi>;
|
|
15
39
|
/** The fields of a fact a correction may not set: what it is, where it comes from, who checked it. */
|
|
16
40
|
export declare const FACT_FIXED_FIELDS: readonly ["kind", "id", "repo", "commit", "cite", "verified", "by", "conf"];
|
|
41
|
+
/**
|
|
42
|
+
* G1 (ADR 0174): what a person paired a call with on the canvas: an entry of a repo (its id when
|
|
43
|
+
* paired, and its method and path, to find it again after a read gives it another id), or an
|
|
44
|
+
* outside system's operation. The call's own fact is left as read; the join reads the pairing.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CorrectionLink: z.ZodObject<{
|
|
47
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
48
|
+
system: z.ZodOptional<z.ZodString>;
|
|
49
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
50
|
+
method: z.ZodOptional<z.ZodString>;
|
|
51
|
+
path: z.ZodString;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export type CorrectionLink = z.infer<typeof CorrectionLink>;
|
|
17
54
|
export declare const FactCorrection: z.ZodObject<{
|
|
18
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
55
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
19
56
|
fact: z.ZodString;
|
|
20
57
|
target: z.ZodObject<{
|
|
21
58
|
kind: z.ZodEnum<{
|
|
22
59
|
config: "config";
|
|
60
|
+
component: "component";
|
|
23
61
|
field: "field";
|
|
24
62
|
term: "term";
|
|
25
63
|
framework: "framework";
|
|
@@ -34,14 +72,41 @@ export declare const FactCorrection: z.ZodObject<{
|
|
|
34
72
|
value: z.ZodString;
|
|
35
73
|
}, z.core.$strict>;
|
|
36
74
|
action: z.ZodEnum<{
|
|
75
|
+
link: "link";
|
|
37
76
|
wrong: "wrong";
|
|
38
77
|
edit: "edit";
|
|
78
|
+
unlink: "unlink";
|
|
39
79
|
}>;
|
|
80
|
+
link: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
82
|
+
system: z.ZodOptional<z.ZodString>;
|
|
83
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
84
|
+
method: z.ZodOptional<z.ZodString>;
|
|
85
|
+
path: z.ZodString;
|
|
86
|
+
}, z.core.$strict>>;
|
|
40
87
|
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
41
88
|
line: z.ZodOptional<z.ZodNumber>;
|
|
42
89
|
reason: z.ZodOptional<z.ZodString>;
|
|
43
90
|
by: z.ZodString;
|
|
44
91
|
at: z.ZodISODateTime;
|
|
92
|
+
ai: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
runtime: z.ZodEnum<{
|
|
94
|
+
"hand-off": "hand-off";
|
|
95
|
+
"copilot-acp": "copilot-acp";
|
|
96
|
+
}>;
|
|
97
|
+
run: z.ZodString;
|
|
98
|
+
bar: z.ZodOptional<z.ZodEnum<{
|
|
99
|
+
confident: "confident";
|
|
100
|
+
"agrees-with-shapes": "agrees-with-shapes";
|
|
101
|
+
"person-rule": "person-rule";
|
|
102
|
+
}>>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
batch: z.ZodOptional<z.ZodString>;
|
|
105
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
from: z.ZodString;
|
|
107
|
+
match: z.ZodString;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
match: z.ZodOptional<z.ZodString>;
|
|
45
110
|
}, z.core.$strict>;
|
|
46
111
|
export type FactCorrection = z.infer<typeof FactCorrection>;
|
|
47
112
|
/** The corrections of a file's text, one per line; a line that isn't one is a problem with its number. */
|
|
@@ -54,3 +119,31 @@ export declare function parseCorrections(text: string): {
|
|
|
54
119
|
};
|
|
55
120
|
/** One correction as its line in the file, keys in a fixed order. */
|
|
56
121
|
export declare function correctionLine(c: FactCorrection): string;
|
|
122
|
+
type CallLike = {
|
|
123
|
+
kind: string;
|
|
124
|
+
id: string;
|
|
125
|
+
cite: {
|
|
126
|
+
file: string;
|
|
127
|
+
line: number;
|
|
128
|
+
value: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* G1 (ADR 0174): every pairing (`link`) that meets a call, newest first: on its cited line by its
|
|
133
|
+
* id or by what it cites, or by its id where an edit of the same fact moved it to the line it is
|
|
134
|
+
* on now. One matcher for the verifier and the join.
|
|
135
|
+
*/
|
|
136
|
+
export declare function linksFor(f: CallLike, corrections: readonly FactCorrection[]): FactCorrection[];
|
|
137
|
+
/** A pairing as the join reads it: what the call reaches, who said so, and (ADR 0181) the AI run. */
|
|
138
|
+
export type PairOnFile = CorrectionLink & {
|
|
139
|
+
by: string;
|
|
140
|
+
ai?: CorrectionAi;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* G1 (ADR 0174): a repo's pairings, call fact id → what the person paired it with, from its
|
|
144
|
+
* corrections file: the newest link per call (a repo's or an outside system's), met as linksFor
|
|
145
|
+
* meets it. A link that meets no call is left out (the verifier says so). ADR 0181: an AI
|
|
146
|
+
* pairing keeps its run (`ai`); a newer `unlink` withdraws any pairing.
|
|
147
|
+
*/
|
|
148
|
+
export declare function pairsFromCorrections(facts: readonly CallLike[], corrections: readonly FactCorrection[]): Record<string, PairOnFile>;
|
|
149
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const FACT_KINDS: readonly ["entry", "call", "store", "field", "deploy", "config", "framework", "flow", "term"];
|
|
2
|
+
export declare const FACT_KINDS: readonly ["entry", "call", "store", "field", "deploy", "config", "framework", "flow", "term", "component"];
|
|
3
3
|
export type FactKind = (typeof FACT_KINDS)[number];
|
|
4
4
|
/** A fact's id: any slug the assistant chooses; the projection makes catalog ids from the claim. */
|
|
5
5
|
export declare const FactId: z.ZodString;
|
|
@@ -421,8 +421,9 @@ export declare const DeployFact: z.ZodObject<{
|
|
|
421
421
|
* number, reads as version 1 and parses unchanged, every field added since being optional.
|
|
422
422
|
* 1: the shapes of ADR 0124 and its addenda. 2: a deploy fact's `host`, `basePath` and `exposes`.
|
|
423
423
|
* 3 (ADR 0163): the `term` kind, and a call's `auth`, `authCite`, `tls` and `tlsCite`.
|
|
424
|
+
* 4 (ADR 0180): the `component` kind, what a component is.
|
|
424
425
|
*/
|
|
425
|
-
export declare const FACTS_SCHEMA_VERSION:
|
|
426
|
+
export declare const FACTS_SCHEMA_VERSION: 4;
|
|
426
427
|
export declare const SETTING_KINDS: readonly ["timeout", "retry", "circuit-breaker", "rate-limit", "pool", "cache-ttl", "feature-flag", "config", "schedule"];
|
|
427
428
|
/**
|
|
428
429
|
* Whether a key and its value look like a secret: the key's last part ends in a secret word,
|
|
@@ -718,6 +719,49 @@ export declare const FlowFact: z.ZodObject<{
|
|
|
718
719
|
}>>;
|
|
719
720
|
kind: z.ZodLiteral<"flow">;
|
|
720
721
|
}, z.core.$strict>;
|
|
722
|
+
/**
|
|
723
|
+
* What a component is (ADR 0180): its type, from the organisation's component types (the set
|
|
724
|
+
* `atticus map <repo> --estimate` lists, data) or Atticus's own. `cite` is the line that shows the
|
|
725
|
+
* signal the type rests on (the annotation, the dependency, the file's first line); `value` is
|
|
726
|
+
* the signal as written there. `type` is the type's id; one the set doesn't have is kept as
|
|
727
|
+
* written and flagged at verify, so a person adds the type or corrects the fact. One per
|
|
728
|
+
* component; a second is refused at verify.
|
|
729
|
+
*/
|
|
730
|
+
export declare const ComponentFact: z.ZodObject<{
|
|
731
|
+
type: z.ZodString;
|
|
732
|
+
why: z.ZodOptional<z.ZodString>;
|
|
733
|
+
id: z.ZodString;
|
|
734
|
+
repo: z.ZodString;
|
|
735
|
+
commit: z.ZodString;
|
|
736
|
+
component: z.ZodOptional<z.ZodString>;
|
|
737
|
+
cite: z.ZodObject<{
|
|
738
|
+
file: z.ZodString;
|
|
739
|
+
line: z.ZodNumber;
|
|
740
|
+
value: z.ZodString;
|
|
741
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
742
|
+
with: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
743
|
+
file: z.ZodString;
|
|
744
|
+
line: z.ZodNumber;
|
|
745
|
+
value: z.ZodString;
|
|
746
|
+
}, z.core.$strict>>>;
|
|
747
|
+
}, z.core.$strict>;
|
|
748
|
+
verified: z.ZodDefault<z.ZodEnum<{
|
|
749
|
+
line: "line";
|
|
750
|
+
none: "none";
|
|
751
|
+
person: "person";
|
|
752
|
+
sample: "sample";
|
|
753
|
+
}>>;
|
|
754
|
+
by: z.ZodDefault<z.ZodEnum<{
|
|
755
|
+
person: "person";
|
|
756
|
+
assistant: "assistant";
|
|
757
|
+
reader: "reader";
|
|
758
|
+
}>>;
|
|
759
|
+
conf: z.ZodDefault<z.ZodEnum<{
|
|
760
|
+
inferred: "inferred";
|
|
761
|
+
declared: "declared";
|
|
762
|
+
}>>;
|
|
763
|
+
kind: z.ZodLiteral<"component">;
|
|
764
|
+
}, z.core.$strict>;
|
|
721
765
|
export declare const Fact: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
722
766
|
entryType: z.ZodEnum<{
|
|
723
767
|
function: "function";
|
|
@@ -1241,6 +1285,40 @@ export declare const Fact: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1241
1285
|
declared: "declared";
|
|
1242
1286
|
}>>;
|
|
1243
1287
|
kind: z.ZodLiteral<"term">;
|
|
1288
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1289
|
+
type: z.ZodString;
|
|
1290
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1291
|
+
id: z.ZodString;
|
|
1292
|
+
repo: z.ZodString;
|
|
1293
|
+
commit: z.ZodString;
|
|
1294
|
+
component: z.ZodOptional<z.ZodString>;
|
|
1295
|
+
cite: z.ZodObject<{
|
|
1296
|
+
file: z.ZodString;
|
|
1297
|
+
line: z.ZodNumber;
|
|
1298
|
+
value: z.ZodString;
|
|
1299
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
1300
|
+
with: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1301
|
+
file: z.ZodString;
|
|
1302
|
+
line: z.ZodNumber;
|
|
1303
|
+
value: z.ZodString;
|
|
1304
|
+
}, z.core.$strict>>>;
|
|
1305
|
+
}, z.core.$strict>;
|
|
1306
|
+
verified: z.ZodDefault<z.ZodEnum<{
|
|
1307
|
+
line: "line";
|
|
1308
|
+
none: "none";
|
|
1309
|
+
person: "person";
|
|
1310
|
+
sample: "sample";
|
|
1311
|
+
}>>;
|
|
1312
|
+
by: z.ZodDefault<z.ZodEnum<{
|
|
1313
|
+
person: "person";
|
|
1314
|
+
assistant: "assistant";
|
|
1315
|
+
reader: "reader";
|
|
1316
|
+
}>>;
|
|
1317
|
+
conf: z.ZodDefault<z.ZodEnum<{
|
|
1318
|
+
inferred: "inferred";
|
|
1319
|
+
declared: "declared";
|
|
1320
|
+
}>>;
|
|
1321
|
+
kind: z.ZodLiteral<"component">;
|
|
1244
1322
|
}, z.core.$strict>], "kind">;
|
|
1245
1323
|
export type Fact = z.infer<typeof Fact>;
|
|
1246
1324
|
export type FactOf<K extends FactKind> = Extract<Fact, {
|
|
@@ -1770,4 +1848,38 @@ export declare const FactsFile: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
1770
1848
|
declared: "declared";
|
|
1771
1849
|
}>>;
|
|
1772
1850
|
kind: z.ZodLiteral<"term">;
|
|
1851
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1852
|
+
type: z.ZodString;
|
|
1853
|
+
why: z.ZodOptional<z.ZodString>;
|
|
1854
|
+
id: z.ZodString;
|
|
1855
|
+
repo: z.ZodString;
|
|
1856
|
+
commit: z.ZodString;
|
|
1857
|
+
component: z.ZodOptional<z.ZodString>;
|
|
1858
|
+
cite: z.ZodObject<{
|
|
1859
|
+
file: z.ZodString;
|
|
1860
|
+
line: z.ZodNumber;
|
|
1861
|
+
value: z.ZodString;
|
|
1862
|
+
quote: z.ZodOptional<z.ZodString>;
|
|
1863
|
+
with: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1864
|
+
file: z.ZodString;
|
|
1865
|
+
line: z.ZodNumber;
|
|
1866
|
+
value: z.ZodString;
|
|
1867
|
+
}, z.core.$strict>>>;
|
|
1868
|
+
}, z.core.$strict>;
|
|
1869
|
+
verified: z.ZodDefault<z.ZodEnum<{
|
|
1870
|
+
line: "line";
|
|
1871
|
+
none: "none";
|
|
1872
|
+
person: "person";
|
|
1873
|
+
sample: "sample";
|
|
1874
|
+
}>>;
|
|
1875
|
+
by: z.ZodDefault<z.ZodEnum<{
|
|
1876
|
+
person: "person";
|
|
1877
|
+
assistant: "assistant";
|
|
1878
|
+
reader: "reader";
|
|
1879
|
+
}>>;
|
|
1880
|
+
conf: z.ZodDefault<z.ZodEnum<{
|
|
1881
|
+
inferred: "inferred";
|
|
1882
|
+
declared: "declared";
|
|
1883
|
+
}>>;
|
|
1884
|
+
kind: z.ZodLiteral<"component">;
|
|
1773
1885
|
}, z.core.$strict>], "kind">>;
|