opencode-agent-skill 13.0.0-beta.2 → 14.4.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 (102) hide show
  1. package/README.md +1571 -607
  2. package/bin/ocskill.mjs +172 -24
  3. package/docs/OPENCODE-COMPAT.md +34 -97
  4. package/docs/PI-COMPAT.md +203 -0
  5. package/docs/V14-CONTEXT-MEMORY-FABRIC.md +70 -0
  6. package/docs/V14.1-QUALITY-PERFORMANCE-FABRIC.md +114 -0
  7. package/docs/V14.2-TURBO-WEAK-MODEL-RUNTIME.md +448 -0
  8. package/evals/v14/tasks.json +46 -0
  9. package/global-config/agents/executor.md +7 -0
  10. package/global-config/agents/visual-verifier.md +22 -3
  11. package/global-config/plugins/ues-router/index.js +13 -8
  12. package/global-config/plugins/ues-router/policy-runtime.js +7 -0
  13. package/global-config/plugins/ues-router/router.js +12 -2
  14. package/global-config/skills/ecommerce-engineering/SKILL.md +1 -1
  15. package/global-config/skills/file-upload-engineering/SKILL.md +1 -1
  16. package/global-config/skills/git-safety/SKILL.md +1 -1
  17. package/global-config/skills/nestjs-engineering/SKILL.md +1 -1
  18. package/global-config/skills/performance-engineering/SKILL.md +1 -1
  19. package/global-config/skills/react-native-engineering/SKILL.md +1 -1
  20. package/global-config/skills/rest-api-design/SKILL.md +1 -1
  21. package/global-config/skills/ui-ux-engineering/SKILL.md +1 -1
  22. package/lib/adaptive-context-budget.mjs +97 -0
  23. package/lib/affected-tests.mjs +260 -0
  24. package/lib/benchmark-confidence.mjs +41 -2
  25. package/lib/browser-mcp-routing.mjs +166 -0
  26. package/lib/capability-fabric.mjs +359 -0
  27. package/lib/capability-registry.mjs +9 -0
  28. package/lib/code-intelligence/edit-anchor.mjs +102 -0
  29. package/lib/code-intelligence/index.mjs +95 -0
  30. package/lib/code-intelligence/lsp-provider.mjs +189 -0
  31. package/lib/completion-auditor.mjs +82 -0
  32. package/lib/context-engine-v11.mjs +65 -1
  33. package/lib/context-graph-rank.mjs +118 -0
  34. package/lib/context-manifest.mjs +97 -18
  35. package/lib/control-center.mjs +19 -1
  36. package/lib/document-ingestion.mjs +60 -0
  37. package/lib/dynamic-workflow.mjs +3 -1
  38. package/lib/evidence-store.mjs +82 -1
  39. package/lib/fast-verification-gate.mjs +69 -0
  40. package/lib/hierarchical-context.mjs +215 -0
  41. package/lib/mcp-health.mjs +144 -0
  42. package/lib/mcp-tool-policy.mjs +19 -0
  43. package/lib/memory-engine.mjs +493 -0
  44. package/lib/model-performance.mjs +33 -8
  45. package/lib/model-policy.mjs +3 -3
  46. package/lib/orchestrator-policy.mjs +5 -209
  47. package/lib/performance-fabric.mjs +229 -0
  48. package/lib/pi-rpc-pool.mjs +433 -0
  49. package/lib/process-hang-detector.mjs +83 -0
  50. package/lib/process-supervisor.mjs +193 -0
  51. package/lib/prompt-cache.mjs +27 -11
  52. package/lib/repo-graph.mjs +53 -2
  53. package/lib/reversible-context.mjs +49 -0
  54. package/lib/runtime-config.mjs +31 -0
  55. package/lib/safety.mjs +132 -0
  56. package/lib/semantic-index.mjs +52 -3
  57. package/lib/skill-compiler.mjs +128 -0
  58. package/lib/skill-quality.mjs +48 -2
  59. package/lib/task-engine.mjs +62 -5
  60. package/lib/task-policy.mjs +291 -0
  61. package/lib/verification-broker.mjs +284 -0
  62. package/lib/verification-command.mjs +111 -0
  63. package/lib/windows-shim.mjs +35 -0
  64. package/lib/workspace-fingerprint.mjs +198 -0
  65. package/package.json +52 -42
  66. package/pi/extensions/ues-child-runtime.ts +393 -0
  67. package/pi/extensions/ues.ts +3327 -0
  68. package/pi/prompts/ues-audit.md +9 -0
  69. package/pi/prompts/ues-critique.md +9 -0
  70. package/pi/prompts/ues-debug.md +9 -0
  71. package/pi/prompts/ues-feature.md +9 -0
  72. package/pi/prompts/ues-fix.md +9 -0
  73. package/pi/prompts/ues-plan.md +9 -0
  74. package/pi/prompts/ues-research.md +9 -0
  75. package/pi/prompts/ues-resume.md +9 -0
  76. package/pi/prompts/ues-review.md +7 -0
  77. package/pi/prompts/ues-run.md +17 -0
  78. package/pi/prompts/ues-verify.md +9 -0
  79. package/scripts/check-release-consistency.mjs +119 -185
  80. package/scripts/check-runtime-exports.mjs +66 -0
  81. package/scripts/check-source-integrity.mjs +246 -0
  82. package/scripts/eval-pi.mjs +492 -0
  83. package/scripts/install.mjs +16 -0
  84. package/scripts/smoke-package-closure.mjs +110 -0
  85. package/scripts/smoke-packed-install.mjs +24 -11
  86. package/scripts/smoke-pi-extension.mjs +144 -0
  87. package/scripts/uninstall.mjs +44 -0
  88. package/CHANGELOG.md +0 -415
  89. package/docs/DETERMINISTIC-TOOLS.md +0 -105
  90. package/docs/ENGINEERING-DESIGN.md +0 -194
  91. package/docs/EVALS.md +0 -158
  92. package/docs/GITHUB-RULESET.md +0 -50
  93. package/docs/NPM-PUBLISH.md +0 -116
  94. package/docs/RESEARCH-SOURCES.md +0 -37
  95. package/docs/TRACE-SCHEMA.md +0 -122
  96. package/docs/V11-PERCEPTION-ADAPTIVE-EXECUTION.md +0 -75
  97. package/docs/V11-PERCEPTION-ADAPTIVE.md +0 -220
  98. package/docs/V12-WEAK-MODEL-INTELLIGENCE.md +0 -27
  99. package/docs/V13-PARALLEL-WEAK-MODEL-RUNTIME.md +0 -86
  100. package/docs/V7-INTELLIGENCE-RUNTIME.md +0 -166
  101. package/docs/V8-INTELLIGENCE-RELIABILITY.md +0 -206
  102. package/docs/V9-SPEED-INTELLIGENCE.md +0 -102
@@ -0,0 +1,246 @@
1
+ import assert from "node:assert/strict"
2
+ import { readFileSync, statSync } from "node:fs"
3
+ import path from "node:path"
4
+ import { fileURLToPath } from "node:url"
5
+
6
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..")
7
+
8
+ const CONTRACTS = [
9
+ {
10
+ file: "pi/extensions/ues.ts",
11
+ minBytes: 80_000,
12
+ startsWith: "import { spawn }",
13
+ required: [
14
+ 'name: "ues_cli"',
15
+ 'name: "ues_execute"',
16
+ 'name: "ues_dispatch"',
17
+ "runRoutedAgent",
18
+ "PiRpcWorkerPool",
19
+ "McpHealthTracker",
20
+ "MCP_HEALTH",
21
+ "auditCompletion",
22
+ "CHILD_RUNTIME_EXTENSION",
23
+ "isAbortedRun",
24
+ "abortedResponse",
25
+ 'reason: "aborted"',
26
+ ],
27
+ },
28
+ {
29
+ file: "pi/extensions/ues-child-runtime.ts",
30
+ minBytes: 6_000,
31
+ startsWith: 'import type { ExtensionAPI }',
32
+ required: [
33
+ 'pi.on("tool_call"',
34
+ 'pi.on("tool_result"',
35
+ 'name: "ues_evidence_get"',
36
+ 'name: "ues_code"',
37
+ 'name: "ues_code_edit"',
38
+ "applyAnchoredFileEdits",
39
+ "diagnoseCode",
40
+ "recordVerification",
41
+ "canonicalVerificationCommand",
42
+ "destructiveShellRisk",
43
+ ],
44
+ },
45
+ {
46
+ file: "bin/ocskill.mjs",
47
+ minBytes: 74_000,
48
+ startsWith: "#!/usr/bin/env node",
49
+ required: [
50
+ 'case "context-pack"',
51
+ 'case "work"',
52
+ 'case "task-policy"',
53
+ 'case "sandbox"',
54
+ 'case "store"',
55
+ 'case "capabilities"',
56
+ 'case "capability-fabric"',
57
+ 'case "hierarchy"',
58
+ 'case "memory"',
59
+ 'case "visual"',
60
+ 'case "browser"',
61
+ 'case "workflow-plan"',
62
+ 'case "dashboard"',
63
+ 'case "models"',
64
+ 'case "update"',
65
+ 'case "remove"',
66
+ 'case "help"',
67
+ "getEvidenceSelected",
68
+ ],
69
+ },
70
+ {
71
+ file: "lib/task-engine.mjs",
72
+ minBytes: 45_000,
73
+ startsWith: "import ",
74
+ required: ["workspaceFingerprint", "initWork", "finalizeWork"],
75
+ },
76
+ {
77
+ file: "lib/model-performance.mjs",
78
+ minBytes: 5_500,
79
+ startsWith: "export const MODEL_TASK_CLASSES",
80
+ required: [
81
+ "recordPerformanceOutcome",
82
+ "wilsonLowerBound",
83
+ "rerankCapabilitySelection",
84
+ ],
85
+ },
86
+ {
87
+ file: "lib/evidence-store.mjs",
88
+ minBytes: 7_500,
89
+ startsWith: "import ",
90
+ required: ["putEvidence", "getEvidence", "getEvidenceSelected"],
91
+ },
92
+ {
93
+ file: "lib/process-supervisor.mjs",
94
+ minBytes: 4_500,
95
+ startsWith: "import ",
96
+ required: ["terminateProcessTree", "runSupervisedProcess", "drainTimeoutMs"],
97
+ },
98
+ {
99
+ file: "lib/pi-rpc-pool.mjs",
100
+ minBytes: 8_000,
101
+ startsWith: "import ",
102
+ required: ["class RpcWorker", "steerActive", "abortActive", "abortTransport", "activeAbort", "uesRpcPhase", "stopAll"],
103
+ },
104
+ {
105
+ file: "lib/workspace-fingerprint.mjs",
106
+ minBytes: 3_000,
107
+ startsWith: "import ",
108
+ required: ["runtimeWorkspaceFingerprint", "runtimeWorkspaceSnapshot", "changedFiles", "cacheable", "untrackedContentDigest", "untracked-total-too-large"],
109
+ },
110
+ {
111
+ file: "lib/skill-compiler.mjs",
112
+ minBytes: 4_000,
113
+ startsWith: "import ",
114
+ required: ["compileSkillContext", "clearSkillCompilerCache", "COMPILED_SKILL_CACHE.set", "return result"],
115
+ },
116
+ {
117
+ file: "lib/verification-command.mjs",
118
+ minBytes: 2_000,
119
+ startsWith: "export const VERIFICATION_COMMAND_RE",
120
+ required: [
121
+ "looksLikeVerificationCommand",
122
+ "canRecordReusableVerification",
123
+ "canonicalVerificationCommand",
124
+ ],
125
+ },
126
+ {
127
+ file: "lib/verification-broker.mjs",
128
+ minBytes: 8_000,
129
+ startsWith: "import ",
130
+ required: [
131
+ "recordVerification",
132
+ "findReusableVerification",
133
+ "listReusableVerification",
134
+ "withCrossProcessCacheLock",
135
+ "entryMatchesKey",
136
+ "freshEnough",
137
+ ],
138
+ },
139
+ {
140
+ file: "test/v14.2-runtime.test.mjs",
141
+ minBytes: 30_000,
142
+ startsWith: 'import assert from "node:assert/strict"',
143
+ required: [
144
+ 'test("V14.2 hot-path helper exports are live"',
145
+ 'test("external RPC abort rejects the active run instead of settling normally"',
146
+ 'test("verification broker preserves concurrent receipts in one workspace"',
147
+ 'test("RPC pool never evicts an active worker when an idle-capacity limit is exceeded"',
148
+ ],
149
+ },
150
+
151
+ {
152
+ file: "lib/code-intelligence/edit-anchor.mjs",
153
+ minBytes: 2_500,
154
+ startsWith: "import ",
155
+ required: ["anchoredLines", "applyAnchoredEdits", "UES_STALE_ANCHOR"],
156
+ },
157
+ {
158
+ file: "lib/code-intelligence/index.mjs",
159
+ minBytes: 4_000,
160
+ startsWith: "import ",
161
+ required: ["readAnchoredCode", "applyAnchoredFileEdits", "searchCodeIntelligence", "diagnoseCode"],
162
+ },
163
+ {
164
+ file: "lib/code-intelligence/lsp-provider.mjs",
165
+ minBytes: 5_000,
166
+ startsWith: "import ",
167
+ required: ["diagnoseCode", "lspProviderStatus", "publishDiagnostics"],
168
+ },
169
+ {
170
+ file: "lib/completion-auditor.mjs",
171
+ minBytes: 2_500,
172
+ startsWith: "function text",
173
+ required: ["auditCompletion", "fresh-behavioral-receipt-missing", "missing-report-section"],
174
+ },
175
+ {
176
+ file: "lib/document-ingestion.mjs",
177
+ minBytes: 3_000,
178
+ startsWith: "import ",
179
+ required: ["ingestDocument", "documentIngestionSupport", "UES_MARKITDOWN_UNAVAILABLE"],
180
+ },
181
+ {
182
+ file: "lib/reversible-context.mjs",
183
+ minBytes: 2_500,
184
+ startsWith: "import ",
185
+ required: ["compactContext", "expandContext", "searchContext"],
186
+ },
187
+ {
188
+ file: "lib/mcp-tool-policy.mjs",
189
+ minBytes: 1_000,
190
+ startsWith: "function firstObject",
191
+ required: ["normalizeMcpAnnotations", "mcpExecutionPolicy", 'trust: "hint-only"'],
192
+ },
193
+ {
194
+ file: "lib/mcp-health.mjs",
195
+ minBytes: 4_000,
196
+ startsWith: "const TRANSIENT_ERROR",
197
+ required: ["McpHealthTracker", "mcpReconnectAdvice", "transient-idempotent-failure", "cooldownUntil"],
198
+ },
199
+ {
200
+ file: "test/v14.3-intelligence.test.mjs",
201
+ minBytes: 5_000,
202
+ startsWith: 'import test from "node:test"',
203
+ required: ["hash anchored edits fail closed", "completion auditor rejects narrative PASS", "verified memory snapshots ignore retrieval/touch noise", "MCP health only recommends reconnect"],
204
+ },
205
+
206
+ {
207
+ file: "lib/affected-tests.mjs",
208
+ minBytes: 7_500,
209
+ startsWith: "import ",
210
+ required: ["resolveAffectedTests", "clearAffectedTestCache", "AFFECTED_TEST_CACHE.set", "return result"],
211
+ },
212
+ ]
213
+
214
+ const problems = []
215
+ for (const contract of CONTRACTS) {
216
+ const absolute = path.join(root, ...contract.file.split("/"))
217
+ let source = ""
218
+ let bytes = 0
219
+ try {
220
+ bytes = statSync(absolute).size
221
+ source = readFileSync(absolute, "utf8")
222
+ } catch (error) {
223
+ problems.push(`${contract.file}: unreadable (${error?.message || error})`)
224
+ continue
225
+ }
226
+
227
+ if (bytes < contract.minBytes) {
228
+ problems.push(`${contract.file}: ${bytes} bytes < required ${contract.minBytes}; possible fragment overwrite`)
229
+ }
230
+ if (!source.startsWith(contract.startsWith)) {
231
+ problems.push(`${contract.file}: source prefix mismatch; possible missing file head`)
232
+ }
233
+ for (const marker of contract.required) {
234
+ if (!source.includes(marker)) {
235
+ problems.push(`${contract.file}: missing integrity marker ${JSON.stringify(marker)}`)
236
+ }
237
+ }
238
+ }
239
+
240
+ assert.deepEqual(
241
+ problems,
242
+ [],
243
+ "Critical UES source-integrity validation failed:\n" + problems.map((item) => "- " + item).join("\n"),
244
+ )
245
+
246
+ console.log(`Source integrity passed for ${CONTRACTS.length} critical runtime files.`)