opencode-agent-skill 14.2.0-beta.1 → 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.
Files changed (55) hide show
  1. package/README.md +51 -18
  2. package/docs/PI-COMPAT.md +167 -3
  3. package/docs/V15-MANAGED-RUNTIME.md +128 -0
  4. package/global-config/agents/architect.md +63 -1
  5. package/global-config/agents/executor.md +7 -0
  6. package/global-config/agents/plan-checker.md +8 -1
  7. package/global-config/agents/verifier.md +3 -3
  8. package/global-config/skills/database-engineering/references/workflow.md +15 -0
  9. package/global-config/skills/engineering-orchestrator/references/long-horizon.md +21 -11
  10. package/lib/activity-deadline.mjs +70 -0
  11. package/lib/adaptive-context-budget.mjs +25 -5
  12. package/lib/affected-tests.mjs +1 -1
  13. package/lib/capability-fabric.mjs +40 -0
  14. package/lib/code-intelligence/edit-anchor.mjs +102 -0
  15. package/lib/code-intelligence/index.mjs +95 -0
  16. package/lib/code-intelligence/lsp-provider.mjs +189 -0
  17. package/lib/completion-auditor.mjs +102 -0
  18. package/lib/document-ingestion.mjs +60 -0
  19. package/lib/evidence-store.mjs +92 -8
  20. package/lib/execution-contract.mjs +579 -0
  21. package/lib/fast-verification-gate.mjs +69 -0
  22. package/lib/leaf-runtime-optimizer.mjs +76 -0
  23. package/lib/mcp-health.mjs +144 -0
  24. package/lib/mcp-tool-policy.mjs +19 -0
  25. package/lib/memory-engine.mjs +28 -0
  26. package/lib/pi-child-invocation.mjs +65 -0
  27. package/lib/pi-rpc-pool.mjs +61 -9
  28. package/lib/plan-salvage.mjs +124 -0
  29. package/lib/planning-speed-policy.mjs +131 -0
  30. package/lib/prompt-cache.mjs +26 -12
  31. package/lib/repo-graph.mjs +1 -1
  32. package/lib/repo-inspect.mjs +1 -0
  33. package/lib/reversible-context.mjs +49 -0
  34. package/lib/runtime-artifacts.mjs +42 -0
  35. package/lib/runtime-events.mjs +33 -1
  36. package/lib/safety.mjs +1 -0
  37. package/lib/semantic-index.mjs +1 -1
  38. package/lib/service-manager.mjs +526 -0
  39. package/lib/session-display.mjs +49 -0
  40. package/lib/task-engine.mjs +6 -10
  41. package/lib/task-graph.mjs +87 -0
  42. package/lib/task-policy.mjs +210 -8
  43. package/lib/trajectory.mjs +111 -1
  44. package/lib/turbo-fast-path.mjs +44 -0
  45. package/lib/workspace-fingerprint.mjs +2 -11
  46. package/lib/workspace-root.mjs +49 -0
  47. package/lib/worktree-sandbox.mjs +234 -11
  48. package/package.json +9 -6
  49. package/pi/extensions/ues-child-runtime.ts +300 -2
  50. package/pi/extensions/ues.ts +1887 -160
  51. package/scripts/check-release-consistency.mjs +25 -2
  52. package/scripts/check-source-integrity.mjs +532 -3
  53. package/scripts/eval-pi.mjs +76 -36
  54. package/scripts/smoke-pi-extension.mjs +1 -1
  55. package/pi/prompts/ues-run.md +0 -17
@@ -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
- const steps = Array.isArray(details?.steps) ? details.steps : []
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
- "Use the UES runtime controller for this benchmark task.",
361
- "You MUST call the ues_execute tool exactly once with the complete engineering task below and the current working directory.",
362
- "Do not edit project files directly before that tool call. After the tool returns, report its verified result concisely.",
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(agentRun.stdout)
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
- ", controller=" + controllerValid +
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.ok(promptResult.prompts.length >= 11, "Pi did not load the bundled UES prompts")
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`,
@@ -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.