@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
@@ -71,8 +71,26 @@ export declare const Approver: z.ZodObject<{
71
71
  groups: z.ZodDefault<z.ZodArray<z.ZodString>>;
72
72
  people: z.ZodDefault<z.ZodArray<z.ZodString>>;
73
73
  }, z.core.$strict>;
74
+ /**
75
+ * roles.yaml version 2 (ADR 0140) adds `teams`: who is on each team a repo manifest's `owner`
76
+ * names, so a question goes to the team that owns its repo and a person can list their own.
77
+ * Words, not permissions: nothing is allowed or refused by team. The rest of the file stays
78
+ * deprecated (ADR 0073). A version-1 file is read as it is; `teams` needs version 2.
79
+ */
80
+ export declare const ROLES_SCHEMA_VERSION: 2;
81
+ export declare const Team: z.ZodObject<{
82
+ id: z.ZodString;
83
+ name: z.ZodOptional<z.ZodString>;
84
+ people: z.ZodDefault<z.ZodArray<z.ZodString>>;
85
+ }, z.core.$strict>;
86
+ export type Team = z.infer<typeof Team>;
74
87
  export declare const Roles: z.ZodObject<{
75
- schemaVersion: z.ZodLiteral<1>;
88
+ schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
89
+ teams: z.ZodDefault<z.ZodArray<z.ZodObject<{
90
+ id: z.ZodString;
91
+ name: z.ZodOptional<z.ZodString>;
92
+ people: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
+ }, z.core.$strict>>>;
76
94
  custom: z.ZodDefault<z.ZodArray<z.ZodObject<{
77
95
  id: z.ZodString;
78
96
  name: z.ZodString;
@@ -168,6 +186,7 @@ export declare const ChangeType: z.ZodObject<{
168
186
  snow: "snow";
169
187
  }>>;
170
188
  lenses: z.ZodDefault<z.ZodArray<z.ZodEnum<{
189
+ release: "release";
171
190
  true: "true";
172
191
  complete: "complete";
173
192
  safe: "safe";
@@ -178,7 +197,6 @@ export declare const ChangeType: z.ZodObject<{
178
197
  ux: "ux";
179
198
  delivery: "delivery";
180
199
  "code-and-test": "code-and-test";
181
- release: "release";
182
200
  }>>>;
183
201
  approvals: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
184
202
  release: "release";
@@ -231,6 +249,7 @@ export declare const ChangeTypes: z.ZodObject<{
231
249
  snow: "snow";
232
250
  }>>;
233
251
  lenses: z.ZodDefault<z.ZodArray<z.ZodEnum<{
252
+ release: "release";
234
253
  true: "true";
235
254
  complete: "complete";
236
255
  safe: "safe";
@@ -241,7 +260,6 @@ export declare const ChangeTypes: z.ZodObject<{
241
260
  ux: "ux";
242
261
  delivery: "delivery";
243
262
  "code-and-test": "code-and-test";
244
- release: "release";
245
263
  }>>>;
246
264
  approvals: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
247
265
  release: "release";
@@ -414,6 +432,13 @@ export declare const IntegrationPattern: z.ZodObject<{
414
432
  }>;
415
433
  }, z.core.$strict>;
416
434
  export type IntegrationPattern = z.infer<typeof IntegrationPattern>;
435
+ /**
436
+ * Review round 49: why git wouldn't take a wiki's `ref` as a branch or tag name, or undefined
437
+ * when it would. Git's own rules (git check-ref-format), and never a leading `-`, so the name
438
+ * can't be read as an option. Beta.18 took any name; round 13 narrowed it to letters, digits and
439
+ * `._/-`, which refused names git takes (`v2.1+hotfix`, `feature@x`); this takes them again.
440
+ */
441
+ export declare function gitRefProblem(ref: string): string | undefined;
417
442
  /** Suggested source kinds (ADR 0083). Tags are free text: an organisation adds its own. */
418
443
  export declare const SOURCE_KIND_SUGGESTIONS: readonly ["enterprise-architecture", "integration-patterns", "platform-runbook", "security-standard", "change-process", "framework"];
419
444
  /**
@@ -749,9 +774,67 @@ export type StepClass = z.infer<typeof StepClass>;
749
774
  * step on the one model; `atticus upgrade` moves it to version 2 (`runtime-v2`), changing nothing
750
775
  * else.
751
776
  */
752
- export declare const RUNTIME_SCHEMA_VERSION: 2;
777
+ export declare const RUNTIME_SCHEMA_VERSION: 4;
778
+ /**
779
+ * runtime.yaml version 4 (ADR 0181): whether the AI decides, itself, what it can (a loose call's
780
+ * pairing with an API, an option question about a target on file), shown as the AI's, or only
781
+ * proposes for a person, as before. `propose` until the organisation turns it on in a pull
782
+ * request. `minPrecision`: the share right of the AI's decisions a sample audit must show
783
+ * (ADR 0148); below it, deciding pauses back to propose and Home says why. Configuration, not a
784
+ * safety rule: a human still approves every write to shared systems, and the AI never decides a
785
+ * free-text question, a scope wider than the repo, an org-pack change, a gate or anything a
786
+ * person only may do.
787
+ */
788
+ export declare const DecideSettings: z.ZodObject<{
789
+ links: z.ZodDefault<z.ZodEnum<{
790
+ auto: "auto";
791
+ propose: "propose";
792
+ }>>;
793
+ questions: z.ZodDefault<z.ZodEnum<{
794
+ auto: "auto";
795
+ propose: "propose";
796
+ }>>;
797
+ minPrecision: z.ZodDefault<z.ZodNumber>;
798
+ }, z.core.$strict>;
799
+ export type DecideSettings = z.infer<typeof DecideSettings>;
800
+ export declare const DECIDE_DEFAULTS: DecideSettings;
801
+ /** runtime.yaml's decide section with its defaults (ADR 0181). */
802
+ export declare function decideOf(runtime: {
803
+ decide?: Partial<DecideSettings> | undefined;
804
+ } | undefined): DecideSettings;
805
+ /**
806
+ * runtime.yaml version 3 (ADR 0171): how Atticus starts the GitHub Copilot language server in its
807
+ * Agent Client Protocol mode, for `copilot-acp`. Only how to start it, which model to ask for and
808
+ * the caps: what the session may read, write and run is fixed in code (rule 6), never here.
809
+ * - command: the server's program and any words before `--acp` (no shell), as one line; a path
810
+ * with spaces in double quotes. Default `npx --yes @github/copilot-language-server`.
811
+ * - model: the model id to ask the server for, when it offers a choice.
812
+ * - maxTurns: the most tool calls one session may make before Atticus cancels it (default 200).
813
+ * - timeoutMs: the longest one session may take (default 30 minutes).
814
+ */
815
+ export declare const CopilotAcpSettings: z.ZodObject<{
816
+ command: z.ZodOptional<z.ZodString>;
817
+ model: z.ZodOptional<z.ZodString>;
818
+ maxTurns: z.ZodOptional<z.ZodNumber>;
819
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
820
+ }, z.core.$strict>;
821
+ export type CopilotAcpSettings = z.infer<typeof CopilotAcpSettings>;
822
+ export declare const COPILOT_ACP_DEFAULTS: {
823
+ readonly command: "npx --yes @github/copilot-language-server";
824
+ readonly maxTurns: 200;
825
+ readonly timeoutMs: number;
826
+ };
827
+ /** runtime.yaml's copilotAcp section with its defaults (ADR 0171). */
828
+ export declare function copilotAcpOf(runtime: {
829
+ copilotAcp?: CopilotAcpSettings | undefined;
830
+ } | undefined): {
831
+ command: string;
832
+ model?: string;
833
+ maxTurns: number;
834
+ timeoutMs: number;
835
+ };
753
836
  export declare const Runtime: z.ZodObject<{
754
- schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
837
+ schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
755
838
  assistants: z.ZodObject<{
756
839
  allowed: z.ZodArray<z.ZodEnum<{
757
840
  copilot: "copilot";
@@ -784,11 +867,13 @@ export declare const Runtime: z.ZodObject<{
784
867
  model: "model";
785
868
  "hand-off": "hand-off";
786
869
  "headless-claude-code": "headless-claude-code";
870
+ "copilot-acp": "copilot-acp";
787
871
  }>>;
788
872
  default: z.ZodEnum<{
789
873
  model: "model";
790
874
  "hand-off": "hand-off";
791
875
  "headless-claude-code": "headless-claude-code";
876
+ "copilot-acp": "copilot-acp";
792
877
  }>;
793
878
  }, z.core.$strict>>;
794
879
  models: z.ZodDefault<z.ZodObject<{
@@ -831,46 +916,93 @@ export declare const Runtime: z.ZodObject<{
831
916
  expansion: z.ZodDefault<z.ZodBoolean>;
832
917
  rerank: z.ZodDefault<z.ZodBoolean>;
833
918
  }, z.core.$strict>>;
919
+ copilotAcp: z.ZodOptional<z.ZodObject<{
920
+ command: z.ZodOptional<z.ZodString>;
921
+ model: z.ZodOptional<z.ZodString>;
922
+ maxTurns: z.ZodOptional<z.ZodNumber>;
923
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
924
+ }, z.core.$strict>>;
925
+ decide: z.ZodOptional<z.ZodObject<{
926
+ links: z.ZodDefault<z.ZodEnum<{
927
+ auto: "auto";
928
+ propose: "propose";
929
+ }>>;
930
+ questions: z.ZodDefault<z.ZodEnum<{
931
+ auto: "auto";
932
+ propose: "propose";
933
+ }>>;
934
+ minPrecision: z.ZodDefault<z.ZodNumber>;
935
+ }, z.core.$strict>>;
834
936
  telemetry: z.ZodDefault<z.ZodObject<{
835
937
  enabled: z.ZodDefault<z.ZodBoolean>;
836
938
  }, z.core.$strict>>;
837
939
  adapters: z.ZodDefault<z.ZodObject<{
838
- workTracker: z.ZodOptional<z.ZodObject<{
940
+ workTracker: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
941
+ [x: string]: string;
942
+ }>, z.ZodTransform<{
943
+ type: string;
944
+ settings: Record<string, string | number | boolean | string[]>;
945
+ }, string>>, z.ZodObject<{
839
946
  type: z.ZodEnum<{
840
947
  [x: string]: string;
841
948
  }>;
842
949
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
843
- }, z.core.$strict>>;
844
- serviceDesk: z.ZodOptional<z.ZodObject<{
950
+ }, z.core.$strict>]>>;
951
+ serviceDesk: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
952
+ [x: string]: string;
953
+ }>, z.ZodTransform<{
954
+ type: string;
955
+ settings: Record<string, string | number | boolean | string[]>;
956
+ }, string>>, z.ZodObject<{
845
957
  type: z.ZodEnum<{
846
958
  [x: string]: string;
847
959
  }>;
848
960
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
849
- }, z.core.$strict>>;
850
- gitHost: z.ZodOptional<z.ZodObject<{
961
+ }, z.core.$strict>]>>;
962
+ gitHost: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
963
+ [x: string]: string;
964
+ }>, z.ZodTransform<{
965
+ type: string;
966
+ settings: Record<string, string | number | boolean | string[]>;
967
+ }, string>>, z.ZodObject<{
851
968
  type: z.ZodEnum<{
852
969
  [x: string]: string;
853
970
  }>;
854
971
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
855
- }, z.core.$strict>>;
856
- wiki: z.ZodOptional<z.ZodObject<{
972
+ }, z.core.$strict>]>>;
973
+ wiki: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
974
+ [x: string]: string;
975
+ }>, z.ZodTransform<{
976
+ type: string;
977
+ settings: Record<string, string | number | boolean | string[]>;
978
+ }, string>>, z.ZodObject<{
857
979
  type: z.ZodEnum<{
858
980
  [x: string]: string;
859
981
  }>;
860
982
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
861
- }, z.core.$strict>>;
862
- notify: z.ZodOptional<z.ZodObject<{
983
+ }, z.core.$strict>]>>;
984
+ notify: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
985
+ [x: string]: string;
986
+ }>, z.ZodTransform<{
987
+ type: string;
988
+ settings: Record<string, string | number | boolean | string[]>;
989
+ }, string>>, z.ZodObject<{
863
990
  type: z.ZodEnum<{
864
991
  [x: string]: string;
865
992
  }>;
866
993
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
867
- }, z.core.$strict>>;
868
- design: z.ZodOptional<z.ZodObject<{
994
+ }, z.core.$strict>]>>;
995
+ design: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
996
+ [x: string]: string;
997
+ }>, z.ZodTransform<{
998
+ type: string;
999
+ settings: Record<string, string | number | boolean | string[]>;
1000
+ }, string>>, z.ZodObject<{
869
1001
  type: z.ZodEnum<{
870
1002
  [x: string]: string;
871
1003
  }>;
872
1004
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
873
- }, z.core.$strict>>;
1005
+ }, z.core.$strict>]>>;
874
1006
  model: z.ZodOptional<z.ZodObject<{
875
1007
  type: z.ZodUnion<readonly [z.ZodEnum<{
876
1008
  mock: "mock";
@@ -923,9 +1055,9 @@ export declare const SkillMeta: z.ZodObject<{
923
1055
  source: z.ZodString;
924
1056
  status: z.ZodDefault<z.ZodEnum<{
925
1057
  retired: "retired";
1058
+ stale: "stale";
926
1059
  active: "active";
927
1060
  draft: "draft";
928
- stale: "stale";
929
1061
  }>>;
930
1062
  reviewedAt: z.ZodOptional<z.ZodISODate>;
931
1063
  }, z.core.$strict>;
@@ -1130,8 +1262,15 @@ export declare const DeclaredCall: z.ZodObject<{
1130
1262
  route: z.ZodOptional<z.ZodString>;
1131
1263
  }, z.core.$strict>;
1132
1264
  export type DeclaredCall = z.infer<typeof DeclaredCall>;
1265
+ /**
1266
+ * profile.yaml's version. 2 (ADR 0162 amendment, review item 15) adds a system's `topics`. A
1267
+ * version-1 profile reads as it is and stays valid, so `atticus upgrade` moves nothing; a profile
1268
+ * that names topics is at 2 (`migrateProfileText`, the number only), as `addProfileSystem` writes
1269
+ * it when an answer puts a topic there.
1270
+ */
1271
+ export declare const PROFILE_SCHEMA_VERSION: 2;
1133
1272
  export declare const Profile: z.ZodObject<{
1134
- schemaVersion: z.ZodLiteral<1>;
1273
+ schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
1135
1274
  platform: z.ZodString;
1136
1275
  name: z.ZodString;
1137
1276
  systems: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1144,6 +1283,7 @@ export declare const Profile: z.ZodObject<{
1144
1283
  }>;
1145
1284
  owner: z.ZodOptional<z.ZodString>;
1146
1285
  aliases: z.ZodDefault<z.ZodArray<z.ZodString>>;
1286
+ topics: z.ZodOptional<z.ZodArray<z.ZodString>>;
1147
1287
  tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
1148
1288
  calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1149
1289
  as: z.ZodOptional<z.ZodEnum<{
@@ -11,7 +11,93 @@ import { z } from "zod";
11
11
  * narrower than) and a draft's `sameAs`. Both are optional, so version-1 files are read as they
12
12
  * are and come back as version 2 in memory; writers write version 2.
13
13
  */
14
- export declare const QUESTION_SCHEMA_VERSION: 2;
14
+ /**
15
+ * Version 3 (ADR 0153) adds two optional fields to an answer: `match`, the rule a target or host
16
+ * answer covers (a host pattern or a path prefix, Q2), and `proposal`, the assistant's proposal a
17
+ * person accepted as their answer (Q5). Version-1 and version-2 files read as before.
18
+ */
19
+ /**
20
+ * Version 4 (ADR 0162) adds `reopened`: a targets answer the code later disagreed with (the repo
21
+ * it named was read, and no route of it serves the call), so the question is open again, with
22
+ * why and the answer it had. Optional; version-1 to version-3 files read as before and come back
23
+ * as version 4 in memory.
24
+ */
25
+ /**
26
+ * Version 5 (one version with role-owned questions' optional `role`, ADR 0181 part 4; merged as
27
+ * one bump) also lets an answer be the AI's: `by` is a person's Git user, or
28
+ * `{ kind: ai, runtime, run }` for a decision Atticus applied from an AI run (never written as the
29
+ * person's); `batch` names the batch that applied an answer (by AI, or by a person's rule), so
30
+ * Undo removes exactly it; `rule` says a person's rule applied it, from which correction. All
31
+ * optional; version-1 to version-4 files read as before and come back as version 5 in memory.
32
+ * Version 5 also (ninth UX walk, before it was released) carries a critic knowledge gap's owner
33
+ * question: `askedOf` (the team or person a person's Ask routed it to) and `finding` (the gap it
34
+ * asks about, by change, gate, round and id). Both optional.
35
+ */
36
+ export declare const QUESTION_SCHEMA_VERSION: 5;
37
+ /**
38
+ * ADR 0181 part 4: who owns a question on a change, by the phase that raised it. The product owner
39
+ * (Define), the architect (Design), the business analyst (Plan's stories) and the tech lead (Plan's
40
+ * tasks and Build). Words, not permissions: anyone can still read and answer any question.
41
+ */
42
+ export declare const QUESTION_ROLES: readonly ["product", "architecture", "analysis", "delivery"];
43
+ export declare const QuestionRole: z.ZodEnum<{
44
+ product: "product";
45
+ architecture: "architecture";
46
+ delivery: "delivery";
47
+ analysis: "analysis";
48
+ }>;
49
+ export type QuestionRole = z.infer<typeof QuestionRole>;
50
+ /**
51
+ * ADR 0181: the runtimes whose runs Atticus records, so a decision can name its run: a Copilot
52
+ * session Atticus started (`copilot-acp`), or a hand-off run Atticus prepared for the person's
53
+ * assistant and read back when it was marked done (`hand-off`, ninth UX walk; additive, the
54
+ * question file stays at version 5). An answer pasted with no Atticus run behind it is no AI
55
+ * decision: it stays a proposal.
56
+ */
57
+ export declare const AI_RUNTIMES: readonly ["copilot-acp", "hand-off"];
58
+ export type AiRuntime = (typeof AI_RUNTIMES)[number];
59
+ /**
60
+ * ADR 0181: the bar an AI decision met to be applied without a person. `confident`: the shapes
61
+ * score the same pair 0.85 or more and 0.2 ahead (ADR 0178); `agrees-with-shapes`: the AI picked
62
+ * what the shapes rank first; `person-rule`: a person's rule covers it and says the same.
63
+ */
64
+ export declare const DECIDE_BARS: readonly ["confident", "agrees-with-shapes", "person-rule"];
65
+ export declare const DecideBar: z.ZodEnum<{
66
+ confident: "confident";
67
+ "agrees-with-shapes": "agrees-with-shapes";
68
+ "person-rule": "person-rule";
69
+ }>;
70
+ export type DecideBar = z.infer<typeof DecideBar>;
71
+ /** ADR 0181: who decided, when it was the AI: the runtime and the run that made it. */
72
+ export declare const AiBy: z.ZodObject<{
73
+ kind: z.ZodLiteral<"ai">;
74
+ runtime: z.ZodEnum<{
75
+ "hand-off": "hand-off";
76
+ "copilot-acp": "copilot-acp";
77
+ }>;
78
+ run: z.ZodString;
79
+ bar: z.ZodOptional<z.ZodEnum<{
80
+ confident: "confident";
81
+ "agrees-with-shapes": "agrees-with-shapes";
82
+ "person-rule": "person-rule";
83
+ }>>;
84
+ }, z.core.$strict>;
85
+ export type AiBy = z.infer<typeof AiBy>;
86
+ /** Whether an answer's or a line's `by` is the AI's. */
87
+ export declare const isAiBy: (by: unknown) => by is AiBy;
88
+ /** Who decided, in words: a person's handle, or "AI (copilot-acp, run <id>)"; never a person for the AI. */
89
+ export declare const answerByWords: (by: string | AiBy) => string;
90
+ /** ADR 0181: a batch of decisions applied at once (by AI, or by a person's rule). */
91
+ export declare const BatchId: z.ZodString;
92
+ /**
93
+ * ADR 0181: an answer or line a person's rule applied: the correction it came from (a question id,
94
+ * or `link:<repo>:<call fact id>`) and the rule (a path prefix, host or topic pattern).
95
+ */
96
+ export declare const AppliedRule: z.ZodObject<{
97
+ from: z.ZodString;
98
+ match: z.ZodString;
99
+ }, z.core.$strict>;
100
+ export type AppliedRule = z.infer<typeof AppliedRule>;
15
101
  /** A question's id: q- and 12 hex characters of the fingerprint of what it asks about. */
16
102
  export declare const QuestionId: z.ZodString;
17
103
  /** Where the question comes from in the repo: path:line. */
@@ -41,10 +127,38 @@ export declare const QuestionOption: z.ZodObject<{
41
127
  changes: z.ZodString;
42
128
  }, z.core.$strict>;
43
129
  export type QuestionOption = z.infer<typeof QuestionOption>;
130
+ /**
131
+ * The rule an answer covers (ADR 0153, Q2): a host pattern as a manifest takes it
132
+ * (`*.payments.forge.internal`, `*` for any part of a label) or a path prefix
133
+ * (`/forge/limits/**`, or `/forge/limits`: the path and everything under it). One answer then
134
+ * covers every call that matches, found now or later, in each repo the answer's scope allows.
135
+ */
136
+ export declare const AnswerMatch: z.ZodString;
137
+ /** Whether a match is a path prefix (else it is a host pattern). */
138
+ export declare const isPathMatch: (m: string) => boolean;
139
+ /** A line a proposal rests on (ADR 0144): the repo (the question's own when left out), file, line, quote. */
140
+ export declare const QuestionProposalCite: z.ZodObject<{
141
+ repo: z.ZodOptional<z.ZodString>;
142
+ file: z.ZodString;
143
+ line: z.ZodNumber;
144
+ quote: z.ZodString;
145
+ }, z.core.$strict>;
44
146
  export declare const QuestionAnswer: z.ZodObject<{
45
147
  option: z.ZodOptional<z.ZodNumber>;
46
148
  text: z.ZodOptional<z.ZodString>;
47
- by: z.ZodString;
149
+ by: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
150
+ kind: z.ZodLiteral<"ai">;
151
+ runtime: z.ZodEnum<{
152
+ "hand-off": "hand-off";
153
+ "copilot-acp": "copilot-acp";
154
+ }>;
155
+ run: z.ZodString;
156
+ bar: z.ZodOptional<z.ZodEnum<{
157
+ confident: "confident";
158
+ "agrees-with-shapes": "agrees-with-shapes";
159
+ "person-rule": "person-rule";
160
+ }>>;
161
+ }, z.core.$strict>]>;
48
162
  at: z.ZodISODateTime;
49
163
  scope: z.ZodObject<{
50
164
  level: z.ZodEnum<{
@@ -54,10 +168,26 @@ export declare const QuestionAnswer: z.ZodObject<{
54
168
  id: z.ZodString;
55
169
  }, z.core.$strict>;
56
170
  skill: z.ZodOptional<z.ZodString>;
171
+ match: z.ZodOptional<z.ZodString>;
172
+ proposal: z.ZodOptional<z.ZodObject<{
173
+ by: z.ZodString;
174
+ at: z.ZodISODateTime;
175
+ cites: z.ZodArray<z.ZodObject<{
176
+ repo: z.ZodOptional<z.ZodString>;
177
+ file: z.ZodString;
178
+ line: z.ZodNumber;
179
+ quote: z.ZodString;
180
+ }, z.core.$strict>>;
181
+ }, z.core.$strict>>;
182
+ batch: z.ZodOptional<z.ZodString>;
183
+ rule: z.ZodOptional<z.ZodObject<{
184
+ from: z.ZodString;
185
+ match: z.ZodString;
186
+ }, z.core.$strict>>;
57
187
  }, z.core.$strict>;
58
188
  export type QuestionAnswer = z.infer<typeof QuestionAnswer>;
59
189
  export declare const Question: z.ZodObject<{
60
- schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
190
+ schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>]>;
61
191
  id: z.ZodString;
62
192
  askedBy: z.ZodObject<{
63
193
  step: z.ZodString;
@@ -87,6 +217,19 @@ export declare const Question: z.ZodObject<{
87
217
  }>;
88
218
  id: z.ZodString;
89
219
  }, z.core.$strict>;
220
+ role: z.ZodOptional<z.ZodEnum<{
221
+ product: "product";
222
+ architecture: "architecture";
223
+ delivery: "delivery";
224
+ analysis: "analysis";
225
+ }>>;
226
+ askedOf: z.ZodOptional<z.ZodString>;
227
+ finding: z.ZodOptional<z.ZodObject<{
228
+ change: z.ZodString;
229
+ gate: z.ZodString;
230
+ round: z.ZodNumber;
231
+ id: z.ZodString;
232
+ }, z.core.$strict>>;
90
233
  state: z.ZodEnum<{
91
234
  retired: "retired";
92
235
  open: "open";
@@ -96,7 +239,19 @@ export declare const Question: z.ZodObject<{
96
239
  answer: z.ZodOptional<z.ZodObject<{
97
240
  option: z.ZodOptional<z.ZodNumber>;
98
241
  text: z.ZodOptional<z.ZodString>;
99
- by: z.ZodString;
242
+ by: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
243
+ kind: z.ZodLiteral<"ai">;
244
+ runtime: z.ZodEnum<{
245
+ "hand-off": "hand-off";
246
+ "copilot-acp": "copilot-acp";
247
+ }>;
248
+ run: z.ZodString;
249
+ bar: z.ZodOptional<z.ZodEnum<{
250
+ confident: "confident";
251
+ "agrees-with-shapes": "agrees-with-shapes";
252
+ "person-rule": "person-rule";
253
+ }>>;
254
+ }, z.core.$strict>]>;
100
255
  at: z.ZodISODateTime;
101
256
  scope: z.ZodObject<{
102
257
  level: z.ZodEnum<{
@@ -106,17 +261,79 @@ export declare const Question: z.ZodObject<{
106
261
  id: z.ZodString;
107
262
  }, z.core.$strict>;
108
263
  skill: z.ZodOptional<z.ZodString>;
264
+ match: z.ZodOptional<z.ZodString>;
265
+ proposal: z.ZodOptional<z.ZodObject<{
266
+ by: z.ZodString;
267
+ at: z.ZodISODateTime;
268
+ cites: z.ZodArray<z.ZodObject<{
269
+ repo: z.ZodOptional<z.ZodString>;
270
+ file: z.ZodString;
271
+ line: z.ZodNumber;
272
+ quote: z.ZodString;
273
+ }, z.core.$strict>>;
274
+ }, z.core.$strict>>;
275
+ batch: z.ZodOptional<z.ZodString>;
276
+ rule: z.ZodOptional<z.ZodObject<{
277
+ from: z.ZodString;
278
+ match: z.ZodString;
279
+ }, z.core.$strict>>;
109
280
  }, z.core.$strict>>;
110
281
  retired: z.ZodOptional<z.ZodObject<{
111
282
  at: z.ZodISODateTime;
112
283
  why: z.ZodString;
113
284
  replacedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
285
  }, z.core.$strict>>;
286
+ reopened: z.ZodOptional<z.ZodObject<{
287
+ at: z.ZodISODateTime;
288
+ why: z.ZodString;
289
+ answer: z.ZodObject<{
290
+ option: z.ZodOptional<z.ZodNumber>;
291
+ text: z.ZodOptional<z.ZodString>;
292
+ by: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
293
+ kind: z.ZodLiteral<"ai">;
294
+ runtime: z.ZodEnum<{
295
+ "hand-off": "hand-off";
296
+ "copilot-acp": "copilot-acp";
297
+ }>;
298
+ run: z.ZodString;
299
+ bar: z.ZodOptional<z.ZodEnum<{
300
+ confident: "confident";
301
+ "agrees-with-shapes": "agrees-with-shapes";
302
+ "person-rule": "person-rule";
303
+ }>>;
304
+ }, z.core.$strict>]>;
305
+ at: z.ZodISODateTime;
306
+ scope: z.ZodObject<{
307
+ level: z.ZodEnum<{
308
+ repo: "repo";
309
+ "repo-type": "repo-type";
310
+ }>;
311
+ id: z.ZodString;
312
+ }, z.core.$strict>;
313
+ skill: z.ZodOptional<z.ZodString>;
314
+ match: z.ZodOptional<z.ZodString>;
315
+ proposal: z.ZodOptional<z.ZodObject<{
316
+ by: z.ZodString;
317
+ at: z.ZodISODateTime;
318
+ cites: z.ZodArray<z.ZodObject<{
319
+ repo: z.ZodOptional<z.ZodString>;
320
+ file: z.ZodString;
321
+ line: z.ZodNumber;
322
+ quote: z.ZodString;
323
+ }, z.core.$strict>>;
324
+ }, z.core.$strict>>;
325
+ batch: z.ZodOptional<z.ZodString>;
326
+ rule: z.ZodOptional<z.ZodObject<{
327
+ from: z.ZodString;
328
+ match: z.ZodString;
329
+ }, z.core.$strict>>;
330
+ }, z.core.$strict>;
331
+ }, z.core.$strict>>;
115
332
  related: z.ZodOptional<z.ZodArray<z.ZodObject<{
116
333
  id: z.ZodString;
117
334
  verdict: z.ZodEnum<{
118
- narrower: "narrower";
119
335
  unsure: "unsure";
336
+ narrower: "narrower";
120
337
  }>;
121
338
  judgment: z.ZodOptional<z.ZodString>;
122
339
  }, z.core.$strict>>>;
@@ -139,6 +356,12 @@ export declare const QuestionDraft: z.ZodObject<{
139
356
  "repo-type": "repo-type";
140
357
  }>>;
141
358
  repoType: z.ZodOptional<z.ZodString>;
359
+ role: z.ZodOptional<z.ZodEnum<{
360
+ product: "product";
361
+ architecture: "architecture";
362
+ delivery: "delivery";
363
+ analysis: "analysis";
364
+ }>>;
142
365
  sameAs: z.ZodOptional<z.ZodObject<{
143
366
  id: z.ZodString;
144
367
  verdict: z.ZodEnum<{
@@ -0,0 +1,51 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * G4 (ADR 0176): reading rules the organisation owns, in the org pack, in layers: `org.yaml` for
4
+ * every repo, `types/<type>.yaml` for every repo of a type, `repos/<repo>.yaml` for one repo, and
5
+ * `imported/<team>/<type>.yaml`, a pinned copy of another product team's type rules. Each rule
6
+ * adds to what Atticus's built-in rules tell a reader; a later layer may switch an earlier one off
7
+ * for its scope (a built-in rule set by `builtin:<set>`), saying why. A person or Copilot writes
8
+ * them; every change is reviewed like code. They never change the facts file's format or the
9
+ * verifier: every fact still cites its line.
10
+ */
11
+ export declare const READING_RULES_SCHEMA_VERSION: 1;
12
+ export declare const ReadingRule: z.ZodObject<{
13
+ key: z.ZodString;
14
+ status: z.ZodDefault<z.ZodEnum<{
15
+ active: "active";
16
+ draft: "draft";
17
+ }>>;
18
+ rule: z.ZodString;
19
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ example: z.ZodOptional<z.ZodString>;
21
+ by: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strict>;
23
+ export type ReadingRule = z.infer<typeof ReadingRule>;
24
+ export declare const ReadingRulesOff: z.ZodObject<{
25
+ key: z.ZodString;
26
+ reason: z.ZodString;
27
+ }, z.core.$strict>;
28
+ export declare const ReadingRulesFile: z.ZodObject<{
29
+ schemaVersion: z.ZodLiteral<1>;
30
+ source: z.ZodOptional<z.ZodObject<{
31
+ from: z.ZodString;
32
+ at: z.ZodString;
33
+ team: z.ZodString;
34
+ }, z.core.$strict>>;
35
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
36
+ key: z.ZodString;
37
+ status: z.ZodDefault<z.ZodEnum<{
38
+ active: "active";
39
+ draft: "draft";
40
+ }>>;
41
+ rule: z.ZodString;
42
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
+ example: z.ZodOptional<z.ZodString>;
44
+ by: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strict>>>;
46
+ off: z.ZodDefault<z.ZodArray<z.ZodObject<{
47
+ key: z.ZodString;
48
+ reason: z.ZodString;
49
+ }, z.core.$strict>>>;
50
+ }, z.core.$strict>;
51
+ export type ReadingRulesFile = z.infer<typeof ReadingRulesFile>;