ultimate-pi 0.19.1 → 0.22.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 +68 -2
- package/.agents/skills/harness-git-commit/SKILL.md +72 -0
- package/.agents/skills/harness-governor/SKILL.md +2 -2
- package/.agents/skills/harness-ls-lint-setup/SKILL.md +59 -0
- package/.agents/skills/harness-plan/SKILL.md +13 -11
- package/.agents/skills/harness-review/SKILL.md +1 -1
- package/.agents/skills/harness-sentrux-repair/SKILL.md +48 -0
- package/.agents/skills/sentrux/SKILL.md +4 -2
- package/.agents/skills/wiki-save/SKILL.md +1 -1
- package/.pi/PACKAGING.md +6 -0
- package/.pi/SYSTEM.md +21 -3
- package/.pi/agents/harness/ls-lint-steward.md +49 -0
- package/.pi/agents/harness/planning/decompose.md +4 -4
- package/.pi/agents/harness/reviewing/evaluator.md +1 -1
- package/.pi/agents/harness/running/executor.md +43 -2
- package/.pi/agents/harness/sentrux-repair-advisor.md +50 -0
- package/.pi/agents/pi-pi/prompt-expert.md +17 -2
- package/.pi/auto-commit.json +9 -2
- package/.pi/extensions/debate-orchestrator.ts +3 -0
- package/.pi/extensions/harness-anchored-edit.ts +139 -0
- package/.pi/extensions/harness-ask-user.ts +13 -34
- package/.pi/extensions/harness-debate-tools.ts +43 -4
- package/.pi/extensions/harness-live-widget.ts +28 -19
- package/.pi/extensions/harness-run-context.ts +278 -115
- package/.pi/extensions/harness-web-tools.ts +598 -471
- package/.pi/extensions/ls-lint-rules-sync.ts +103 -0
- package/.pi/extensions/observation-bus.ts +4 -0
- package/.pi/extensions/policy-gate.ts +270 -229
- package/.pi/extensions/sentrux-rules-sync.ts +2 -0
- package/.pi/extensions/soundboard.ts +48 -48
- package/.pi/harness/README.md +4 -0
- package/.pi/harness/agents.manifest.json +15 -7
- package/.pi/harness/agents.policy.yaml +47 -81
- package/.pi/harness/docs/adrs/0051-hash-anchored-executor-edits.md +41 -0
- package/.pi/harness/docs/adrs/0052-ls-lint-naming-lifecycle.md +45 -0
- package/.pi/harness/docs/adrs/0052-sentrux-structured-repair.md +38 -0
- package/.pi/harness/docs/adrs/0053-plan-task-clarification-gate.md +39 -0
- package/.pi/harness/docs/adrs/0054-harness-native-ask-user.md +40 -0
- package/.pi/harness/docs/adrs/0055-auto-commit-coauthor-lifecycle.md +40 -0
- package/.pi/harness/docs/adrs/README.md +7 -0
- package/.pi/harness/docs/practice-map.md +21 -5
- package/.pi/harness/evals/smoke/ls-lint-stub.json +10 -0
- package/.pi/harness/evolution/self-healing-rules.json +16 -0
- package/.pi/harness/ls-lint/naming.manifest.json +128 -0
- package/.pi/harness/sentrux/architecture.manifest.json +1 -1
- package/.pi/harness/specs/auto-commit.schema.json +63 -0
- package/.pi/harness/specs/ls-lint-manifest-proposal.schema.json +80 -0
- package/.pi/harness/specs/ls-lint-signal.schema.json +47 -0
- package/.pi/harness/specs/naming-manifest.schema.json +54 -0
- package/.pi/harness/specs/plan-task-clarification.schema.json +88 -0
- package/.pi/harness/specs/sentrux-diagnostics.schema.json +173 -0
- package/.pi/harness/specs/sentrux-repair-plan.schema.json +133 -0
- package/.pi/harness/specs/sentrux-report.schema.json +119 -0
- package/.pi/harness/specs/sentrux-signal.schema.json +34 -1
- package/.pi/lib/agents-policy.d.mts +26 -47
- package/.pi/lib/agents-policy.mjs +84 -29
- package/.pi/lib/agents-policy.ts +1 -0
- package/.pi/lib/agt/build-evaluation-context.ts +136 -64
- package/.pi/lib/ask-user/constants.mjs +3 -0
- package/.pi/lib/ask-user/constants.ts +4 -0
- package/.pi/lib/ask-user/contracts/glimpse-parse.ts +56 -0
- package/.pi/lib/ask-user/contracts/glimpse-payload-build.ts +58 -0
- package/.pi/lib/ask-user/contracts/glimpse-payload.ts +38 -0
- package/.pi/lib/ask-user/core/questionnaire.ts +74 -0
- package/.pi/lib/ask-user/dialog.ts +2 -314
- package/.pi/lib/ask-user/fallback.ts +2 -78
- package/.pi/lib/ask-user/format.ts +85 -0
- package/.pi/lib/ask-user/glimpseui.d.ts +10 -0
- package/.pi/lib/ask-user/index.ts +114 -0
- package/.pi/lib/ask-user/merge-task-clarification.ts +98 -0
- package/.pi/lib/ask-user/policy.mjs +43 -0
- package/.pi/lib/ask-user/policy.ts +104 -0
- package/.pi/lib/ask-user/presenters/glimpse.ts +130 -0
- package/.pi/lib/ask-user/presenters/headless.ts +131 -0
- package/.pi/lib/ask-user/presenters/select.ts +60 -0
- package/.pi/lib/ask-user/presenters/tui.ts +373 -0
- package/.pi/lib/ask-user/presenters/types.ts +13 -0
- package/.pi/lib/ask-user/render.ts +40 -9
- package/.pi/lib/ask-user/schema.ts +66 -13
- package/.pi/lib/ask-user/types.ts +60 -3
- package/.pi/lib/ask-user/validate-core.mjs +193 -7
- package/.pi/lib/ask-user/validate.ts +53 -34
- package/.pi/lib/harness-anchored-edit/.hash_anchors +1721 -0
- package/.pi/lib/harness-anchored-edit/anchor-state.ts +320 -0
- package/.pi/lib/harness-anchored-edit/apply-anchored-edits.ts +161 -0
- package/.pi/lib/harness-anchored-edit/edit-executor.ts +146 -0
- package/.pi/lib/harness-anchored-edit/index.ts +9 -0
- package/.pi/lib/harness-anchored-edit/line-protocol.ts +38 -0
- package/.pi/lib/harness-anchored-edit/package.json +3 -0
- package/.pi/lib/harness-anchored-edit/settings.ts +1 -0
- package/.pi/lib/harness-anchored-edit/task-id.ts +8 -0
- package/.pi/lib/harness-anchored-edit/types.ts +19 -0
- package/.pi/lib/harness-artifact-gate.ts +75 -21
- package/.pi/lib/harness-auto-commit-config.mjs +321 -0
- package/.pi/lib/harness-lens/clients/anchored-edit-autopatch.ts +158 -0
- package/.pi/lib/harness-lens/clients/lsp/client.ts +62 -39
- package/.pi/lib/harness-lens/clients/tool-policy.ts +73 -181
- package/.pi/lib/harness-lens/index.ts +246 -96
- package/.pi/lib/harness-lens/tools/lsp-navigation.ts +10 -8
- package/.pi/lib/harness-repair-brief.ts +84 -25
- package/.pi/lib/harness-run-context.ts +42 -52
- package/.pi/lib/harness-sentrux-parse.mjs +272 -0
- package/.pi/lib/harness-sentrux-root.mjs +78 -0
- package/.pi/lib/harness-slash-completions.ts +116 -0
- package/.pi/lib/harness-spawn-topology.ts +121 -87
- package/.pi/lib/harness-subagent-submit-registry.ts +10 -0
- package/.pi/lib/harness-subagents-bridge.ts +11 -6
- package/.pi/lib/harness-ui-state.ts +95 -48
- package/.pi/lib/plan-approval/dialog.ts +5 -0
- package/.pi/lib/plan-approval/validate.ts +1 -1
- package/.pi/lib/plan-approval-readiness.ts +32 -0
- package/.pi/lib/plan-debate-gate.ts +154 -114
- package/.pi/lib/plan-task-clarification.ts +158 -0
- package/.pi/prompts/harness-auto.md +2 -2
- package/.pi/prompts/harness-ls-lint-steward.md +43 -0
- package/.pi/prompts/harness-plan.md +58 -8
- package/.pi/prompts/harness-review.md +40 -6
- package/.pi/prompts/harness-run.md +33 -11
- package/.pi/prompts/harness-setup.md +72 -3
- package/.pi/prompts/harness-steer.md +3 -2
- package/.pi/prompts/wiki-save.md +5 -4
- package/.pi/scripts/README.md +8 -0
- package/.pi/scripts/generate-agents-policy-yaml.mjs +14 -2
- package/.pi/scripts/harness-anchored-edit-smoke.mjs +45 -0
- package/.pi/scripts/harness-auto-commit-bootstrap.mjs +96 -0
- package/.pi/scripts/harness-cli-verify.sh +47 -0
- package/.pi/scripts/harness-git-churn.mjs +77 -0
- package/.pi/scripts/harness-git-commit.mjs +173 -0
- package/.pi/scripts/harness-ls-lint-bootstrap.mjs +142 -0
- package/.pi/scripts/harness-ls-lint-cli.mjs +184 -0
- package/.pi/scripts/harness-seed-project-contracts.mjs +47 -0
- package/.pi/scripts/harness-sentrux-diagnostics.mjs +230 -0
- package/.pi/scripts/harness-sentrux-report.mjs +256 -0
- package/.pi/scripts/harness-verify.mjs +347 -117
- package/.pi/scripts/ls-lint-rules-sync.mjs +265 -0
- package/.pi/scripts/run-tests.mjs +65 -0
- package/.pi/settings.example.json +1 -0
- package/.sentrux/rules.toml +1 -1
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +31 -0
- package/README.md +13 -4
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/package.json +8 -3
- package/vendor/pi-subagents/src/agents.ts +5 -0
- package/vendor/pi-subagents/src/subagents.ts +22 -3
- package/vendor/pi-vcc/src/hooks/before-compact.ts +86 -60
- package/.pi/scripts/release.sh +0 -338
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ls-lint-rules-sync — keep .ls-lint.yml aligned with harness naming manifest.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
import { resolveHarnessScript } from "../lib/harness-paths.js";
|
|
8
|
+
import { isHarnessProjectEnabled } from "../lib/harness-project-config.js";
|
|
9
|
+
import { completeStrictFlag } from "../lib/harness-slash-completions.js";
|
|
10
|
+
|
|
11
|
+
function resolveSyncScript(): string {
|
|
12
|
+
return resolveHarnessScript(
|
|
13
|
+
// @ts-expect-error pi extensions run as ESM
|
|
14
|
+
import.meta.url,
|
|
15
|
+
"ls-lint-rules-sync.mjs",
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function runSync(args: string[]): Promise<{ code: number; output: string }> {
|
|
20
|
+
const syncScript = resolveSyncScript();
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const child = spawn(process.execPath, [syncScript, ...args], {
|
|
23
|
+
cwd: process.cwd(),
|
|
24
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
25
|
+
});
|
|
26
|
+
let output = "";
|
|
27
|
+
child.stdout?.on("data", (d) => {
|
|
28
|
+
output += d.toString();
|
|
29
|
+
});
|
|
30
|
+
child.stderr?.on("data", (d) => {
|
|
31
|
+
output += d.toString();
|
|
32
|
+
});
|
|
33
|
+
child.on("close", (code) => resolve({ code: code ?? 1, output }));
|
|
34
|
+
child.on("error", (err) =>
|
|
35
|
+
resolve({ code: 1, output: String(err.message) }),
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default function lsLintRulesSync(pi: ExtensionAPI) {
|
|
41
|
+
if (!isHarnessProjectEnabled()) return;
|
|
42
|
+
pi.on("session_start", async () => {
|
|
43
|
+
const { code, output } = await runSync(["--check"]);
|
|
44
|
+
if (code !== 0) {
|
|
45
|
+
console.warn(
|
|
46
|
+
"[ls-lint-rules-sync] .ls-lint.yml out of date — run /harness-ls-lint-sync",
|
|
47
|
+
);
|
|
48
|
+
if (output.trim()) console.warn(output.trim());
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
pi.on("agent_end", async (_event, ctx) => {
|
|
53
|
+
const entries = ctx.sessionManager.getEntries();
|
|
54
|
+
let shouldSync = false;
|
|
55
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
56
|
+
const entry = entries[i] as {
|
|
57
|
+
type?: string;
|
|
58
|
+
customType?: string;
|
|
59
|
+
data?: { phase?: string };
|
|
60
|
+
};
|
|
61
|
+
if (entry.type !== "custom") continue;
|
|
62
|
+
if (entry.customType === "harness-policy-state") {
|
|
63
|
+
const phase = entry.data?.phase;
|
|
64
|
+
if (phase === "plan" || phase === "merge") shouldSync = true;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
if (entry.customType === "harness-naming-changed") {
|
|
68
|
+
shouldSync = true;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!shouldSync) return;
|
|
73
|
+
const { output } = await runSync(["--force"]);
|
|
74
|
+
if (output.trim()) {
|
|
75
|
+
pi.appendEntry("harness-ls-lint-rules-sync", {
|
|
76
|
+
synced_at: new Date().toISOString(),
|
|
77
|
+
message: output.trim().split("\n").pop(),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
pi.registerCommand("harness-ls-lint-sync", {
|
|
83
|
+
description: "Regenerate .ls-lint.yml from harness naming manifest",
|
|
84
|
+
getArgumentCompletions: completeStrictFlag,
|
|
85
|
+
handler: async (_args, ctx) => {
|
|
86
|
+
const strict = _args.includes("--strict");
|
|
87
|
+
const { code, output } = await runSync(
|
|
88
|
+
strict ? ["--force", "--strict"] : ["--force"],
|
|
89
|
+
);
|
|
90
|
+
const msg =
|
|
91
|
+
output.trim() || (code === 0 ? "naming rules synced" : "sync failed");
|
|
92
|
+
if (ctx.hasUI) {
|
|
93
|
+
ctx.ui.notify(msg, code === 0 ? "info" : "error");
|
|
94
|
+
} else {
|
|
95
|
+
pi.sendMessage({
|
|
96
|
+
customType: "harness-ls-lint-sync-result",
|
|
97
|
+
content: msg,
|
|
98
|
+
display: true,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
@@ -19,6 +19,7 @@ type ObservationKind =
|
|
|
19
19
|
| "drift"
|
|
20
20
|
| "eval"
|
|
21
21
|
| "sentrux"
|
|
22
|
+
| "ls-lint"
|
|
22
23
|
| "trace";
|
|
23
24
|
type ObservationSource =
|
|
24
25
|
| "policy-gate"
|
|
@@ -29,6 +30,7 @@ type ObservationSource =
|
|
|
29
30
|
| "debate-orchestrator"
|
|
30
31
|
| "drift-monitor"
|
|
31
32
|
| "sentrux"
|
|
33
|
+
| "ls-lint"
|
|
32
34
|
| "evaluator"
|
|
33
35
|
| "harness-telemetry";
|
|
34
36
|
|
|
@@ -52,6 +54,7 @@ const SOURCE_BY_CUSTOM: Record<string, ObservationSource> = {
|
|
|
52
54
|
"harness-drift-report": "drift-monitor",
|
|
53
55
|
"harness-eval-verdict": "evaluator",
|
|
54
56
|
"harness-sentrux-signal": "sentrux",
|
|
57
|
+
"harness-ls-lint-signal": "ls-lint",
|
|
55
58
|
"harness-run-record": "trace-recorder",
|
|
56
59
|
};
|
|
57
60
|
|
|
@@ -69,6 +72,7 @@ const KIND_BY_CUSTOM: Record<string, ObservationKind> = {
|
|
|
69
72
|
"harness-drift-report": "drift",
|
|
70
73
|
"harness-eval-verdict": "eval",
|
|
71
74
|
"harness-sentrux-signal": "sentrux",
|
|
75
|
+
"harness-ls-lint-signal": "ls-lint",
|
|
72
76
|
"harness-run-record": "trace",
|
|
73
77
|
};
|
|
74
78
|
|