opencode-longrun-harness 1.2.22

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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +390 -0
  3. package/docs/V1.2.20_EVIDENCE.md +114 -0
  4. package/docs/V1.2.21_EVIDENCE.md +68 -0
  5. package/docs/V1.2.22_EVIDENCE.md +52 -0
  6. package/harness/commissioning/README.md +16 -0
  7. package/harness/commissioning/inspect-copied-run.mjs +25 -0
  8. package/harness/commissioning/verify-copied-case.mjs +35 -0
  9. package/harness/plugin/longrun.js +677 -0
  10. package/harness/src/cli.mjs +40 -0
  11. package/harness/src/controller.js +1413 -0
  12. package/harness/src/evidence.mjs +135 -0
  13. package/harness/src/execution.mjs +217 -0
  14. package/harness/src/executor.mjs +21 -0
  15. package/harness/src/install.mjs +435 -0
  16. package/harness/src/maintenance.mjs +257 -0
  17. package/harness/src/memory.mjs +472 -0
  18. package/harness/test/candidates.test.mjs +73 -0
  19. package/harness/test/checkpoint.test.mjs +65 -0
  20. package/harness/test/controller.test.mjs +230 -0
  21. package/harness/test/evidence.test.mjs +57 -0
  22. package/harness/test/fixtures/durable-host.mjs +27 -0
  23. package/harness/test/fixtures/example-app-run.json +1375 -0
  24. package/harness/test/fixtures/notes-budget-exhausted-run.json +2070 -0
  25. package/harness/test/fixtures/notes-premature-complete-run.json +1496 -0
  26. package/harness/test/fixtures/notes-recovery-run.json +622 -0
  27. package/harness/test/fixtures/presets-readout-run.json +825 -0
  28. package/harness/test/fixtures/routing-worker.mjs +35 -0
  29. package/harness/test/fixtures/vitest-failed-receipt.json +33 -0
  30. package/harness/test/helper.mjs +41 -0
  31. package/harness/test/install.test.mjs +117 -0
  32. package/harness/test/lifecycle.test.mjs +102 -0
  33. package/harness/test/maintenance.test.mjs +204 -0
  34. package/harness/test/memory.test.mjs +145 -0
  35. package/harness/test/negative-control.test.mjs +91 -0
  36. package/harness/test/plugin.test.mjs +169 -0
  37. package/harness/test/recovery-runner.test.mjs +435 -0
  38. package/harness/test/recovery.test.mjs +68 -0
  39. package/harness/test/repair-mechanics.test.mjs +122 -0
  40. package/harness/test/toolbehavior.test.mjs +75 -0
  41. package/harness/test/v121-commissioning.test.mjs +177 -0
  42. package/harness/test/v1210-deadline.test.mjs +134 -0
  43. package/harness/test/v1211-pause.test.mjs +81 -0
  44. package/harness/test/v1212-maintenance-pause.test.mjs +76 -0
  45. package/harness/test/v1213-readout.test.mjs +82 -0
  46. package/harness/test/v1214-durable.test.mjs +121 -0
  47. package/harness/test/v1215-guidance.test.mjs +57 -0
  48. package/harness/test/v1216-test-summary.test.mjs +39 -0
  49. package/harness/test/v1217-discovery.test.mjs +73 -0
  50. package/harness/test/v1218-completion-review.test.mjs +203 -0
  51. package/harness/test/v1219-budget-pause.test.mjs +134 -0
  52. package/harness/test/v122-lifecycle-resolver.test.mjs +218 -0
  53. package/harness/test/v1220-budget-amendment.test.mjs +343 -0
  54. package/harness/test/v1221-negative-fixture-anchor.test.mjs +65 -0
  55. package/harness/test/v1222-default-evidence-class.test.mjs +75 -0
  56. package/harness/test/v123-plugin-e2e.test.mjs +120 -0
  57. package/harness/test/v123-receipt-model.test.mjs +185 -0
  58. package/harness/test/v124-canonical.test.mjs +147 -0
  59. package/harness/test/v124-installed.test.mjs +48 -0
  60. package/harness/test/v125-stability.test.mjs +183 -0
  61. package/harness/test/v126-execution.test.mjs +183 -0
  62. package/harness/test/v127-reconciliation.test.mjs +139 -0
  63. package/harness/test/v128-compaction.test.mjs +156 -0
  64. package/harness/test/v129-routing.test.mjs +165 -0
  65. package/harness/tools/audit-receipts.mjs +121 -0
  66. package/harness/tools/recovery-runner.mjs +499 -0
  67. package/package.json +49 -0
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ // Long-run harness maintenance CLI. Dependency-free (node builtins).
3
+ // Usage: node cli.mjs <dry-run|install|doctor|disable|enable|uninstall> [--config-dir PATH] [--home PATH] [--json]
4
+ import { install, doctor, uninstall, disable, enable, resolveConfigDir, VERSION } from "./install.mjs";
5
+ import fs from "node:fs";
6
+
7
+ const [, , cmd, ...rest] = process.argv;
8
+ const flag = (n) => { const i = rest.indexOf(n); return i >= 0 ? rest[i + 1] : undefined; };
9
+ const json = rest.includes("--json");
10
+ let configDir = flag("--config-dir");
11
+ if (!configDir) {
12
+ const home = flag("--home");
13
+ configDir = home ? home + "/.config/opencode" : resolveConfigDir({ HOME: process.env.HOME });
14
+ }
15
+
16
+ function main() {
17
+ const report = (() => {
18
+ switch (cmd) {
19
+ case "dry-run": return install({ configDir, dryRun: true, version: VERSION });
20
+ case "install": return install({ configDir, version: VERSION });
21
+ case "doctor": return doctor({ configDir });
22
+ case "disable": return disable({ configDir });
23
+ case "enable": return enable({ configDir });
24
+ case "uninstall": return uninstall({ configDir });
25
+ default: return { error: "unknown command", usage: "node cli.mjs <dry-run|install|doctor|disable|enable|uninstall> [--config-dir PATH] [--home PATH]" };
26
+ }
27
+ })();
28
+ const code = report && (report.error || (report.ok === false) || (report.degraded && report.degraded.length)) ? 2 : 0;
29
+ if (json) { process.stdout.write(JSON.stringify({ configDir, cmd, ...report }, null, 2) + "\n"); }
30
+ else {
31
+ process.stdout.write(`config-dir: ${configDir}\ncmd: ${cmd}\n`);
32
+ for (const a of (report.actions || [])) process.stdout.write(` ${a.action.padEnd(16)} ${a.rel}\n`);
33
+ for (const c of (report.conflicts || [])) process.stdout.write(` CONFLICT ${c.rel} (${c.reason})\n`);
34
+ for (const d of (report.degraded || [])) process.stdout.write(` DEGRADED ${d}\n`);
35
+ for (const n of (report.notes || [])) process.stdout.write(` note: ${n}\n`);
36
+ if (report.removed) process.stdout.write(` removed ${report.removed.length}; preserved-edits ${report.leftEdited.length}\n`);
37
+ }
38
+ process.exit(code);
39
+ }
40
+ main();