ultimate-pi 0.17.0 → 0.18.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 (110) hide show
  1. package/.agents/skills/harness-context/SKILL.md +13 -6
  2. package/.agents/skills/harness-debate-plan/SKILL.md +37 -20
  3. package/.agents/skills/harness-eval/SKILL.md +6 -21
  4. package/.agents/skills/harness-governor/SKILL.md +4 -3
  5. package/.agents/skills/harness-orchestration/SKILL.md +39 -51
  6. package/.agents/skills/harness-plan/SKILL.md +23 -12
  7. package/.agents/skills/harness-review/SKILL.md +52 -0
  8. package/.agents/skills/harness-sentrux-setup/SKILL.md +13 -1
  9. package/.agents/skills/harness-steer/SKILL.md +14 -0
  10. package/.pi/agents/harness/adversary.md +3 -10
  11. package/.pi/agents/harness/evaluator.md +3 -12
  12. package/.pi/agents/harness/executor.md +12 -14
  13. package/.pi/agents/harness/planning/decompose.md +7 -4
  14. package/.pi/agents/harness/planning/hypothesis-validator.md +2 -0
  15. package/.pi/agents/harness/planning/hypothesis.md +3 -1
  16. package/.pi/agents/harness/planning/plan-adversary.md +2 -0
  17. package/.pi/agents/harness/planning/plan-evaluator.md +2 -0
  18. package/.pi/agents/harness/planning/plan-synthesizer.md +25 -0
  19. package/.pi/agents/harness/planning/planning-context.md +48 -0
  20. package/.pi/agents/harness/planning/review-integrator.md +2 -0
  21. package/.pi/agents/harness/planning/scout-graphify.md +3 -1
  22. package/.pi/agents/harness/planning/scout-semantic.md +3 -1
  23. package/.pi/agents/harness/planning/scout-structure.md +3 -1
  24. package/.pi/agents/harness/planning/sprint-contract-auditor.md +2 -0
  25. package/.pi/agents/harness/sentrux-steward.md +51 -0
  26. package/.pi/extensions/00-posthog-network-bootstrap.ts +11 -0
  27. package/.pi/extensions/harness-live-widget.ts +27 -1
  28. package/.pi/extensions/harness-plan-approval.ts +62 -56
  29. package/.pi/extensions/harness-run-context.ts +541 -84
  30. package/.pi/extensions/harness-subagent-submit.ts +43 -10
  31. package/.pi/extensions/lib/harness-artifact-gate.ts +182 -0
  32. package/.pi/extensions/lib/harness-posthog.ts +9 -5
  33. package/.pi/extensions/lib/harness-spawn-topology.ts +188 -0
  34. package/.pi/extensions/lib/harness-subagent-auth.ts +1 -0
  35. package/.pi/extensions/lib/harness-subagent-policy.ts +23 -19
  36. package/.pi/extensions/lib/harness-subagent-precheck.ts +35 -9
  37. package/.pi/extensions/lib/harness-subagent-submit-pipeline.ts +66 -2
  38. package/.pi/extensions/lib/harness-subagent-submit-registry.ts +21 -3
  39. package/.pi/extensions/lib/harness-subagents-bridge.ts +7 -29
  40. package/.pi/extensions/lib/harness-subprocess-bootstrap.ts +73 -0
  41. package/.pi/extensions/lib/plan-approval/create-plan.ts +2 -3
  42. package/.pi/extensions/lib/plan-approval/resolve-disk.ts +102 -0
  43. package/.pi/extensions/lib/plan-approval/schema.ts +22 -8
  44. package/.pi/extensions/lib/plan-approval/types.ts +1 -1
  45. package/.pi/extensions/lib/plan-approval/validate.ts +2 -2
  46. package/.pi/extensions/lib/plan-approval-readiness.ts +241 -0
  47. package/.pi/extensions/lib/plan-debate-eligibility.ts +12 -5
  48. package/.pi/extensions/lib/plan-debate-gate.ts +22 -1
  49. package/.pi/extensions/lib/plan-debate-lanes.ts +32 -2
  50. package/.pi/extensions/lib/plan-review-gate.ts +8 -0
  51. package/.pi/extensions/lib/posthog-client.ts +76 -0
  52. package/.pi/extensions/policy-gate.ts +24 -19
  53. package/.pi/harness/agents.manifest.json +24 -16
  54. package/.pi/harness/corpus/cron.example +8 -0
  55. package/.pi/harness/corpus/graphify-kb-updater.config.json +159 -0
  56. package/.pi/harness/corpus/systemd/graphify-kb-updater.env.template +4 -0
  57. package/.pi/harness/corpus/systemd/graphify-kb-updater.service +17 -0
  58. package/.pi/harness/corpus/systemd/graphify-kb-updater.timer +11 -0
  59. package/.pi/harness/docs/adrs/0001-harness-constitution.md +2 -1
  60. package/.pi/harness/docs/adrs/0006-sentrux-dual-layer.md +7 -6
  61. package/.pi/harness/docs/adrs/0009-sentrux-rules-lifecycle.md +6 -1
  62. package/.pi/harness/docs/adrs/0031-harness-run-context.md +1 -1
  63. package/.pi/harness/docs/adrs/0032-harness-command-orchestration.md +7 -0
  64. package/.pi/harness/docs/adrs/0034-darwin-plan-research-pipeline.md +3 -3
  65. package/.pi/harness/docs/adrs/0036-implementation-research-and-selective-debate.md +8 -5
  66. package/.pi/harness/docs/adrs/0039-harness-post-run-review-gate.md +47 -0
  67. package/.pi/harness/docs/adrs/0040-practice-grounded-orchestration.md +40 -0
  68. package/.pi/harness/docs/adrs/0041-intelligent-planning-reconnaissance.md +39 -0
  69. package/.pi/harness/docs/adrs/0042-agent-native-orchestration.md +35 -0
  70. package/.pi/harness/docs/adrs/0043-path-first-harness-tools.md +38 -0
  71. package/.pi/harness/docs/adrs/0044-harness-steer-loop.md +36 -0
  72. package/.pi/harness/docs/adrs/README.md +10 -0
  73. package/.pi/harness/docs/graphify-kb-updater-runbook.md +157 -0
  74. package/.pi/harness/docs/practice-map.md +110 -0
  75. package/.pi/harness/env.harness.template +5 -3
  76. package/.pi/harness/evals/smoke/sentrux-stub.json +1 -1
  77. package/.pi/harness/evals/smoke/smoke-harness-plan.mjs +5 -2
  78. package/.pi/harness/specs/README.md +1 -1
  79. package/.pi/harness/specs/harness-run-context.schema.json +11 -0
  80. package/.pi/harness/specs/harness-spawn-context.schema.json +14 -0
  81. package/.pi/harness/specs/plan-execution-plan.schema.json +39 -1
  82. package/.pi/harness/specs/plan-packet.schema.json +4 -0
  83. package/.pi/harness/specs/plan-phase-status.schema.json +17 -0
  84. package/.pi/harness/specs/plan-phase-waiver.schema.json +25 -0
  85. package/.pi/harness/specs/plan-planning-context.schema.json +50 -0
  86. package/.pi/harness/specs/repair-brief.schema.json +45 -0
  87. package/.pi/harness/specs/review-outcome.schema.json +46 -0
  88. package/.pi/harness/specs/sentrux-manifest-proposal.schema.json +80 -0
  89. package/.pi/harness/specs/sentrux-signal.schema.json +43 -0
  90. package/.pi/harness/specs/steer-state.schema.json +20 -0
  91. package/.pi/lib/harness-context-mode-policy.ts +256 -0
  92. package/.pi/lib/harness-repair-brief.ts +145 -0
  93. package/.pi/lib/harness-run-context.ts +591 -32
  94. package/.pi/lib/harness-ui-state.ts +87 -9
  95. package/.pi/prompts/harness-auto.md +9 -9
  96. package/.pi/prompts/harness-critic.md +3 -30
  97. package/.pi/prompts/harness-eval.md +4 -37
  98. package/.pi/prompts/harness-plan.md +118 -54
  99. package/.pi/prompts/harness-review.md +150 -15
  100. package/.pi/prompts/harness-run.md +62 -10
  101. package/.pi/prompts/harness-sentrux-steward.md +55 -0
  102. package/.pi/prompts/harness-steer.md +30 -0
  103. package/.pi/scripts/graphify-kb-updater.mjs +358 -0
  104. package/.pi/scripts/harness-verify.mjs +22 -6
  105. package/.pi/scripts/harness-web-policy-guard.mjs +68 -0
  106. package/.pi/scripts/validate-plan-dag.mjs +3 -3
  107. package/AGENTS.md +1 -0
  108. package/CHANGELOG.md +11 -0
  109. package/package.json +5 -4
  110. package/.pi/prompts/git-sync.md +0 -124
@@ -0,0 +1,157 @@
1
+ # Graphify KB updater runbook
2
+
3
+ ## Purpose and scope
4
+
5
+ `graphify-kb-updater` keeps the local Graphify source corpus current for agentic engineering, context engineering, harness engineering, AI coding harnesses, research papers/feeds, articles/blogs, local books/transcripts, YouTube candidates, and competitor intelligence.
6
+
7
+ The approved operating model is **hybrid allowlist auto-promotion with conservative staging**:
8
+
9
+ - Daily local automation may auto-promote only explicitly approved allowlisted public sources with complete provenance and rights/access metadata.
10
+ - Books, transcripts, YouTube/video material, paid/copyrighted/mirrored material, unclear-license content, and unknown open-web sources remain staged until manually approved.
11
+ - Competitor monitoring is a curated taxonomy/watchlist/reporting signal, not an exhaustive crawler.
12
+ - Pi-agent-open integration is intentionally limited/deferred: opening Pi should do at most a low-latency, no-network stale check. It must not perform synchronous web discovery, promotion, or Graphify mutation.
13
+
14
+ ## Governance and approval boundaries
15
+
16
+ Required rights/access fields for every promotion:
17
+
18
+ - `license`
19
+ - `access`
20
+ - `approved_by`
21
+ - `approved_at`
22
+
23
+ Allowlist auto-promotion requires all of the following:
24
+
25
+ 1. `.pi/harness/corpus/graphify-kb-updater.config.json` has `auto_promote_allowlist: true`.
26
+ 2. The candidate domain is present in `allowlist` with `approved: true`.
27
+ 3. The candidate itself has `approved: true`.
28
+ 4. `rights_access` is complete.
29
+ 5. The candidate is not a risky source class that requires manual review.
30
+
31
+ Risky source classes (`book`, `transcript`, `youtube`) always require explicit approval and complete rights/access metadata. Raw HTTP shell paths are forbidden; keep discovery/fetch through approved harness web/API abstractions and verify with `.pi/scripts/harness-web-policy-guard.mjs`.
32
+
33
+ ## Manual commands
34
+
35
+ Dry-run, no mutation of `raw/`, state, or `graphify-out/`:
36
+
37
+ ```bash
38
+ node .pi/scripts/graphify-kb-updater.mjs --dry-run --pilot-report
39
+ ```
40
+
41
+ Apply approved/promotable candidates and refresh Graphify only when promoted files changed:
42
+
43
+ ```bash
44
+ node .pi/scripts/graphify-kb-updater.mjs --apply --refresh-graph --pilot-report
45
+ ```
46
+
47
+ Apply without graph mutation:
48
+
49
+ ```bash
50
+ node .pi/scripts/graphify-kb-updater.mjs --apply --skip-graph --pilot-report
51
+ ```
52
+
53
+ Validate scheduler templates:
54
+
55
+ ```bash
56
+ node .pi/scripts/graphify-kb-updater.mjs --scheduler-smoke
57
+ ```
58
+
59
+ Run web-policy guard:
60
+
61
+ ```bash
62
+ node .pi/scripts/harness-web-policy-guard.mjs
63
+ ```
64
+
65
+ ## Approval workflow
66
+
67
+ 1. Review dry-run JSON: candidate count, source counts, competitor labels, duplicate/skipped/blocked counts, stale warnings, planned promotions, and graph action.
68
+ 2. For a candidate, add it to `.pi/harness/corpus/graphify-kb-updater.config.json` `review_queue` with:
69
+ - `kind` (`article`, `paper`, `book`, `transcript`, or `youtube`)
70
+ - `title`
71
+ - `url` or `path`
72
+ - `approved: true`
73
+ - `rights_access` object with all required fields
74
+ - optional `competitor_labels` or provenance notes.
75
+ 3. For local files, you may place `<file>.rights.json` beside the source, but risky classes still require explicit approval before promotion.
76
+ 4. Run `--apply --refresh-graph`.
77
+ 5. Promoted sources land under `raw/graphify-kb-updates/<kind>/` with `.provenance.json` sidecars.
78
+
79
+ ## Daily scheduler setup
80
+
81
+ Systemd user timer is the primary path and runs daily at 08:30 with randomized delay:
82
+
83
+ ```bash
84
+ mkdir -p ~/.config/ultimate-pi ~/.config/systemd/user ~/.local/state/ultimate-pi
85
+ cp .pi/harness/corpus/systemd/graphify-kb-updater.env.template ~/.config/ultimate-pi/graphify-kb-updater.env
86
+ # edit UP_ROOT in the env file
87
+ cp .pi/harness/corpus/systemd/graphify-kb-updater.service ~/.config/systemd/user/
88
+ cp .pi/harness/corpus/systemd/graphify-kb-updater.timer ~/.config/systemd/user/
89
+ systemctl --user daemon-reload
90
+ systemctl --user enable --now graphify-kb-updater.timer
91
+ systemctl --user list-timers graphify-kb-updater.timer
92
+ ```
93
+
94
+ The service uses `flock`, `timeout 45m`, explicit env, append-only logs, and a non-overlap lock.
95
+
96
+ Cron fallback is daily at 08:30; edit `UP_ROOT` and copy the line from `.pi/harness/corpus/cron.example` with `crontab -e`.
97
+
98
+ ## Reports, logs, and fields
99
+
100
+ Apply runs write:
101
+
102
+ - Registry: `.pi/harness/corpus/graphify-kb-updater-state/registry.json`
103
+ - Per-run logs: `.pi/harness/corpus/graphify-kb-updater-state/logs/`
104
+ - Scheduler logs: `~/.local/state/ultimate-pi/graphify-kb-updater.log` and `.err`
105
+
106
+ Each run reports:
107
+
108
+ - `last_run_at`
109
+ - `candidate_count`, `promoted_count`, `blocked_count`, `skipped_count`, `duplicate_skips`, `failure_count`
110
+ - `counts.by_kind`, `counts.by_source_type`, `counts.by_competitor_label`, `counts.allowlisted`
111
+ - `stale_warnings`
112
+ - `changed_existing_count` for same URL/path content changes
113
+ - `graph.action`, `graph.exit_status`, and Graphify report path when refreshed
114
+ - optional pilot metrics: `frontier_recall_proxy`, `promoted_precision_proxy`, `duplicate_noise_rate`, `graphify_success`
115
+
116
+ Review these fields before enabling unattended mode and after every config change.
117
+
118
+ ## Troubleshooting
119
+
120
+ - `missing_rights_access_approval`: add complete rights/access metadata.
121
+ - `manual_approval_required`: set `approved: true` after source and rights review.
122
+ - `duplicate_unchanged`: candidate was already promoted and content hash is unchanged.
123
+ - `changed_existing_count > 0`: a stable URL/path changed content; review before relying on previous conclusions.
124
+ - Graphify skipped: no promoted changes, `--skip-graph`, or no `--refresh-graph`.
125
+ - Graphify failed: inspect `graph.stderr`, run `graphify update .` manually, and keep the scheduler disabled until fixed.
126
+ - Scheduler did not run: check `systemctl --user status graphify-kb-updater.timer`, the env file path, and scheduler logs.
127
+ - Overlap: lock path `%t/graphify-kb-updater.lock` or `/tmp/graphify-kb-updater.lock` prevents concurrent runs.
128
+
129
+ ## Disable
130
+
131
+ ```bash
132
+ systemctl --user disable --now graphify-kb-updater.timer
133
+ systemctl --user reset-failed graphify-kb-updater.service
134
+ ```
135
+
136
+ Remove any cron line copied from `.pi/harness/corpus/cron.example`.
137
+
138
+ ## Rollback
139
+
140
+ 1. Disable systemd timer and remove cron line.
141
+ 2. Use registry/log promoted paths to remove or quarantine promoted files under `raw/graphify-kb-updates/`.
142
+ 3. Restore `.pi/harness/corpus/graphify-kb-updater-state/registry.json` from backup, or mark candidates rejected/quarantined.
143
+ 4. Revert implementation files if needed:
144
+
145
+ ```bash
146
+ git checkout -- .pi/scripts/graphify-kb-updater.mjs .pi/harness/corpus/graphify-kb-updater.config.json .pi/harness/corpus/systemd/graphify-kb-updater.timer .pi/harness/corpus/cron.example test/graphify-kb-updater.test.mjs .pi/harness/docs/graphify-kb-updater-runbook.md
147
+ ```
148
+
149
+ 5. Regenerate Graphify from valid sources:
150
+
151
+ ```bash
152
+ graphify update .
153
+ ```
154
+
155
+ ## Pilot gate before unattended mode
156
+
157
+ Run at least one dry-run and one supervised apply. Record frontier recall proxy, promoted precision proxy, duplicate/noise rate, skipped reasons, stale warnings, and Graphify success from `--pilot-report`. Enable the timer only if promoted precision is acceptable and graph refresh succeeds.
@@ -0,0 +1,110 @@
1
+ # Harness practice map
2
+
3
+ Source of truth linking harness phases to proven practices (graphify corpus), agents/scripts, spawn topology, and **agent translation** (ADR 0042). Orchestrators and agents should cite this doc when unsure why a lane exists.
4
+
5
+ See also: [ADRs](adrs/README.md), [ADR 0040](adrs/0040-practice-grounded-orchestration.md), [ADR 0041](adrs/0041-intelligent-planning-reconnaissance.md), [ADR 0042](adrs/0042-agent-native-orchestration.md), [ADR 0043](adrs/0043-path-first-harness-tools.md), [ADR 0044](adrs/0044-harness-steer-loop.md), [`raw/modules/structured-planning.md`](../../../raw/modules/structured-planning.md).
6
+
7
+ ## Agent translation (human practice → agent design)
8
+
9
+ | Human practice | Agent translation |
10
+ |----------------|-------------------|
11
+ | Meeting / chair | Parent as **scheduler + gate checker** only |
12
+ | Fagan inspection rounds | **Schema-bound probes** + merge (`parallel_probes` profile) |
13
+ | Two-pizza cap per batch | **Token/spawn budget** per phase (`harness-spawn-budget.ts`) |
14
+ | RACI roles | **Disjoint prompt contexts**, not serial speakers |
15
+ | WBS decomposition | **Lake-first `execution_plan`** (few outcomes, bundled context) |
16
+ | Sprint / story points | **`executor_strategy` + lake `done_criteria`** |
17
+ | Critical path | **`critical_path_lake_ids`** |
18
+ | Replan on every failure | **Steer loop** (`implementation_gap`) vs **plan revise** (`plan_gap`) |
19
+ | Tool payloads in chat | **Path-first** approve/submit/merge (ADR 0043) |
20
+
21
+ ## Team management rules (all `/harness-*` orchestrators)
22
+
23
+ 1. **Parallelism law** — Parallel `subagent` `tasks` only when outputs are independent inputs to a later merge (implementation ∥ stack research; inspector ∥ adversary in `parallel_probes`). Never parallelize decompose ∥ hypothesis.
24
+ 2. **Two-pizza cap per batch** — Max 2 research lanes, max 1 optional `planning-context` subagent, max 1 executor, max 1 debate lane agent per `subagent` call (plan-verify may use 2 probes + integrator in separate batches).
25
+ 3. **No redundant thinkers** — If artifact X exists, downstream agents read it; they do not re-derive (e.g. decompose after `planning-context.yaml`).
26
+ 4. **Sequential dependency chain** — planning context → problem framing / decompose → hypothesis → research → synthesis/author → DAG → plan-verify → approve → execute → review → (steer)* → policy.
27
+ 5. **Plan-verify (agent-native)** — For `fast`/`standard`, parallel probes then integrator; parent is chair, not participant. Threaded debate remains for `full` until parity.
28
+ 6. **Tool intelligence** — Parent chooses graphify, sg, ccc; subprocesses optional. **Path-first:** disk is source of truth; tool args are pointers (ADR 0043).
29
+
30
+ ## `/harness-plan` — Planning Process Group
31
+
32
+ | Phase | Practice | Agent translation | Actor | Spawn |
33
+ |-------|----------|---------------------|-------|-------|
34
+ | 0 | Tooling / fast feedback | Pre-index once | Parent + `ccc` | Automatic |
35
+ | 1 | Reconnaissance before WBS | **ContextPack** on disk | Parent tools or optional `planning-context` | No default subprocess |
36
+ | 2a | Problem framing / lakes | Lake outcomes, not ticket tree | `decompose` or synthesizer section | Sequential after context gate |
37
+ | 2b | Hypothesis-driven approach | Falsifiable claim grounded in framing | `hypothesis` or synthesizer | After `artifacts/decomposition.yaml` |
38
+ | 3.5 | Spike / external research | Paths in research brief | Researchers optional | Artifacts required |
39
+ | 4 | Fork resolution (batched) | One `ask_user` gate | Parent | After 3.5 |
40
+ | 4b | Lake-first execution plan | `executor_strategy`, context bundles | `plan-synthesizer` (low/med) or `execution-plan-author` (high) | Single agent |
41
+ | 4c | Deterministic quality gate | Script, not LLM | `validate-plan-dag.mjs` | Parent; hard stop |
42
+ | 4d | Tailor process to risk | Probe depth, not meeting count | `harness_plan_debate_eligibility` | Pre plan-verify |
43
+ | 4e | Architectural intent | Fitness-function spec | `harness/sentrux-steward` optional | When structural risk |
44
+ | 5 | Plan-verify (Review Gate) | Parallel probes + integrator | Debate cast / probes | `parallel_probes` or threaded |
45
+ | 6 | Baseline + approve | Path-only `approve_plan` | Parent | `approve_plan`, `create_plan` |
46
+
47
+ ### Review Gate — debate RACI (threaded / full profile)
48
+
49
+ | Agent | Inspection role | Practice | When |
50
+ |-------|-----------------|----------|------|
51
+ | `hypothesis-validator` | Blind verifier | Independent verification (ADR 0034) | Round 1 / fast path |
52
+ | `plan-evaluator` | Inspector | Neutral checklist | Every required focus |
53
+ | `plan-adversary` | Red team | Adversarial review | Every required focus |
54
+ | `sprint-contract-auditor` | DoD auditor | Sprint contract | `quality` focus |
55
+ | `review-integrator` | Recorder | Single round artifact | End of round |
56
+ | Parent | Chair | Gates only | Always |
57
+
58
+ ### Plan-verify profiles
59
+
60
+ | Profile | When | Team shape |
61
+ |---------|------|------------|
62
+ | `full` | High risk, material fork | Threaded: all four focuses |
63
+ | `standard` | Default med | `parallel_probes`: inspector ∥ adversary → integrator |
64
+ | `light` | Low risk | Threaded: `spec` + `quality` |
65
+ | `fast` | Med/low, clear stack | Consolidated verify + blind hypothesis-validator |
66
+
67
+ ## `/harness-run` — Executing Process Group
68
+
69
+ | Step | Practice | Agent translation | Actor |
70
+ |------|----------|-------------------|-------|
71
+ | Gate | Change control | `plan_ready` required | Parent |
72
+ | Pre-work | Fitness baseline | `sentrux gate --save` | Parent |
73
+ | Work | Single implementer | `executor_strategy` | `harness/executor` |
74
+ | Post-work | Observation | `sentrux check` / signal artifact | Parent |
75
+ | Handoff | Generator–evaluator | `submit_executor_handoff` | Executor |
76
+ | Next | Always verify | **`/harness-review`** (not replan on blocked) | Parent routing |
77
+
78
+ ## `/harness-review` — Monitoring and Controlling
79
+
80
+ | Phase | Practice | Agent translation | Actor |
81
+ |-------|----------|-------------------|-------|
82
+ | 1 | Automated QC + fitness | Deterministic first | Parent scripts |
83
+ | 2 | Measure vs plan | Benchmark on disk | `evaluator` benchmark |
84
+ | 3 | Policy audit | Verdict (no fail-fast skip) | `evaluator` verdict |
85
+ | 4 | Red team | Tiered: full attempt 1, lite 2+ steer | `adversary` |
86
+ | 5 | Outcome + repair brief | Machine routing | Parent + `review-outcome.yaml`, `repair-brief.yaml` |
87
+ | 6 | Steer gate | One `ask_user` | harness-decisions |
88
+ | 7 | Steer / revise | `implementation_gap` → `/harness-steer`; `plan_gap` → plan revise | ADR 0044 |
89
+
90
+ `--quick` = deterministic + benchmark + verdict (no adversary). Steer attempts 2+ default to lite review unless `block_merge`.
91
+
92
+ ## `/harness-steer` — Repair sub-cycle (ADR 0044)
93
+
94
+ | Step | Practice | Actor |
95
+ |------|----------|-------|
96
+ | 0 | Read review + repair briefs | Parent |
97
+ | 1 | Policy phase → `execute` | Parent |
98
+ | 2 | Repair scope | `harness/executor` `mode: repair` |
99
+ | 3 | Re-verify | `/harness-review` |
100
+
101
+ ## Anti-patterns
102
+
103
+ - **Do not** spawn `decompose` and `hypothesis` in the same parallel `tasks` batch.
104
+ - **Do not** run `graphify query` in `decompose` when planning-context coverage is ok (ADR 0041).
105
+ - **Do not** parallelize threaded debate lanes in one batch (except `parallel_probes` inspector ∥ adversary per ADR 0042).
106
+ - **Do not** let executor or parent self-certify.
107
+ - **Do not** stop review on benchmark fail — complete verdict and route via steer (ADR 0044).
108
+ - **Do not** tell user to run `/harness-plan "<new task>"` on test failure — use `/harness-steer` with `repair-brief.yaml`.
109
+ - **Do not** re-`approve_plan` every steer attempt — only when packet changes.
110
+ - **Do not** embed full plan packets in `approve_plan` / `submit_*` tool args (ADR 0043).
@@ -21,6 +21,8 @@ HARNESS_WEB_SEARCH_ENGINE=ddg_html
21
21
 
22
22
  # --- PostHog (optional) ---
23
23
  # Project key — required for harness_* telemetry when HARNESS_TELEMETRY_ENABLED=true
24
+ # WSL2: ultimate-pi loads 00-posthog-network-bootstrap.ts (IPv4 fetch for *.posthog.com).
25
+ # If flush still fails, set POSTHOG_ENABLED=false or fix outbound HTTPS to PostHog.
24
26
  # POSTHOG_API_KEY=
25
27
  # POSTHOG_HOST=https://us.i.posthog.com
26
28
  # POSTHOG_ENABLED=true
@@ -39,6 +41,6 @@ HARNESS_WEB_SEARCH_ENGINE=ddg_html
39
41
  # --- Wiki / Obsidian vault (optional) ---
40
42
  VAULT_WIKI_PATH=vault/wiki
41
43
 
42
- # --- Sentrux gate (optional) ---
43
- # Require Sentrux stub for harness-verify (see .pi/scripts/harness-verify.mjs)
44
- # HARNESS_SENTRUX_REQUIRED=true
44
+ # --- Sentrux fitness functions ---
45
+ # Require sentrux check + run signal (or CI stub) in harness-verify
46
+ HARNESS_SENTRUX_REQUIRED=true
@@ -2,5 +2,5 @@
2
2
  "schema_version": "1.0.0",
3
3
  "signal_type": "stub",
4
4
  "score": 0.5,
5
- "note": "Placeholder until Sentrux MCP is wired. Satisfies HARNESS_SENTRUX_REQUIRED gate in harness:verify."
5
+ "note": "Fallback when HARNESS_RUN_DIR/artifacts/sentrux-signal.yaml is absent. Prefer run signal from /harness-run (ADR 0006)."
6
6
  }
@@ -26,13 +26,16 @@ async function scanFocusCoverage(fixtureRoot, requiredFocus) {
26
26
  let last_round_index = 0;
27
27
  const { readdir } = await import("node:fs/promises");
28
28
  const files = (await readdir(art)).filter((f) =>
29
- /^review-round(?:-r\d+|-consolidated)\.yaml$/i.test(f),
29
+ /^review-round(?:-r\d+|-consolidated|-parallel-probes)\.yaml$/i.test(f),
30
30
  );
31
31
  for (const name of files.sort()) {
32
32
  const consolidated = /^review-round-consolidated\.yaml$/i.test(name);
33
+ const parallelProbes = /^review-round-parallel-probes\.yaml$/i.test(name);
33
34
  const m = consolidated
34
35
  ? ["review-round-consolidated.yaml", "1"]
35
- : /^review-round-r(\d+)\.yaml$/i.exec(name);
36
+ : parallelProbes
37
+ ? ["review-round-parallel-probes.yaml", "1"]
38
+ : /^review-round-r(\d+)\.yaml$/i.exec(name);
36
39
  if (!m) continue;
37
40
  const roundIndex = consolidated ? 1 : Number(m[1]);
38
41
  if (roundIndex > last_round_index) last_round_index = roundIndex;
@@ -13,7 +13,7 @@ This directory is the canonical contract surface for Phase 1 harness artifacts.
13
13
 
14
14
  These schemas define the minimum machine-readable contracts for:
15
15
 
16
- - planning (`PlanPacket`, `PlanDecompositionBrief`, `PlanHypothesisBrief`, `PlanHypothesisEval`, `PlanAdversaryBrief`)
16
+ - planning (`PlanPacket`, `PlanPlanningContext`, `PlanDecompositionBrief`, `PlanHypothesisBrief`, `PlanHypothesisEval`, `PlanAdversaryBrief`, legacy `PlanScoutFindings`)
17
17
  - execution telemetry (`RunTrace`, `HarnessRunRecord`)
18
18
  - PostHog harness events (`HarnessPostHogEvent`)
19
19
  - observation bus (`HarnessObservation`)
@@ -75,6 +75,17 @@
75
75
  },
76
76
  "turn_override_run_id": {
77
77
  "type": ["string", "null"]
78
+ },
79
+ "steer_approved": {
80
+ "type": "boolean"
81
+ },
82
+ "steer_attempt": {
83
+ "type": "integer",
84
+ "minimum": 0
85
+ },
86
+ "steer_max_attempts": {
87
+ "type": "integer",
88
+ "minimum": 1
78
89
  }
79
90
  }
80
91
  }
@@ -23,6 +23,7 @@
23
23
  "revise",
24
24
  "plan_review",
25
25
  "execute",
26
+ "repair",
26
27
  "benchmark",
27
28
  "verdict",
28
29
  "adversary",
@@ -61,6 +62,19 @@
61
62
  "handoff_summary": {
62
63
  "type": "string",
63
64
  "description": "Prior phase bullet summary for chained spawns (harness-auto)"
65
+ },
66
+ "critical_path_work_item_ids": {
67
+ "type": "array",
68
+ "items": { "type": "string", "minLength": 1 },
69
+ "description": "Limiting-step work item ids from execution_plan.schedule_metadata (execute phase)"
70
+ },
71
+ "repair_brief_path": {
72
+ "type": "string",
73
+ "description": "Path to repair-brief.yaml (steer / repair mode)"
74
+ },
75
+ "executor_strategy": {
76
+ "type": "string",
77
+ "enum": ["single_pass", "per_lake", "per_work_item"]
64
78
  }
65
79
  }
66
80
  }
@@ -36,9 +36,41 @@
36
36
  "items": { "$ref": "#/$defs/risk" }
37
37
  },
38
38
  "schedule_metadata": { "$ref": "#/$defs/schedule_metadata" },
39
- "dag_validation": { "$ref": "#/$defs/dag_validation" }
39
+ "dag_validation": { "$ref": "#/$defs/dag_validation" },
40
+ "lakes": {
41
+ "type": "array",
42
+ "items": { "$ref": "#/$defs/lake" }
43
+ },
44
+ "executor_strategy": {
45
+ "type": "string",
46
+ "enum": ["single_pass", "per_lake", "per_work_item"]
47
+ },
48
+ "critical_path_lake_ids": {
49
+ "type": "array",
50
+ "items": { "type": "string", "minLength": 1 }
51
+ }
40
52
  },
41
53
  "$defs": {
54
+ "lake": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["lake_id", "title", "outcome", "done_criteria"],
58
+ "properties": {
59
+ "lake_id": { "type": "string", "minLength": 1 },
60
+ "title": { "type": "string", "minLength": 1 },
61
+ "outcome": { "type": "string", "minLength": 1 },
62
+ "done_criteria": { "type": "string", "minLength": 1 },
63
+ "context_bundle_path": { "type": "string", "minLength": 1 },
64
+ "files": {
65
+ "type": "array",
66
+ "items": { "type": "string", "minLength": 1 }
67
+ },
68
+ "out_of_scope": {
69
+ "type": "array",
70
+ "items": { "type": "string", "minLength": 1 }
71
+ }
72
+ }
73
+ },
42
74
  "phase": {
43
75
  "type": "object",
44
76
  "additionalProperties": false,
@@ -107,6 +139,12 @@
107
139
  "type": "array",
108
140
  "minItems": 1,
109
141
  "items": { "type": "string", "minLength": 1 }
142
+ },
143
+ "lake_id": { "type": "string", "minLength": 1 },
144
+ "context_bundle_path": { "type": "string", "minLength": 1 },
145
+ "context_refs": {
146
+ "type": "array",
147
+ "items": { "type": "string", "minLength": 1 }
110
148
  }
111
149
  }
112
150
  },
@@ -94,6 +94,10 @@
94
94
  },
95
95
  "execution_plan": {
96
96
  "$ref": "plan-execution-plan.schema.json"
97
+ },
98
+ "executor_strategy": {
99
+ "type": "string",
100
+ "enum": ["single_pass", "per_lake", "per_work_item"]
97
101
  }
98
102
  }
99
103
  }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultimate-pi.local/.pi/harness/specs/plan-phase-status.schema.json",
4
+ "title": "PlanPhaseStatus",
5
+ "description": "Orchestrator-recorded plan phase outcome before baseline approval.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "plan_status"],
9
+ "properties": {
10
+ "schema_version": { "type": "string", "const": "1.0.0" },
11
+ "plan_status": {
12
+ "type": "string",
13
+ "enum": ["ready", "partial", "needs_clarification"]
14
+ },
15
+ "notes": { "type": "string" }
16
+ }
17
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultimate-pi.local/.pi/harness/specs/plan-phase-waiver.schema.json",
4
+ "title": "PlanPhaseWaiver",
5
+ "description": "Explicit human waiver for partial scouts or plan-phase blockers before approve_plan.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "waived"],
9
+ "properties": {
10
+ "schema_version": { "type": "string", "const": "1.0.0" },
11
+ "waived": {
12
+ "type": "array",
13
+ "minItems": 1,
14
+ "items": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["reason", "rationale"],
18
+ "properties": {
19
+ "reason": { "type": "string", "minLength": 1 },
20
+ "rationale": { "type": "string", "minLength": 1 }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultimate-pi.local/.pi/harness/specs/plan-planning-context.schema.json",
4
+ "title": "PlanPlanningContext",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema_version", "status", "summary", "coverage"],
8
+ "properties": {
9
+ "schema_version": { "type": "string", "const": "1.0.0" },
10
+ "status": {
11
+ "type": "string",
12
+ "enum": ["ok", "partial", "failed", "error"]
13
+ },
14
+ "task_ref": { "type": "string" },
15
+ "summary": { "type": "string", "minLength": 1 },
16
+ "coverage": {
17
+ "type": "object",
18
+ "required": ["architecture", "structure"],
19
+ "properties": {
20
+ "architecture": { "$ref": "#/$defs/coverageLane" },
21
+ "structure": { "$ref": "#/$defs/coverageLane" },
22
+ "semantic": { "$ref": "#/$defs/coverageLane" }
23
+ },
24
+ "additionalProperties": true
25
+ },
26
+ "findings": { "type": "array" },
27
+ "key_paths": { "type": "array", "items": { "type": "string" } },
28
+ "evidence_refs": { "type": "array" },
29
+ "open_questions": { "type": "array" }
30
+ },
31
+ "$defs": {
32
+ "coverageLane": {
33
+ "type": "object",
34
+ "required": ["status"],
35
+ "properties": {
36
+ "status": {
37
+ "type": "string",
38
+ "enum": ["ok", "partial", "skipped", "failed", "error"]
39
+ },
40
+ "tools_used": {
41
+ "type": "array",
42
+ "items": { "type": "string" }
43
+ },
44
+ "summary": { "type": "string" },
45
+ "key_paths": { "type": "array", "items": { "type": "string" } }
46
+ },
47
+ "additionalProperties": true
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultimate-pi.local/.pi/harness/specs/repair-brief.schema.json",
4
+ "title": "RepairBrief",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "run_id",
10
+ "steer_attempt",
11
+ "remediation_class",
12
+ "source_artifacts",
13
+ "fix_directives"
14
+ ],
15
+ "properties": {
16
+ "schema_version": { "type": "string", "const": "1.0.0" },
17
+ "run_id": { "type": "string", "minLength": 1 },
18
+ "steer_attempt": { "type": "integer", "minimum": 1 },
19
+ "remediation_class": {
20
+ "type": "string",
21
+ "enum": ["implementation_gap", "plan_gap", "rollback", "inconclusive"]
22
+ },
23
+ "source_artifacts": {
24
+ "type": "object",
25
+ "additionalProperties": { "type": "string" }
26
+ },
27
+ "failed_acceptance_check_ids": {
28
+ "type": "array",
29
+ "items": { "type": "string", "minLength": 1 }
30
+ },
31
+ "priority_lake_ids": {
32
+ "type": "array",
33
+ "items": { "type": "string", "minLength": 1 }
34
+ },
35
+ "fix_directives": {
36
+ "type": "array",
37
+ "minItems": 1,
38
+ "items": { "type": "string", "minLength": 1 }
39
+ },
40
+ "constraints": {
41
+ "type": "array",
42
+ "items": { "type": "string", "minLength": 1 }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultimate-pi.local/.pi/harness/specs/review-outcome.schema.json",
4
+ "title": "ReviewOutcome",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "run_id",
10
+ "status",
11
+ "remediation_class",
12
+ "recommended_next"
13
+ ],
14
+ "properties": {
15
+ "schema_version": { "type": "string", "const": "1.0.0" },
16
+ "run_id": { "type": "string", "minLength": 1 },
17
+ "status": {
18
+ "type": "string",
19
+ "enum": ["pass", "fail", "inconclusive"]
20
+ },
21
+ "remediation_class": {
22
+ "type": "string",
23
+ "enum": [
24
+ "pass",
25
+ "implementation_gap",
26
+ "plan_gap",
27
+ "rollback",
28
+ "inconclusive"
29
+ ]
30
+ },
31
+ "recommended_next": { "type": "string", "minLength": 1 },
32
+ "failed_acceptance_check_ids": {
33
+ "type": "array",
34
+ "items": { "type": "string", "minLength": 1 }
35
+ },
36
+ "steer_attempt": { "type": "integer", "minimum": 0 },
37
+ "review_tier": {
38
+ "type": "string",
39
+ "enum": ["full", "lite"]
40
+ },
41
+ "source_artifacts": {
42
+ "type": "object",
43
+ "additionalProperties": { "type": "string" }
44
+ }
45
+ }
46
+ }