@maycombhq/sdk 2.0.0-beta.1 → 2.0.0-beta.10

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 (98) hide show
  1. package/{dist → npm}/cache.d.ts +1 -1
  2. package/npm/core/api.d.ts +7462 -0
  3. package/npm/core/assistant-actor.d.ts +15 -0
  4. package/npm/core/audit.d.ts +153 -0
  5. package/npm/core/branches.d.ts +21 -0
  6. package/npm/core/cancel.d.ts +9 -0
  7. package/npm/core/catalog.d.ts +4733 -0
  8. package/npm/core/change-types-migrate.d.ts +10 -0
  9. package/npm/core/cite.d.ts +54 -0
  10. package/npm/core/curated.d.ts +37 -0
  11. package/npm/core/fact-paths.d.ts +14 -0
  12. package/npm/core/facts-callers.d.ts +152 -0
  13. package/npm/core/facts-carry.d.ts +36 -0
  14. package/npm/core/facts-join-prototype.d.ts +234 -0
  15. package/npm/core/facts-join-vendor.d.ts +110 -0
  16. package/npm/core/facts-join.d.ts +482 -0
  17. package/npm/core/facts.d.ts +94 -0
  18. package/npm/core/fs.d.ts +47 -0
  19. package/npm/core/gates-migrate.d.ts +10 -0
  20. package/npm/core/host-questions.d.ts +66 -0
  21. package/npm/core/identity.d.ts +17 -0
  22. package/npm/core/index.d.ts +73 -0
  23. package/npm/core/json-schema.d.ts +20 -0
  24. package/npm/core/judgments.d.ts +63 -0
  25. package/npm/core/light.d.ts +8 -0
  26. package/npm/core/link-evidence.d.ts +212 -0
  27. package/npm/core/log.d.ts +49 -0
  28. package/npm/core/manifest-edit.d.ts +57 -0
  29. package/npm/core/merge.d.ts +78 -0
  30. package/npm/core/metarepo.d.ts +91 -0
  31. package/npm/core/migrate.d.ts +31 -0
  32. package/npm/core/migration-files.d.ts +13 -0
  33. package/npm/core/orgpack-defaults.d.ts +199 -0
  34. package/npm/core/orgpack-load.d.ts +102 -0
  35. package/npm/core/question-order.d.ts +23 -0
  36. package/npm/core/question-owners.d.ts +53 -0
  37. package/npm/core/question-proposals.d.ts +77 -0
  38. package/npm/core/questions.d.ts +297 -0
  39. package/npm/core/record-cache.d.ts +52 -0
  40. package/npm/core/refs.d.ts +9 -0
  41. package/npm/core/repo-description.d.ts +44 -0
  42. package/npm/core/repo-reads.d.ts +44 -0
  43. package/npm/core/roles-migrate.d.ts +9 -0
  44. package/npm/core/runtime-migrate.d.ts +11 -0
  45. package/npm/core/schema/ai.d.ts +397 -0
  46. package/npm/core/schema/change.d.ts +244 -0
  47. package/npm/core/schema/common.d.ts +135 -0
  48. package/npm/core/schema/conventions.d.ts +75 -0
  49. package/npm/core/schema/dialect.d.ts +801 -0
  50. package/npm/core/schema/executors.d.ts +396 -0
  51. package/npm/core/schema/fact-corrections.d.ts +55 -0
  52. package/npm/core/schema/facts.d.ts +1491 -0
  53. package/npm/core/schema/frameworks.d.ts +371 -0
  54. package/npm/core/schema/judgment.d.ts +77 -0
  55. package/npm/core/schema/kinds.d.ts +5166 -0
  56. package/npm/core/schema/layout.d.ts +25 -0
  57. package/npm/core/schema/orgpack.d.ts +1185 -0
  58. package/npm/core/schema/plugin.d.ts +73 -0
  59. package/npm/core/schema/question.d.ts +195 -0
  60. package/npm/core/schema/repo-type.d.ts +109 -0
  61. package/npm/core/schema/review.d.ts +558 -0
  62. package/npm/core/schema/scan-settings.d.ts +34 -0
  63. package/npm/core/schema/scan-verify.d.ts +535 -0
  64. package/npm/core/schema/spec.d.ts +269 -0
  65. package/npm/core/schema/version.d.ts +9 -0
  66. package/npm/core/schema/workspace.d.ts +330 -0
  67. package/npm/core/serialize.d.ts +17 -0
  68. package/npm/core/shared-maps.d.ts +146 -0
  69. package/npm/core/sources-migrate.d.ts +15 -0
  70. package/npm/core/specs.d.ts +66 -0
  71. package/npm/core/stack-helpers.d.ts +32 -0
  72. package/npm/core/tar-read.d.ts +13 -0
  73. package/npm/core/template.d.ts +101 -0
  74. package/npm/core/words.d.ts +13 -0
  75. package/npm/core/zip-read.d.ts +37 -0
  76. package/npm/core/zip.d.ts +13 -0
  77. package/npm/index.js +9780 -0
  78. package/{dist → npm}/plugin.d.ts +1 -1
  79. package/{dist → npm}/runner.d.ts +1 -1
  80. package/package.json +10 -11
  81. package/dist/cache.js +0 -115
  82. package/dist/cache.js.map +0 -1
  83. package/dist/fs-repo.js +0 -120
  84. package/dist/fs-repo.js.map +0 -1
  85. package/dist/index.js +0 -7
  86. package/dist/index.js.map +0 -1
  87. package/dist/parse-cache.js +0 -275
  88. package/dist/parse-cache.js.map +0 -1
  89. package/dist/plugin.js +0 -85
  90. package/dist/plugin.js.map +0 -1
  91. package/dist/runner.js +0 -209
  92. package/dist/runner.js.map +0 -1
  93. package/dist/sandbox.js +0 -443
  94. package/dist/sandbox.js.map +0 -1
  95. /package/{dist → npm}/fs-repo.d.ts +0 -0
  96. /package/{dist → npm}/index.d.ts +0 -0
  97. /package/{dist → npm}/parse-cache.d.ts +0 -0
  98. /package/{dist → npm}/sandbox.d.ts +0 -0
@@ -0,0 +1,91 @@
1
+ /** True when the org pack is in `.atticus/org-pack/` (a repo adopted in place). */
2
+ export declare function isAdopted(root: string): boolean;
3
+ /** The org pack folder: `org-pack/` at the root, else `.atticus/org-pack/` when adopted. */
4
+ export declare function orgPackDirOf(root: string): string;
5
+ /** The org pack folder relative to the root with forward slashes, for messages and stored paths. */
6
+ export declare function orgPackRelOf(root: string): string;
7
+ /** The folder holding local state (`.index/`, `.runs/`, `workspace/`): the root, or `.atticus/`. */
8
+ export declare function stateDirOf(root: string): string;
9
+ /** Run folders (`.runs/<change>/<runId>/`: prompts, packs, build logs): under the state folder. */
10
+ export declare function runsDirOf(root: string): string;
11
+ /** The run folders relative to the root with forward slashes, for messages and stored paths. */
12
+ export declare function runsRelOf(root: string): string;
13
+ /** Where intake looks for what people drop in: `inputs/`, or `.atticus/inputs/` when adopted. */
14
+ export declare function inputsDirOf(root: string): string;
15
+ /** Where Atticus writes proposals for people to review, relative to the root with forward slashes. */
16
+ export declare function proposalsRelOf(root: string): string;
17
+ /** The proposals folder: `proposals/`, or `.atticus/proposals/` when adopted. */
18
+ export declare function proposalsDirOf(root: string): string;
19
+ /** Where questions to people live (ADR 0078), relative to the root: `questions`, or `.atticus/questions` when adopted. */
20
+ export declare function questionsRelOf(root: string): string;
21
+ /** The questions folder (ADR 0078). */
22
+ export declare function questionsDirOf(root: string): string;
23
+ /** Where the facts an assistant writes live, with forward slashes (ADR 0124): `facts`, or `.atticus/facts` when adopted. */
24
+ export declare function factsRelOf(root: string): string;
25
+ /** The facts folder (ADR 0124): `<repo>.jsonl` the assistant writes, `<repo>.rejected.jsonl` and `<repo>.verify.yaml` the verifier writes. */
26
+ export declare function factsDirOf(root: string): string;
27
+ /** Where evidence from outside the code lives (ADR 0151), relative to the root: `evidence`, or `.atticus/evidence` when adopted. */
28
+ export declare function evidenceRelOf(root: string): string;
29
+ /** Where other teams' shared maps live (ADR 0160), relative to the root: `shared`, or `.atticus/shared` when adopted. */
30
+ export declare function sharedRelOf(root: string): string;
31
+ /** The shared maps folder (ADR 0160): `<team>/map.yaml` and `<team>/facts/<repo>.jsonl`, their entries, read-only. */
32
+ export declare function sharedDirOf(root: string): string;
33
+ /** The evidence folder (ADR 0151): `traffic/<source>-<from>-<to>.yaml`, the traffic aggregates a person imported. */
34
+ export declare function evidenceDirOf(root: string): string;
35
+ /**
36
+ * The files the facts folder keeps beside a repo's facts file (ADR 0124): the questions the
37
+ * assistant raised, what the verifier rejected, the files read and found to hold no fact, a
38
+ * person's corrections, the verifier's report, and the read plan of a repo read in parts
39
+ * (addendum A-ledger). None of them is a facts file of its own.
40
+ */
41
+ export declare const FACTS_COMPANIONS: readonly [".questions.jsonl", ".rejected.jsonl", ".reviewed.jsonl", ".corrections.jsonl", ".verify.yaml", ".read-plan.yaml", ".audit.yaml", ".contracts.yaml", ".gaps.md"];
42
+ /**
43
+ * The repo a file in the facts folder belongs to, and whether it is the repo's facts file
44
+ * (`<repo>.jsonl`) or one of its companions; undefined for any other file. Every place that lists
45
+ * the facts folder reads it through this, so a companion is never taken for another repo.
46
+ */
47
+ export declare function factsFileOf(name: string): {
48
+ repo: string;
49
+ facts: boolean;
50
+ } | undefined;
51
+ /** Where the map rendered from a repo's verified facts lives, with forward slashes (ADR 0124): `map`, or `.atticus/map` when adopted. */
52
+ export declare function mapRelOf(root: string): string;
53
+ /** The map folder (ADR 0124): `<repo>/map.md`, `<repo>/flows/` and `<repo>/contracts/`, written by atticus map render. */
54
+ export declare function mapDirOf(root: string): string;
55
+ /** Where judgments live (ADR 0117), relative to the root: `judgments`, or `.atticus/judgments` when adopted. */
56
+ export declare function judgmentsRelOf(root: string): string;
57
+ /** The judgments folder (ADR 0117): judgments/<kind>/<key>.yaml. */
58
+ export declare function judgmentsDirOf(root: string): string;
59
+ /** Where repo specs live (ADR 0079), relative to the root: `specs`, or `.atticus/specs` when adopted. */
60
+ export declare function specsRelOf(root: string): string;
61
+ /** The specs folder (ADR 0079), holding one folder per repo. */
62
+ export declare function specsDirOf(root: string): string;
63
+ /** One repo's spec folder, relative to the root: `specs/<repo>` (spec.yaml and one file per flow). */
64
+ export declare function specRelOf(root: string, repo: string): string;
65
+ /** One repo's spec folder (ADR 0079). */
66
+ export declare function specDirOf(root: string, repo: string): string;
67
+ /**
68
+ * Where knowledge lives (ADR 0083), relative to the root: `knowledge`, or `.atticus/knowledge`
69
+ * when adopted. It holds `snapshots/<source>/<date>/` (what a sync copied) and `items/` (what
70
+ * the knowledge scan read from a snapshot).
71
+ */
72
+ export declare function knowledgeRelOf(root: string): string;
73
+ /** The knowledge folder (ADR 0083). */
74
+ export declare function knowledgeDirOf(root: string): string;
75
+ /** The layout from sources.yaml, or the defaults. */
76
+ export declare function layoutOf(root: string): {
77
+ catalog: string;
78
+ openspec: string;
79
+ };
80
+ /** The catalog folder (holding generated/ and curated/). */
81
+ export declare function catalogDirOf(root: string): string;
82
+ /**
83
+ * Where OpenSpec keeps changes, relative to the root with forward slashes: `changes/` under
84
+ * `layout.openspec` (`openspec/changes` by default, `.atticus/openspec/changes` in a repo
85
+ * adopted without its own OpenSpec folder). For messages, PR file lists and CODEOWNERS paths.
86
+ */
87
+ export declare function changesRelOf(root: string): string;
88
+ /** The OpenSpec folder (holding config.yaml, specs/ and changes/). */
89
+ export declare function openspecDirOf(root: string): string;
90
+ /** The folder holding change folders (`<id>/`) and `archive/`. */
91
+ export declare function changesDirOf(root: string): string;
@@ -0,0 +1,31 @@
1
+ export interface MigrationResult {
2
+ /** Files rewritten at the current schema version (relative to the folder, "/"-separated). */
3
+ migrated: string[];
4
+ /** Record files already at the current version, left alone. */
5
+ current: string[];
6
+ /** Old record files that don't pass C1: left exactly as they are, with why. */
7
+ problems: {
8
+ file: string;
9
+ message: string;
10
+ }[];
11
+ }
12
+ /**
13
+ * Rewrite every older record file under a catalog folder (generated and curated) at the
14
+ * current schema version, in canonical form. Readers accept old files anyway; migrating once
15
+ * keeps diffs clean afterwards. A file that isn't a catalog record (no known `kind`) is not
16
+ * touched, nor is an old one that fails C1: it is reported, so nothing is half-migrated.
17
+ * Version 1 → 2 (ADR 0031) and 2 → 3 (ADR 0125) change only `schemaVersion`: version 3 adds
18
+ * `required` on a Schema field, and a migrated record gains none, since nothing knew it. The
19
+ * canonical form also writes list defaults a hand-written file left out, exactly as a scan
20
+ * would write the record. `versions` limits it to files at those versions (each `atticus
21
+ * upgrade` step lists its own); what it writes is always the current version.
22
+ *
23
+ * `pendingOnly` is for a question about what is to do (`atticus doctor`, the app's Set up
24
+ * screen): `current` stays empty, and with `versions` a file whose text alone says it is at
25
+ * another version is not read as YAML. `migrated` and `problems` are the same as without it.
26
+ */
27
+ export declare function migrateCatalog(dir: string, o?: {
28
+ dryRun?: boolean;
29
+ versions?: readonly number[];
30
+ pendingOnly?: boolean;
31
+ }): Promise<MigrationResult>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Whether a cited file is a database migration, by the file naming the common migration tools
3
+ * use (ADR 0124 addendum B-places): the facts cite a column where it is declared, and when that
4
+ * is a migration the store's migrations are known from the facts, so a change to its tables is a
5
+ * new migration beside them rather than an edit of a schema file. `tool` is C1's Migration tool;
6
+ * `version` is the part of the name the tool orders by. A schema file, an entity, a tool's own
7
+ * scaffolding (an environment script, a designer or snapshot file) is no migration.
8
+ */
9
+ export interface MigrationFile {
10
+ tool: "flyway" | "liquibase" | "alembic" | "prisma" | "other";
11
+ version: string;
12
+ }
13
+ export declare function migrationOf(path: string): MigrationFile | undefined;
@@ -0,0 +1,199 @@
1
+ export declare const DEFAULT_CHANGE_TYPES: {
2
+ schemaVersion: 1 | 2;
3
+ types: {
4
+ id: string;
5
+ name: string;
6
+ phases: ("release" | "design" | "qa" | "define" | "plan" | "build")[];
7
+ artifacts: ("interfaces" | "data" | "ux" | "brief" | "proposal" | "specs" | "mappings" | "design" | "stories" | "tasks" | "snow")[];
8
+ lenses: ("true" | "complete" | "safe" | "ship" | "business" | "architecture" | "story" | "ux" | "delivery" | "code-and-test" | "release")[];
9
+ approvals: Partial<Record<"release" | "design" | "qa" | "define" | "plan" | "build", string[]>>;
10
+ postReleaseReview: boolean;
11
+ description?: string | undefined;
12
+ size?: "small" | "standard" | undefined;
13
+ smallWhenBriefSays?: boolean | undefined;
14
+ fastGate?: string | undefined;
15
+ }[];
16
+ };
17
+ export declare const DEFAULT_GATES: {
18
+ schemaVersion: 1 | 2;
19
+ gates: {
20
+ id: string;
21
+ phase: "release" | "design" | "qa" | "define" | "plan" | "build";
22
+ approvers: string[];
23
+ minApprovals: number;
24
+ checklists: string[];
25
+ checks: {
26
+ check: string;
27
+ params: Record<string, unknown>;
28
+ }[];
29
+ maxAuthorRounds?: number | "unlimited" | undefined;
30
+ }[];
31
+ };
32
+ export declare const DEFAULT_ROLES: {
33
+ schemaVersion: 1 | 2;
34
+ teams: {
35
+ id: string;
36
+ people: string[];
37
+ name?: string | undefined;
38
+ }[];
39
+ custom: {
40
+ id: string;
41
+ name: string;
42
+ basedOn: "product-owner" | "business-analyst" | "architect" | "team-lead" | "developer" | "qa" | "delivery-lead" | "platform-lead" | "designer" | "process-owner" | "data-architect" | "sre" | "security-reviewer";
43
+ }[];
44
+ enabledOptional: ("process-owner" | "data-architect" | "sre" | "security-reviewer")[];
45
+ mappings: {
46
+ group: string;
47
+ role: string;
48
+ }[];
49
+ approvals: Partial<Record<"release-go-no-go" | "waiver" | "snow-submission" | "org-pack-change" | "catalog-assert", {
50
+ roles: string[];
51
+ groups: string[];
52
+ people: string[];
53
+ }>>;
54
+ separation: {
55
+ actions: [string, string];
56
+ reason: string;
57
+ }[];
58
+ };
59
+ export declare const DEFAULT_RUNTIME: {
60
+ schemaVersion: 1 | 2;
61
+ assistants: {
62
+ allowed: ("copilot" | "claude-code" | "cursor" | "gemini-cli" | "windsurf" | "agents-md")[];
63
+ default: "copilot" | "claude-code" | "cursor" | "gemini-cli" | "windsurf" | "agents-md";
64
+ };
65
+ editors: ("vscode" | "intellij")[];
66
+ ai: "on" | "text-only" | "off";
67
+ modes: {
68
+ allowed: ("model" | "hand-off" | "headless-claude-code")[];
69
+ default: "model" | "hand-off" | "headless-claude-code";
70
+ };
71
+ models: {
72
+ allowed: string[];
73
+ recommended: Record<string, string>;
74
+ read?: string | undefined;
75
+ draft?: string | undefined;
76
+ critic?: string | undefined;
77
+ knowledge?: string | undefined;
78
+ quick?: string | undefined;
79
+ };
80
+ autonomy: {
81
+ default: "draft" | "plan-only" | "draft-and-pr";
82
+ capPerRepo: Record<string, "draft" | "plan-only" | "draft-and-pr">;
83
+ maxFixRounds: number;
84
+ };
85
+ budgets: {
86
+ defaultTokens: number;
87
+ perAgent: Record<string, number>;
88
+ };
89
+ retention: {
90
+ runsDays: number;
91
+ };
92
+ telemetry: {
93
+ enabled: boolean;
94
+ };
95
+ adapters: {
96
+ workTracker?: {
97
+ type: string;
98
+ settings: Record<string, string | number | boolean | string[]>;
99
+ } | undefined;
100
+ serviceDesk?: {
101
+ type: string;
102
+ settings: Record<string, string | number | boolean | string[]>;
103
+ } | undefined;
104
+ gitHost?: {
105
+ type: string;
106
+ settings: Record<string, string | number | boolean | string[]>;
107
+ } | undefined;
108
+ wiki?: {
109
+ type: string;
110
+ settings: Record<string, string | number | boolean | string[]>;
111
+ } | undefined;
112
+ notify?: {
113
+ type: string;
114
+ settings: Record<string, string | number | boolean | string[]>;
115
+ } | undefined;
116
+ design?: {
117
+ type: string;
118
+ settings: Record<string, string | number | boolean | string[]>;
119
+ } | undefined;
120
+ model?: {
121
+ type: string;
122
+ settings: Record<string, string | number | boolean | string[]>;
123
+ } | undefined;
124
+ };
125
+ history?: {
126
+ record: boolean;
127
+ } | undefined;
128
+ retrieval?: {
129
+ embeddings: {
130
+ model: string;
131
+ runtime?: string | undefined;
132
+ };
133
+ expansion: boolean;
134
+ rerank: boolean;
135
+ } | undefined;
136
+ buildEngine?: {
137
+ default: "atticus" | "speckit";
138
+ perRepo: Record<string, "atticus" | "speckit">;
139
+ } | undefined;
140
+ };
141
+ export declare const DEFAULT_SOURCES: {
142
+ schemaVersion: 3 | 1 | 2;
143
+ layout: {
144
+ openspec: string;
145
+ catalog: string;
146
+ skills: string[];
147
+ prompts: string[];
148
+ constitution?: string | undefined;
149
+ };
150
+ wikis: {
151
+ id: string;
152
+ type: "confluence-export" | "sharepoint-export" | "confluence" | "ado-wiki" | "sharepoint" | "markdown-folder" | "git";
153
+ location: string;
154
+ spaces: string[];
155
+ owner?: string | undefined;
156
+ tags?: {
157
+ kinds: string[];
158
+ frameworks: string[];
159
+ } | undefined;
160
+ ref?: string | undefined;
161
+ path?: string | undefined;
162
+ checkout?: "clone" | "submodule" | undefined;
163
+ include?: string[] | undefined;
164
+ exclude?: string[] | undefined;
165
+ authority?: "platform" | "standard" | "framework" | "team" | "reference" | undefined;
166
+ byPage?: {
167
+ match: string[];
168
+ authority?: "platform" | "standard" | "framework" | "team" | "reference" | undefined;
169
+ status?: "current" | "deprecated" | "superseded" | "archived" | undefined;
170
+ }[] | undefined;
171
+ reviewMonths?: number | undefined;
172
+ appliesTo?: {
173
+ systems?: string[] | undefined;
174
+ components?: string[] | undefined;
175
+ platforms?: string[] | undefined;
176
+ repoTypes?: string[] | undefined;
177
+ frameworks?: string[] | undefined;
178
+ newComponents?: boolean | undefined;
179
+ } | undefined;
180
+ readRestricted?: boolean | undefined;
181
+ maxPages?: number | undefined;
182
+ }[];
183
+ absorbed: {
184
+ id: string;
185
+ url: string;
186
+ format: "openspec" | "atticus" | "speckit" | "plain";
187
+ mode: "link" | "adopt" | "ignore";
188
+ ref?: string | undefined;
189
+ }[];
190
+ };
191
+ export declare const DEFAULT_TEST_STRATEGY: {
192
+ schemaVersion: 1;
193
+ matrix: {
194
+ changeType: string;
195
+ risk: "low" | "medium" | "high";
196
+ required: ("unit" | "contract" | "integration" | "e2e" | "regression" | "performance" | "security" | "accessibility" | "data-migration")[];
197
+ }[];
198
+ definitionOfReady: string[];
199
+ };
@@ -0,0 +1,102 @@
1
+ import { FrameworkModel } from "./schema/frameworks.js";
2
+ import { ScanSettings } from "./schema/scan-settings.js";
3
+ import { RepoType } from "./schema/repo-type.js";
4
+ import { ModelProviderPlugin, ScannerPlugin } from "./schema/plugin.js";
5
+ import { SpecTemplate } from "./schema/spec.js";
6
+ import type { z } from "zod";
7
+ import { AgentDefinition } from "./schema/ai.js";
8
+ import { Dialect } from "./schema/dialect.js";
9
+ import { ChangeTypes, Estimates, Gates, OpenSpecSettings, IntegrationPattern, PackManifest, Procedure, Profile, Roles, Runtime, ServiceRequestTemplate, SkillMeta, Sources, TestStrategy } from "./schema/orgpack.js";
10
+ import { ChecklistPack } from "./schema/review.js";
11
+ import { RepoManifest } from "./schema/workspace.js";
12
+ import { Conventions } from "./schema/conventions.js";
13
+ export interface OrgPackProblem {
14
+ /** File relative to the org-pack folder. */
15
+ file: string;
16
+ path: string;
17
+ message: string;
18
+ }
19
+ export interface OrgPack {
20
+ pack?: PackManifest;
21
+ /** Deprecated (ADR 0073): loaded and validated when present, read by nothing. */
22
+ roles: Roles;
23
+ changeTypes: z.infer<typeof ChangeTypes>;
24
+ gates: z.infer<typeof Gates>;
25
+ runtime: Runtime;
26
+ sources: z.infer<typeof Sources>;
27
+ testStrategy: z.infer<typeof TestStrategy>;
28
+ profiles: {
29
+ profile?: Profile;
30
+ repos?: RepoManifest;
31
+ platform: string;
32
+ }[];
33
+ patterns: IntegrationPattern[];
34
+ dialects: Dialect[];
35
+ /** Framework models (ADR 0054), from frameworks/. */
36
+ frameworks: FrameworkModel[];
37
+ /** Scan settings per repo (ADR 0075), from scan/<repo>.yaml. */
38
+ scanSettings: ScanSettings[];
39
+ /** Repo types (ADR 0077), from repo-types/<id>/type.yaml. */
40
+ repoTypes: RepoType[];
41
+ /** Scanner plugins (ADR 0080), from plugins/<id>/plugin.yaml, with their folders. */
42
+ plugins: {
43
+ manifest: ScannerPlugin;
44
+ dir: string;
45
+ }[];
46
+ /** Model-provider plugins (ADR 0121 item 4): plugins/model-providers/<id>/plugin.yaml. */
47
+ modelProviders: {
48
+ manifest: ModelProviderPlugin;
49
+ dir: string;
50
+ }[];
51
+ /** Spec templates (ADR 0079), from repo-types/<id>/spec-template.yaml; a type may have none. */
52
+ specTemplates: SpecTemplate[];
53
+ checklists: ChecklistPack[];
54
+ skills: (z.infer<typeof SkillMeta> & {
55
+ body: string;
56
+ })[];
57
+ serviceRequests: z.infer<typeof ServiceRequestTemplate>[];
58
+ /** Procedures (ADR 0033), from process/procedures/. */
59
+ procedures: Procedure[];
60
+ agents: AgentDefinition[];
61
+ /**
62
+ * The house conventions a read leans on (ADR 0147), from conventions.yaml: the built-in lists
63
+ * when the pack has none. Optional so a pack built in code (a test's) needs none.
64
+ */
65
+ conventions?: Conventions;
66
+ /** Files that came from built-in defaults because the pack doesn't have them. */
67
+ defaulted: string[];
68
+ problems: OrgPackProblem[];
69
+ }
70
+ /**
71
+ * Read and validate a whole org pack. Never throws for content problems: every schema or
72
+ * cross-file problem is listed in `problems` with its file, so a team sees all of them at
73
+ * once. Missing files fall back to the built-in defaults.
74
+ */
75
+ export declare function loadOrgPack(dir: string): Promise<OrgPack>;
76
+ /**
77
+ * The org pack's OpenSpec store settings (ADR 0126), `openspec.yaml`: the defaults (nothing on)
78
+ * when the pack has none, and also, with a problem, when the file is there and doesn't read.
79
+ */
80
+ export declare function loadOpenSpecSettings(dir: string): Promise<{
81
+ settings: OpenSpecSettings;
82
+ problem?: string;
83
+ }>;
84
+ /**
85
+ * The org pack's reference ranges for estimates (ADR 0109), `estimates.yaml`: undefined when
86
+ * the pack has none (an estimate then sizes the work and gives no days); a problem when the
87
+ * file is there and doesn't read.
88
+ */
89
+ export declare function loadEstimates(dir: string): Promise<{
90
+ estimates?: Estimates;
91
+ problem?: string;
92
+ }>;
93
+ /** The conventions of a pack (ADR 0147), its defaults when it has none. */
94
+ export declare const conventionsOf: (op: Pick<OrgPack, "conventions"> | undefined) => Conventions;
95
+ /** What the estate join takes from a pack's conventions (ADR 0147): its facing words and bundle folders. */
96
+ export declare function joinConventions(op: Pick<OrgPack, "conventions"> | undefined): {
97
+ facing: {
98
+ internal: readonly string[];
99
+ external: readonly string[];
100
+ };
101
+ bundleFolders: readonly string[];
102
+ };
@@ -0,0 +1,23 @@
1
+ import type { Question } from "./schema/question.js";
2
+ /** The changes in flight: their ids, sorted. */
3
+ export declare function changesInFlight(root: string): Promise<string[]>;
4
+ /**
5
+ * The questions each change in flight rests on, by question id: the changes, sorted. A change's
6
+ * own questions are found by `questionWeights` (their repo is the change's id); this reads the
7
+ * question files the newest round of each of its gates cites.
8
+ */
9
+ export declare function questionsInFlight(root: string): Promise<Map<string, string[]>>;
10
+ /** Why a question is where it is in the list. */
11
+ export interface QuestionWeight {
12
+ /** The changes in flight that rest on it, sorted; empty when none. */
13
+ restsOn: string[];
14
+ /** How many calls its answer joins; 0 for a question that isn't about a link. */
15
+ joins: number;
16
+ }
17
+ /** The weight of each question (see `QuestionWeight`), by id. */
18
+ export declare function questionWeights(root: string, questions: readonly Question[]): Promise<Map<string, QuestionWeight>>;
19
+ /**
20
+ * The questions in the order to ask them: what a change in flight rests on first, then the
21
+ * answers that join the most calls; otherwise as they came (oldest first, from listQuestions).
22
+ */
23
+ export declare function orderQuestions<Q extends Pick<Question, "id">>(questions: readonly Q[], weights: ReadonlyMap<string, QuestionWeight>): Q[];
@@ -0,0 +1,53 @@
1
+ import { type Team } from "./schema/orgpack.js";
2
+ import type { Question } from "./schema/question.js";
3
+ /**
4
+ * Route each question to its owner (ADR 0140, Q4): the team that owns the question's repo is the
5
+ * repo manifest's `owner`; roles.yaml's `teams` (version 2) gives the team a name and says who is
6
+ * on it, so `atticus questions list --mine` and the app's Questions page can list a person's own.
7
+ * The person is the metarepo's Git user (ADR 0073). Words, not permissions: anyone can still
8
+ * read and answer any question.
9
+ */
10
+ /** The team a question goes to, or why none does. */
11
+ export type QuestionOwner = {
12
+ team: string;
13
+ name?: string;
14
+ } | {
15
+ none: string;
16
+ };
17
+ /** The teams roles.yaml names, and why they couldn't be read when they couldn't. */
18
+ export declare function readTeams(root: string): Promise<{
19
+ teams: Team[];
20
+ problem?: string;
21
+ }>;
22
+ /** The teams a person is on, by their Git handle. */
23
+ export declare function teamsOfPerson(handle: string, teams: readonly Team[]): Team[];
24
+ /**
25
+ * Who a question goes to: the team the manifest names as its repo's owner, with the name
26
+ * roles.yaml gives it. A change's own questions, and a repo no manifest lists, have no team.
27
+ */
28
+ export declare function ownerOfQuestion(q: Pick<Question, "repo">, o: {
29
+ /** Each listed repo's owner, from the repo manifests. */
30
+ owners: ReadonlyMap<string, string>;
31
+ teams: readonly Team[];
32
+ /** The ids of the changes, whose own questions are filed under them. */
33
+ changes?: ReadonlySet<string>;
34
+ }): QuestionOwner;
35
+ /**
36
+ * Who a question goes to, a change's people included (ADR 0153, Q4): a change's own question,
37
+ * filed under the change's id, goes to the people its change.yaml names under `owners`, whatever
38
+ * they do on it; every other question goes to its repo's team (`ownerOfQuestion`).
39
+ */
40
+ export type QuestionRoute = QuestionOwner | {
41
+ change: string;
42
+ people: string[];
43
+ };
44
+ /** Everyone a change.yaml's `owners` names, by handle, once each, sorted. */
45
+ export declare function peopleOfChange(owners: Readonly<Record<string, readonly string[]>>): string[];
46
+ export declare function routeOfQuestion(q: Pick<Question, "repo">, o: Parameters<typeof ownerOfQuestion>[1] & {
47
+ /** The people of each change (`peopleOfChange`), by change id. */
48
+ changePeople?: ReadonlyMap<string, readonly string[]>;
49
+ }): QuestionRoute;
50
+ /** Whether a question is the person's: they are on its team, or one of its change's people. */
51
+ export declare function isPersonsQuestion(handle: string, route: QuestionRoute, teams: readonly Team[]): boolean;
52
+ /** The owner in a few words: "team-ledger (Ledger team)", "add-pins's people: ari, sam", or "no owner: why". */
53
+ export declare function ownerWords(o: QuestionRoute): string;
@@ -0,0 +1,77 @@
1
+ import { z } from "zod";
2
+ import { answerQuestion } from "./questions.js";
3
+ import { QuestionScopeLevel, type Question } from "./schema/question.js";
4
+ /**
5
+ * The assistant proposes, a person confirms (ADR 0144, Q5). The `/atticus-propose` step reads the
6
+ * code and config behind each open question and writes a proposed answer beside it, in
7
+ * `proposals/questions/<id>.yaml` (under `.atticus/` in a repo adopted in place), with the lines
8
+ * it rests on. It never answers: the question file is untouched until a person accepts.
9
+ *
10
+ * Every citation is checked here, deterministically, before a proposal is shown: its repo is the
11
+ * question's or one a manifest lists, and has a checkout here (only a change's own question cites
12
+ * the metarepo, and never Atticus's own folders: proposals, questions, facts, knowledge, judgments,
13
+ * runs); the file is in that checkout once links are followed; the line is there; and the quoted
14
+ * words are on it (spacing, curly quotes and case aside, as `quotedIn`). A refused citation's
15
+ * problem never says what the file holds. A proposal that fails is never shown as a proposal, only as its problems.
16
+ * `acceptProposal` checks it again and records the answer as the person's (`answerQuestion`).
17
+ *
18
+ * The proposals folder holds drafts for a person to review, not a contract. An accepted answer
19
+ * records, in the question file, that it was a proposal (ADR 0153): who proposed it, when, and the
20
+ * lines it cited.
21
+ */
22
+ export declare const QUESTION_PROPOSAL_SCHEMA_VERSION: 1;
23
+ /** A line the proposal rests on (the same shape an accepted answer keeps, ADR 0153). */
24
+ export declare const ProposalCite: z.ZodObject<{
25
+ repo: z.ZodOptional<z.ZodString>;
26
+ file: z.ZodString;
27
+ line: z.ZodNumber;
28
+ quote: z.ZodString;
29
+ }, z.core.$strict>;
30
+ export type ProposalCite = z.infer<typeof ProposalCite>;
31
+ export declare const QuestionProposal: z.ZodObject<{
32
+ schemaVersion: z.ZodLiteral<1>;
33
+ answer: z.ZodObject<{
34
+ option: z.ZodOptional<z.ZodNumber>;
35
+ text: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strict>;
37
+ why: z.ZodString;
38
+ cites: z.ZodArray<z.ZodObject<{
39
+ repo: z.ZodOptional<z.ZodString>;
40
+ file: z.ZodString;
41
+ line: z.ZodNumber;
42
+ quote: z.ZodString;
43
+ }, z.core.$strict>>;
44
+ by: z.ZodString;
45
+ at: z.ZodISODateTime;
46
+ }, z.core.$strict>;
47
+ export type QuestionProposal = z.infer<typeof QuestionProposal>;
48
+ /** Where a question's proposal lives, relative to the root. */
49
+ export declare const proposalRelOf: (root: string, id: string) => string;
50
+ /** A proposal as read and checked. `ok` only when it read and every check passed. */
51
+ export interface CheckedProposal {
52
+ id: string;
53
+ /** Relative to the root. */
54
+ file: string;
55
+ proposal?: QuestionProposal;
56
+ ok: boolean;
57
+ /** Its question is answered, retired or gone: nothing to propose. */
58
+ stale?: true;
59
+ problems: string[];
60
+ }
61
+ /** The problems of one proposal against its question and the files it cites; none: it holds. */
62
+ export declare function checkProposal(root: string, q: Question, p: QuestionProposal): Promise<string[]>;
63
+ /** Every proposal on file, each read and checked against its question; by question id. */
64
+ export declare function checkedProposals(root: string): Promise<CheckedProposal[]>;
65
+ /** One question's proposal, checked; undefined when there is none. */
66
+ export declare function proposalOf(root: string, id: string): Promise<CheckedProposal | undefined>;
67
+ /**
68
+ * A person accepts the proposal: checked again, then written as their answer, by them, at the
69
+ * scope they confirm (the question's own by default). Refused when there is none or it fails.
70
+ */
71
+ export declare function acceptProposal(root: string, id: string, a: {
72
+ by: string;
73
+ at: string;
74
+ scope?: QuestionScopeLevel;
75
+ repoType?: string;
76
+ match?: string;
77
+ }): ReturnType<typeof answerQuestion>;