sysprom 1.19.0 → 1.21.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/README.md +3 -0
- package/dist/schema.json +4 -43
- package/dist/src/cli/commands/add.js +6 -2
- package/dist/src/cli/commands/query.js +5 -3
- package/dist/src/cli/commands/speckit.js +2 -2
- package/dist/src/cli/commands/update.js +6 -4
- package/dist/src/endpoint-types.d.ts +4 -0
- package/dist/src/endpoint-types.js +22 -116
- package/dist/src/json-to-md.js +2 -16
- package/dist/src/lifecycle-state.d.ts +9 -0
- package/dist/src/lifecycle-state.js +22 -0
- package/dist/src/mcp/server.js +3 -6
- package/dist/src/md-to-json.js +1 -19
- package/dist/src/operations/add-node.d.ts +21 -132
- package/dist/src/operations/add-plan-task.d.ts +14 -88
- package/dist/src/operations/add-relationship.d.ts +16 -102
- package/dist/src/operations/check.d.ts +7 -44
- package/dist/src/operations/graph-decision.d.ts +7 -44
- package/dist/src/operations/graph-decision.js +0 -1
- package/dist/src/operations/graph-dependency.d.ts +7 -44
- package/dist/src/operations/graph-dependency.js +3 -23
- package/dist/src/operations/graph-refinement.d.ts +7 -44
- package/dist/src/operations/graph-shared.js +1 -3
- package/dist/src/operations/graph.d.ts +7 -44
- package/dist/src/operations/infer-completeness.d.ts +10 -53
- package/dist/src/operations/infer-derived.d.ts +7 -44
- package/dist/src/operations/infer-derived.js +28 -4
- package/dist/src/operations/infer-impact.d.ts +49 -308
- package/dist/src/operations/infer-impact.js +22 -3
- package/dist/src/operations/infer-lifecycle.d.ts +8 -105
- package/dist/src/operations/infer-lifecycle.js +4 -10
- package/dist/src/operations/init-document.d.ts +7 -44
- package/dist/src/operations/json-to-markdown.d.ts +7 -44
- package/dist/src/operations/mark-task-done.d.ts +14 -88
- package/dist/src/operations/mark-task-undone.d.ts +14 -88
- package/dist/src/operations/markdown-to-json.d.ts +7 -44
- package/dist/src/operations/next-id.d.ts +8 -47
- package/dist/src/operations/node-history.d.ts +7 -44
- package/dist/src/operations/plan-add-task.d.ts +14 -88
- package/dist/src/operations/plan-gate.d.ts +7 -44
- package/dist/src/operations/plan-init.d.ts +7 -44
- package/dist/src/operations/plan-progress.d.ts +7 -44
- package/dist/src/operations/plan-status.d.ts +7 -44
- package/dist/src/operations/query-node.d.ts +29 -188
- package/dist/src/operations/query-nodes.d.ts +15 -89
- package/dist/src/operations/query-nodes.js +6 -4
- package/dist/src/operations/query-relationships.d.ts +9 -58
- package/dist/src/operations/remove-node.d.ts +21 -132
- package/dist/src/operations/remove-node.js +11 -1
- package/dist/src/operations/remove-relationship.d.ts +15 -101
- package/dist/src/operations/rename.d.ts +14 -88
- package/dist/src/operations/search.d.ts +14 -88
- package/dist/src/operations/speckit-diff.d.ts +7 -44
- package/dist/src/operations/speckit-export.d.ts +7 -44
- package/dist/src/operations/speckit-import.d.ts +7 -44
- package/dist/src/operations/speckit-sync.d.ts +22 -133
- package/dist/src/operations/speckit-sync.js +3 -3
- package/dist/src/operations/state-at.d.ts +7 -44
- package/dist/src/operations/stats.d.ts +7 -44
- package/dist/src/operations/sync.d.ts +21 -132
- package/dist/src/operations/task-list.d.ts +7 -44
- package/dist/src/operations/timeline.d.ts +7 -44
- package/dist/src/operations/trace-from-node.d.ts +21 -132
- package/dist/src/operations/update-metadata.d.ts +14 -88
- package/dist/src/operations/update-node.d.ts +20 -152
- package/dist/src/operations/update-plan-task.d.ts +14 -88
- package/dist/src/operations/validate.d.ts +7 -44
- package/dist/src/operations/validate.js +8 -6
- package/dist/src/schema.d.ts +22 -159
- package/dist/src/schema.js +4 -26
- package/dist/src/speckit/generate.js +10 -7
- package/dist/src/speckit/parse.js +6 -3
- package/dist/src/speckit/plan.js +1 -1
- package/package.json +12 -1
- package/schema.json +4 -43
package/dist/src/schema.d.ts
CHANGED
|
@@ -24,14 +24,12 @@ export declare const NodeType: z.ZodEnum<{
|
|
|
24
24
|
gate: "gate";
|
|
25
25
|
mode: "mode";
|
|
26
26
|
artefact: "artefact";
|
|
27
|
-
artefact_flow: "artefact_flow";
|
|
28
27
|
decision: "decision";
|
|
29
28
|
change: "change";
|
|
30
29
|
view: "view";
|
|
31
30
|
milestone: "milestone";
|
|
32
|
-
version: "version";
|
|
33
31
|
}> & {
|
|
34
|
-
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
32
|
+
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
|
|
35
33
|
};
|
|
36
34
|
/** A valid node type string. */
|
|
37
35
|
export type NodeType = z.infer<typeof NodeType>;
|
|
@@ -51,15 +49,13 @@ export declare const NODE_TYPE_LABELS: {
|
|
|
51
49
|
readonly gate: "Gates";
|
|
52
50
|
readonly mode: "Modes";
|
|
53
51
|
readonly artefact: "Artefacts";
|
|
54
|
-
readonly artefact_flow: "Artefact Flows";
|
|
55
52
|
readonly decision: "Decisions";
|
|
56
53
|
readonly change: "Changes";
|
|
57
54
|
readonly view: "Views";
|
|
58
55
|
readonly milestone: "Milestones";
|
|
59
|
-
readonly version: "Versions";
|
|
60
56
|
};
|
|
61
57
|
/** Reverse map from human-readable label to node type key (e.g. `"Intent"` → `"intent"`). */
|
|
62
|
-
export declare const NODE_LABEL_TO_TYPE: Record<string, "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
58
|
+
export declare const NODE_LABEL_TO_TYPE: Record<string, "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone">;
|
|
63
59
|
/** All valid node status values, ordered by typical lifecycle progression. */
|
|
64
60
|
export declare const NODE_STATUSES: readonly ["proposed", "accepted", "active", "implemented", "adopted", "defined", "introduced", "in_progress", "complete", "consolidated", "experimental", "deprecated", "retired", "superseded", "abandoned", "deferred"];
|
|
65
61
|
/** Zod schema for the set of valid node statuses (e.g. `"proposed"`, `"active"`, `"deprecated"`). */
|
|
@@ -95,26 +91,14 @@ export declare const RelationshipType: z.ZodEnum<{
|
|
|
95
91
|
affects: "affects";
|
|
96
92
|
supersedes: "supersedes";
|
|
97
93
|
must_preserve: "must_preserve";
|
|
98
|
-
performs: "performs";
|
|
99
94
|
part_of: "part_of";
|
|
100
95
|
precedes: "precedes";
|
|
101
96
|
must_follow: "must_follow";
|
|
102
|
-
blocks: "blocks";
|
|
103
|
-
routes_to: "routes_to";
|
|
104
97
|
governed_by: "governed_by";
|
|
105
98
|
modifies: "modifies";
|
|
106
|
-
triggered_by: "triggered_by";
|
|
107
|
-
applies_to: "applies_to";
|
|
108
99
|
produces: "produces";
|
|
109
|
-
consumes: "consumes";
|
|
110
|
-
transforms_into: "transforms_into";
|
|
111
|
-
selects: "selects";
|
|
112
|
-
requires: "requires";
|
|
113
|
-
disables: "disables";
|
|
114
|
-
influence: "influence";
|
|
115
|
-
justifies: "justifies";
|
|
116
100
|
}> & {
|
|
117
|
-
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
101
|
+
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
118
102
|
};
|
|
119
103
|
/** A valid relationship type string. */
|
|
120
104
|
export type RelationshipType = z.infer<typeof RelationshipType>;
|
|
@@ -128,27 +112,15 @@ export declare const RELATIONSHIP_TYPE_LABELS: {
|
|
|
128
112
|
readonly affects: "Affects";
|
|
129
113
|
readonly supersedes: "Supersedes";
|
|
130
114
|
readonly must_preserve: "Must preserve";
|
|
131
|
-
readonly performs: "Performs";
|
|
132
115
|
readonly part_of: "Part of";
|
|
133
116
|
readonly precedes: "Precedes";
|
|
134
117
|
readonly must_follow: "Must follow";
|
|
135
|
-
readonly blocks: "Blocks";
|
|
136
|
-
readonly routes_to: "Routes to";
|
|
137
118
|
readonly governed_by: "Governed by";
|
|
138
119
|
readonly modifies: "Modifies";
|
|
139
|
-
readonly triggered_by: "Triggered by";
|
|
140
|
-
readonly applies_to: "Applies to";
|
|
141
120
|
readonly produces: "Produces";
|
|
142
|
-
readonly consumes: "Consumes";
|
|
143
|
-
readonly transforms_into: "Transforms into";
|
|
144
|
-
readonly selects: "Selects";
|
|
145
|
-
readonly requires: "Requires";
|
|
146
|
-
readonly disables: "Disables";
|
|
147
|
-
readonly influence: "Influence";
|
|
148
|
-
readonly justifies: "Justifies";
|
|
149
121
|
};
|
|
150
122
|
/** Reverse map from human-readable label to relationship type key (e.g. `"Refines"` → `"refines"`). */
|
|
151
|
-
export declare const RELATIONSHIP_LABEL_TO_TYPE: Record<string, "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
123
|
+
export declare const RELATIONSHIP_LABEL_TO_TYPE: Record<string, "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces">;
|
|
152
124
|
/** Zod schema for impact polarity (e.g. `"positive"`, `"negative"`, `"neutral"`, `"uncertain"`). */
|
|
153
125
|
export declare const ImpactPolarity: z.ZodEnum<{
|
|
154
126
|
positive: "positive";
|
|
@@ -309,26 +281,14 @@ export declare const Relationship: z.ZodObject<{
|
|
|
309
281
|
affects: "affects";
|
|
310
282
|
supersedes: "supersedes";
|
|
311
283
|
must_preserve: "must_preserve";
|
|
312
|
-
performs: "performs";
|
|
313
284
|
part_of: "part_of";
|
|
314
285
|
precedes: "precedes";
|
|
315
286
|
must_follow: "must_follow";
|
|
316
|
-
blocks: "blocks";
|
|
317
|
-
routes_to: "routes_to";
|
|
318
287
|
governed_by: "governed_by";
|
|
319
288
|
modifies: "modifies";
|
|
320
|
-
triggered_by: "triggered_by";
|
|
321
|
-
applies_to: "applies_to";
|
|
322
289
|
produces: "produces";
|
|
323
|
-
consumes: "consumes";
|
|
324
|
-
transforms_into: "transforms_into";
|
|
325
|
-
selects: "selects";
|
|
326
|
-
requires: "requires";
|
|
327
|
-
disables: "disables";
|
|
328
|
-
influence: "influence";
|
|
329
|
-
justifies: "justifies";
|
|
330
290
|
}> & {
|
|
331
|
-
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
291
|
+
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
332
292
|
};
|
|
333
293
|
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
334
294
|
is(value: unknown): value is string | string[];
|
|
@@ -347,7 +307,7 @@ export declare const Relationship: z.ZodObject<{
|
|
|
347
307
|
[x: string]: unknown;
|
|
348
308
|
from: string;
|
|
349
309
|
to: string;
|
|
350
|
-
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
310
|
+
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
351
311
|
description?: string | string[] | undefined;
|
|
352
312
|
polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
|
|
353
313
|
strength?: number | undefined;
|
|
@@ -386,26 +346,14 @@ declare const SysProMDocumentSchema: z.ZodObject<{
|
|
|
386
346
|
affects: "affects";
|
|
387
347
|
supersedes: "supersedes";
|
|
388
348
|
must_preserve: "must_preserve";
|
|
389
|
-
performs: "performs";
|
|
390
349
|
part_of: "part_of";
|
|
391
350
|
precedes: "precedes";
|
|
392
351
|
must_follow: "must_follow";
|
|
393
|
-
blocks: "blocks";
|
|
394
|
-
routes_to: "routes_to";
|
|
395
352
|
governed_by: "governed_by";
|
|
396
353
|
modifies: "modifies";
|
|
397
|
-
triggered_by: "triggered_by";
|
|
398
|
-
applies_to: "applies_to";
|
|
399
354
|
produces: "produces";
|
|
400
|
-
consumes: "consumes";
|
|
401
|
-
transforms_into: "transforms_into";
|
|
402
|
-
selects: "selects";
|
|
403
|
-
requires: "requires";
|
|
404
|
-
disables: "disables";
|
|
405
|
-
influence: "influence";
|
|
406
|
-
justifies: "justifies";
|
|
407
355
|
}> & {
|
|
408
|
-
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
356
|
+
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
409
357
|
};
|
|
410
358
|
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
411
359
|
is(value: unknown): value is string | string[];
|
|
@@ -424,7 +372,7 @@ declare const SysProMDocumentSchema: z.ZodObject<{
|
|
|
424
372
|
[x: string]: unknown;
|
|
425
373
|
from: string;
|
|
426
374
|
to: string;
|
|
427
|
-
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
375
|
+
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
428
376
|
description?: string | string[] | undefined;
|
|
429
377
|
polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
|
|
430
378
|
strength?: number | undefined;
|
|
@@ -478,39 +426,18 @@ export declare const NodeBase: z.ZodObject<{
|
|
|
478
426
|
gate: "gate";
|
|
479
427
|
mode: "mode";
|
|
480
428
|
artefact: "artefact";
|
|
481
|
-
artefact_flow: "artefact_flow";
|
|
482
429
|
decision: "decision";
|
|
483
430
|
change: "change";
|
|
484
431
|
view: "view";
|
|
485
432
|
milestone: "milestone";
|
|
486
|
-
version: "version";
|
|
487
433
|
}> & {
|
|
488
|
-
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
434
|
+
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
|
|
489
435
|
};
|
|
490
436
|
name: z.ZodString;
|
|
491
437
|
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
492
438
|
is(value: unknown): value is string | string[];
|
|
493
439
|
}>;
|
|
494
|
-
status: z.ZodOptional<z.
|
|
495
|
-
deprecated: "deprecated";
|
|
496
|
-
proposed: "proposed";
|
|
497
|
-
accepted: "accepted";
|
|
498
|
-
active: "active";
|
|
499
|
-
implemented: "implemented";
|
|
500
|
-
adopted: "adopted";
|
|
501
|
-
defined: "defined";
|
|
502
|
-
introduced: "introduced";
|
|
503
|
-
in_progress: "in_progress";
|
|
504
|
-
complete: "complete";
|
|
505
|
-
consolidated: "consolidated";
|
|
506
|
-
experimental: "experimental";
|
|
507
|
-
retired: "retired";
|
|
508
|
-
superseded: "superseded";
|
|
509
|
-
abandoned: "abandoned";
|
|
510
|
-
deferred: "deferred";
|
|
511
|
-
}> & {
|
|
512
|
-
is(value: unknown): value is "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred";
|
|
513
|
-
}>;
|
|
440
|
+
status: z.ZodOptional<z.ZodNever>;
|
|
514
441
|
lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
515
442
|
context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
516
443
|
is(value: unknown): value is string | string[];
|
|
@@ -565,8 +492,6 @@ export declare const NodeBase: z.ZodObject<{
|
|
|
565
492
|
}>>;
|
|
566
493
|
propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
567
494
|
includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
568
|
-
input: z.ZodOptional<z.ZodString>;
|
|
569
|
-
output: z.ZodOptional<z.ZodString>;
|
|
570
495
|
external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
571
496
|
role: z.ZodEnum<{
|
|
572
497
|
output: "output";
|
|
@@ -615,39 +540,18 @@ declare const NodeSchema: z.ZodObject<{
|
|
|
615
540
|
gate: "gate";
|
|
616
541
|
mode: "mode";
|
|
617
542
|
artefact: "artefact";
|
|
618
|
-
artefact_flow: "artefact_flow";
|
|
619
543
|
decision: "decision";
|
|
620
544
|
change: "change";
|
|
621
545
|
view: "view";
|
|
622
546
|
milestone: "milestone";
|
|
623
|
-
version: "version";
|
|
624
547
|
}> & {
|
|
625
|
-
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
548
|
+
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
|
|
626
549
|
};
|
|
627
550
|
name: z.ZodString;
|
|
628
551
|
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
629
552
|
is(value: unknown): value is string | string[];
|
|
630
553
|
}>;
|
|
631
|
-
status: z.ZodOptional<z.
|
|
632
|
-
deprecated: "deprecated";
|
|
633
|
-
proposed: "proposed";
|
|
634
|
-
accepted: "accepted";
|
|
635
|
-
active: "active";
|
|
636
|
-
implemented: "implemented";
|
|
637
|
-
adopted: "adopted";
|
|
638
|
-
defined: "defined";
|
|
639
|
-
introduced: "introduced";
|
|
640
|
-
in_progress: "in_progress";
|
|
641
|
-
complete: "complete";
|
|
642
|
-
consolidated: "consolidated";
|
|
643
|
-
experimental: "experimental";
|
|
644
|
-
retired: "retired";
|
|
645
|
-
superseded: "superseded";
|
|
646
|
-
abandoned: "abandoned";
|
|
647
|
-
deferred: "deferred";
|
|
648
|
-
}> & {
|
|
649
|
-
is(value: unknown): value is "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred";
|
|
650
|
-
}>;
|
|
554
|
+
status: z.ZodOptional<z.ZodNever>;
|
|
651
555
|
lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
652
556
|
context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
653
557
|
is(value: unknown): value is string | string[];
|
|
@@ -702,8 +606,6 @@ declare const NodeSchema: z.ZodObject<{
|
|
|
702
606
|
}>>;
|
|
703
607
|
propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
704
608
|
includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
705
|
-
input: z.ZodOptional<z.ZodString>;
|
|
706
|
-
output: z.ZodOptional<z.ZodString>;
|
|
707
609
|
external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
708
610
|
role: z.ZodEnum<{
|
|
709
611
|
output: "output";
|
|
@@ -771,26 +673,14 @@ export declare const SysProMDocument: z.ZodObject<{
|
|
|
771
673
|
affects: "affects";
|
|
772
674
|
supersedes: "supersedes";
|
|
773
675
|
must_preserve: "must_preserve";
|
|
774
|
-
performs: "performs";
|
|
775
676
|
part_of: "part_of";
|
|
776
677
|
precedes: "precedes";
|
|
777
678
|
must_follow: "must_follow";
|
|
778
|
-
blocks: "blocks";
|
|
779
|
-
routes_to: "routes_to";
|
|
780
679
|
governed_by: "governed_by";
|
|
781
680
|
modifies: "modifies";
|
|
782
|
-
triggered_by: "triggered_by";
|
|
783
|
-
applies_to: "applies_to";
|
|
784
681
|
produces: "produces";
|
|
785
|
-
consumes: "consumes";
|
|
786
|
-
transforms_into: "transforms_into";
|
|
787
|
-
selects: "selects";
|
|
788
|
-
requires: "requires";
|
|
789
|
-
disables: "disables";
|
|
790
|
-
influence: "influence";
|
|
791
|
-
justifies: "justifies";
|
|
792
682
|
}> & {
|
|
793
|
-
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
683
|
+
is(value: unknown): value is "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
794
684
|
};
|
|
795
685
|
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
796
686
|
is(value: unknown): value is string | string[];
|
|
@@ -809,7 +699,7 @@ export declare const SysProMDocument: z.ZodObject<{
|
|
|
809
699
|
[x: string]: unknown;
|
|
810
700
|
from: string;
|
|
811
701
|
to: string;
|
|
812
|
-
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
702
|
+
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
813
703
|
description?: string | string[] | undefined;
|
|
814
704
|
polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
|
|
815
705
|
strength?: number | undefined;
|
|
@@ -849,10 +739,10 @@ export declare const SysProMDocument: z.ZodObject<{
|
|
|
849
739
|
nodes: {
|
|
850
740
|
[x: string]: unknown;
|
|
851
741
|
id: string;
|
|
852
|
-
type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
742
|
+
type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
|
|
853
743
|
name: string;
|
|
854
744
|
description?: string | string[] | undefined;
|
|
855
|
-
status?:
|
|
745
|
+
status?: undefined;
|
|
856
746
|
lifecycle?: Record<string, string | boolean> | undefined;
|
|
857
747
|
context?: string | string[] | undefined;
|
|
858
748
|
options?: {
|
|
@@ -876,8 +766,6 @@ export declare const SysProMDocument: z.ZodObject<{
|
|
|
876
766
|
}[] | undefined;
|
|
877
767
|
propagation?: Record<string, boolean> | undefined;
|
|
878
768
|
includes?: string[] | undefined;
|
|
879
|
-
input?: string | undefined;
|
|
880
|
-
output?: string | undefined;
|
|
881
769
|
external_references?: {
|
|
882
770
|
role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
|
|
883
771
|
identifier: string;
|
|
@@ -900,7 +788,7 @@ export declare const SysProMDocument: z.ZodObject<{
|
|
|
900
788
|
[x: string]: unknown;
|
|
901
789
|
from: string;
|
|
902
790
|
to: string;
|
|
903
|
-
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
791
|
+
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
904
792
|
description?: string | string[] | undefined;
|
|
905
793
|
polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
|
|
906
794
|
strength?: number | undefined;
|
|
@@ -938,39 +826,18 @@ export declare const Node: z.ZodObject<{
|
|
|
938
826
|
gate: "gate";
|
|
939
827
|
mode: "mode";
|
|
940
828
|
artefact: "artefact";
|
|
941
|
-
artefact_flow: "artefact_flow";
|
|
942
829
|
decision: "decision";
|
|
943
830
|
change: "change";
|
|
944
831
|
view: "view";
|
|
945
832
|
milestone: "milestone";
|
|
946
|
-
version: "version";
|
|
947
833
|
}> & {
|
|
948
|
-
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
834
|
+
is(value: unknown): value is "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
|
|
949
835
|
};
|
|
950
836
|
name: z.ZodString;
|
|
951
837
|
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
952
838
|
is(value: unknown): value is string | string[];
|
|
953
839
|
}>;
|
|
954
|
-
status: z.ZodOptional<z.
|
|
955
|
-
deprecated: "deprecated";
|
|
956
|
-
proposed: "proposed";
|
|
957
|
-
accepted: "accepted";
|
|
958
|
-
active: "active";
|
|
959
|
-
implemented: "implemented";
|
|
960
|
-
adopted: "adopted";
|
|
961
|
-
defined: "defined";
|
|
962
|
-
introduced: "introduced";
|
|
963
|
-
in_progress: "in_progress";
|
|
964
|
-
complete: "complete";
|
|
965
|
-
consolidated: "consolidated";
|
|
966
|
-
experimental: "experimental";
|
|
967
|
-
retired: "retired";
|
|
968
|
-
superseded: "superseded";
|
|
969
|
-
abandoned: "abandoned";
|
|
970
|
-
deferred: "deferred";
|
|
971
|
-
}> & {
|
|
972
|
-
is(value: unknown): value is "deprecated" | "proposed" | "accepted" | "active" | "implemented" | "adopted" | "defined" | "introduced" | "in_progress" | "complete" | "consolidated" | "experimental" | "retired" | "superseded" | "abandoned" | "deferred";
|
|
973
|
-
}>;
|
|
840
|
+
status: z.ZodOptional<z.ZodNever>;
|
|
974
841
|
lifecycle: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
975
842
|
context: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]> & {
|
|
976
843
|
is(value: unknown): value is string | string[];
|
|
@@ -1025,8 +892,6 @@ export declare const Node: z.ZodObject<{
|
|
|
1025
892
|
}>>;
|
|
1026
893
|
propagation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
1027
894
|
includes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1028
|
-
input: z.ZodOptional<z.ZodString>;
|
|
1029
|
-
output: z.ZodOptional<z.ZodString>;
|
|
1030
895
|
external_references: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1031
896
|
role: z.ZodEnum<{
|
|
1032
897
|
output: "output";
|
|
@@ -1061,10 +926,10 @@ export declare const Node: z.ZodObject<{
|
|
|
1061
926
|
is(value: unknown): value is {
|
|
1062
927
|
[x: string]: unknown;
|
|
1063
928
|
id: string;
|
|
1064
|
-
type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "
|
|
929
|
+
type: "intent" | "concept" | "capability" | "element" | "realisation" | "invariant" | "principle" | "policy" | "protocol" | "stage" | "role" | "gate" | "mode" | "artefact" | "decision" | "change" | "view" | "milestone";
|
|
1065
930
|
name: string;
|
|
1066
931
|
description?: string | string[] | undefined;
|
|
1067
|
-
status?:
|
|
932
|
+
status?: undefined;
|
|
1068
933
|
lifecycle?: Record<string, string | boolean> | undefined;
|
|
1069
934
|
context?: string | string[] | undefined;
|
|
1070
935
|
options?: {
|
|
@@ -1088,8 +953,6 @@ export declare const Node: z.ZodObject<{
|
|
|
1088
953
|
}[] | undefined;
|
|
1089
954
|
propagation?: Record<string, boolean> | undefined;
|
|
1090
955
|
includes?: string[] | undefined;
|
|
1091
|
-
input?: string | undefined;
|
|
1092
|
-
output?: string | undefined;
|
|
1093
956
|
external_references?: {
|
|
1094
957
|
role: "output" | "input" | "context" | "evidence" | "source" | "standard" | "prior_art";
|
|
1095
958
|
identifier: string;
|
|
@@ -1112,7 +975,7 @@ export declare const Node: z.ZodObject<{
|
|
|
1112
975
|
[x: string]: unknown;
|
|
1113
976
|
from: string;
|
|
1114
977
|
to: string;
|
|
1115
|
-
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "
|
|
978
|
+
type: "refines" | "realises" | "implements" | "depends_on" | "constrained_by" | "affects" | "supersedes" | "must_preserve" | "part_of" | "precedes" | "must_follow" | "governed_by" | "modifies" | "produces";
|
|
1116
979
|
description?: string | string[] | undefined;
|
|
1117
980
|
polarity?: "positive" | "negative" | "neutral" | "uncertain" | undefined;
|
|
1118
981
|
strength?: number | undefined;
|
package/dist/src/schema.js
CHANGED
|
@@ -58,12 +58,10 @@ const nodeTypeDef = labelledEnum({
|
|
|
58
58
|
gate: "Gates",
|
|
59
59
|
mode: "Modes",
|
|
60
60
|
artefact: "Artefacts",
|
|
61
|
-
artefact_flow: "Artefact Flows",
|
|
62
61
|
decision: "Decisions",
|
|
63
62
|
change: "Changes",
|
|
64
63
|
view: "Views",
|
|
65
64
|
milestone: "Milestones",
|
|
66
|
-
version: "Versions",
|
|
67
65
|
});
|
|
68
66
|
/** Zod schema for the set of valid node types (e.g. `"intent"`, `"decision"`, `"change"`). */
|
|
69
67
|
export const NodeType = nodeTypeDef.schema;
|
|
@@ -107,24 +105,12 @@ const relationshipTypeDef = labelledEnum({
|
|
|
107
105
|
affects: "Affects",
|
|
108
106
|
supersedes: "Supersedes",
|
|
109
107
|
must_preserve: "Must preserve",
|
|
110
|
-
performs: "Performs",
|
|
111
108
|
part_of: "Part of",
|
|
112
109
|
precedes: "Precedes",
|
|
113
110
|
must_follow: "Must follow",
|
|
114
|
-
blocks: "Blocks",
|
|
115
|
-
routes_to: "Routes to",
|
|
116
111
|
governed_by: "Governed by",
|
|
117
112
|
modifies: "Modifies",
|
|
118
|
-
triggered_by: "Triggered by",
|
|
119
|
-
applies_to: "Applies to",
|
|
120
113
|
produces: "Produces",
|
|
121
|
-
consumes: "Consumes",
|
|
122
|
-
transforms_into: "Transforms into",
|
|
123
|
-
selects: "Selects",
|
|
124
|
-
requires: "Requires",
|
|
125
|
-
disables: "Disables",
|
|
126
|
-
influence: "Influence",
|
|
127
|
-
justifies: "Justifies",
|
|
128
114
|
});
|
|
129
115
|
/** Zod schema for the set of valid relationship types (e.g. `"refines"`, `"depends_on"`, `"affects"`). */
|
|
130
116
|
export const RelationshipType = relationshipTypeDef.schema;
|
|
@@ -270,7 +256,10 @@ export const NodeBase = z
|
|
|
270
256
|
type: NodeType,
|
|
271
257
|
name: z.string().describe("Human-readable name."),
|
|
272
258
|
description: Text.optional(),
|
|
273
|
-
status:
|
|
259
|
+
status: z
|
|
260
|
+
.never()
|
|
261
|
+
.optional()
|
|
262
|
+
.describe("Deprecated field. Node-level status is not supported; use lifecycle states instead."),
|
|
274
263
|
lifecycle: z
|
|
275
264
|
.record(z.string(), z.union([z.boolean(), z.string()]))
|
|
276
265
|
.describe("Map of lifecycle state names to completion status. Values may be boolean or an ISO date string indicating when the state was reached.")
|
|
@@ -305,14 +294,6 @@ export const NodeBase = z
|
|
|
305
294
|
.array(z.string())
|
|
306
295
|
.describe("IDs of nodes included in this projection. Applicable to view nodes.")
|
|
307
296
|
.optional(),
|
|
308
|
-
input: z
|
|
309
|
-
.string()
|
|
310
|
-
.describe("ID of the input artefact. Applicable to artefact_flow nodes.")
|
|
311
|
-
.optional(),
|
|
312
|
-
output: z
|
|
313
|
-
.string()
|
|
314
|
-
.describe("ID of the output artefact. Applicable to artefact_flow nodes.")
|
|
315
|
-
.optional(),
|
|
316
297
|
external_references: z
|
|
317
298
|
.array(ExternalReference)
|
|
318
299
|
.describe("External resources related to this node.")
|
|
@@ -364,7 +345,6 @@ export const NODE_FILE_MAP = {
|
|
|
364
345
|
"gate",
|
|
365
346
|
"mode",
|
|
366
347
|
"artefact",
|
|
367
|
-
"artefact_flow",
|
|
368
348
|
],
|
|
369
349
|
DECISIONS: ["decision"],
|
|
370
350
|
CHANGES: ["change"],
|
|
@@ -385,12 +365,10 @@ export const NODE_ID_PREFIX = {
|
|
|
385
365
|
gate: "GATE",
|
|
386
366
|
mode: "MODE",
|
|
387
367
|
artefact: "ART",
|
|
388
|
-
artefact_flow: "FLOW",
|
|
389
368
|
decision: "DEC",
|
|
390
369
|
change: "CHG",
|
|
391
370
|
view: "VIEW",
|
|
392
371
|
milestone: "MILE",
|
|
393
|
-
version: "VER",
|
|
394
372
|
};
|
|
395
373
|
// ---------------------------------------------------------------------------
|
|
396
374
|
// Generate JSON Schema
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { textToString } from "../text.js";
|
|
4
|
+
import { hasLifecycleState, primaryLifecycleState, } from "../lifecycle-state.js";
|
|
4
5
|
// ============================================================================
|
|
5
6
|
// Helper functions
|
|
6
7
|
// ============================================================================
|
|
@@ -120,23 +121,23 @@ function parseTasks(node) {
|
|
|
120
121
|
}));
|
|
121
122
|
}
|
|
122
123
|
/**
|
|
123
|
-
* Format the
|
|
124
|
-
* @param
|
|
124
|
+
* Format the lifecycle state for spec output: "proposed" -> "Draft", etc.
|
|
125
|
+
* @param state - The node lifecycle state.
|
|
125
126
|
* @returns Formatted status label.
|
|
126
127
|
* @example
|
|
127
128
|
* ```ts
|
|
128
129
|
* formatStatus("proposed"); // => "Draft"
|
|
129
130
|
* ```
|
|
130
131
|
*/
|
|
131
|
-
function formatStatus(
|
|
132
|
-
if (!
|
|
132
|
+
function formatStatus(state) {
|
|
133
|
+
if (!state)
|
|
133
134
|
return "Draft";
|
|
134
135
|
const mapping = {
|
|
135
136
|
proposed: "Draft",
|
|
136
137
|
active: "Active",
|
|
137
138
|
complete: "Complete",
|
|
138
139
|
};
|
|
139
|
-
return mapping[
|
|
140
|
+
return mapping[state] ?? state;
|
|
140
141
|
}
|
|
141
142
|
// ============================================================================
|
|
142
143
|
// generate Constitution
|
|
@@ -244,7 +245,7 @@ export function generateSpec(doc, prefix) {
|
|
|
244
245
|
// Metadata
|
|
245
246
|
output += `**Feature Branch**: \`${prefix.toLowerCase()}\`\n`;
|
|
246
247
|
output += `**Created**: ${new Date().toISOString().split("T")[0]}\n`;
|
|
247
|
-
output += `**Status**: ${formatStatus(spec
|
|
248
|
+
output += `**Status**: ${formatStatus(primaryLifecycleState(spec))}\n\n`;
|
|
248
249
|
// User Scenarios & Testing section
|
|
249
250
|
output += "## User Scenarios & Testing *(mandatory)*\n\n";
|
|
250
251
|
const capabilityRels = findRelationshipsTo(doc, specId, "refines");
|
|
@@ -314,7 +315,9 @@ export function generateSpec(doc, prefix) {
|
|
|
314
315
|
else {
|
|
315
316
|
frNodes.forEach((req) => {
|
|
316
317
|
const reqText = textToString(req.description ?? "");
|
|
317
|
-
const status = req
|
|
318
|
+
const status = hasLifecycleState(req, "proposed")
|
|
319
|
+
? ` [NEEDS CLARIFICATION]`
|
|
320
|
+
: "";
|
|
318
321
|
output += `- **${req.id}**: ${reqText}${status}\n`;
|
|
319
322
|
});
|
|
320
323
|
output += "\n";
|
|
@@ -165,6 +165,9 @@ function mapStatusValue(value) {
|
|
|
165
165
|
};
|
|
166
166
|
return statusMap[lower] ?? "proposed";
|
|
167
167
|
}
|
|
168
|
+
function statusLifecycle(status) {
|
|
169
|
+
return { [status]: true };
|
|
170
|
+
}
|
|
168
171
|
/**
|
|
169
172
|
* Extract a single line value from body text (e.g., "**Created**: 2025-01-01").
|
|
170
173
|
* @param body - Markdown body text.
|
|
@@ -311,7 +314,7 @@ export function parseSpec(content, idPrefix) {
|
|
|
311
314
|
id: specId,
|
|
312
315
|
type: "artefact",
|
|
313
316
|
name: title,
|
|
314
|
-
status,
|
|
317
|
+
lifecycle: statusLifecycle(status),
|
|
315
318
|
description: titleSection?.body,
|
|
316
319
|
});
|
|
317
320
|
// Track user stories, FRs, SCs, and entities
|
|
@@ -390,7 +393,7 @@ export function parseSpec(content, idPrefix) {
|
|
|
390
393
|
type: "invariant",
|
|
391
394
|
name: `FR-${String(frIdx)}`,
|
|
392
395
|
description: frText,
|
|
393
|
-
|
|
396
|
+
lifecycle: statusLifecycle(needsClarification ? "proposed" : "active"),
|
|
394
397
|
});
|
|
395
398
|
relationships.push({
|
|
396
399
|
from: frId,
|
|
@@ -437,7 +440,7 @@ export function parseSpec(content, idPrefix) {
|
|
|
437
440
|
type: "invariant",
|
|
438
441
|
name: `SC-${String(scIdx)}`,
|
|
439
442
|
description: scText,
|
|
440
|
-
|
|
443
|
+
lifecycle: statusLifecycle("active"),
|
|
441
444
|
});
|
|
442
445
|
relationships.push({
|
|
443
446
|
from: scId,
|
package/dist/src/speckit/plan.js
CHANGED