opencode-agent-skill 14.4.0 → 15.0.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/README.md +33 -15
- package/docs/PI-COMPAT.md +151 -2
- package/docs/V15-MANAGED-RUNTIME.md +128 -0
- package/global-config/agents/architect.md +63 -1
- package/global-config/agents/executor.md +7 -0
- package/global-config/agents/plan-checker.md +8 -1
- package/global-config/agents/verifier.md +3 -3
- package/global-config/skills/database-engineering/references/workflow.md +15 -0
- package/global-config/skills/engineering-orchestrator/references/long-horizon.md +21 -11
- package/lib/activity-deadline.mjs +70 -0
- package/lib/adaptive-context-budget.mjs +25 -5
- package/lib/affected-tests.mjs +1 -1
- package/lib/capability-fabric.mjs +17 -0
- package/lib/completion-auditor.mjs +25 -5
- package/lib/evidence-store.mjs +92 -8
- package/lib/execution-contract.mjs +579 -0
- package/lib/leaf-runtime-optimizer.mjs +76 -0
- package/lib/pi-child-invocation.mjs +65 -0
- package/lib/pi-rpc-pool.mjs +61 -9
- package/lib/plan-salvage.mjs +124 -0
- package/lib/planning-speed-policy.mjs +131 -0
- package/lib/repo-graph.mjs +1 -1
- package/lib/repo-inspect.mjs +1 -0
- package/lib/runtime-artifacts.mjs +42 -0
- package/lib/runtime-events.mjs +33 -1
- package/lib/safety.mjs +1 -0
- package/lib/semantic-index.mjs +1 -1
- package/lib/service-manager.mjs +526 -0
- package/lib/session-display.mjs +49 -0
- package/lib/task-graph.mjs +87 -0
- package/lib/task-policy.mjs +150 -4
- package/lib/trajectory.mjs +111 -1
- package/lib/turbo-fast-path.mjs +44 -0
- package/lib/workspace-fingerprint.mjs +2 -11
- package/lib/workspace-root.mjs +49 -0
- package/lib/worktree-sandbox.mjs +234 -11
- package/package.json +8 -5
- package/pi/extensions/ues-child-runtime.ts +145 -2
- package/pi/extensions/ues.ts +1760 -160
- package/scripts/check-release-consistency.mjs +25 -2
- package/scripts/check-source-integrity.mjs +471 -4
- package/scripts/eval-pi.mjs +76 -36
- package/scripts/smoke-pi-extension.mjs +1 -1
- package/pi/prompts/ues-run.md +0 -17
package/scripts/eval-pi.mjs
CHANGED
|
@@ -155,6 +155,35 @@ function parsePiTelemetry(stdout) {
|
|
|
155
155
|
baseContextChars: 0,
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
const consumeControllerDetails = (details) => {
|
|
159
|
+
const steps = Array.isArray(details?.steps) ? details.steps : []
|
|
160
|
+
for (const step of steps) {
|
|
161
|
+
const optimization = step?.optimizations
|
|
162
|
+
if (optimization && typeof optimization === "object") {
|
|
163
|
+
turbo.routedAgentSteps += 1
|
|
164
|
+
if (optimization.childRuntime === "rpc") turbo.rpcRuns += 1
|
|
165
|
+
if (optimization.childRuntime === "cli") turbo.cliRuns += 1
|
|
166
|
+
if (optimization.warmWorkerReused === true) turbo.warmWorkerReuses += 1
|
|
167
|
+
if (optimization.contextCacheHit === true) turbo.contextCacheHits += 1
|
|
168
|
+
if (optimization.microSkillCacheHit === true) turbo.microSkillCacheHits += 1
|
|
169
|
+
if (optimization.affectedTestCacheHit === true) turbo.affectedTestCacheHits += 1
|
|
170
|
+
turbo.reusableVerificationReceipts += Number(optimization.reusableVerificationReceipts || 0)
|
|
171
|
+
if (optimization.compactToolOutput === true) turbo.compactedToolOutputSteps += 1
|
|
172
|
+
turbo.adaptiveContextChars += Number(optimization.runtimeContextBudget || 0)
|
|
173
|
+
turbo.baseContextChars += Number(optimization.baseContextBudget || 0)
|
|
174
|
+
}
|
|
175
|
+
if (step?.usage) {
|
|
176
|
+
addUsage(childUsage, step.usage)
|
|
177
|
+
childUsageSamples += 1
|
|
178
|
+
}
|
|
179
|
+
childToolCalls += Number(step?.toolCalls || 0)
|
|
180
|
+
for (const name of step?.toolNames || []) {
|
|
181
|
+
const key = "child:" + String(name)
|
|
182
|
+
toolNames[key] = Number(toolNames[key] || 0) + 1
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
158
187
|
for (const line of String(stdout || "").split(/\r?\n/)) {
|
|
159
188
|
if (!line.trim()) continue
|
|
160
189
|
let event
|
|
@@ -188,34 +217,19 @@ function parsePiTelemetry(stdout) {
|
|
|
188
217
|
|
|
189
218
|
if (event.type === "tool_execution_end" && event.toolName === "ues_execute") {
|
|
190
219
|
const details = event.result?.details
|
|
191
|
-
|
|
192
|
-
for (const step of steps) {
|
|
193
|
-
const optimization = step?.optimizations
|
|
194
|
-
if (optimization && typeof optimization === "object") {
|
|
195
|
-
turbo.routedAgentSteps += 1
|
|
196
|
-
if (optimization.childRuntime === "rpc") turbo.rpcRuns += 1
|
|
197
|
-
if (optimization.childRuntime === "cli") turbo.cliRuns += 1
|
|
198
|
-
if (optimization.warmWorkerReused === true) turbo.warmWorkerReuses += 1
|
|
199
|
-
if (optimization.contextCacheHit === true) turbo.contextCacheHits += 1
|
|
200
|
-
if (optimization.microSkillCacheHit === true) turbo.microSkillCacheHits += 1
|
|
201
|
-
if (optimization.affectedTestCacheHit === true) turbo.affectedTestCacheHits += 1
|
|
202
|
-
turbo.reusableVerificationReceipts += Number(optimization.reusableVerificationReceipts || 0)
|
|
203
|
-
if (optimization.compactToolOutput === true) turbo.compactedToolOutputSteps += 1
|
|
204
|
-
turbo.adaptiveContextChars += Number(optimization.runtimeContextBudget || 0)
|
|
205
|
-
turbo.baseContextChars += Number(optimization.baseContextBudget || 0)
|
|
206
|
-
}
|
|
207
|
-
if (step?.usage) {
|
|
208
|
-
addUsage(childUsage, step.usage)
|
|
209
|
-
childUsageSamples += 1
|
|
210
|
-
}
|
|
211
|
-
childToolCalls += Number(step?.toolCalls || 0)
|
|
212
|
-
for (const name of step?.toolNames || []) {
|
|
213
|
-
const key = "child:" + String(name)
|
|
214
|
-
toolNames[key] = Number(toolNames[key] || 0) + 1
|
|
215
|
-
}
|
|
216
|
-
}
|
|
220
|
+
consumeControllerDetails(details)
|
|
217
221
|
if (event.isError !== true && details?.mode === "execute") controllerPass = true
|
|
218
222
|
}
|
|
223
|
+
|
|
224
|
+
if (event.type === "ues_controller_progress") {
|
|
225
|
+
controllerUsed = true
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (event.type === "ues_controller_direct") {
|
|
229
|
+
controllerUsed = event.controllerUsed === true
|
|
230
|
+
controllerPass = event.controllerPass === true
|
|
231
|
+
consumeControllerDetails(event.details)
|
|
232
|
+
}
|
|
219
233
|
}
|
|
220
234
|
|
|
221
235
|
const totalUsage = zeroUsage()
|
|
@@ -334,6 +348,7 @@ try {
|
|
|
334
348
|
const childEnv = {
|
|
335
349
|
...process.env,
|
|
336
350
|
UES_CONFIG_DIR: uesConfigDir,
|
|
351
|
+
UES_EVAL_DIRECT_TELEMETRY: mode === "ues" ? "1" : "0",
|
|
337
352
|
PI_SKIP_VERSION_CHECK: "true",
|
|
338
353
|
NO_COLOR: "1",
|
|
339
354
|
}
|
|
@@ -356,14 +371,10 @@ try {
|
|
|
356
371
|
let prompt = task.prompt
|
|
357
372
|
if (mode === "ues") {
|
|
358
373
|
piArgs.push("--extension", path.join(root, "pi", "extensions", "ues.ts"))
|
|
359
|
-
prompt
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
"",
|
|
364
|
-
"Engineering task:",
|
|
365
|
-
task.prompt,
|
|
366
|
-
].join("\n")
|
|
374
|
+
// /ues-run is an extension command, resolved before prompt templates.
|
|
375
|
+
// The benchmark therefore exercises the controller deterministically
|
|
376
|
+
// instead of measuring whether a weak parent model remembers to call a tool.
|
|
377
|
+
prompt = "/ues-run " + task.prompt
|
|
367
378
|
}
|
|
368
379
|
piArgs.push(prompt)
|
|
369
380
|
|
|
@@ -371,6 +382,31 @@ try {
|
|
|
371
382
|
"[" + mode + "] " + task.id + " trial " + trial + ": starting Pi " + piVersion +
|
|
372
383
|
(providerExtensions.length ? " with provider extension isolation" : ""),
|
|
373
384
|
)
|
|
385
|
+
const progressBuffers = { stdout: "", stderr: "" }
|
|
386
|
+
const consumeControllerProgress = (chunk, stream) => {
|
|
387
|
+
if (mode !== "ues") return
|
|
388
|
+
progressBuffers[stream] += String(chunk || "")
|
|
389
|
+
const lines = progressBuffers[stream].split(/\r?\n/)
|
|
390
|
+
progressBuffers[stream] = lines.pop() || ""
|
|
391
|
+
for (const line of lines) {
|
|
392
|
+
if (!line.trim()) continue
|
|
393
|
+
try {
|
|
394
|
+
const event = JSON.parse(line)
|
|
395
|
+
if (event?.type !== "ues_controller_progress") continue
|
|
396
|
+
console.log(
|
|
397
|
+
"[" + mode + "] " + task.id + " trial " + trial +
|
|
398
|
+
": controller progress" +
|
|
399
|
+
(event.agent ? " agent=" + event.agent : "") +
|
|
400
|
+
(event.phase ? " phase=" + event.phase : "") +
|
|
401
|
+
" elapsed=" + Math.round(Number(event.elapsedMs || 0) / 1000) + "s" +
|
|
402
|
+
" idle=" + Math.round(Number(event.idleMs || 0) / 1000) + "s" +
|
|
403
|
+
" tools=" + Number(event.toolCalls || 0) +
|
|
404
|
+
(event.activeTool ? " activeTool=" + event.activeTool : "") +
|
|
405
|
+
(event.note ? " note=" + String(event.note).slice(0, 180) : ""),
|
|
406
|
+
)
|
|
407
|
+
} catch {}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
374
410
|
const agentRun = await runAsync(piCommand, piArgs, {
|
|
375
411
|
cwd: workspace,
|
|
376
412
|
env: childEnv,
|
|
@@ -379,6 +415,8 @@ try {
|
|
|
379
415
|
timeoutMs,
|
|
380
416
|
idleTimeoutMs,
|
|
381
417
|
signal: abortController.signal,
|
|
418
|
+
onStdout: (chunk) => consumeControllerProgress(chunk, "stdout"),
|
|
419
|
+
onStderr: (chunk) => consumeControllerProgress(chunk, "stderr"),
|
|
382
420
|
onHeartbeat: ({ elapsedMs, idleMs }) => {
|
|
383
421
|
console.log(
|
|
384
422
|
"[" + mode + "] " + task.id + " trial " + trial +
|
|
@@ -398,7 +436,9 @@ try {
|
|
|
398
436
|
|
|
399
437
|
const afterSnapshot = await snapshotWorkspace(workspace)
|
|
400
438
|
const changedFiles = diffWorkspaceSnapshots(beforeSnapshot, afterSnapshot)
|
|
401
|
-
const telemetry = parsePiTelemetry(
|
|
439
|
+
const telemetry = parsePiTelemetry(
|
|
440
|
+
[agentRun.stdout, agentRun.stderr].filter(Boolean).join("\n"),
|
|
441
|
+
)
|
|
402
442
|
const baselineIsolated = mode !== "baseline" || telemetry.controllerUsed === false
|
|
403
443
|
const controllerValid =
|
|
404
444
|
mode === "baseline"
|
|
@@ -437,7 +477,7 @@ try {
|
|
|
437
477
|
"[" + mode + "] " + task.id + " trial " + trial + ": " +
|
|
438
478
|
(passed ? "PASS" : "FAIL") +
|
|
439
479
|
" (agent=" + agentRun.status + ", grader=" + graderRun.status +
|
|
440
|
-
",
|
|
480
|
+
", controllerValid=" + controllerValid +
|
|
441
481
|
(mode === "baseline" ? ", isolated=" + baselineIsolated : "") + ")",
|
|
442
482
|
)
|
|
443
483
|
}
|
|
@@ -132,7 +132,7 @@ try {
|
|
|
132
132
|
0,
|
|
133
133
|
promptResult.diagnostics.map((entry) => `${entry.path || entry.filePath || "prompt"}: ${entry.message || entry.error || JSON.stringify(entry)}`).join("\n"),
|
|
134
134
|
)
|
|
135
|
-
assert.
|
|
135
|
+
assert.equal(promptResult.prompts.length, 10, "Pi must load exactly 10 prompt templates; /ues-run is an extension command")
|
|
136
136
|
|
|
137
137
|
console.log(
|
|
138
138
|
`Pi package smoke passed via ${loaded.source}: ${result.extensions.length} extension(s), ${skillResult.skills.length} skill(s), ${promptResult.prompts.length} prompt(s) loaded`,
|
package/pi/prompts/ues-run.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Execute engineering work through the deterministic UES runtime controller on Pi, with adaptive context, model routing, retries, and evidence-gated verification.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Run this task with UES on Pi: $@
|
|
6
|
-
|
|
7
|
-
Preserve the user's requested outcome and approval boundaries.
|
|
8
|
-
|
|
9
|
-
1. If the request is directly answerable and needs no repository evidence, edits, or machine-checkable verification, answer directly.
|
|
10
|
-
2. Otherwise prefer the `ues_execute` tool for end-to-end engineering work. Pass a concise but complete task and the current repository cwd. The controller owns task policy, bounded context construction, model-tier routing, optional diagnosis/plan gating, implementation, retries, independent verification, integration verification, and performance telemetry.
|
|
11
|
-
3. Do not manually reproduce the controller workflow unless `ues_execute` is unavailable or the user explicitly asks for plan-only/review-only/research-only work.
|
|
12
|
-
4. Use `ues_cli` for deterministic inspection, durable `.ues-work/` state, task graphs, receipts, evidence, worktrees, browser/visual helpers, and explicit policy/config operations.
|
|
13
|
-
5. Use `ues_dispatch` when you intentionally need one specialist, a custom chain, or bounded parallel read-only work. Routed dispatch automatically applies model policy and adaptive context.
|
|
14
|
-
6. Parallel read-only agents may share the repository. Parallel writer agents must use explicit distinct isolated cwd/worktrees; otherwise run writers serially. Never bypass this guard.
|
|
15
|
-
7. Preserve unrelated user changes. Do not force-clean a repository.
|
|
16
|
-
8. Do not merge, push, publish, deploy, rewrite history, or perform destructive operations without explicit user approval.
|
|
17
|
-
9. Final completion claims must come from a verified controller PASS or equivalent fresh command/test evidence plus the final diff/status.
|