ultimate-pi 0.22.1 → 0.22.2

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 (42) hide show
  1. package/.pi/extensions/agt-kill-switch.ts +7 -1
  2. package/.pi/extensions/harness-plan-approval.ts +9 -1
  3. package/.pi/extensions/harness-run-context.ts +529 -84
  4. package/.pi/extensions/policy-gate.ts +15 -2
  5. package/.pi/harness/agents.manifest.json +3 -3
  6. package/.pi/harness/agents.policy.yaml +82 -3
  7. package/.pi/harness/specs/plan-task-clarification.schema.json +10 -1
  8. package/.pi/lib/agents-policy.mjs +42 -1
  9. package/.pi/lib/agt/build-evaluation-context.ts +3 -1
  10. package/.pi/lib/agt/kill-switch-state.ts +14 -0
  11. package/.pi/lib/agt/legacy-evaluate.ts +3 -1
  12. package/.pi/lib/ask-user/index.ts +2 -0
  13. package/.pi/lib/ask-user/merge-task-clarification.ts +5 -0
  14. package/.pi/lib/ask-user/policy.ts +23 -0
  15. package/.pi/lib/ask-user/presenters/glimpse.ts +8 -1
  16. package/.pi/lib/ask-user/presenters/headless.ts +15 -0
  17. package/.pi/lib/ask-user/presenters/select.ts +11 -2
  18. package/.pi/lib/ask-user/validate-core.mjs +16 -0
  19. package/.pi/lib/harness-artifact-gate.ts +75 -5
  20. package/.pi/lib/harness-repair-brief.ts +30 -4
  21. package/.pi/lib/harness-run-context.ts +804 -17
  22. package/.pi/lib/harness-schema-validate.ts +147 -38
  23. package/.pi/lib/harness-spawn-policy.ts +9 -0
  24. package/.pi/lib/harness-spawn-topology.ts +109 -7
  25. package/.pi/lib/harness-subagent-precheck.ts +21 -0
  26. package/.pi/lib/harness-subagent-submit-pipeline.ts +95 -21
  27. package/.pi/lib/harness-subagent-submit-register.ts +6 -1
  28. package/.pi/lib/harness-subagents-bridge.ts +3 -0
  29. package/.pi/lib/harness-yaml.ts +11 -3
  30. package/.pi/lib/plan-approval/create-plan.ts +2 -6
  31. package/.pi/lib/plan-debate-gate.ts +87 -0
  32. package/.pi/lib/plan-debate-lane.ts +8 -2
  33. package/.pi/lib/plan-human-gates.ts +322 -0
  34. package/.pi/prompts/harness-clear.md +25 -0
  35. package/.pi/prompts/harness-plan.md +4 -0
  36. package/.pi/scripts/generate-agents-policy-yaml.mjs +73 -7
  37. package/.pi/scripts/harness-reconcile-run-context.mjs +62 -0
  38. package/.pi/scripts/harness-schema-compile-verify.mjs +29 -0
  39. package/.pi/scripts/harness-verify.mjs +27 -0
  40. package/CHANGELOG.md +6 -0
  41. package/README.md +4 -0
  42. package/package.json +1 -1
@@ -519,6 +519,32 @@ async function checkSentruxGate() {
519
519
  ok("sentrux check passed");
520
520
  }
521
521
 
522
+ async function verifyHarnessSchemaCompilation() {
523
+ const script = join(ROOT, ".pi", "scripts", "harness-schema-compile-verify.mjs");
524
+ if (!(await fileExists(script))) {
525
+ fail("missing harness-schema-compile-verify.mjs");
526
+ }
527
+ const { code, out } = await new Promise((resolve) => {
528
+ const child = spawn("npx", ["-y", "tsx", script], {
529
+ cwd: ROOT,
530
+ stdio: ["ignore", "pipe", "pipe"],
531
+ shell: true,
532
+ });
533
+ let buf = "";
534
+ child.stdout?.on("data", (d) => {
535
+ buf += d.toString();
536
+ });
537
+ child.stderr?.on("data", (d) => {
538
+ buf += d.toString();
539
+ });
540
+ child.on("close", (c) => resolve({ code: c ?? 1, out: buf }));
541
+ });
542
+ if (code !== 0) {
543
+ fail(out.trim() || "harness schema compile verify failed");
544
+ }
545
+ ok(out.trim() || "harness schemas compile (cross-file $ref)");
546
+ }
547
+
522
548
  async function verifySchemaAdrAndExtensions() {
523
549
  for (const name of REQUIRED_SCHEMAS) {
524
550
  const path = join(SPECS, name);
@@ -526,6 +552,7 @@ async function verifySchemaAdrAndExtensions() {
526
552
  JSON.parse(await readFile(path, "utf-8"));
527
553
  ok(`schema ${name}`);
528
554
  }
555
+ await verifyHarnessSchemaCompilation();
529
556
  for (const name of REQUIRED_ADRS) {
530
557
  const path = join(ADRS, name);
531
558
  if (!(await fileExists(path))) fail(`missing ADR ${name}`);
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [v0.22.2] — 2026-05-28
6
+
7
+ ### 🐛 Fixes
8
+
9
+ - Harden harness plan/run/review/auto pipeline routing: reconcile run context from disk and handoffs, sync review-outcome from eval, fix harness-auto fresh runs (plan path, abort lock, kill-switch disarm), add harness-clear and expanded tests.
10
+
5
11
  ## [v0.22.1] — 2026-05-27
6
12
 
7
13
  ### 🔧 Chores
package/README.md CHANGED
@@ -76,6 +76,8 @@ If `/harness-review` returns `implementation_gap`, run:
76
76
  | `/harness-review [--run <id>] [--quick] [--readonly] [--trace <ref>]` | Post-run verification gate: deterministic checks, benchmark evaluator, policy verdict, adversary, optional tie-breaker. |
77
77
  | `/harness-steer [--attempt N]` | Post-review repair pass for `implementation_gap`; executor reads `repair-brief.yaml`, then you re-run `/harness-review`. |
78
78
  | `/harness-abort [reason]` | Safely aborts the active run, clears plan readiness, and re-locks mutation until a fresh plan is approved. |
79
+
80
+ | `/harness-clear` | Deletes only historical `.pi/harness/runs/<run_id>/` directories after mandatory confirmation; active run is preserved and non-affirmative/outage confirmation paths are no-op. |
79
81
  | `/harness-trace [--run <id>] [--phase plan\|execute\|evaluate\|adversary\|merge]` | Summarizes run traces and artifact handoffs for replay/forensics. |
80
82
  | `/harness-incident --trigger <reason> [--run <id>] [--severity low\|med\|high\|critical]` | Records incident, rollback, and override trail for harness failures. |
81
83
  | `/harness-sentrux-steward [--run <id>]` | Ad-hoc architectural intent review for Sentrux manifest/rule alignment. |
@@ -127,6 +129,8 @@ Subagents run isolated from the parent session. They persist canonical YAML thro
127
129
  | No approved plan | Run `/harness-plan "<task>"`, then `/harness-run`. |
128
130
  | Need to inspect handoff | Run `/harness-trace` or inspect `.pi/harness/runs/<run_id>/`. |
129
131
  | Need to restart safely | Run `/harness-abort [reason]`, then create a fresh plan. |
132
+
133
+ | Need to prune old run history safely | Run `/harness-clear`; only historical run directories are eligible and confirmation failure/cancel deletes nothing. |
130
134
  | Review says `implementation_gap` | Run `/harness-steer`, then `/harness-review`. |
131
135
  | Review says `plan_gap` | Revise with `/harness-plan "<updated task>"`. |
132
136
  | Sentrux missing | Install/configure Sentrux or keep it skipped; harness verification still reports the status. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-pi",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "description": "Governed AI coding harness for pi.dev — bootstrap, plan, execute, review, and steer with deterministic policy gates",
5
5
  "keywords": [
6
6
  "pi-package",