ultimate-pi 0.7.0 → 0.9.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-decisions/SKILL.md +20 -1
- package/.agents/skills/harness-eval/SKILL.md +11 -13
- package/.agents/skills/harness-orchestration/SKILL.md +36 -30
- package/.agents/skills/harness-plan/SKILL.md +13 -18
- package/.pi/PACKAGING.md +1 -1
- package/.pi/agents/harness/adversary.md +20 -12
- package/.pi/agents/harness/evaluator.md +25 -14
- package/.pi/agents/harness/executor.md +27 -16
- package/.pi/agents/harness/incident-recorder.md +37 -0
- package/.pi/agents/harness/meta-optimizer.md +18 -15
- package/.pi/agents/harness/planner.md +26 -30
- package/.pi/agents/harness/tie-breaker.md +4 -2
- package/.pi/agents/harness/trace-librarian.md +18 -11
- package/.pi/agents/pi-pi/ext-expert.md +1 -1
- package/.pi/agents/pi-pi/keybinding-expert.md +1 -1
- package/.pi/agents/pi-pi/tui-expert.md +3 -3
- package/.pi/extensions/00-ultimate-pi-system-prompt.ts +2 -2
- package/.pi/extensions/budget-guard.ts +47 -18
- package/.pi/extensions/custom-footer.ts +8 -3
- package/.pi/extensions/custom-header.ts +2 -2
- package/.pi/extensions/debate-orchestrator.ts +1 -1
- package/.pi/extensions/dotenv-loader.ts +1 -1
- package/.pi/extensions/drift-monitor.ts +1 -1
- package/.pi/extensions/harness-ask-user.ts +1 -1
- package/.pi/extensions/harness-live-widget.ts +1 -1
- package/.pi/extensions/harness-run-context.ts +197 -33
- package/.pi/extensions/harness-telemetry.ts +1 -1
- package/.pi/extensions/harness-web-guard.ts +1 -1
- package/.pi/extensions/harness-web-tools.ts +1 -1
- package/.pi/extensions/lib/ask-user/dialog.ts +2 -2
- package/.pi/extensions/lib/ask-user/fallback.ts +1 -1
- package/.pi/extensions/lib/ask-user/render.ts +3 -3
- package/.pi/extensions/lib/harness-subagents/agent-loader.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/agent-parser.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/blackboard-tool.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/harness-subagent-policy.ts +134 -0
- package/.pi/extensions/lib/harness-subagents/parent-ask-user-bridge.ts +89 -0
- package/.pi/extensions/lib/harness-subagents/spawn-policy.ts +20 -2
- package/.pi/extensions/lib/harness-subagents/vendored/agent-manager.ts +3 -2
- package/.pi/extensions/lib/harness-subagents/vendored/agent-runner.ts +44 -24
- package/.pi/extensions/lib/harness-subagents/vendored/context.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/env.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/index.ts +23 -2
- package/.pi/extensions/lib/harness-subagents/vendored/output-file.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/schedule.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/settings.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/skill-loader.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/types.ts +2 -2
- package/.pi/extensions/lib/harness-subagents/vendored/ui/agent-widget.ts +1 -1
- package/.pi/extensions/lib/harness-subagents/vendored/ui/conversation-viewer.ts +2 -2
- package/.pi/extensions/lib/harness-subagents/vendored/ui/schedule-menu.ts +1 -1
- package/.pi/extensions/observation-bus.ts +1 -1
- package/.pi/extensions/pi-model-router-harness.ts +1 -1
- package/.pi/extensions/policy-gate.ts +90 -20
- package/.pi/extensions/provider-payload-sanitize.ts +1 -1
- package/.pi/extensions/review-integrity.ts +76 -22
- package/.pi/extensions/sentrux-rules-sync.ts +1 -1
- package/.pi/extensions/soundboard.ts +1 -1
- package/.pi/extensions/test-diff-integrity.ts +1 -1
- package/.pi/extensions/trace-recorder.ts +1 -1
- package/.pi/extensions/ultimate-pi-vcc.ts +1 -1
- package/.pi/harness/agents.manifest.json +82 -78
- package/.pi/harness/docs/adrs/0031-harness-run-context.md +6 -3
- package/.pi/harness/docs/adrs/0032-harness-command-orchestration.md +37 -0
- package/.pi/harness/docs/adrs/README.md +1 -0
- package/.pi/harness/specs/budget-exhausted-event.schema.json +3 -1
- package/.pi/harness/specs/harness-spawn-context.schema.json +65 -0
- package/.pi/harness/specs/harness-turn.schema.json +18 -0
- package/.pi/lib/harness-agent-output.ts +41 -0
- package/.pi/lib/harness-run-context.ts +516 -37
- package/.pi/lib/harness-ui-state.ts +1 -1
- package/.pi/prompts/harness-auto.md +36 -61
- package/.pi/prompts/harness-critic.md +15 -28
- package/.pi/prompts/harness-eval.md +19 -27
- package/.pi/prompts/harness-incident.md +15 -34
- package/.pi/prompts/harness-plan.md +28 -49
- package/.pi/prompts/harness-review.md +16 -30
- package/.pi/prompts/harness-router-tune.md +16 -38
- package/.pi/prompts/harness-run.md +21 -38
- package/.pi/prompts/harness-setup.md +2 -0
- package/.pi/prompts/harness-trace.md +13 -30
- package/.pi/scripts/harness-generate-model-router.mjs +16 -13
- package/.pi/scripts/harness-verify.mjs +17 -0
- package/.pi/scripts/vendor-sync-pi-model-router.sh +10 -10
- package/CHANGELOG.md +25 -1
- package/README.md +4 -5
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/package.json +13 -8
- package/vendor/pi-model-router/UPSTREAM_PIN.md +1 -1
- package/vendor/pi-model-router/extensions/commands.ts +2 -2
- package/vendor/pi-model-router/extensions/config.ts +2 -2
- package/vendor/pi-model-router/extensions/index.ts +1 -1
- package/vendor/pi-model-router/extensions/provider.ts +2 -2
- package/vendor/pi-model-router/extensions/routing.ts +2 -2
- package/vendor/pi-model-router/extensions/types.ts +1 -1
- package/vendor/pi-model-router/extensions/ui.ts +1 -1
- package/vendor/pi-model-router/package.json +4 -4
- package/vendor/pi-vcc/index.ts +1 -1
- package/vendor/pi-vcc/package.json +1 -1
- package/vendor/pi-vcc/src/commands/pi-vcc.ts +1 -1
- package/vendor/pi-vcc/src/commands/vcc-recall.ts +1 -1
- package/vendor/pi-vcc/src/core/content.ts +1 -1
- package/vendor/pi-vcc/src/core/load-messages.ts +1 -1
- package/vendor/pi-vcc/src/core/normalize.ts +1 -1
- package/vendor/pi-vcc/src/core/render-entries.ts +1 -1
- package/vendor/pi-vcc/src/core/report.ts +1 -1
- package/vendor/pi-vcc/src/core/search-entries.ts +1 -1
- package/vendor/pi-vcc/src/core/summarize.ts +1 -1
- package/vendor/pi-vcc/src/hooks/before-compact.ts +2 -2
- package/vendor/pi-vcc/src/tools/recall.ts +1 -1
- package/vendor/pi-vcc/src/types.ts +1 -1
- package/vendor/pi-vcc/tests/fixtures.ts +1 -1
- package/vendor/pi-vcc/tests/render-entries.test.ts +1 -1
- package/vendor/pi-vcc/tests/search-entries.test.ts +1 -1
- package/vendor/pi-vcc/tests/support/load-session.ts +2 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ultimate-pi.local/.pi/harness/specs/harness-spawn-context.schema.json",
|
|
4
|
+
"title": "HarnessSpawnContext",
|
|
5
|
+
"description": "Structured context passed from harness slash-command orchestrators to harness/* subagents.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema_version", "agent", "mode"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "1.0.0"
|
|
13
|
+
},
|
|
14
|
+
"agent": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 1,
|
|
17
|
+
"description": "Target subagent id, e.g. harness/planner"
|
|
18
|
+
},
|
|
19
|
+
"mode": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"create",
|
|
23
|
+
"revise",
|
|
24
|
+
"execute",
|
|
25
|
+
"benchmark",
|
|
26
|
+
"verdict",
|
|
27
|
+
"adversary",
|
|
28
|
+
"trace",
|
|
29
|
+
"incident",
|
|
30
|
+
"tune"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"run_id": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"plan_packet_path": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"run_dir": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"task_summary": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
"risk_level": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": ["low", "med", "high"]
|
|
48
|
+
},
|
|
49
|
+
"quick": {
|
|
50
|
+
"type": "boolean"
|
|
51
|
+
},
|
|
52
|
+
"acceptance_checks": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": { "type": "string" }
|
|
55
|
+
},
|
|
56
|
+
"artifact_paths": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": { "type": "string" }
|
|
59
|
+
},
|
|
60
|
+
"handoff_summary": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Prior phase bullet summary for chained spawns (harness-auto)"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "HarnessTurn",
|
|
4
|
+
"description": "Recorded on Pi input event when user invokes a /harness-* prompt template (raw slash, before expansion).",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schema_version", "command", "args", "source", "invoked_at"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "const": "1.0.0" },
|
|
10
|
+
"command": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^harness-[a-z0-9-]+$"
|
|
13
|
+
},
|
|
14
|
+
"args": { "type": "string" },
|
|
15
|
+
"source": { "const": "slash" },
|
|
16
|
+
"invoked_at": { "type": "string", "format": "date-time" }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse structured JSON blocks from harness subagent assistant output.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const JSON_FENCE_RE = /```(?:json)?\s*([\s\S]*?)```/i;
|
|
6
|
+
|
|
7
|
+
export function extractJsonBlock(text: string): string | null {
|
|
8
|
+
const trimmed = text.trim();
|
|
9
|
+
if (trimmed.startsWith("{")) {
|
|
10
|
+
return trimmed;
|
|
11
|
+
}
|
|
12
|
+
const match = JSON_FENCE_RE.exec(text);
|
|
13
|
+
if (match?.[1]) {
|
|
14
|
+
return match[1].trim();
|
|
15
|
+
}
|
|
16
|
+
const lastBrace = trimmed.lastIndexOf("{");
|
|
17
|
+
const lastClose = trimmed.lastIndexOf("}");
|
|
18
|
+
if (lastBrace >= 0 && lastClose > lastBrace) {
|
|
19
|
+
return trimmed.slice(lastBrace, lastClose + 1);
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function parseHarnessAgentJson<T extends Record<string, unknown>>(
|
|
25
|
+
text: string,
|
|
26
|
+
): { ok: true; value: T } | { ok: false; error: string } {
|
|
27
|
+
const block = extractJsonBlock(text);
|
|
28
|
+
if (!block) {
|
|
29
|
+
return { ok: false, error: "no JSON block found in subagent output" };
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const value = JSON.parse(block) as T;
|
|
33
|
+
if (!value || typeof value !== "object") {
|
|
34
|
+
return { ok: false, error: "parsed value is not an object" };
|
|
35
|
+
}
|
|
36
|
+
return { ok: true, value };
|
|
37
|
+
} catch (err) {
|
|
38
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
39
|
+
return { ok: false, error: message };
|
|
40
|
+
}
|
|
41
|
+
}
|