@specforge/canary-cli 0.2.13 → 0.2.14
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/node_modules/@specforge/report-types/package.json +1 -1
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.d.ts +24 -0
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.d.ts.map +1 -1
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.js +44 -10
- package/node_modules/@specforge/spec-types/dist/schema/step-link-coverage.js.map +1 -1
- package/node_modules/@specforge/spec-types/package.json +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@specforge/report-types",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "SpecForge status/analytic report types (specification/epic status, implementation/time/blockers). Embeds the canonical spec-domain entities (spec-types) + Project (api-types).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,6 +49,30 @@ export interface TicketLinkCoverage {
|
|
|
49
49
|
orphanFileChangeCount: number;
|
|
50
50
|
orphanSnippetCount: number;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* MB.42.1 — the set of code/type snippet ids that ARE linked by ≥1 (surviving) step.
|
|
54
|
+
* Pure step-derivation (no `ticketType` gate) so it is the SINGLE source of the
|
|
55
|
+
* step↔snippet link set shared by the coverage counter, the projection prune
|
|
56
|
+
* (`@specforge/core` apply-mutation) and the persistence prune (`@specforge/lifecycle`
|
|
57
|
+
* buildNodeVerbWriteItems). A snippet id NOT in the returned set is orphan — it was
|
|
58
|
+
* left dangling by a removed/edited step and must be pruned (row-vs-link asymmetry).
|
|
59
|
+
*/
|
|
60
|
+
export declare function linkedSnippetIds(ticket: TicketLinkCoverageInput): {
|
|
61
|
+
code: Set<string>;
|
|
62
|
+
type: Set<string>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* MB.42.1 — the code/type snippet ROW ids that link NO step (orphans). Built on
|
|
66
|
+
* `linkedSnippetIds` so the projection filter (keep-linked) and the persistence
|
|
67
|
+
* `relatedDelete` (delete-orphan) prune the IDENTICAL id set by construction —
|
|
68
|
+
* structural projection↔persistence parity, not three hand-rolled inline filters.
|
|
69
|
+
* Pure + id-only (never reads `content`/`language`), so it is safe over the recompose
|
|
70
|
+
* `{id,content}` shape that deliberately drops `language`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function orphanSnippetIds(ticket: TicketLinkCoverageInput): {
|
|
73
|
+
code: string[];
|
|
74
|
+
type: string[];
|
|
75
|
+
};
|
|
52
76
|
/**
|
|
53
77
|
* Compute the four link-coverage counters for a single ticket. Pure + deterministic;
|
|
54
78
|
* the ONLY source of the materialized numbers, shared by both write paths (projection
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-link-coverage.d.ts","sourceRoot":"","sources":["../../src/schema/step-link-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,oFAAoF;AACpF,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mBAAmB,CAAC,EAAE,aAAa,CAAC;QAClC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;QACzC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;QAChD,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;KACjD,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACjB,uFAAuF;IACvF,cAAc,CAAC,EAAE,aAAa,CAAC;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3F,YAAY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AAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACnE,YAAY,CAAC,EAAE,aAAa,CAAC;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CACpE;AAED,+DAA+D;AAC/D,MAAM,WAAW,kBAAkB;IACjC,uBAAuB,EAAE,MAAM,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AASD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,GAAG;IAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAW1G;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,uBAAuB,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAWpG;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,uBAAuB,GAAG,kBAAkB,CAqC7F"}
|
|
@@ -28,6 +28,46 @@ const ZERO_COVERAGE = {
|
|
|
28
28
|
orphanFileChangeCount: 0,
|
|
29
29
|
orphanSnippetCount: 0,
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* MB.42.1 — the set of code/type snippet ids that ARE linked by ≥1 (surviving) step.
|
|
33
|
+
* Pure step-derivation (no `ticketType` gate) so it is the SINGLE source of the
|
|
34
|
+
* step↔snippet link set shared by the coverage counter, the projection prune
|
|
35
|
+
* (`@specforge/core` apply-mutation) and the persistence prune (`@specforge/lifecycle`
|
|
36
|
+
* buildNodeVerbWriteItems). A snippet id NOT in the returned set is orphan — it was
|
|
37
|
+
* left dangling by a removed/edited step and must be pruned (row-vs-link asymmetry).
|
|
38
|
+
*/
|
|
39
|
+
export function linkedSnippetIds(ticket) {
|
|
40
|
+
const code = new Set();
|
|
41
|
+
const type = new Set();
|
|
42
|
+
const steps = (ticket.implementationSteps ?? []).filter((s) => s != null);
|
|
43
|
+
for (const step of steps) {
|
|
44
|
+
for (const id of step.linkedCodeSnippetIds ?? [])
|
|
45
|
+
code.add(id);
|
|
46
|
+
for (const id of step.linkedTypeSnippetIds ?? [])
|
|
47
|
+
type.add(id);
|
|
48
|
+
}
|
|
49
|
+
return { code, type };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* MB.42.1 — the code/type snippet ROW ids that link NO step (orphans). Built on
|
|
53
|
+
* `linkedSnippetIds` so the projection filter (keep-linked) and the persistence
|
|
54
|
+
* `relatedDelete` (delete-orphan) prune the IDENTICAL id set by construction —
|
|
55
|
+
* structural projection↔persistence parity, not three hand-rolled inline filters.
|
|
56
|
+
* Pure + id-only (never reads `content`/`language`), so it is safe over the recompose
|
|
57
|
+
* `{id,content}` shape that deliberately drops `language`.
|
|
58
|
+
*/
|
|
59
|
+
export function orphanSnippetIds(ticket) {
|
|
60
|
+
const linked = linkedSnippetIds(ticket);
|
|
61
|
+
const code = (ticket.codeSnippets ?? [])
|
|
62
|
+
.filter((c) => c != null && typeof c.id === 'string')
|
|
63
|
+
.map((c) => c.id)
|
|
64
|
+
.filter((id) => !linked.code.has(id));
|
|
65
|
+
const type = (ticket.typeSnippets ?? [])
|
|
66
|
+
.filter((c) => c != null && typeof c.id === 'string')
|
|
67
|
+
.map((c) => c.id)
|
|
68
|
+
.filter((id) => !linked.type.has(id));
|
|
69
|
+
return { code, type };
|
|
70
|
+
}
|
|
31
71
|
/**
|
|
32
72
|
* Compute the four link-coverage counters for a single ticket. Pure + deterministic;
|
|
33
73
|
* the ONLY source of the materialized numbers, shared by both write paths (projection
|
|
@@ -39,8 +79,6 @@ export function computeTicketLinkCoverage(ticket) {
|
|
|
39
79
|
return { ...ZERO_COVERAGE };
|
|
40
80
|
const steps = (ticket.implementationSteps ?? []).filter((s) => s != null);
|
|
41
81
|
const linkedFileIds = new Set();
|
|
42
|
-
const linkedCodeIds = new Set();
|
|
43
|
-
const linkedTypeIds = new Set();
|
|
44
82
|
let stepsWithLinkedFileCount = 0;
|
|
45
83
|
for (const step of steps) {
|
|
46
84
|
const files = step.linkedFileIds ?? [];
|
|
@@ -48,10 +86,6 @@ export function computeTicketLinkCoverage(ticket) {
|
|
|
48
86
|
stepsWithLinkedFileCount += 1;
|
|
49
87
|
for (const id of files)
|
|
50
88
|
linkedFileIds.add(id);
|
|
51
|
-
for (const id of step.linkedCodeSnippetIds ?? [])
|
|
52
|
-
linkedCodeIds.add(id);
|
|
53
|
-
for (const id of step.linkedTypeSnippetIds ?? [])
|
|
54
|
-
linkedTypeIds.add(id);
|
|
55
89
|
}
|
|
56
90
|
// orphan-file: produced (role `creates`/`modifies`) files linked by no step.
|
|
57
91
|
// ME.19.2 (D17) — sourced off the step-file roles, not the abolished
|
|
@@ -60,14 +94,14 @@ export function computeTicketLinkCoverage(ticket) {
|
|
|
60
94
|
(f.kind === 'creates' || f.kind === 'modifies') &&
|
|
61
95
|
typeof f.id === 'string' &&
|
|
62
96
|
!linkedFileIds.has(f.id)).length;
|
|
63
|
-
// orphan-snippet: a code/type snippet linking no step
|
|
64
|
-
|
|
65
|
-
const
|
|
97
|
+
// orphan-snippet: a code/type snippet linking no step — same single-source set the
|
|
98
|
+
// projection + persistence prune, so the count agrees with what actually survives.
|
|
99
|
+
const orphans = orphanSnippetIds(ticket);
|
|
66
100
|
return {
|
|
67
101
|
implementationStepCount: steps.length,
|
|
68
102
|
stepsWithLinkedFileCount,
|
|
69
103
|
orphanFileChangeCount,
|
|
70
|
-
orphanSnippetCount:
|
|
104
|
+
orphanSnippetCount: orphans.code.length + orphans.type.length,
|
|
71
105
|
};
|
|
72
106
|
}
|
|
73
107
|
//# sourceMappingURL=step-link-coverage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-link-coverage.js","sourceRoot":"","sources":["../../src/schema/step-link-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAwBH,MAAM,aAAa,GAAuB;IACxC,uBAAuB,EAAE,CAAC;IAC1B,wBAAwB,EAAE,CAAC;IAC3B,qBAAqB,EAAE,CAAC;IACxB,kBAAkB,EAAE,CAAC;CACtB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"step-link-coverage.js","sourceRoot":"","sources":["../../src/schema/step-link-coverage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAwBH,MAAM,aAAa,GAAuB;IACxC,uBAAuB,EAAE,CAAC;IAC1B,wBAAwB,EAAE,CAAC;IAC3B,qBAAqB,EAAE,CAAC;IACxB,kBAAkB,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA+B;IAC9D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,MAAM,CACrD,CAAC,CAAC,EAA8B,EAAE,CAAC,CAAC,IAAI,IAAI,CAC7C,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,oBAAoB,IAAI,EAAE;YAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/D,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,oBAAoB,IAAI,EAAE;YAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC;AAED;;;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,IAAI,GAAG,EAAU,CAAC;IACxC,IAAI,wBAAwB,GAAG,CAAC,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;QACvC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,wBAAwB,IAAI,CAAC,CAAC;QACpD,KAAK,MAAM,EAAE,IAAI,KAAK;YAAE,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,6EAA6E;IAC7E,qEAAqE;IACrE,gDAAgD;IAChD,MAAM,qBAAqB,GAAG,CAAC,MAAM,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM,CAChE,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,IAAI,IAAI;QACT,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;QAC/C,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;QACxB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3B,CAAC,MAAM,CAAC;IAET,mFAAmF;IACnF,mFAAmF;IACnF,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO;QACL,uBAAuB,EAAE,KAAK,CAAC,MAAM;QACrC,wBAAwB;QACxB,qBAAqB;QACrB,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM;KAC9D,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@specforge/canary-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "MCP server for SpecForge - AI agent integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"ora": "^8.2.0",
|
|
20
20
|
"zod": "^3.25.0",
|
|
21
21
|
"@specforge/api-types": "0.4.16",
|
|
22
|
-
"@specforge/report-types": "0.4.6",
|
|
23
22
|
"@specforge/session-types": "0.4.14",
|
|
24
|
-
"@specforge/
|
|
23
|
+
"@specforge/report-types": "0.4.7",
|
|
24
|
+
"@specforge/spec-types": "0.4.15"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/inquirer": "^9.0.9",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"tsx": "^4.7.0",
|
|
34
34
|
"typescript": "^5.0.0",
|
|
35
35
|
"vitest": "4.0.18",
|
|
36
|
-
"@specforge/lifecycle": "0.3.
|
|
36
|
+
"@specforge/lifecycle": "0.3.20"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=18.0.0"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@specforge/session-types",
|
|
62
62
|
"@specforge/report-types"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "31ce6344b19e843ad9a1fd67517120638b37f95a",
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsup && tsc --emitDeclarationOnly --outDir dist",
|
|
67
67
|
"typecheck": "tsc --noEmit",
|