sneakoscope 7.0.2 → 7.0.3

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 (468) hide show
  1. package/README.md +7 -5
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/dist/bin/sks-dispatch.js +0 -3
  5. package/dist/cli/command-registry.js +0 -2
  6. package/dist/cli/install-helpers-codex-lb-chain.js +24 -2
  7. package/dist/cli/install-helpers-codex-lb-config.js +0 -7
  8. package/dist/cli/install-helpers-codex-lb-selftest-chain.js +0 -3
  9. package/dist/cli/install-helpers-codex-lb-selftest.js +0 -17
  10. package/dist/cli/install-helpers.js +81 -96
  11. package/dist/cli/router.js +0 -22
  12. package/dist/commands/codex-lb.js +176 -22
  13. package/dist/commands/codex.js +3 -8
  14. package/dist/commands/doctor.js +4 -14
  15. package/dist/commands/perf.js +5 -1
  16. package/dist/commands/zellij-slot-column-anchor.js +0 -2
  17. package/dist/commands/zellij-slot-pane.js +0 -7
  18. package/dist/commands/zellij.js +0 -2
  19. package/dist/config/skills-manifest.json +52 -52
  20. package/dist/core/agent-bridge/agent-manifest.js +192 -1
  21. package/dist/core/agent-bridge/agent-mode.js +0 -5
  22. package/dist/core/agent-bridge/host-capability-policy.js +189 -0
  23. package/dist/core/agent-bridge/host-capability-runtime.js +1395 -0
  24. package/dist/core/agent-bridge/mcp-server.js +1 -11
  25. package/dist/core/agents/agent-effort-policy.js +0 -3
  26. package/dist/core/agents/agent-orchestrator.js +0 -4
  27. package/dist/core/agents/agent-proof-evidence.js +0 -2
  28. package/dist/core/agents/agent-runner-ollama.js +0 -3
  29. package/dist/core/agents/agent-scheduler.js +0 -5
  30. package/dist/core/agents/native-cli-worker-runtime.js +5 -17
  31. package/dist/core/agents/work-partition/repo-inventory.js +0 -2
  32. package/dist/core/auto-review.js +0 -13
  33. package/dist/core/bench.js +0 -14
  34. package/dist/core/code-structure.js +0 -3
  35. package/dist/core/codex/agent-config-file-repair.js +0 -8
  36. package/dist/core/codex/codex-cli-update.js +122 -20
  37. package/dist/core/codex/codex-config-eperm-repair.js +0 -4
  38. package/dist/core/codex/codex-config-guard.js +0 -3
  39. package/dist/core/codex/codex-config-readability.js +0 -13
  40. package/dist/core/codex/codex-project-config-policy.js +0 -33
  41. package/dist/core/codex/official-goal-mode.js +0 -2
  42. package/dist/core/codex-app/codex-app-fast-ui-repair.js +5 -7
  43. package/dist/core/codex-app/codex-app-ui-state-snapshot.js +44 -7
  44. package/dist/core/codex-app/sks-menubar.js +0 -1
  45. package/dist/core/codex-app.js +0 -9
  46. package/dist/core/codex-compat/codex-hook-output-builders.js +9 -1
  47. package/dist/core/codex-compat/codex-hook-output-normalizer.js +1 -1
  48. package/dist/core/codex-compat/codex-hook-semantic-validator.js +3 -2
  49. package/dist/core/codex-compat/codex-hook-warning-detector.js +10 -2
  50. package/dist/core/codex-control/codex-lb-launch-recovery.js +0 -3
  51. package/dist/core/codex-control/codex-reliability-shield.js +0 -8
  52. package/dist/core/codex-control/codex-sdk-adapter.js +0 -3
  53. package/dist/core/codex-control/codex-sdk-config-policy.js +0 -2
  54. package/dist/core/codex-control/codex-sdk-env-policy.js +61 -16
  55. package/dist/core/codex-control/codex-task-runner.js +0 -7
  56. package/dist/core/codex-control/codex-thread-registry.js +0 -4
  57. package/dist/core/codex-lb/codex-lb-env.js +118 -20
  58. package/dist/core/codex-lb/codex-lb-tool-catalog.js +0 -4
  59. package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +1 -1
  60. package/dist/core/codex-model-guard.js +0 -14
  61. package/dist/core/codex-native/codex-native-feature-broker.js +67 -22
  62. package/dist/core/codex-native/codex-native-interop-policy.js +81 -9
  63. package/dist/core/codex-native/confined-report-writer.js +21 -0
  64. package/dist/core/codex-native/core-skill-integrity.js +169 -20
  65. package/dist/core/codex-native/project-skill-dedupe.js +55 -13
  66. package/dist/core/codex-native/skill-registry-ledger.js +137 -16
  67. package/dist/core/codex-native/sks-skill-paths.js +185 -0
  68. package/dist/core/codex-runtime/codex-desktop-config-policy.js +0 -2
  69. package/dist/core/commands/agent-bridge-command.js +28 -8
  70. package/dist/core/commands/basic-cli.js +67 -26
  71. package/dist/core/commands/bench-command.js +5 -1
  72. package/dist/core/commands/command-utils.js +0 -5
  73. package/dist/core/commands/image-ux-review-command.js +0 -9
  74. package/dist/core/commands/mad-sks-command.js +0 -38
  75. package/dist/core/commands/naruto-command.js +46 -12
  76. package/dist/core/commands/ppt-command.js +0 -9
  77. package/dist/core/commands/run-command.js +8 -2
  78. package/dist/core/commands/seo-command.js +0 -6
  79. package/dist/core/commands/wiki-command.js +0 -14
  80. package/dist/core/computer-use-live-evidence.js +0 -5
  81. package/dist/core/config/secret-preservation.js +0 -11
  82. package/dist/core/daemon/sksd-hook-daemon-entrypoint.js +0 -2
  83. package/dist/core/daemon/sksd-hook-daemon.js +1 -29
  84. package/dist/core/daemon/sksd-hook-dispatch.js +0 -17
  85. package/dist/core/db-safety.js +0 -7
  86. package/dist/core/doctor/browser-use-repair.js +0 -2
  87. package/dist/core/doctor/doctor-codex-startup-repair.js +0 -3
  88. package/dist/core/doctor/doctor-readiness-matrix.js +12 -0
  89. package/dist/core/doctor/doctor-skill-reconcile.js +32 -0
  90. package/dist/core/doctor/imagegen-repair.js +0 -2
  91. package/dist/core/doctor/mcp-transport-collision-repair.js +0 -3
  92. package/dist/core/doctor/retired-managed-residue-private.js +0 -1
  93. package/dist/core/doctor/supabase-mcp-repair.js +0 -11
  94. package/dist/core/feature-fixture-executor.js +0 -48
  95. package/dist/core/feature-fixtures.js +0 -5
  96. package/dist/core/fsx.js +11 -12
  97. package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +0 -5
  98. package/dist/core/hooks-runtime/hook-context.js +202 -0
  99. package/dist/core/hooks-runtime/hook-io.js +1 -12
  100. package/dist/core/hooks-runtime/light-turn.js +0 -2
  101. package/dist/core/hooks-runtime/naruto-decision-gate.js +4 -1
  102. package/dist/core/hooks-runtime/naruto-terminal-finalization.js +91 -0
  103. package/dist/core/hooks-runtime/official-subagent-lifecycle.js +370 -0
  104. package/dist/core/hooks-runtime/standalone-parent-host-capability.js +98 -0
  105. package/dist/core/hooks-runtime/subagent-context.js +59 -0
  106. package/dist/core/hooks-runtime/subagent-skill-availability-contract.js +29 -0
  107. package/dist/core/hooks-runtime/subagent-skill-availability-evidence.js +195 -0
  108. package/dist/core/hooks-runtime/subagent-skill-availability-guards.js +316 -0
  109. package/dist/core/hooks-runtime/subagent-skill-availability.js +217 -0
  110. package/dist/core/hooks-runtime.js +259 -535
  111. package/dist/core/image-ux-review/codex-app-generated-image-discovery.js +0 -17
  112. package/dist/core/image-ux-review/imagegen-adapter.js +0 -14
  113. package/dist/core/imagegen/imagegen-auth-readiness.js +0 -9
  114. package/dist/core/imagegen/imagegen-capability.js +0 -3
  115. package/dist/core/init/managed-skill-install.js +42 -0
  116. package/dist/core/init/skills.js +247 -74
  117. package/dist/core/init.js +15 -40
  118. package/dist/core/lean-engineering-policy.js +0 -2
  119. package/dist/core/locks/file-lock.js +0 -21
  120. package/dist/core/loops/loop-planner.js +0 -6
  121. package/dist/core/loops/loop-runtime.js +0 -1
  122. package/dist/core/loops/loop-worker-runtime.js +0 -19
  123. package/dist/core/mad-sks/executors/db-write-executor.js +0 -4
  124. package/dist/core/mad-sks/executors/executor-base.js +0 -10
  125. package/dist/core/mad-sks/immutable-harness-guard.js +0 -5
  126. package/dist/core/mad-sks/sql-plane/coordinator.js +0 -5
  127. package/dist/core/mad-sks/sql-plane/ledger.js +0 -4
  128. package/dist/core/mad-sks/sql-plane/lock.js +0 -4
  129. package/dist/core/mad-sks/sql-plane/mcp-executor.js +0 -9
  130. package/dist/core/mad-sks/sql-plane/policy-resolver.js +0 -2
  131. package/dist/core/mad-sks/sql-plane/postconditions.js +0 -4
  132. package/dist/core/mad-sks/sql-plane/recovery.js +0 -2
  133. package/dist/core/mad-sks/sql-plane/runtime-profile.js +0 -8
  134. package/dist/core/managed-assets/managed-assets-manifest.js +1 -7
  135. package/dist/core/mcp-config/health-check.js +10 -3
  136. package/dist/core/migration/migration-transaction-journal.js +0 -8
  137. package/dist/core/mission.js +0 -2
  138. package/dist/core/naruto/naruto-active-pool.js +0 -2
  139. package/dist/core/naruto/naruto-concurrency-governor.js +0 -1
  140. package/dist/core/naruto/naruto-real-write-proof.js +0 -4
  141. package/dist/core/naruto/naruto-write-e2e.js +0 -1
  142. package/dist/core/perf/perf-budget.js +0 -5
  143. package/dist/core/permission-gates.js +0 -2
  144. package/dist/core/pipeline-internals/runtime-core.js +15 -5
  145. package/dist/core/pipeline-internals/runtime-gates.js +0 -12
  146. package/dist/core/preflight/parallel-preflight-engine.js +0 -11
  147. package/dist/core/proof/evidence-collector.js +0 -2
  148. package/dist/core/proof/route-finalizer.js +0 -1
  149. package/dist/core/proof/selftest-proof-fixtures.js +0 -5
  150. package/dist/core/providers/glm/bench/glm-benchmark-runner.js +0 -2
  151. package/dist/core/providers/glm/glm-request-cache.js +0 -3
  152. package/dist/core/providers/glm/naruto/glm-naruto-command.js +0 -1
  153. package/dist/core/providers/glm/naruto/glm-naruto-decomposer.js +0 -1
  154. package/dist/core/providers/glm/naruto/glm-naruto-orchestrator.js +0 -6
  155. package/dist/core/providers/glm/naruto/glm-naruto-trace.js +0 -1
  156. package/dist/core/providers/glm/naruto/glm-naruto-worker-pool.js +0 -1
  157. package/dist/core/providers/glm/naruto/glm-naruto-worktree.js +0 -1
  158. package/dist/core/providers/openrouter/openrouter-secret-store.js +0 -1
  159. package/dist/core/providers/openrouter/openrouter-stream.js +0 -2
  160. package/dist/core/questions.js +3 -3
  161. package/dist/core/release/gate-manifest.js +0 -5
  162. package/dist/core/release/package-size-budget.js +1 -1
  163. package/dist/core/release/release-gate-batch-runner.js +11 -2
  164. package/dist/core/release/release-gate-cache-v2.js +0 -4
  165. package/dist/core/release/release-gate-hermetic-env.js +0 -5
  166. package/dist/core/release-parallel-full-coverage.js +0 -2
  167. package/dist/core/remote/ssh-worker-client.js +0 -3
  168. package/dist/core/research/research-adversarial-review.js +6 -2
  169. package/dist/core/responses-retry-policy.js +0 -10
  170. package/dist/core/retention.js +0 -7
  171. package/dist/core/routes/constants.js +0 -3
  172. package/dist/core/routes.js +89 -15
  173. package/dist/core/safety/command-contract/contracts.js +2 -0
  174. package/dist/core/safety/mutation-guard.js +0 -25
  175. package/dist/core/safety/mutation-ledger.js +0 -9
  176. package/dist/core/safety/requested-scope-contract.js +0 -0
  177. package/dist/core/security/high-risk-contracts.js +0 -1
  178. package/dist/core/skills/core-skill-card.js +0 -0
  179. package/dist/core/skills/core-skill-deployment.js +0 -13
  180. package/dist/core/skills/core-skill-epoch.js +0 -11
  181. package/dist/core/skills/core-skill-meta-update.js +0 -6
  182. package/dist/core/skills/core-skill-patch-apply.js +0 -7
  183. package/dist/core/skills/core-skill-patch.js +0 -8
  184. package/dist/core/skills/core-skill-reflection.js +0 -16
  185. package/dist/core/skills/core-skill-runtime.js +0 -6
  186. package/dist/core/skills/core-skill-scorer.js +0 -7
  187. package/dist/core/skills/core-skill-trainer.js +0 -11
  188. package/dist/core/skills/core-skill-types.js +0 -9
  189. package/dist/core/skills/core-skill-validation.js +0 -5
  190. package/dist/core/skills/rejected-skill-patch-buffer.js +0 -2
  191. package/dist/core/stop-gate/stop-gate-check.js +0 -8
  192. package/dist/core/stop-gate/stop-gate-resolver.js +0 -7
  193. package/dist/core/stop-gate/stop-gate-writer.js +0 -5
  194. package/dist/core/subagents/model-policy.js +0 -7
  195. package/dist/core/subagents/naruto-help-contract.js +1 -1
  196. package/dist/core/subagents/naruto-proof-projection.js +580 -12
  197. package/dist/core/subagents/official-subagent-config.js +0 -8
  198. package/dist/core/subagents/official-subagent-preparation.js +6 -5
  199. package/dist/core/subagents/official-subagent-prompt.js +29 -0
  200. package/dist/core/subagents/official-subagent-runner.js +343 -37
  201. package/dist/core/subagents/subagent-evidence.js +378 -9
  202. package/dist/core/subagents/thread-budget.js +5 -2
  203. package/dist/core/subagents/triwiki-attention.js +0 -4
  204. package/dist/core/subagents/wave-parent-guidance.js +54 -9
  205. package/dist/core/telegram/runtime.js +0 -1
  206. package/dist/core/triwiki/code-index-scanner.js +0 -3
  207. package/dist/core/triwiki/code-pack-head-freshness.js +0 -10
  208. package/dist/core/triwiki/code-pack.js +0 -2
  209. package/dist/core/triwiki/triwiki-cache-key.js +0 -1
  210. package/dist/core/triwiki/triwiki-proof-bank.js +0 -1
  211. package/dist/core/triwiki-attention.js +0 -10
  212. package/dist/core/triwiki-provenance.js +0 -5
  213. package/dist/core/triwiki-runtime.js +0 -12
  214. package/dist/core/triwiki-wrongness/wrongness-ledger.js +0 -7
  215. package/dist/core/triwiki-wrongness/wrongness-schema.js +0 -3
  216. package/dist/core/trust-kernel/trust-report.js +0 -7
  217. package/dist/core/update/update-migration-state.js +21 -39
  218. package/dist/core/update-check.js +2 -14
  219. package/dist/core/version-manager.js +2 -0
  220. package/dist/core/version.js +1 -1
  221. package/dist/core/work-order-ledger.js +0 -17
  222. package/dist/core/zellij/zellij-clipboard-config.js +0 -18
  223. package/dist/core/zellij/zellij-lane-renderer.js +5 -46
  224. package/dist/core/zellij/zellij-lane-runtime.js +0 -1
  225. package/dist/core/zellij/zellij-launcher.js +0 -26
  226. package/dist/core/zellij/zellij-official-subagent-activity.js +0 -5
  227. package/dist/core/zellij/zellij-official-subagent-telemetry.js +0 -5
  228. package/dist/core/zellij/zellij-screen-proof.js +0 -7
  229. package/dist/core/zellij/zellij-slot-column-anchor.js +0 -1
  230. package/dist/core/zellij/zellij-slot-pane-renderer.js +0 -9
  231. package/dist/core/zellij/zellij-slot-telemetry.js +0 -12
  232. package/dist/core/zellij/zellij-ui-mode.js +0 -7
  233. package/dist/core/zellij/zellij-update.js +0 -29
  234. package/dist/core/zellij/zellij-worker-pane-manager.js +0 -39
  235. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +213 -27
  236. package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +95 -12
  237. package/dist/scripts/agent-message-bus-reader-check.js +0 -1
  238. package/dist/scripts/all-feature-deep-completion-check.js +0 -1
  239. package/dist/scripts/appshots-thread-attachment-discovery-check.js +0 -1
  240. package/dist/scripts/architecture-guard-check.js +0 -1
  241. package/dist/scripts/build-dist.js +0 -1
  242. package/dist/scripts/build-once-runner-check.js +0 -1
  243. package/dist/scripts/canonical-test-runner.js +0 -2
  244. package/dist/scripts/certificate-sla-check.js +0 -1
  245. package/dist/scripts/changelog-check.js +0 -1
  246. package/dist/scripts/check-cli-entrypoint.js +0 -1
  247. package/dist/scripts/check-command-module-budget.js +0 -7
  248. package/dist/scripts/check-feature-quality.js +0 -1
  249. package/dist/scripts/check-legacy-free.js +0 -1
  250. package/dist/scripts/check-pipeline-runtime.js +0 -1
  251. package/dist/scripts/check-runtime-schemas.js +0 -1
  252. package/dist/scripts/codex-0-134-runner-truth-check.js +0 -1
  253. package/dist/scripts/codex-0-137-compat-check.js +0 -1
  254. package/dist/scripts/codex-0138-capability-artifact-check.js +0 -1
  255. package/dist/scripts/codex-0138-capability-check.js +0 -1
  256. package/dist/scripts/codex-0138-doctor-check.js +0 -1
  257. package/dist/scripts/codex-0138-feature-probes-check.js +0 -1
  258. package/dist/scripts/codex-0144-core-real-probes-check.js +0 -1
  259. package/dist/scripts/codex-app-handoff-check.js +0 -1
  260. package/dist/scripts/codex-app-handoff-launch-check.js +0 -1
  261. package/dist/scripts/codex-config-load-probe.js +0 -5
  262. package/dist/scripts/codex-control-all-pipelines-check.js +0 -1
  263. package/dist/scripts/codex-control-event-stream-ledger-check.js +0 -1
  264. package/dist/scripts/codex-control-tool-output-continuity-audit-check.js +0 -1
  265. package/dist/scripts/codex-permission-profiles-check.js +0 -1
  266. package/dist/scripts/codex-plugin-app-template-policy-check.js +0 -1
  267. package/dist/scripts/codex-project-config-policy-splitter-check.js +0 -1
  268. package/dist/scripts/codex-sdk-all-pipelines-check.js +0 -1
  269. package/dist/scripts/codex-sdk-backend-router-check.js +0 -1
  270. package/dist/scripts/codex-sdk-capability-check.js +0 -1
  271. package/dist/scripts/codex-sdk-event-stream-ledger-check.js +0 -1
  272. package/dist/scripts/codex-sdk-real-smoke-check.js +0 -1
  273. package/dist/scripts/concurrent-session-collision-check.js +9 -0
  274. package/dist/scripts/context7-evidence-dedupe-check.js +0 -1
  275. package/dist/scripts/core-skill-card-schema-check.js +0 -11
  276. package/dist/scripts/core-skill-deployment-snapshot-check.js +0 -10
  277. package/dist/scripts/core-skill-heldout-validation-check.js +0 -11
  278. package/dist/scripts/core-skill-no-inference-optimizer-check.js +0 -11
  279. package/dist/scripts/core-skill-patch-check.js +0 -11
  280. package/dist/scripts/core-skill-route-runtime-integration-check.js +0 -11
  281. package/dist/scripts/current-surface-update-e2e-check.js +0 -4
  282. package/dist/scripts/current-upgrade-matrix-check.js +0 -1
  283. package/dist/scripts/dfix-fixture-check.js +0 -1
  284. package/dist/scripts/dfix-patch-handoff-check.js +0 -1
  285. package/dist/scripts/dfix-verification-check.js +0 -1
  286. package/dist/scripts/dfix-verification-recommendation-check.js +0 -1
  287. package/dist/scripts/docs-truthfulness-check.js +3 -3
  288. package/dist/scripts/doctor-fastpath-check.js +0 -1
  289. package/dist/scripts/doctor-fix-proves-codex-read-check.js +0 -11
  290. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +0 -4
  291. package/dist/scripts/doctor-idempotence-check.js +0 -1
  292. package/dist/scripts/doctor-ops-semantics-check.js +0 -1
  293. package/dist/scripts/ensure-bin-executable.js +0 -1
  294. package/dist/scripts/evidence-flagship-coverage-check.js +0 -1
  295. package/dist/scripts/fast-codex-service-tier-proof-check.js +0 -1
  296. package/dist/scripts/fixtures/fake-codex-config-loader.js +0 -5
  297. package/dist/scripts/fsx-hotpath-check.js +0 -1
  298. package/dist/scripts/gate-policy-audit-check.js +1 -1
  299. package/dist/scripts/geo-claim-evidence-check.js +0 -1
  300. package/dist/scripts/geo-cli-blackbox-check.js +0 -1
  301. package/dist/scripts/geo-crawler-policy-check.js +0 -1
  302. package/dist/scripts/git-worktree-diff-envelope-check.js +0 -1
  303. package/dist/scripts/git-worktree-dirty-lock-check.js +0 -1
  304. package/dist/scripts/git-worktree-dirty-main-detection-check.js +0 -1
  305. package/dist/scripts/git-worktree-integration-primary-check.js +0 -1
  306. package/dist/scripts/git-worktree-manifest-append-check.js +0 -1
  307. package/dist/scripts/git-worktree-untracked-diff-check.js +0 -1
  308. package/dist/scripts/high-risk-contracts-check.js +0 -1
  309. package/dist/scripts/hook-latency-budget-check.js +0 -1
  310. package/dist/scripts/hook-latency-quantum-check.js +0 -1
  311. package/dist/scripts/image-artifact-path-contract-check.js +0 -1
  312. package/dist/scripts/imagegen-real-smoke-check.js +0 -1
  313. package/dist/scripts/import-graph-budget-check.js +0 -1
  314. package/dist/scripts/installed-package-smoke-check.js +0 -1
  315. package/dist/scripts/legacy-gate-purge-check.js +0 -1
  316. package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -3
  317. package/dist/scripts/lib/ensure-dist-fresh.js +0 -1
  318. package/dist/scripts/lib/valid-png-fixture.js +0 -1
  319. package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +0 -1
  320. package/dist/scripts/loop-directive-check-lib.js +0 -1
  321. package/dist/scripts/loop-worker-fixture-child.js +0 -1
  322. package/dist/scripts/mad-preflight-blocks-unreadable-config-check.js +0 -10
  323. package/dist/scripts/mad-sks-sql-plane-lifecycle-hook-decision-check.js +0 -1
  324. package/dist/scripts/mad-sks-sql-plane-result-lifecycle-check.js +0 -1
  325. package/dist/scripts/mcp-plugin-inventory-check.js +0 -1
  326. package/dist/scripts/mcp-tool-naming-parity-check.js +0 -1
  327. package/dist/scripts/model-call-concurrency-check.js +0 -1
  328. package/dist/scripts/mutation-callsite-coverage-check.js +0 -5
  329. package/dist/scripts/naruto-codex-e2e-check.js +0 -1
  330. package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -1
  331. package/dist/scripts/official-subagent-workflow-check.js +3 -1
  332. package/dist/scripts/ops-diagnostics-bundle-check.js +0 -1
  333. package/dist/scripts/packlist-performance-check.js +1 -3
  334. package/dist/scripts/perf-budget-check.js +0 -1
  335. package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -1
  336. package/dist/scripts/ppt-real-export-adapter-check.js +0 -1
  337. package/dist/scripts/ppt-real-imagegen-smoke-check.js +0 -1
  338. package/dist/scripts/ppt-real-imagegen-wiring-check.js +0 -1
  339. package/dist/scripts/ppt-reexport-rereview-check.js +0 -1
  340. package/dist/scripts/prepublish-fast-check.js +0 -23
  341. package/dist/scripts/prepublish-release-check-or-fast.js +0 -7
  342. package/dist/scripts/probe-memoization-check.js +0 -1
  343. package/dist/scripts/product-design-plugin-routing-check.js +0 -1
  344. package/dist/scripts/project-skill-dedupe-blackbox.js +36 -9
  345. package/dist/scripts/prompt-placeholder-guard-check.js +0 -1
  346. package/dist/scripts/python-codex-sdk-all-pipelines-check.js +0 -3
  347. package/dist/scripts/qa-loop-app-handoff-capability-check.js +0 -1
  348. package/dist/scripts/qa-loop-app-handoff-check.js +0 -1
  349. package/dist/scripts/qa-loop-app-handoff-cli-check.js +0 -1
  350. package/dist/scripts/qa-loop-app-handoff-confirmation-check.js +0 -1
  351. package/dist/scripts/qa-loop-app-handoff-gate-lifecycle-check.js +0 -1
  352. package/dist/scripts/qa-loop-app-handoff-launch-check.js +0 -1
  353. package/dist/scripts/qa-loop-app-handoff-status-lifecycle-check.js +0 -1
  354. package/dist/scripts/qa-loop-budget-policy-check.js +0 -1
  355. package/dist/scripts/qa-loop-effort-escalation-check.js +0 -1
  356. package/dist/scripts/qa-loop-image-path-exposure-check.js +0 -1
  357. package/dist/scripts/qa-loop-image-path-prompt-injection-check.js +0 -1
  358. package/dist/scripts/release-cache-glob-hashing-check.js +0 -1
  359. package/dist/scripts/release-cache-input-classifier-check.js +0 -1
  360. package/dist/scripts/release-cache-neutralization-report-check.js +0 -1
  361. package/dist/scripts/release-cache-version-neutral-fixture-check.js +0 -1
  362. package/dist/scripts/release-check-stamp.js +0 -4
  363. package/dist/scripts/release-dist-freshness-check.js +0 -1
  364. package/dist/scripts/release-full-parallelism-blackbox.js +3 -3
  365. package/dist/scripts/release-gate-batch-runner-check.js +22 -0
  366. package/dist/scripts/release-gate-budget-check.js +0 -6
  367. package/dist/scripts/release-gate-dag-runner-check.js +0 -1
  368. package/dist/scripts/release-latency-slo-check.js +0 -1
  369. package/dist/scripts/release-metadata-1-19-check.js +0 -1
  370. package/dist/scripts/release-metadata-check.js +0 -3
  371. package/dist/scripts/release-parallel-speed-budget-check.js +0 -5
  372. package/dist/scripts/release-proof-truth-check.js +0 -1
  373. package/dist/scripts/release-provenance-check.js +0 -1
  374. package/dist/scripts/release-real-check.js +0 -1
  375. package/dist/scripts/release-runtime-truth-matrix-check.js +0 -1
  376. package/dist/scripts/release-version-truth-check.js +0 -1
  377. package/dist/scripts/research-blueprint-densifier-check.js +0 -1
  378. package/dist/scripts/research-claim-builder-check.js +0 -1
  379. package/dist/scripts/research-complete-package-fixture-check.js +0 -1
  380. package/dist/scripts/research-final-reviewer-blackbox.js +0 -1
  381. package/dist/scripts/responses-retry-policy-centralized-check.js +0 -1
  382. package/dist/scripts/retention-apply-smoke-check.js +0 -1
  383. package/dist/scripts/retention-budget-check.js +0 -1
  384. package/dist/scripts/retention-dry-run-check.js +0 -1
  385. package/dist/scripts/rollback-recovery-smoke-check.js +0 -1
  386. package/dist/scripts/route-intent-regression-check.js +0 -1
  387. package/dist/scripts/runtime-current-terminal-check.js +0 -1
  388. package/dist/scripts/runtime-dist-parity-check.js +0 -1
  389. package/dist/scripts/runtime-no-src-mjs-check.js +0 -1
  390. package/dist/scripts/runtime-proof-summary-check.js +0 -1
  391. package/dist/scripts/runtime-ts-rust-boundary-check.js +0 -15
  392. package/dist/scripts/runtime-ts-source-of-truth-check.js +0 -1
  393. package/dist/scripts/scheduler-batch-dispatch-check.js +0 -1
  394. package/dist/scripts/scheduler-parallel-proof-consistency-check.js +0 -1
  395. package/dist/scripts/scheduler-utilization-integral-check.js +0 -1
  396. package/dist/scripts/search-visibility-gate-lib.js +0 -1
  397. package/dist/scripts/seo-audit-fixture-check.js +0 -1
  398. package/dist/scripts/seo-cli-blackbox-check.js +0 -1
  399. package/dist/scripts/seo-geo-geo-disambiguation-check.js +0 -1
  400. package/dist/scripts/seo-geo-route-identity-check.js +0 -1
  401. package/dist/scripts/seo-geo-skill-rich-content-check.js +0 -1
  402. package/dist/scripts/seo-marketing-truthfulness-check.js +0 -1
  403. package/dist/scripts/seo-metadata-sync-check.js +0 -1
  404. package/dist/scripts/seo-no-mutation-by-default-check.js +0 -1
  405. package/dist/scripts/shared-memory-fixture-check.js +0 -1
  406. package/dist/scripts/side-effect-runtime-report-check.js +0 -1
  407. package/dist/scripts/sizecheck.js +0 -1
  408. package/dist/scripts/sks-1-11-gate-lib.js +0 -1
  409. package/dist/scripts/sks-1-12-real-execution-check-lib.js +0 -1
  410. package/dist/scripts/sks-1-18-gate-lib.js +0 -1
  411. package/dist/scripts/sks-menubar-install-check.js +0 -3
  412. package/dist/scripts/sksd-daemon-check.js +0 -1
  413. package/dist/scripts/super-search-live-smoke-check.js +0 -1
  414. package/dist/scripts/super-search-local-http-smoke-check.js +0 -1
  415. package/dist/scripts/super-search-offline-contract-check.js +0 -1
  416. package/dist/scripts/super-search-provider-interface-check.js +0 -1
  417. package/dist/scripts/triwiki-cache-key-check.js +0 -1
  418. package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -1
  419. package/dist/scripts/triwiki-proof-bank-check.js +0 -1
  420. package/dist/scripts/triwiki-proof-card-check.js +0 -1
  421. package/dist/scripts/trust-fixture-check.js +0 -1
  422. package/dist/scripts/ultra-router-auto-router-check.js +0 -1
  423. package/dist/scripts/update-fastpath-check.js +0 -1
  424. package/dist/scripts/upgrade-migration-matrix-check.js +0 -1
  425. package/dist/scripts/ux-review-extract-wires-real-extractor-check.js +0 -1
  426. package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -1
  427. package/dist/scripts/ux-review-patch-diff-recheck-check.js +0 -1
  428. package/dist/scripts/ux-review-real-imagegen-smoke-check.js +0 -1
  429. package/dist/scripts/ux-review-run-wires-imagegen-check.js +0 -1
  430. package/dist/scripts/write-build-manifest.js +0 -1
  431. package/dist/scripts/wrongness-fixture-check.js +0 -1
  432. package/dist/scripts/zellij-capability-check.js +0 -1
  433. package/dist/scripts/zellij-developer-controls-check.js +0 -1
  434. package/dist/scripts/zellij-doctor-readiness-check.js +0 -13
  435. package/dist/scripts/zellij-dynamic-pane-lifecycle-check.js +0 -1
  436. package/dist/scripts/zellij-fake-adapter-check.js +0 -1
  437. package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -1
  438. package/dist/scripts/zellij-lane-renderer-check.js +0 -1
  439. package/dist/scripts/zellij-launch-command-truth-check.js +0 -12
  440. package/dist/scripts/zellij-layout-valid-check.js +0 -1
  441. package/dist/scripts/zellij-pane-creation-lock-metrics-check.js +0 -1
  442. package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -1
  443. package/dist/scripts/zellij-pane-lock-does-not-block-worker-check.js +0 -1
  444. package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -1
  445. package/dist/scripts/zellij-pane-proof-check.js +0 -1
  446. package/dist/scripts/zellij-qa-app-handoff-status-check.js +0 -1
  447. package/dist/scripts/zellij-real-session-cleanup-check.js +0 -1
  448. package/dist/scripts/zellij-real-session-launch-check.js +0 -1
  449. package/dist/scripts/zellij-right-column-geometry-proof.js +0 -1
  450. package/dist/scripts/zellij-right-column-headless-overflow-check.js +0 -1
  451. package/dist/scripts/zellij-right-column-manager-check.js +0 -1
  452. package/dist/scripts/zellij-screen-proof-check.js +0 -1
  453. package/dist/scripts/zellij-slot-only-ui-check.js +0 -1
  454. package/dist/scripts/zellij-slot-pane-renderer-check.js +0 -1
  455. package/dist/scripts/zellij-slot-pane-stale-detection-check.js +0 -7
  456. package/dist/scripts/zellij-slot-telemetry-incremental-check.js +0 -1
  457. package/dist/scripts/zellij-slot-telemetry-live-flush-check.js +0 -1
  458. package/dist/scripts/zellij-slot-telemetry-performance-check.js +0 -1
  459. package/dist/scripts/zellij-stacked-capability-routing-check.js +0 -1
  460. package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -1
  461. package/dist/scripts/zellij-stacked-version-matrix-check.js +0 -1
  462. package/dist/scripts/zellij-stacked-version-parser-check.js +0 -1
  463. package/dist/scripts/zellij-ui-design-check.js +0 -12
  464. package/dist/scripts/zellij-update-prompt-matrix-check.js +0 -1
  465. package/dist/scripts/zellij-update-prompt-mode-check.js +0 -1
  466. package/dist/scripts/zellij-update-prompt-safety-check.js +0 -1
  467. package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -2
  468. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  import { leanEngineeringCompactText, leanEngineeringLongText } from './lean-engineering-policy.js';
2
2
  export { leanEngineeringCompactText, leanEngineeringLongText };
3
- import { ALLOWED_REASONING_EFFORTS, FROM_CHAT_IMG_CHECKLIST_ARTIFACT, FROM_CHAT_IMG_COVERAGE_ARTIFACT, FROM_CHAT_IMG_QA_LOOP_ARTIFACT, FROM_CHAT_IMG_SOURCE_INVENTORY_ARTIFACT, FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT, FROM_CHAT_IMG_TEMP_TRIWIKI_SESSIONS, FROM_CHAT_IMG_VISUAL_MAP_ARTIFACT, FROM_CHAT_IMG_WORK_ORDER_ARTIFACT, REFLECTION_SKILL_NAME, USAGE_TOPICS } from './routes/constants.js';
3
+ import { ALLOWED_REASONING_EFFORTS, FROM_CHAT_IMG_CHECKLIST_ARTIFACT, FROM_CHAT_IMG_COVERAGE_ARTIFACT, FROM_CHAT_IMG_QA_LOOP_ARTIFACT, FROM_CHAT_IMG_SOURCE_INVENTORY_ARTIFACT, FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT, FROM_CHAT_IMG_TEMP_TRIWIKI_SESSIONS, FROM_CHAT_IMG_VISUAL_MAP_ARTIFACT, FROM_CHAT_IMG_WORK_ORDER_ARTIFACT, RECOMMENDED_SKILLS, REFLECTION_SKILL_NAME, USAGE_TOPICS } from './routes/constants.js';
4
4
  import { CODEX_APP_IMAGE_GENERATION_DOC_URL, CODEX_COMPUTER_USE_ONLY_POLICY, CODEX_IMAGEGEN_REQUIRED_POLICY, CODEX_WEB_VERIFICATION_POLICY, RESERVED_CODEX_PLUGIN_SKILL_NAMES } from './routes/evidence.js';
5
5
  import { getdesignReferencePolicyText, imageUxReviewPipelinePolicyText } from './routes/design-policy.js';
6
6
  import { PPT_PIPELINE_SKILL_ALLOWLIST, pptPipelineAllowlistPolicyText } from './routes/ppt-policy.js';
7
7
  import { normalizeDollarSkillName, prefixKnownSksDollarReferences, sksPrefixedDollarCommand, sksPrefixedSkillName, unprefixedSksSkillName } from './routes/dollar-prefix.js';
8
8
  import { classifyTaskProfile, looksLikeDatabaseWorkRequest } from './runtime/task-profile.js';
9
+ import { legacyCoreSkillNames } from './codex-native/core-skill-manifest.js';
9
10
  export * from './routes/constants.js';
10
11
  export * from './routes/design-policy.js';
11
12
  export * from './routes/evidence.js';
@@ -186,12 +187,6 @@ export const ROUTES = [
186
187
  command: '$Plan',
187
188
  mode: 'PLAN',
188
189
  route: 'planning-only frontdoor',
189
- // 20차 P0-8: $Plan currently writes a fixed template (goal/scope/steps
190
- // headings) with no task-specific agent reasoning behind it — it is a
191
- // scaffold to fill in, not the "decision-complete planning" this used to
192
- // claim. Retracted rather than reimplemented as a real planning agent
193
- // (out of scope for this pass); implementation remains disallowed until
194
- // $Work runs the plan.
195
190
  description: 'Plan scaffold only: writes a fixed-template .sneakoscope/plans/<slug>.md (goal/scope/steps headings to fill in), not project-specific decision-complete planning. Keeps implementation disallowed until $Work runs the plan.',
196
191
  requiredSkills: ['plan', 'honest-mode'],
197
192
  lifecycle: ['plan_intake', 'scope_and_acceptance', 'write_plan_artifact', 'implementation_allowed_false', 'honest_mode'],
@@ -263,7 +258,7 @@ export const ROUTES = [
263
258
  reasoningPolicy: 'high',
264
259
  stopGate: 'naruto-gate.json',
265
260
  coverage_required: true,
266
- cliEntrypoint: 'sks naruto run "task" [--agents N] [--max-threads N] | sks naruto status|subagents|proof',
261
+ cliEntrypoint: 'sks naruto run "task" [--agents N] [--max-threads N] [--trusted-project] | sks naruto status|subagents|proof',
267
262
  examples: ['$Naruto run review twelve independent packages with --agents 12', '$Work']
268
263
  },
269
264
  {
@@ -272,7 +267,7 @@ export const ROUTES = [
272
267
  mode: 'RELEASE_REVIEW',
273
268
  route: 'official subagent release review',
274
269
  description: 'Run release-readiness collaboration through official Codex subagents with explicit thread budget, disjoint ownership, parent integration, scoped verification, and cleanup evidence.',
275
- requiredSkills: ['naruto', 'pipeline-runner', REFLECTION_SKILL_NAME, 'honest-mode'],
270
+ requiredSkills: ['release-review', 'naruto', 'pipeline-runner', REFLECTION_SKILL_NAME, 'honest-mode'],
276
271
  lifecycle: ['subagent_plan', 'release_fixture_matrix', 'risk_scoped_review', 'parent_integration', 'session_cleanup', 'honest_mode'],
277
272
  context7Policy: 'optional',
278
273
  reasoningPolicy: 'high',
@@ -362,7 +357,7 @@ export const ROUTES = [
362
357
  mode: 'COMMIT',
363
358
  route: 'simple git commit',
364
359
  description: 'Summarize current git changes, stage them, and create one commit without the full SKS pipeline.',
365
- requiredSkills: ['honest-mode'],
360
+ requiredSkills: ['commit', 'honest-mode'],
366
361
  lifecycle: ['git_status_summary', 'git_add_all', 'git_commit', 'short_result'],
367
362
  context7Policy: 'not_required',
368
363
  reasoningPolicy: 'low',
@@ -377,7 +372,7 @@ export const ROUTES = [
377
372
  mode: 'COMMIT_AND_PUSH',
378
373
  route: 'simple git commit and push',
379
374
  description: 'Summarize current git changes, stage them, create one commit, then run git push without the full SKS pipeline.',
380
- requiredSkills: ['honest-mode'],
375
+ requiredSkills: ['commit-and-push', 'honest-mode'],
381
376
  lifecycle: ['git_status_summary', 'git_add_all', 'git_commit', 'git_push', 'short_result'],
382
377
  context7Policy: 'not_required',
383
378
  reasoningPolicy: 'low',
@@ -537,6 +532,40 @@ export const LEGACY_DOLLAR_COMMAND_NAMES = Array.from(new Set(ROUTES
537
532
  .flatMap((route) => [route.command, ...(route.dollarAliases || [])])));
538
533
  export const LEGACY_DOLLAR_SKILL_NAMES = Array.from(new Set(ROUTES.flatMap((route) => legacyRouteAppSkillNames(route))));
539
534
  export const DOLLAR_SKILL_NAMES = Array.from(new Set(ROUTES.flatMap((route) => routeAppSkillNames(route))));
535
+ const PACKAGED_MANAGED_SUPPORT_SKILL_NAMES = [
536
+ 'sks-autoresearch-loop',
537
+ 'sks-context7-docs',
538
+ 'sks-db-safety-guard',
539
+ 'sks-design-artifact-expert',
540
+ 'sks-design-system-builder',
541
+ 'sks-design-ui-editor',
542
+ 'sks-from-chat-img',
543
+ 'sks-getdesign-reference',
544
+ 'sks-gx-visual-generate',
545
+ 'sks-gx-visual-read',
546
+ 'sks-gx-visual-validate',
547
+ 'sks-honest-mode',
548
+ 'sks-hproof-claim-ledger',
549
+ 'sks-hproof-evidence-bind',
550
+ 'sks-imagegen',
551
+ 'sks-imagegen-source-scout',
552
+ 'sks-performance-evaluator',
553
+ 'sks-pipeline-runner',
554
+ 'sks-prompt-pipeline',
555
+ 'sks-reasoning-router',
556
+ 'sks-reflection',
557
+ 'sks-research-discovery',
558
+ 'sks-solution-scout',
559
+ 'sks-turbo-context-pack'
560
+ ];
561
+ export const MANAGED_ROUTE_SKILL_NAMES = Array.from(new Set([
562
+ ...DOLLAR_SKILL_NAMES,
563
+ ...RECOMMENDED_SKILLS,
564
+ ...PACKAGED_MANAGED_SUPPORT_SKILL_NAMES,
565
+ ...legacyCoreSkillNames().map((name) => sksPrefixedSkillName(name)),
566
+ ...ROUTES.flatMap((route) => Array.isArray(route.requiredSkills) ? route.requiredSkills : [])
567
+ ]));
568
+ export const INVALID_EXPLICIT_MANAGED_SKILL_NAME = 'sks-invalid-explicit-managed-skill';
540
569
  const LEGACY_DOLLAR_REFERENCE_NAMES = Array.from(new Set([
541
570
  ...LEGACY_DOLLAR_SKILL_NAMES,
542
571
  ...LEGACY_DOLLAR_COMMAND_NAMES.map((command) => normalizeDollarSkillName(command)),
@@ -557,6 +586,7 @@ export const DOLLAR_COMMANDS = ROUTES.filter((route) => route.hidden !== true).f
557
586
  export const DOLLAR_COMMAND_ALIASES = ROUTES.flatMap((route) => [
558
587
  ...routeAppSkillNames(route).map((alias) => ({ canonical: sksPrefixedDollarCommand(route.command), app_skill: `$${alias}` }))
559
588
  ]);
589
+ const MANAGED_ROUTE_SKILL_NAME_SET = new Set(MANAGED_ROUTE_SKILL_NAMES);
560
590
  const ROUTE_BY_ID = new Map();
561
591
  const ROUTE_BY_DOLLAR_COMMAND = new Map();
562
592
  for (const route of ROUTES) {
@@ -658,14 +688,14 @@ export const COMMAND_CATALOG = [
658
688
  { name: 'wiki', usage: 'sks wiki coords|pack|refresh|publish|rebuild-index|validate|validate-shared|wrongness ...', description: 'Build, refresh, publish shared shards, rebuild ignored indexes, validate, and attach wrongness-memory context to RGBA/trig LLM Wiki packs with attention.use_first and attention.hydrate_first for compact recall plus source hydration.' },
659
689
  { name: 'memory', usage: 'sks memory build [--json] | sks memory gc [--dry-run]', description: 'Project TriWiki context-pack memory into managed AGENTS.md blocks or run bounded memory cleanup.' },
660
690
  { name: 'hproof', usage: 'sks hproof check [mission-id|latest]', description: 'Evaluate the H-Proof done gate for a mission.' },
661
- { name: 'naruto', usage: 'sks naruto run \"task\" [--agents N] [--max-threads N] [--json] | sks naruto status|subagents|proof [latest|M-...] [--json]', description: 'Run or inspect the Codex official subagent workflow with a Sol Max parent and fixed Luna Max mechanical, Sol High implementation, Sol Max judgment, and Terra Medium long-context/tool profiles, max_depth=1, and structured parent-thread completion evidence.' },
691
+ { name: 'naruto', usage: 'sks naruto run \"task\" [--agents N] [--max-threads N] [--trusted-project] [--json] | sks naruto status|subagents|proof [latest|M-...] [--json]', description: 'Run or inspect the Codex official subagent workflow with a Sol Max parent and fixed Luna Max mechanical, Sol High implementation, Sol Max judgment, and Terra Medium long-context/tool profiles, max_depth=1, and structured parent-thread completion evidence.' },
662
692
  { name: 'reasoning', usage: 'sks reasoning ["prompt"] [--json]', description: 'Show SKS temporary reasoning-effort routing: medium for simple tasks, high for logic, xhigh for research.' },
663
693
  { name: 'gx', usage: 'sks gx init|render|validate|drift|snapshot [name]', description: 'Create and verify deterministic SVG/HTML visual context cartridges.' },
664
694
  { name: 'profile', usage: 'sks profile show|set <model>', description: 'Inspect or set the current SKS model profile metadata.' },
665
695
  { name: 'gc', usage: 'sks gc [--dry-run] [--json]', description: 'Compact oversized logs and prune stale runtime artifacts.' },
666
696
  { name: 'stats', usage: 'sks stats [--full] [--json]', description: 'Show package and .sneakoscope storage size.' },
667
697
  { name: 'mcp-server', usage: 'sks mcp-server [--expose-exec] [--probe]', description: 'Run a stdio MCP server exposing SKS read-only commands as tools for any MCP-capable agent host; --expose-exec also exposes non-read-only commands; --probe round-trips initialize/tools-list and exits.' },
668
- { name: 'agent-bridge', usage: 'sks agent-bridge setup [--json]', description: 'Publish the agent-bridge manifest, print host registration snippets (generic MCP host, Codex CLI, non-interactive contract), and run a live non-interactive smoke test.' }
698
+ { name: 'agent-bridge', usage: 'sks agent-bridge setup [--trusted-project] [--json]', description: 'Publish the agent-bridge manifest, print host registration snippets (generic MCP host, Codex CLI, non-interactive contract), and run a live non-interactive smoke test; project MCP inventory requires explicit project trust.' }
669
699
  ];
670
700
  export function routeById(id) {
671
701
  const key = String(id || '').replace(/^\$/, '').toLowerCase();
@@ -698,6 +728,52 @@ export function dollarCommand(prompt) {
698
728
  const embedded = embeddedDollarCommandMatch(prompt);
699
729
  return embedded ? embedded.command.toUpperCase() : null;
700
730
  }
731
+ export function explicitManagedSkillNames(prompt = '') {
732
+ const text = String(prompt || '');
733
+ const matches = [];
734
+ for (const match of text.matchAll(/\[\$([A-Za-z][A-Za-z0-9_-]*)\]\([^)]+\)/g)) {
735
+ matches.push({ index: match.index ?? 0, name: match[1] || '' });
736
+ }
737
+ for (const match of text.matchAll(/(^|[\s([{<])\$([A-Za-z][A-Za-z0-9_-]*)(?=\s|:|$|[.,!?;)\]}])/g)) {
738
+ matches.push({ index: (match.index ?? 0) + (match[1] || '').length, name: match[2] || '' });
739
+ }
740
+ const selected = [];
741
+ for (const match of matches.sort((a, b) => a.index - b.index)) {
742
+ const rawName = normalizeDollarSkillName(match.name);
743
+ const skillName = sksPrefixedSkillName(match.name);
744
+ if (!skillName || skillName.length > 100)
745
+ continue;
746
+ if (routeByDollarCommand(match.name)) {
747
+ if (!MANAGED_ROUTE_SKILL_NAME_SET.has(skillName) || selected.includes(skillName))
748
+ continue;
749
+ selected.push(skillName);
750
+ continue;
751
+ }
752
+ if (!rawName.startsWith('sks-'))
753
+ continue;
754
+ const boundedSkillName = MANAGED_ROUTE_SKILL_NAME_SET.has(skillName)
755
+ ? skillName
756
+ : INVALID_EXPLICIT_MANAGED_SKILL_NAME;
757
+ if (selected.includes(boundedSkillName))
758
+ continue;
759
+ selected.push(boundedSkillName);
760
+ }
761
+ return selected;
762
+ }
763
+ export function managedSkillNamesForPrompt(route, prompt = '') {
764
+ return Array.from(new Set([
765
+ ...(Array.isArray(route?.requiredSkills) ? route.requiredSkills.map(String) : []),
766
+ ...explicitManagedSkillNames(prompt)
767
+ ]));
768
+ }
769
+ export function allowlistedManagedRouteSkillNames(value) {
770
+ if (!Array.isArray(value))
771
+ return [];
772
+ return Array.from(new Set(value
773
+ .slice(0, MANAGED_ROUTE_SKILL_NAMES.length + 1)
774
+ .filter((name) => typeof name === 'string'
775
+ && (MANAGED_ROUTE_SKILL_NAME_SET.has(name) || name === INVALID_EXPLICIT_MANAGED_SKILL_NAME))));
776
+ }
701
777
  export function hasMadSksSignal(prompt = '') {
702
778
  return /(?:^|\s)(?:\$(?:sks-)?MAD-SKS|\[\$(?:sks-)?MAD-SKS\]\([^)]+\))(?:\s|:|$)/i.test(String(prompt || ''));
703
779
  }
@@ -1101,8 +1177,6 @@ export function narutoDecisionForRoute(route, prompt = '', profile = classifyTas
1101
1177
  return narutoRouteDecision('none', null, profile, 'no_route_or_task_context', true);
1102
1178
  }
1103
1179
  if (NARUTO_GATE_ROUTE_OWNED_IDS.has(routeId)) {
1104
- // These routes already own their orchestration lifecycle. The common
1105
- // Naruto gate records that fact but must not add a second generic fanout.
1106
1180
  return narutoRouteDecision('route_owned', routeId, profile, `route_owned_orchestration:${routeId}`, false);
1107
1181
  }
1108
1182
  if (NARUTO_GATE_BYPASS_ROUTE_IDS.has(routeId)) {
@@ -18,6 +18,7 @@ const ARGUMENT_PROFILES = {
18
18
  agents: { type: 'integer', minimum: 1 },
19
19
  max_threads: { type: 'integer', minimum: 1 },
20
20
  readonly: { type: 'boolean' },
21
+ trusted_project: { type: 'boolean' },
21
22
  json: { type: 'boolean' }
22
23
  }),
23
24
  build: (input) => {
@@ -34,6 +35,7 @@ const ARGUMENT_PROFILES = {
34
35
  ...numberFlag(input, 'agents', '--agents'),
35
36
  ...numberFlag(input, 'max_threads', '--max-threads'),
36
37
  ...booleanFlag(input, 'readonly', '--readonly'),
38
+ ...booleanFlag(input, 'trusted_project', '--trusted-project'),
37
39
  ...jsonFlag(input)
38
40
  ];
39
41
  }
@@ -3,16 +3,6 @@ import path from 'node:path';
3
3
  import { runProcess, writeTextAtomic } from '../fsx.js';
4
4
  import { isMutationAllowed, isPathAllowed } from './requested-scope-contract.js';
5
5
  import { evaluateMutation, recordMutation } from './mutation-ledger.js';
6
- // Mutation Guard Adapter (1.20.2 Area 1a).
7
- //
8
- // Thin wrappers that force every genuinely-risky mutation through the existing
9
- // Requested-Scope-Contract + Mutation-Ledger before it touches the filesystem or
10
- // spawns a process. This layer adds NO new IO primitives and NO new scope/ledger
11
- // logic — it composes `isMutationAllowed`/`evaluateMutation`/`recordMutation` from
12
- // requested-scope-contract.ts + mutation-ledger.ts and delegates the actual op to
13
- // fsx/fsp/runProcess. A scope violation throws BEFORE the mutation is applied; a
14
- // config/skill mutation lacking a backup or no-op reason throws; every applied
15
- // mutation is recorded to the ledger.
16
6
  export const MUTATION_GUARD_SCHEMA = 'sks.mutation-guard.v1';
17
7
  export class MutationGuardViolationError extends Error {
18
8
  kind;
@@ -26,24 +16,14 @@ export class MutationGuardViolationError extends Error {
26
16
  this.reason = reason;
27
17
  }
28
18
  }
29
- // Config/skill mutations that must carry a backup or a no-op reason (mirrors the
30
- // `needsBackup` rule inside evaluateMutation so the guard can pre-validate).
31
19
  const NEEDS_BACKUP = new Set([
32
20
  'global_config_write',
33
21
  'codex_app_flag_change',
34
22
  'codex_lb_auth_change',
35
23
  'skill_snapshot_promotion'
36
24
  ]);
37
- /**
38
- * Core guard: validate scope + backup BEFORE applying, run `apply`, then record
39
- * the mutation to the ledger. Throws MutationGuardViolationError without applying
40
- * when the mutation is out of scope or a backup-requiring mutation has neither a
41
- * backup nor a no-op reason. On apply failure, records `applied:false` + reason
42
- * and rethrows the underlying error.
43
- */
44
25
  async function guard(ctx, kind, target, opts, apply) {
45
26
  const evalOpts = buildEvalOpts(target, opts, false);
46
- // Pre-apply scope check (applied:false → violation reflects scope only).
47
27
  const scope = isMutationAllowed(ctx.contract, scopeForKind(kind), { confirmed: opts.confirmed === true });
48
28
  if (!scope.allowed)
49
29
  throw new MutationGuardViolationError(kind, target, scope.reason);
@@ -73,8 +53,6 @@ async function guard(ctx, kind, target, opts, apply) {
73
53
  }
74
54
  }
75
55
  function scopeForKind(kind) {
76
- // Reuse the ledger's KIND_TO_SCOPE indirectly: evaluateMutation already maps it,
77
- // but the pre-apply scope check needs the contract scope directly. Mirror the map.
78
56
  switch (kind) {
79
57
  case 'global_config_write':
80
58
  case 'codex_app_flag_change':
@@ -121,7 +99,6 @@ function pathTargetsFor(kind, target, opts) {
121
99
  return target.split(' -> ').map((s) => s.trim()).filter(Boolean);
122
100
  return [target];
123
101
  }
124
- // ---- Public guarded wrappers -------------------------------------------------
125
102
  export async function guardedWriteFile(ctx, target, data, opts = {}) {
126
103
  await guard(ctx, 'file_write', target, opts, () => writeTextAtomic(target, data));
127
104
  }
@@ -148,7 +125,6 @@ export async function guardedXattr(ctx, target, action, opts = {}) {
148
125
  await guard(ctx, 'xattr', target, opts, async () => {
149
126
  const args = action.op === 'remove' ? ['-d', action.name, target] : ['-w', action.name, action.value, target];
150
127
  const result = await runProcess('xattr', args, { timeoutMs: 5000 });
151
- // xattr -d returns 1 when the attribute is already absent; treat as no-op.
152
128
  if (result.code !== 0 && !(action.op === 'remove' && result.code === 1)) {
153
129
  throw new Error(`xattr_failed:${result.stderr || result.code}`);
154
130
  }
@@ -179,7 +155,6 @@ export async function guardedPackageInstall(ctx, spec, opts) {
179
155
  export async function guardedSkillSnapshotPromotion(ctx, skillTarget, opts, apply) {
180
156
  return guard(ctx, 'skill_snapshot_promotion', skillTarget, opts, apply);
181
157
  }
182
- // Escape hatch for callers that already have an atomic apply but want guarding:
183
158
  export async function guardedApply(ctx, kind, target, opts, apply) {
184
159
  return guard(ctx, kind, target, opts, apply);
185
160
  }
@@ -2,7 +2,6 @@ import path from 'node:path';
2
2
  import { appendJsonl, ensureDir, nowIso } from '../fsx.js';
3
3
  import { isMutationAllowed } from './requested-scope-contract.js';
4
4
  export const MUTATION_LEDGER_SCHEMA = 'sks.mutation-ledger.v1';
5
- // Every kind of mutation SKS can perform. Anything here must be recorded.
6
5
  export const MUTATION_KINDS = [
7
6
  'file_write',
8
7
  'file_delete',
@@ -19,7 +18,6 @@ export const MUTATION_KINDS = [
19
18
  'database_write',
20
19
  'skill_snapshot_promotion'
21
20
  ];
22
- // Which contract scope each ledger kind maps to.
23
21
  const KIND_TO_SCOPE = {
24
22
  file_write: 'project_files',
25
23
  file_delete: 'project_files',
@@ -39,18 +37,11 @@ const KIND_TO_SCOPE = {
39
37
  export function mutationLedgerPath(root) {
40
38
  return path.join(path.resolve(root), '.sneakoscope', 'reports', 'mutation-ledger.jsonl');
41
39
  }
42
- /**
43
- * Evaluate a mutation against the contract WITHOUT applying it. A mutation that is
44
- * out of scope, or a config/skill mutation lacking a backup or no-op reason, is a
45
- * violation that callers must not apply.
46
- */
47
40
  export function evaluateMutation(contract, kind, opts) {
48
41
  const scope = KIND_TO_SCOPE[kind];
49
42
  const decision = isMutationAllowed(contract, scope, { confirmed: opts.confirmed === true });
50
43
  const needsBackup = kind === 'global_config_write' || kind === 'codex_app_flag_change' || kind === 'codex_lb_auth_change' || kind === 'skill_snapshot_promotion';
51
44
  const hasBackupOrNoop = Boolean(opts.backupPath) || Boolean(opts.noOpReason);
52
- // Violations: applied without scope permission, or a config/skill mutation applied
53
- // without a backup/no-op reason.
54
45
  const violation = (opts.applied && !decision.allowed) || (opts.applied && needsBackup && !hasBackupOrNoop);
55
46
  return {
56
47
  schema: MUTATION_LEDGER_SCHEMA,
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  export const HIGH_RISK_CONTRACT_TARGETS = [
3
2
  'super-search fetch',
4
3
  'commit-and-push',
Binary file
@@ -15,21 +15,11 @@ export function setDeploymentContext(active) {
15
15
  export function isDeploymentContext() {
16
16
  return DEPLOYMENT_CONTEXT || process.env.SKS_SKILL_DEPLOYMENT_CONTEXT === '1';
17
17
  }
18
- /**
19
- * Guard invoked at the entry of every optimizer/epoch function. In a
20
- * deployment/inference context the optimizer must never run — only the deployed
21
- * snapshot is read. Throws to make any accidental call a hard failure.
22
- */
23
18
  export function assertNotInDeployment(fnName) {
24
19
  if (isDeploymentContext())
25
20
  throw new SkillDeploymentViolationError(fnName);
26
21
  }
27
22
  export const readDeploymentSnapshot = loadDeployedSnapshot;
28
- /**
29
- * Primary release/deployment promotion API. It writes the immutable deployed
30
- * snapshot and treats the side-effect ledger as part of the transaction: when
31
- * ledger recording fails, the deployed pointer is rolled back or removed.
32
- */
33
23
  export async function promoteToDeployedWithLedger(root, accepted, opts) {
34
24
  return promoteToDeployedInternal(root, accepted, opts, true);
35
25
  }
@@ -56,12 +46,10 @@ async function promoteToDeployedInternal(root, accepted, opts, ledgerRequired) {
56
46
  let archivedPath = null;
57
47
  const existing = (await readJson(deployedPath, null));
58
48
  if (existing) {
59
- // Archive previous snapshot for rollback before overwriting.
60
49
  const historyDir = path.join(dir, 'deployed-history');
61
50
  await ensureDir(historyDir);
62
51
  archivedPath = path.join(historyDir, `v${existing.version}.json`);
63
52
  await writeJsonAtomic(archivedPath, existing);
64
- // A changed snapshot body requires a strictly higher version.
65
53
  if (cardBodyHash(existing.body) !== cardBodyHash(accepted.body) && accepted.version <= existing.version) {
66
54
  return { ok: false, blockers: ['snapshot_changed_without_version_increment'], snapshot: null, archived_path: archivedPath };
67
55
  }
@@ -118,7 +106,6 @@ export async function rollbackDeployment(root, route, skillId) {
118
106
  const current = await loadDeployedSnapshot(root, route, skillId);
119
107
  if (!current)
120
108
  return { ok: false, restored_version: null };
121
- // Find the highest-versioned archived snapshot below the current version.
122
109
  let restore = null;
123
110
  for (let v = current.version - 1; v >= 1; v -= 1) {
124
111
  const candidate = (await readJson(path.join(historyDir, `v${v}.json`), null));
@@ -6,12 +6,6 @@ import { validateHeldout } from './core-skill-validation.js';
6
6
  import { isPatchRejected, recordRejectedPatch } from './rejected-skill-patch-buffer.js';
7
7
  import { assertNotInDeployment } from './core-skill-deployment.js';
8
8
  export const DEFAULT_TEXTUAL_LEARNING_RATE = { max_added_chars: 800, max_deleted_chars: 400, max_replaced_chars: 600 };
9
- /**
10
- * Pure, no-model-call optimizer. Proposes a single bounded SkillPatch from scored
11
- * rollouts using deterministic heuristics (reinforce verification when proof is
12
- * thin; add a rollback instruction when rollback readiness is weak). Returns null
13
- * when there is nothing safe to improve. Forbidden in deployment context.
14
- */
15
9
  export function proposeSkillPatch(card, traces) {
16
10
  assertNotInDeployment('proposeSkillPatch');
17
11
  if (!traces.length)
@@ -35,11 +29,6 @@ export function proposeSkillPatch(card, traces) {
35
29
  textual_learning_rate: { ...DEFAULT_TEXTUAL_LEARNING_RATE }
36
30
  };
37
31
  }
38
- /**
39
- * Run one optimizer epoch in a TRAINING/EVALUATION context. Produces at most one
40
- * accepted candidate (never a deployed snapshot). Rejected patches are buffered so
41
- * the same failed edit is not proposed again. Never mutates code/config/global files.
42
- */
43
32
  export async function runSkillEpoch(root, input) {
44
33
  assertNotInDeployment('runSkillEpoch');
45
34
  const patch = input.patch ?? proposeSkillPatch(input.card, input.trainTraces);
@@ -1,13 +1,7 @@
1
- // SKS Core Skill Engine — SkillOpt-style epoch-wise meta-update.
2
- //
3
- // SkillOpt adjusts its textual learning rate between epochs: rejected edits decay
4
- // the budget (smaller, safer proposals), accepted edits regrow it toward the
5
- // default ceiling. Deterministic, bounded, never exceeds the configured maximum.
6
1
  import { DEFAULT_TEXTUAL_LEARNING_RATE } from './core-skill-epoch.js';
7
2
  export const MIN_TEXTUAL_LEARNING_RATE = { max_added_chars: 100, max_deleted_chars: 50, max_replaced_chars: 75 };
8
3
  export const META_UPDATE_DECAY = 0.5;
9
4
  export const META_UPDATE_GROWTH = 1.25;
10
- /** Epoch-wise textual learning-rate adjustment: decay on rejection, bounded regrowth on acceptance. */
11
5
  export function metaUpdateLearningRate(rate, outcome, opts = {}) {
12
6
  const decay = opts.decay ?? META_UPDATE_DECAY;
13
7
  const growth = opts.growth ?? META_UPDATE_GROWTH;
@@ -1,9 +1,5 @@
1
1
  import { createCandidateCard, cardBodyHash } from './core-skill-card.js';
2
2
  import { sectionSlug, validatePatch } from './core-skill-patch.js';
3
- /**
4
- * Apply a validated SkillPatch to a single skill card, producing a NEW candidate
5
- * card. Never touches code/config/global files. Records before/after body hashes.
6
- */
7
3
  export function applyPatch(card, patch) {
8
4
  const beforeHash = cardBodyHash(card.body);
9
5
  const validation = validatePatch(patch, card);
@@ -44,13 +40,11 @@ function applyOp(body, op) {
44
40
  return { body, blocker: `delete_text_not_found:${op.target}` };
45
41
  return { body: replaceFirst(body, op.text, '') };
46
42
  }
47
- // Whole-section delete.
48
43
  const removed = removeSection(body, op.target);
49
44
  if (removed === null)
50
45
  return { body, blocker: `delete_section_not_found:${op.target}` };
51
46
  return { body: removed };
52
47
  }
53
- // add
54
48
  const text = String(op.text ?? '');
55
49
  return { body: addToSection(body, op.target, text) };
56
50
  }
@@ -92,7 +86,6 @@ function addToSection(body, target, text) {
92
86
  lines.splice(bounds.end, 0, text);
93
87
  return lines.join('\n');
94
88
  }
95
- // Section missing: append a new section with a readable title.
96
89
  const title = (target.includes(':') ? target.split(':').slice(1).join(':') : target).trim();
97
90
  const trimmed = body.replace(/\s+$/, '');
98
91
  return `${trimmed}\n\n## ${title}\n${text}\n`;
@@ -15,17 +15,12 @@ function deletedLength(op, card) {
15
15
  if (typeof op.text === 'string')
16
16
  return op.text.length;
17
17
  if (card && op.target) {
18
- // Whole-section delete: approximate removed length as the section block size.
19
18
  const block = sectionBlock(card.body, op.target);
20
19
  if (block)
21
20
  return block.length;
22
21
  }
23
22
  return 0;
24
23
  }
25
- /**
26
- * Validate a SkillPatch: op whitelist, single-document scope, no code/config/global
27
- * targets, and textual learning-rate budget. Pure; never mutates anything.
28
- */
29
24
  export function validatePatch(patch, card = null) {
30
25
  const blockers = [];
31
26
  let added = 0;
@@ -57,8 +52,6 @@ export function validatePatch(patch, card = null) {
57
52
  blockers.push(`patch_bad_op:${op?.op}`);
58
53
  continue;
59
54
  }
60
- // Every op must target the single skill document (a section/sentence/paragraph),
61
- // never a filesystem/code/config path.
62
55
  if (typeof op.target !== 'string' || !op.target)
63
56
  blockers.push('patch_op_missing_target');
64
57
  else if (FORBIDDEN_PATCH_TARGET_RE.test(op.target))
@@ -86,7 +79,6 @@ export function validatePatch(patch, card = null) {
86
79
  }
87
80
  return { ok: blockers.length === 0, blockers, added_chars: added, deleted_chars: deleted, replaced_chars: replaced };
88
81
  }
89
- /** Extract the markdown "## <slug>" section block (header + body) for a target like "section:foo". */
90
82
  export function sectionBlock(body, target) {
91
83
  const slug = target.includes(':') ? target.split(':').slice(1).join(':') : target;
92
84
  const lines = String(body || '').split('\n');
@@ -1,13 +1,4 @@
1
- // SKS Core Skill Engine — SkillOpt-style reflection stage.
2
- //
3
- // SkillOpt's training loop is rollout → reflection → aggregation → selection →
4
- // validation-gated update. This module implements the reflect/aggregate/select
5
- // stages deterministically (no model call): each scored rollout yields reflection
6
- // records for its deficient score dimensions, reflections are aggregated and
7
- // ranked across the batch, and the top-ranked deficiencies are mapped to bounded
8
- // add-operations on the single skill document.
9
1
  import { scoreRollout } from './core-skill-scorer.js';
10
- // dimension → { instruction line, target section, regex proving the card already covers it }
11
2
  const DIMENSION_LESSONS = {
12
3
  proof_completeness: {
13
4
  target: 'section:verification',
@@ -40,7 +31,6 @@ const DIMENSION_LESSONS = {
40
31
  covered: /failure reason/i
41
32
  }
42
33
  };
43
- /** Reflect on one scored rollout: one reflection per deficient score dimension. */
44
34
  export function reflectOnTrace(trace, opts = {}) {
45
35
  const score = scoreRollout(trace, opts);
46
36
  const reflections = [];
@@ -56,7 +46,6 @@ export function reflectOnTrace(trace, opts = {}) {
56
46
  }
57
47
  return reflections;
58
48
  }
59
- /** Aggregate reflections across a rollout batch, ranked by total severity then count. */
60
49
  export function aggregateReflections(reflections) {
61
50
  const byDimension = new Map();
62
51
  for (const reflection of reflections) {
@@ -67,11 +56,6 @@ export function aggregateReflections(reflections) {
67
56
  }
68
57
  return [...byDimension.values()].sort((a, b) => b.severity - a.severity || b.count - a.count || a.dimension.localeCompare(b.dimension));
69
58
  }
70
- /**
71
- * Select bounded patch operations from aggregated reflections. Skips lessons the
72
- * card body already covers, and truncates the selection so total added chars fit
73
- * the textual learning-rate budget.
74
- */
75
59
  export function selectPatchOperations(card, aggregated, learningRate, opts = {}) {
76
60
  const maxOperations = Math.max(1, opts.maxOperations ?? 2);
77
61
  const operations = [];
@@ -1,10 +1,5 @@
1
1
  import { cardHash, loadDeployedSnapshot } from './core-skill-card.js';
2
2
  import { isDeploymentContext } from './core-skill-deployment.js';
3
- /**
4
- * Inference-path skill selection. Reads ONLY the deployed snapshot for a route/skill
5
- * and returns it as an instruction fragment. Never invokes the optimizer. Missing
6
- * snapshot is a graceful fallback with a warning (route still runs).
7
- */
8
3
  export async function selectRouteSkill(root, route, skillId) {
9
4
  let card = null;
10
5
  try {
@@ -25,7 +20,6 @@ export async function selectRouteSkill(root, route, skillId) {
25
20
  instruction: card.body
26
21
  };
27
22
  }
28
- /** Compact record for route proof evidence. */
29
23
  export function skillProofRecord(selection) {
30
24
  return {
31
25
  skill_id: selection.skill_id,
@@ -2,11 +2,6 @@ import path from 'node:path';
2
2
  import { ensureDir, nowIso, writeJsonAtomic } from '../fsx.js';
3
3
  import { CORE_SKILL_SCORE_SCHEMA } from './core-skill-types.js';
4
4
  export const DEFAULT_LATENCY_BUDGET_MS = 60_000;
5
- /**
6
- * Score a rollout trace. A side-effect-zero violation (mutations beyond requested
7
- * scope) is a HARD fail: the score is driven negative so the candidate can never
8
- * be accepted regardless of task success. Proof-less success scores low.
9
- */
10
5
  export function scoreRollout(trace, opts = {}) {
11
6
  const latencyBudget = Math.max(1, opts.latencyBudgetMs ?? DEFAULT_LATENCY_BUDGET_MS);
12
7
  const hadSideEffect = trace.side_effect_ledger.length > 0;
@@ -25,7 +20,6 @@ export function scoreRollout(trace, opts = {}) {
25
20
  components.latency_budget +
26
21
  components.rollback_ready +
27
22
  components.requested_scope_compliance;
28
- // Hard fail: any requested-scope violation forces a negative score.
29
23
  const score = sideEffectViolation ? -1 : raw;
30
24
  return {
31
25
  schema: CORE_SKILL_SCORE_SCHEMA,
@@ -36,7 +30,6 @@ export function scoreRollout(trace, opts = {}) {
36
30
  skill_version: trace.skill_version
37
31
  };
38
32
  }
39
- /** Aggregate score across a set of rollouts (mean), preserving any violation as a hard fail. */
40
33
  export function scoreRollouts(traces, opts = {}) {
41
34
  if (!traces.length) {
42
35
  return {
@@ -1,12 +1,3 @@
1
- // SKS Core Skill Engine — SkillOpt-style multi-epoch trainer.
2
- //
3
- // Closes the SkillOpt training loop over the existing primitives: per epoch a
4
- // rollout batch is reflected on (reflect → aggregate → select), the selected
5
- // bounded edit goes through the strict held-out gate (runSkillEpoch), and the
6
- // textual learning rate is meta-updated from the outcome. The best held-out
7
- // accepted card is exported as the deployable best-skill artifact (SkillOpt's
8
- // best_skill.md analogue). Pure/deterministic: the caller supplies the held-out
9
- // evaluator; no model call is made here. Forbidden in deployment context.
10
1
  import path from 'node:path';
11
2
  import { ensureDir, nowIso, writeJsonAtomic } from '../fsx.js';
12
3
  import { assertNotInDeployment } from './core-skill-deployment.js';
@@ -16,7 +7,6 @@ import { applyPatch } from './core-skill-patch-apply.js';
16
7
  import { aggregateReflections, reflectOnTrace, selectPatchOperations } from './core-skill-reflection.js';
17
8
  import { CORE_SKILL_PATCH_SCHEMA } from './core-skill-types.js';
18
9
  export const CORE_SKILL_TRAINING_REPORT_SCHEMA = 'sks.core-skill-training-report.v1';
19
- /** Run the SkillOpt training loop in a TRAINING/EVALUATION context. */
20
10
  export async function trainSkill(root, input) {
21
11
  assertNotInDeployment('trainSkill');
22
12
  let current = input.card;
@@ -41,7 +31,6 @@ export async function trainSkill(root, input) {
41
31
  operations,
42
32
  textual_learning_rate: { ...learningRate }
43
33
  };
44
- // Probe the candidate's held-out score BEFORE the gated update.
45
34
  const preview = applyPatch(current, patch);
46
35
  const candidateProbe = preview.ok && preview.candidate ? input.evaluateHeldout(preview.candidate) : currentProbe;
47
36
  const result = await runSkillEpoch(root, {
@@ -1,15 +1,6 @@
1
- // SKS Core Skill Engine — shared type contract (SkillOpt-derived).
2
- //
3
- // Skills are the frozen agent's external, versioned state. An optimizer proposes
4
- // bounded edits to a single skill document; edits are accepted ONLY on strict
5
- // held-out improvement; deployment reads an immutable accepted snapshot and never
6
- // calls the optimizer. None of this mutates code/config/global files.
7
1
  export const CORE_SKILL_CARD_SCHEMA = 'sks.core-skill-card.v1';
8
2
  export const CORE_SKILL_PATCH_SCHEMA = 'sks.core-skill-patch.v1';
9
3
  export const CORE_ROLLOUT_TRACE_SCHEMA = 'sks.core-rollout-trace.v1';
10
4
  export const CORE_SKILL_SCORE_SCHEMA = 'sks.core-skill-rollout-score.v1';
11
- // Targets a SkillPatch may address. Anything else (code/config/global files) is
12
- // rejected — patches only ever edit the single skill document.
13
5
  export const SKILL_PATCH_TARGET_RE = /^(section|sentence|paragraph):[A-Za-z0-9 _.-]+$/;
14
- // Targets that look like filesystem/code/config paths are explicitly forbidden.
15
6
  export const FORBIDDEN_PATCH_TARGET_RE = /[/\\]|\.(ts|js|mjs|json|toml|rs|md|lock)\b|^~|^\.{1,2}\//i;
@@ -1,8 +1,3 @@
1
- /**
2
- * Strict held-out acceptance. A candidate skill is accepted ONLY when its held-out
3
- * score strictly improves AND no safety/quality dimension regresses. Train-only
4
- * improvement with worse held-out is rejected.
5
- */
6
1
  export function validateHeldout(input) {
7
2
  const delta = input.candidateHeldout - input.baselineHeldout;
8
3
  const result = (accept, reason) => ({
@@ -10,7 +10,6 @@ export async function recordRejectedPatch(root, entry) {
10
10
  await appendJsonl(file, full);
11
11
  return full;
12
12
  }
13
- /** Has this exact patch (by hash) already been rejected? Used to skip repeated failed edits. */
14
13
  export async function isPatchRejected(root, patchHash) {
15
14
  const text = await readText(rejectedBufferPath(root), '');
16
15
  if (!text.trim())
@@ -24,7 +23,6 @@ export async function isPatchRejected(root, patchHash) {
24
23
  return true;
25
24
  }
26
25
  catch {
27
- // tolerate malformed lines
28
26
  }
29
27
  }
30
28
  return false;