ultimate-pi 0.17.0 → 0.18.1
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-context/SKILL.md +13 -6
- package/.agents/skills/harness-debate-plan/SKILL.md +37 -20
- package/.agents/skills/harness-decisions/SKILL.md +1 -1
- package/.agents/skills/harness-eval/SKILL.md +6 -21
- package/.agents/skills/harness-governor/SKILL.md +4 -3
- package/.agents/skills/harness-orchestration/SKILL.md +41 -53
- package/.agents/skills/harness-plan/SKILL.md +23 -12
- package/.agents/skills/harness-review/SKILL.md +52 -0
- package/.agents/skills/harness-sentrux-setup/SKILL.md +16 -3
- package/.agents/skills/harness-steer/SKILL.md +14 -0
- package/.agents/skills/sentrux/SKILL.md +9 -9
- package/.pi/agents/harness/planning/decompose.md +7 -4
- package/.pi/agents/harness/planning/hypothesis-validator.md +2 -0
- package/.pi/agents/harness/planning/hypothesis.md +3 -1
- package/.pi/agents/harness/planning/plan-adversary.md +2 -0
- package/.pi/agents/harness/planning/plan-evaluator.md +2 -0
- package/.pi/agents/harness/planning/plan-synthesizer.md +25 -0
- package/.pi/agents/harness/planning/planning-context.md +48 -0
- package/.pi/agents/harness/planning/review-integrator.md +2 -0
- package/.pi/agents/harness/planning/sprint-contract-auditor.md +2 -0
- package/.pi/agents/harness/{adversary.md → reviewing/adversary.md} +3 -10
- package/.pi/agents/harness/{evaluator.md → reviewing/evaluator.md} +3 -12
- package/.pi/agents/harness/running/executor.md +45 -0
- package/.pi/agents/harness/sentrux-steward.md +51 -0
- package/.pi/extensions/00-harness-project-control.ts +133 -0
- package/.pi/extensions/00-posthog-network-bootstrap.ts +11 -0
- package/.pi/extensions/budget-guard.ts +2 -0
- package/.pi/extensions/debate-orchestrator.ts +2 -0
- package/.pi/extensions/harness-ask-user.ts +2 -2
- package/.pi/extensions/harness-debate-tools.ts +2 -2
- package/.pi/extensions/harness-live-widget.ts +60 -3
- package/.pi/extensions/harness-plan-approval.ts +64 -58
- package/.pi/extensions/harness-run-context.ts +715 -90
- package/.pi/extensions/harness-subagent-submit.ts +46 -12
- package/.pi/extensions/harness-subagents.ts +2 -2
- package/.pi/extensions/harness-telemetry.ts +2 -0
- package/.pi/extensions/harness-web-tools.ts +2 -2
- package/.pi/extensions/lib/extension-load-guard.ts +10 -0
- package/.pi/extensions/lib/harness-artifact-gate.ts +172 -0
- package/.pi/extensions/lib/harness-posthog.ts +9 -5
- package/.pi/extensions/lib/harness-spawn-topology.ts +165 -0
- package/.pi/extensions/lib/harness-subagent-auth.ts +1 -2
- package/.pi/extensions/lib/harness-subagent-policy.ts +28 -24
- package/.pi/extensions/lib/harness-subagent-precheck.ts +36 -10
- package/.pi/extensions/lib/harness-subagent-submit-pipeline.ts +66 -2
- package/.pi/extensions/lib/harness-subagent-submit-registry.ts +22 -22
- package/.pi/extensions/lib/harness-subagents-bridge.ts +7 -29
- package/.pi/extensions/lib/harness-subprocess-bootstrap.ts +73 -0
- package/.pi/extensions/lib/plan-approval/create-plan.ts +2 -3
- package/.pi/extensions/lib/plan-approval/resolve-disk.ts +102 -0
- package/.pi/extensions/lib/plan-approval/schema.ts +22 -8
- package/.pi/extensions/lib/plan-approval/types.ts +1 -1
- package/.pi/extensions/lib/plan-approval/validate.ts +2 -2
- package/.pi/extensions/lib/plan-approval-readiness.ts +192 -0
- package/.pi/extensions/lib/plan-debate-eligibility.ts +12 -5
- package/.pi/extensions/lib/plan-debate-gate.ts +22 -1
- package/.pi/extensions/lib/plan-debate-lanes.ts +32 -2
- package/.pi/extensions/lib/plan-review-gate.ts +8 -0
- package/.pi/extensions/lib/posthog-client.ts +76 -0
- package/.pi/extensions/lib/spawn-policy.ts +3 -3
- package/.pi/extensions/observation-bus.ts +2 -0
- package/.pi/extensions/policy-gate.ts +26 -19
- package/.pi/extensions/review-integrity.ts +91 -10
- package/.pi/extensions/sentrux-rules-sync.ts +2 -0
- package/.pi/extensions/test-diff-integrity.ts +1 -0
- package/.pi/extensions/trace-recorder.ts +2 -0
- package/.pi/harness/agents.manifest.json +37 -37
- package/.pi/harness/corpus/cron.example +8 -0
- package/.pi/harness/corpus/graphify-kb-updater.config.json +214 -0
- package/.pi/harness/corpus/systemd/graphify-kb-updater.env.template +4 -0
- package/.pi/harness/corpus/systemd/graphify-kb-updater.service +17 -0
- package/.pi/harness/corpus/systemd/graphify-kb-updater.timer +11 -0
- package/.pi/harness/docs/adrs/0001-harness-constitution.md +2 -1
- package/.pi/harness/docs/adrs/0006-sentrux-dual-layer.md +8 -6
- package/.pi/harness/docs/adrs/0009-sentrux-rules-lifecycle.md +6 -1
- package/.pi/harness/docs/adrs/0031-harness-run-context.md +1 -1
- package/.pi/harness/docs/adrs/0032-harness-command-orchestration.md +7 -0
- package/.pi/harness/docs/adrs/0034-darwin-plan-research-pipeline.md +3 -3
- package/.pi/harness/docs/adrs/0036-implementation-research-and-selective-debate.md +8 -5
- package/.pi/harness/docs/adrs/0039-harness-post-run-review-gate.md +47 -0
- package/.pi/harness/docs/adrs/0040-practice-grounded-orchestration.md +40 -0
- package/.pi/harness/docs/adrs/0041-intelligent-planning-reconnaissance.md +39 -0
- package/.pi/harness/docs/adrs/0042-agent-native-orchestration.md +35 -0
- package/.pi/harness/docs/adrs/0043-path-first-harness-tools.md +38 -0
- package/.pi/harness/docs/adrs/0044-harness-steer-loop.md +37 -0
- package/.pi/harness/docs/adrs/0045-phase-scoped-agent-directories.md +33 -0
- package/.pi/harness/docs/adrs/README.md +11 -0
- package/.pi/harness/docs/graphify-kb-updater-runbook.md +163 -0
- package/.pi/harness/docs/practice-map.md +110 -0
- package/.pi/harness/env.harness.template +5 -3
- package/.pi/harness/evals/smoke/sentrux-stub.json +1 -1
- package/.pi/harness/evals/smoke/smoke-harness-plan.mjs +5 -2
- package/.pi/harness/specs/README.md +1 -1
- package/.pi/harness/specs/harness-run-context.schema.json +11 -0
- package/.pi/harness/specs/harness-spawn-context.schema.json +15 -1
- package/.pi/harness/specs/plan-execution-plan.schema.json +39 -1
- package/.pi/harness/specs/plan-packet.schema.json +4 -0
- package/.pi/harness/specs/plan-phase-status.schema.json +17 -0
- package/.pi/harness/specs/plan-phase-waiver.schema.json +25 -0
- package/.pi/harness/specs/plan-planning-context.schema.json +50 -0
- package/.pi/harness/specs/repair-brief.schema.json +45 -0
- package/.pi/harness/specs/review-outcome.schema.json +46 -0
- package/.pi/harness/specs/sentrux-manifest-proposal.schema.json +80 -0
- package/.pi/harness/specs/sentrux-signal.schema.json +43 -0
- package/.pi/harness/specs/steer-state.schema.json +20 -0
- package/.pi/lib/harness-context-mode-policy.ts +256 -0
- package/.pi/lib/harness-project-config.ts +91 -0
- package/.pi/lib/harness-repair-brief.ts +145 -0
- package/.pi/lib/harness-run-context.ts +591 -32
- package/.pi/lib/harness-ui-state.ts +114 -21
- package/.pi/prompts/harness-auto.md +10 -10
- package/.pi/prompts/harness-critic.md +3 -30
- package/.pi/prompts/harness-eval.md +4 -37
- package/.pi/prompts/harness-plan.md +116 -54
- package/.pi/prompts/harness-review.md +150 -15
- package/.pi/prompts/harness-run.md +62 -10
- package/.pi/prompts/harness-sentrux-steward.md +55 -0
- package/.pi/prompts/harness-setup.md +5 -4
- package/.pi/prompts/harness-steer.md +30 -0
- package/.pi/scripts/README.md +1 -0
- package/.pi/scripts/graphify-kb-updater.mjs +398 -0
- package/.pi/scripts/harness-agents-manifest.mjs +1 -1
- package/.pi/scripts/harness-project-toggle.mjs +129 -0
- package/.pi/scripts/harness-sentrux-cli.mjs +142 -0
- package/.pi/scripts/harness-verify.mjs +22 -6
- package/.pi/scripts/harness-web-policy-guard.mjs +68 -0
- package/.pi/scripts/validate-plan-dag.mjs +3 -3
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +23 -0
- package/README.md +94 -58
- package/package.json +5 -4
- package/.pi/agents/harness/executor.md +0 -47
- package/.pi/agents/harness/planning/scout-graphify.md +0 -37
- package/.pi/agents/harness/planning/scout-semantic.md +0 -39
- package/.pi/agents/harness/planning/scout-structure.md +0 -35
- package/.pi/prompts/git-sync.md +0 -124
- /package/.pi/agents/harness/{tie-breaker.md → reviewing/tie-breaker.md} +0 -0
|
@@ -23,6 +23,8 @@ const REQUIRED_SCHEMAS = [
|
|
|
23
23
|
"eval-verdict.schema.json",
|
|
24
24
|
"harness-spawn-context.schema.json",
|
|
25
25
|
"harness-turn.schema.json",
|
|
26
|
+
"sentrux-manifest-proposal.schema.json",
|
|
27
|
+
"sentrux-signal.schema.json",
|
|
26
28
|
];
|
|
27
29
|
|
|
28
30
|
const REQUIRED_ADRS = [
|
|
@@ -39,6 +41,7 @@ const REQUIRED_ADRS = [
|
|
|
39
41
|
"0032-harness-command-orchestration.md",
|
|
40
42
|
"0037-subagent-submit-tools.md",
|
|
41
43
|
"0038-budget-telemetry-only.md",
|
|
44
|
+
"0040-practice-grounded-orchestration.md",
|
|
42
45
|
];
|
|
43
46
|
|
|
44
47
|
const REQUIRED_EXTENSIONS = [
|
|
@@ -180,13 +183,21 @@ async function checkSentruxGate() {
|
|
|
180
183
|
ok("Sentrux MCP stub gate skipped (HARNESS_SENTRUX_REQUIRED not set)");
|
|
181
184
|
return;
|
|
182
185
|
}
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
const runDir = process.env.HARNESS_RUN_DIR?.trim();
|
|
187
|
+
const runSignalPath = runDir
|
|
188
|
+
? join(runDir, "artifacts", "sentrux-signal.yaml")
|
|
189
|
+
: null;
|
|
190
|
+
if (runSignalPath && (await fileExists(runSignalPath))) {
|
|
191
|
+
ok(`Sentrux run signal present (${runSignalPath})`);
|
|
192
|
+
} else {
|
|
193
|
+
const stubPath = join(ROOT, ".pi", "harness", "evals", "smoke", "sentrux-stub.json");
|
|
194
|
+
if (!(await fileExists(stubPath))) {
|
|
195
|
+
fail(
|
|
196
|
+
"HARNESS_SENTRUX_REQUIRED=true but no artifacts/sentrux-signal.yaml (set HARNESS_RUN_DIR) and .pi/harness/evals/smoke/sentrux-stub.json missing",
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
ok("Sentrux stub present (run signal absent — prefer artifacts/sentrux-signal.yaml from /harness-run)");
|
|
188
200
|
}
|
|
189
|
-
ok("Sentrux stub present");
|
|
190
201
|
|
|
191
202
|
const { code, out } = await runNodeScript(
|
|
192
203
|
join(ROOT, ".pi", "scripts", "sentrux-rules-sync.mjs"),
|
|
@@ -290,6 +301,11 @@ async function main() {
|
|
|
290
301
|
if (!policyGateSrc.includes('pi.on("tool_call", async (event, ctx)')) {
|
|
291
302
|
fail("policy-gate tool_call must receive ctx for run context");
|
|
292
303
|
}
|
|
304
|
+
if (!policyGateSrc.includes("evaluateContextModeMutation")) {
|
|
305
|
+
fail(
|
|
306
|
+
"policy-gate.ts must evaluate context-mode execute tools via evaluateContextModeMutation",
|
|
307
|
+
);
|
|
308
|
+
}
|
|
293
309
|
ok("policy-gate plan-phase writes");
|
|
294
310
|
|
|
295
311
|
const runCtxFixture = join(SMOKE, "run-context.fixture.json");
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** Package-wide web-policy guard.
|
|
3
|
+
* Rejects raw HTTP shell/client paths unless they are in approved harness/API
|
|
4
|
+
* abstraction files. This is a static smoke guard; runtime blocking remains in
|
|
5
|
+
* .pi/extensions/harness-web-guard.ts.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
9
|
+
import { join, relative, resolve } from "node:path";
|
|
10
|
+
|
|
11
|
+
const ROOT = resolve(new URL("../..", import.meta.url).pathname);
|
|
12
|
+
const ALLOWED_FILES = new Set([
|
|
13
|
+
".pi/extensions/harness-web-guard.ts",
|
|
14
|
+
".pi/extensions/harness-web-tools.ts",
|
|
15
|
+
".pi/extensions/lib/harness-web/run-cli.ts",
|
|
16
|
+
".pi/extensions/harness-run-context.ts",
|
|
17
|
+
".pi/extensions/lib/ask-user/schema.ts",
|
|
18
|
+
".pi/scripts/harness-web.py",
|
|
19
|
+
".pi/scripts/harness-web-search.md",
|
|
20
|
+
".pi/scripts/harness-web-policy-guard.mjs",
|
|
21
|
+
".agents/skills/scrapling-web/SKILL.md",
|
|
22
|
+
".pi/scripts/harness-cli-verify.sh",
|
|
23
|
+
".pi/scripts/harness_web/output.py",
|
|
24
|
+
"AGENTS.md",
|
|
25
|
+
]);
|
|
26
|
+
const SKIP_DIRS = new Set([".git", "node_modules", "vendor", "graphify-out", "graphify-books-out", ".web", ".cocoindex_code", ".agents", ".cursor", "raw"]);
|
|
27
|
+
const TEXT_EXTS = new Set([".js", ".mjs", ".ts", ".tsx", ".json", ".yaml", ".yml", ".py", ".sh", ".toml", ".example", ".template"]);
|
|
28
|
+
const NEEDLES = [
|
|
29
|
+
{ name: "raw curl/wget URL", re: /\b(?:curl|wget)\b[^\n]*https?:\/\//i },
|
|
30
|
+
{ name: "raw Node HTTP client", re: /\b(?:fetch|request|get)\s*\(\s*[`'"]https?:\/\//i },
|
|
31
|
+
{ name: "raw Python HTTP client", re: /\brequests\.(?:get|post|put|delete|head)\s*\(\s*[`'"]https?:\/\//i },
|
|
32
|
+
{ name: "Firecrawl path", re: /\bfirecrawl\b/i },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
function ext(path) {
|
|
36
|
+
const i = path.lastIndexOf(".");
|
|
37
|
+
return i >= 0 ? path.slice(i) : "";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function walk(dir, out = []) {
|
|
41
|
+
for (const name of readdirSync(dir)) {
|
|
42
|
+
const abs = join(dir, name);
|
|
43
|
+
const r = relative(ROOT, abs);
|
|
44
|
+
if (SKIP_DIRS.has(name) || r.startsWith(".pi/harness/runs/") || r.startsWith(".pi/agents/") || r.startsWith(".pi/skills/") || r.startsWith(".pi/prompts/") || r.startsWith(".pi/harness/docs/")) continue;
|
|
45
|
+
const st = statSync(abs);
|
|
46
|
+
if (st.isDirectory()) walk(abs, out);
|
|
47
|
+
else if (TEXT_EXTS.has(ext(name)) || name.includes("template") || name.includes("example")) out.push(abs);
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const hits = [];
|
|
53
|
+
for (const abs of walk(ROOT)) {
|
|
54
|
+
const r = relative(ROOT, abs);
|
|
55
|
+
if (ALLOWED_FILES.has(r)) continue;
|
|
56
|
+
let text = "";
|
|
57
|
+
try { text = readFileSync(abs, "utf8"); } catch { continue; }
|
|
58
|
+
for (const needle of NEEDLES) {
|
|
59
|
+
const m = text.match(needle.re);
|
|
60
|
+
if (m) hits.push({ file: r, rule: needle.name, match: m[0].slice(0, 140) });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (hits.length) {
|
|
65
|
+
console.error(JSON.stringify({ ok: false, hits }, null, 2));
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
console.log(JSON.stringify({ ok: true, scanned_root: ROOT }, null, 2));
|
|
@@ -12,9 +12,9 @@ import { readYamlFile, writeYamlFile } from "../lib/harness-yaml.mjs";
|
|
|
12
12
|
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
13
13
|
|
|
14
14
|
const MINIMUMS = {
|
|
15
|
-
low: { phases: 2, work_items:
|
|
16
|
-
med: { phases: 3, work_items:
|
|
17
|
-
high: { phases: 4, work_items:
|
|
15
|
+
low: { phases: 2, work_items: 2, acceptance_checks: 3, risks: 0 },
|
|
16
|
+
med: { phases: 3, work_items: 4, acceptance_checks: 5, risks: 3 },
|
|
17
|
+
high: { phases: 4, work_items: 6, acceptance_checks: 8, risks: 3 },
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
function fail(msg) {
|
package/AGENTS.md
CHANGED
|
@@ -10,6 +10,7 @@ Created: 2026-05-14
|
|
|
10
10
|
- ./raw/ → Source documents for graphify ingestion
|
|
11
11
|
- docs/adr/ → Repo-level Architectural Decision Records
|
|
12
12
|
- .pi/harness/docs/adrs/ → Harness ADRs (team-shared; [index](.pi/harness/docs/adrs/README.md))
|
|
13
|
+
- .pi/harness/docs/practice-map.md → Phase → practice → agent spawn topology for `/harness-plan`, `/harness-run`, `/harness-review`
|
|
13
14
|
- .pi/skills/ → Agent skills
|
|
14
15
|
- .pi/agents/ → Specialized agents
|
|
15
16
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
### ✨ Features
|
|
8
|
+
|
|
9
|
+
- **Graphify KB updater:** Productize conservative daily discovery/promotion with explicit repo/release taxonomy, allowlist source-class gates, operator review queue reporting, scheduler smoke validation, and safe Graphify refresh controls.
|
|
10
|
+
|
|
11
|
+
## [v0.18.1] — 2026-05-24
|
|
12
|
+
|
|
13
|
+
### 🔧 Chores
|
|
14
|
+
|
|
15
|
+
- Ignore local project runtime config.
|
|
16
|
+
- Fix harness review revise flow and widget UX.
|
|
17
|
+
- Add harness project toggle controls.
|
|
18
|
+
|
|
19
|
+
## [v0.18.0] — 2026-05-23
|
|
20
|
+
|
|
21
|
+
### ✨ Features
|
|
22
|
+
|
|
23
|
+
- **Harness:** Agent-native plan/review workflows (ADR 0042–0044) — path-first `approve_plan` / `create_plan` / `submit_*`, lakes on execution plans, `parallel_probes` debate, `review-outcome.yaml` routing, `/harness-steer` repair loop, `merge_harness_yaml`, and `harness_synthesize_repair_brief`.
|
|
24
|
+
- **Harness:** Practice map, planning-context and plan-synthesizer agents, PostHog bootstrap, graphify KB updater corpus, and Sentrux steward prompt.
|
|
25
|
+
|
|
26
|
+
### ✅ Tests
|
|
27
|
+
|
|
28
|
+
- Add harness tool-payload, post-run routing, subprocess bootstrap, artifact gate, and topology tests; extend smoke plan fixture for parallel probes.
|
|
29
|
+
|
|
7
30
|
## [v0.17.0] — 2026-05-22
|
|
8
31
|
|
|
9
32
|
### ✨ Features
|
package/README.md
CHANGED
|
@@ -2,102 +2,138 @@
|
|
|
2
2
|
|
|
3
3
|
> The **ultimate AI coding harness** on top of [**pi.dev**](https://pi.dev).
|
|
4
4
|
|
|
5
|
-
`ultimate-pi`
|
|
5
|
+
`ultimate-pi` adds a governed coding workflow to Pi: bootstrap the repo, plan with evidence, execute only against an approved PlanPacket, then run an independent review gate before merge.
|
|
6
6
|
|
|
7
7
|
## Quick start
|
|
8
8
|
|
|
9
|
-
**Requirements:** Node 18+, npm 9+, git.
|
|
9
|
+
**Requirements:** Node 18+, npm 9+, git, and Pi.
|
|
10
10
|
|
|
11
|
-
1.
|
|
11
|
+
1. Install the package in your project:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
pi install npm:ultimate-pi
|
|
15
15
|
/reload
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
2.
|
|
18
|
+
2. Bootstrap the harness once per project:
|
|
19
19
|
|
|
20
20
|
```text
|
|
21
21
|
/harness-setup
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
3.
|
|
24
|
+
3. Run the strict end-to-end pipeline:
|
|
25
25
|
|
|
26
26
|
```text
|
|
27
27
|
/harness-auto "implement feature X safely"
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
`/harness-auto` runs plan → execute → review → optional steer loop. It may prepare commit/PR work when gates pass, but it never auto-merges.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
## Core workflow
|
|
33
|
+
|
|
34
|
+
### Recommended: one command
|
|
33
35
|
|
|
34
36
|
```text
|
|
35
|
-
/harness-
|
|
36
|
-
/harness-policy-status
|
|
37
|
-
/harness-trace-last
|
|
37
|
+
/harness-auto "your task" [--quick] [--risk low|med|high]
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|---------|----------------|
|
|
44
|
-
| `/harness-setup` | One-time project bootstrap (tools, harness dirs, extensions) |
|
|
45
|
-
| `/harness-auto "<task>"` | End-to-end pipeline (recommended) |
|
|
46
|
-
| `/harness-plan "<task>"` | Create or **revise** the active plan in context (no plan path to copy) |
|
|
47
|
-
| `/harness-run` | Execute the active plan from context (**no `--plan`** on happy path) |
|
|
48
|
-
| `/harness-eval` | Eval for active run (optional `--run`; spawns isolated `harness/evaluator`) |
|
|
49
|
-
| `/harness-review` | Independent review (optional `--run`) |
|
|
50
|
-
| `/harness-critic` | Adversarial review (optional `--run`) |
|
|
51
|
-
| `/harness-trace` | Trace summary (optional `--run`) |
|
|
52
|
-
| `/harness-run-status` | Where you are + what to run next (no run id shown) |
|
|
53
|
-
| `/harness-new-run` | Abandon current run and start fresh |
|
|
54
|
-
| `/harness-use-run <id>` | Advanced recovery only |
|
|
55
|
-
| `/harness-trace-last` | Last phase / handoff (no run id) |
|
|
56
|
-
| `/harness-policy-status` | Current policy / block reasons |
|
|
57
|
-
| `/harness-abort [reason]` | Stop and replan path |
|
|
58
|
-
|
|
59
|
-
## Manual workflow
|
|
60
|
-
|
|
61
|
-
Use this when you want each step separate:
|
|
40
|
+
Use this for most feature, fix, and refactor work. The parent orchestrator handles the phase handoffs and keeps active run context in `.pi/harness/active-run.json` plus run artifacts under `.pi/harness/runs/`.
|
|
41
|
+
|
|
42
|
+
### Manual: phase by phase
|
|
62
43
|
|
|
63
44
|
```text
|
|
64
|
-
/harness-plan "your task"
|
|
45
|
+
/harness-plan "your task" [--risk low|med|high] [--quick]
|
|
65
46
|
/harness-run
|
|
66
|
-
/harness-
|
|
67
|
-
/harness-review
|
|
68
|
-
/harness-critic
|
|
47
|
+
/harness-review [--quick]
|
|
69
48
|
```
|
|
70
49
|
|
|
71
|
-
|
|
50
|
+
Manual mode is useful when you want to inspect or approve each handoff. On the happy path you do **not** pass `--plan` or a run id; the harness restores the active PlanPacket and run context.
|
|
72
51
|
|
|
73
|
-
|
|
52
|
+
### Repair loop
|
|
74
53
|
|
|
75
|
-
|
|
54
|
+
If `/harness-review` returns `implementation_gap`, run:
|
|
76
55
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- **Concurrent plans** — a second `/harness-plan` while a run is active is blocked until `/harness-abort` or `/harness-new-run` (except drift replan / amend after `needs_clarification`).
|
|
82
|
-
- **Plan before mutate** — write/edit/shell that changes the repo is blocked until execute phase.
|
|
83
|
-
- **No auto-merge** — you decide when to open or merge a PR.
|
|
84
|
-
- **Structured runs** — each run writes artifacts under `.pi/harness/runs/` for replay and audit.
|
|
56
|
+
```text
|
|
57
|
+
/harness-steer
|
|
58
|
+
/harness-review
|
|
59
|
+
```
|
|
85
60
|
|
|
86
|
-
|
|
61
|
+
`/harness-steer` uses `artifacts/repair-brief.yaml` and respawns the executor in repair mode without widening the approved plan scope.
|
|
62
|
+
|
|
63
|
+
## Command reference
|
|
64
|
+
|
|
65
|
+
| Command | Purpose |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `/harness-setup [--skip-graphify] [--skip-tools] [--non-interactive] [--force]` | Idempotent project bootstrap: Graphify, harness-web/Scrapling, CLI tools, settings, contracts, Sentrux, model router, and verification. |
|
|
68
|
+
| `/harness-auto "<task>" [--quick] [--risk low\|med\|high]` | Strict full pipeline: plan, execute, review, steer when appropriate. |
|
|
69
|
+
| `/harness-plan "<task>" [--risk low\|med\|high] [--quick]` | PM-grade planning: reconnaissance, decomposition, hypothesis, external research, ExecutionPlan, DAG validation, Review Gate debate, `approve_plan`, `create_plan`. |
|
|
70
|
+
| `/harness-run` | Executes the approved active PlanPacket by spawning `harness/running/executor`; no inline implementation. |
|
|
71
|
+
| `/harness-review [--run <id>] [--quick] [--readonly] [--trace <ref>]` | Post-run verification gate: deterministic checks, benchmark evaluator, policy verdict, adversary, optional tie-breaker. |
|
|
72
|
+
| `/harness-steer [--attempt N]` | Post-review repair pass for `implementation_gap`; executor reads `repair-brief.yaml`, then you re-run `/harness-review`. |
|
|
73
|
+
| `/harness-abort [reason]` | Safely aborts the active run, clears plan readiness, and re-locks mutation until a fresh plan is approved. |
|
|
74
|
+
| `/harness-trace [--run <id>] [--phase plan\|execute\|evaluate\|adversary\|merge]` | Summarizes run traces and artifact handoffs for replay/forensics. |
|
|
75
|
+
| `/harness-incident --trigger <reason> [--run <id>] [--severity low\|med\|high\|critical]` | Records incident, rollback, and override trail for harness failures. |
|
|
76
|
+
| `/harness-sentrux-steward [--run <id>]` | Ad-hoc architectural intent review for Sentrux manifest/rule alignment. |
|
|
77
|
+
| `/harness-router-tune --evidence <evidence.json> --candidate <candidate-router.json> [--proposal <out.json>]` | Proposes model-router updates from evidence; applies only after explicit approval. |
|
|
78
|
+
| `/graphify [directory]` | Bootstraps or updates the Graphify knowledge graph. |
|
|
79
|
+
| `/wiki-autoresearch [topic]` | Runs autonomous web research and builds a Graphify-backed research wiki. |
|
|
80
|
+
| `/wiki-save` | Saves the current conversation or insight as a structured wiki note. |
|
|
81
|
+
| `/release [patch\|minor\|major] [--dry-run]` | Maintainer release helper. |
|
|
82
|
+
|
|
83
|
+
Deprecated compatibility aliases:
|
|
84
|
+
|
|
85
|
+
| Alias | Use instead |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `/harness-eval` | `/harness-review` |
|
|
88
|
+
| `/harness-critic` | `/harness-review` |
|
|
89
|
+
|
|
90
|
+
## Harness phases and agents
|
|
91
|
+
|
|
92
|
+
- **Planning** uses agents under `.pi/agents/harness/planning/` plus parent-led Graphify → `sg` → `ccc` reconnaissance. Legacy tool-tied `planning/scout-*` agents have been removed; planning context is captured in `artifacts/planning-context.yaml`.
|
|
93
|
+
- **Running** uses `.pi/agents/harness/running/executor.md` via agent id `harness/running/executor`.
|
|
94
|
+
- **Reviewing** uses `.pi/agents/harness/reviewing/` via `harness/reviewing/evaluator`, `harness/reviewing/adversary`, and `harness/reviewing/tie-breaker`.
|
|
95
|
+
- **Support agents** such as `harness/incident-recorder`, `harness/sentrux-steward`, and `harness/trace-librarian` remain under `.pi/agents/harness/`.
|
|
96
|
+
|
|
97
|
+
Subagents run isolated from the parent session. They persist canonical YAML through `submit_*` tools; the parent gates with `harness_artifact_ready` and writes only orchestrator-owned merge artifacts.
|
|
98
|
+
|
|
99
|
+
## Artifacts and layout
|
|
100
|
+
|
|
101
|
+
| Path | Description |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `.pi/harness/active-run.json` | Active run pointer for happy-path commands. |
|
|
104
|
+
| `.pi/harness/runs/<run_id>/plan-packet.yaml` | Approved execution baseline. |
|
|
105
|
+
| `.pi/harness/runs/<run_id>/research-brief.yaml` | Planning evidence and research merge. |
|
|
106
|
+
| `.pi/harness/runs/<run_id>/artifacts/` | Planning context, decomposition, research, benchmark, verdict, adversary, repair, and Sentrux artifacts. |
|
|
107
|
+
| `.pi/harness/runs/<run_id>/handoff/executor-summary.yaml` | Executor handoff written by `submit_executor_handoff`. |
|
|
108
|
+
| `.pi/harness/incidents/` | Incident records and rollback/override trail. |
|
|
109
|
+
| `.pi/harness/docs/adrs/` | Harness architectural decisions. |
|
|
110
|
+
| `.pi/harness/specs/` | Artifact contracts and schemas seeded into projects. |
|
|
111
|
+
|
|
112
|
+
## Safety defaults
|
|
113
|
+
|
|
114
|
+
- **Graph before grep:** planning consults `graphify-out/GRAPH_REPORT.md` and Graphify queries before raw file reads.
|
|
115
|
+
- **Plan before mutate:** mutating tools are blocked until `/harness-plan` approves and creates a plan.
|
|
116
|
+
- **No inline execution:** `/harness-run` delegates to `harness/running/executor` only.
|
|
117
|
+
- **No inline review:** `/harness-review` delegates verdicts to isolated reviewing agents.
|
|
118
|
+
- **No auto-merge:** final merge remains a human/operator decision.
|
|
119
|
+
- **Sentrux is observational:** structural baselines and gates inform review; executor does not optimize metrics as a goal.
|
|
120
|
+
- **Router is gated:** `pi-model-router` activates after `/harness-setup` creates `.pi/model-router.json`; run `/reload` after setup or router changes.
|
|
87
121
|
|
|
88
122
|
## Troubleshooting
|
|
89
123
|
|
|
90
124
|
| Problem | Try |
|
|
91
|
-
|
|
92
|
-
| Setup fails | `node --version`
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
125
|
+
|---|---|
|
|
126
|
+
| Setup fails | Confirm `node --version` is 18+, `npm --version` is 9+, then rerun `/harness-setup`. |
|
|
127
|
+
| No approved plan | Run `/harness-plan "<task>"`, then `/harness-run`. |
|
|
128
|
+
| Need to inspect handoff | Run `/harness-trace` or inspect `.pi/harness/runs/<run_id>/`. |
|
|
129
|
+
| Need to restart safely | Run `/harness-abort [reason]`, then create a fresh plan. |
|
|
130
|
+
| Review says `implementation_gap` | Run `/harness-steer`, then `/harness-review`. |
|
|
131
|
+
| Review says `plan_gap` | Revise with `/harness-plan "<updated task>"`. |
|
|
132
|
+
| Router profile missing | Complete `/harness-setup`, run `/reload`, then check `.pi/model-router.json`. |
|
|
133
|
+
| Sentrux missing | Install/configure Sentrux or keep it skipped; harness verification still reports the status. |
|
|
134
|
+
|
|
135
|
+
Optional integrations can be configured by copying `.env.example` to `.env`; `/harness-setup` appends missing keys without overwriting existing values.
|
|
100
136
|
|
|
101
137
|
## Contributing
|
|
102
138
|
|
|
103
|
-
Local development, harness internals, and quality gates: [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
139
|
+
Local development, harness internals, and quality gates: [CONTRIBUTING.md](./CONTRIBUTING.md), [`.pi/scripts/README.md`](.pi/scripts/README.md), and [`.pi/harness/docs/adrs/`](.pi/harness/docs/adrs/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultimate-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Ultimate AI coding harness for pi.dev — extensible skills, Obsidian wiki knowledge layer, compressed context, deterministic output",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@earendil-works/pi-coding-agent": "*"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
|
-
"check:ts": "tsc --noEmit --target ES2023 --lib ES2023 --moduleResolution nodenext --module nodenext --skipLibCheck .pi/extensions/custom-system-prompt.ts .pi/lib/harness-run-context.ts .pi/lib/harness-ui-state.ts .pi/extensions/harness-run-context.ts .pi/extensions/lib/harness-vcc-settings.ts .pi/extensions/dotenv-loader.ts .pi/extensions/lib/posthog-node.d.ts .pi/extensions/lib/harness-posthog.ts .pi/extensions/lib/harness-paths.ts .pi/extensions/pi-model-router-harness.ts .pi/extensions/provider-payload-sanitize.ts .pi/extensions/harness-telemetry.ts .pi/extensions/harness-ask-user.ts .pi/extensions/harness-plan-approval.ts .pi/extensions/lib/ask-user/schema.ts .pi/extensions/lib/ask-user/types.ts .pi/extensions/lib/ask-user/validate.ts .pi/extensions/lib/ask-user/dialog.ts .pi/extensions/lib/ask-user/fallback.ts .pi/extensions/lib/ask-user/render.ts .pi/extensions/lib/plan-approval/types.ts .pi/extensions/lib/plan-approval/schema.ts .pi/extensions/lib/plan-approval/validate.ts .pi/extensions/lib/plan-approval/format-plan.ts .pi/extensions/lib/plan-approval/dialog.ts .pi/extensions/lib/plan-approval/render.ts .pi/extensions/lib/plan-approval/create-plan.ts .pi/extensions/harness-subagents.ts .pi/extensions/lib/harness-subagents-bridge.ts .pi/extensions/lib/harness-cocoindex-refresh.ts .pi/extensions/lib/harness-subagent-auth.ts .pi/extensions/lib/harness-subagent-policy.ts .pi/extensions/lib/harness-subagent-precheck.ts .pi/extensions/lib/harness-spawn-budget.ts .pi/extensions/lib/spawn-policy.ts vendor/pi-subagents/src/agents.ts vendor/pi-subagents/src/subagents.ts .pi/extensions/trace-recorder.ts .pi/extensions/observation-bus.ts .pi/extensions/drift-monitor.ts .pi/extensions/policy-gate.ts .pi/extensions/budget-guard.ts .pi/extensions/debate-orchestrator.ts .pi/extensions/harness-debate-tools.ts .pi/extensions/lib/debate-bus-core.ts .pi/extensions/lib/debate-bus-state.ts .pi/extensions/lib/plan-debate-gate.ts .pi/extensions/lib/plan-debate-id.ts .pi/extensions/lib/plan-messenger.ts .pi/extensions/lib/plan-debate-envelope.ts .pi/extensions/lib/plan-review-integrator-rules.ts .pi/extensions/lib/plan-scope-guard.ts .pi/extensions/lib/plan-debate-write-guard.ts .pi/extensions/lib/plan-debate-lane.ts .pi/extensions/lib/plan-debate-round-status.ts .pi/extensions/harness-live-widget.ts .pi/extensions/sentrux-rules-sync.ts .pi/extensions/custom-header.ts .pi/extensions/harness-web-tools.ts .pi/extensions/harness-web-guard.ts .pi/extensions/lib/harness-web/run-cli.ts",
|
|
77
|
+
"check:ts": "tsc --noEmit --target ES2023 --lib ES2023 --moduleResolution nodenext --module nodenext --skipLibCheck .pi/extensions/00-harness-project-control.ts .pi/extensions/custom-system-prompt.ts .pi/lib/harness-run-context.ts .pi/lib/harness-context-mode-policy.ts .pi/lib/harness-ui-state.ts .pi/extensions/harness-run-context.ts .pi/extensions/lib/harness-vcc-settings.ts .pi/extensions/dotenv-loader.ts .pi/extensions/00-posthog-network-bootstrap.ts .pi/extensions/lib/posthog-client.ts .pi/extensions/lib/posthog-node.d.ts .pi/extensions/lib/harness-posthog.ts .pi/extensions/lib/harness-paths.ts .pi/extensions/pi-model-router-harness.ts .pi/extensions/provider-payload-sanitize.ts .pi/extensions/harness-telemetry.ts .pi/extensions/harness-ask-user.ts .pi/extensions/harness-plan-approval.ts .pi/extensions/lib/ask-user/schema.ts .pi/extensions/lib/ask-user/types.ts .pi/extensions/lib/ask-user/validate.ts .pi/extensions/lib/ask-user/dialog.ts .pi/extensions/lib/ask-user/fallback.ts .pi/extensions/lib/ask-user/render.ts .pi/extensions/lib/plan-approval/types.ts .pi/extensions/lib/plan-approval/schema.ts .pi/extensions/lib/plan-approval/validate.ts .pi/extensions/lib/plan-approval/format-plan.ts .pi/extensions/lib/plan-approval/dialog.ts .pi/extensions/lib/plan-approval/render.ts .pi/extensions/lib/plan-approval/create-plan.ts .pi/extensions/harness-subagents.ts .pi/extensions/lib/harness-subagents-bridge.ts .pi/extensions/lib/harness-cocoindex-refresh.ts .pi/extensions/lib/harness-subagent-auth.ts .pi/extensions/lib/harness-subagent-policy.ts .pi/extensions/lib/harness-subagent-precheck.ts .pi/extensions/lib/harness-spawn-budget.ts .pi/extensions/lib/spawn-policy.ts vendor/pi-subagents/src/agents.ts vendor/pi-subagents/src/subagents.ts .pi/extensions/review-integrity.ts .pi/extensions/trace-recorder.ts .pi/extensions/observation-bus.ts .pi/extensions/drift-monitor.ts .pi/extensions/policy-gate.ts .pi/extensions/budget-guard.ts .pi/extensions/debate-orchestrator.ts .pi/extensions/harness-debate-tools.ts .pi/extensions/lib/debate-bus-core.ts .pi/extensions/lib/debate-bus-state.ts .pi/extensions/lib/plan-debate-gate.ts .pi/extensions/lib/plan-debate-id.ts .pi/extensions/lib/plan-messenger.ts .pi/extensions/lib/plan-debate-envelope.ts .pi/extensions/lib/plan-review-integrator-rules.ts .pi/extensions/lib/plan-scope-guard.ts .pi/extensions/lib/plan-debate-write-guard.ts .pi/extensions/lib/plan-debate-lane.ts .pi/extensions/lib/plan-debate-round-status.ts .pi/extensions/harness-live-widget.ts .pi/extensions/sentrux-rules-sync.ts .pi/extensions/custom-header.ts .pi/extensions/harness-web-tools.ts .pi/extensions/harness-web-guard.ts .pi/extensions/lib/harness-web/run-cli.ts",
|
|
78
78
|
"vendor:sync-router": "bash .pi/scripts/vendor-sync-pi-model-router.sh",
|
|
79
79
|
"vendor:sync-vcc": "bash .pi/scripts/vendor-sync-pi-vcc.sh",
|
|
80
80
|
"vendor:sync-subagents": "bash .pi/scripts/vendor-sync-pi-subagents.sh",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"format": "biome format --write",
|
|
85
85
|
"format:check": "biome format",
|
|
86
86
|
"prepare": "lefthook install",
|
|
87
|
-
"test": "node --test test/harness-verify.test.mjs test/harness-ask-user.test.mjs test/harness-subagents-loader.test.mjs test/harness-subagent-precheck.test.mjs test/sentrux-rules-sync.test.mjs test/harness-budget-guard.test.mjs && node .pi/harness/evals/smoke/smoke-harness-plan.mjs --fixture && npx -y tsx --test test/harness-vcc-settings.test.ts test/harness-live-widget-status.test.ts test/harness-plan-phase-policy.test.mjs test/harness-subagent-policy.test.mjs test/harness-spawn-budget.test.mjs test/harness-spawn-parse.test.mjs test/harness-schema-validate.test.mjs test/harness-turn-routing.test.mjs test/harness-budget-enforce.test.mjs test/harness-submit-policy.test.mjs test/plan-approval-format.test.mjs test/plan-approval-dialog.test.mjs test/plan-approval-sync.test.mjs test/plan-create-plan.test.mjs test/plan-review-format.test.mjs test/debate-plan-phase.test.mjs test/plan-debate-eligibility.test.mjs test/plan-messenger-gate.test.mjs test/plan-debate-lane-apply.test.mjs",
|
|
87
|
+
"test": "node --test test/harness-verify.test.mjs test/posthog-client.test.mjs test/harness-ask-user.test.mjs test/harness-subagents-loader.test.mjs test/harness-subagent-precheck.test.mjs test/sentrux-rules-sync.test.mjs test/harness-budget-guard.test.mjs && node .pi/harness/evals/smoke/smoke-harness-plan.mjs --fixture && npx -y tsx --test test/harness-vcc-settings.test.ts test/harness-run-context-postrun.test.mjs test/harness-tool-payload.test.mjs test/harness-live-widget-status.test.ts test/harness-project-toggle-tui.test.ts test/harness-plan-phase-policy.test.mjs test/harness-context-mode-policy.test.mjs test/harness-subprocess-bootstrap.test.mjs test/harness-subagent-policy.test.mjs test/harness-subagent-precheck-topology.test.mjs test/plan-approval-readiness.test.mjs test/harness-spawn-budget.test.mjs test/harness-spawn-parse.test.mjs test/harness-schema-validate.test.mjs test/harness-turn-routing.test.mjs test/harness-budget-enforce.test.mjs test/harness-submit-policy.test.mjs test/plan-approval-format.test.mjs test/plan-approval-dialog.test.mjs test/plan-approval-sync.test.mjs test/plan-create-plan.test.mjs test/plan-review-format.test.mjs test/debate-plan-phase.test.mjs test/plan-debate-eligibility.test.mjs test/plan-messenger-gate.test.mjs test/plan-debate-lane-apply.test.mjs test/review-integrity-revise-handoff.test.mjs test/harness-plan-revise-reset.test.mjs",
|
|
88
88
|
"test:vcc": "npx -y tsx --test vendor/pi-vcc/tests/*.test.ts",
|
|
89
89
|
"harness:sentrux-bootstrap": "node .pi/scripts/harness-sentrux-bootstrap.mjs",
|
|
90
90
|
"harness:sentrux-sync": "node .pi/scripts/sentrux-rules-sync.mjs --force",
|
|
@@ -108,7 +108,8 @@
|
|
|
108
108
|
"croner": "^9.0.0",
|
|
109
109
|
"jimp": "^1.6.1",
|
|
110
110
|
"nanoid": "^5.1.5",
|
|
111
|
-
"posthog-node": "^5.30.6"
|
|
111
|
+
"posthog-node": "^5.30.6",
|
|
112
|
+
"undici": "^7.16.0"
|
|
112
113
|
},
|
|
113
114
|
"overrides": {
|
|
114
115
|
"@mariozechner/pi-agent-core": "npm:@earendil-works/pi-agent-core@0.74.1",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Harness executor that implements only within approved PlanPacket scope.
|
|
3
|
-
tools: read, write, edit, bash, grep, find, ls, submit_executor_handoff
|
|
4
|
-
extensions: true
|
|
5
|
-
disallowed_tools: ask_user
|
|
6
|
-
thinking: medium
|
|
7
|
-
max_turns: 20
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are the Harness Executor.
|
|
11
|
-
|
|
12
|
-
## Mission
|
|
13
|
-
|
|
14
|
-
Implement the approved plan with surgical diffs and strict scope control. The parent orchestrator spawned you with a `HarnessSpawnContext` appendix — use `plan_packet_path`, `run_dir`, and acceptance checks from that JSON.
|
|
15
|
-
|
|
16
|
-
## Process
|
|
17
|
-
|
|
18
|
-
1. Read the approved `PlanPacket` at `plan_packet_path` from spawn context; extract allowed scope before any mutation.
|
|
19
|
-
2. Implement only approved scope with minimal, reversible diffs.
|
|
20
|
-
3. Run focused validations mapped to `acceptance_checks`.
|
|
21
|
-
4. Prepare rollback artifacts: revert command, prepared revert branch name, patch bundle path under the run directory.
|
|
22
|
-
5. For plan-level ambiguity (wrong scope, missing acceptance), stop and return structured `scope_drift` — do not widen scope.
|
|
23
|
-
6. Do not self-certify final quality; hand off evidence paths for evaluator/adversary.
|
|
24
|
-
|
|
25
|
-
## Guardrails
|
|
26
|
-
|
|
27
|
-
- Only modify files required by the approved `PlanPacket`.
|
|
28
|
-
- Never speculate about code you have not read.
|
|
29
|
-
- If scope drift appears, stop with `execution_status: scope_drift` in your final JSON summary.
|
|
30
|
-
- Never set `inherit_context: true` on harness agents.
|
|
31
|
-
- Do not call `ask_user` — parent handles governance forks.
|
|
32
|
-
|
|
33
|
-
## Output
|
|
34
|
-
|
|
35
|
-
End with a JSON block:
|
|
36
|
-
|
|
37
|
-
```json
|
|
38
|
-
{
|
|
39
|
-
"execution_status": "completed",
|
|
40
|
-
"files_changed": [],
|
|
41
|
-
"validation_summary": "…",
|
|
42
|
-
"rollback_refs": {},
|
|
43
|
-
"handoff_ready": { "evaluator": true, "adversary": true }
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Use `execution_status` values: `completed`, `blocked`, or `scope_drift`.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Plan-phase scout — graphify graph and wiki navigation (read-only).
|
|
3
|
-
tools: read, bash, ls, submit_scout_findings
|
|
4
|
-
disallowed_tools: write, edit, ask_user, approve_plan, create_plan, subagent, grep, find
|
|
5
|
-
extensions: false
|
|
6
|
-
thinking: low
|
|
7
|
-
max_turns: 8
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are the **Harness planning scout (graphify lane)**.
|
|
11
|
-
|
|
12
|
-
## Mission
|
|
13
|
-
|
|
14
|
-
Explore the codebase via graphify for the task in `HarnessSpawnContext`. You do **not** build the PlanPacket, approve plans, or mutate anything.
|
|
15
|
-
|
|
16
|
-
Findings should feed **constraints, prior art, and tensions** for the decompose agent (existing patterns, god nodes, surprising connections).
|
|
17
|
-
|
|
18
|
-
**Lane contract:** you own **relationships and architecture** (`graphify query`, `explain`, `path`). `scout-semantic` owns implementation-by-meaning via `ccc search` — do not duplicate semantic chunk search here.
|
|
19
|
-
|
|
20
|
-
## Spawn context
|
|
21
|
-
|
|
22
|
-
Read `HarnessSpawnContext` in the spawn prompt (`task_summary`, `mode`, `plan_packet_path`, `risk_level`, `quick`). For `mode: revise`, read the existing plan at `plan_packet_path` first and focus findings on what changed or is at risk.
|
|
23
|
-
|
|
24
|
-
## Process
|
|
25
|
-
|
|
26
|
-
1. Read `graphify-out/GRAPH_REPORT.md` when present; use `graphify query`, `graphify path`, or `graphify explain` for the task (read-only CLI only).
|
|
27
|
-
2. If `graphify-out/` is missing, say so in `findings` and `open_questions` — do not run `graphify update` or installs.
|
|
28
|
-
3. Do not read `.pi/harness/specs/*.schema.json` from disk.
|
|
29
|
-
4. **Stop early** — target ≤6 tool calls when possible.
|
|
30
|
-
|
|
31
|
-
## Bash guardrails
|
|
32
|
-
|
|
33
|
-
Read-only only: no `graphify update`, `graphify extract`, `pip install`, redirects (`>`, `>>`), or file creation. Allowed: `graphify query`, `graphify path`, `graphify explain`, `ls`, `cat`, `head`.
|
|
34
|
-
|
|
35
|
-
## Output
|
|
36
|
-
|
|
37
|
-
Before ending, call `submit_scout_findings` exactly once with the full document (`schema_version`, `lane`, `status`, `findings`, `key_paths`, `open_questions`). Use `"status": "partial"` if the graph is missing or queries failed. Do not paste the artifact as prose — the tool write is the deliverable.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Plan-phase scout — CocoIndex semantic code search (read-only).
|
|
3
|
-
tools: read, bash, ls, submit_scout_findings
|
|
4
|
-
disallowed_tools: write, edit, ask_user, approve_plan, create_plan, subagent, grep, find
|
|
5
|
-
extensions: false
|
|
6
|
-
thinking: low
|
|
7
|
-
max_turns: 6
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are the **Harness planning scout (semantic lane)**.
|
|
11
|
-
|
|
12
|
-
## Mission
|
|
13
|
-
|
|
14
|
-
Find conceptually related **implementation** via CocoIndex (`ccc search`) for the task in `HarnessSpawnContext`. You do **not** build the PlanPacket or mutate files.
|
|
15
|
-
|
|
16
|
-
**Lane contract:** `scout-graphify` owns relationships, callers, and communities. You own **meaning** — functions, classes, and chunks that implement the task.
|
|
17
|
-
|
|
18
|
-
## Spawn context
|
|
19
|
-
|
|
20
|
-
Read `HarnessSpawnContext` in the spawn prompt. For `mode: revise`, bias searches toward delta areas from the existing plan at `plan_packet_path`.
|
|
21
|
-
|
|
22
|
-
## Process
|
|
23
|
-
|
|
24
|
-
1. Run **2–3** task-focused queries: `ccc search "<query>" --limit 5` (add `--path` when spawn context names a directory).
|
|
25
|
-
2. The harness runs incremental `ccc index` before scouts spawn — **do not** run `ccc index`, `ccc init`, or `ccc search --refresh`.
|
|
26
|
-
3. If `ccc` is missing or the index is empty: `status: partial` and document in `findings`.
|
|
27
|
-
4. **Stop early** — top **5** most relevant paths only.
|
|
28
|
-
|
|
29
|
-
## Bash guardrails
|
|
30
|
-
|
|
31
|
-
Read-only only: no installs, indexing, daemon control, or redirects.
|
|
32
|
-
|
|
33
|
-
**Allowed:** `ccc search`, `ccc status`, `ls`, `head`, `cat`, `sed -n` (read slices).
|
|
34
|
-
|
|
35
|
-
**Forbidden:** `ccc index`, `ccc init`, `ccc reset`, `ccc daemon`, `ccc search --refresh`, package installs.
|
|
36
|
-
|
|
37
|
-
## Output
|
|
38
|
-
|
|
39
|
-
Before ending, call `submit_scout_findings` exactly once with the full document (`schema_version`, `lane`, `status`, `findings`, `key_paths`, `open_questions`). Do not paste the artifact as prose — the tool write is the deliverable.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Plan-phase scout — ast-grep structural code search (read-only).
|
|
3
|
-
tools: read, bash, ls, submit_scout_findings
|
|
4
|
-
disallowed_tools: write, edit, ask_user, approve_plan, create_plan, subagent, grep, find
|
|
5
|
-
extensions: false
|
|
6
|
-
thinking: low
|
|
7
|
-
max_turns: 6
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
You are the **Harness planning scout (structure lane)**.
|
|
11
|
-
|
|
12
|
-
## Mission
|
|
13
|
-
|
|
14
|
-
Find relevant code structure for the task using ast-grep (`sg`). You do **not** build the PlanPacket or mutate files.
|
|
15
|
-
|
|
16
|
-
Findings should name **implementation surfaces** (handlers, types, exports, call sites) for hypothesis mechanism and experiment design.
|
|
17
|
-
|
|
18
|
-
## Spawn context
|
|
19
|
-
|
|
20
|
-
Read `HarnessSpawnContext` in the spawn prompt. For `mode: revise`, read the existing plan at `plan_packet_path` and focus on files and patterns affected by the revision.
|
|
21
|
-
|
|
22
|
-
## Process
|
|
23
|
-
|
|
24
|
-
1. Run `sg -p '…'` with patterns tied to the task (handlers, types, exports, call sites). **Do not use `find` or `grep`.**
|
|
25
|
-
2. Prefer absolute paths in `key_paths`.
|
|
26
|
-
3. If `sg` is not on PATH, set `status: partial` and note the tooling gap in `findings`.
|
|
27
|
-
4. **Stop early** — target ≤6 tool calls when possible.
|
|
28
|
-
|
|
29
|
-
## Bash guardrails
|
|
30
|
-
|
|
31
|
-
Read-only only: no installs, redirects, or mutating git/npm commands.
|
|
32
|
-
|
|
33
|
-
## Output
|
|
34
|
-
|
|
35
|
-
Before ending, call `submit_scout_findings` exactly once with the full document (`schema_version`, `lane`, `status`, `findings`, `key_paths`, `open_questions`). Do not paste the artifact as prose — the tool write is the deliverable.
|