ultimate-pi 0.11.0 → 0.12.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.
- package/.agents/skills/harness-debate-plan/SKILL.md +44 -0
- package/.agents/skills/harness-decisions/SKILL.md +1 -1
- package/.agents/skills/harness-orchestration/SKILL.md +54 -28
- package/.agents/skills/harness-plan/SKILL.md +15 -20
- package/.pi/agents/harness/adversary.md +0 -1
- package/.pi/agents/harness/evaluator.md +0 -1
- package/.pi/agents/harness/executor.md +1 -2
- package/.pi/agents/harness/incident-recorder.md +0 -1
- package/.pi/agents/harness/meta-optimizer.md +0 -1
- package/.pi/agents/harness/planning/decompose.md +3 -4
- package/.pi/agents/harness/planning/execution-plan-author.md +30 -0
- package/.pi/agents/harness/planning/hypothesis-validator.md +23 -0
- package/.pi/agents/harness/planning/hypothesis.md +3 -4
- package/.pi/agents/harness/planning/plan-adversary.md +10 -42
- package/.pi/agents/harness/planning/plan-evaluator.md +18 -0
- package/.pi/agents/harness/planning/review-integrator.md +23 -0
- package/.pi/agents/harness/planning/scout-graphify.md +11 -5
- package/.pi/agents/harness/planning/scout-semantic.md +11 -6
- package/.pi/agents/harness/planning/scout-structure.md +12 -6
- package/.pi/agents/harness/planning/sprint-contract-auditor.md +18 -0
- package/.pi/agents/harness/planning/stack-researcher.md +24 -0
- package/.pi/agents/harness/tie-breaker.md +0 -1
- package/.pi/agents/harness/trace-librarian.md +0 -1
- package/.pi/extensions/debate-orchestrator.ts +90 -53
- package/.pi/extensions/harness-plan-approval.ts +2 -2
- package/.pi/extensions/harness-run-context.ts +145 -5
- package/.pi/extensions/harness-subagents.ts +2 -2
- package/.pi/extensions/lib/harness-posthog.ts +6 -1
- package/.pi/extensions/lib/harness-spawn-budget.ts +75 -0
- package/.pi/extensions/lib/harness-subagent-auth.ts +123 -0
- package/.pi/extensions/lib/{harness-subagents/harness-subagent-policy.ts → harness-subagent-policy.ts} +3 -6
- package/.pi/extensions/lib/harness-subagent-precheck.ts +95 -0
- package/.pi/extensions/lib/harness-subagents-bridge.ts +176 -0
- package/.pi/extensions/lib/plan-approval/create-plan.ts +4 -7
- package/.pi/extensions/lib/plan-approval/plan-review.ts +1 -1
- package/.pi/extensions/lib/plan-approval/types.ts +7 -1
- package/.pi/extensions/lib/plan-debate-envelope.ts +84 -0
- package/.pi/extensions/lib/{harness-subagents/spawn-policy.ts → spawn-policy.ts} +1 -0
- package/.pi/extensions/policy-gate.ts +1 -1
- package/.pi/extensions/review-integrity.ts +48 -29
- package/.pi/harness/agents.manifest.json +37 -25
- package/.pi/harness/docs/adrs/0032-harness-command-orchestration.md +4 -3
- package/.pi/harness/docs/adrs/0033-parent-orchestrated-planning.md +1 -1
- package/.pi/harness/docs/adrs/0035-plan-phase-review-gate.md +27 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med/artifacts/review-round-r1.yaml +25 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med/artifacts/review-round-r4.yaml +26 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med/artifacts/sprint-audit-r4.yaml +5 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med/plan-packet.yaml +196 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med/plan-review.md +14 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med/research-brief.yaml +32 -0
- package/.pi/harness/evals/smoke/run-context.fixture.json +1 -1
- package/.pi/harness/evals/smoke/smoke-harness-plan.mjs +88 -0
- package/.pi/harness/specs/harness-posthog-event.schema.json +6 -1
- package/.pi/harness/specs/plan-execution-plan-brief.schema.json +13 -0
- package/.pi/harness/specs/plan-execution-plan.schema.json +255 -0
- package/.pi/harness/specs/plan-packet.schema.json +14 -5
- package/.pi/harness/specs/plan-review-round-draft.schema.json +68 -0
- package/.pi/harness/specs/plan-sprint-audit-turn.schema.json +29 -0
- package/.pi/harness/specs/plan-stack-brief.schema.json +65 -0
- package/.pi/harness/specs/plan-validation-turn.schema.json +42 -0
- package/.pi/harness/specs/round-result.schema.json +16 -9
- package/.pi/lib/debate-orchestrator-types.ts +38 -0
- package/.pi/lib/harness-agent-discovery.mjs +81 -0
- package/.pi/lib/harness-run-context.ts +64 -38
- package/.pi/lib/harness-yaml.mjs +73 -0
- package/.pi/lib/harness-yaml.ts +90 -0
- package/.pi/prompts/harness-auto.md +13 -11
- package/.pi/prompts/harness-critic.md +2 -2
- package/.pi/prompts/harness-eval.md +3 -3
- package/.pi/prompts/harness-incident.md +2 -2
- package/.pi/prompts/harness-plan.md +79 -93
- package/.pi/prompts/harness-review.md +2 -2
- package/.pi/prompts/harness-router-tune.md +1 -1
- package/.pi/prompts/harness-run.md +2 -2
- package/.pi/prompts/harness-setup.md +15 -6
- package/.pi/prompts/harness-trace.md +2 -2
- package/.pi/scripts/harness-agents-manifest.mjs +1 -1
- package/.pi/scripts/harness-verify.mjs +28 -19
- package/.pi/scripts/validate-plan-dag.mjs +258 -0
- package/.pi/scripts/vendor-sync-pi-subagents.sh +19 -0
- package/CHANGELOG.md +12 -0
- package/THIRD_PARTY_NOTICES.md +8 -0
- package/biome.json +2 -2
- package/package.json +6 -4
- package/.pi/agents/harness/planner.md +0 -13
- package/.pi/agents/harness/planning/hypothesis-eval.md +0 -59
- package/.pi/agents/harness/planning/planner.md +0 -20
- package/.pi/extensions/lib/harness-subagents/agent-loader.ts +0 -126
- package/.pi/extensions/lib/harness-subagents/agent-manifest.ts +0 -119
- package/.pi/extensions/lib/harness-subagents/agent-parser.ts +0 -87
- package/.pi/extensions/lib/harness-subagents/blackboard-tool.ts +0 -118
- package/.pi/extensions/lib/harness-subagents/blackboard.ts +0 -175
- package/.pi/extensions/lib/harness-subagents/parent-ask-user-bridge.ts +0 -10
- package/.pi/extensions/lib/harness-subagents/parent-harness-ui-bridge.ts +0 -137
- package/.pi/extensions/lib/harness-subagents/parent-harness-ui-hooks.ts +0 -77
- package/.pi/extensions/lib/harness-subagents/types-blackboard.ts +0 -27
- package/.pi/extensions/lib/harness-subagents/vendored/agent-manager.ts +0 -558
- package/.pi/extensions/lib/harness-subagents/vendored/agent-runner.ts +0 -666
- package/.pi/extensions/lib/harness-subagents/vendored/agent-types.ts +0 -175
- package/.pi/extensions/lib/harness-subagents/vendored/context.ts +0 -59
- package/.pi/extensions/lib/harness-subagents/vendored/cross-extension-rpc.ts +0 -134
- package/.pi/extensions/lib/harness-subagents/vendored/custom-agents.ts +0 -5
- package/.pi/extensions/lib/harness-subagents/vendored/default-agents.ts +0 -123
- package/.pi/extensions/lib/harness-subagents/vendored/env.ts +0 -43
- package/.pi/extensions/lib/harness-subagents/vendored/group-join.ts +0 -144
- package/.pi/extensions/lib/harness-subagents/vendored/index.ts +0 -2460
- package/.pi/extensions/lib/harness-subagents/vendored/invocation-config.ts +0 -52
- package/.pi/extensions/lib/harness-subagents/vendored/memory.ts +0 -182
- package/.pi/extensions/lib/harness-subagents/vendored/model-resolver.ts +0 -92
- package/.pi/extensions/lib/harness-subagents/vendored/output-file.ts +0 -115
- package/.pi/extensions/lib/harness-subagents/vendored/prompts.ts +0 -103
- package/.pi/extensions/lib/harness-subagents/vendored/schedule-store.ts +0 -177
- package/.pi/extensions/lib/harness-subagents/vendored/schedule.ts +0 -416
- package/.pi/extensions/lib/harness-subagents/vendored/settings.ts +0 -210
- package/.pi/extensions/lib/harness-subagents/vendored/skill-loader.ts +0 -108
- package/.pi/extensions/lib/harness-subagents/vendored/types.ts +0 -187
- package/.pi/extensions/lib/harness-subagents/vendored/ui/agent-widget.ts +0 -639
- package/.pi/extensions/lib/harness-subagents/vendored/ui/conversation-viewer.ts +0 -324
- package/.pi/extensions/lib/harness-subagents/vendored/ui/schedule-menu.ts +0 -110
- package/.pi/extensions/lib/harness-subagents/vendored/usage.ts +0 -71
- package/.pi/extensions/lib/harness-subagents/vendored/worktree.ts +0 -195
- /package/.pi/extensions/{00-ultimate-pi-system-prompt.ts → custom-system-prompt.ts} +0 -0
|
@@ -1,154 +1,140 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: PM-grade harness plan — scouts, ExecutionPlan, DAG validation, Review Gate debate, approval.
|
|
3
3
|
argument-hint: "\"<task>\" [--risk low|med|high] [--budget <amount>] [--quick]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# harness-plan
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
You are the **planning PM** for this harness run. Produce an execution baseline (`plan-packet.yaml` + `plan-review.md`), not strategy theater. Parent owns `ask_user`, `approve_plan`, `create_plan`, debate bus commands, and YAML writes under `.pi/harness/runs/<run_id>/`.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Never `write`/`edit` the final canonical packet except via **`write_harness_yaml`** for run artifacts and **`create_plan`** after approval. Do not paste JSON into `.yaml` files — subagents emit JSON; you convert via `write_harness_yaml`.
|
|
11
|
+
|
|
12
|
+
## Allowed subagents
|
|
11
13
|
|
|
12
14
|
- `harness/planning/scout-graphify`
|
|
13
15
|
- `harness/planning/scout-structure`
|
|
14
|
-
- `harness/planning/scout-semantic`
|
|
16
|
+
- `harness/planning/scout-semantic` (skip when `--quick`)
|
|
15
17
|
- `harness/planning/decompose`
|
|
16
18
|
- `harness/planning/hypothesis`
|
|
19
|
+
- `harness/planning/stack-researcher`
|
|
20
|
+
- `harness/planning/execution-plan-author`
|
|
21
|
+
- `harness/planning/hypothesis-validator` (debate R1 only)
|
|
22
|
+
- `harness/planning/plan-evaluator`
|
|
17
23
|
- `harness/planning/plan-adversary`
|
|
18
|
-
- `harness/planning/
|
|
19
|
-
|
|
20
|
-
Do **not** spawn `harness/planner` or `harness/planning/planner`.
|
|
24
|
+
- `harness/planning/sprint-contract-auditor`
|
|
25
|
+
- `harness/planning/review-integrator`
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
Read **harness-debate-plan** skill before Review Gate rounds.
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
## Performance rules
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
1. Use `subagent` with `agentScope: "both"` and parallel `tasks` where lanes are independent.
|
|
32
|
+
2. Each `subagent` call blocks until subprocesses finish — batch parallel scouts in one `tasks` array.
|
|
33
|
+
3. Cap: **12** harness subagent invocations per parent session (extension-enforced).
|
|
34
|
+
4. Compact task text: embed `HarnessSpawnContext` JSON + lane-specific instructions only.
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
## Step 0 — Parse `$ARGUMENTS`
|
|
30
37
|
|
|
31
|
-
|
|
38
|
+
- task (required)
|
|
39
|
+
- `--risk low|med|high`, `--budget`, `--quick`
|
|
32
40
|
|
|
33
|
-
`--quick` skips
|
|
41
|
+
`--quick` skips **scout-semantic** and post-run adversary only — **never** skip graphify, structure, decompose, hypothesis, stack research, execution plan, DAG validation, or **4-round plan debate**.
|
|
34
42
|
|
|
35
43
|
## Active plan context
|
|
36
44
|
|
|
37
|
-
Use
|
|
45
|
+
Use `[HarnessActivePlan]` / `[HarnessRunContext]` only. On revise: preserve `plan_id` / `task_id`. Canonical paths: `plan-packet.yaml`, `research-brief.yaml`, `artifacts/*.yaml`.
|
|
46
|
+
|
|
47
|
+
## Phase 1 — Parallel scouts
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"agentScope": "both",
|
|
52
|
+
"tasks": [
|
|
53
|
+
{ "agent": "harness/planning/scout-graphify", "task": "<HarnessSpawnContext + graphify lane>", "timeoutMs": 90000 },
|
|
54
|
+
{ "agent": "harness/planning/scout-structure", "task": "<HarnessSpawnContext + structure lane>", "timeoutMs": 90000 }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
40
58
|
|
|
41
|
-
-
|
|
42
|
-
- Set `mode: revise` in `HarnessSpawnContext` from `[HarnessRunContext]`.
|
|
43
|
-
- **Preserve `plan_id` and `task_id`** from the existing packet when amending.
|
|
44
|
-
- Scouts focus on delta vs existing `plan_packet_path`; full re-scout only if scope changed materially.
|
|
59
|
+
Add `harness/planning/scout-semantic` to `tasks` unless `--quick`. Require graphify + structure success.
|
|
45
60
|
|
|
46
|
-
|
|
61
|
+
## Phase 2 & 3 — Decompose + hypothesis (parallel)
|
|
47
62
|
|
|
48
|
-
|
|
63
|
+
One `subagent` call with `tasks` for `harness/planning/decompose` and `harness/planning/hypothesis`. Parse `PlanDecompositionBrief` and `PlanHypothesisBrief` from outputs. Persist with `write_harness_yaml` → `artifacts/decomposition.yaml` and `artifacts/hypothesis.yaml`.
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
2. Spawn scouts with **`inherit_context: false`**. Prefer parallel: `run_in_background: true` on each `Agent` call, then `get_subagent_result` for all.
|
|
65
|
+
## Phase 4 — Draft shell + fork
|
|
52
66
|
|
|
53
|
-
|
|
54
|
-
Agent({ subagent_type: "harness/planning/scout-graphify", prompt: "<task + HarnessSpawnContext + scout JSON schema>", run_in_background: true })
|
|
55
|
-
Agent({ subagent_type: "harness/planning/scout-structure", prompt: "…", run_in_background: true })
|
|
56
|
-
```
|
|
67
|
+
Build draft `PlanPacket` (`contract_version: "1.1.0"`):
|
|
57
68
|
|
|
58
|
-
|
|
69
|
+
- `scope`, `assumptions`, `acceptance_checks`, `risk_level`, `rollback_plan`
|
|
70
|
+
- `execution_plan` placeholder until Phase 4b
|
|
59
71
|
|
|
60
|
-
|
|
61
|
-
4. **Partial failure:** require successful **graphify + structure** lanes. Semantic is optional. If a required lane fails, continue with `plan_status: partial` and document gaps in `assumptions`.
|
|
62
|
-
5. If JSON parse fails for a lane, summarize free-text output and add an assumption that the lane was unstructured.
|
|
72
|
+
`ask_user` when `dialectical_fork` is material.
|
|
63
73
|
|
|
64
|
-
|
|
74
|
+
Initialize `research-brief.yaml` with decomposition + hypothesis (`write_harness_yaml`).
|
|
65
75
|
|
|
66
|
-
|
|
76
|
+
## Phase 4a — Stack research
|
|
67
77
|
|
|
68
78
|
```
|
|
69
|
-
|
|
79
|
+
subagent({ agentScope: "both", agent: "harness/planning/stack-researcher", task: "<HarnessSpawnContext + stack research brief>" })
|
|
70
80
|
```
|
|
71
81
|
|
|
72
|
-
|
|
73
|
-
3. On parse failure: one retry with “output valid JSON only”; if still failing, abort with `plan_status: needs_clarification`.
|
|
74
|
-
|
|
75
|
-
## Phase 3 — Hypothesis (DARWIN)
|
|
82
|
+
`write_harness_yaml` → `artifacts/stack.yaml`; merge into `research-brief.yaml` → `stack`.
|
|
76
83
|
|
|
77
|
-
|
|
84
|
+
## Phase 4b — Execution plan author
|
|
78
85
|
|
|
79
86
|
```
|
|
80
|
-
|
|
87
|
+
subagent({ agentScope: "both", agent: "harness/planning/execution-plan-author", task: "<HarnessSpawnContext + execution plan brief>" })
|
|
81
88
|
```
|
|
82
89
|
|
|
83
|
-
|
|
84
|
-
3. **Revision cap:** at most **one** re-spawn of `hypothesis` if Phase 6 eval requests revision (see below).
|
|
90
|
+
Merge `execution_plan` into draft `plan-packet.yaml` (`write_harness_yaml`). Save `artifacts/execution-plan-draft.yaml` the same way.
|
|
85
91
|
|
|
86
|
-
## Phase
|
|
92
|
+
## Phase 4c — DAG validation (hard gate)
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|-------|--------|
|
|
92
|
-
| `scope` | `problem_restatement` (narrowed) + `primary.claim` + `primary.mechanism` (implementation-ready) |
|
|
93
|
-
| `assumptions` | `core_tension`, `prior_art.dead_ends`, scout `open_questions`, chosen fork path (if any) |
|
|
94
|
-
| `acceptance_checks` | Each `primary.prediction` and `primary.experiment` as verifiable checklist items (min 1) |
|
|
95
|
-
| `risk_level` | From `$ARGUMENTS` or infer from fork uncertainty / blast radius |
|
|
96
|
-
|
|
97
|
-
Build complete draft: `plan_id`, `task_id`, `scope`, `assumptions`, `risk_level`, `acceptance_checks`, `rollback_plan` (`revert_commit_ready: true`, artifacts filled).
|
|
98
|
-
|
|
99
|
-
Call **`ask_user`** when `dialectical_fork` is material (Path A vs B materially different) **before** Phase 5 reviews.
|
|
94
|
+
```bash
|
|
95
|
+
node .pi/scripts/validate-plan-dag.mjs --packet .pi/harness/runs/<run_id>/plan-packet.yaml --write
|
|
96
|
+
```
|
|
100
97
|
|
|
101
|
-
|
|
98
|
+
Must **pass** before debate. On fail: fix via author or parent patches, re-run.
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
"decomposition": { /* PlanDecompositionBrief */ },
|
|
106
|
-
"hypothesis": { /* PlanHypothesisBrief */ },
|
|
107
|
-
"eval": null
|
|
108
|
-
}
|
|
109
|
-
```
|
|
100
|
+
## Phase 5 — Review Gate debate (4 rounds, even with `--quick`)
|
|
110
101
|
|
|
111
|
-
|
|
102
|
+
1. `/harness-debate-open plan-<run_id>`
|
|
103
|
+
2. For rounds 1–4 (`debate_round_focus`: spec, wbs, schedule, quality):
|
|
112
104
|
|
|
113
|
-
|
|
105
|
+
| Round | Extra spawns (before integrator) |
|
|
106
|
+
|-------|----------------------------------|
|
|
107
|
+
| 1 | `hypothesis-validator` (blind: task + hypothesis only) → `plan-evaluator` → `plan-adversary` |
|
|
108
|
+
| 2 | `plan-evaluator` → `plan-adversary` (optional `sprint-contract-auditor` if done_criteria thin) |
|
|
109
|
+
| 3 | `plan-evaluator` → `plan-adversary` |
|
|
110
|
+
| 4 | `plan-evaluator` → `plan-adversary` → **`sprint-contract-auditor` (required)** |
|
|
114
111
|
|
|
115
|
-
|
|
116
|
-
Agent({ subagent_type: "harness/planning/plan-adversary", prompt: "<HarnessSpawnContext + draft PlanPacket + scout summaries + decomposition human_summary>", inherit_context: false })
|
|
117
|
-
Agent({ subagent_type: "harness/planning/hypothesis-eval", prompt: "<original task ONLY + PlanHypothesisBrief JSON — no decomposition, no PlanPacket>", inherit_context: false })
|
|
118
|
-
```
|
|
112
|
+
Then `review-integrator` → `write_harness_yaml` → `artifacts/review-round-r{N}.yaml` → build bus envelope → `/harness-debate-round '<json>'`.
|
|
119
113
|
|
|
120
|
-
|
|
121
|
-
2. Parse `PlanHypothesisEval` — set `research_brief.eval`.
|
|
122
|
-
3. If `revision_recommended` or testability < 70 or `relevance.passes` is false: re-spawn `hypothesis` once with eval rationale, update PlanPacket + `research_brief.hypothesis`, then re-run **hypothesis-eval** only (not adversary unless PlanPacket changed materially).
|
|
114
|
+
3. `/harness-debate-consensus` after round 4.
|
|
123
115
|
|
|
124
|
-
|
|
116
|
+
**R1 blind rule:** hypothesis-validator prompt must exclude decomposition, scouts, PlanPacket, prior debate.
|
|
125
117
|
|
|
126
|
-
|
|
118
|
+
If R1 `revision_recommended` or `relevance.passes === false`: one `hypothesis` re-spawn, update brief, continue.
|
|
127
119
|
|
|
128
|
-
|
|
129
|
-
2. On **Approve** only, call **`create_plan`** with the **same** `plan_packet`.
|
|
130
|
-
3. If `create_plan` fails, tell the user to fix validation errors or run `/harness-plan-commit` after approval is recorded.
|
|
131
|
-
4. Confirm `[HarnessRunContext]` `plan_ready: true` before handoff.
|
|
120
|
+
**Blockers:** `policy_decision: block` → do not `approve_plan`. `human_required` → `ask_user` before approval.
|
|
132
121
|
|
|
133
|
-
|
|
122
|
+
## Phase 5b — Revise packet
|
|
134
123
|
|
|
135
|
-
|
|
124
|
+
Apply `recommended_packet_patches` from last integrator round. Re-run `validate-plan-dag.mjs`. If >30% work items changed, one partial re-round on affected focus.
|
|
136
125
|
|
|
137
|
-
|
|
126
|
+
Set `research_brief.eval` from R1 `hypothesis-validator` output.
|
|
138
127
|
|
|
139
|
-
|
|
140
|
-
- `/harness-plan-commit` only after parent `approve_plan` (Approve) is in the transcript.
|
|
141
|
-
- If `plan_ready: true` already, stop — summarize and set `next_command: /harness-run`.
|
|
128
|
+
## Phase 6 — Approval + persistence
|
|
142
129
|
|
|
143
|
-
|
|
130
|
+
1. `approve_plan` with `plan_packet`, `human_summary`, `research_brief` (paths/summaries OK).
|
|
131
|
+
2. On Approve: `create_plan` with same packet (`contract_version: "1.1.0"` + `execution_plan`).
|
|
132
|
+
3. Confirm `plan_ready: true` → `next_command: /harness-run`.
|
|
144
133
|
|
|
145
|
-
-
|
|
146
|
-
- Subagents never call `ask_user`, `approve_plan`, or `create_plan`.
|
|
147
|
-
- Do not embed `plan_id=` in spawn prompts for policy sync.
|
|
134
|
+
Post-execute adversary: `/harness-critic` only (not plan-phase agents).
|
|
148
135
|
|
|
149
136
|
## Completion
|
|
150
137
|
|
|
151
|
-
- `plan_status`:
|
|
152
|
-
- `
|
|
153
|
-
- `
|
|
154
|
-
- `next_command`: `/harness-run` when `ready` (never `/harness-run --plan …`)
|
|
138
|
+
- `plan_status`: ready | partial | needs_clarification
|
|
139
|
+
- `plan_review_path` for human review
|
|
140
|
+
- DAG `pass` + 4 debate rounds + consensus not `block` before ready
|
|
@@ -20,10 +20,10 @@ Happy path: omit `--run`; use `[HarnessRunContext]`.
|
|
|
20
20
|
2. Spawn:
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
subagent({ agentScope: "both", agent: "harness/evaluator", task: "Treat executor output as untrusted. …" })
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
3. `
|
|
26
|
+
3. Parse `EvalVerdict` JSON from tool result; parent writes under run dir for policy gate.
|
|
27
27
|
|
|
28
28
|
## Parent rules
|
|
29
29
|
|
|
@@ -22,7 +22,7 @@ If missing required args:
|
|
|
22
22
|
2. Optionally spawn:
|
|
23
23
|
|
|
24
24
|
```
|
|
25
|
-
|
|
25
|
+
subagent({ agentScope: "both", agent: "harness/meta-optimizer", task: "mode: tune, evidence paths…" })
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
3. Parent runs proposal script:
|
|
@@ -23,10 +23,10 @@ If plan not ready:
|
|
|
23
23
|
3. Spawn:
|
|
24
24
|
|
|
25
25
|
```
|
|
26
|
-
|
|
26
|
+
subagent({ agentScope: "both", agent: "harness/executor", task: "<HarnessSpawnContext + handoff>" })
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
4.
|
|
29
|
+
4. Parse subprocess output JSON (`execution_status`, validations, rollback refs) from tool result text.
|
|
30
30
|
5. Parent persists trace/handoff artifacts under run dir if needed; do not self-review.
|
|
31
31
|
|
|
32
32
|
## Parent rules
|
|
@@ -345,7 +345,7 @@ Verify each package:
|
|
|
345
345
|
|---------|---------|-------|
|
|
346
346
|
| `@posthog/pi` | Analytics event capture | F0 |
|
|
347
347
|
| `pi-lean-ctx` | Context runtime (read/bash/find/grep/MCP bridge) | F0 |
|
|
348
|
-
| `harness-subagents` (bundled extension) | L4
|
|
348
|
+
| `harness-subagents` (bundled extension) | L4 `subagent` tool, subprocess spawns, package agents | P16 |
|
|
349
349
|
| Vendored `pi-vcc` (`vendor/pi-vcc`, `.pi/extensions/ultimate-pi-vcc.ts`) | VCC compaction / `vcc_recall` — env-only: `HARNESS_VCC_COMPACTION` (default on), `HARNESS_VCC_DEBUG` | Shipped |
|
|
350
350
|
| `pi-model-router` | Vendored (`vendor/`); activates after `.pi/model-router.json` exists | F0 |
|
|
351
351
|
|
|
@@ -383,11 +383,11 @@ Manual override: **`/router profile auto`** anytime after reload if they changed
|
|
|
383
383
|
|
|
384
384
|
## Step 3.6 — Harness agents (package-resolved)
|
|
385
385
|
|
|
386
|
-
`harness-subagents` loads agents from the installed **`ultimate-pi`** package (`$UP_PKG/.pi/agents/**`) with namespaced ids (`harness/
|
|
386
|
+
`harness-subagents` loads agents from the installed **`ultimate-pi`** package (`$UP_PKG/.pi/agents/**`) with namespaced ids (`harness/executor`, `harness/planning/scout-graphify`, `pi-pi/agent-expert`). **Do not copy** agents into the project unless you want a deliberate override.
|
|
387
387
|
|
|
388
388
|
**Slash commands are orchestrators:** `/harness-plan`, `/harness-run`, etc. spawn `harness/*` agents via the `Agent` tool — bootstrap stays **script-first**; only optionally spawn `harness/sentrux-bootstrap` for Sentrux (see Step 4.2).
|
|
389
389
|
|
|
390
|
-
Optional per-repo overrides: place `.md` files at the **same relative path** (e.g. `.pi/agents/harness/planning/scout-graphify.md` overrides the package scout).
|
|
390
|
+
Optional per-repo overrides: place `.md` files at the **same relative path** (e.g. `.pi/agents/harness/planning/scout-graphify.md` overrides the package scout).
|
|
391
391
|
|
|
392
392
|
Verify manifest drift after `pi update ultimate-pi`:
|
|
393
393
|
|
|
@@ -478,16 +478,25 @@ Template keys (placeholders — user fills secrets): `HARNESS_TELEMETRY_ENABLED`
|
|
|
478
478
|
|
|
479
479
|
### 4.1 — .gitignore Entries
|
|
480
480
|
|
|
481
|
-
Ensure `.gitignore` contains:
|
|
481
|
+
Ensure `.gitignore` contains harness runtime entries (see repo root `.gitignore` — **do not** ignore `.pi/harness/specs/`; JSON schemas are shared contracts):
|
|
482
|
+
|
|
482
483
|
```
|
|
483
484
|
.env
|
|
484
485
|
.web/
|
|
485
486
|
.searxng/
|
|
486
487
|
.raw/
|
|
487
488
|
.vault-meta/
|
|
488
|
-
.pi/harness/
|
|
489
|
+
.pi/harness/active-run.json
|
|
490
|
+
.pi/harness/release-readiness-report.md
|
|
489
491
|
.pi/harness/plans/
|
|
490
|
-
.pi/harness/
|
|
492
|
+
.pi/harness/critics/
|
|
493
|
+
.pi/harness/runs/**
|
|
494
|
+
!.pi/harness/runs/README.md
|
|
495
|
+
.pi/harness/incidents/*
|
|
496
|
+
!.pi/harness/incidents/README.md
|
|
497
|
+
.pi/harness/debates/*
|
|
498
|
+
!.pi/harness/debates/README.md
|
|
499
|
+
.pi/harness/router/proposals/*
|
|
491
500
|
|
|
492
501
|
# Model router config (user-specific — generated from env)
|
|
493
502
|
.pi/model-router.json
|
|
@@ -20,10 +20,10 @@ Happy path: omit `--run`.
|
|
|
20
20
|
2. Spawn:
|
|
21
21
|
|
|
22
22
|
```
|
|
23
|
-
|
|
23
|
+
subagent({ agentScope: "both", agent: "harness/trace-librarian", task: "…" })
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
3.
|
|
26
|
+
3. Present timeline and artifact index from tool result to user.
|
|
27
27
|
|
|
28
28
|
## Completion
|
|
29
29
|
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
isSafeAgentId,
|
|
15
15
|
sha256Content,
|
|
16
16
|
walkAgentsDir,
|
|
17
|
-
} from "
|
|
17
|
+
} from "../lib/harness-agent-discovery.mjs";
|
|
18
18
|
|
|
19
19
|
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
20
20
|
const MANIFEST_PATH = join(ROOT, ".pi", "harness", "agents.manifest.json");
|
|
@@ -202,32 +202,41 @@ async function main() {
|
|
|
202
202
|
if (!(await fileExists(runCtxLib))) fail("missing lib/harness-run-context.ts");
|
|
203
203
|
ok("lib/harness-run-context.ts");
|
|
204
204
|
|
|
205
|
-
const
|
|
205
|
+
const subagentsVendor = join(
|
|
206
|
+
ROOT,
|
|
207
|
+
"vendor",
|
|
208
|
+
"pi-subagents",
|
|
209
|
+
"src",
|
|
210
|
+
"subagents.ts",
|
|
211
|
+
);
|
|
212
|
+
if (!(await fileExists(subagentsVendor))) {
|
|
213
|
+
fail("missing vendor/pi-subagents/src/subagents.ts");
|
|
214
|
+
}
|
|
215
|
+
const bridgePath = join(
|
|
206
216
|
ROOT,
|
|
207
217
|
".pi",
|
|
208
218
|
"extensions",
|
|
209
219
|
"lib",
|
|
210
|
-
"harness-subagents",
|
|
211
|
-
"vendored",
|
|
212
|
-
"index.ts",
|
|
220
|
+
"harness-subagents-bridge.ts",
|
|
213
221
|
);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
/from ["']([^"']*harness-run-context\.js)["']/,
|
|
217
|
-
);
|
|
218
|
-
if (!runCtxImport) {
|
|
219
|
-
fail("vendored/index.ts must import harness-run-context.js");
|
|
222
|
+
if (!(await fileExists(bridgePath))) {
|
|
223
|
+
fail("missing harness-subagents-bridge.ts");
|
|
220
224
|
}
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (
|
|
226
|
-
fail(
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
const bridgeSrc = await readFile(bridgePath, "utf-8");
|
|
226
|
+
if (!bridgeSrc.includes("precheckHarnessSubagentSpawn")) {
|
|
227
|
+
fail("harness-subagents-bridge must run precheckHarnessSubagentSpawn");
|
|
228
|
+
}
|
|
229
|
+
if (!bridgeSrc.includes("packageRoot")) {
|
|
230
|
+
fail("harness-subagents-bridge must pass packageRoot for agent discovery");
|
|
231
|
+
}
|
|
232
|
+
const subagentsSrc = await readFile(subagentsVendor, "utf-8");
|
|
233
|
+
if (!subagentsSrc.includes("discoverAgents")) {
|
|
234
|
+
fail("vendor subagents.ts must implement discoverAgents");
|
|
235
|
+
}
|
|
236
|
+
if (!subagentsSrc.includes("packageRoot")) {
|
|
237
|
+
fail("vendor subagents.ts must pass packageRoot into discovery");
|
|
229
238
|
}
|
|
230
|
-
ok("
|
|
239
|
+
ok("vendor pi-subagents + harness bridge");
|
|
231
240
|
|
|
232
241
|
const policyGateSrc = await readFile(
|
|
233
242
|
join(ROOT, ".pi", "extensions", "policy-gate.ts"),
|