@deftai/directive 0.61.2 → 0.63.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.
Files changed (102) hide show
  1. package/dist/{branch-parity.d.ts → branch-fixtures.d.ts} +1 -3
  2. package/dist/{branch-parity.js → branch-fixtures.js} +3 -110
  3. package/dist/dispatch.d.ts +1 -1
  4. package/dist/dispatch.js +4 -1
  5. package/dist/framework-check-updates.d.ts +10 -0
  6. package/dist/framework-check-updates.js +68 -0
  7. package/dist/install-cli/coverage-map.js +3 -2
  8. package/dist/orchestration-cli/coverage-map.js +1 -1
  9. package/dist/{policy-parity.d.ts → policy-fixtures.d.ts} +1 -3
  10. package/dist/{policy-parity.js → policy-fixtures.js} +4 -100
  11. package/dist/{release-e2e-parity.d.ts → release-e2e-fixtures.d.ts} +1 -3
  12. package/dist/release-e2e-fixtures.js +38 -0
  13. package/dist/{story-ready-parity.d.ts → story-ready-fixtures.d.ts} +1 -3
  14. package/dist/{story-ready-parity.js → story-ready-fixtures.js} +4 -121
  15. package/dist/{triage-aux-a-parity.d.ts → triage-aux-a-fixtures.d.ts} +1 -3
  16. package/dist/{triage-aux-a-parity.js → triage-aux-a-fixtures.js} +3 -73
  17. package/dist/{triage-aux-b-parity.d.ts → triage-aux-b-fixtures.d.ts} +1 -3
  18. package/dist/triage-aux-b-fixtures.js +167 -0
  19. package/dist/{triage-bootstrap-parity.d.ts → triage-bootstrap-fixtures.d.ts} +1 -3
  20. package/dist/{triage-bootstrap-parity.js → triage-bootstrap-fixtures.js} +4 -91
  21. package/dist/{triage-classify-parity.d.ts → triage-classify-fixtures.d.ts} +1 -3
  22. package/dist/{triage-classify-parity.js → triage-classify-fixtures.js} +4 -94
  23. package/dist/{triage-queue-parity.d.ts → triage-queue-fixtures.d.ts} +1 -3
  24. package/dist/{triage-queue-parity.js → triage-queue-fixtures.js} +4 -86
  25. package/dist/{triage-scope-parity.d.ts → triage-scope-fixtures.d.ts} +1 -3
  26. package/dist/{triage-scope-parity.js → triage-scope-fixtures.js} +4 -91
  27. package/dist/umbrella-current-shape.d.ts +9 -0
  28. package/dist/umbrella-current-shape.js +56 -0
  29. package/dist/{vbrief-preflight-parity.d.ts → vbrief-preflight-fixtures.d.ts} +1 -3
  30. package/dist/vbrief-preflight-fixtures.js +79 -0
  31. package/dist/{wip-cap-parity.d.ts → wip-cap-fixtures.d.ts} +1 -3
  32. package/dist/{wip-cap-parity.js → wip-cap-fixtures.js} +4 -91
  33. package/package.json +4 -15
  34. package/dist/cache-parity.d.ts +0 -36
  35. package/dist/cache-parity.js +0 -165
  36. package/dist/codebase-parity.d.ts +0 -31
  37. package/dist/codebase-parity.js +0 -303
  38. package/dist/doc-cli-parity.d.ts +0 -29
  39. package/dist/doc-cli-parity.js +0 -159
  40. package/dist/doctor-parity.d.ts +0 -42
  41. package/dist/doctor-parity.js +0 -157
  42. package/dist/intake-parity.d.ts +0 -30
  43. package/dist/intake-parity.js +0 -203
  44. package/dist/lifecycle-packs-parity.d.ts +0 -30
  45. package/dist/lifecycle-packs-parity.js +0 -377
  46. package/dist/orchestration-parity.d.ts +0 -38
  47. package/dist/orchestration-parity.js +0 -364
  48. package/dist/parity.d.ts +0 -36
  49. package/dist/parity.js +0 -176
  50. package/dist/platform-parity.d.ts +0 -26
  51. package/dist/platform-parity.js +0 -309
  52. package/dist/pr-closing-keywords-parity.d.ts +0 -45
  53. package/dist/pr-closing-keywords-parity.js +0 -259
  54. package/dist/pr-merge-readiness-parity.d.ts +0 -44
  55. package/dist/pr-merge-readiness-parity.js +0 -296
  56. package/dist/pr-monitor-parity.d.ts +0 -44
  57. package/dist/pr-monitor-parity.js +0 -283
  58. package/dist/pr-protected-issues-parity.d.ts +0 -41
  59. package/dist/pr-protected-issues-parity.js +0 -220
  60. package/dist/pr-wait-mergeable-parity.d.ts +0 -45
  61. package/dist/pr-wait-mergeable-parity.js +0 -340
  62. package/dist/release-e2e-parity.js +0 -114
  63. package/dist/release-parity.d.ts +0 -40
  64. package/dist/release-parity.js +0 -226
  65. package/dist/release-publish-parity.d.ts +0 -36
  66. package/dist/release-publish-parity.js +0 -138
  67. package/dist/release-rollback-parity.d.ts +0 -37
  68. package/dist/release-rollback-parity.js +0 -161
  69. package/dist/render-parity.d.ts +0 -36
  70. package/dist/render-parity.js +0 -385
  71. package/dist/scm-parity.d.ts +0 -39
  72. package/dist/scm-parity.js +0 -181
  73. package/dist/scope-lifecycle-parity.d.ts +0 -35
  74. package/dist/scope-lifecycle-parity.js +0 -177
  75. package/dist/session-parity.d.ts +0 -39
  76. package/dist/session-parity.js +0 -262
  77. package/dist/slice-parity.d.ts +0 -36
  78. package/dist/slice-parity.js +0 -304
  79. package/dist/swarm-parity.d.ts +0 -28
  80. package/dist/swarm-parity.js +0 -327
  81. package/dist/triage-actions-parity.d.ts +0 -36
  82. package/dist/triage-actions-parity.js +0 -357
  83. package/dist/triage-aux-b-parity.js +0 -308
  84. package/dist/triage-summary-parity.d.ts +0 -50
  85. package/dist/triage-summary-parity.js +0 -306
  86. package/dist/validate-content-parity.d.ts +0 -33
  87. package/dist/validate-content-parity.js +0 -356
  88. package/dist/vbrief-activate-parity.d.ts +0 -39
  89. package/dist/vbrief-activate-parity.js +0 -216
  90. package/dist/vbrief-build-parity.d.ts +0 -28
  91. package/dist/vbrief-build-parity.js +0 -399
  92. package/dist/vbrief-preflight-parity.js +0 -163
  93. package/dist/vbrief-reconcile-parity.d.ts +0 -23
  94. package/dist/vbrief-reconcile-parity.js +0 -609
  95. package/dist/vbrief-validate-parity.d.ts +0 -27
  96. package/dist/vbrief-validate-parity.js +0 -122
  97. package/dist/vbrief-validation-parity.d.ts +0 -28
  98. package/dist/vbrief-validation-parity.js +0 -645
  99. package/dist/verify-env-parity.d.ts +0 -28
  100. package/dist/verify-env-parity.js +0 -272
  101. package/dist/verify-source-parity.d.ts +0 -26
  102. package/dist/verify-source-parity.js +0 -178
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- export interface CommandCapture {
3
- readonly exitCode: number;
4
- readonly stdout: string;
5
- readonly stderr: string;
6
- }
7
- export interface SliceFixtureOptions {
8
- readonly seedRecords?: ReadonlyArray<Record<string, unknown>>;
9
- }
10
- export interface ParityCase {
11
- readonly name: string;
12
- readonly argv: string[];
13
- readonly fixture?: SliceFixtureOptions;
14
- }
15
- export interface ParityDiff {
16
- readonly caseName: string;
17
- readonly exitMismatch: boolean;
18
- readonly stdoutMismatch: boolean;
19
- readonly stderrMismatch: boolean;
20
- readonly pythonExit: number;
21
- readonly tsExit: number;
22
- }
23
- export interface ParityResult {
24
- readonly ok: boolean;
25
- readonly diffs: ParityDiff[];
26
- }
27
- /** Strip volatile absolute paths, UUIDs, and timestamps before compare. */
28
- export declare function normalizeOutput(text: string): string;
29
- export declare function buildFixtureRepo(options?: SliceFixtureOptions): string;
30
- /** Diff one parity case between Python oracle and TS CLI. */
31
- export declare function diffCase(python: CommandCapture, ts: CommandCapture, caseName: string): ParityDiff;
32
- export declare const PARITY_CASES: readonly ParityCase[];
33
- /** Run all parity cases; returns aggregate result. */
34
- export declare function runParity(): ParityResult;
35
- export declare function renderReport(result: ParityResult): string;
36
- //# sourceMappingURL=slice-parity.d.ts.map
@@ -1,304 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Golden-output parity harness (#1727): runs BOTH the Python oracle
4
- * (`scripts/slice_record_existing.py`) and the ported TS slice CLI with
5
- * identical argv on throwaway fixtures, then diffs exit codes and
6
- * normalised stdout/stderr (cache-off).
7
- *
8
- * Exit codes: 0 parity / 1 divergence / 2 harness setup error.
9
- */
10
- import { spawnSync } from "node:child_process";
11
- import { appendFileSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
12
- import { tmpdir } from "node:os";
13
- import { dirname, join, resolve } from "node:path";
14
- import { fileURLToPath } from "node:url";
15
- function sortKeysDeep(value) {
16
- if (Array.isArray(value)) {
17
- return value.map((item) => sortKeysDeep(item));
18
- }
19
- if (value !== null && typeof value === "object") {
20
- const obj = value;
21
- const sorted = {};
22
- for (const key of Object.keys(obj).sort()) {
23
- sorted[key] = sortKeysDeep(obj[key]);
24
- }
25
- return sorted;
26
- }
27
- return value;
28
- }
29
- function seedJsonLine(record) {
30
- return JSON.stringify(sortKeysDeep(record)).replace(/("(?:[^"\\]|\\.)*")|([:,])/g, (_match, str, sep) => str !== undefined ? str : sep === ":" ? ": " : ", ");
31
- }
32
- /** Strip volatile absolute paths, UUIDs, and timestamps before compare. */
33
- export function normalizeOutput(text) {
34
- return text
35
- .replace(/--project-root [^\s]+/g, "--project-root <ROOT>")
36
- .replace(/slice_id=[0-9a-fA-F-]{36}/g, "slice_id=<UUID>")
37
- .replace(/slice_id=[0-9a-fA-F-]{36}/g, "slice_id=<UUID>")
38
- .replace(/"slice_id": "[0-9a-fA-F-]{36}"/g, '"slice_id": "<UUID>"')
39
- .replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g, "<ISO>");
40
- }
41
- function runCapture(cmd, args, cwd) {
42
- const result = spawnSync(cmd, args, {
43
- cwd,
44
- encoding: "utf8",
45
- env: process.env,
46
- stdio: ["ignore", "pipe", "pipe"],
47
- });
48
- return {
49
- exitCode: result.status ?? 2,
50
- stdout: typeof result.stdout === "string" ? result.stdout : "",
51
- stderr: typeof result.stderr === "string" ? result.stderr : "",
52
- };
53
- }
54
- export function buildFixtureRepo(options = {}) {
55
- const root = mkdtempSync(join(tmpdir(), "deft-slice-parity-"));
56
- mkdirSync(join(root, "vbrief", ".eval"), { recursive: true });
57
- mkdirSync(join(root, ".git"));
58
- const logPath = join(root, "vbrief", ".eval", "slices.jsonl");
59
- for (const record of options.seedRecords ?? []) {
60
- appendFileSync(logPath, `${seedJsonLine(record)}\n`, "utf8");
61
- }
62
- return root;
63
- }
64
- function resolveDeftRoot() {
65
- if (process.env.DEFT_ROOT !== undefined && process.env.DEFT_ROOT.length > 0) {
66
- return resolve(process.env.DEFT_ROOT);
67
- }
68
- return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
69
- }
70
- function runPythonSlice(deftRoot, repo, argv) {
71
- return runCapture("uv", [
72
- "run",
73
- "python",
74
- join(deftRoot, "scripts", "slice_record_existing.py"),
75
- ...argv,
76
- "--project-root",
77
- repo,
78
- ], deftRoot);
79
- }
80
- function runTsSlice(deftRoot, repo, argv) {
81
- return runCapture("node", [
82
- join(deftRoot, "packages", "core", "dist", "slice", "cli.js"),
83
- ...argv,
84
- "--project-root",
85
- repo,
86
- ], deftRoot);
87
- }
88
- /** Diff one parity case between Python oracle and TS CLI. */
89
- export function diffCase(python, ts, caseName) {
90
- const pyOut = normalizeOutput(python.stdout);
91
- const tsOut = normalizeOutput(ts.stdout);
92
- const pyErr = normalizeOutput(python.stderr);
93
- const tsErr = normalizeOutput(ts.stderr);
94
- return {
95
- caseName,
96
- exitMismatch: python.exitCode !== ts.exitCode,
97
- stdoutMismatch: pyOut !== tsOut,
98
- stderrMismatch: pyErr !== tsErr,
99
- pythonExit: python.exitCode,
100
- tsExit: ts.exitCode,
101
- };
102
- }
103
- export const PARITY_CASES = [
104
- { name: "list-empty", argv: ["list"] },
105
- {
106
- name: "list-seeded",
107
- argv: ["list"],
108
- fixture: {
109
- seedRecords: [
110
- {
111
- slice_id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
112
- umbrella: 10,
113
- umbrella_url: "https://github.com/owner/repo/issues/10",
114
- sliced_at: "2026-05-14T17:00:00Z",
115
- actor: "manual:operator",
116
- children: [
117
- { n: 11, url: "https://github.com/owner/repo/issues/11", wave: 1, role: "manual" },
118
- ],
119
- expected_close_signal: "all-children-merged",
120
- },
121
- ],
122
- },
123
- },
124
- {
125
- name: "list-json-seeded",
126
- argv: ["list", "--json"],
127
- fixture: {
128
- seedRecords: [
129
- {
130
- slice_id: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
131
- umbrella: 10,
132
- umbrella_url: "https://github.com/owner/repo/issues/10",
133
- sliced_at: "2026-05-14T17:00:00Z",
134
- actor: "manual:operator",
135
- children: [
136
- { n: 11, url: "https://github.com/owner/repo/issues/11", wave: 1, role: "manual" },
137
- ],
138
- expected_close_signal: "all-children-merged",
139
- },
140
- ],
141
- },
142
- },
143
- {
144
- name: "record-existing-skip-validation",
145
- argv: [
146
- "record-existing",
147
- "--umbrella=1",
148
- "--children=2,3",
149
- "--repo=owner/repo",
150
- "--skip-validation",
151
- "--sliced-at=2026-05-14T17:00:00Z",
152
- ],
153
- },
154
- {
155
- name: "record-existing-idempotent",
156
- argv: [
157
- "record-existing",
158
- "--umbrella=1",
159
- "--children=2,3",
160
- "--repo=owner/repo",
161
- "--skip-validation",
162
- "--sliced-at=2026-05-14T17:00:00Z",
163
- ],
164
- fixture: {
165
- seedRecords: [
166
- {
167
- slice_id: "bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee",
168
- umbrella: 1,
169
- umbrella_url: "https://github.com/owner/repo/issues/1",
170
- sliced_at: "2026-05-14T17:00:00Z",
171
- actor: "manual:operator",
172
- children: [
173
- { n: 2, url: "https://github.com/owner/repo/issues/2", wave: 1, role: "manual" },
174
- { n: 3, url: "https://github.com/owner/repo/issues/3", wave: 1, role: "manual" },
175
- ],
176
- expected_close_signal: "all-children-merged",
177
- },
178
- ],
179
- },
180
- },
181
- {
182
- name: "record-existing-dry-run",
183
- argv: [
184
- "record-existing",
185
- "--umbrella=42",
186
- "--children=100,101",
187
- "--repo=owner/repo",
188
- "--dry-run",
189
- "--skip-validation",
190
- "--sliced-at=2026-05-14T17:00:00Z",
191
- ],
192
- },
193
- {
194
- name: "duplicate-child",
195
- argv: [
196
- "record-existing",
197
- "--umbrella=1",
198
- "--children=2,2",
199
- "--repo=owner/repo",
200
- "--skip-validation",
201
- ],
202
- },
203
- {
204
- name: "umbrella-in-children",
205
- argv: [
206
- "record-existing",
207
- "--umbrella=1",
208
- "--children=1,2",
209
- "--repo=owner/repo",
210
- "--skip-validation",
211
- ],
212
- },
213
- {
214
- name: "wave-member-not-in-children",
215
- argv: [
216
- "record-existing",
217
- "--umbrella=1",
218
- "--children=2,3",
219
- "--wave-2=999",
220
- "--repo=owner/repo",
221
- "--skip-validation",
222
- ],
223
- },
224
- {
225
- name: "cross-wave-collision",
226
- argv: [
227
- "record-existing",
228
- "--umbrella=1",
229
- "--children=2,3",
230
- "--wave-1=2",
231
- "--wave-2=2",
232
- "--repo=owner/repo",
233
- "--skip-validation",
234
- ],
235
- },
236
- {
237
- name: "default-subcommand",
238
- argv: [
239
- "--umbrella=1",
240
- "--children=2",
241
- "--repo=owner/repo",
242
- "--skip-validation",
243
- "--sliced-at=2026-05-14T17:00:00Z",
244
- ],
245
- },
246
- {
247
- name: "missing-project-root",
248
- argv: ["list", "--project-root", "/no/such/deft-project-root-xyz"],
249
- },
250
- ];
251
- /** Run all parity cases; returns aggregate result. */
252
- export function runParity() {
253
- const deftRoot = resolveDeftRoot();
254
- const diffs = [];
255
- for (const testCase of PARITY_CASES) {
256
- const pyRepo = buildFixtureRepo(testCase.fixture);
257
- const tsRepo = buildFixtureRepo(testCase.fixture);
258
- try {
259
- const python = runPythonSlice(deftRoot, pyRepo, testCase.argv);
260
- const ts = runTsSlice(deftRoot, tsRepo, testCase.argv);
261
- diffs.push(diffCase(python, ts, testCase.name));
262
- }
263
- finally {
264
- rmSync(pyRepo, { recursive: true, force: true });
265
- rmSync(tsRepo, { recursive: true, force: true });
266
- }
267
- }
268
- const ok = diffs.every((d) => !d.exitMismatch && !d.stdoutMismatch && !d.stderrMismatch);
269
- return { ok, diffs };
270
- }
271
- export function renderReport(result) {
272
- if (result.ok) {
273
- return `slice parity: CLEAN -- Python and TS agree on ${PARITY_CASES.length} case(s).`;
274
- }
275
- const lines = ["slice parity: DIVERGENCE"];
276
- for (const d of result.diffs) {
277
- if (d.exitMismatch || d.stdoutMismatch || d.stderrMismatch) {
278
- lines.push(` case: ${d.caseName}`);
279
- if (d.exitMismatch)
280
- lines.push(` exit: python=${d.pythonExit} ts=${d.tsExit}`);
281
- if (d.stdoutMismatch)
282
- lines.push(" stdout mismatch");
283
- if (d.stderrMismatch)
284
- lines.push(" stderr mismatch");
285
- }
286
- }
287
- return lines.join("\n");
288
- }
289
- if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
290
- try {
291
- const result = runParity();
292
- if (result.ok) {
293
- process.stdout.write(`${renderReport(result)}\n`);
294
- process.exit(0);
295
- }
296
- process.stderr.write(`${renderReport(result)}\n`);
297
- process.exit(1);
298
- }
299
- catch (err) {
300
- process.stderr.write(`slice parity: harness error -- ${String(err)}\n`);
301
- process.exit(2);
302
- }
303
- }
304
- //# sourceMappingURL=slice-parity.js.map
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- export interface Capture {
3
- exitCode: number;
4
- stdout: string;
5
- stderr: string;
6
- }
7
- export interface ParityCase {
8
- name: string;
9
- run: (deftRoot: string) => {
10
- python: Capture;
11
- ts: Capture;
12
- };
13
- }
14
- export declare function normalizeOutput(text: string): string;
15
- export declare const PARITY_CASES: readonly ParityCase[];
16
- export declare function diffCase(name: string, python: Capture, ts: Capture): {
17
- name: string;
18
- ok: boolean;
19
- exitMismatch: boolean;
20
- stdoutMismatch: boolean;
21
- stderrMismatch: boolean;
22
- };
23
- export declare function runParity(): {
24
- ok: boolean;
25
- cases: ReturnType<typeof diffCase>[];
26
- };
27
- export declare function runParityCli(): number;
28
- //# sourceMappingURL=swarm-parity.d.ts.map