@maycombhq/sdk 2.0.0-beta.2 → 2.0.0-beta.22

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.
Files changed (61) hide show
  1. package/npm/core/ai-decisions.d.ts +373 -0
  2. package/npm/core/api.d.ts +5890 -1210
  3. package/npm/core/audit.d.ts +165 -0
  4. package/npm/core/catalog.d.ts +220 -66
  5. package/npm/core/cite.d.ts +20 -4
  6. package/npm/core/contract-check.d.ts +261 -0
  7. package/npm/core/decision-batches.d.ts +29 -0
  8. package/npm/core/declared-links.d.ts +62 -0
  9. package/npm/core/eol.d.ts +5 -0
  10. package/npm/core/fact-paths.d.ts +14 -0
  11. package/npm/core/facts-callers.d.ts +2 -0
  12. package/npm/core/facts-carry.d.ts +8 -2
  13. package/npm/core/facts-join-prototype.d.ts +66 -4
  14. package/npm/core/facts-join-vendor.d.ts +20 -2
  15. package/npm/core/facts-join.d.ts +325 -1
  16. package/npm/core/facts-terms.d.ts +108 -0
  17. package/npm/core/fs.d.ts +40 -4
  18. package/npm/core/glob.d.ts +14 -0
  19. package/npm/core/host-questions.d.ts +93 -1
  20. package/npm/core/identity.d.ts +28 -0
  21. package/npm/core/index.d.ts +24 -0
  22. package/npm/core/link-candidates.d.ts +103 -0
  23. package/npm/core/link-evidence.d.ts +212 -0
  24. package/npm/core/manifest-edit.d.ts +53 -4
  25. package/npm/core/merge.d.ts +28 -0
  26. package/npm/core/metarepo.d.ts +18 -1
  27. package/npm/core/migrate.d.ts +3 -2
  28. package/npm/core/org-notes.d.ts +180 -0
  29. package/npm/core/orgpack-defaults.d.ts +22 -6
  30. package/npm/core/orgpack-load.d.ts +19 -0
  31. package/npm/core/profile-migrate.d.ts +11 -0
  32. package/npm/core/question-order.d.ts +23 -0
  33. package/npm/core/question-owners.d.ts +53 -0
  34. package/npm/core/question-proposals.d.ts +77 -0
  35. package/npm/core/question-roles.d.ts +24 -0
  36. package/npm/core/questions.d.ts +90 -6
  37. package/npm/core/repo-files.d.ts +60 -0
  38. package/npm/core/repo-reads.d.ts +44 -0
  39. package/npm/core/roles-migrate.d.ts +9 -0
  40. package/npm/core/runtime-migrate.d.ts +18 -0
  41. package/npm/core/schema/ai.d.ts +57 -9
  42. package/npm/core/schema/common.d.ts +32 -8
  43. package/npm/core/schema/component-type.d.ts +193 -0
  44. package/npm/core/schema/conventions.d.ts +80 -0
  45. package/npm/core/schema/fact-corrections.d.ts +105 -2
  46. package/npm/core/schema/facts.d.ts +410 -1
  47. package/npm/core/schema/kinds.d.ts +230 -66
  48. package/npm/core/schema/orgpack.d.ts +159 -19
  49. package/npm/core/schema/question.d.ts +228 -5
  50. package/npm/core/schema/reading-rules.d.ts +51 -0
  51. package/npm/core/schema/repo-type.d.ts +20 -2
  52. package/npm/core/schema/review.d.ts +7 -7
  53. package/npm/core/schema/scan-verify.d.ts +87 -45
  54. package/npm/core/schema/version.d.ts +4 -1
  55. package/npm/core/schema/workspace.d.ts +29 -11
  56. package/npm/core/shared-maps.d.ts +146 -0
  57. package/npm/core/stack-helpers.d.ts +32 -0
  58. package/npm/fs-repo.d.ts +2 -1
  59. package/npm/index.js +6194 -2542
  60. package/npm/listing.d.ts +14 -0
  61. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { type JudgmentStore } from "./judgments.js";
2
- import { Question, type QuestionDraft, type QuestionScopeLevel, type QuestionState } from "./schema/question.js";
2
+ import { Question, type AiBy, type AppliedRule, type QuestionDraft, type QuestionScopeLevel, type QuestionState } from "./schema/question.js";
3
3
  /**
4
4
  * Questions as files (ADR 0078): raise, list, read and answer questions/<id>.yaml. The CLI
5
5
  * (atticus questions) and the local API (/api/questions) both call these, so the app and the
@@ -21,6 +21,21 @@ export declare function questionId(o: {
21
21
  question: string;
22
22
  evidence: string[];
23
23
  }): string;
24
+ /** The step a critic knowledge gap's owner question is asked by (ninth UX walk). */
25
+ export declare const ASKED_GAP_STEP = "critic-ask";
26
+ /**
27
+ * Ninth UX walk: the id of the owner question a person's Ask raises for a critic knowledge gap.
28
+ * It is a fingerprint of the change and the gap's own fingerprint (its rule, artifact, record and
29
+ * summary), so the same gap carried to a later round or gate finds the same question.
30
+ */
31
+ export declare function askedGapQuestionId(change: string, f: {
32
+ rule: string;
33
+ artifact: string;
34
+ locator: {
35
+ record?: string | undefined;
36
+ };
37
+ summary: string;
38
+ }): string;
24
39
  /** Who asked: the step, the repo, the command as typed, the command that reads the answer. */
25
40
  export interface AskedBy {
26
41
  step: string;
@@ -154,6 +169,14 @@ export interface RaiseOptions {
154
169
  hold?: (q: Question, answered: Question[]) => boolean;
155
170
  /** Where judgments are kept; default the metarepo's judgments/. */
156
171
  judgments?: JudgmentStore;
172
+ /**
173
+ * Beta.12: an open, unanswered question on file by the draft's id, that this step asked, gets
174
+ * the draft's options and words in place (the same id, its history kept), so what a step
175
+ * offers now (ranked suggestions, their reasons, a repo read since) reaches a question asked
176
+ * before. Returned in `refreshed` (and `known`). An answered or retired question is never
177
+ * touched.
178
+ */
179
+ refresh?: boolean;
157
180
  }
158
181
  /** A question held back: the one it would have been, and the answered ones that may decide it. */
159
182
  export interface HeldQuestion {
@@ -178,7 +201,8 @@ export declare function sameTarget(a: {
178
201
  }, repo?: string): boolean;
179
202
  /**
180
203
  * Write the questions a step raised (ADR 0078, 0089, 0117). One already on file by its id is
181
- * left as it is and returned in `known`. Otherwise it is weighed against the questions on file
204
+ * left as it is and returned in `known` (with `refresh`, an open one this step asked takes the
205
+ * draft's options and words first). Otherwise it is weighed against the questions on file
182
206
  * for the same repo:
183
207
  * 1. the veto: the two name different ids, fields or numbers, so they differ;
184
208
  * 2. the step's own reading (`sameAs`), when the id is a candidate and its words are in it;
@@ -198,14 +222,22 @@ export declare function raiseQuestions(root: string, drafts: QuestionDraft[], by
198
222
  held: HeldQuestion[];
199
223
  /** The answered questions whose answer decides a draft, by the draft's index (ADR 0117 addendum). */
200
224
  decidedBy: Map<number, Question>;
225
+ /** With `refresh`: open questions on file that took the draft's options and words. */
226
+ refreshed: Question[];
201
227
  }>;
202
228
  /**
203
- * Rewrite questions/<id>.yaml files written at question schema version 1 at version 2 (ADR
204
- * 0117): only the version changes, since what version 2 adds is optional. Returns the files,
205
- * relative to the root; with dryRun, the files it would rewrite.
229
+ * Rewrite questions/<id>.yaml files written at an older question schema version (1, ADR 0078;
230
+ * 2, ADR 0117) at the current one (3, ADR 0153): only the version changes, since what each
231
+ * version adds is optional. Returns the files, relative to the root; with dryRun, the files it
232
+ * would rewrite.
206
233
  */
207
234
  export declare function migrateQuestions(root: string, o?: {
208
235
  dryRun?: boolean;
236
+ /** Round 49: the files left as they are, with why (a file not named by its question's id). */
237
+ problems?: {
238
+ file: string;
239
+ message: string;
240
+ }[];
209
241
  }): Promise<string[]>;
210
242
  /** What a step says of a question it reused: who asked it first, and that it waits on it. */
211
243
  export declare const reusedLine: (q: Question) => string;
@@ -225,6 +257,15 @@ export declare function retireQuestion(root: string, id: string, o: {
225
257
  replacedBy?: string[];
226
258
  at: string;
227
259
  }): Promise<Question>;
260
+ /**
261
+ * ADR 0162 (F8): open an answered targets question again, because the code read since disagrees
262
+ * with its answer (the repo it named has no route that serves the call). The answer it had is
263
+ * kept under `reopened` with why, so the person sees what they said and what the code says.
264
+ */
265
+ export declare function reopenQuestion(root: string, id: string, o: {
266
+ why: string;
267
+ at: string;
268
+ }): Promise<Question>;
228
269
  export declare function answerWords(q: Question): string | undefined;
229
270
  /**
230
271
  * An answer as a step's next prompt gives it (B-run2-fixes 8): the option picked with what it
@@ -243,9 +284,35 @@ export interface AnswerInput {
243
284
  scope?: QuestionScopeLevel;
244
285
  /** The repo type, when the person widens a repo question to its type. */
245
286
  repoType?: string;
246
- by: string;
287
+ /**
288
+ * ADR 0153 (Q2): the rule the answer covers, for a target or hosts question: a host pattern
289
+ * (`*.payments.forge.internal`) or a path prefix (`/forge/limits/**`).
290
+ */
291
+ match?: string;
292
+ /** ADR 0153 (Q5): the assistant's proposal this answer accepts (acceptProposal sets it). */
293
+ proposal?: NonNullable<Question["answer"]>["proposal"];
294
+ /**
295
+ * Review item 14: a file change the answer brings (a system written into the profile, ADR
296
+ * 0162), made only once the answer is checked and just before it is written. When it throws,
297
+ * nothing is answered (a `bad-answer` with its first line).
298
+ */
299
+ beforeWrite?: () => Promise<void>;
300
+ /**
301
+ * The person (their Git user); or, ADR 0181, the AI with its runtime and run, for a decision
302
+ * Atticus applies from an AI run (only an option on file, of a targets question, at the repo).
303
+ */
304
+ by: string | AiBy;
247
305
  at: string;
306
+ /** ADR 0181: the batch applying it (by AI, or by a person's rule). */
307
+ batch?: string;
308
+ /** ADR 0181: a person's rule applies it, from their correction. */
309
+ rule?: AppliedRule;
248
310
  }
311
+ /**
312
+ * Whether a host a hosts question asks about (`localhost:9966`, `limits.payments.forge.internal`)
313
+ * is one a rule's host pattern covers, as the manifest matches hosts.
314
+ */
315
+ export declare function hostRuleCovers(pattern: string, asked: string): boolean;
249
316
  /**
250
317
  * Record a person's answer in the question's file. A repo-type answer also goes, as a line
251
318
  * under "## Answers", in the type's skill file when that file is there; the path is kept in
@@ -263,5 +330,22 @@ export declare function answerQuestion(root: string, id: string, a: AnswerInput)
263
330
  host: string;
264
331
  manifest: string;
265
332
  added: boolean;
333
+ basePath?: string;
334
+ };
335
+ /**
336
+ * ADR 0153 (Q2): the other open hosts questions the answer's host pattern covers, retired as
337
+ * answered by it.
338
+ */
339
+ covered?: string[];
340
+ /**
341
+ * For a hosts question answered with an outside system (O1): the system written to the
342
+ * profile, with the host as its alias.
343
+ */
344
+ system?: {
345
+ id: string;
346
+ host: string;
347
+ boundary: "internal" | "vendor";
348
+ profile: string;
349
+ added: boolean;
266
350
  };
267
351
  }>;
@@ -0,0 +1,60 @@
1
+ import { type GlobMatcher } from "./glob.js";
2
+ /**
3
+ * A file's bytes as text, the same way for every reader: UTF-16 (LE or BE) when it starts with
4
+ * that byte-order mark (SQL Server Management Studio saves .sql files so), else UTF-8 with any
5
+ * byte-order mark dropped, else, when the bytes aren't valid UTF-8, windows-1252 (a Latin-1 file
6
+ * from an older editor). Line numbers and quotes then agree between the read, the scan and the
7
+ * check.
8
+ */
9
+ export declare function decodeText(bytes: Uint8Array): string;
10
+ /** Whether a file's bytes are binary: a NUL in the first 8,000, unless it is marked UTF-16. */
11
+ export declare function isBinaryBytes(bytes: Uint8Array): boolean;
12
+ /** The same, for text `decodeText` made: a NUL is left only where the bytes were binary. */
13
+ export declare function isBinaryText(text: string): boolean;
14
+ /** A Git LFS pointer a checkout wasn't smudged with: three lines that stand for the real file. */
15
+ export declare function isLfsPointer(text: string): boolean;
16
+ /**
17
+ * Tokens a text costs, as every budget counts them (ADR 0112): four ASCII characters a token,
18
+ * and each character outside ASCII a token of its own. Characters / 4 alone counted Japanese,
19
+ * Chinese or Cyrillic at a quarter of what a tokenizer gives, so prompts over the model's limit
20
+ * were planned as fitting. `tokenUnits` is the same count in quarters, to sum over parts.
21
+ */
22
+ export declare function estimateTokens(text: string): number;
23
+ /** Quarter tokens: 1 for each ASCII character, 4 for each other (an astral one counted once). */
24
+ export declare function tokenUnits(text: string): number;
25
+ export interface IgnoreRule {
26
+ /** The folder of the .gitignore, repo-relative ("" for the root). */
27
+ base: string;
28
+ /** Matched in linear time (glob.ts): a scanned repo's .gitignore can't stall the scan. */
29
+ re: GlobMatcher;
30
+ negate: boolean;
31
+ dirOnly: boolean;
32
+ }
33
+ /** The rules of one .gitignore file (git's syntax: #, !, a trailing /, a leading or inner /). */
34
+ export declare function ignoreRules(text: string, base: string): IgnoreRule[];
35
+ /** Whether git would ignore a path by these rules: the last rule that matches decides. */
36
+ export declare function ignoredBy(rules: readonly IgnoreRule[], path: string, isDir: boolean): boolean;
37
+ export interface WalkOptions {
38
+ /**
39
+ * Whether a folder is left out: `above` are the folders it is in (repo-relative parts), `name`
40
+ * its own, `siblings` every name beside it. Asked after .git, links and .gitignore.
41
+ */
42
+ skipFolder?: (above: readonly string[], name: string, siblings: readonly string[]) => boolean;
43
+ }
44
+ /**
45
+ * A checkout's files, repo-relative with `/`, in the order a walk by name meets them: never a
46
+ * symbolic link (so no loop, no file outside the repo and no secret under another name), never
47
+ * `.git`, and nothing a .gitignore in the repo ignores (an ignored folder isn't walked). Only the
48
+ * repo's own .gitignore files are read. Deterministic: the same tree gives the same list.
49
+ */
50
+ export declare function listRepoFilesSync(root: string, o?: WalkOptions): string[];
51
+ /**
52
+ * The same walk, a file at a time: `visit` returns false to stop. Stops after `max` files and
53
+ * says it was cut.
54
+ */
55
+ export declare function walkRepo(root: string, visit: (path: string) => Promise<boolean | void>, o?: WalkOptions & {
56
+ max?: number;
57
+ }): Promise<{
58
+ files: number;
59
+ cut: boolean;
60
+ }>;
@@ -0,0 +1,44 @@
1
+ import type { Fact, FactOf } from "./schema/facts.js";
2
+ import type { Question } from "./schema/question.js";
3
+ /**
4
+ * The commit a checkout is at, read from its `.git` files: HEAD, a loose ref or packed-refs,
5
+ * following a worktree's `gitdir:` and `commondir`. Undefined when there is no checkout.
6
+ */
7
+ export declare function headFromFiles(dir: string): Promise<string | undefined>;
8
+ /** Where a repo is checked out: the metarepo's workspace/<repo>, or the repo itself when adopted. */
9
+ export declare const checkoutDirOf: (root: string, repo: string) => string;
10
+ /**
11
+ * not-read: no facts and no verifier's report (a repo the readers alone mapped, or none);
12
+ * stale: the facts were read at another commit than the checkout is at; incomplete: facts were
13
+ * rejected, some aren't verified, there is no verifier's report, or files went unread; read: none
14
+ * of these.
15
+ */
16
+ export type RepoReadState = "not-read" | "stale" | "incomplete" | "read";
17
+ export interface RepoRead {
18
+ repo: string;
19
+ state: RepoReadState;
20
+ /** Why it is stale or incomplete, in words a person reads; empty when it is read. */
21
+ why: string[];
22
+ /** The command that reads it again or checks it. */
23
+ next?: string;
24
+ /** The commit its facts were read at, and the checkout's. */
25
+ commit?: string;
26
+ head?: string;
27
+ /** Its facts, for the questions that cite their lines. */
28
+ facts: Fact[];
29
+ }
30
+ /** The read of one repo (see `RepoRead`). Never throws: an unreadable file is a reason. */
31
+ export declare function repoReadOf(root: string, repo: string): Promise<RepoRead>;
32
+ /**
33
+ * The steps whose questions are about a link (ADR 0140): which repo or system answers a call
34
+ * (`facts-targets`, scanner's TARGETS_STEP; `estate-targets`, the estate join's) and which repo
35
+ * answers on a host (`scan-hosts`). Their answers join calls.
36
+ */
37
+ export declare const LINK_QUESTION_STEPS: ReadonlySet<string>;
38
+ export declare const isLinkQuestion: (q: Pick<Question, "askedBy">) => boolean;
39
+ /**
40
+ * The calls a link question asks about: a targets question's are the call facts of its repo on
41
+ * the lines it cites (one per call, a group's every call, Q1); a hosts question's are every call
42
+ * to its host, in any repo (its evidence cites only the first few). `facts` are the facts by repo.
43
+ */
44
+ export declare function callsOfQuestion(q: Pick<Question, "askedBy" | "repo" | "evidence" | "question">, facts: ReadonlyMap<string, readonly Fact[]>): FactOf<"call">[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * roles.yaml version 1 → 2 (ADR 0140). Version 2 adds `teams`; a file without them names no
3
+ * team, as version 1 did, so the step writes the new number only and keeps the file's comments,
4
+ * order and line layout (`atticus upgrade`'s roles-v2).
5
+ */
6
+ export declare function migrateRolesText(text: string): {
7
+ text: string;
8
+ changed: boolean;
9
+ };
@@ -9,3 +9,21 @@ export declare function migrateRuntimeText(text: string): {
9
9
  text: string;
10
10
  changed: boolean;
11
11
  };
12
+ /**
13
+ * runtime.yaml to version 3 (ADR 0171), for a file that names copilot-acp (a mode, or the
14
+ * copilotAcp section): the number only, every other line as the person wrote it. A file that
15
+ * doesn't name it means the same at version 1 or 2, so it is left as it is.
16
+ */
17
+ export declare function migrateRuntimeV3Text(text: string): {
18
+ text: string;
19
+ changed: boolean;
20
+ };
21
+ /**
22
+ * runtime.yaml to version 4 (ADR 0181), for a file that sets `decide` (whether the AI decides
23
+ * pairings and option questions itself): the number only, every other line as the person wrote
24
+ * it. A file without it means the same at version 1 to 3, so it is left as it is.
25
+ */
26
+ export declare function migrateRuntimeV4Text(text: string): {
27
+ text: string;
28
+ changed: boolean;
29
+ };
@@ -4,10 +4,12 @@ import { z } from "zod";
4
4
  * context-pack manifests and run summaries are written per run. See ADR 0014.
5
5
  */
6
6
  export declare const AI_SCHEMA_VERSION: 1;
7
+ /** ADR 0171 adds copilot-acp: GitHub Copilot driven unattended through its Agent Client Protocol. */
7
8
  export declare const RuntimeKind: z.ZodEnum<{
8
9
  model: "model";
9
10
  "hand-off": "hand-off";
10
11
  "headless-claude-code": "headless-claude-code";
12
+ "copilot-acp": "copilot-acp";
11
13
  mock: "mock";
12
14
  replay: "replay";
13
15
  }>;
@@ -93,6 +95,7 @@ export declare const AgentDefinition: z.ZodObject<{
93
95
  model: "model";
94
96
  "hand-off": "hand-off";
95
97
  "headless-claude-code": "headless-claude-code";
98
+ "copilot-acp": "copilot-acp";
96
99
  mock: "mock";
97
100
  replay: "replay";
98
101
  }>>;
@@ -164,10 +167,33 @@ export type RunState = z.infer<typeof RunState>;
164
167
  /**
165
168
  * The run record's own version: 2 adds the tools a run's model called (ADR 0107 addendum); 3 how
166
169
  * its context was retrieved (ADR 0116): the model's expansion of the input and its order of the
167
- * candidates; 4 the step's class and the model that ran it (ADR 0121 addendum, per-step models).
168
- * A version 1, 2 or 3 record is read through `migrateRunSummary`, without what came later.
170
+ * candidates; 4 the step's class and the model that ran it (ADR 0121 addendum, per-step models);
171
+ * 5 the assistant program that ran it and its version (ADR 0171: the Copilot language server a
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.
169
175
  */
170
- export declare const RUN_SCHEMA_VERSION: 4;
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>;
186
+ /**
187
+ * The assistant program a run talked to (version 5, ADR 0171), as it named itself: the agent's
188
+ * name and version from the Agent Client Protocol's initialize answer, the protocol version both
189
+ * sides agreed, and the version `<command> --version` printed. Data, never instructions.
190
+ */
191
+ export declare const RunAssistant: z.ZodObject<{
192
+ name: z.ZodString;
193
+ version: z.ZodOptional<z.ZodString>;
194
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
195
+ }, z.core.$strict>;
196
+ export type RunAssistant = z.infer<typeof RunAssistant>;
171
197
  /**
172
198
  * How a run's context was retrieved (ADR 0116), when a model helped: what it read the input as
173
199
  * (search terms, the names it found, each mapped to an id the index has or said new, with the
@@ -237,7 +263,7 @@ export declare const RunTools: z.ZodObject<{
237
263
  export type RunTools = z.infer<typeof RunTools>;
238
264
  /** What goes into review/ for every run; full packs and transcripts stay in git-ignored .runs/. */
239
265
  export declare const RunSummary: z.ZodObject<{
240
- schemaVersion: z.ZodLiteral<4>;
266
+ schemaVersion: z.ZodLiteral<6>;
241
267
  runId: z.ZodString;
242
268
  change: z.ZodString;
243
269
  agent: z.ZodString;
@@ -245,6 +271,7 @@ export declare const RunSummary: z.ZodObject<{
245
271
  model: "model";
246
272
  "hand-off": "hand-off";
247
273
  "headless-claude-code": "headless-claude-code";
274
+ "copilot-acp": "copilot-acp";
248
275
  mock: "mock";
249
276
  replay: "replay";
250
277
  }>;
@@ -313,21 +340,32 @@ export declare const RunSummary: z.ZodObject<{
313
340
  quick: "quick";
314
341
  }>>;
315
342
  model: z.ZodOptional<z.ZodString>;
343
+ assistant: z.ZodOptional<z.ZodObject<{
344
+ name: z.ZodString;
345
+ version: z.ZodOptional<z.ZodString>;
346
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
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>>>;
316
353
  }, z.core.$strict>;
317
354
  export type RunSummary = z.infer<typeof RunSummary>;
318
355
  /**
319
- * A stored run record at the current version: version 1 (before tools), 2 (before retrieval) and
320
- * 3 (before the step's class and model) read as version 4 without them; anything else is
321
- * returned as it is, for the schema to judge.
356
+ * A stored run record at the current version: version 1 (before tools), 2 (before retrieval), 3
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.
322
360
  */
323
361
  export declare function migrateRunSummary(raw: unknown): unknown;
324
362
  /** Read a stored run record of any version (ADR 0107 addendum). */
325
363
  export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
326
- schemaVersion: 4;
364
+ schemaVersion: 6;
327
365
  runId: string;
328
366
  change: string;
329
367
  agent: string;
330
- runtime: "model" | "hand-off" | "headless-claude-code" | "mock" | "replay";
368
+ runtime: "model" | "hand-off" | "headless-claude-code" | "copilot-acp" | "mock" | "replay";
331
369
  state: "failed" | "prepared" | "waiting" | "produced" | "validated" | "cancelled";
332
370
  startedAt: string;
333
371
  contextManifestSha256: string;
@@ -380,6 +418,16 @@ export declare const readRunSummary: (raw: unknown) => z.ZodSafeParseResult<{
380
418
  } | undefined;
381
419
  stepClass?: "read" | "draft" | "critic" | "knowledge" | "quick" | undefined;
382
420
  model?: string | undefined;
421
+ assistant?: {
422
+ name: string;
423
+ version?: string | undefined;
424
+ protocolVersion?: number | undefined;
425
+ } | undefined;
426
+ batch?: string | undefined;
427
+ parts?: {
428
+ name: string;
429
+ runId: string;
430
+ }[] | undefined;
383
431
  }>;
384
432
  /** A recorded model output for the replay runtime, keyed by agent and prompt hash. */
385
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];
6
+ export declare const SUPPORTED_SCHEMA_VERSIONS: readonly [1, 2, 3, 4, 5];
7
7
  /**
8
- * A record's schema version. Version-1 and version-2 files differ from version 3 only in this
9
- * number (nothing they hold changed meaning), so they are read as they are and come back as
10
- * version 3 in memory; writers always write the current version, and `migrateCatalog` rewrites
11
- * old files. The type stays `1 | 2 | 3` so code that builds older records in memory keeps
12
- * compiling until it is updated.
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>]>;
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>]>;
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
  };