@maycombhq/openspec-adapter 0.0.0-stage → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +177 -0
- package/dist/adapter.d.ts +81 -0
- package/dist/adapter.js +249 -0
- package/dist/adapter.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/org-flow.d.ts +38 -0
- package/dist/org-flow.js +286 -0
- package/dist/org-flow.js.map +1 -0
- package/dist/results.d.ts +265 -0
- package/dist/results.js +125 -0
- package/dist/results.js.map +1 -0
- package/dist/stores.d.ts +112 -0
- package/dist/stores.js +249 -0
- package/dist/stores.js.map +1 -0
- package/package.json +28 -3
- package/README.md +0 -3
package/dist/org-flow.js
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { parseDocument, stringify } from "yaml";
|
|
4
|
+
/**
|
|
5
|
+
* The org-flow workflow schema: OpenSpec's own schema format, written into the metarepo at
|
|
6
|
+
* openspec/schemas/org-flow/. It extends spec-driven with the artifacts an enterprise
|
|
7
|
+
* change needs, in this dependency order:
|
|
8
|
+
*
|
|
9
|
+
* proposal → specs, interfaces → mappings, data → design → stories → tasks → snow
|
|
10
|
+
*
|
|
11
|
+
* Files Atticus owns that are not schema artifacts (brief.md, stories/<id>.md, ux.md,
|
|
12
|
+
* repos.yaml, review/) live in the same change folder; OpenSpec ignores them.
|
|
13
|
+
*
|
|
14
|
+
* Organisations change instructions and templates through the org pack (process/), which
|
|
15
|
+
* regenerates this folder; nobody edits it by hand.
|
|
16
|
+
*/
|
|
17
|
+
export const ORG_FLOW = "org-flow";
|
|
18
|
+
const ARTIFACTS = [
|
|
19
|
+
{
|
|
20
|
+
id: "proposal",
|
|
21
|
+
generates: "proposal.md",
|
|
22
|
+
description: "Why the change is needed and what it changes, drafted from the PO's brief",
|
|
23
|
+
requires: [],
|
|
24
|
+
instruction: `Write the proposal from brief.md in this change folder. brief.md is the product owner's
|
|
25
|
+
source; do not add scope it does not ask for, and list anything unclear under Open questions.
|
|
26
|
+
|
|
27
|
+
Sections:
|
|
28
|
+
- Why: the problem or opportunity in one or two sentences, and why now.
|
|
29
|
+
- What Changes: specific bullets. Mark breaking changes with **BREAKING**.
|
|
30
|
+
- Capabilities: new and modified capabilities. Each becomes specs/<capability>/spec.md.
|
|
31
|
+
Run \`openspec list --specs\` first and reuse existing capability names.
|
|
32
|
+
- Systems: every system the change touches, by catalog id, and whether it is new, modified or retired.
|
|
33
|
+
- Impact: affected APIs, data, consumers, teams and external parties.
|
|
34
|
+
- Open questions: what the brief leaves undecided, each with who should answer.
|
|
35
|
+
|
|
36
|
+
A change that alters no behaviour sets skip_specs: true in .openspec.yaml instead of inventing requirements.`,
|
|
37
|
+
template: `# Proposal
|
|
38
|
+
|
|
39
|
+
## Why
|
|
40
|
+
|
|
41
|
+
<!-- The problem or opportunity, and why now. -->
|
|
42
|
+
|
|
43
|
+
## What Changes
|
|
44
|
+
|
|
45
|
+
- <!-- Specific change. Mark breaking changes with **BREAKING**. -->
|
|
46
|
+
|
|
47
|
+
## Capabilities
|
|
48
|
+
|
|
49
|
+
### New Capabilities
|
|
50
|
+
- \`<capability>\`: <!-- what it covers -->
|
|
51
|
+
|
|
52
|
+
### Modified Capabilities
|
|
53
|
+
- \`<existing-capability>\`: <!-- what requirement changes -->
|
|
54
|
+
|
|
55
|
+
## Systems
|
|
56
|
+
|
|
57
|
+
| System (catalog id) | New, modified or retired | Why |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| | | |
|
|
60
|
+
|
|
61
|
+
## Impact
|
|
62
|
+
|
|
63
|
+
<!-- APIs, data, consumers, teams, external parties. -->
|
|
64
|
+
|
|
65
|
+
## Open questions
|
|
66
|
+
|
|
67
|
+
- <!-- Question — who should answer -->
|
|
68
|
+
`,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "specs",
|
|
72
|
+
generates: "specs/**/*.md",
|
|
73
|
+
description: "Behaviour the change adds, modifies or removes, as OpenSpec delta specs",
|
|
74
|
+
requires: ["proposal"],
|
|
75
|
+
instruction: `Write one delta spec per capability in the proposal, at specs/<capability>/spec.md.
|
|
76
|
+
Use OpenSpec delta headers (## ADDED Requirements, ## MODIFIED Requirements, ## REMOVED Requirements,
|
|
77
|
+
## RENAMED Requirements). Every requirement uses SHALL or MUST and has at least one
|
|
78
|
+
"#### Scenario:" with WHEN and THEN bullets. Specs describe observable behaviour: inputs, outputs,
|
|
79
|
+
errors, limits. No class names, libraries or step-by-step plans.`,
|
|
80
|
+
template: `## ADDED Requirements
|
|
81
|
+
|
|
82
|
+
### Requirement: <!-- name -->
|
|
83
|
+
The system SHALL <!-- behaviour -->.
|
|
84
|
+
|
|
85
|
+
#### Scenario: <!-- name -->
|
|
86
|
+
- **WHEN** <!-- condition -->
|
|
87
|
+
- **THEN** <!-- outcome -->
|
|
88
|
+
`,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "interfaces",
|
|
92
|
+
generates: "interfaces.md",
|
|
93
|
+
description: "Every integration hop the change adds, changes or retires",
|
|
94
|
+
requires: ["proposal"],
|
|
95
|
+
instruction: `List every hop between systems that the change adds, modifies or retires. Start from the
|
|
96
|
+
catalog: an existing hop keeps its interface id. For each hop give caller, callee, the integration
|
|
97
|
+
pattern code from the org pack's pattern registry, the operation (method and path, or topic), the
|
|
98
|
+
contract (OpenAPI, AsyncAPI, schema or vendor spec), and its status: planned-new, planned-modify or
|
|
99
|
+
planned-retire. A hop through the gateway names the gateway route. Never invent a pattern code; if
|
|
100
|
+
none fits, write "none fits" and say why. Hops are reconciled against the architect's diagram.`,
|
|
101
|
+
template: `# Interfaces
|
|
102
|
+
|
|
103
|
+
| Interface id | Caller | Callee | Pattern | Operation | Contract | Status |
|
|
104
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
105
|
+
| <!-- if-… or new --> | | | | <!-- GET /path or topic --> | | planned-new |
|
|
106
|
+
|
|
107
|
+
## Notes
|
|
108
|
+
|
|
109
|
+
<!-- Auth, timeouts and retries per hop, consumers affected by modified or retired hops. -->
|
|
110
|
+
`,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "mappings",
|
|
114
|
+
generates: "mappings.md",
|
|
115
|
+
description: "Field-level mappings for each new or changed interface",
|
|
116
|
+
requires: ["interfaces"],
|
|
117
|
+
instruction: `For each new or modified interface in interfaces.md, map every field from source to target:
|
|
118
|
+
source field, target field, transformation or rule, and what happens when the source is missing or
|
|
119
|
+
invalid. Use the glossary's business terms and catalog field names. Note sensitive fields and how
|
|
120
|
+
they are protected. An interface with no payload change says "No mapping change".`,
|
|
121
|
+
template: `# Mappings
|
|
122
|
+
|
|
123
|
+
## <!-- interface id or name -->
|
|
124
|
+
|
|
125
|
+
| Source field | Target field | Rule or transformation | When missing or invalid |
|
|
126
|
+
| --- | --- | --- | --- |
|
|
127
|
+
| | | | |
|
|
128
|
+
`,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "data",
|
|
132
|
+
generates: "data.md",
|
|
133
|
+
description: "Database and data changes: tables, columns, indexes, migrations, retention",
|
|
134
|
+
requires: ["interfaces"],
|
|
135
|
+
instruction: `Describe every data change against the current database design in the catalog: new or
|
|
136
|
+
changed tables, columns (type, nullability, default), indexes and constraints, the migrations that
|
|
137
|
+
make them, backfill and its size, data classification, retention and who else reads or writes the
|
|
138
|
+
tables. Destructive changes need an expand-and-contract plan. A change with no data impact says
|
|
139
|
+
"No data change" and why.`,
|
|
140
|
+
template: `# Data
|
|
141
|
+
|
|
142
|
+
## Changes
|
|
143
|
+
|
|
144
|
+
| Data store | Table | Change | Migration |
|
|
145
|
+
| --- | --- | --- | --- |
|
|
146
|
+
| | | | |
|
|
147
|
+
|
|
148
|
+
## Backfill, classification and retention
|
|
149
|
+
|
|
150
|
+
<!-- Size and duration of any backfill; classification of new fields; retention. -->
|
|
151
|
+
|
|
152
|
+
## Other readers and writers
|
|
153
|
+
|
|
154
|
+
<!-- From the catalog: who else uses these tables, and what they need to know. -->
|
|
155
|
+
`,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "design",
|
|
159
|
+
generates: "design.md",
|
|
160
|
+
description: "How the change is built: approach, decisions, non-functional design, rollout",
|
|
161
|
+
requires: ["specs", "mappings", "data"],
|
|
162
|
+
instruction: `Explain how the change will be built. Cover: approach per system; decisions with the options
|
|
163
|
+
considered; non-functional design (timeouts, retries, idempotency, capacity, security, observability)
|
|
164
|
+
checked against the catalog's current settings and the platform's obligations; rollout order across
|
|
165
|
+
repos, feature flags and rollback; and risks. Reference interfaces, mappings and data by id rather
|
|
166
|
+
than repeating them.`,
|
|
167
|
+
template: `# Design
|
|
168
|
+
|
|
169
|
+
## Approach
|
|
170
|
+
|
|
171
|
+
## Decisions
|
|
172
|
+
|
|
173
|
+
| Decision | Options considered | Chosen because |
|
|
174
|
+
| --- | --- | --- |
|
|
175
|
+
| | | |
|
|
176
|
+
|
|
177
|
+
## Non-functional design
|
|
178
|
+
|
|
179
|
+
<!-- Timeouts, retries, idempotency, capacity, security, observability. -->
|
|
180
|
+
|
|
181
|
+
## Rollout and rollback
|
|
182
|
+
|
|
183
|
+
## Risks
|
|
184
|
+
`,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: "stories",
|
|
188
|
+
generates: "stories.md",
|
|
189
|
+
description: "Index of user stories; each story lives in stories/<story-id>.md",
|
|
190
|
+
requires: ["design"],
|
|
191
|
+
instruction: `Break the change into user stories, one file per story at stories/<story-id>.md, and keep
|
|
192
|
+
stories.md as the index (Atticus regenerates it from the story files). Each story has a title in
|
|
193
|
+
"As a … I want … so that …" form, acceptance criteria in Given/When/Then form that trace to spec
|
|
194
|
+
scenarios, the systems and repos it touches, and its dependencies. A story without acceptance
|
|
195
|
+
criteria is not ready.`,
|
|
196
|
+
template: `# Stories
|
|
197
|
+
|
|
198
|
+
| Story | Title | Repos | Depends on |
|
|
199
|
+
| --- | --- | --- | --- |
|
|
200
|
+
| <!-- s1 --> | | | |
|
|
201
|
+
`,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "tasks",
|
|
205
|
+
generates: "tasks.md",
|
|
206
|
+
description: "Implementation checklist grouped by repo",
|
|
207
|
+
requires: ["stories"],
|
|
208
|
+
instruction: `List implementation tasks grouped by repo, one "## <repo-id>" heading per repo from repos.yaml.
|
|
209
|
+
Each task is a checkbox "- [ ] <n>.<m> <description>" small enough for one pull request, names the
|
|
210
|
+
story it serves, and includes its tests. Order tasks so dependencies come first across repos.`,
|
|
211
|
+
template: `# Tasks
|
|
212
|
+
|
|
213
|
+
## <!-- repo-id -->
|
|
214
|
+
|
|
215
|
+
- [ ] 1.1 <!-- task (story s1) -->
|
|
216
|
+
`,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: "snow",
|
|
220
|
+
generates: "snow.md",
|
|
221
|
+
description: "Service-desk requests the change needs: firewall, access, certificates, change tickets",
|
|
222
|
+
requires: ["tasks"],
|
|
223
|
+
instruction: `List every service-desk request the change needs before it can go live: firewall rules,
|
|
224
|
+
access grants, certificates, DNS, secrets and the change ticket itself. Use the org pack's request
|
|
225
|
+
templates and fill each field from the catalog and the design (source, destination, port, environment,
|
|
226
|
+
justification). Each request names the task it unblocks. A change that needs none says "No requests".`,
|
|
227
|
+
template: `# Service-desk requests
|
|
228
|
+
|
|
229
|
+
## <!-- request type, e.g. firewall rule -->
|
|
230
|
+
|
|
231
|
+
| Field | Value |
|
|
232
|
+
| --- | --- |
|
|
233
|
+
| Environment | |
|
|
234
|
+
| Justification | |
|
|
235
|
+
| Unblocks task | |
|
|
236
|
+
`,
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
/** The schema.yaml content, as data. */
|
|
240
|
+
export function orgFlowSchema() {
|
|
241
|
+
return {
|
|
242
|
+
name: ORG_FLOW,
|
|
243
|
+
version: 1,
|
|
244
|
+
description: "Enterprise change flow - proposal → specs, interfaces → mappings, data → design → stories → tasks → snow",
|
|
245
|
+
artifacts: ARTIFACTS.map((a) => ({
|
|
246
|
+
id: a.id,
|
|
247
|
+
generates: a.generates,
|
|
248
|
+
description: a.description,
|
|
249
|
+
template: `${a.id}.md`,
|
|
250
|
+
instruction: a.instruction + "\n",
|
|
251
|
+
requires: a.requires,
|
|
252
|
+
})),
|
|
253
|
+
apply: {
|
|
254
|
+
requires: ["tasks"],
|
|
255
|
+
tracks: "tasks.md",
|
|
256
|
+
instruction: "Work in the change's worktrees, one repo at a time, in task order. Tick each task when its tests pass. Stop and ask when a task conflicts with the specs or design.\n",
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
export const ORG_FLOW_ARTIFACTS = ARTIFACTS.map((a) => a.id);
|
|
261
|
+
/** Write openspec/schemas/org-flow/ (schema.yaml and templates/). Overwrites: the folder is generated. */
|
|
262
|
+
export async function writeOrgFlowSchema(root) {
|
|
263
|
+
const dir = join(root, "openspec", "schemas", ORG_FLOW);
|
|
264
|
+
await mkdir(join(dir, "templates"), { recursive: true });
|
|
265
|
+
const header = "# Generated by Atticus from the org pack. Do not edit; change org-pack/process and regenerate.\n";
|
|
266
|
+
await writeFile(join(dir, "schema.yaml"), header + stringify(orgFlowSchema(), { lineWidth: 0 }), "utf8");
|
|
267
|
+
for (const a of ARTIFACTS) {
|
|
268
|
+
await writeFile(join(dir, "templates", `${a.id}.md`), a.template, "utf8");
|
|
269
|
+
}
|
|
270
|
+
return dir;
|
|
271
|
+
}
|
|
272
|
+
/** Set the default schema in openspec/config.yaml, keeping the rest of the file and its comments. */
|
|
273
|
+
export async function setDefaultSchema(root, schema) {
|
|
274
|
+
const path = join(root, "openspec", "config.yaml");
|
|
275
|
+
let text = "";
|
|
276
|
+
try {
|
|
277
|
+
text = await readFile(path, "utf8");
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
// no config yet
|
|
281
|
+
}
|
|
282
|
+
const doc = parseDocument(text);
|
|
283
|
+
doc.set("schema", schema);
|
|
284
|
+
await writeFile(path, doc.toString({ lineWidth: 0 }), "utf8");
|
|
285
|
+
}
|
|
286
|
+
//# sourceMappingURL=org-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-flow.js","sourceRoot":"","sources":["../src/org-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAWnC,MAAM,SAAS,GAAkB;IAC/B;QACE,EAAE,EAAE,UAAU;QACd,SAAS,EAAE,aAAa;QACxB,WAAW,EAAE,2EAA2E;QACxF,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE;;;;;;;;;;;;6GAY4F;QACzG,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bb;KACE;IACD;QACE,EAAE,EAAE,OAAO;QACX,SAAS,EAAE,eAAe;QAC1B,WAAW,EAAE,yEAAyE;QACtF,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,WAAW,EAAE;;;;iEAIgD;QAC7D,QAAQ,EAAE;;;;;;;;CAQb;KACE;IACD;QACE,EAAE,EAAE,YAAY;QAChB,SAAS,EAAE,eAAe;QAC1B,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,WAAW,EAAE;;;;;+FAK8E;QAC3F,QAAQ,EAAE;;;;;;;;;CASb;KACE;IACD;QACE,EAAE,EAAE,UAAU;QACd,SAAS,EAAE,aAAa;QACxB,WAAW,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IAC5E,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qGAAqG;AACrG,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,MAAc;IACjE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IACnD,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,gBAAgB;IAClB,CAAC;IACD,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC1B,MAAM,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Shapes of OpenSpec's `--json` output that Atticus relies on. Objects are loose: OpenSpec
|
|
4
|
+
* may add fields in a minor release, and that must not break Atticus. Fields listed here
|
|
5
|
+
* are the contract; the contract tests run them against the pinned OpenSpec version.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OpenSpecRoot: z.ZodObject<{
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
source: z.ZodString;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
export declare const StatusMessage: z.ZodObject<{
|
|
12
|
+
severity: z.ZodString;
|
|
13
|
+
code: z.ZodString;
|
|
14
|
+
message: z.ZodString;
|
|
15
|
+
fix: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$loose>;
|
|
17
|
+
/** Error envelope OpenSpec prints with a non-zero exit. */
|
|
18
|
+
export declare const ErrorEnvelope: z.ZodObject<{
|
|
19
|
+
status: z.ZodArray<z.ZodObject<{
|
|
20
|
+
severity: z.ZodString;
|
|
21
|
+
code: z.ZodString;
|
|
22
|
+
message: z.ZodString;
|
|
23
|
+
fix: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$loose>>;
|
|
25
|
+
}, z.core.$loose>;
|
|
26
|
+
export declare const NewChangeResult: z.ZodObject<{
|
|
27
|
+
change: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
path: z.ZodString;
|
|
30
|
+
schema: z.ZodString;
|
|
31
|
+
}, z.core.$loose>;
|
|
32
|
+
root: z.ZodObject<{
|
|
33
|
+
path: z.ZodString;
|
|
34
|
+
source: z.ZodString;
|
|
35
|
+
}, z.core.$loose>;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
export declare const ArtifactStatus: z.ZodObject<{
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
outputPath: z.ZodString;
|
|
40
|
+
status: z.ZodString;
|
|
41
|
+
requires: z.ZodArray<z.ZodString>;
|
|
42
|
+
missingDeps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
}, z.core.$loose>;
|
|
44
|
+
export declare const ChangeStatus: z.ZodObject<{
|
|
45
|
+
changeName: z.ZodString;
|
|
46
|
+
schemaName: z.ZodString;
|
|
47
|
+
isComplete: z.ZodBoolean;
|
|
48
|
+
applyRequires: z.ZodArray<z.ZodString>;
|
|
49
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
50
|
+
id: z.ZodString;
|
|
51
|
+
outputPath: z.ZodString;
|
|
52
|
+
status: z.ZodString;
|
|
53
|
+
requires: z.ZodArray<z.ZodString>;
|
|
54
|
+
missingDeps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
}, z.core.$loose>>;
|
|
56
|
+
root: z.ZodObject<{
|
|
57
|
+
path: z.ZodString;
|
|
58
|
+
source: z.ZodString;
|
|
59
|
+
}, z.core.$loose>;
|
|
60
|
+
}, z.core.$loose>;
|
|
61
|
+
export type ChangeStatus = z.infer<typeof ChangeStatus>;
|
|
62
|
+
export declare const ArtifactInstructions: z.ZodObject<{
|
|
63
|
+
changeName: z.ZodString;
|
|
64
|
+
artifactId: z.ZodString;
|
|
65
|
+
schemaName: z.ZodString;
|
|
66
|
+
outputPath: z.ZodString;
|
|
67
|
+
description: z.ZodString;
|
|
68
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
69
|
+
template: z.ZodString;
|
|
70
|
+
dependencies: z.ZodArray<z.ZodUnknown>;
|
|
71
|
+
unlocks: z.ZodArray<z.ZodString>;
|
|
72
|
+
}, z.core.$loose>;
|
|
73
|
+
export type ArtifactInstructions = z.infer<typeof ArtifactInstructions>;
|
|
74
|
+
export declare const ApplyTask: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
done: z.ZodBoolean;
|
|
78
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
}, z.core.$loose>;
|
|
80
|
+
export declare const ApplyInstructions: z.ZodObject<{
|
|
81
|
+
changeName: z.ZodString;
|
|
82
|
+
schemaName: z.ZodString;
|
|
83
|
+
progress: z.ZodObject<{
|
|
84
|
+
total: z.ZodNumber;
|
|
85
|
+
complete: z.ZodNumber;
|
|
86
|
+
remaining: z.ZodNumber;
|
|
87
|
+
}, z.core.$loose>;
|
|
88
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
description: z.ZodString;
|
|
91
|
+
done: z.ZodBoolean;
|
|
92
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$loose>>;
|
|
94
|
+
}, z.core.$loose>;
|
|
95
|
+
export type ApplyInstructions = z.infer<typeof ApplyInstructions>;
|
|
96
|
+
export declare const ValidationIssue: z.ZodObject<{
|
|
97
|
+
level: z.ZodEnum<{
|
|
98
|
+
ERROR: "ERROR";
|
|
99
|
+
WARNING: "WARNING";
|
|
100
|
+
INFO: "INFO";
|
|
101
|
+
}>;
|
|
102
|
+
path: z.ZodString;
|
|
103
|
+
message: z.ZodString;
|
|
104
|
+
}, z.core.$loose>;
|
|
105
|
+
export type ValidationIssue = z.infer<typeof ValidationIssue>;
|
|
106
|
+
export declare const ValidationItem: z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
type: z.ZodEnum<{
|
|
109
|
+
change: "change";
|
|
110
|
+
spec: "spec";
|
|
111
|
+
}>;
|
|
112
|
+
valid: z.ZodBoolean;
|
|
113
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
114
|
+
level: z.ZodEnum<{
|
|
115
|
+
ERROR: "ERROR";
|
|
116
|
+
WARNING: "WARNING";
|
|
117
|
+
INFO: "INFO";
|
|
118
|
+
}>;
|
|
119
|
+
path: z.ZodString;
|
|
120
|
+
message: z.ZodString;
|
|
121
|
+
}, z.core.$loose>>;
|
|
122
|
+
}, z.core.$loose>;
|
|
123
|
+
export type ValidationItem = z.infer<typeof ValidationItem>;
|
|
124
|
+
export declare const ValidationReport: z.ZodObject<{
|
|
125
|
+
items: z.ZodArray<z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
type: z.ZodEnum<{
|
|
128
|
+
change: "change";
|
|
129
|
+
spec: "spec";
|
|
130
|
+
}>;
|
|
131
|
+
valid: z.ZodBoolean;
|
|
132
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
133
|
+
level: z.ZodEnum<{
|
|
134
|
+
ERROR: "ERROR";
|
|
135
|
+
WARNING: "WARNING";
|
|
136
|
+
INFO: "INFO";
|
|
137
|
+
}>;
|
|
138
|
+
path: z.ZodString;
|
|
139
|
+
message: z.ZodString;
|
|
140
|
+
}, z.core.$loose>>;
|
|
141
|
+
}, z.core.$loose>>;
|
|
142
|
+
summary: z.ZodObject<{
|
|
143
|
+
totals: z.ZodObject<{
|
|
144
|
+
items: z.ZodNumber;
|
|
145
|
+
passed: z.ZodNumber;
|
|
146
|
+
failed: z.ZodNumber;
|
|
147
|
+
}, z.core.$loose>;
|
|
148
|
+
}, z.core.$loose>;
|
|
149
|
+
}, z.core.$loose>;
|
|
150
|
+
export type ValidationReport = z.infer<typeof ValidationReport>;
|
|
151
|
+
export declare const ChangeSummary: z.ZodObject<{
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
completedTasks: z.ZodNumber;
|
|
154
|
+
totalTasks: z.ZodNumber;
|
|
155
|
+
lastModified: z.ZodString;
|
|
156
|
+
status: z.ZodString;
|
|
157
|
+
}, z.core.$loose>;
|
|
158
|
+
export type ChangeSummary = z.infer<typeof ChangeSummary>;
|
|
159
|
+
export declare const ChangeList: z.ZodObject<{
|
|
160
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
completedTasks: z.ZodNumber;
|
|
163
|
+
totalTasks: z.ZodNumber;
|
|
164
|
+
lastModified: z.ZodString;
|
|
165
|
+
status: z.ZodString;
|
|
166
|
+
}, z.core.$loose>>;
|
|
167
|
+
}, z.core.$loose>;
|
|
168
|
+
export declare const SpecSummary: z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
requirementCount: z.ZodNumber;
|
|
171
|
+
}, z.core.$loose>;
|
|
172
|
+
export type SpecSummary = z.infer<typeof SpecSummary>;
|
|
173
|
+
export declare const SpecList: z.ZodObject<{
|
|
174
|
+
specs: z.ZodArray<z.ZodObject<{
|
|
175
|
+
id: z.ZodString;
|
|
176
|
+
requirementCount: z.ZodNumber;
|
|
177
|
+
}, z.core.$loose>>;
|
|
178
|
+
}, z.core.$loose>;
|
|
179
|
+
export declare const Scenario: z.ZodObject<{
|
|
180
|
+
name: z.ZodString;
|
|
181
|
+
rawText: z.ZodString;
|
|
182
|
+
}, z.core.$loose>;
|
|
183
|
+
export declare const Requirement: z.ZodObject<{
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
text: z.ZodString;
|
|
186
|
+
scenarios: z.ZodArray<z.ZodObject<{
|
|
187
|
+
name: z.ZodString;
|
|
188
|
+
rawText: z.ZodString;
|
|
189
|
+
}, z.core.$loose>>;
|
|
190
|
+
}, z.core.$loose>;
|
|
191
|
+
export type Requirement = z.infer<typeof Requirement>;
|
|
192
|
+
export declare const Delta: z.ZodObject<{
|
|
193
|
+
spec: z.ZodString;
|
|
194
|
+
operation: z.ZodEnum<{
|
|
195
|
+
ADDED: "ADDED";
|
|
196
|
+
MODIFIED: "MODIFIED";
|
|
197
|
+
REMOVED: "REMOVED";
|
|
198
|
+
RENAMED: "RENAMED";
|
|
199
|
+
}>;
|
|
200
|
+
description: z.ZodString;
|
|
201
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
text: z.ZodString;
|
|
204
|
+
scenarios: z.ZodArray<z.ZodObject<{
|
|
205
|
+
name: z.ZodString;
|
|
206
|
+
rawText: z.ZodString;
|
|
207
|
+
}, z.core.$loose>>;
|
|
208
|
+
}, z.core.$loose>>>;
|
|
209
|
+
}, z.core.$loose>;
|
|
210
|
+
export type Delta = z.infer<typeof Delta>;
|
|
211
|
+
export declare const ChangeDetail: z.ZodObject<{
|
|
212
|
+
id: z.ZodString;
|
|
213
|
+
title: z.ZodString;
|
|
214
|
+
deltaCount: z.ZodNumber;
|
|
215
|
+
deltas: z.ZodArray<z.ZodObject<{
|
|
216
|
+
spec: z.ZodString;
|
|
217
|
+
operation: z.ZodEnum<{
|
|
218
|
+
ADDED: "ADDED";
|
|
219
|
+
MODIFIED: "MODIFIED";
|
|
220
|
+
REMOVED: "REMOVED";
|
|
221
|
+
RENAMED: "RENAMED";
|
|
222
|
+
}>;
|
|
223
|
+
description: z.ZodString;
|
|
224
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
text: z.ZodString;
|
|
227
|
+
scenarios: z.ZodArray<z.ZodObject<{
|
|
228
|
+
name: z.ZodString;
|
|
229
|
+
rawText: z.ZodString;
|
|
230
|
+
}, z.core.$loose>>;
|
|
231
|
+
}, z.core.$loose>>>;
|
|
232
|
+
}, z.core.$loose>>;
|
|
233
|
+
}, z.core.$loose>;
|
|
234
|
+
export type ChangeDetail = z.infer<typeof ChangeDetail>;
|
|
235
|
+
export declare const SpecDetail: z.ZodObject<{
|
|
236
|
+
id: z.ZodString;
|
|
237
|
+
title: z.ZodString;
|
|
238
|
+
overview: z.ZodString;
|
|
239
|
+
requirementCount: z.ZodNumber;
|
|
240
|
+
requirements: z.ZodArray<z.ZodObject<{
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
text: z.ZodString;
|
|
243
|
+
scenarios: z.ZodArray<z.ZodObject<{
|
|
244
|
+
name: z.ZodString;
|
|
245
|
+
rawText: z.ZodString;
|
|
246
|
+
}, z.core.$loose>>;
|
|
247
|
+
}, z.core.$loose>>;
|
|
248
|
+
}, z.core.$loose>;
|
|
249
|
+
export type SpecDetail = z.infer<typeof SpecDetail>;
|
|
250
|
+
export declare const ArchiveResult: z.ZodObject<{
|
|
251
|
+
archive: z.ZodObject<{
|
|
252
|
+
change: z.ZodString;
|
|
253
|
+
archivedAs: z.ZodString;
|
|
254
|
+
path: z.ZodString;
|
|
255
|
+
specsUpdated: z.ZodBoolean;
|
|
256
|
+
}, z.core.$loose>;
|
|
257
|
+
}, z.core.$loose>;
|
|
258
|
+
export type ArchiveResult = z.infer<typeof ArchiveResult>;
|
|
259
|
+
export declare const SchemaInfo: z.ZodObject<{
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
description: z.ZodOptional<z.ZodString>;
|
|
262
|
+
artifacts: z.ZodArray<z.ZodString>;
|
|
263
|
+
source: z.ZodString;
|
|
264
|
+
}, z.core.$loose>;
|
|
265
|
+
export type SchemaInfo = z.infer<typeof SchemaInfo>;
|
package/dist/results.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Shapes of OpenSpec's `--json` output that Atticus relies on. Objects are loose: OpenSpec
|
|
4
|
+
* may add fields in a minor release, and that must not break Atticus. Fields listed here
|
|
5
|
+
* are the contract; the contract tests run them against the pinned OpenSpec version.
|
|
6
|
+
*/
|
|
7
|
+
export const OpenSpecRoot = z.looseObject({ path: z.string(), source: z.string() });
|
|
8
|
+
export const StatusMessage = z.looseObject({
|
|
9
|
+
severity: z.string(),
|
|
10
|
+
code: z.string(),
|
|
11
|
+
message: z.string(),
|
|
12
|
+
fix: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
/** Error envelope OpenSpec prints with a non-zero exit. */
|
|
15
|
+
export const ErrorEnvelope = z.looseObject({ status: z.array(StatusMessage).min(1) });
|
|
16
|
+
export const NewChangeResult = z.looseObject({
|
|
17
|
+
change: z.looseObject({ id: z.string(), path: z.string(), schema: z.string() }),
|
|
18
|
+
root: OpenSpecRoot,
|
|
19
|
+
});
|
|
20
|
+
export const ArtifactStatus = z.looseObject({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
outputPath: z.string(),
|
|
23
|
+
/** done, ready (all requirements met) or blocked. */
|
|
24
|
+
status: z.string(),
|
|
25
|
+
requires: z.array(z.string()),
|
|
26
|
+
missingDeps: z.array(z.string()).optional(),
|
|
27
|
+
});
|
|
28
|
+
export const ChangeStatus = z.looseObject({
|
|
29
|
+
changeName: z.string(),
|
|
30
|
+
schemaName: z.string(),
|
|
31
|
+
isComplete: z.boolean(),
|
|
32
|
+
applyRequires: z.array(z.string()),
|
|
33
|
+
artifacts: z.array(ArtifactStatus),
|
|
34
|
+
root: OpenSpecRoot,
|
|
35
|
+
});
|
|
36
|
+
export const ArtifactInstructions = z.looseObject({
|
|
37
|
+
changeName: z.string(),
|
|
38
|
+
artifactId: z.string(),
|
|
39
|
+
schemaName: z.string(),
|
|
40
|
+
outputPath: z.string(),
|
|
41
|
+
description: z.string(),
|
|
42
|
+
instruction: z.string().optional(),
|
|
43
|
+
template: z.string(),
|
|
44
|
+
dependencies: z.array(z.unknown()),
|
|
45
|
+
unlocks: z.array(z.string()),
|
|
46
|
+
});
|
|
47
|
+
export const ApplyTask = z.looseObject({
|
|
48
|
+
id: z.string(),
|
|
49
|
+
description: z.string(),
|
|
50
|
+
done: z.boolean(),
|
|
51
|
+
line: z.number().optional(),
|
|
52
|
+
});
|
|
53
|
+
export const ApplyInstructions = z.looseObject({
|
|
54
|
+
changeName: z.string(),
|
|
55
|
+
schemaName: z.string(),
|
|
56
|
+
progress: z.looseObject({ total: z.number(), complete: z.number(), remaining: z.number() }),
|
|
57
|
+
tasks: z.array(ApplyTask),
|
|
58
|
+
});
|
|
59
|
+
export const ValidationIssue = z.looseObject({
|
|
60
|
+
level: z.enum(["ERROR", "WARNING", "INFO"]),
|
|
61
|
+
path: z.string(),
|
|
62
|
+
message: z.string(),
|
|
63
|
+
});
|
|
64
|
+
export const ValidationItem = z.looseObject({
|
|
65
|
+
id: z.string(),
|
|
66
|
+
type: z.enum(["change", "spec"]),
|
|
67
|
+
valid: z.boolean(),
|
|
68
|
+
issues: z.array(ValidationIssue),
|
|
69
|
+
});
|
|
70
|
+
export const ValidationReport = z.looseObject({
|
|
71
|
+
items: z.array(ValidationItem),
|
|
72
|
+
summary: z.looseObject({
|
|
73
|
+
totals: z.looseObject({ items: z.number(), passed: z.number(), failed: z.number() }),
|
|
74
|
+
}),
|
|
75
|
+
});
|
|
76
|
+
export const ChangeSummary = z.looseObject({
|
|
77
|
+
name: z.string(),
|
|
78
|
+
completedTasks: z.number(),
|
|
79
|
+
totalTasks: z.number(),
|
|
80
|
+
lastModified: z.string(),
|
|
81
|
+
status: z.string(),
|
|
82
|
+
});
|
|
83
|
+
export const ChangeList = z.looseObject({ changes: z.array(ChangeSummary) });
|
|
84
|
+
export const SpecSummary = z.looseObject({ id: z.string(), requirementCount: z.number() });
|
|
85
|
+
export const SpecList = z.looseObject({ specs: z.array(SpecSummary) });
|
|
86
|
+
export const Scenario = z.looseObject({ name: z.string(), rawText: z.string() });
|
|
87
|
+
export const Requirement = z.looseObject({
|
|
88
|
+
name: z.string(),
|
|
89
|
+
text: z.string(),
|
|
90
|
+
scenarios: z.array(Scenario),
|
|
91
|
+
});
|
|
92
|
+
export const Delta = z.looseObject({
|
|
93
|
+
spec: z.string(),
|
|
94
|
+
operation: z.enum(["ADDED", "MODIFIED", "REMOVED", "RENAMED"]),
|
|
95
|
+
description: z.string(),
|
|
96
|
+
requirements: z.array(Requirement).optional(),
|
|
97
|
+
});
|
|
98
|
+
export const ChangeDetail = z.looseObject({
|
|
99
|
+
id: z.string(),
|
|
100
|
+
title: z.string(),
|
|
101
|
+
deltaCount: z.number(),
|
|
102
|
+
deltas: z.array(Delta),
|
|
103
|
+
});
|
|
104
|
+
export const SpecDetail = z.looseObject({
|
|
105
|
+
id: z.string(),
|
|
106
|
+
title: z.string(),
|
|
107
|
+
overview: z.string(),
|
|
108
|
+
requirementCount: z.number(),
|
|
109
|
+
requirements: z.array(Requirement),
|
|
110
|
+
});
|
|
111
|
+
export const ArchiveResult = z.looseObject({
|
|
112
|
+
archive: z.looseObject({
|
|
113
|
+
change: z.string(),
|
|
114
|
+
archivedAs: z.string(),
|
|
115
|
+
path: z.string(),
|
|
116
|
+
specsUpdated: z.boolean(),
|
|
117
|
+
}),
|
|
118
|
+
});
|
|
119
|
+
export const SchemaInfo = z.looseObject({
|
|
120
|
+
name: z.string(),
|
|
121
|
+
description: z.string().optional(),
|
|
122
|
+
artifacts: z.array(z.string()),
|
|
123
|
+
source: z.string(),
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=results.js.map
|