rosettify 2.4.4 → 3.1.0
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/dist/commands/plan/core.d.ts +2 -1
- package/dist/commands/plan/core.d.ts.map +1 -1
- package/dist/commands/plan/core.js +6 -26
- package/dist/commands/plan/core.js.map +1 -1
- package/dist/commands/plan/errors.d.ts +6 -2
- package/dist/commands/plan/errors.d.ts.map +1 -1
- package/dist/commands/plan/errors.js +6 -2
- package/dist/commands/plan/errors.js.map +1 -1
- package/dist/commands/plan/next.js +3 -3
- package/dist/commands/plan/next.js.map +1 -1
- package/dist/commands/plan/query.js +3 -3
- package/dist/commands/plan/query.js.map +1 -1
- package/dist/commands/plan/show-status.js +3 -3
- package/dist/commands/plan/show-status.js.map +1 -1
- package/dist/commands/plan/update-status.js +1 -1
- package/dist/commands/plan/update-status.js.map +1 -1
- package/dist/commands/plan/upsert.js +2 -2
- package/dist/commands/plan/upsert.js.map +1 -1
- package/dist/commands/specs/add.d.ts +12 -0
- package/dist/commands/specs/add.d.ts.map +1 -0
- package/dist/commands/specs/add.js +127 -0
- package/dist/commands/specs/add.js.map +1 -0
- package/dist/commands/specs/aggregate.d.ts +12 -0
- package/dist/commands/specs/aggregate.d.ts.map +1 -0
- package/dist/commands/specs/aggregate.js +14 -0
- package/dist/commands/specs/aggregate.js.map +1 -0
- package/dist/commands/specs/approve.d.ts +4 -0
- package/dist/commands/specs/approve.d.ts.map +1 -0
- package/dist/commands/specs/approve.js +69 -0
- package/dist/commands/specs/approve.js.map +1 -0
- package/dist/commands/specs/core.d.ts +123 -0
- package/dist/commands/specs/core.d.ts.map +1 -0
- package/dist/commands/specs/core.js +284 -0
- package/dist/commands/specs/core.js.map +1 -0
- package/dist/commands/specs/delete.d.ts +4 -0
- package/dist/commands/specs/delete.d.ts.map +1 -0
- package/dist/commands/specs/delete.js +36 -0
- package/dist/commands/specs/delete.js.map +1 -0
- package/dist/commands/specs/deprecate.d.ts +4 -0
- package/dist/commands/specs/deprecate.d.ts.map +1 -0
- package/dist/commands/specs/deprecate.js +51 -0
- package/dist/commands/specs/deprecate.js.map +1 -0
- package/dist/commands/specs/errors.d.ts +69 -0
- package/dist/commands/specs/errors.d.ts.map +1 -0
- package/dist/commands/specs/errors.js +114 -0
- package/dist/commands/specs/errors.js.map +1 -0
- package/dist/commands/specs/get.d.ts +4 -0
- package/dist/commands/specs/get.d.ts.map +1 -0
- package/dist/commands/specs/get.js +37 -0
- package/dist/commands/specs/get.js.map +1 -0
- package/dist/commands/specs/graph.d.ts +33 -0
- package/dist/commands/specs/graph.d.ts.map +1 -0
- package/dist/commands/specs/graph.js +179 -0
- package/dist/commands/specs/graph.js.map +1 -0
- package/dist/commands/specs/help-content.d.ts +226 -0
- package/dist/commands/specs/help-content.d.ts.map +1 -0
- package/dist/commands/specs/help-content.js +328 -0
- package/dist/commands/specs/help-content.js.map +1 -0
- package/dist/commands/specs/implemented.d.ts +4 -0
- package/dist/commands/specs/implemented.d.ts.map +1 -0
- package/dist/commands/specs/implemented.js +69 -0
- package/dist/commands/specs/implemented.js.map +1 -0
- package/dist/commands/specs/index.d.ts +4 -0
- package/dist/commands/specs/index.d.ts.map +1 -0
- package/dist/commands/specs/index.js +282 -0
- package/dist/commands/specs/index.js.map +1 -0
- package/dist/commands/specs/info.d.ts +4 -0
- package/dist/commands/specs/info.d.ts.map +1 -0
- package/dist/commands/specs/info.js +78 -0
- package/dist/commands/specs/info.js.map +1 -0
- package/dist/commands/specs/migrate.d.ts +4 -0
- package/dist/commands/specs/migrate.d.ts.map +1 -0
- package/dist/commands/specs/migrate.js +124 -0
- package/dist/commands/specs/migrate.js.map +1 -0
- package/dist/commands/specs/output.d.ts +152 -0
- package/dist/commands/specs/output.d.ts.map +1 -0
- package/dist/commands/specs/output.js +45 -0
- package/dist/commands/specs/output.js.map +1 -0
- package/dist/commands/specs/purge.d.ts +4 -0
- package/dist/commands/specs/purge.d.ts.map +1 -0
- package/dist/commands/specs/purge.js +58 -0
- package/dist/commands/specs/purge.js.map +1 -0
- package/dist/commands/specs/query-filter.d.ts +26 -0
- package/dist/commands/specs/query-filter.d.ts.map +1 -0
- package/dist/commands/specs/query-filter.js +275 -0
- package/dist/commands/specs/query-filter.js.map +1 -0
- package/dist/commands/specs/query.d.ts +4 -0
- package/dist/commands/specs/query.d.ts.map +1 -0
- package/dist/commands/specs/query.js +35 -0
- package/dist/commands/specs/query.js.map +1 -0
- package/dist/commands/specs/render.d.ts +9 -0
- package/dist/commands/specs/render.d.ts.map +1 -0
- package/dist/commands/specs/render.js +129 -0
- package/dist/commands/specs/render.js.map +1 -0
- package/dist/commands/specs/reopen.d.ts +4 -0
- package/dist/commands/specs/reopen.d.ts.map +1 -0
- package/dist/commands/specs/reopen.js +47 -0
- package/dist/commands/specs/reopen.js.map +1 -0
- package/dist/commands/specs/req-parser.d.ts +55 -0
- package/dist/commands/specs/req-parser.d.ts.map +1 -0
- package/dist/commands/specs/req-parser.js +325 -0
- package/dist/commands/specs/req-parser.js.map +1 -0
- package/dist/commands/specs/restore.d.ts +4 -0
- package/dist/commands/specs/restore.d.ts.map +1 -0
- package/dist/commands/specs/restore.js +46 -0
- package/dist/commands/specs/restore.js.map +1 -0
- package/dist/commands/specs/rubric.d.ts +18 -0
- package/dist/commands/specs/rubric.d.ts.map +1 -0
- package/dist/commands/specs/rubric.js +86 -0
- package/dist/commands/specs/rubric.js.map +1 -0
- package/dist/commands/specs/schemas.d.ts +687 -0
- package/dist/commands/specs/schemas.d.ts.map +1 -0
- package/dist/commands/specs/schemas.js +454 -0
- package/dist/commands/specs/schemas.js.map +1 -0
- package/dist/commands/specs/update.d.ts +4 -0
- package/dist/commands/specs/update.d.ts.map +1 -0
- package/dist/commands/specs/update.js +139 -0
- package/dist/commands/specs/update.js.map +1 -0
- package/dist/commands/specs/validate.d.ts +13 -0
- package/dist/commands/specs/validate.d.ts.map +1 -0
- package/dist/commands/specs/validate.js +165 -0
- package/dist/commands/specs/validate.js.map +1 -0
- package/dist/commands/specs/write.d.ts +38 -0
- package/dist/commands/specs/write.d.ts.map +1 -0
- package/dist/commands/specs/write.js +65 -0
- package/dist/commands/specs/write.js.map +1 -0
- package/dist/frontends/cli.d.ts.map +1 -1
- package/dist/frontends/cli.js +186 -0
- package/dist/frontends/cli.js.map +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +2 -0
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/types.d.ts +22 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/shared/actor.d.ts +8 -0
- package/dist/shared/actor.d.ts.map +1 -0
- package/dist/shared/actor.js +65 -0
- package/dist/shared/actor.js.map +1 -0
- package/dist/shared/constants.d.ts +6 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +8 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/dispatch.d.ts.map +1 -1
- package/dist/shared/dispatch.js +2 -0
- package/dist/shared/dispatch.js.map +1 -1
- package/dist/shared/doc-io.d.ts +46 -0
- package/dist/shared/doc-io.d.ts.map +1 -0
- package/dist/shared/{plan-io.js → doc-io.js} +23 -18
- package/dist/shared/doc-io.js.map +1 -0
- package/dist/shared/errors.d.ts +3 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +6 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/graph.d.ts +6 -0
- package/dist/shared/graph.d.ts.map +1 -0
- package/dist/shared/graph.js +34 -0
- package/dist/shared/graph.js.map +1 -0
- package/dist/shared/time.d.ts +9 -0
- package/dist/shared/time.d.ts.map +1 -0
- package/dist/shared/time.js +20 -0
- package/dist/shared/time.js.map +1 -0
- package/package.json +11 -3
- package/dist/shared/plan-io.d.ts +0 -41
- package/dist/shared/plan-io.d.ts.map +0 -1
- package/dist/shared/plan-io.js.map +0 -1
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
export declare const specsNotes: string[];
|
|
2
|
+
export declare const specsHelpContent: {
|
|
3
|
+
name: string;
|
|
4
|
+
brief: string;
|
|
5
|
+
description: string;
|
|
6
|
+
specs_file: {
|
|
7
|
+
convention: string;
|
|
8
|
+
note: string;
|
|
9
|
+
};
|
|
10
|
+
concepts: {
|
|
11
|
+
spec_unit: string;
|
|
12
|
+
areas: string;
|
|
13
|
+
status_lifecycle: string;
|
|
14
|
+
depends_on_vs_related: string;
|
|
15
|
+
guarded_fields: string;
|
|
16
|
+
validate_then_approve: string;
|
|
17
|
+
};
|
|
18
|
+
subcommands: ({
|
|
19
|
+
name: string;
|
|
20
|
+
brief: string;
|
|
21
|
+
usage: string;
|
|
22
|
+
args: {
|
|
23
|
+
data: string;
|
|
24
|
+
ids?: undefined;
|
|
25
|
+
query?: undefined;
|
|
26
|
+
"--include-removed"?: undefined;
|
|
27
|
+
"--force"?: undefined;
|
|
28
|
+
target_id?: undefined;
|
|
29
|
+
"--additional-paths"?: undefined;
|
|
30
|
+
"--format"?: undefined;
|
|
31
|
+
sources?: undefined;
|
|
32
|
+
};
|
|
33
|
+
required: string;
|
|
34
|
+
description: string;
|
|
35
|
+
examples: {
|
|
36
|
+
tip: string;
|
|
37
|
+
real: string;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
name: string;
|
|
41
|
+
brief: string;
|
|
42
|
+
usage: string;
|
|
43
|
+
args: {
|
|
44
|
+
ids: string;
|
|
45
|
+
data?: undefined;
|
|
46
|
+
query?: undefined;
|
|
47
|
+
"--include-removed"?: undefined;
|
|
48
|
+
"--force"?: undefined;
|
|
49
|
+
target_id?: undefined;
|
|
50
|
+
"--additional-paths"?: undefined;
|
|
51
|
+
"--format"?: undefined;
|
|
52
|
+
sources?: undefined;
|
|
53
|
+
};
|
|
54
|
+
required: string;
|
|
55
|
+
description: string;
|
|
56
|
+
examples: {
|
|
57
|
+
tip: string;
|
|
58
|
+
real: string;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
name: string;
|
|
62
|
+
brief: string;
|
|
63
|
+
usage: string;
|
|
64
|
+
args: {
|
|
65
|
+
query: string;
|
|
66
|
+
"--include-removed": string;
|
|
67
|
+
data?: undefined;
|
|
68
|
+
ids?: undefined;
|
|
69
|
+
"--force"?: undefined;
|
|
70
|
+
target_id?: undefined;
|
|
71
|
+
"--additional-paths"?: undefined;
|
|
72
|
+
"--format"?: undefined;
|
|
73
|
+
sources?: undefined;
|
|
74
|
+
};
|
|
75
|
+
required: string;
|
|
76
|
+
description: string;
|
|
77
|
+
examples: {
|
|
78
|
+
tip: string;
|
|
79
|
+
real: string;
|
|
80
|
+
};
|
|
81
|
+
} | {
|
|
82
|
+
name: string;
|
|
83
|
+
brief: string;
|
|
84
|
+
usage: string;
|
|
85
|
+
args: {
|
|
86
|
+
ids: string;
|
|
87
|
+
"--force": string;
|
|
88
|
+
data?: undefined;
|
|
89
|
+
query?: undefined;
|
|
90
|
+
"--include-removed"?: undefined;
|
|
91
|
+
target_id?: undefined;
|
|
92
|
+
"--additional-paths"?: undefined;
|
|
93
|
+
"--format"?: undefined;
|
|
94
|
+
sources?: undefined;
|
|
95
|
+
};
|
|
96
|
+
required: string;
|
|
97
|
+
description: string;
|
|
98
|
+
examples: {
|
|
99
|
+
tip: string;
|
|
100
|
+
real: string;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
103
|
+
name: string;
|
|
104
|
+
brief: string;
|
|
105
|
+
usage: string;
|
|
106
|
+
args: {
|
|
107
|
+
query: string;
|
|
108
|
+
data?: undefined;
|
|
109
|
+
ids?: undefined;
|
|
110
|
+
"--include-removed"?: undefined;
|
|
111
|
+
"--force"?: undefined;
|
|
112
|
+
target_id?: undefined;
|
|
113
|
+
"--additional-paths"?: undefined;
|
|
114
|
+
"--format"?: undefined;
|
|
115
|
+
sources?: undefined;
|
|
116
|
+
};
|
|
117
|
+
required: string;
|
|
118
|
+
description: string;
|
|
119
|
+
examples: {
|
|
120
|
+
tip: string;
|
|
121
|
+
real: string;
|
|
122
|
+
};
|
|
123
|
+
} | {
|
|
124
|
+
name: string;
|
|
125
|
+
brief: string;
|
|
126
|
+
usage: string;
|
|
127
|
+
args: {
|
|
128
|
+
target_id: string;
|
|
129
|
+
"--additional-paths": string;
|
|
130
|
+
data?: undefined;
|
|
131
|
+
ids?: undefined;
|
|
132
|
+
query?: undefined;
|
|
133
|
+
"--include-removed"?: undefined;
|
|
134
|
+
"--force"?: undefined;
|
|
135
|
+
"--format"?: undefined;
|
|
136
|
+
sources?: undefined;
|
|
137
|
+
};
|
|
138
|
+
required: string;
|
|
139
|
+
description: string;
|
|
140
|
+
examples: {
|
|
141
|
+
tip: string;
|
|
142
|
+
real: string;
|
|
143
|
+
};
|
|
144
|
+
} | {
|
|
145
|
+
name: string;
|
|
146
|
+
brief: string;
|
|
147
|
+
usage: string;
|
|
148
|
+
args: {
|
|
149
|
+
query: string;
|
|
150
|
+
"--format": string;
|
|
151
|
+
data?: undefined;
|
|
152
|
+
ids?: undefined;
|
|
153
|
+
"--include-removed"?: undefined;
|
|
154
|
+
"--force"?: undefined;
|
|
155
|
+
target_id?: undefined;
|
|
156
|
+
"--additional-paths"?: undefined;
|
|
157
|
+
sources?: undefined;
|
|
158
|
+
};
|
|
159
|
+
required: string;
|
|
160
|
+
description: string;
|
|
161
|
+
examples: {
|
|
162
|
+
tip: string;
|
|
163
|
+
real: string;
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
name: string;
|
|
167
|
+
brief: string;
|
|
168
|
+
usage: string;
|
|
169
|
+
args: {
|
|
170
|
+
data?: undefined;
|
|
171
|
+
ids?: undefined;
|
|
172
|
+
query?: undefined;
|
|
173
|
+
"--include-removed"?: undefined;
|
|
174
|
+
"--force"?: undefined;
|
|
175
|
+
target_id?: undefined;
|
|
176
|
+
"--additional-paths"?: undefined;
|
|
177
|
+
"--format"?: undefined;
|
|
178
|
+
sources?: undefined;
|
|
179
|
+
};
|
|
180
|
+
required: string;
|
|
181
|
+
description: string;
|
|
182
|
+
examples: {
|
|
183
|
+
tip: string;
|
|
184
|
+
real: string;
|
|
185
|
+
};
|
|
186
|
+
} | {
|
|
187
|
+
name: string;
|
|
188
|
+
brief: string;
|
|
189
|
+
usage: string;
|
|
190
|
+
args: {
|
|
191
|
+
sources: string;
|
|
192
|
+
data?: undefined;
|
|
193
|
+
ids?: undefined;
|
|
194
|
+
query?: undefined;
|
|
195
|
+
"--include-removed"?: undefined;
|
|
196
|
+
"--force"?: undefined;
|
|
197
|
+
target_id?: undefined;
|
|
198
|
+
"--additional-paths"?: undefined;
|
|
199
|
+
"--format"?: undefined;
|
|
200
|
+
};
|
|
201
|
+
required: string;
|
|
202
|
+
description: string;
|
|
203
|
+
examples: {
|
|
204
|
+
tip: string;
|
|
205
|
+
real: string;
|
|
206
|
+
};
|
|
207
|
+
})[];
|
|
208
|
+
schemas: Record<string, unknown>;
|
|
209
|
+
limits: {
|
|
210
|
+
max_specs: number;
|
|
211
|
+
max_dependencies_per_spec: number;
|
|
212
|
+
max_acceptance_per_spec: number;
|
|
213
|
+
max_string_length: number;
|
|
214
|
+
max_name_length: number;
|
|
215
|
+
max_batch_size: number;
|
|
216
|
+
};
|
|
217
|
+
query_notation: {
|
|
218
|
+
grammar: string;
|
|
219
|
+
keys: string;
|
|
220
|
+
semantics: string;
|
|
221
|
+
example: string;
|
|
222
|
+
};
|
|
223
|
+
notes: string[];
|
|
224
|
+
next_steps_for_ai: string;
|
|
225
|
+
};
|
|
226
|
+
//# sourceMappingURL=help-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-content.d.ts","sourceRoot":"","sources":["../../../src/commands/specs/help-content.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,UAAU,EAAE,MAAM,EAa9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuU5B,CAAC"}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
// Implements FR-SPECS-0060 (specs help content), FR-SPECS-0061 (notes), FR-SPECS-0043/FR-ARCH-0016
|
|
2
|
+
// (no internal-traceability leakage in any authored string below — no requirement id, ticket id,
|
|
3
|
+
// internal path, internal module name, or authoring rationale). Mirrors commands/plan/help-content.ts.
|
|
4
|
+
//
|
|
5
|
+
// Resolution (ambiguity — the leakage rule (FR-ARCH-0016/FR-SPECS-0043) forbids requirement
|
|
6
|
+
// identifiers in authored strings, yet FR-SPECS-0060 separately requires a "real-form example
|
|
7
|
+
// (concrete JSON producing a working invocation)" per subcommand, and this command's own domain
|
|
8
|
+
// is ids shaped exactly like a requirement id, <PREFIX>-<AREA>-<NNNN>): every example id below
|
|
9
|
+
// uses the fictional area "CHK" (checkout), which is not a real area used anywhere in this
|
|
10
|
+
// project's own requirement ids (FR-SPECS-*, FR-ARCH-*, FR-PLAN-*, FR-CLI-*, FR-HELP-*) — it
|
|
11
|
+
// demonstrates the caller's own id grammar (the exact concern FR-SPECS-0043 carves out) rather
|
|
12
|
+
// than referencing any Rosetta-internal traceability id.
|
|
13
|
+
import { SPECS_MAX_SPECS, SPECS_MAX_DEPENDENCIES_PER_SPEC, SPECS_MAX_ACCEPTANCE_PER_SPEC, SPECS_MAX_STRING_LENGTH, SPECS_MAX_NAME_LENGTH, SPECS_MAX_BATCH_SIZE, } from "../../shared/constants.js";
|
|
14
|
+
import { specsSchemasDict } from "./schemas.js";
|
|
15
|
+
// FR-SPECS-0061 — the 12 caller-facing behaviors, each standalone directive guidance
|
|
16
|
+
export const specsNotes = [
|
|
17
|
+
"the JSON-bearing argument (data) is passed as an inline JSON string, not a file path — a single object or an array (batch)",
|
|
18
|
+
"ids are caller-provided, never server-minted; run info first to get the suggested next id per area before add",
|
|
19
|
+
"a new spec always enters as Draft/NotStarted; any status, approved_by, or implementation supplied on add or update is silently dropped",
|
|
20
|
+
"guarded fields (status, approved_by, implementation, changed_by) change only through the lifecycle ops (approve, deprecate, restore, reopen, delete, implemented) and the actor resolver — never through add or update directly",
|
|
21
|
+
"editing an Approved spec's statement or acceptance moves it to Modified and clears its approval; editing an Implemented spec's contract sets its implementation to ToBeModified",
|
|
22
|
+
"approve runs validation first and refuses on any error-level finding; fix the reported errors, then approve again",
|
|
23
|
+
"delete is a reversible soft-delete (status becomes Removed; restore undoes it); purge permanently removes a spec and requires --force plus no remaining references from other specs",
|
|
24
|
+
"writes are all-or-nothing — a batch with any invalid item writes nothing and the error names every rejected item",
|
|
25
|
+
"query grammar: key:value terms; space between terms means AND; a comma inside one term's value list means OR; a leading - negates a term; a bare word searches title and statement; Removed specs are excluded unless include_removed:true or an explicit status:Removed term is present",
|
|
26
|
+
"timestamps are stored in UTC and shown in local time by render and info; get and query return the stored UTC value verbatim",
|
|
27
|
+
"migrate is a one-time import of legacy markdown spec blocks into the JSON document",
|
|
28
|
+
"every error response is a single human-readable string that aggregates every problem at once — a batch or approval failure names every failing item in one message rather than stopping at the first",
|
|
29
|
+
];
|
|
30
|
+
export const specsHelpContent = {
|
|
31
|
+
name: "specs",
|
|
32
|
+
brief: "Manage requirements/specs (add, query, validate, approve, and more)",
|
|
33
|
+
description: "The specs command manages a component's requirements as spec units stored in one JSON document. " +
|
|
34
|
+
"Write subcommands return a shared SpecWriteResult or SpecLifecycleResult snapshot of the affected specs.",
|
|
35
|
+
// FR-SPECS-0060 — specs_file convention
|
|
36
|
+
specs_file: {
|
|
37
|
+
convention: "one JSON document per component",
|
|
38
|
+
note: "specs_file is the path to that component's specs document",
|
|
39
|
+
},
|
|
40
|
+
// FR-SPECS-0060 — core concepts
|
|
41
|
+
concepts: {
|
|
42
|
+
spec_unit: "A spec is one requirement: id, type (FR|NFR|INT|DATA), level, title, statement, rationale, source, priority, " +
|
|
43
|
+
"status, approved_by, changed, changed_by, verification, acceptance (Given/When/Then criteria), depends_on, related, " +
|
|
44
|
+
"implementation, implementation_notes, notes.",
|
|
45
|
+
areas: "An id has the form <PREFIX>-<AREA>-<NNNN> (e.g. FR-CHK-0001). AREA groups related specs and is registered in the " +
|
|
46
|
+
"document the first time it appears in an add or migrate call — it does not need to be declared separately.",
|
|
47
|
+
status_lifecycle: "Statuses: Draft, Approved, Modified, Deprecated, Removed. " +
|
|
48
|
+
"add creates a spec as Draft. " +
|
|
49
|
+
"approve moves Draft or Modified to Approved (idempotent if already Approved); refuses if the spec is Removed or Deprecated. " +
|
|
50
|
+
"A normative edit (statement or acceptance) to an Approved spec via update auto-moves it to Modified and clears approval. " +
|
|
51
|
+
"deprecate moves Draft, Modified, or Approved to Deprecated (idempotent); refuses if Removed. " +
|
|
52
|
+
"restore moves Removed back to Draft; refuses from any other status. " +
|
|
53
|
+
"reopen moves Approved back to Draft and clears approval; refuses from any other status. " +
|
|
54
|
+
"delete is a reversible soft-delete: sets status to Removed (idempotent), the spec unit is retained. " +
|
|
55
|
+
"purge permanently removes the spec unit — separate from status entirely, requires --force.",
|
|
56
|
+
depends_on_vs_related: "depends_on is directional and must stay acyclic — it expresses a hard prerequisite relationship. " +
|
|
57
|
+
"related is associative and may legitimately cycle — it expresses a soft cross-reference. " +
|
|
58
|
+
"Both must reference ids that exist in the document; a Removed spec remains a valid reference target.",
|
|
59
|
+
guarded_fields: "status, approved_by, implementation, and changed_by cannot be set directly through add or update — any value supplied " +
|
|
60
|
+
"for them there is silently dropped. They change only as the side effect of a lifecycle op (approve, deprecate, restore, " +
|
|
61
|
+
"reopen, delete, implemented), which also stamps changed_by with the resolved actor.",
|
|
62
|
+
validate_then_approve: "validate is a read-only check (structural checks are errors that block approval; phrasing checks are warnings, advisory " +
|
|
63
|
+
"only). approve internally re-runs the same checks over its targets and refuses the whole batch if any error-level finding " +
|
|
64
|
+
"remains, so the intended flow is: author with add, validate, fix reported errors, then approve.",
|
|
65
|
+
},
|
|
66
|
+
// FR-SPECS-0060 — subcommands, each with a required-inputs statement and dual-form examples
|
|
67
|
+
subcommands: [
|
|
68
|
+
{
|
|
69
|
+
name: "add",
|
|
70
|
+
brief: "Append one or more new spec units",
|
|
71
|
+
usage: "rosettify specs add <specs_file> '<data>'",
|
|
72
|
+
args: { data: "inline JSON string: a single spec object, or an array of spec objects (batch)" },
|
|
73
|
+
required: "specs_file and data are required",
|
|
74
|
+
description: "Creates the document if it does not exist yet. Each item must include id, type, title, statement, source, " +
|
|
75
|
+
"priority, verification, and a non-empty acceptance array; status/approved_by/implementation are ignored and set " +
|
|
76
|
+
"to Draft/''/NotStarted. The whole batch is rejected together if any item is invalid. Returns SpecWriteResult.",
|
|
77
|
+
examples: {
|
|
78
|
+
tip: "rosettify specs add [specs_file] '[spec-json-object-or-array]'",
|
|
79
|
+
real: "rosettify specs add specs/checkout/specs.json '{\"id\":\"FR-CHK-0001\",\"type\":\"FR\",\"title\":\"Cart total\",\"statement\":\"When the cart changes, the system shall recompute the total.\",\"source\":\"User\",\"priority\":\"Must\",\"verification\":\"Test\",\"acceptance\":[{\"given\":\"an item is added\",\"when\":\"the cart updates\",\"then\":\"the total reflects the new item\"}]}'",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "get",
|
|
84
|
+
brief: "Retrieve spec units by id",
|
|
85
|
+
usage: "rosettify specs get <specs_file> <ids...>",
|
|
86
|
+
args: { ids: "one or more spec ids" },
|
|
87
|
+
required: "specs_file and at least one id are required",
|
|
88
|
+
description: "Returns each requested spec regardless of its status (including Removed). A missing id is reported in " +
|
|
89
|
+
"missing rather than failing the call. Returns SpecGetResult.",
|
|
90
|
+
examples: {
|
|
91
|
+
tip: "rosettify specs get [specs_file] [id-1] [id-2 ...]",
|
|
92
|
+
real: "rosettify specs get specs/checkout/specs.json FR-CHK-0001",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "query",
|
|
97
|
+
brief: "Search spec units by attribute or free text",
|
|
98
|
+
usage: "rosettify specs query <specs_file> [query] [--include-removed]",
|
|
99
|
+
args: {
|
|
100
|
+
query: "filter query string (see query_notation); omit to return every non-Removed spec",
|
|
101
|
+
"--include-removed": "include Removed specs even without an explicit status:Removed term",
|
|
102
|
+
},
|
|
103
|
+
required: "specs_file is required; query and --include-removed are optional",
|
|
104
|
+
description: "Read-only attribute/free-text search over the whole document. Returns SpecQueryResult.",
|
|
105
|
+
examples: {
|
|
106
|
+
tip: "rosettify specs query [specs_file] '[key:value-and-free-text-query]'",
|
|
107
|
+
real: "rosettify specs query specs/checkout/specs.json 'type:FR status:Draft,Modified'",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "update",
|
|
112
|
+
brief: "Merge-patch one or more existing spec units",
|
|
113
|
+
usage: "rosettify specs update <specs_file> '<data>'",
|
|
114
|
+
args: { data: "inline JSON string: a single patch object, or an array of patch objects (batch); each must include id" },
|
|
115
|
+
required: "specs_file and data are required",
|
|
116
|
+
description: "Merge-patches (a null value removes the key) each targeted spec; id is immutable. Guarded fields in the patch " +
|
|
117
|
+
"are ignored. Editing statement or acceptance on an Approved spec moves it to Modified and clears approval; if its " +
|
|
118
|
+
"implementation was Implemented, that becomes ToBeModified. The whole batch is rejected together if any patch " +
|
|
119
|
+
"targets a missing id or is otherwise invalid. Returns SpecWriteResult.",
|
|
120
|
+
examples: {
|
|
121
|
+
tip: "rosettify specs update [specs_file] '{\"id\":\"[spec-id]\", ...patch-fields}'",
|
|
122
|
+
real: "rosettify specs update specs/checkout/specs.json '{\"id\":\"FR-CHK-0001\",\"priority\":\"Should\"}'",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "delete",
|
|
127
|
+
brief: "Soft-delete spec units (reversible)",
|
|
128
|
+
usage: "rosettify specs delete <specs_file> <ids...>",
|
|
129
|
+
args: { ids: "one or more spec ids" },
|
|
130
|
+
required: "specs_file and at least one id are required",
|
|
131
|
+
description: "Sets each targeted spec's status to Removed (idempotent; the unit is retained, restore undoes it). A missing " +
|
|
132
|
+
"id is reported in missing rather than failing the call. Returns SpecDeleteResult.",
|
|
133
|
+
examples: {
|
|
134
|
+
tip: "rosettify specs delete [specs_file] [id-1] [id-2 ...]",
|
|
135
|
+
real: "rosettify specs delete specs/checkout/specs.json FR-CHK-0001",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "purge",
|
|
140
|
+
brief: "Permanently remove spec units (irreversible)",
|
|
141
|
+
usage: "rosettify specs purge <specs_file> <ids...> --force",
|
|
142
|
+
args: { ids: "one or more spec ids", "--force": "required — permanent removal refuses without it" },
|
|
143
|
+
required: "specs_file, at least one id, and --force are all required",
|
|
144
|
+
description: "Permanently deletes each targeted spec unit. Refuses if any target is still referenced by another spec's " +
|
|
145
|
+
"depends_on or related, unless that referrer is also purged in the same batch. A missing id is reported in " +
|
|
146
|
+
"missing rather than failing the call. Returns SpecPurgeResult.",
|
|
147
|
+
examples: {
|
|
148
|
+
tip: "rosettify specs purge [specs_file] [id-1] [id-2 ...] --force",
|
|
149
|
+
real: "rosettify specs purge specs/checkout/specs.json FR-CHK-0099 --force",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "implemented",
|
|
154
|
+
brief: "Set the implementation status of one or more spec units",
|
|
155
|
+
usage: "rosettify specs implemented <specs_file> '<data>'",
|
|
156
|
+
args: { data: "inline JSON string: a single {id, implementation, implementation_notes?} object, or an array (batch)" },
|
|
157
|
+
required: "specs_file and data are required",
|
|
158
|
+
description: "Sets each targeted spec's implementation enum value (NotStarted|Implemented|Planned|ToBeModified|ToBeRemoved) " +
|
|
159
|
+
"and optionally its implementation_notes; never touches status. Returns SpecImplementedResult.",
|
|
160
|
+
examples: {
|
|
161
|
+
tip: "rosettify specs implemented [specs_file] '{\"id\":\"[spec-id]\",\"implementation\":\"[implementation-value]\"}'",
|
|
162
|
+
real: "rosettify specs implemented specs/checkout/specs.json '{\"id\":\"FR-CHK-0001\",\"implementation\":\"Implemented\"}'",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "approve",
|
|
167
|
+
brief: "Approve spec units (Draft/Modified -> Approved)",
|
|
168
|
+
usage: "rosettify specs approve <specs_file> <ids...>",
|
|
169
|
+
args: { ids: "one or more spec ids" },
|
|
170
|
+
required: "specs_file and at least one id are required",
|
|
171
|
+
description: "Runs validation over every target first and refuses the whole batch if any error-level finding remains. " +
|
|
172
|
+
"Otherwise moves Draft or Modified targets to Approved (idempotent if already Approved) and sets approved_by " +
|
|
173
|
+
"to the resolved actor; refuses a Removed or Deprecated target. Returns SpecLifecycleResult.",
|
|
174
|
+
examples: {
|
|
175
|
+
tip: "rosettify specs approve [specs_file] [id-1] [id-2 ...]",
|
|
176
|
+
real: "rosettify specs approve specs/checkout/specs.json FR-CHK-0001",
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "deprecate",
|
|
181
|
+
brief: "Deprecate spec units",
|
|
182
|
+
usage: "rosettify specs deprecate <specs_file> <ids...>",
|
|
183
|
+
args: { ids: "one or more spec ids" },
|
|
184
|
+
required: "specs_file and at least one id are required",
|
|
185
|
+
description: "Moves Draft, Modified, or Approved targets to Deprecated (idempotent); refuses a Removed target. " +
|
|
186
|
+
"Returns SpecLifecycleResult.",
|
|
187
|
+
examples: {
|
|
188
|
+
tip: "rosettify specs deprecate [specs_file] [id-1] [id-2 ...]",
|
|
189
|
+
real: "rosettify specs deprecate specs/checkout/specs.json FR-CHK-0002",
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "restore",
|
|
194
|
+
brief: "Restore Removed spec units back to Draft",
|
|
195
|
+
usage: "rosettify specs restore <specs_file> <ids...>",
|
|
196
|
+
args: { ids: "one or more spec ids" },
|
|
197
|
+
required: "specs_file and at least one id are required",
|
|
198
|
+
description: "Moves a Removed target back to Draft; refuses any other current status. Returns SpecLifecycleResult.",
|
|
199
|
+
examples: {
|
|
200
|
+
tip: "rosettify specs restore [specs_file] [id-1] [id-2 ...]",
|
|
201
|
+
real: "rosettify specs restore specs/checkout/specs.json FR-CHK-0001",
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "reopen",
|
|
206
|
+
brief: "Withdraw approval on Approved spec units",
|
|
207
|
+
usage: "rosettify specs reopen <specs_file> <ids...>",
|
|
208
|
+
args: { ids: "one or more spec ids" },
|
|
209
|
+
required: "specs_file and at least one id are required",
|
|
210
|
+
description: "Moves an Approved target back to Draft and clears approved_by; refuses any other current status. " +
|
|
211
|
+
"Returns SpecLifecycleResult.",
|
|
212
|
+
examples: {
|
|
213
|
+
tip: "rosettify specs reopen [specs_file] [id-1] [id-2 ...]",
|
|
214
|
+
real: "rosettify specs reopen specs/checkout/specs.json FR-CHK-0001",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "validate",
|
|
219
|
+
brief: "Run structural and phrasing checks over a scope",
|
|
220
|
+
usage: "rosettify specs validate <specs_file> [query]",
|
|
221
|
+
args: { query: "optional scope filter (see query_notation); omit to validate every non-Removed spec" },
|
|
222
|
+
required: "specs_file is required; query is optional",
|
|
223
|
+
description: "Read-only. Structural findings (schema completeness, id format, area registration, uniqueness, reference " +
|
|
224
|
+
"integrity, acyclic depends_on, size limits, acceptance completeness) are severity error and block approve; " +
|
|
225
|
+
"phrasing findings (EARS pattern, measurable NFR, modal verbs, duplicate statements) are severity warning, " +
|
|
226
|
+
"advisory only. Returns SpecValidateResult.",
|
|
227
|
+
examples: {
|
|
228
|
+
tip: "rosettify specs validate [specs_file] '[optional-scope-query]'",
|
|
229
|
+
real: "rosettify specs validate specs/checkout/specs.json 'area:CHK'",
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "graph",
|
|
234
|
+
brief: "Resolve dependency/related closures, cycles, and unresolved references",
|
|
235
|
+
usage: "rosettify specs graph <specs_file> [target_id] [--additional-paths <paths>]",
|
|
236
|
+
args: {
|
|
237
|
+
target_id: "optional single spec id; omit for whole-document mode",
|
|
238
|
+
"--additional-paths": "comma-separated paths to other specs documents to resolve cross-document references against",
|
|
239
|
+
},
|
|
240
|
+
required: "specs_file is required; target_id and --additional-paths are optional",
|
|
241
|
+
description: "Target mode returns that spec's forward dependency closure, reverse dependent closure, and direct related " +
|
|
242
|
+
"ids. Whole-document mode returns every edge and every depends_on cycle in the document. Both modes report " +
|
|
243
|
+
"unresolved references. An unknown target_id refuses with an error. Returns SpecGraphResult.",
|
|
244
|
+
examples: {
|
|
245
|
+
tip: "rosettify specs graph [specs_file] [optional-target-id] --additional-paths [other-specs-file-1,other-specs-file-2]",
|
|
246
|
+
real: "rosettify specs graph specs/checkout/specs.json FR-CHK-0001",
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "render",
|
|
251
|
+
brief: "Render a human-readable document (markdown or text)",
|
|
252
|
+
usage: "rosettify specs render <specs_file> [query] [--format <fmt>]",
|
|
253
|
+
args: {
|
|
254
|
+
query: "optional scope filter (see query_notation); omit to render every non-Removed spec",
|
|
255
|
+
"--format": "markdown (default) or text",
|
|
256
|
+
},
|
|
257
|
+
required: "specs_file is required; query and --format are optional",
|
|
258
|
+
description: "Read-only; renders the scoped specs grouped by area, with local-time timestamps. No file is written. Returns SpecRenderResult.",
|
|
259
|
+
examples: {
|
|
260
|
+
tip: "rosettify specs render [specs_file] '[optional-scope-query]' --format [markdown|text]",
|
|
261
|
+
real: "rosettify specs render specs/checkout/specs.json 'status:Approved'",
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "info",
|
|
266
|
+
brief: "Orientation summary: areas, totals, and next free ids",
|
|
267
|
+
usage: "rosettify specs info <specs_file>",
|
|
268
|
+
args: {},
|
|
269
|
+
required: "specs_file is required",
|
|
270
|
+
description: "Returns registered areas with their spec counts, totals by type/status/implementation, the next free id " +
|
|
271
|
+
"per prefix+area combination that already has at least one spec, and the document's timestamps in local time. " +
|
|
272
|
+
"No full spec bodies. Returns SpecInfoResult.",
|
|
273
|
+
examples: {
|
|
274
|
+
tip: "rosettify specs info [specs_file]",
|
|
275
|
+
real: "rosettify specs info specs/checkout/specs.json",
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: "migrate",
|
|
280
|
+
brief: "One-time import of legacy markdown spec blocks",
|
|
281
|
+
usage: "rosettify specs migrate <specs_file> <sources...>",
|
|
282
|
+
args: { sources: "one or more legacy markdown source file paths" },
|
|
283
|
+
required: "specs_file and at least one source are required",
|
|
284
|
+
description: "Creates the document if it does not exist yet. Parses legacy spec blocks out of each source and appends them. " +
|
|
285
|
+
"A source that does not exist or contains no parseable blocks is excluded and reported in skipped; a per-block " +
|
|
286
|
+
"issue (including a missing id) is reported in warnings without dropping the rest of that source. " +
|
|
287
|
+
"Returns SpecMigrateResult.",
|
|
288
|
+
examples: {
|
|
289
|
+
tip: "rosettify specs migrate [specs_file] [legacy-source-1.md] [legacy-source-2.md ...]",
|
|
290
|
+
real: "rosettify specs migrate specs/checkout/specs.json docs/legacy/checkout-requirements.md",
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
// FR-HELP-0002 — flat schemas dict sourced from per-subcommand declarations (not hand-authored)
|
|
295
|
+
schemas: specsSchemasDict,
|
|
296
|
+
// FR-SPECS-0007 / FR-SPECS-0060 — limits
|
|
297
|
+
limits: {
|
|
298
|
+
max_specs: SPECS_MAX_SPECS,
|
|
299
|
+
max_dependencies_per_spec: SPECS_MAX_DEPENDENCIES_PER_SPEC,
|
|
300
|
+
max_acceptance_per_spec: SPECS_MAX_ACCEPTANCE_PER_SPEC,
|
|
301
|
+
max_string_length: SPECS_MAX_STRING_LENGTH,
|
|
302
|
+
max_name_length: SPECS_MAX_NAME_LENGTH,
|
|
303
|
+
max_batch_size: SPECS_MAX_BATCH_SIZE,
|
|
304
|
+
},
|
|
305
|
+
// FR-SPECS-0012 / FR-SPECS-0060 — query grammar
|
|
306
|
+
query_notation: {
|
|
307
|
+
grammar: "query := term ( term)*; term := [\"-\"] (key:value[,value...] | free-text)",
|
|
308
|
+
keys: "type, area, status, priority, implementation, verification, source, depends_on, related, title, statement",
|
|
309
|
+
semantics: "Terms AND-combine. Within one field, comma-separated values OR-combine. A leading - negates the whole term. " +
|
|
310
|
+
"A bare (non key:value) term is free text, matched case-insensitively as a substring of title or statement. " +
|
|
311
|
+
"Quote a value to force an exact case-sensitive match instead of a case-insensitive substring/equality match, " +
|
|
312
|
+
"or to include whitespace or a colon in free text. The pseudo-key include_removed:true includes Removed specs " +
|
|
313
|
+
"(equivalent to the --include-removed flag on query). Removed specs are otherwise excluded unless a term " +
|
|
314
|
+
"explicitly matches status:Removed. An empty query matches every non-Removed spec.",
|
|
315
|
+
example: 'type:FR status:Draft,Modified -priority:Wont "exact phrase"',
|
|
316
|
+
},
|
|
317
|
+
// FR-SPECS-0061 — notes array
|
|
318
|
+
notes: specsNotes,
|
|
319
|
+
// FR-SPECS-0060 — next_steps_for_ai
|
|
320
|
+
next_steps_for_ai: "Orient first: call info to see registered areas, current totals, and the next free id per area. " +
|
|
321
|
+
"Author with add, choosing ids from info's next_ids so they don't collide. " +
|
|
322
|
+
"Refine with update as the requirement's wording settles. " +
|
|
323
|
+
"Call validate over the scope you just authored and read every error-level finding; fix them with update, then " +
|
|
324
|
+
"validate again until error_count is 0 (warnings are advisory and do not block). " +
|
|
325
|
+
"Only then call approve — it re-runs the same checks and will refuse if anything error-level remains. " +
|
|
326
|
+
"Track delivery afterward with implemented as work completes.",
|
|
327
|
+
};
|
|
328
|
+
//# sourceMappingURL=help-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help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AAwF;aAC/F;SACF;KACF;IAED,gGAAgG;IAChG,OAAO,EAAE,gBAAgB;IAEzB,yCAAyC;IACzC,MAAM,EAAE;QACN,SAAS,EAAE,eAAe;QAC1B,yBAAyB,EAAE,+BAA+B;QAC1D,uBAAuB,EAAE,6BAA6B;QACtD,iBAAiB,EAAE,uBAAuB;QAC1C,eAAe,EAAE,qBAAqB;QACtC,cAAc,EAAE,oBAAoB;KACrC;IAED,gDAAgD;IAChD,cAAc,EAAE;QACd,OAAO,EAAE,4EAA4E;QACrF,IAAI,EAAE,2GAA2G;QACjH,SAAS,EACP,8GAA8G;YAC9G,6GAA6G;YAC7G,+GAA+G;YAC/G,+GAA+G;YAC/G,0GAA0G;YAC1G,mFAAmF;QACrF,OAAO,EAAE,6DAA6D;KACvE;IAED,8BAA8B;IAC9B,KAAK,EAAE,UAAU;IAEjB,oCAAoC;IACpC,iBAAiB,EACf,kGAAkG;QAClG,4EAA4E;QAC5E,2DAA2D;QAC3D,gHAAgH;QAChH,kFAAkF;QAClF,uGAAuG;QACvG,8DAA8D;CACjE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RunEnvelope } from "../../registry/types.js";
|
|
2
|
+
import type { SpecImplementedResult } from "./output.js";
|
|
3
|
+
export declare function cmdImplemented(specsFile: string, items: unknown[], actor?: string): Promise<RunEnvelope<SpecImplementedResult>>;
|
|
4
|
+
//# sourceMappingURL=implemented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"implemented.d.ts","sourceRoot":"","sources":["../../../src/commands/specs/implemented.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM3D,OAAO,KAAK,EAAuB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAK9E,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,CAiE7C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Implements FR-SPECS-0015 (implemented subcommand). Sets the target's `implementation` enum
|
|
2
|
+
// (+optional implementation_notes); NEVER touches `status` — approval and implementation
|
|
3
|
+
// lifecycles are independent. All-or-nothing (FR-SPECS-0030).
|
|
4
|
+
import { ok, err } from "../../shared/envelope.js";
|
|
5
|
+
import { logger } from "../../shared/logger.js";
|
|
6
|
+
import { applyBatchWrite } from "./write.js";
|
|
7
|
+
import { aggregate } from "./aggregate.js";
|
|
8
|
+
import { IMPLS } from "./core.js";
|
|
9
|
+
import { ERR_INVALID_IMPLEMENTATION, ERR_INVALID_SPEC_FIELD, ERR_MISSING_DATA, ERR_MISSING_ID, ERR_MISSING_IMPLEMENTATION, ERR_TARGET_NOT_FOUND } from "./errors.js";
|
|
10
|
+
const IMPL_SET = new Set(IMPLS);
|
|
11
|
+
export async function cmdImplemented(specsFile, items, actor) {
|
|
12
|
+
try {
|
|
13
|
+
if (!items || items.length === 0)
|
|
14
|
+
return err(ERR_MISSING_DATA, true);
|
|
15
|
+
const build = (doc) => {
|
|
16
|
+
const rejects = [];
|
|
17
|
+
const affected = [];
|
|
18
|
+
const updated = [];
|
|
19
|
+
items.forEach((raw, index) => {
|
|
20
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
21
|
+
rejects.push({ ref: `index ${index}`, reason: ERR_INVALID_SPEC_FIELD });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const item = raw;
|
|
25
|
+
const id = typeof item["id"] === "string" ? item["id"] : undefined;
|
|
26
|
+
if (!id) {
|
|
27
|
+
rejects.push({ ref: `index ${index}`, reason: ERR_MISSING_ID });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const spec = (doc.specs ?? []).find((s) => s.id === id);
|
|
31
|
+
if (!spec) {
|
|
32
|
+
rejects.push({ ref: id, reason: ERR_TARGET_NOT_FOUND });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const implRaw = item["implementation"];
|
|
36
|
+
if (implRaw === undefined || implRaw === null || implRaw === "") {
|
|
37
|
+
rejects.push({ ref: id, reason: ERR_MISSING_IMPLEMENTATION });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (typeof implRaw !== "string" || !IMPL_SET.has(implRaw)) {
|
|
41
|
+
rejects.push({ ref: id, reason: ERR_INVALID_IMPLEMENTATION });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
spec.implementation = implRaw; // guarded — set only here (FR-SPECS-0040); status untouched
|
|
45
|
+
if (typeof item["implementation_notes"] === "string") {
|
|
46
|
+
spec.implementation_notes = item["implementation_notes"];
|
|
47
|
+
}
|
|
48
|
+
affected.push(id);
|
|
49
|
+
updated.push({ id, implementation: spec.implementation });
|
|
50
|
+
});
|
|
51
|
+
if (rejects.length > 0) {
|
|
52
|
+
return { ok: false, error: aggregate(rejects[0].reason, rejects) };
|
|
53
|
+
}
|
|
54
|
+
return { ok: true, affected, result: { updated } };
|
|
55
|
+
};
|
|
56
|
+
const writeResult = await applyBatchWrite(specsFile, build, { actor });
|
|
57
|
+
if (!writeResult.ok) {
|
|
58
|
+
return { ok: false, result: null, error: writeResult.error, include_help: writeResult.include_help };
|
|
59
|
+
}
|
|
60
|
+
const result = writeResult.result.result;
|
|
61
|
+
logger.info({ specsFile, count: result.updated.length }, "specs implemented");
|
|
62
|
+
return ok(result);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
66
|
+
return err(`internal_error: ${msg}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=implemented.js.map
|