@rasensio/aidlc 1.82.0 → 1.83.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 (45) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +2 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/gate.d.ts.map +1 -1
  5. package/dist/commands/gate.js +39 -4
  6. package/dist/commands/gate.js.map +1 -1
  7. package/dist/commands/transition.d.ts.map +1 -1
  8. package/dist/commands/transition.js +15 -0
  9. package/dist/commands/transition.js.map +1 -1
  10. package/dist/commands/verify.d.ts +16 -0
  11. package/dist/commands/verify.d.ts.map +1 -0
  12. package/dist/commands/verify.js +59 -0
  13. package/dist/commands/verify.js.map +1 -0
  14. package/dist/core/gate.d.ts +7 -0
  15. package/dist/core/gate.d.ts.map +1 -1
  16. package/dist/core/gate.js.map +1 -1
  17. package/dist/core/next-steps.d.ts.map +1 -1
  18. package/dist/core/next-steps.js +9 -0
  19. package/dist/core/next-steps.js.map +1 -1
  20. package/dist/core/types.d.ts +3 -1
  21. package/dist/core/types.d.ts.map +1 -1
  22. package/dist/menu/roster.d.ts.map +1 -1
  23. package/dist/menu/roster.js +3 -0
  24. package/dist/menu/roster.js.map +1 -1
  25. package/dist/verify/config.d.ts +29 -0
  26. package/dist/verify/config.d.ts.map +1 -0
  27. package/dist/verify/config.js +61 -0
  28. package/dist/verify/config.js.map +1 -0
  29. package/dist/verify/gate-criterion.d.ts +29 -0
  30. package/dist/verify/gate-criterion.d.ts.map +1 -0
  31. package/dist/verify/gate-criterion.js +86 -0
  32. package/dist/verify/gate-criterion.js.map +1 -0
  33. package/dist/verify/git.d.ts +28 -0
  34. package/dist/verify/git.d.ts.map +1 -0
  35. package/dist/verify/git.js +76 -0
  36. package/dist/verify/git.js.map +1 -0
  37. package/dist/verify/receipt.d.ts +39 -0
  38. package/dist/verify/receipt.d.ts.map +1 -0
  39. package/dist/verify/receipt.js +60 -0
  40. package/dist/verify/receipt.js.map +1 -0
  41. package/dist/verify/run.d.ts +24 -0
  42. package/dist/verify/run.d.ts.map +1 -0
  43. package/dist/verify/run.js +59 -0
  44. package/dist/verify/run.js.map +1 -0
  45. package/package.json +2 -2
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Run `verify.command` and write the receipt.
3
+ *
4
+ * The command runs through the platform shell because it is a string a person wrote
5
+ * for one (`pnpm test && pnpm lint` must work). Output is shown live and hashed as it
6
+ * arrives; it is never stored (AC-7). The receipt is written whether the command
7
+ * passed or failed, so a failing run replaces an older passing one (AC-10).
8
+ *
9
+ * Requirements: tool-written-test-receipts/AC-4, AC-5, AC-6, AC-10
10
+ */
11
+ import { spawn } from 'node:child_process';
12
+ import { createHash } from 'node:crypto';
13
+ import { constants } from 'node:os';
14
+ import { VERSION } from '../core/version.js';
15
+ import { changedOutside } from './git.js';
16
+ import { hashCommand, writeReceipt } from './receipt.js';
17
+ /** Exit code for a run killed by a signal: the shell convention, 128 + its number. */
18
+ function signalExitCode(signal) {
19
+ const n = signal ? constants.signals[signal] : undefined;
20
+ return n === undefined ? 1 : 128 + n;
21
+ }
22
+ /**
23
+ * @param commit HEAD, already resolved by the caller (which refuses when there is none).
24
+ */
25
+ export async function runVerify(projectRoot, instance, command, commit, out = { stdout: process.stdout, stderr: process.stderr }) {
26
+ // Measured before the run, so what the run itself writes cannot make it dirty. An
27
+ // unanswerable status counts as dirty: unknown is not clean (AC-6).
28
+ const changed = changedOutside(projectRoot, instance, null);
29
+ const dirty = !changed.ok || changed.paths.length > 0;
30
+ const hash = createHash('sha256');
31
+ const started = Date.now();
32
+ const exitCode = await new Promise((resolve) => {
33
+ const child = spawn(command, { shell: true, cwd: projectRoot, stdio: ['inherit', 'pipe', 'pipe'] });
34
+ child.stdout.on('data', (chunk) => {
35
+ hash.update(chunk);
36
+ out.stdout.write(chunk);
37
+ });
38
+ child.stderr.on('data', (chunk) => {
39
+ hash.update(chunk);
40
+ out.stderr.write(chunk);
41
+ });
42
+ // A shell that cannot start is the shell's "command not found".
43
+ child.on('error', () => resolve(127));
44
+ child.on('close', (code, signal) => resolve(code ?? signalExitCode(signal)));
45
+ });
46
+ const receipt = {
47
+ version: 1,
48
+ commit,
49
+ dirty,
50
+ command_sha256: hashCommand(command),
51
+ exit_code: exitCode,
52
+ output_sha256: hash.digest('hex'),
53
+ duration_ms: Date.now() - started,
54
+ cli_version: VERSION,
55
+ finished_at: new Date().toISOString(),
56
+ };
57
+ return { receipt, path: writeReceipt(projectRoot, instance, receipt) };
58
+ }
59
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/verify/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQzD,sFAAsF;AACtF,SAAS,cAAc,CAAC,MAA6B;IACnD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,SAAS,CAAC,OAAkC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrF,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,WAAmB,EACnB,QAAgB,EAChB,OAAe,EACf,MAAc,EACd,MAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,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AAM,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAY;QACvB,OAAO,EAAE,CAAC;QACV,MAAM;QACN,KAAK;QACL,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC;QACpC,SAAS,EAAE,QAAQ;QACnB,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QACjC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO;QACjC,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACtC,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;AACzE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasensio/aidlc",
3
- "version": "1.82.0",
3
+ "version": "1.83.0",
4
4
  "description": "AI Development Lifecycle Framework — structured lifecycle guidance for AI coding agents across platforms",
5
5
  "homepage": "https://aidlc.rodrigoasensio.com",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "commander": "15.0.0",
32
32
  "picomatch": "4.0.5",
33
33
  "yaml": "2.9.0",
34
- "@rasensio/aidlc-content": "1.82.0"
34
+ "@rasensio/aidlc-content": "1.83.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "22.15.32",