@deftai/directive 0.62.0 → 0.64.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 (99) 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 +3 -1
  5. package/dist/orchestration-cli/coverage-map.js +1 -1
  6. package/dist/{policy-parity.d.ts → policy-fixtures.d.ts} +1 -3
  7. package/dist/{policy-parity.js → policy-fixtures.js} +4 -100
  8. package/dist/{release-e2e-parity.d.ts → release-e2e-fixtures.d.ts} +1 -3
  9. package/dist/release-e2e-fixtures.js +38 -0
  10. package/dist/{story-ready-parity.d.ts → story-ready-fixtures.d.ts} +1 -3
  11. package/dist/{story-ready-parity.js → story-ready-fixtures.js} +4 -121
  12. package/dist/{triage-aux-a-parity.d.ts → triage-aux-a-fixtures.d.ts} +1 -3
  13. package/dist/{triage-aux-a-parity.js → triage-aux-a-fixtures.js} +3 -73
  14. package/dist/{triage-aux-b-parity.d.ts → triage-aux-b-fixtures.d.ts} +1 -3
  15. package/dist/triage-aux-b-fixtures.js +167 -0
  16. package/dist/{triage-bootstrap-parity.d.ts → triage-bootstrap-fixtures.d.ts} +1 -3
  17. package/dist/{triage-bootstrap-parity.js → triage-bootstrap-fixtures.js} +4 -91
  18. package/dist/{triage-classify-parity.d.ts → triage-classify-fixtures.d.ts} +1 -3
  19. package/dist/{triage-classify-parity.js → triage-classify-fixtures.js} +4 -94
  20. package/dist/{triage-queue-parity.d.ts → triage-queue-fixtures.d.ts} +1 -3
  21. package/dist/{triage-queue-parity.js → triage-queue-fixtures.js} +4 -86
  22. package/dist/{triage-scope-parity.d.ts → triage-scope-fixtures.d.ts} +1 -3
  23. package/dist/{triage-scope-parity.js → triage-scope-fixtures.js} +4 -91
  24. package/dist/{vbrief-preflight-parity.d.ts → vbrief-preflight-fixtures.d.ts} +1 -3
  25. package/dist/vbrief-preflight-fixtures.js +79 -0
  26. package/dist/verify-source-cli/verify-cursor-tier1.d.ts +12 -0
  27. package/dist/verify-source-cli/verify-cursor-tier1.js +51 -0
  28. package/dist/{wip-cap-parity.d.ts → wip-cap-fixtures.d.ts} +1 -3
  29. package/dist/{wip-cap-parity.js → wip-cap-fixtures.js} +4 -91
  30. package/package.json +4 -15
  31. package/dist/cache-parity.d.ts +0 -36
  32. package/dist/cache-parity.js +0 -165
  33. package/dist/codebase-parity.d.ts +0 -31
  34. package/dist/codebase-parity.js +0 -303
  35. package/dist/doc-cli-parity.d.ts +0 -29
  36. package/dist/doc-cli-parity.js +0 -159
  37. package/dist/doctor-parity.d.ts +0 -42
  38. package/dist/doctor-parity.js +0 -157
  39. package/dist/intake-parity.d.ts +0 -30
  40. package/dist/intake-parity.js +0 -203
  41. package/dist/lifecycle-packs-parity.d.ts +0 -30
  42. package/dist/lifecycle-packs-parity.js +0 -377
  43. package/dist/orchestration-parity.d.ts +0 -38
  44. package/dist/orchestration-parity.js +0 -364
  45. package/dist/parity.d.ts +0 -36
  46. package/dist/parity.js +0 -176
  47. package/dist/platform-parity.d.ts +0 -26
  48. package/dist/platform-parity.js +0 -309
  49. package/dist/pr-closing-keywords-parity.d.ts +0 -45
  50. package/dist/pr-closing-keywords-parity.js +0 -259
  51. package/dist/pr-merge-readiness-parity.d.ts +0 -44
  52. package/dist/pr-merge-readiness-parity.js +0 -296
  53. package/dist/pr-monitor-parity.d.ts +0 -44
  54. package/dist/pr-monitor-parity.js +0 -283
  55. package/dist/pr-protected-issues-parity.d.ts +0 -41
  56. package/dist/pr-protected-issues-parity.js +0 -220
  57. package/dist/pr-wait-mergeable-parity.d.ts +0 -45
  58. package/dist/pr-wait-mergeable-parity.js +0 -340
  59. package/dist/release-e2e-parity.js +0 -114
  60. package/dist/release-parity.d.ts +0 -40
  61. package/dist/release-parity.js +0 -226
  62. package/dist/release-publish-parity.d.ts +0 -36
  63. package/dist/release-publish-parity.js +0 -138
  64. package/dist/release-rollback-parity.d.ts +0 -37
  65. package/dist/release-rollback-parity.js +0 -161
  66. package/dist/render-parity.d.ts +0 -36
  67. package/dist/render-parity.js +0 -385
  68. package/dist/scm-parity.d.ts +0 -39
  69. package/dist/scm-parity.js +0 -181
  70. package/dist/scope-lifecycle-parity.d.ts +0 -35
  71. package/dist/scope-lifecycle-parity.js +0 -177
  72. package/dist/session-parity.d.ts +0 -39
  73. package/dist/session-parity.js +0 -262
  74. package/dist/slice-parity.d.ts +0 -36
  75. package/dist/slice-parity.js +0 -304
  76. package/dist/swarm-parity.d.ts +0 -28
  77. package/dist/swarm-parity.js +0 -327
  78. package/dist/triage-actions-parity.d.ts +0 -36
  79. package/dist/triage-actions-parity.js +0 -357
  80. package/dist/triage-aux-b-parity.js +0 -308
  81. package/dist/triage-summary-parity.d.ts +0 -50
  82. package/dist/triage-summary-parity.js +0 -306
  83. package/dist/validate-content-parity.d.ts +0 -33
  84. package/dist/validate-content-parity.js +0 -356
  85. package/dist/vbrief-activate-parity.d.ts +0 -39
  86. package/dist/vbrief-activate-parity.js +0 -216
  87. package/dist/vbrief-build-parity.d.ts +0 -28
  88. package/dist/vbrief-build-parity.js +0 -399
  89. package/dist/vbrief-preflight-parity.js +0 -163
  90. package/dist/vbrief-reconcile-parity.d.ts +0 -23
  91. package/dist/vbrief-reconcile-parity.js +0 -609
  92. package/dist/vbrief-validate-parity.d.ts +0 -27
  93. package/dist/vbrief-validate-parity.js +0 -122
  94. package/dist/vbrief-validation-parity.d.ts +0 -28
  95. package/dist/vbrief-validation-parity.js +0 -645
  96. package/dist/verify-env-parity.d.ts +0 -28
  97. package/dist/verify-env-parity.js +0 -272
  98. package/dist/verify-source-parity.d.ts +0 -26
  99. package/dist/verify-source-parity.js +0 -178
@@ -1,50 +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 SummaryFixtureOptions {
8
- readonly wipCap?: number;
9
- readonly triageScope?: Record<string, unknown>[] | null;
10
- readonly cachedIssues?: ReadonlyArray<{
11
- repo: string;
12
- number: number;
13
- }>;
14
- readonly auditEntries?: Record<string, unknown>[];
15
- readonly pendingVbriefs?: number;
16
- readonly activeVbriefs?: ReadonlyArray<{
17
- name: string;
18
- status?: string;
19
- }>;
20
- }
21
- export interface ParityCase {
22
- readonly name: string;
23
- readonly argv: string[];
24
- readonly fixture?: SummaryFixtureOptions;
25
- }
26
- export interface ParityDiff {
27
- readonly caseName: string;
28
- readonly exitMismatch: boolean;
29
- readonly stdoutMismatch: boolean;
30
- readonly stderrMismatch: boolean;
31
- readonly pythonExit: number;
32
- readonly tsExit: number;
33
- readonly pythonStdout: string;
34
- readonly tsStdout: string;
35
- }
36
- export interface ParityResult {
37
- readonly ok: boolean;
38
- readonly diffs: ParityDiff[];
39
- }
40
- /** Strip volatile fields before compare. */
41
- export declare function normalizeOutput(text: string): string;
42
- /** Build a throwaway project root with optional cache / audit / vBRIEF state. */
43
- export declare function buildFixtureRepo(options?: SummaryFixtureOptions): string;
44
- /** Diff one parity case between Python oracle and TS CLI. */
45
- export declare function diffCase(python: CommandCapture, ts: CommandCapture, caseName: string): ParityDiff;
46
- export declare const PARITY_CASES: readonly ParityCase[];
47
- /** Run all parity cases; returns aggregate result. */
48
- export declare function runParity(): ParityResult;
49
- export declare function renderReport(result: ParityResult): string;
50
- //# sourceMappingURL=triage-summary-parity.d.ts.map
@@ -1,306 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Golden-output parity harness (#1725): builds throwaway fixture repos, runs
4
- * BOTH the Python oracle (`scripts/triage_summary.py`) and the ported TS
5
- * triage:summary CLI, and diffs stdout (cache-off).
6
- *
7
- * Exit codes: 0 parity / 1 divergence / 2 harness setup error.
8
- */
9
- import { spawnSync } from "node:child_process";
10
- import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
11
- import { tmpdir } from "node:os";
12
- import { dirname, join, resolve } from "node:path";
13
- import { fileURLToPath } from "node:url";
14
- /** Strip volatile fields before compare. */
15
- export function normalizeOutput(text) {
16
- return text
17
- .replace(/\r\n/g, "\n")
18
- .replace(/"emitted_at": "[^"]+"/g, '"emitted_at": "<TS>"')
19
- .trimEnd();
20
- }
21
- function runCapture(cmd, args, cwd, env = {}) {
22
- const merged = { ...process.env, ...env };
23
- for (const key of Object.keys(merged)) {
24
- if (merged[key] === undefined)
25
- delete merged[key];
26
- }
27
- const result = spawnSync(cmd, args, {
28
- cwd,
29
- encoding: "utf8",
30
- env: merged,
31
- stdio: ["ignore", "pipe", "pipe"],
32
- });
33
- return {
34
- status: result.status ?? 2,
35
- stdout: typeof result.stdout === "string" ? result.stdout : "",
36
- stderr: typeof result.stderr === "string" ? result.stderr : "",
37
- };
38
- }
39
- function writeProjectDefinition(root, options) {
40
- const dir = join(root, "vbrief");
41
- mkdirSync(dir, { recursive: true });
42
- const policy = {};
43
- if (options.wipCap !== undefined) {
44
- policy.wipCap = options.wipCap;
45
- }
46
- if (options.triageScope !== undefined && options.triageScope !== null) {
47
- policy.triageScope = options.triageScope;
48
- }
49
- writeFileSync(join(dir, "PROJECT-DEFINITION.vbrief.json"), `${JSON.stringify({
50
- vBRIEFInfo: { version: "0.6" },
51
- plan: { title: "T", status: "running", items: [], policy },
52
- }, null, 2)}\n`, { encoding: "utf8" });
53
- }
54
- function makeCachedIssue(cacheRoot, repo, number) {
55
- const [owner, name] = repo.split("/", 2);
56
- const entry = join(cacheRoot, "github-issue", owner ?? "", name ?? "", String(number));
57
- mkdirSync(entry, { recursive: true });
58
- writeFileSync(join(entry, "meta.json"), "{}\n", { encoding: "utf8" });
59
- writeFileSync(join(entry, "raw.json"), "{}\n", { encoding: "utf8" });
60
- }
61
- function writeAuditLog(root, entries) {
62
- const logDir = join(root, "vbrief", ".eval");
63
- mkdirSync(logDir, { recursive: true });
64
- const lines = entries.map((e) => JSON.stringify(e, Object.keys(e).sort())).join("\n");
65
- writeFileSync(join(logDir, "candidates.jsonl"), lines.length > 0 ? `${lines}\n` : "", {
66
- encoding: "utf8",
67
- });
68
- }
69
- function writeActiveVbrief(root, name, status) {
70
- const dir = join(root, "vbrief", "active");
71
- mkdirSync(dir, { recursive: true });
72
- writeFileSync(join(dir, `${name}.vbrief.json`), `${JSON.stringify({
73
- vBRIEFInfo: { version: "0.6" },
74
- plan: { status, title: name },
75
- })}\n`, { encoding: "utf8" });
76
- }
77
- function writePendingVbriefs(root, count) {
78
- const dir = join(root, "vbrief", "pending");
79
- mkdirSync(dir, { recursive: true });
80
- for (let i = 0; i < count; i += 1) {
81
- writeFileSync(join(dir, `pending-${i}.vbrief.json`), `${JSON.stringify({ vBRIEFInfo: { version: "0.6" }, plan: { status: "approved" } })}\n`, { encoding: "utf8" });
82
- }
83
- }
84
- /** Build a throwaway project root with optional cache / audit / vBRIEF state. */
85
- export function buildFixtureRepo(options = {}) {
86
- const root = mkdtempSync(join(tmpdir(), "deft-triage-summary-parity-"));
87
- mkdirSync(join(root, "vbrief"), { recursive: true });
88
- if (options.wipCap !== undefined || options.triageScope !== undefined) {
89
- writeProjectDefinition(root, {
90
- wipCap: options.wipCap,
91
- triageScope: options.triageScope,
92
- });
93
- }
94
- const cacheRoot = join(root, ".deft-cache");
95
- for (const issue of options.cachedIssues ?? []) {
96
- makeCachedIssue(cacheRoot, issue.repo, issue.number);
97
- }
98
- if (options.auditEntries !== undefined && options.auditEntries.length > 0) {
99
- writeAuditLog(root, options.auditEntries);
100
- }
101
- if (options.pendingVbriefs !== undefined && options.pendingVbriefs > 0) {
102
- writePendingVbriefs(root, options.pendingVbriefs);
103
- }
104
- for (const vb of options.activeVbriefs ?? []) {
105
- writeActiveVbrief(root, vb.name, vb.status ?? "running");
106
- }
107
- return root;
108
- }
109
- function resolveDeftRoot() {
110
- if (process.env.DEFT_ROOT !== undefined && process.env.DEFT_ROOT.length > 0) {
111
- return resolve(process.env.DEFT_ROOT);
112
- }
113
- return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
114
- }
115
- function runPythonSummary(deftRoot, repo, argv) {
116
- const cap = runCapture("uv", [
117
- "run",
118
- "python",
119
- join(deftRoot, "scripts", "triage_summary.py"),
120
- ...argv,
121
- "--project-root",
122
- repo,
123
- "--no-history",
124
- ], deftRoot);
125
- return { exitCode: cap.status, stdout: cap.stdout, stderr: cap.stderr };
126
- }
127
- function runTsSummary(deftRoot, repo, argv) {
128
- const cap = runCapture("node", [
129
- join(deftRoot, "packages", "cli", "dist", "triage-summary.js"),
130
- ...argv,
131
- "--project-root",
132
- repo,
133
- "--no-history",
134
- ], deftRoot);
135
- return { exitCode: cap.status, stdout: cap.stdout, stderr: cap.stderr };
136
- }
137
- /** Diff one parity case between Python oracle and TS CLI. */
138
- export function diffCase(python, ts, caseName) {
139
- const pyOut = normalizeOutput(python.stdout);
140
- const tsOut = normalizeOutput(ts.stdout);
141
- const pyErr = normalizeOutput(python.stderr);
142
- const tsErr = normalizeOutput(ts.stderr);
143
- return {
144
- caseName,
145
- exitMismatch: python.exitCode !== ts.exitCode,
146
- stdoutMismatch: pyOut !== tsOut,
147
- stderrMismatch: pyErr !== tsErr,
148
- pythonExit: python.exitCode,
149
- tsExit: ts.exitCode,
150
- pythonStdout: pyOut,
151
- tsStdout: tsOut,
152
- };
153
- }
154
- const auditEntry = (repo, issueNumber, decision, decisionId) => ({
155
- actor: "agent:test",
156
- decision,
157
- decision_id: decisionId,
158
- issue_number: issueNumber,
159
- repo,
160
- timestamp: "2026-05-17T20:00:00Z",
161
- });
162
- export const PARITY_CASES = [
163
- {
164
- name: "empty-cache",
165
- argv: [],
166
- fixture: {},
167
- },
168
- {
169
- name: "populated-zero-wip",
170
- argv: [],
171
- fixture: {
172
- cachedIssues: [
173
- { repo: "deftai/directive", number: 100 },
174
- { repo: "deftai/directive", number: 101 },
175
- { repo: "deftai/directive", number: 102 },
176
- ],
177
- auditEntries: [
178
- auditEntry("deftai/directive", 100, "accept", "11111111-1111-1111-1111-111111111101"),
179
- auditEntry("deftai/directive", 101, "accept", "11111111-1111-1111-1111-111111111102"),
180
- ],
181
- },
182
- },
183
- {
184
- name: "zero-untriaged-still-prints",
185
- argv: [],
186
- fixture: {
187
- cachedIssues: [{ repo: "deftai/directive", number: 200 }],
188
- auditEntries: [
189
- auditEntry("deftai/directive", 200, "accept", "22222222-2222-2222-2222-222222222200"),
190
- ],
191
- },
192
- },
193
- {
194
- name: "wip-at-cap-warning",
195
- argv: [],
196
- fixture: {
197
- wipCap: 12,
198
- cachedIssues: [{ repo: "deftai/directive", number: 500 }],
199
- pendingVbriefs: 12,
200
- },
201
- },
202
- {
203
- name: "wip-above-cap-warning",
204
- argv: [],
205
- fixture: {
206
- wipCap: 5,
207
- cachedIssues: [{ repo: "deftai/directive", number: 501 }],
208
- activeVbriefs: Array.from({ length: 7 }, (_, i) => ({ name: `active-${i}` })),
209
- },
210
- },
211
- {
212
- name: "filesystem-in-flight-divergence",
213
- argv: [],
214
- fixture: {
215
- cachedIssues: [
216
- { repo: "deftai/directive", number: 600 },
217
- { repo: "deftai/directive", number: 601 },
218
- { repo: "deftai/directive", number: 602 },
219
- ],
220
- auditEntries: [
221
- auditEntry("deftai/directive", 600, "accept", "66666666-6666-6666-6666-666666666600"),
222
- auditEntry("deftai/directive", 601, "accept", "66666666-6666-6666-6666-666666666601"),
223
- ],
224
- activeVbriefs: [{ name: "only-running", status: "running" }],
225
- },
226
- },
227
- {
228
- name: "configured-scope-divergence",
229
- argv: [],
230
- fixture: {
231
- triageScope: [{ rule: "labels", "any-of": ["phase-1"] }],
232
- cachedIssues: [{ repo: "deftai/directive", number: 700 }],
233
- auditEntries: [
234
- auditEntry("deftai/directive", 700, "accept", "77777777-7777-7777-7777-777777777700"),
235
- ],
236
- activeVbriefs: [
237
- { name: "one-running", status: "running" },
238
- { name: "two-running", status: "running" },
239
- ],
240
- },
241
- },
242
- {
243
- name: "json-mode",
244
- argv: ["--json"],
245
- fixture: {
246
- cachedIssues: [{ repo: "deftai/directive", number: 900 }],
247
- },
248
- },
249
- ];
250
- /** Run all parity cases; returns aggregate result. */
251
- export function runParity() {
252
- const deftRoot = resolveDeftRoot();
253
- const diffs = [];
254
- for (const testCase of PARITY_CASES) {
255
- const pyRepo = buildFixtureRepo(testCase.fixture);
256
- const tsRepo = buildFixtureRepo(testCase.fixture);
257
- try {
258
- const python = runPythonSummary(deftRoot, pyRepo, testCase.argv);
259
- const ts = runTsSummary(deftRoot, tsRepo, testCase.argv);
260
- diffs.push(diffCase(python, ts, testCase.name));
261
- }
262
- finally {
263
- rmSync(pyRepo, { recursive: true, force: true });
264
- rmSync(tsRepo, { recursive: true, force: true });
265
- }
266
- }
267
- const ok = diffs.every((d) => !d.exitMismatch && !d.stdoutMismatch && !d.stderrMismatch);
268
- return { ok, diffs };
269
- }
270
- export function renderReport(result) {
271
- if (result.ok) {
272
- return `triage:summary parity: CLEAN -- Python and TS agree on ${PARITY_CASES.length} cases.`;
273
- }
274
- const lines = ["triage:summary parity: DIVERGENCE"];
275
- for (const d of result.diffs) {
276
- if (d.exitMismatch || d.stdoutMismatch || d.stderrMismatch) {
277
- lines.push(` case: ${d.caseName}`);
278
- if (d.exitMismatch)
279
- lines.push(` exit: python=${d.pythonExit} ts=${d.tsExit}`);
280
- if (d.stdoutMismatch) {
281
- lines.push(` python stdout: ${d.pythonStdout}`);
282
- lines.push(` ts stdout: ${d.tsStdout}`);
283
- }
284
- if (d.stderrMismatch)
285
- lines.push(" stderr mismatch");
286
- }
287
- }
288
- return lines.join("\n");
289
- }
290
- if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
291
- try {
292
- const result = runParity();
293
- if (result.ok) {
294
- process.stdout.write(`${renderReport(result)}\n`);
295
- process.exit(0);
296
- }
297
- process.stderr.write(`${renderReport(result)}\n`);
298
- process.exit(1);
299
- }
300
- catch (err) {
301
- const msg = String(err).replace(/\r?\n/g, " ");
302
- process.stderr.write(`triage:summary parity: harness error -- ${msg}\n`);
303
- process.exit(2);
304
- }
305
- }
306
- //# sourceMappingURL=triage-summary-parity.js.map
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare function normalizeOutput(text: string): string;
3
- export interface CommandCapture {
4
- readonly exitCode: number;
5
- readonly stdout: string;
6
- readonly stderr: string;
7
- }
8
- export interface ParityCase {
9
- readonly gate: "validate-links" | "validate-strategy-output" | "verify-capacity";
10
- readonly name: string;
11
- readonly setup: (root: string) => void;
12
- readonly argv?: string[];
13
- readonly env?: Record<string, string>;
14
- readonly now?: string;
15
- }
16
- export interface ParityDiff {
17
- readonly gate: string;
18
- readonly caseName: string;
19
- readonly exitMismatch: boolean;
20
- readonly stdoutMismatch: boolean;
21
- readonly stderrMismatch: boolean;
22
- readonly pythonExit: number;
23
- readonly tsExit: number;
24
- }
25
- export interface ParityResult {
26
- readonly ok: boolean;
27
- readonly diffs: ParityDiff[];
28
- }
29
- export declare const PARITY_CASES: readonly ParityCase[];
30
- export declare function diffCase(python: CommandCapture, ts: CommandCapture, gate: string, caseName: string): ParityDiff;
31
- export declare function runParity(): ParityResult;
32
- export declare function renderReport(result: ParityResult): string;
33
- //# sourceMappingURL=validate-content-parity.d.ts.map