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,6 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import fsp from 'node:fs/promises';
3
3
  import os from 'node:os';
4
+ import { fileURLToPath } from 'node:url';
4
5
  import { ensureDir, exists, nowIso, PACKAGE_VERSION, readJson, readText, sha256, withScratchDir, writeJsonAtomic, writeTextAtomic } from '../fsx.js';
5
6
  import { buildSksCoreSkillManifest, isCoreSkillName, legacyCoreSkillNames } from '../codex-native/core-skill-manifest.js';
6
7
  import { syncCoreSkillsIntegrity } from '../codex-native/core-skill-integrity.js';
@@ -80,6 +81,8 @@ function reflectionInstructionText(commandPrefix = 'sks') {
80
81
  return `Post-route reflection: full routes load \`reflection\` after work/tests and before final; DFix/Answer/Help/Wiki/SKS discovery are exempt. Write reflection.md; record only real misses/gaps, or no_issue_acknowledged. For lessons, append TriWiki claim rows to ${REFLECTION_MEMORY_PATH}. Run "${commandPrefix} wiki refresh" or pack, validate, then pass reflection-gate.json.`;
81
82
  }
82
83
  async function installOfficialSkills(root) {
84
+ const quarantinedUserCollisions = [];
85
+ const quarantinedManifestCollisions = await prepareReservedSkillManifestsForWrite(root);
83
86
  const imageUxReviewSkill = (name) => `---\nname: ${name}\ndescription: $Image-UX-Review/$UX-Review imagegen/gpt-image-2 annotated UI/UX review loop.\n---\n\nUse only for $Image-UX-Review, $UX-Review, $visual-review, or $ui-ux-review UI/UX review requests. ${imageUxReviewPipelinePolicyText()} Route start must check Codex App imagegen capability and run the SKS imagegen repair loop once; if $imagegen/gpt-image-2 is still unavailable, stop with codex_imagegen_unavailable instead of doing text-only review or direct API substitution. Core loop: capture or attach source UI screenshots, then invoke Codex App $imagegen with gpt-image-2 to create a new generated annotated review image from each source screenshot, then analyze the generated review image with vision/OCR into image-ux-issue-ledger.json, then apply only requested safe fixes and recheck changed screens. Text-only screenshot critique cannot satisfy full verification; missing generated annotated review images keep full image-ux-review-gate.json verification blocked, but may close verified_partial/reference-only when source screenshots plus hashes, docs evidence, source Image Voxel anchors, and Honest Mode evidence exist. For live web/browser/webapp capture use Codex Chrome Extension first and halt if it is not installed/enabled; use Codex Computer Use only for native Mac/non-web app screens. Required artifacts: image-ux-review-policy.json, image-ux-screen-inventory.json, image-ux-generated-review-ledger.json, image-ux-issue-ledger.json, image-ux-iteration-report.json, image-ux-review-gate.json. Finish with reflection and Honest Mode.\n`;
84
87
  const canonicalMadSksSqlPlanePolicy = madSksSqlPlanePolicyText()
85
88
  .replace(/^---[\s\S]*?---\s*/, '')
@@ -152,15 +155,28 @@ async function installOfficialSkills(root) {
152
155
  continue;
153
156
  const dir = path.join(root, '.agents', 'skills', name);
154
157
  const skillContent = markManagedSkill(name, currentSurfaceSkillText(enrichSkillContent(legacyName, content), name));
155
- const existingText = await readConfinedOfficialSkillText(root, dir, name);
156
- if (typeof existingText === 'string' && !isSksManagedOrGeneratedOfficialSkill(existingText)) {
158
+ const existing = await readConfinedOfficialSkillText(root, dir, name);
159
+ if (existing.quarantined)
160
+ quarantinedUserCollisions.push(name);
161
+ if (typeof existing.text === 'string' && !isSksManagedOfficialSkill(existing.text)) {
157
162
  await quarantineSkillDir(root, dir, name, 'global-official-name-user-collision');
163
+ quarantinedUserCollisions.push(name);
158
164
  }
159
165
  await ensureConfinedDirectory(root, dir);
160
166
  await writeTextAtomic(path.join(dir, 'SKILL.md'), `${skillContent.trim()}\n`);
161
167
  await writeSkillMetadata(root, dir, name);
162
168
  }
163
169
  const coreManifest = buildSksCoreSkillManifest();
170
+ for (const skill of coreManifest.skills) {
171
+ const dir = path.join(root, '.agents', 'skills', skill.canonical_name);
172
+ const existing = await readConfinedOfficialSkillText(root, dir, skill.canonical_name);
173
+ if (existing.quarantined)
174
+ quarantinedUserCollisions.push(skill.canonical_name);
175
+ if (typeof existing.text === 'string' && !isSksManagedOfficialSkill(existing.text)) {
176
+ await quarantineSkillDir(root, dir, skill.canonical_name, 'global-official-core-name-user-collision');
177
+ quarantinedUserCollisions.push(skill.canonical_name);
178
+ }
179
+ }
164
180
  const coreByName = new Map(coreManifest.skills.map((skill) => [skill.canonical_name, skill.content_sha256]));
165
181
  const coreIntegrity = await syncCoreSkillsIntegrity({
166
182
  root,
@@ -175,9 +191,15 @@ async function installOfficialSkills(root) {
175
191
  await writeSkillMetadata(root, path.join(root, '.agents', 'skills', name), name);
176
192
  }
177
193
  const skillNames = [...nonCoreSkillNames, ...managedCoreSkillNames];
178
- const removedStaleGeneratedSkills = await removeStaleGeneratedSkillsFromManifest(root, skillNames);
194
+ const staleGeneratedSkills = await removeStaleGeneratedSkillsFromManifest(root, skillNames);
195
+ quarantinedUserCollisions.push(...staleGeneratedSkills.quarantined);
179
196
  const removedPluginSkillCollisions = await removeGeneratedPluginSkillCollisions(root);
197
+ quarantinedUserCollisions.push(...removedPluginSkillCollisions.quarantined);
180
198
  await writeGeneratedSkillManifest(root, skillNames);
199
+ const removedAgentSkillAliases = await removeGeneratedAgentSkillAliases(root, skillNames);
200
+ quarantinedUserCollisions.push(...removedAgentSkillAliases.quarantined);
201
+ const removedCodexSkillMirrors = await removeGeneratedCodexSkillMirrors(root, skillNames);
202
+ quarantinedUserCollisions.push(...removedCodexSkillMirrors.quarantined);
181
203
  return {
182
204
  installed_skills: skillNames,
183
205
  generated_files: generatedSkillFiles(skillNames),
@@ -189,18 +211,20 @@ async function installOfficialSkills(root) {
189
211
  user_collision_count: coreIntegrity.user_collision_count,
190
212
  report: '.sneakoscope/reports/core-skill-integrity.json'
191
213
  },
192
- removed_stale_generated_skills: [...removedStaleGeneratedSkills, ...removedPluginSkillCollisions].sort(),
193
- removed_agent_skill_aliases: await removeGeneratedAgentSkillAliases(root, skillNames),
194
- removed_codex_skill_mirrors: await removeGeneratedCodexSkillMirrors(root, skillNames)
214
+ removed_stale_generated_skills: [...staleGeneratedSkills.removed, ...removedPluginSkillCollisions.removed].sort(),
215
+ removed_agent_skill_aliases: removedAgentSkillAliases.removed,
216
+ removed_codex_skill_mirrors: removedCodexSkillMirrors.removed,
217
+ quarantined_user_collisions: [...new Set(quarantinedUserCollisions)].sort(),
218
+ quarantined_manifest_collisions: [...new Set(quarantinedManifestCollisions)].sort()
195
219
  };
196
220
  }
197
221
  async function readConfinedOfficialSkillText(root, dir, name) {
198
222
  const dirInspection = await inspectConfinedPath(root, dir);
199
223
  if (!dirInspection.exists)
200
- return null;
224
+ return { text: null, quarantined: false };
201
225
  if (dirInspection.leafSymlink || !dirInspection.stat?.isDirectory()) {
202
226
  await quarantineSkillDir(root, dir, name, 'global-official-path-collision');
203
- return null;
227
+ return { text: null, quarantined: true };
204
228
  }
205
229
  const expected = [
206
230
  { target: path.join(dir, 'SKILL.md'), kind: 'file' },
@@ -214,12 +238,22 @@ async function readConfinedOfficialSkillText(root, dir, name) {
214
238
  const wrongType = row.kind === 'file' ? !inspected.stat?.isFile() : !inspected.stat?.isDirectory();
215
239
  if (inspected.leafSymlink || wrongType) {
216
240
  await quarantineSkillDir(root, dir, name, 'global-official-nested-path-collision');
217
- return null;
241
+ return { text: null, quarantined: true };
218
242
  }
219
243
  }
220
244
  const skillPath = path.join(dir, 'SKILL.md');
221
245
  const skillInspection = await inspectConfinedPath(root, skillPath);
222
- return skillInspection.exists ? fsp.readFile(skillPath, 'utf8') : null;
246
+ if (!skillInspection.exists) {
247
+ const entries = await fsp.readdir(dir);
248
+ if (entries.length > 0) {
249
+ await quarantineSkillDir(root, dir, name, 'global-official-missing-skill-user-collision');
250
+ return { text: null, quarantined: true };
251
+ }
252
+ }
253
+ return {
254
+ text: skillInspection.exists ? await fsp.readFile(skillPath, 'utf8') : null,
255
+ quarantined: false
256
+ };
223
257
  }
224
258
  function currentSksInstalledSkillName(value) {
225
259
  const canonical = canonicalSkillNameFromValue(value);
@@ -356,7 +390,7 @@ async function reconcileRemovedSkillTargets(targets, fix) {
356
390
  const displayPath = displayRemovedSkillPath(target, dir);
357
391
  let managed = false;
358
392
  try {
359
- managed = await isManagedRemovedSkillPath(ownerRoot, dir, name);
393
+ managed = await isManagedRemovedSkillPath(ownerRoot, dir);
360
394
  }
361
395
  catch (error) {
362
396
  errors.push(`${displayPath}:${publicPathError(error, dir)}`);
@@ -415,7 +449,7 @@ function displayRemovedSkillPath(target, dir) {
415
449
  return `$SKS_GLOBAL_ROOT/${rel}`;
416
450
  return target.scope.startsWith('global') ? `~/${rel}` : rel;
417
451
  }
418
- async function isManagedRemovedSkillPath(ownerRoot, dir, name) {
452
+ async function isManagedRemovedSkillPath(ownerRoot, dir) {
419
453
  const dirInspection = await inspectConfinedPath(ownerRoot, dir);
420
454
  if (!dirInspection.exists || dirInspection.leafSymlink || !dirInspection.stat?.isDirectory())
421
455
  return false;
@@ -424,7 +458,8 @@ async function isManagedRemovedSkillPath(ownerRoot, dir, name) {
424
458
  if (!skillInspection.exists || skillInspection.leafSymlink || !skillInspection.stat?.isFile())
425
459
  return false;
426
460
  const text = await fsp.readFile(skillPath, 'utf8');
427
- return isGeneratedRemovedSksSkill(text, name);
461
+ return MANAGED_SKILL_MARKER_RE.test(text)
462
+ && await managedSkillDirectoryContainsOnlyOwnedFiles(ownerRoot, dir);
428
463
  }
429
464
  async function confinedPathStillExists(ownerRoot, targetPath, errors, displayPath) {
430
465
  try {
@@ -551,7 +586,7 @@ function scrubRemovedSkillManifest(fileName, parsed) {
551
586
  return { valid: false, changed: false, hasRetiredResidue, next: parsed };
552
587
  }
553
588
  if (fileName === SKS_SKILL_MANIFEST_FILE) {
554
- if (parsed.generated_by !== 'sneakoscope' || !Array.isArray(parsed.skills) || !Array.isArray(parsed.files)) {
589
+ if (!isSksOwnedReservedSkillManifest(fileName, parsed)) {
555
590
  return { valid: false, changed: false, hasRetiredResidue, next: parsed };
556
591
  }
557
592
  const next = {
@@ -566,7 +601,7 @@ function scrubRemovedSkillManifest(fileName, parsed) {
566
601
  next
567
602
  };
568
603
  }
569
- if (parsed.schema !== PACKAGED_SKILLS_MANIFEST_SCHEMA || !Array.isArray(parsed.skills)) {
604
+ if (!isSksOwnedReservedSkillManifest(fileName, parsed)) {
570
605
  return { valid: false, changed: false, hasRetiredResidue, next: parsed };
571
606
  }
572
607
  const next = normalizeSkillsManifest(parsed);
@@ -602,16 +637,6 @@ function generatedFileReferencesRemovedSkill(value) {
602
637
  function nodeErrorCode(error) {
603
638
  return error && typeof error === 'object' && 'code' in error ? String(error.code) : '';
604
639
  }
605
- function isGeneratedRemovedSksSkill(text, name) {
606
- if (typeof text !== 'string')
607
- return false;
608
- if (MANAGED_SKILL_MARKER_RE.test(text))
609
- return true;
610
- const declared = /^name:\s*(.+)\s*$/m.exec(text)?.[1]?.trim() || '';
611
- if (canonicalSkillNameFromValue(declared) !== canonicalSkillNameFromValue(name))
612
- return false;
613
- return isGeneratedSksAgentSkill(text, declared) || isGeneratedSksLegacySkill(text, declared);
614
- }
615
640
  export async function reconcileSkills(opts) {
616
641
  const targetDir = path.resolve(opts.targetDir);
617
642
  const root = rootFromSkillsDir(targetDir);
@@ -683,12 +708,12 @@ export async function reconcileSkills(opts) {
683
708
  report.warnings.push(`skill_target_prepare_failed:${publicPathError(error, targetDir)}`);
684
709
  return report;
685
710
  }
686
- const existing = await listSkillDirs(targetDir);
711
+ const existing = await listSkillDirs(targetDir, { includeUnsafeEntries: opts.scope === 'project' });
687
712
  if (opts.scope === 'project') {
688
713
  await reconcileProjectSkillEntries(root, targetDir, existing, officialNames, aliasNames, removedNames, report, opts.fix);
689
714
  const legacyCodexSkillsDir = path.join(root, '.codex', 'skills');
690
715
  if (path.resolve(legacyCodexSkillsDir) !== targetDir) {
691
- const legacyEntries = await listSkillDirs(legacyCodexSkillsDir);
716
+ const legacyEntries = await listSkillDirs(legacyCodexSkillsDir, { includeUnsafeEntries: true });
692
717
  if (legacyEntries.length)
693
718
  await reconcileProjectSkillEntries(root, legacyCodexSkillsDir, legacyEntries, officialNames, aliasNames, removedNames, report, opts.fix);
694
719
  await removeDirIfEmpty(legacyCodexSkillsDir);
@@ -732,6 +757,8 @@ export async function reconcileSkills(opts) {
732
757
  report.installed_skills = install?.installed_skills || [...report.installed];
733
758
  report.generated_files = install?.generated_files || generatedSkillFiles(report.installed_skills);
734
759
  report.core_skill_integrity = install?.core_skill_integrity || { ok: true, installed_count: 0, restored_count: 0, user_collision_count: 0 };
760
+ report.quarantined_user_collisions.push(...(install?.quarantined_user_collisions || []));
761
+ report.quarantined_manifest_collisions = [...new Set(install?.quarantined_manifest_collisions || [])].sort();
735
762
  report.removed_stale_generated_skills = currentSurfaceSkillPaths(install?.removed_stale_generated_skills || report.removed);
736
763
  report.removed_agent_skill_aliases = currentSurfaceSkillPaths(install?.removed_agent_skill_aliases || []);
737
764
  report.removed_codex_skill_mirrors = currentSurfaceSkillPaths(install?.removed_codex_skill_mirrors || []);
@@ -746,22 +773,23 @@ function currentSurfaceSkillPaths(values) {
746
773
  return !segments.some((segment) => REMOVED_SKS_SKILL_NAME_SET.has(segment));
747
774
  }))).sort();
748
775
  }
749
- function looksGeneratedOfficialSkill(text) {
750
- return /Sneakoscope|SKS|Codex App pipeline activation|Dollar-command route|Context tracking|Honest Mode|Route:/i.test(String(text || ''));
751
- }
752
- function isSksManagedOrGeneratedOfficialSkill(text) {
753
- return MANAGED_SKILL_MARKER_RE.test(String(text || '')) || looksGeneratedOfficialSkill(text);
776
+ function isSksManagedOfficialSkill(text) {
777
+ return MANAGED_SKILL_MARKER_RE.test(String(text || ''));
754
778
  }
755
779
  async function reconcileProjectSkillEntries(root, targetDir, entries, officialNames, aliasNames, removedNames, report, fix) {
756
780
  for (const entry of entries) {
757
- const official = officialNames.has(entry.canonical) || aliasNames.has(entry.canonical) || removedNames.has(entry.canonical);
781
+ const directoryCanonical = canonicalSkillNameFromValue(entry.directoryCanonical || entry.name);
782
+ const declaredCanonical = canonicalSkillNameFromValue(entry.declaredCanonical || entry.canonical);
783
+ const candidateNames = [...new Set([directoryCanonical, declaredCanonical].filter(Boolean))];
784
+ const isOfficialName = (name) => (officialNames.has(name) || aliasNames.has(name) || removedNames.has(name));
785
+ const official = candidateNames.some(isOfficialName);
758
786
  const forge = FORGE_SKILL_MARKER_RE.test(entry.text);
759
- const managed = MANAGED_SKILL_MARKER_RE.test(entry.text) || official;
787
+ const managed = MANAGED_SKILL_MARKER_RE.test(entry.text);
760
788
  if (forge) {
761
789
  report.preserved_forge.push(entry.name);
762
790
  continue;
763
791
  }
764
- if (official && !MANAGED_SKILL_MARKER_RE.test(entry.text) && !looksGeneratedOfficialSkill(entry.text)) {
792
+ if (official && !managed) {
765
793
  if (fix)
766
794
  await quarantineSkillDir(root, entry.dir, entry.name, 'project-official-name-user-collision');
767
795
  report.quarantined_user_collisions.push(entry.name);
@@ -769,9 +797,17 @@ async function reconcileProjectSkillEntries(root, targetDir, entries, officialNa
769
797
  continue;
770
798
  }
771
799
  if (managed) {
772
- if (fix)
773
- await removeManagedPathVerified(root, entry.dir);
774
- report.removed.push(path.relative(root, entry.dir).split(path.sep).join('/'));
800
+ if (await managedSkillDirectoryContainsOnlyOwnedFiles(root, entry.dir)) {
801
+ if (fix)
802
+ await removeManagedPathVerified(root, entry.dir);
803
+ report.removed.push(path.relative(root, entry.dir).split(path.sep).join('/'));
804
+ }
805
+ else {
806
+ if (fix)
807
+ await quarantineSkillDir(root, entry.dir, entry.name, 'project-managed-skill-user-content-collision');
808
+ report.quarantined_user_collisions.push(entry.name);
809
+ report.warnings.push(`managed_skill_user_content_quarantined:${entry.name}`);
810
+ }
775
811
  continue;
776
812
  }
777
813
  report.preserved_user.push(entry.name);
@@ -851,6 +887,7 @@ export async function generatePackagedSkillsManifest() {
851
887
  }
852
888
  export async function writePackagedSkillManifest(targetDir, manifest) {
853
889
  const file = path.join(targetDir, 'skills-manifest.json');
890
+ await prepareReservedSkillManifestForWrite(rootFromSkillsDir(targetDir), file, 'skills-manifest.json');
854
891
  await writeJsonAtomic(file, manifest);
855
892
  return file;
856
893
  }
@@ -873,7 +910,7 @@ function buildFallbackSkillsManifest() {
873
910
  }))
874
911
  };
875
912
  }
876
- async function listSkillDirs(targetDir) {
913
+ async function listSkillDirs(targetDir, opts = {}) {
877
914
  const boundary = rootFromSkillsDir(targetDir);
878
915
  let rootInspection;
879
916
  try {
@@ -892,21 +929,53 @@ async function listSkillDirs(targetDir) {
892
929
  const rows = await fsp.readdir(targetDir, { withFileTypes: true });
893
930
  const out = [];
894
931
  for (const row of rows) {
895
- if (row.isSymbolicLink() || !row.isDirectory())
896
- continue;
897
932
  const dir = path.join(targetDir, row.name);
933
+ const directoryCanonical = canonicalSkillNameFromValue(row.name);
934
+ if (row.isSymbolicLink() || !row.isDirectory()) {
935
+ if (opts.includeUnsafeEntries) {
936
+ out.push({
937
+ name: row.name,
938
+ dir,
939
+ skillMdPath: null,
940
+ text: '',
941
+ canonical: directoryCanonical,
942
+ declaredCanonical: '',
943
+ directoryCanonical,
944
+ hash: '',
945
+ unsafeEntry: row.isSymbolicLink() ? 'symlink' : 'non-directory'
946
+ });
947
+ }
948
+ continue;
949
+ }
898
950
  const skillMdPath = path.join(dir, 'SKILL.md');
899
951
  const inspected = await inspectConfinedPath(boundary, skillMdPath);
900
- if (!inspected.exists || inspected.leafSymlink || !inspected.stat?.isFile())
952
+ if (!inspected.exists || inspected.leafSymlink || !inspected.stat?.isFile()) {
953
+ if (opts.includeUnsafeEntries) {
954
+ out.push({
955
+ name: row.name,
956
+ dir,
957
+ skillMdPath,
958
+ text: '',
959
+ canonical: directoryCanonical,
960
+ declaredCanonical: '',
961
+ directoryCanonical,
962
+ hash: '',
963
+ unsafeEntry: inspected.leafSymlink ? 'skill-file-symlink' : 'missing-or-non-file-skill'
964
+ });
965
+ }
901
966
  continue;
967
+ }
902
968
  const text = await fsp.readFile(skillMdPath, 'utf8');
903
969
  const displayName = /^name:\s*(.+)\s*$/m.exec(text)?.[1] || row.name;
970
+ const declaredCanonical = canonicalSkillNameFromValue(displayName);
904
971
  out.push({
905
972
  name: row.name,
906
973
  dir,
907
974
  skillMdPath,
908
975
  text,
909
- canonical: canonicalSkillNameFromValue(displayName),
976
+ canonical: declaredCanonical,
977
+ declaredCanonical,
978
+ directoryCanonical,
910
979
  hash: sha256(text)
911
980
  });
912
981
  }
@@ -923,7 +992,7 @@ function canonicalSkillNameFromValue(value) {
923
992
  return String(value || '').trim().toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
924
993
  }
925
994
  function packageRootDir() {
926
- return path.resolve(path.dirname(new URL(import.meta.url).pathname), '..', '..', '..');
995
+ return path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', '..');
927
996
  }
928
997
  async function pruneProjectGeneratedManifest(targetDir) {
929
998
  await fsp.rm(path.join(targetDir, SKS_SKILL_MANIFEST_FILE), { force: true }).catch(() => undefined);
@@ -945,6 +1014,7 @@ function generatedSkillManifestPath(root) {
945
1014
  }
946
1015
  async function writeGeneratedSkillManifest(root, skillNames) {
947
1016
  const manifestPath = generatedSkillManifestPath(root);
1017
+ await prepareReservedSkillManifestForWrite(root, manifestPath, SKS_SKILL_MANIFEST_FILE);
948
1018
  await writeJsonAtomic(manifestPath, {
949
1019
  schema_version: 1,
950
1020
  generated_by: 'sneakoscope',
@@ -958,9 +1028,10 @@ async function removeStaleGeneratedSkillsFromManifest(root, skillNames) {
958
1028
  const previous = await readJson(generatedSkillManifestPath(root), null);
959
1029
  const previousSkills = Array.isArray(previous?.skills) ? previous.skills : [];
960
1030
  if (!previousSkills.length)
961
- return [];
1031
+ return { removed: [], quarantined: [] };
962
1032
  const current = new Set(skillNames);
963
1033
  const removed = [];
1034
+ const quarantined = [];
964
1035
  for (const name of previousSkills) {
965
1036
  const skillName = String(name || '').trim();
966
1037
  if (!skillName || current.has(skillName) || !/^[a-z0-9-]+$/.test(skillName))
@@ -971,25 +1042,103 @@ async function removeStaleGeneratedSkillsFromManifest(root, skillNames) {
971
1042
  if (!(await exists(dir)))
972
1043
  continue;
973
1044
  const text = await readText(path.join(dir, 'SKILL.md'), null);
974
- if (!isSksManagedOrGeneratedOfficialSkill(String(text || '')))
1045
+ if (!isSksManagedOfficialSkill(String(text || '')))
975
1046
  continue;
976
- await fsp.rm(dir, { recursive: true, force: true });
1047
+ if (!(await managedSkillDirectoryContainsOnlyOwnedFiles(root, dir))) {
1048
+ await quarantineSkillDir(root, dir, skillName, 'stale-generated-skill-user-content-collision');
1049
+ quarantined.push(skillName);
1050
+ continue;
1051
+ }
1052
+ await removeManagedPathVerified(root, dir);
977
1053
  removed.push(path.relative(root, dir));
978
1054
  }
979
- return removed.sort();
1055
+ return { removed: removed.sort(), quarantined: quarantined.sort() };
1056
+ }
1057
+ async function managedSkillDirectoryContainsOnlyOwnedFiles(root, dir) {
1058
+ const dirInspection = await inspectConfinedPath(root, dir);
1059
+ if (!dirInspection.exists || dirInspection.leafSymlink || !dirInspection.stat?.isDirectory())
1060
+ return false;
1061
+ const rootEntries = await fsp.readdir(dir, { withFileTypes: true });
1062
+ if (rootEntries.some((entry) => !['SKILL.md', 'agents'].includes(entry.name)))
1063
+ return false;
1064
+ const skillEntry = rootEntries.find((entry) => entry.name === 'SKILL.md');
1065
+ const agentsEntry = rootEntries.find((entry) => entry.name === 'agents');
1066
+ if (!skillEntry?.isFile())
1067
+ return false;
1068
+ if (!agentsEntry)
1069
+ return true;
1070
+ if (!agentsEntry.isDirectory())
1071
+ return false;
1072
+ const agentsDir = path.join(dir, 'agents');
1073
+ const agentsInspection = await inspectConfinedPath(root, agentsDir);
1074
+ if (!agentsInspection.exists || agentsInspection.leafSymlink || !agentsInspection.stat?.isDirectory())
1075
+ return false;
1076
+ const agentEntries = await fsp.readdir(agentsDir, { withFileTypes: true });
1077
+ return agentEntries.length === 0 || (agentEntries.length === 1
1078
+ && agentEntries[0]?.name === 'openai.yaml'
1079
+ && agentEntries[0].isFile());
1080
+ }
1081
+ async function prepareReservedSkillManifestsForWrite(root) {
1082
+ const skillRoot = path.join(root, '.agents', 'skills');
1083
+ const quarantined = [];
1084
+ for (const fileName of [SKS_SKILL_MANIFEST_FILE, 'skills-manifest.json']) {
1085
+ if (await prepareReservedSkillManifestForWrite(root, path.join(skillRoot, fileName), fileName)) {
1086
+ quarantined.push(fileName);
1087
+ }
1088
+ }
1089
+ return quarantined;
1090
+ }
1091
+ async function prepareReservedSkillManifestForWrite(root, manifestPath, fileName) {
1092
+ const inspection = await inspectConfinedPath(root, manifestPath);
1093
+ if (!inspection.exists)
1094
+ return false;
1095
+ if (!inspection.leafSymlink && inspection.stat?.isFile()) {
1096
+ try {
1097
+ const parsed = JSON.parse(await fsp.readFile(manifestPath, 'utf8'));
1098
+ if (isSksOwnedReservedSkillManifest(fileName, parsed))
1099
+ return false;
1100
+ }
1101
+ catch {
1102
+ }
1103
+ }
1104
+ await quarantineSkillDir(root, manifestPath, fileName, 'reserved-skill-manifest-user-collision');
1105
+ return true;
1106
+ }
1107
+ function isSksOwnedReservedSkillManifest(fileName, parsed) {
1108
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
1109
+ return false;
1110
+ if (fileName === SKS_SKILL_MANIFEST_FILE) {
1111
+ return parsed.schema_version === 1
1112
+ && parsed.generated_by === 'sneakoscope'
1113
+ && parsed.prune_policy === GENERATED_PRUNE_POLICY
1114
+ && Array.isArray(parsed.skills)
1115
+ && Array.isArray(parsed.files);
1116
+ }
1117
+ return fileName === 'skills-manifest.json'
1118
+ && parsed.schema === PACKAGED_SKILLS_MANIFEST_SCHEMA
1119
+ && typeof parsed.package_version === 'string'
1120
+ && Array.isArray(parsed.skills)
1121
+ && parsed.skills.every((skill) => (skill
1122
+ && typeof skill === 'object'
1123
+ && !Array.isArray(skill)
1124
+ && typeof skill.canonical_name === 'string'
1125
+ && ['core', 'official'].includes(skill.type)
1126
+ && typeof skill.content_sha256 === 'string'
1127
+ && Array.isArray(skill.hash_history)
1128
+ && Array.isArray(skill.deprecated_aliases)));
980
1129
  }
981
1130
  async function removeGeneratedPluginSkillCollisions(root) {
982
1131
  const removed = [];
1132
+ const quarantined = [];
983
1133
  for (const name of RESERVED_CODEX_PLUGIN_SKILL_NAMES) {
984
1134
  const dir = path.join(root, '.agents', 'skills', name);
985
- const skillPath = path.join(dir, 'SKILL.md');
986
- const text = await readText(skillPath, null);
987
- if (!isGeneratedSksPluginCollisionSkill(text, name))
988
- continue;
989
- await fsp.rm(dir, { recursive: true, force: true });
990
- removed.push(path.relative(root, dir));
1135
+ const action = await cleanupGeneratedSkillResidue(root, dir, name, (text) => isGeneratedSksPluginCollisionSkill(text, name), 'generated-plugin-skill-user-content-collision');
1136
+ if (action === 'removed')
1137
+ removed.push(path.relative(root, dir));
1138
+ if (action === 'quarantined')
1139
+ quarantined.push(name);
991
1140
  }
992
- return removed.sort();
1141
+ return { removed: removed.sort(), quarantined: quarantined.sort() };
993
1142
  }
994
1143
  function isGeneratedSksPluginCollisionSkill(text, name) {
995
1144
  if (typeof text !== 'string')
@@ -1042,8 +1191,9 @@ async function writeSkillMetadata(root, dir, name) {
1042
1191
  async function removeGeneratedCodexSkillMirrors(root, skillNames) {
1043
1192
  const legacyRoot = path.join(root, '.codex', 'skills');
1044
1193
  if (!(await exists(legacyRoot)))
1045
- return [];
1194
+ return { removed: [], quarantined: [] };
1046
1195
  const removed = [];
1196
+ const quarantined = [];
1047
1197
  const names = Array.from(new Set([
1048
1198
  ...skillNames,
1049
1199
  ...DOLLAR_COMMANDS.map((c) => c.command.slice(1)),
@@ -1055,16 +1205,15 @@ async function removeGeneratedCodexSkillMirrors(root, skillNames) {
1055
1205
  ]));
1056
1206
  for (const name of names) {
1057
1207
  const dir = path.join(legacyRoot, name);
1058
- const skillPath = path.join(dir, 'SKILL.md');
1059
- const text = await readText(skillPath, null);
1060
- if (!isGeneratedSksLegacySkill(text, name))
1061
- continue;
1062
- await fsp.rm(dir, { recursive: true, force: true });
1063
- removed.push(path.relative(root, dir));
1208
+ const action = await cleanupGeneratedSkillResidue(root, dir, String(name), (text) => isGeneratedSksLegacySkill(text, name), 'generated-codex-skill-user-content-collision');
1209
+ if (action === 'removed')
1210
+ removed.push(path.relative(root, dir));
1211
+ if (action === 'quarantined')
1212
+ quarantined.push(String(name));
1064
1213
  }
1065
1214
  await removeDirIfEmpty(legacyRoot);
1066
1215
  await removeDirIfEmpty(path.join(root, '.agents'));
1067
- return removed;
1216
+ return { removed: removed.sort(), quarantined: quarantined.sort() };
1068
1217
  }
1069
1218
  async function removeGeneratedAgentSkillAliases(root, skillNames) {
1070
1219
  const current = new Set(skillNames);
@@ -1078,18 +1227,40 @@ async function removeGeneratedAgentSkillAliases(root, skillNames) {
1078
1227
  'ralph-resolver'
1079
1228
  ];
1080
1229
  const removed = [];
1230
+ const quarantined = [];
1081
1231
  for (const name of obsolete) {
1082
1232
  if (current.has(name))
1083
1233
  continue;
1084
1234
  const dir = path.join(root, '.agents', 'skills', name);
1085
- const skillPath = path.join(dir, 'SKILL.md');
1086
- const text = await readText(skillPath, null);
1087
- if (!isGeneratedSksAgentSkill(text, name))
1088
- continue;
1089
- await fsp.rm(dir, { recursive: true, force: true });
1090
- removed.push(path.relative(root, dir));
1235
+ const action = await cleanupGeneratedSkillResidue(root, dir, name, (text) => isGeneratedSksAgentSkill(text, name), 'generated-agent-skill-user-content-collision');
1236
+ if (action === 'removed')
1237
+ removed.push(path.relative(root, dir));
1238
+ if (action === 'quarantined')
1239
+ quarantined.push(name);
1240
+ }
1241
+ return { removed: removed.sort(), quarantined: quarantined.sort() };
1242
+ }
1243
+ async function cleanupGeneratedSkillResidue(root, dir, name, isOwnedText, quarantineReason) {
1244
+ const dirInspection = await inspectConfinedPath(root, dir);
1245
+ if (!dirInspection.exists || dirInspection.leafSymlink || !dirInspection.stat?.isDirectory())
1246
+ return 'preserved';
1247
+ const skillPath = path.join(dir, 'SKILL.md');
1248
+ const skillInspection = await inspectConfinedPath(root, skillPath);
1249
+ if (!skillInspection.exists || skillInspection.leafSymlink || !skillInspection.stat?.isFile())
1250
+ return 'preserved';
1251
+ const text = await fsp.readFile(skillPath, 'utf8');
1252
+ if (!isOwnedText(text))
1253
+ return 'preserved';
1254
+ if (!MANAGED_SKILL_MARKER_RE.test(text)) {
1255
+ await quarantineSkillDir(root, dir, name, quarantineReason);
1256
+ return 'quarantined';
1257
+ }
1258
+ if (!(await managedSkillDirectoryContainsOnlyOwnedFiles(root, dir))) {
1259
+ await quarantineSkillDir(root, dir, name, quarantineReason);
1260
+ return 'quarantined';
1091
1261
  }
1092
- return removed;
1262
+ await removeManagedPathVerified(root, dir);
1263
+ return 'removed';
1093
1264
  }
1094
1265
  function isGeneratedSksAgentSkill(text, name) {
1095
1266
  if (!text)
@@ -1135,8 +1306,10 @@ export function currentGeneratedFileInventory(skillInstall = {}, agentInstall =
1135
1306
  '.sneakoscope/harness-guard.json',
1136
1307
  '.sneakoscope/db-safety.json',
1137
1308
  '.sneakoscope/policy.json',
1138
- '.agents/skills/.sks-generated.json',
1139
- ...(Array.isArray(skillInstall.generated_files) ? skillInstall.generated_files : []),
1309
+ ...(opts.includeSkillFiles === false ? [] : [
1310
+ '.agents/skills/.sks-generated.json',
1311
+ ...(Array.isArray(skillInstall.generated_files) ? skillInstall.generated_files : [])
1312
+ ]),
1140
1313
  ...(Array.isArray(agentInstall.generated_files) ? agentInstall.generated_files : [])
1141
1314
  ])).sort();
1142
1315
  }
@@ -1169,11 +1342,11 @@ function normalizeGeneratedRelPath(value) {
1169
1342
  }
1170
1343
  function isPrunableGeneratedPath(rel) {
1171
1344
  if (rel.startsWith('.agents/skills/'))
1172
- return true;
1345
+ return false;
1173
1346
  if (rel.startsWith('.codex/agents/'))
1174
1347
  return false;
1175
1348
  if (rel.startsWith('.codex/skills/'))
1176
- return true;
1349
+ return false;
1177
1350
  return new Set([
1178
1351
  '.codex/SNEAKOSCOPE.md',
1179
1352
  '.codex/hooks.json',