ultimate-pi 0.15.0 → 0.17.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-governor/SKILL.md +11 -0
- package/.agents/skills/harness-orchestration/SKILL.md +3 -1
- package/.agents/skills/harness-plan/SKILL.md +5 -5
- package/.pi/agents/harness/adversary.md +1 -1
- package/.pi/agents/harness/evaluator.md +1 -1
- package/.pi/agents/harness/executor.md +1 -1
- package/.pi/agents/harness/incident-recorder.md +1 -1
- package/.pi/agents/harness/meta-optimizer.md +1 -1
- package/.pi/agents/harness/planning/decompose.md +4 -33
- package/.pi/agents/harness/planning/execution-plan-author.md +3 -2
- package/.pi/agents/harness/planning/hypothesis-validator.md +3 -2
- package/.pi/agents/harness/planning/hypothesis.md +4 -27
- package/.pi/agents/harness/planning/implementation-researcher.md +3 -2
- package/.pi/agents/harness/planning/plan-adversary.md +2 -3
- package/.pi/agents/harness/planning/plan-evaluator.md +3 -2
- package/.pi/agents/harness/planning/review-integrator.md +2 -3
- package/.pi/agents/harness/planning/scout-graphify.md +3 -22
- package/.pi/agents/harness/planning/scout-semantic.md +3 -18
- package/.pi/agents/harness/planning/scout-structure.md +3 -18
- package/.pi/agents/harness/planning/sprint-contract-auditor.md +3 -2
- package/.pi/agents/harness/planning/stack-researcher.md +3 -2
- package/.pi/agents/harness/tie-breaker.md +1 -1
- package/.pi/agents/harness/trace-librarian.md +1 -1
- package/.pi/extensions/budget-guard.ts +33 -19
- package/.pi/extensions/harness-debate-tools.ts +54 -6
- package/.pi/extensions/harness-run-context.ts +108 -2
- package/.pi/extensions/harness-subagent-submit.ts +172 -0
- package/.pi/extensions/harness-telemetry.ts +29 -4
- package/.pi/extensions/lib/debate-bus-core.ts +49 -6
- package/.pi/extensions/lib/harness-subagent-auth.ts +104 -19
- package/.pi/extensions/lib/harness-subagent-policy.ts +59 -0
- package/.pi/extensions/lib/harness-subagent-submit-pipeline.ts +82 -0
- package/.pi/extensions/lib/harness-subagent-submit-registry.ts +172 -0
- package/.pi/extensions/lib/harness-subagents-bridge.ts +127 -0
- package/.pi/extensions/lib/plan-debate-eligibility.ts +61 -8
- package/.pi/extensions/lib/plan-debate-focus.ts +21 -9
- package/.pi/extensions/lib/plan-debate-gate.ts +92 -18
- package/.pi/extensions/lib/plan-debate-lane.ts +15 -0
- package/.pi/extensions/lib/plan-debate-lanes.ts +27 -3
- package/.pi/extensions/lib/plan-debate-round-status.ts +18 -7
- package/.pi/extensions/lib/plan-messenger.ts +4 -0
- package/.pi/extensions/lib/plan-review-gate.ts +51 -0
- package/.pi/extensions/trace-recorder.ts +1 -0
- package/.pi/harness/agents.manifest.json +22 -22
- package/.pi/harness/docs/adrs/0037-subagent-submit-tools.md +31 -0
- package/.pi/harness/docs/adrs/0038-budget-telemetry-only.md +23 -0
- package/.pi/harness/docs/adrs/README.md +2 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med-fast/artifacts/implementation-research.yaml +28 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med-fast/artifacts/review-round-consolidated.yaml +25 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med-fast/plan-packet.yaml +196 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med-fast/plan-review.md +14 -0
- package/.pi/harness/evals/smoke/fixtures/plan-phase/minimal-med-fast/research-brief.yaml +62 -0
- package/.pi/harness/evals/smoke/smoke-harness-plan.mjs +40 -17
- package/.pi/harness/specs/harness-executor-handoff.schema.json +19 -0
- package/.pi/harness/specs/harness-human-required.schema.json +16 -0
- package/.pi/harness/specs/plan-review-round-draft.schema.json +1 -1
- package/.pi/harness/specs/plan-scout-findings.schema.json +19 -0
- package/.pi/lib/harness-agent-output.ts +45 -0
- package/.pi/lib/harness-budget-enforce.ts +18 -0
- package/.pi/lib/harness-schema-validate.ts +89 -0
- package/.pi/lib/harness-spawn-parse.ts +86 -0
- package/.pi/lib/harness-subagent-submit-path.ts +41 -0
- package/.pi/lib/harness-ui-state.ts +15 -2
- package/.pi/model-router.example.json +13 -4
- package/.pi/prompts/harness-auto.md +2 -2
- package/.pi/prompts/harness-plan.md +34 -14
- package/.pi/prompts/harness-run.md +2 -2
- package/.pi/prompts/harness-setup.md +4 -4
- package/.pi/scripts/harness-generate-model-router.mjs +118 -36
- package/.pi/scripts/harness-model-router-routing.test.mjs +97 -0
- package/.pi/scripts/harness-sync-model-router.mjs +15 -2
- package/.pi/scripts/harness-verify.mjs +31 -0
- package/.pi/scripts/harness_web/__pycache__/__init__.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/config.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/output.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/scrape.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/search.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/search_ddg.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/search_searxng.cpython-314.pyc +0 -0
- package/CHANGELOG.md +21 -0
- package/package.json +4 -2
- package/vendor/pi-model-router/UPSTREAM_PIN.md +3 -1
- package/vendor/pi-model-router/extensions/commands.ts +4 -4
- package/vendor/pi-model-router/extensions/index.ts +21 -0
- package/vendor/pi-model-router/extensions/provider.ts +130 -79
- package/vendor/pi-model-router/extensions/routing.ts +148 -0
- package/vendor/pi-model-router/extensions/state.ts +3 -0
- package/vendor/pi-model-router/extensions/types.ts +9 -0
- package/vendor/pi-model-router/extensions/ui.ts +16 -2
- package/vendor/pi-subagents/src/subagents.ts +29 -3
|
@@ -42,6 +42,13 @@ export interface SpawnAuthForward {
|
|
|
42
42
|
|
|
43
43
|
export interface HarnessSubagentsOptions {
|
|
44
44
|
packageRoot?: string;
|
|
45
|
+
/** Absolute path to harness-subagent-submit.ts for subprocess-only extension loading (Option A). */
|
|
46
|
+
harnessSubprocessExtensionPath?: string;
|
|
47
|
+
/** Extra env vars per subprocess (e.g. HARNESS_RUN_ID, HARNESS_RUN_DIR). */
|
|
48
|
+
resolveSubprocessEnv?: (
|
|
49
|
+
task: string,
|
|
50
|
+
agent: AgentConfig,
|
|
51
|
+
) => Record<string, string> | undefined;
|
|
45
52
|
defaultAgentScope?: AgentScope;
|
|
46
53
|
defaultConfirmProjectAgents?: boolean;
|
|
47
54
|
beforeExecute?: (
|
|
@@ -388,8 +395,11 @@ function terminateProcess(proc: ReturnType<typeof spawn>) {
|
|
|
388
395
|
|
|
389
396
|
type OnUpdateCallback = (partial: AgentToolResult<SubagentDetails>) => void;
|
|
390
397
|
|
|
391
|
-
function buildSpawnEnv(
|
|
392
|
-
|
|
398
|
+
function buildSpawnEnv(
|
|
399
|
+
packageRoot?: string,
|
|
400
|
+
extra?: Record<string, string>,
|
|
401
|
+
): NodeJS.ProcessEnv {
|
|
402
|
+
const env = { ...process.env, ...extra };
|
|
393
403
|
env.PI_HARNESS_SUBPROCESS = "1";
|
|
394
404
|
if (packageRoot) {
|
|
395
405
|
env.UP_PKG = packageRoot;
|
|
@@ -411,6 +421,7 @@ async function runSingleAgent(
|
|
|
411
421
|
makeDetails: (results: SingleResult[]) => SubagentDetails,
|
|
412
422
|
packageRoot?: string,
|
|
413
423
|
spawnAuth?: SpawnAuthForward,
|
|
424
|
+
subagentsOptions?: HarnessSubagentsOptions,
|
|
414
425
|
): Promise<SingleResult> {
|
|
415
426
|
const agent = agents.find((a) => a.name === agentName);
|
|
416
427
|
|
|
@@ -434,8 +445,15 @@ async function runSingleAgent(
|
|
|
434
445
|
else if (spawnAuth) args.push("--model", spawnAuth.modelRef);
|
|
435
446
|
if (spawnAuth?.apiKey) args.push("--api-key", spawnAuth.apiKey);
|
|
436
447
|
if (agent.thinking) args.push("--thinking", agent.thinking);
|
|
448
|
+
const harnessExt =
|
|
449
|
+
agent.extensionsOff &&
|
|
450
|
+
agent.name.startsWith("harness/") &&
|
|
451
|
+
subagentsOptions?.harnessSubprocessExtensionPath;
|
|
437
452
|
if (agent.extensionsOff) {
|
|
438
453
|
args.push("--no-extensions");
|
|
454
|
+
if (harnessExt) {
|
|
455
|
+
args.push("-e", harnessExt);
|
|
456
|
+
}
|
|
439
457
|
if (agent.skillsOff) args.push("--no-skills");
|
|
440
458
|
}
|
|
441
459
|
if (agent.tools && agent.tools.length > 0) {
|
|
@@ -443,7 +461,11 @@ async function runSingleAgent(
|
|
|
443
461
|
} else if (agent.extensionsOff) {
|
|
444
462
|
args.push("--no-tools");
|
|
445
463
|
}
|
|
446
|
-
const
|
|
464
|
+
const extraEnv = subagentsOptions?.resolveSubprocessEnv?.(task, agent);
|
|
465
|
+
const spawnEnv = buildSpawnEnv(packageRoot, {
|
|
466
|
+
...extraEnv,
|
|
467
|
+
HARNESS_AGENT_ID: agent.name,
|
|
468
|
+
});
|
|
447
469
|
|
|
448
470
|
let tmpPromptDir: string | null = null;
|
|
449
471
|
let tmpPromptPath: string | null = null;
|
|
@@ -856,6 +878,7 @@ export function createSubagentsExtension(
|
|
|
856
878
|
makeDetails("chain"),
|
|
857
879
|
packageRoot,
|
|
858
880
|
await resolveSpawnAuth(step.agent),
|
|
881
|
+
options,
|
|
859
882
|
);
|
|
860
883
|
results.push(result);
|
|
861
884
|
|
|
@@ -950,6 +973,7 @@ export function createSubagentsExtension(
|
|
|
950
973
|
makeDetails("parallel"),
|
|
951
974
|
packageRoot,
|
|
952
975
|
await resolveSpawnAuth(t.agent),
|
|
976
|
+
options,
|
|
953
977
|
);
|
|
954
978
|
allResults[index] = result;
|
|
955
979
|
doneCount += 1;
|
|
@@ -987,6 +1011,7 @@ export function createSubagentsExtension(
|
|
|
987
1011
|
makeDetails("parallel"),
|
|
988
1012
|
packageRoot,
|
|
989
1013
|
await resolveSpawnAuth(aggregator.agent),
|
|
1014
|
+
options,
|
|
990
1015
|
);
|
|
991
1016
|
}
|
|
992
1017
|
|
|
@@ -1038,6 +1063,7 @@ export function createSubagentsExtension(
|
|
|
1038
1063
|
makeDetails("single"),
|
|
1039
1064
|
packageRoot,
|
|
1040
1065
|
await resolveSpawnAuth(params.agent),
|
|
1066
|
+
options,
|
|
1041
1067
|
);
|
|
1042
1068
|
const isError = result.exitCode !== 0 || result.stopReason === "error" || result.stopReason === "aborted";
|
|
1043
1069
|
if (isError) {
|