sneakoscope 7.3.0 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/README.md +129 -10
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/dist/cli/codex-app-command.js +1 -1
  5. package/dist/cli/command-manifest-lite.js +4 -1
  6. package/dist/cli/command-registry.js +2 -0
  7. package/dist/cli/install-helpers-codex-lb-chain.js +42 -0
  8. package/dist/cli/install-helpers-codex-lb-config.js +114 -9
  9. package/dist/cli/install-helpers-install-support.js +6 -16
  10. package/dist/cli/install-helpers.js +788 -600
  11. package/dist/cli/router.js +30 -2
  12. package/dist/commands/codex-app.js +37 -1
  13. package/dist/commands/codex-lb.js +491 -300
  14. package/dist/config/skills-manifest.json +57 -71
  15. package/dist/core/align/align-route.js +127 -0
  16. package/dist/core/codex-app/codex-app-fast-ui-repair.js +8 -4
  17. package/dist/core/codex-app/codex-app-restart.js +83 -0
  18. package/dist/core/codex-app/codex-app-ui-state-snapshot.js +8 -4
  19. package/dist/core/codex-app/desktop-routing-snapshot.js +1 -1
  20. package/dist/core/codex-app/menubar/constants.js +5 -0
  21. package/dist/core/codex-app/menubar/generation-transaction-journal.js +1 -3
  22. package/dist/core/codex-app/menubar/installer.js +18 -0
  23. package/dist/core/codex-app/multi-provider-router.js +22 -10
  24. package/dist/core/codex-app/openrouter-activate.js +26 -1
  25. package/dist/core/codex-app.js +118 -26
  26. package/dist/core/codex-control/codex-app-server-runtime-env.js +86 -0
  27. package/dist/core/codex-control/codex-app-server-v2-client.js +78 -8
  28. package/dist/core/codex-control/codex-task-runner.js +2 -2
  29. package/dist/core/codex-lb/capability-runner.js +204 -0
  30. package/dist/core/codex-lb/capability-types.js +1 -0
  31. package/dist/core/codex-lb/codex-lb-env.js +9 -13
  32. package/dist/core/codex-lb/codex-lb-setup.js +45 -8
  33. package/dist/core/codex-lb/codex-lb-tool-catalog.js +52 -74
  34. package/dist/core/codex-lb/codex-lb-tool-output-recovery.js +1 -1
  35. package/dist/core/codex-lb/desktop-auth-invariant.js +185 -0
  36. package/dist/core/codex-lb/desktop-bridge/client.js +34 -0
  37. package/dist/core/codex-lb/desktop-bridge/header-policy.js +106 -0
  38. package/dist/core/codex-lb/desktop-bridge/http-forward.js +101 -0
  39. package/dist/core/codex-lb/desktop-bridge/index.js +10 -0
  40. package/dist/core/codex-lb/desktop-bridge/launchd.js +81 -0
  41. package/dist/core/codex-lb/desktop-bridge/location-rewrite.js +27 -0
  42. package/dist/core/codex-lb/desktop-bridge/security.js +274 -0
  43. package/dist/core/codex-lb/desktop-bridge/server.js +179 -0
  44. package/dist/core/codex-lb/desktop-bridge/state.js +119 -0
  45. package/dist/core/codex-lb/desktop-bridge/types.js +16 -0
  46. package/dist/core/codex-lb/desktop-bridge/websocket-forward.js +151 -0
  47. package/dist/core/codex-lb/desktop-center-credentials.js +189 -0
  48. package/dist/core/codex-lb/desktop-controller.js +1410 -0
  49. package/dist/core/codex-lb/desktop-mode.js +32 -0
  50. package/dist/core/codex-lb/desktop-real-evidence.js +168 -0
  51. package/dist/core/codex-lb/desktop-service.js +613 -0
  52. package/dist/core/codex-lb/legacy-migration.js +575 -0
  53. package/dist/core/codex-lb/migration-receipt.js +246 -0
  54. package/dist/core/codex-lb/probes/auxiliary-surfaces-probe.js +60 -0
  55. package/dist/core/codex-lb/probes/bridge-probe.js +75 -0
  56. package/dist/core/codex-lb/probes/catalog-probe.js +128 -0
  57. package/dist/core/codex-lb/probes/computer-use-probe.js +50 -0
  58. package/dist/core/codex-lb/probes/image-generation-probe.js +47 -0
  59. package/dist/core/codex-lb/probes/probe-evidence.js +39 -0
  60. package/dist/core/codex-lb/probes/voice-realtime-probe.js +44 -0
  61. package/dist/core/codex-lb/trusted-deep-evidence.js +403 -0
  62. package/dist/core/codex-native/core-skill-manifest.js +22 -6
  63. package/dist/core/codex-runtime/codex-desktop-config-policy.js +2 -1
  64. package/dist/core/commands/align-command.js +220 -0
  65. package/dist/core/commands/image-ux-review-command.js +280 -68
  66. package/dist/core/commands/naruto-command.js +257 -8
  67. package/dist/core/commands/ppt-command.js +2 -2
  68. package/dist/core/commands/telegram-command.js +402 -34
  69. package/dist/core/commands/triwiki-command.js +11 -1
  70. package/dist/core/commands/triwiki-graph-command.js +160 -0
  71. package/dist/core/commands/wiki-command.js +100 -20
  72. package/dist/core/doctor/skill-legacy-surface.js +1 -3
  73. package/dist/core/errors/message.js +3 -0
  74. package/dist/core/evidence/evidence-freshness.js +14 -0
  75. package/dist/core/feature-fixtures.js +9 -1
  76. package/dist/core/feature-registry.js +5 -3
  77. package/dist/core/fsx.js +7 -3
  78. package/dist/core/hooks-runtime/codex-commit-hooks-selftest.js +82 -0
  79. package/dist/core/hooks-runtime/context-graph-freshness-preflight.js +113 -0
  80. package/dist/core/hooks-runtime/hook-context.js +15 -2
  81. package/dist/core/hooks-runtime/managed-skill-generation-heal.js +46 -0
  82. package/dist/core/hooks-runtime/naruto-terminal-finalization.js +1 -0
  83. package/dist/core/hooks-runtime/official-subagent-lifecycle.js +1 -1
  84. package/dist/core/hooks-runtime/tool-output-quarantine.js +1 -1
  85. package/dist/core/hooks-runtime.js +33 -89
  86. package/dist/core/image-ux-review/callout-extraction.js +6 -0
  87. package/dist/core/image-ux-review/imagegen-adapter.js +64 -23
  88. package/dist/core/image-ux-review/real-callout-extractor.js +1 -0
  89. package/dist/core/image-ux-review.js +230 -12
  90. package/dist/core/imagegen/codex-lb-imagegen-target.js +21 -7
  91. package/dist/core/imagegen/imagegen-capability.js +10 -4
  92. package/dist/core/imagegen/require-imagegen.js +29 -5
  93. package/dist/core/init/skills.js +25 -13
  94. package/dist/core/init.js +1 -1
  95. package/dist/core/install/installed-package-smoke.js +157 -4
  96. package/dist/core/managed-assets/managed-assets-manifest.js +2 -1
  97. package/dist/core/managed-path-safety.js +8 -10
  98. package/dist/core/mcp-config/backup.js +2 -4
  99. package/dist/core/mcp-config/config-reader.js +2 -4
  100. package/dist/core/mcp-config/scope.js +3 -5
  101. package/dist/core/naruto/context-graph-advisor-scope.js +242 -0
  102. package/dist/core/naruto/context-graph-advisor.js +0 -0
  103. package/dist/core/perf/release-latency-slo.js +12 -6
  104. package/dist/core/pipeline-internals/runtime-core.js +78 -0
  105. package/dist/core/pipeline-internals/runtime-gates.js +5 -2
  106. package/dist/core/policy/latest-version-guidance.js +113 -0
  107. package/dist/core/ppt.js +8 -8
  108. package/dist/core/preflight/parallel-preflight-engine.js +1 -1
  109. package/dist/core/proof/auto-finalize.js +98 -6
  110. package/dist/core/proof/route-proof-gate.js +12 -1
  111. package/dist/core/proof/route-proof-policy.js +8 -8
  112. package/dist/core/release/gate-manifest.js +32 -1
  113. package/dist/core/release/npm-stage-contract.js +21 -0
  114. package/dist/core/release/package-size-budget.js +2 -2
  115. package/dist/core/release/release-gate-contract.js +5 -0
  116. package/dist/core/release/release-proof-io.js +1 -3
  117. package/dist/core/release/release-real-contract.js +5 -4
  118. package/dist/core/release/release-stamp-proof.js +1 -3
  119. package/dist/core/release/stage-publish.js +27 -0
  120. package/dist/core/remote/audit-idempotency.js +50 -18
  121. package/dist/core/remote/codex-public-activity.js +283 -0
  122. package/dist/core/remote/index.js +1 -0
  123. package/dist/core/remote/ssh-worker-client.js +4 -1
  124. package/dist/core/remote/worker.js +206 -27
  125. package/dist/core/research/research-adversarial-review.js +1 -3
  126. package/dist/core/research/research-claim-synthesizer.js +1 -3
  127. package/dist/core/research/research-falsification-runner.js +1 -3
  128. package/dist/core/research/research-source-evidence.js +1 -3
  129. package/dist/core/responses-stream.js +65 -19
  130. package/dist/core/routes/constants.js +1 -1
  131. package/dist/core/routes/design-policy.js +7 -2
  132. package/dist/core/routes/dollar-manifest-lite.js +2 -4
  133. package/dist/core/routes/evidence.js +1 -1
  134. package/dist/core/routes.js +30 -10
  135. package/dist/core/safety/command-contract/contracts.js +2 -0
  136. package/dist/core/safety/command-contract/types.js +1 -1
  137. package/dist/core/search/context-graph-seeds.js +205 -0
  138. package/dist/core/search/context.js +0 -0
  139. package/dist/core/search/provider.js +2 -2
  140. package/dist/core/secret-redaction.js +6 -0
  141. package/dist/core/subagents/naruto-help-contract.js +2 -1
  142. package/dist/core/subagents/naruto-host-credentials.js +161 -0
  143. package/dist/core/subagents/official-subagent-preparation.js +4 -1
  144. package/dist/core/subagents/official-subagent-prompt.js +44 -2
  145. package/dist/core/subagents/official-subagent-runner.js +26 -8
  146. package/dist/core/subagents/triwiki-attention.js +135 -123
  147. package/dist/core/telegram/bot-api.js +85 -10
  148. package/dist/core/telegram/center-snapshot.js +718 -0
  149. package/dist/core/telegram/config.js +158 -31
  150. package/dist/core/telegram/hub.js +288 -33
  151. package/dist/core/telegram/index.js +2 -0
  152. package/dist/core/telegram/ingress-spool.js +419 -0
  153. package/dist/core/telegram/ledgers.js +188 -29
  154. package/dist/core/telegram/messages.js +26 -6
  155. package/dist/core/telegram/owner-lock.js +10 -7
  156. package/dist/core/telegram/runtime-projection.js +38 -3
  157. package/dist/core/telegram/runtime.js +298 -63
  158. package/dist/core/telegram/service.js +137 -8
  159. package/dist/core/telegram/setup.js +291 -73
  160. package/dist/core/text/strings.js +3 -0
  161. package/dist/core/triwiki/code-pack.js +12 -120
  162. package/dist/core/triwiki/context-graph/compiler/cache-key.js +277 -0
  163. package/dist/core/triwiki/context-graph/compiler/extract.js +104 -0
  164. package/dist/core/triwiki/context-graph/compiler/freshness.js +108 -0
  165. package/dist/core/triwiki/context-graph/compiler/index.js +237 -0
  166. package/dist/core/triwiki/context-graph/compiler/merge.js +0 -0
  167. package/dist/core/triwiki/context-graph/compiler/serialize.js +115 -0
  168. package/dist/core/triwiki/context-graph/contracts.js +236 -0
  169. package/dist/core/triwiki/context-graph/extractors/code/builders.js +150 -0
  170. package/dist/core/triwiki/context-graph/extractors/code/declarations.js +161 -0
  171. package/dist/core/triwiki/context-graph/extractors/code/index.js +265 -0
  172. package/dist/core/triwiki/context-graph/extractors/code/inventory.js +237 -0
  173. package/dist/core/triwiki/context-graph/extractors/code/module-graph.js +252 -0
  174. package/dist/core/triwiki/context-graph/extractors/code/modules.js +79 -0
  175. package/dist/core/triwiki/context-graph/extractors/code/references.js +184 -0
  176. package/dist/core/triwiki/context-graph/extractors/code/selection.js +100 -0
  177. package/dist/core/triwiki/context-graph/extractors/code/ts-config.js +161 -0
  178. package/dist/core/triwiki/context-graph/extractors/code/types.js +18 -0
  179. package/dist/core/triwiki/context-graph/extractors/evidence/claims.js +289 -0
  180. package/dist/core/triwiki/context-graph/extractors/evidence/index.js +54 -0
  181. package/dist/core/triwiki/context-graph/extractors/evidence/proof-index.js +213 -0
  182. package/dist/core/triwiki/context-graph/extractors/evidence/proofs.js +266 -0
  183. package/dist/core/triwiki/context-graph/extractors/evidence/redaction.js +177 -0
  184. package/dist/core/triwiki/context-graph/extractors/evidence/shared.js +0 -0
  185. package/dist/core/triwiki/context-graph/extractors/evidence/sources.js +154 -0
  186. package/dist/core/triwiki/context-graph/extractors/index.js +7 -0
  187. package/dist/core/triwiki/context-graph/extractors/topology/commands.js +207 -0
  188. package/dist/core/triwiki/context-graph/extractors/topology/gate-edges.js +201 -0
  189. package/dist/core/triwiki/context-graph/extractors/topology/gates.js +182 -0
  190. package/dist/core/triwiki/context-graph/extractors/topology/globs.js +124 -0
  191. package/dist/core/triwiki/context-graph/extractors/topology/index.js +92 -0
  192. package/dist/core/triwiki/context-graph/extractors/topology/routes.js +135 -0
  193. package/dist/core/triwiki/context-graph/extractors/topology/shared.js +215 -0
  194. package/dist/core/triwiki/context-graph/graph-index.js +143 -0
  195. package/dist/core/triwiki/context-graph/ids.js +0 -0
  196. package/dist/core/triwiki/context-graph/lint/index.js +0 -0
  197. package/dist/core/triwiki/context-graph/lint/rules.js +232 -0
  198. package/dist/core/triwiki/context-graph/lint/warnings.js +93 -0
  199. package/dist/core/triwiki/context-graph/paths.js +116 -0
  200. package/dist/core/triwiki/context-graph/profiles.js +78 -0
  201. package/dist/core/triwiki/context-graph/projections/anchors.js +91 -0
  202. package/dist/core/triwiki/context-graph/projections/attention.js +58 -0
  203. package/dist/core/triwiki/context-graph/projections/code-pack-workspace.js +62 -0
  204. package/dist/core/triwiki/context-graph/projections/code-pack.js +144 -0
  205. package/dist/core/triwiki/context-graph/projections/index.js +7 -0
  206. package/dist/core/triwiki/context-graph/projections/module-view.js +140 -0
  207. package/dist/core/triwiki/context-graph/projections/node-summary.js +118 -0
  208. package/dist/core/triwiki/context-graph/projections/pack-contract.js +6 -0
  209. package/dist/core/triwiki/context-graph/query/explain.js +0 -0
  210. package/dist/core/triwiki/context-graph/query/index.js +178 -0
  211. package/dist/core/triwiki/context-graph/query/load.js +116 -0
  212. package/dist/core/triwiki/context-graph/query/pack.js +117 -0
  213. package/dist/core/triwiki/context-graph/query/rank.js +142 -0
  214. package/dist/core/triwiki/context-graph/query/ranking-config.js +64 -0
  215. package/dist/core/triwiki/context-graph/query/seeds.js +241 -0
  216. package/dist/core/triwiki/context-graph/query/snapshot-cache.js +72 -0
  217. package/dist/core/triwiki/context-graph/query/traverse.js +154 -0
  218. package/dist/core/triwiki/context-graph/query-types.js +29 -0
  219. package/dist/core/triwiki/context-graph/store/compile-lock.js +21 -0
  220. package/dist/core/triwiki/context-graph/store/event-log.js +48 -0
  221. package/dist/core/triwiki/context-graph/store/fragment-cache.js +85 -0
  222. package/dist/core/triwiki/context-graph/store/graph-status.js +85 -0
  223. package/dist/core/triwiki/context-graph/store/snapshot-store.js +155 -0
  224. package/dist/core/triwiki/triwiki-proof-bank-index-repair.js +115 -0
  225. package/dist/core/triwiki/triwiki-proof-bank-index-store.js +290 -0
  226. package/dist/core/triwiki/triwiki-proof-bank-index.js +126 -0
  227. package/dist/core/triwiki/triwiki-proof-bank.js +7 -1
  228. package/dist/core/verification/context-graph-affected.js +271 -0
  229. package/dist/core/version.js +1 -1
  230. package/dist/native/sks-menubar/Sources/AlertFactory.swift +11 -3
  231. package/dist/native/sks-menubar/Sources/AppDelegate.swift +9 -0
  232. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +25 -3
  233. package/dist/native/sks-menubar/Sources/ControlKit.swift +19 -8
  234. package/dist/native/sks-menubar/Sources/DiagnosticsViewController.swift +1 -2
  235. package/dist/native/sks-menubar/Sources/MCPServersViewController.swift +45 -17
  236. package/dist/native/sks-menubar/Sources/OverviewSummary.swift +162 -0
  237. package/dist/native/sks-menubar/Sources/OverviewViewController.swift +136 -190
  238. package/dist/native/sks-menubar/Sources/ProcessClient.swift +107 -11
  239. package/dist/native/sks-menubar/Sources/ProvidersMultiProvider.swift +5 -1
  240. package/dist/native/sks-menubar/Sources/ProvidersOpenRouter.swift +16 -4
  241. package/dist/native/sks-menubar/Sources/ProvidersRoleModels.swift +4 -1
  242. package/dist/native/sks-menubar/Sources/ProvidersRoutingTruth.swift +131 -0
  243. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +288 -341
  244. package/dist/native/sks-menubar/Sources/RemoteTelegramCenterState.swift +447 -0
  245. package/dist/native/sks-menubar/Sources/RemoteTelegramRendering.swift +484 -0
  246. package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +364 -115
  247. package/dist/native/sks-menubar/Sources/SettingsViewController.swift +73 -12
  248. package/dist/native/sks-menubar/Sources/SidebarItem.swift +3 -3
  249. package/dist/native/sks-menubar/Sources/StatusItemController.swift +13 -13
  250. package/dist/native/sks-menubar/Sources/TelegramHubSupervisor.swift +469 -0
  251. package/dist/native/sks-menubar/Sources/UpdatesViewController.swift +1 -6
  252. package/dist/native/sks-menubar/Tests/AppRuntimeTestSupport.swift +12 -0
  253. package/dist/native/sks-menubar/Tests/NativeTelegramRegressionRunner.swift +55 -0
  254. package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +33 -0
  255. package/dist/native/sks-menubar/Tests/ProvidersViewControllerTests.swift +142 -0
  256. package/dist/native/sks-menubar/Tests/RemoteTelegramCenterStateTests.swift +56 -0
  257. package/dist/native/sks-menubar/Tests/TelegramHubSupervisorTests.swift +55 -0
  258. package/dist/scripts/codex-lb-catalog-passthrough-check.js +120 -0
  259. package/dist/scripts/codex-lb-desktop-auth-invariant-check.js +169 -0
  260. package/dist/scripts/codex-lb-desktop-bridge-check.js +394 -0
  261. package/dist/scripts/codex-lb-desktop-bridge-latency-check.js +196 -0
  262. package/dist/scripts/codex-lb-desktop-capabilities-check.js +287 -0
  263. package/dist/scripts/codex-lb-desktop-real-evidence-check.js +123 -0
  264. package/dist/scripts/codex-lb-fast-mode-truth-check.js +10 -3
  265. package/dist/scripts/codex-lb-fast-ui-preservation-check.js +81 -40
  266. package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +99 -37
  267. package/dist/scripts/context-graph-check.js +191 -0
  268. package/dist/scripts/doctor-fixes-codex-app-fast-ui-check.js +1 -1
  269. package/dist/scripts/gate-policy-audit-check.js +1 -1
  270. package/dist/scripts/helper-dedup-check.js +0 -2
  271. package/dist/scripts/installed-package-smoke-check.js +4 -1
  272. package/dist/scripts/latest-version-guidance-check.js +74 -0
  273. package/dist/scripts/release-metadata-check.js +21 -4
  274. package/dist/scripts/release-real-check.js +7 -0
  275. package/dist/scripts/ux-review-imagegen-blackbox-check.js +25 -1
  276. package/dist/scripts/ux-review-run-wires-imagegen-check.js +9 -1
  277. package/package.json +8 -3
  278. package/release-gates.v2.json +176 -1
  279. package/runtime-required-scripts.json +30 -0
  280. package/schemas/triwiki/context-graph.schema.json +119 -0
  281. package/dist/cli/install-helpers-codex-lb-selftest-chain.js +0 -112
  282. package/dist/cli/install-helpers-codex-lb-selftest.js +0 -481
  283. package/dist/core/triwiki/code-index-scanner.js +0 -309
@@ -1,5 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { readJson } from '../fsx.js';
3
+ import { uniqueValues as unique } from '../text/strings.js';
3
4
  import { runCodexTask } from '../codex-control/codex-task-runner.js';
4
5
  import { THINKING_SUBAGENT_MODEL, SUBAGENT_EFFORT } from '../subagents/model-policy.js';
5
6
  import { normalizeClaimEvidenceMatrix, validateClaimEvidenceMatrix } from './claim-evidence-matrix.js';
@@ -281,9 +282,6 @@ function semanticTokens(value) {
281
282
  return unique(String(value || '').toLowerCase().normalize('NFKC').match(/[\p{L}\p{N}]{4,}/gu) || [])
282
283
  .filter((token) => !stop.has(token));
283
284
  }
284
- function unique(values) {
285
- return [...new Set(values)];
286
- }
287
285
  export const researchClaimEvidenceMatrixOutputSchema = {
288
286
  type: 'object',
289
287
  additionalProperties: false,
@@ -1,5 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { nowIso, readJson } from '../fsx.js';
3
+ import { uniqueValues as unique } from '../text/strings.js';
3
4
  import { runCodexTask } from '../codex-control/codex-task-runner.js';
4
5
  import { THINKING_SUBAGENT_MODEL, SUBAGENT_EFFORT } from '../subagents/model-policy.js';
5
6
  export async function runResearchFalsification(input) {
@@ -141,9 +142,6 @@ function buildResearchFalsificationPrompt(input) {
141
142
  function normalizeStrings(value) {
142
143
  return unique((Array.isArray(value) ? value : value == null ? [] : [value]).map((entry) => String(entry || '').trim()).filter(Boolean));
143
144
  }
144
- function unique(values) {
145
- return [...new Set(values)];
146
- }
147
145
  export const researchFalsificationOutputSchema = {
148
146
  type: 'object',
149
147
  additionalProperties: false,
@@ -1,6 +1,7 @@
1
1
  import fsp from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { sha256 } from '../fsx.js';
4
+ import { uniqueValues as unique } from '../text/strings.js';
4
5
  export function trustworthyVerifiedResearchSource(source) {
5
6
  return String(source?.acquisition_verdict || '') === 'verified_content'
6
7
  && /^verified_content:/i.test(String(source?.credibility || ''))
@@ -138,6 +139,3 @@ function sourceId(source) {
138
139
  function normalizedStrings(value) {
139
140
  return (Array.isArray(value) ? value : value == null ? [] : [value]).map(String).map((item) => item.trim()).filter(Boolean);
140
141
  }
141
- function unique(values) {
142
- return [...new Set(values)];
143
- }
@@ -37,21 +37,29 @@ export function findStreamedImageOutput(events) {
37
37
  for (const event of events) {
38
38
  const type = String(event?.type || '');
39
39
  const item = event?.item;
40
- if (item && String(item.type || '') === 'image_generation_call') {
40
+ const partialEvent = type === 'response.image_generation_call.partial_image'
41
+ || type.endsWith('.image_generation_call.partial_image');
42
+ if (partialEvent) {
43
+ const partialB64 = b64Of(event?.partial_image_b64)
44
+ || b64Of(event?.b64_json)
45
+ || b64Of(event?.result)
46
+ || b64Of(item?.partial_image_b64)
47
+ || b64Of(item?.b64_json)
48
+ || b64Of(item?.result);
49
+ if (partialB64)
50
+ partial = { id: event?.item_id || item?.id || null, b64: partialB64, partial: true };
51
+ continue;
52
+ }
53
+ if (type === 'response.output_item.done' && item && String(item.type || '') === 'image_generation_call') {
41
54
  const b64 = b64Of(item.result) || b64Of(item.b64_json);
42
55
  if (b64)
43
56
  final = { id: item.id || event?.item_id || null, b64, partial: false };
44
57
  continue;
45
58
  }
46
- if (/image_generation_call/.test(type)) {
59
+ if (type === 'response.image_generation_call.completed' || type === 'response.image_generation_call.done') {
47
60
  const b64 = b64Of(event?.result) || b64Of(event?.b64_json);
48
- if (b64) {
61
+ if (b64)
49
62
  final = { id: event?.item_id || event?.id || null, b64, partial: false };
50
- continue;
51
- }
52
- const partialB64 = b64Of(event?.partial_image_b64);
53
- if (partialB64)
54
- partial = { id: event?.item_id || null, b64: partialB64, partial: true };
55
63
  }
56
64
  }
57
65
  return final || partial;
@@ -86,22 +94,46 @@ export function parseResponsesSsePayload(text) {
86
94
  if (output.length) {
87
95
  if (hasImageGenerationResult(completed.response) || !streamedImage)
88
96
  return completed.response;
97
+ if (streamedImage.partial) {
98
+ return {
99
+ ...completed.response,
100
+ image_output_partial_frame: true,
101
+ partial_image_output_present: true
102
+ };
103
+ }
89
104
  return {
90
105
  ...completed.response,
91
106
  output: [...output, streamedImageItem(streamedImage)],
92
107
  image_output_recovered_from_stream: true,
93
- image_output_partial_frame: streamedImage.partial
108
+ image_output_partial_frame: false,
109
+ image_output_provenance: 'response.output_item.done'
110
+ };
111
+ }
112
+ if (!recovered.length) {
113
+ if (!streamedImage?.partial)
114
+ return completed.response;
115
+ return {
116
+ ...completed.response,
117
+ image_output_partial_frame: true,
118
+ partial_image_output_present: true
94
119
  };
95
120
  }
96
- if (!recovered.length)
97
- return completed.response;
98
121
  return {
99
122
  ...completed.response,
100
123
  output: recovered,
101
124
  output_recovered_from_stream: true,
102
- ...(streamedImage
103
- ? { image_output_recovered_from_stream: true, image_output_partial_frame: streamedImage.partial }
104
- : {})
125
+ ...(streamedImage?.partial
126
+ ? {
127
+ image_output_partial_frame: true,
128
+ partial_image_output_present: true
129
+ }
130
+ : streamedImage
131
+ ? {
132
+ image_output_recovered_from_stream: true,
133
+ image_output_partial_frame: false,
134
+ image_output_provenance: 'response.output_item.done'
135
+ }
136
+ : {})
105
137
  };
106
138
  }
107
139
  if (recovered.length) {
@@ -110,13 +142,27 @@ export function parseResponsesSsePayload(text) {
110
142
  status: 'completed',
111
143
  output: recovered,
112
144
  output_recovered_from_stream: true,
113
- ...(streamedImage
114
- ? { image_output_recovered_from_stream: true, image_output_partial_frame: streamedImage.partial }
115
- : {}),
145
+ ...(streamedImage?.partial
146
+ ? {
147
+ image_output_partial_frame: true,
148
+ partial_image_output_present: true
149
+ }
150
+ : streamedImage
151
+ ? {
152
+ image_output_recovered_from_stream: true,
153
+ image_output_partial_frame: false,
154
+ image_output_provenance: 'response.output_item.done'
155
+ }
156
+ : {}),
116
157
  events: eventTypes
117
158
  };
118
159
  }
119
- return { object: 'response.sse', status: 'unknown', events: eventTypes };
160
+ return {
161
+ object: 'response.sse',
162
+ status: 'unknown',
163
+ ...(streamedImage?.partial ? { image_output_partial_frame: true, partial_image_output_present: true } : {}),
164
+ events: eventTypes
165
+ };
120
166
  }
121
167
  export function responsesOutputText(payload) {
122
168
  const direct = typeof payload?.output_text === 'string' ? payload.output_text : '';
@@ -134,7 +180,7 @@ export function responsesOutputText(payload) {
134
180
  function recoveredOutput(items, streamedImage) {
135
181
  const output = [...items];
136
182
  const hasImage = output.some((item) => String(item?.type || '') === 'image_generation_call' && b64Of(item?.result));
137
- if (streamedImage && !hasImage)
183
+ if (streamedImage && !streamedImage.partial && !hasImage)
138
184
  output.push(streamedImageItem(streamedImage));
139
185
  return output;
140
186
  }
@@ -9,7 +9,7 @@ export const FROM_CHAT_IMG_CHECKLIST_ARTIFACT = 'from-chat-img-checklist.md';
9
9
  export const FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT = 'from-chat-img-temp-triwiki.json';
10
10
  export const FROM_CHAT_IMG_QA_LOOP_ARTIFACT = 'from-chat-img-qa-loop.json';
11
11
  export const FROM_CHAT_IMG_TEMP_TRIWIKI_SESSIONS = 5;
12
- export const USAGE_TOPICS = 'install|setup|bootstrap|root|deps|zellij|auto-review|naruto|qa-loop|ppt|image-ux-review|computer-use|goal|fast-mode|review|research|seo-geo-optimizer|git|codex|codex-app|codex-native|hooks|features|all-features|dfix|commit|commit-and-push|design|imagegen|dollar|context7|super-search|pipeline|reasoning|guard|conflicts|versioning|eval|harness|hproof|gx|wiki|memory|wrongness|code-structure|proof-field|skill-dream|rust';
12
+ export const USAGE_TOPICS = 'install|setup|bootstrap|root|deps|zellij|auto-review|naruto|qa-loop|ppt|image-ux-review|computer-use|goal|fast-mode|review|research|seo-geo-optimizer|git|codex|codex-app|codex-native|hooks|features|all-features|dfix|commit|commit-and-push|design|imagegen|dollar|context7|super-search|pipeline|reasoning|guard|conflicts|versioning|eval|harness|hproof|gx|wiki|memory|wrongness|code-structure|proof-field|skill-dream|rust|align';
13
13
  export const RECOMMENDED_MCP_SERVERS = [
14
14
  {
15
15
  id: 'context7',
@@ -1,14 +1,19 @@
1
1
  import { PRODUCT_DESIGN_PLUGIN, PRODUCT_DESIGN_REQUIRED_SKILLS, productDesignPluginPolicyText } from '../product-design-plugin.js';
2
2
  import { CODEX_APP_IMAGE_GENERATION_DOC_URL, CODEX_COMPUTER_USE_ONLY_POLICY, CODEX_IMAGEGEN_REQUIRED_POLICY, CODEX_WEB_VERIFICATION_POLICY } from './evidence.js';
3
3
  export { productDesignPluginPolicyText };
4
+ const GETDESIGN_CODEX_SKILL_REPOSITORY = 'MohtashamMurshid/getdesign';
5
+ const GETDESIGN_CODEX_SKILL_REF = '83e9840d4a5744b5f10117ec00b855059e5abc25';
4
6
  export const GETDESIGN_REFERENCE = {
5
7
  id: 'getdesign',
6
8
  url: 'https://getdesign.md/',
7
9
  docs_url: 'https://docs.getdesign.app/',
8
10
  official_urls_url: 'https://docs.getdesign.app/resources/official-urls/',
9
11
  codex_guide_url: 'https://docs.getdesign.app/guides/use-with-codex/',
10
- codex_skill: 'MohtashamMurshid/getdesign',
11
- codex_skill_install: 'skills add MohtashamMurshid/getdesign',
12
+ codex_skill_repository: GETDESIGN_CODEX_SKILL_REPOSITORY,
13
+ codex_skill_ref: GETDESIGN_CODEX_SKILL_REF,
14
+ codex_skill: GETDESIGN_CODEX_SKILL_REPOSITORY,
15
+ codex_skill_install: `skills add ${GETDESIGN_CODEX_SKILL_REPOSITORY} -g -a codex -y`,
16
+ codex_skill_install_mode: 'manual_only',
12
17
  npm_cli: '@getdesign/cli',
13
18
  npm_sdk: '@getdesign/sdk',
14
19
  official_mcp_available: false,
@@ -18,7 +18,6 @@ const DOLLAR_COMMANDS_LITE_BASE = [
18
18
  { command: '$QA-LOOP', route: 'QA loop', description: 'Dogfood UI/API as human proxy with safety gates, Codex Chrome Extension-first web UI evidence, safe fixes, rechecks, Honest Mode.' },
19
19
  { command: '$PPT', route: 'HTML/PDF presentation pipeline', description: 'Create restrained, information-first HTML/PDF presentation artifacts after delivery context, audience profile, STP, decision context, pain-point, research, design-system, and verification questions are sealed.' },
20
20
  { command: '$Image-UX-Review', route: 'image-generation UI/UX review loop', description: 'Review UI/UX through the imagegen/gpt-image-2 visual critique loop: source screenshots become generated annotated review images, those images become issue ledgers, then fixes are rechecked.' },
21
- { command: '$UX-Review', route: 'image-generation UI/UX review loop', description: 'Review UI/UX through the imagegen/gpt-image-2 visual critique loop: source screenshots become generated annotated review images, those images become issue ledgers, then fixes are rechecked.' },
22
21
  { command: '$Computer-Use', route: 'native Computer Use fast lane', description: COMPUTER_USE_DESCRIPTION },
23
22
  { command: '$CU', route: 'native Computer Use fast lane', description: COMPUTER_USE_DESCRIPTION },
24
23
  { command: '$Goal', route: 'Codex native /goal control', description: 'Use Codex native Goal directly with detailed completion criteria; SKS creates no Goal mission, artifact, loop, or fallback state.' },
@@ -32,6 +31,7 @@ const DOLLAR_COMMANDS_LITE_BASE = [
32
31
  { command: '$MAD-SKS', route: 'explicit scoped permission-widening modifier plus SQL-plane execution', description: 'Explicit high-risk authorization modifier that can be combined with other $ commands to temporarily open approved target-project scopes such as files, shell, package installs, services, network, Computer Use/browser workflows, generated assets, file permissions, migrations, Supabase MCP DB writes, direct execute SQL, schema cleanup, and normal targeted DB writes for the active invocation.' },
33
32
  { command: '$GX', route: 'visual context', description: 'Deterministic GX visual context cartridges.' },
34
33
  { command: '$Wiki', route: 'TriWiki refresh and maintenance', description: 'Refresh, pack, validate, or prune TriWiki context packs from Codex App.' },
34
+ { command: '$Align', route: 'latest GPT-5.6 / openai/skills modernization', description: 'One-shot modernization that aligns SKS prompts, settings, and skill/command surfaces to the latest GPT-5.6 official prompting, programmatic tool calling, agents, and openai/skills guidance. Latest-version only: delete legacy compat knobs and deduplicate redundant prompt/config content.' },
35
35
  { command: '$Help', route: 'command help', description: 'Explain installed SKS commands and workflows.' }
36
36
  ];
37
37
  const DOLLAR_COMMAND_ALIASES_LITE_BASE = [
@@ -52,9 +52,6 @@ const DOLLAR_COMMAND_ALIASES_LITE_BASE = [
52
52
  { canonical: '$QA-LOOP', app_skill: '$qa-loop' },
53
53
  { canonical: '$PPT', app_skill: '$ppt' },
54
54
  { canonical: '$Image-UX-Review', app_skill: '$image-ux-review' },
55
- { canonical: '$Image-UX-Review', app_skill: '$ux-review' },
56
- { canonical: '$Image-UX-Review', app_skill: '$visual-review' },
57
- { canonical: '$Image-UX-Review', app_skill: '$ui-ux-review' },
58
55
  { canonical: '$Computer-Use', app_skill: '$computer-use-fast' },
59
56
  { canonical: '$Computer-Use', app_skill: '$cu' },
60
57
  { canonical: '$Goal', app_skill: '$goal' },
@@ -68,6 +65,7 @@ const DOLLAR_COMMAND_ALIASES_LITE_BASE = [
68
65
  { canonical: '$MAD-SKS', app_skill: '$mad-sks' },
69
66
  { canonical: '$GX', app_skill: '$gx' },
70
67
  { canonical: '$Wiki', app_skill: '$wiki' },
68
+ { canonical: '$Align', app_skill: '$align' },
71
69
  { canonical: '$Help', app_skill: '$help' }
72
70
  ];
73
71
  const LEGACY_LITE_DOLLAR_NAMES = Array.from(new Set([
@@ -24,7 +24,7 @@ export const CODEX_QA_SURFACE_ROUTING_POLICY = `Codex QA surface routing follows
24
24
  export const CODEX_WEB_VERIFICATION_POLICY = CODEX_QA_SURFACE_ROUTING_POLICY;
25
25
  export const CODEX_COMPUTER_USE_ONLY_POLICY = `Codex Computer Use is a live GUI surface for supported macOS and Windows environments, invoked with @Computer or @AppName for native apps, OS settings, browser contexts that truly require GUI-level operation, and cross-app workflows. Do not replace @Browser localhost/public-page checks or @Chrome signed-in checks with Computer Use unless the surface router records a specific GUI-only/cross-app reason. If live Computer Use tools, permissions, or app access are unavailable, mark the affected native/GUI evidence blocked or unverified instead of fabricating screenshots or actions. Codex App readiness/config checks are capability evidence only, not target interaction proof.`;
26
26
  export const IMAGEGEN_SOCIAL_SOURCE_POLICY = 'Use public X/social/community reports only as prompt-quality and workflow-sentiment hints after official OpenAI/Codex docs. Social posts are not capability specs, evidence of tool availability, or proof that a generated asset was created.';
27
- export const CODEX_IMAGEGEN_REQUIRED_POLICY = 'Pipeline image generation, raster asset creation/editing, and generated image-review evidence must use real Codex App imagegen/$imagegen with gpt-image-2 when that evidence is required for full verification. For newest-model image requests, prompt explicitly for "ChatGPT Images 2.0 / GPT Image 2.0 with gpt-image-2" instead of relying on generic image-generation wording. Do not substitute placeholder SVG/HTML/CSS, prose-only critique, stock-like stand-ins, manually fabricated files, or missing-output ledgers for requested/generated raster assets or required generated review images. If imagegen/gpt-image-2 is unavailable or generated annotated images cannot be created/linked, record the blocker and cap any closeout at verified_partial/reference-only instead of claiming generated-image evidence or full route verification; that partial closeout requires source screenshots plus hashes, docs evidence, source Image Voxel anchors, and Honest Mode evidence. In Codex App prompts, invoke $imagegen when live image generation is needed; SKS hooks and skills can require the policy but cannot attach missing host image-generation tools to an already-started turn. Official OpenAI/Codex docs are authoritative for capabilities, surfaces, limits, and evidence rules; X/social/community reports may inform prompt style only.';
27
+ export const CODEX_IMAGEGEN_REQUIRED_POLICY = 'Pipeline image generation, raster asset creation/editing, and generated image-review evidence must use gpt-image-2 through the user-selected Codex provider when that evidence is required for full verification: Codex App imagegen/$imagegen, or the selected and ready codex-lb Responses provider. Only completed response output or a final response.output_item.done image result qualifies; streamed partial preview frames never count as generated-image evidence. For newest-model image requests, prompt explicitly for "ChatGPT Images 2.0 / GPT Image 2.0 with gpt-image-2" instead of relying on generic image-generation wording. Do not substitute placeholder SVG/HTML/CSS, prose-only critique, stock-like stand-ins, manually fabricated files, or missing-output ledgers for requested/generated raster assets or required generated review images. If imagegen/gpt-image-2 is unavailable or generated annotated images cannot be created/linked, record the blocker and cap any closeout at verified_partial/reference-only instead of claiming generated-image evidence or full route verification; that partial closeout requires source screenshots plus hashes, docs evidence, source Image Voxel anchors, and Honest Mode evidence. In Codex App prompts, invoke $imagegen when live image generation is needed; SKS hooks and skills can require the policy but cannot attach missing host image-generation tools to an already-started turn. Official OpenAI/Codex docs are authoritative for capabilities, surfaces, limits, and evidence rules; X/social/community reports may inform prompt style only.';
28
28
  export const DEFAULT_CODEX_APP_PLUGINS = Object.freeze([
29
29
  ['browser', 'openai-bundled'],
30
30
  ['chrome', 'openai-bundled'],
@@ -258,7 +258,7 @@ export const ROUTES = [
258
258
  reasoningPolicy: 'high',
259
259
  stopGate: 'naruto-gate.json',
260
260
  coverage_required: true,
261
- cliEntrypoint: 'sks naruto run "task" [--agents N] [--max-threads N] [--trusted-project] | sks naruto status|subagents|proof',
261
+ cliEntrypoint: 'sks naruto run "task" [--agents N] [--max-threads N] [--trusted-project] | sks naruto status|subagents|proof | sks naruto parent-summary --mission M-... --stdin',
262
262
  examples: ['$Naruto run review twelve independent packages with --agents 12', '$Work']
263
263
  },
264
264
  {
@@ -310,8 +310,7 @@ export const ROUTES = [
310
310
  route: 'image-generation UI/UX review loop',
311
311
  description: 'Review UI/UX through the imagegen/gpt-image-2 visual critique loop: source screenshots become generated annotated review images, those images become issue ledgers, then fixes are rechecked.',
312
312
  requiredSkills: ['image-ux-review', 'imagegen', 'cu', 'pipeline-runner', REFLECTION_SKILL_NAME, 'honest-mode'],
313
- dollarAliases: ['$UX-Review'],
314
- appSkillAliases: ['ux-review', 'visual-review', 'ui-ux-review'],
313
+ hiddenDollarAliases: ['$UX-Review', '$Visual-Review', '$UI-UX-Review'],
315
314
  lifecycle: ['target_and_capture_inventory', 'source_screenshots', 'gpt_image_2_annotated_review_image', 'generated_image_text_extraction', 'issue_ledger', 'optional_safe_fixes', 'changed_screen_recheck', 'post_route_reflection', 'honest_mode'],
316
315
  context7Policy: 'if_external_docs',
317
316
  reasoningPolicy: 'high',
@@ -498,6 +497,21 @@ export const ROUTES = [
498
497
  cliEntrypoint: 'sks wiki refresh|pack|validate|prune',
499
498
  examples: ['$Wiki refresh', '$Wiki prune and validate']
500
499
  },
500
+ {
501
+ id: 'Align',
502
+ command: '$Align',
503
+ mode: 'ALIGN',
504
+ route: 'latest GPT-5.6 / openai/skills modernization',
505
+ description: 'One-shot modernization that aligns SKS prompts, settings, and skill/command surfaces to the latest GPT-5.6 official prompting, programmatic tool calling, agents, and openai/skills guidance. Latest-version only: delete legacy compat knobs and deduplicate redundant prompt/config content.',
506
+ requiredSkills: ['align', 'pipeline-runner', 'prompt-pipeline', REFLECTION_SKILL_NAME, 'honest-mode'],
507
+ lifecycle: ['align_plan', 'latest_model_prompt_grammar', 'programmatic_tool_calling', 'agents_guidance', 'openai_skills_and_plugins', 'latest_only_cleanup', 'deduplicate_prompt_config', 'align_ledger', 'align_gate', 'post_route_reflection', 'honest_mode'],
508
+ context7Policy: 'if_external_docs',
509
+ reasoningPolicy: 'high',
510
+ stopGate: 'align-gate.json',
511
+ coverage_required: true,
512
+ cliEntrypoint: 'sks align prepare|run|status|proof',
513
+ examples: ['$Align modernize SKS skills to latest GPT-5.6', 'sks align prepare --json', 'sks align run "prompts and skills"']
514
+ },
501
515
  {
502
516
  id: 'Help',
503
517
  command: '$Help',
@@ -632,7 +646,7 @@ export const COMMAND_CATALOG = [
632
646
  { name: 'uninstall', usage: 'sks uninstall [--dry-run] [--yes] [--keep-config] [--keep-data] [--purge-projects] [--json]', description: 'Remove SKS global skills, hooks, menu bar, state, temp files, and optional project residue while preserving user-owned content by default.' },
633
647
  { name: 'deps', usage: 'sks deps check [--json] [--yes]', description: 'Check Node/npm, Codex CLI, and Zellij readiness; pass --yes to repair missing Codex CLI/Zellij tooling when supported.' },
634
648
  { name: 'codex', usage: 'sks codex compatibility|version|update-status [--refresh]|update|doctor|schema|0.144 [--json]', description: 'Check Codex CLI compatibility/version/update status, run the official `codex update`, and inspect current manifest, capability, and hook-schema evidence.' },
635
- { name: 'codex-app', usage: 'sks codex-app [check|set-openrouter-key --api-key-stdin|use-openrouter --model <id>|openrouter-status|product-design|chrome-extension|pat status|remote-control]', description: 'Check Codex App install, OpenRouter provider activation, codex-lb key-entry guidance, Product Design plugin readiness, Codex Chrome Extension web verification readiness, PAT-safe status, first-party MCP/plugin readiness, and Codex CLI 0.130.0+ remote-control availability.' },
649
+ { name: 'codex-app', usage: 'sks codex-app [check|set-openrouter-key --api-key-stdin|use-openrouter --model <id>|openrouter-status|product-design|chrome-extension|pat status|remote-control]', description: 'Check Codex App install, OpenRouter provider activation, codex-lb key-entry guidance, Product Design plugin readiness, Codex Chrome Extension web verification readiness, PAT-safe status, first-party MCP/plugin readiness, and Codex CLI remote-control availability.' },
636
650
  { name: 'codex-native', usage: 'sks codex-native status|feature-broker|invocation-plan|init-deep [--json]', description: 'Inspect Codex Native feature broker readiness, invocation routing, pattern evidence, and managed memory setup.' },
637
651
  { name: 'hooks', usage: 'sks hooks explain|status|trust-report|replay|codex-validate|warning-check ... [--json]', description: 'Explain Codex hook events, validate vendored latest 10-event output schemas, replay fixtures, and enforce warning-zero SKS hook policies under the 0.134 compatibility matrix.' },
638
652
  { name: 'codex-lb', usage: 'sks codex-lb status|health|metrics|doctor|circuit|repair|setup ...', description: 'Configure, health-check, repair, and record circuit evidence for codex-lb provider auth without confusing ChatGPT OAuth and proxy keys.' },
@@ -642,7 +656,7 @@ export const COMMAND_CATALOG = [
642
656
  { name: 'mad-sks', usage: 'sks mad-sks plan|run|apply|sql|apply-migration|status|close|rollback-apply ... | sks --mad [--high]', description: 'Open or inspect MAD-SKS scoped permission workflows, merged SQL-plane execution, and the Zellij permission launcher.' },
643
657
  { name: 'auto-review', usage: 'sks auto-review status|enable|start [--high] | sks --Auto-review --high', description: 'Enable Codex automatic approval review and launch SKS Zellij with the auto-review profile.' },
644
658
  { name: 'dollar-commands', usage: 'sks dollar-commands [--json]', description: 'List Codex App $ commands such as $sks-dfix and $sks-naruto.' },
645
- { name: 'fast-mode', usage: 'sks fast-mode on|off|status|clear [--project] [--json]', description: 'Toggle the global Codex Desktop GPT 5.5 Fast default used by $sks-fast-on/$sks-fast-off and keep project worker preference in sync; pass --project for project-local only.' },
659
+ { name: 'fast-mode', usage: 'sks fast-mode on|off|status|clear [--project] [--json]', description: 'Toggle the global Codex Desktop GPT-5.6 Fast default used by $sks-fast-on/$sks-fast-off and keep project worker preference in sync; pass --project for project-local only.' },
646
660
  { name: 'with-local-llm', usage: 'sks with-local-llm on|off|status|set-model [--json]', description: 'Toggle the optional local Ollama worker backend used by $sks-with-local-llm-on/$sks-with-local-llm-off and eligible simple worker slices.' },
647
661
  { name: 'commit', usage: 'sks commit [--message "msg"] [--json]', description: 'Stage current changes, summarize them, and create a simple git commit without the full SKS pipeline.' },
648
662
  { name: 'commit-and-push', usage: 'sks commit-and-push [--message "msg"] [--json]', description: 'Stage current changes, create a simple git commit, and push without the full SKS pipeline.' },
@@ -662,6 +676,7 @@ export const COMMAND_CATALOG = [
662
676
  { name: 'features', usage: 'sks features list|check|inventory [--json] [--write-docs]', description: 'Build and validate the feature registry that maps CLI commands, hidden handlers, dollar routes, app skill aliases, and skills.' },
663
677
  { name: 'all-features', usage: 'sks all-features selftest --mock [--json]', description: 'Run the mock all-features contract selftest for feature registry, proof, Voxel TriWiki, and failure-contract coverage.' },
664
678
  { name: 'aliases', usage: 'sks aliases', description: 'Show command aliases and npm binary names.' },
679
+ { name: 'align', usage: 'sks align prepare|run|status|proof ["scope"] [--json]', description: 'Prepare or inspect the $sks-align modernization mission that aligns SKS prompts, settings, and skills to latest GPT-5.6 / openai/skills guidance.' },
665
680
  { name: 'setup', usage: 'sks setup [--bootstrap] [--install-scope global|project] [--local-only] [--force] [--json]', description: 'Initialize SKS state, Codex App files, hooks, skills, and rules.' },
666
681
  { name: 'fix-path', usage: 'sks fix-path [--install-scope global|project] [--json]', description: 'Refresh hook commands with the resolved SKS binary path.' },
667
682
  { name: 'doctor', usage: 'sks doctor [--fix] [--local-only] [--json] [--install-scope global|project]', description: 'Check and repair SKS generated files, while blocking setup if another Codex harness is detected.' },
@@ -688,7 +703,7 @@ export const COMMAND_CATALOG = [
688
703
  { 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.' },
689
704
  { 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.' },
690
705
  { name: 'hproof', usage: 'sks hproof check [mission-id|latest]', description: 'Evaluate the H-Proof done gate for a mission.' },
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.' },
706
+ { name: 'naruto', usage: 'sks naruto run \"task\" [--agents N] [--max-threads N] [--trusted-project] [--json] | sks naruto status|subagents|proof [latest|M-...] [--json] | sks naruto parent-summary --mission M-... --stdin [--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.' },
692
707
  { name: 'reasoning', usage: 'sks reasoning ["prompt"] [--json]', description: 'Show SKS temporary reasoning-effort routing: medium for simple tasks, high for logic, xhigh for research.' },
693
708
  { name: 'gx', usage: 'sks gx init|render|validate|drift|snapshot [name]', description: 'Create and verify deterministic SVG/HTML visual context cartridges.' },
694
709
  { name: 'profile', usage: 'sks profile show|set <model>', description: 'Inspect or set the current SKS model profile metadata.' },
@@ -743,10 +758,15 @@ export function explicitManagedSkillNames(prompt = '') {
743
758
  const skillName = sksPrefixedSkillName(match.name);
744
759
  if (!skillName || skillName.length > 100)
745
760
  continue;
746
- if (routeByDollarCommand(match.name)) {
747
- if (!MANAGED_ROUTE_SKILL_NAME_SET.has(skillName) || selected.includes(skillName))
761
+ const matchedRoute = routeByDollarCommand(match.name);
762
+ if (matchedRoute) {
763
+ const canonicalRouteSkillName = sksPrefixedSkillName(dollarSkillName(matchedRoute.command));
764
+ const selectedSkillName = MANAGED_ROUTE_SKILL_NAME_SET.has(skillName)
765
+ ? skillName
766
+ : canonicalRouteSkillName;
767
+ if (!MANAGED_ROUTE_SKILL_NAME_SET.has(selectedSkillName) || selected.includes(selectedSkillName))
748
768
  continue;
749
- selected.push(skillName);
769
+ selected.push(selectedSkillName);
750
770
  continue;
751
771
  }
752
772
  if (!rawName.startsWith('sks-'))
@@ -1236,7 +1256,7 @@ export function simpleGitOnlyRouteId(prompt = '') {
1236
1256
  }
1237
1257
  export function reflectionRequiredForRoute(route) {
1238
1258
  const id = String(route?.id || route?.mode || route?.route || route || '').replace(/^\$/, '');
1239
- return /^(naruto|qaloop|qa-loop|ppt|imageuxreview|image-ux-review|research|autoresearch|seo|geo|db|database|madsks|mad-sks|gx)$/i.test(id);
1259
+ return /^(naruto|qaloop|qa-loop|ppt|imageuxreview|image-ux-review|research|autoresearch|seo|geo|db|database|madsks|mad-sks|gx|align)$/i.test(id);
1240
1260
  }
1241
1261
  export function looksLikeCodeChangingWork(prompt = '') {
1242
1262
  const text = String(prompt || '');
@@ -17,6 +17,7 @@ const ARGUMENT_PROFILES = {
17
17
  mission: boundedString(1, 160),
18
18
  agents: { type: 'integer', minimum: 1 },
19
19
  max_threads: { type: 'integer', minimum: 1 },
20
+ stdin: { type: 'boolean' },
20
21
  readonly: { type: 'boolean' },
21
22
  trusted_project: { type: 'boolean' },
22
23
  json: { type: 'boolean' }
@@ -34,6 +35,7 @@ const ARGUMENT_PROFILES = {
34
35
  ...valueFlag(input, 'mission', '--mission'),
35
36
  ...numberFlag(input, 'agents', '--agents'),
36
37
  ...numberFlag(input, 'max_threads', '--max-threads'),
38
+ ...booleanFlag(input, 'stdin', '--stdin'),
37
39
  ...booleanFlag(input, 'readonly', '--readonly'),
38
40
  ...booleanFlag(input, 'trusted_project', '--trusted-project'),
39
41
  ...jsonFlag(input)
@@ -1 +1 @@
1
- export const NARUTO_ACTIONS = ['run', 'status', 'subagents', 'proof', 'help'];
1
+ export const NARUTO_ACTIONS = ['run', 'status', 'subagents', 'proof', 'parent-summary', 'help'];
@@ -0,0 +1,205 @@
1
+ import path from 'node:path';
2
+ import { compareContextGraphIds } from '../triwiki/context-graph/ids.js';
3
+ import { isWorkspaceRelativePosixPath } from '../triwiki/context-graph/paths.js';
4
+ import { CONTEXT_GRAPH_TRAVERSAL_CAPS } from '../triwiki/context-graph/profiles.js';
5
+ import { CONTEXT_GRAPH_RANKING_CONFIG, contextGraphSeedConfidenceScore, isExactContextGraphSeedConfidence } from '../triwiki/context-graph/query/ranking-config.js';
6
+ import { normalizeContextGraphQuery, seedConfidenceFor } from '../triwiki/context-graph/query/seeds.js';
7
+ const SEED_SCAN_BUDGET = 20_000;
8
+ const GLOB_META = /[*?[\]{}!]/;
9
+ export function contextGraphFocusPaths(patterns) {
10
+ const out = [];
11
+ for (const raw of patterns ?? []) {
12
+ const candidate = String(raw ?? '').trim().replace(/^\.\//, '').replace(/\/+$/, '');
13
+ if (!candidate || GLOB_META.test(candidate))
14
+ continue;
15
+ if (!isWorkspaceRelativePosixPath(candidate))
16
+ continue;
17
+ if (!out.includes(candidate))
18
+ out.push(candidate);
19
+ }
20
+ return out;
21
+ }
22
+ class SeedTable {
23
+ index;
24
+ config;
25
+ focusPaths;
26
+ drafts = new Map();
27
+ constructor(index, config, focusPaths) {
28
+ this.index = index;
29
+ this.config = config;
30
+ this.focusPaths = focusPaths;
31
+ }
32
+ has(nodeId) {
33
+ return this.drafts.has(nodeId);
34
+ }
35
+ get size() {
36
+ return this.drafts.size;
37
+ }
38
+ exactCount() {
39
+ let count = 0;
40
+ for (const draft of this.drafts.values()) {
41
+ if (isExactContextGraphSeedConfidence(draft.confidence))
42
+ count += 1;
43
+ }
44
+ return count;
45
+ }
46
+ add(nodeId, confidence, channel) {
47
+ const node = this.index.nodesById.get(nodeId);
48
+ if (!node)
49
+ return;
50
+ if (this.focusPaths.length > 0 && !underFocus(node.path, this.focusPaths))
51
+ return;
52
+ const score = contextGraphSeedConfidenceScore(this.config, confidence);
53
+ const existing = this.drafts.get(nodeId);
54
+ if (existing && existing.score >= score)
55
+ return;
56
+ this.drafts.set(nodeId, {
57
+ nodeId,
58
+ confidence,
59
+ channel,
60
+ score,
61
+ ...(node.path === undefined ? {} : { path: node.path }),
62
+ ...(node.locator?.line === undefined ? {} : { line: node.locator.line })
63
+ });
64
+ }
65
+ ranked(limit) {
66
+ return [...this.drafts.values()]
67
+ .sort((left, right) => right.score - left.score || compareContextGraphIds(left.nodeId, right.nodeId))
68
+ .slice(0, Math.max(0, limit));
69
+ }
70
+ }
71
+ function underFocus(nodePath, focusPaths) {
72
+ if (!nodePath)
73
+ return false;
74
+ return focusPaths.some((focus) => nodePath === focus || nodePath.startsWith(`${focus}/`));
75
+ }
76
+ function addSymbolSeeds(table, index, token, perToken) {
77
+ const direct = index.nodesById.get(token);
78
+ if (direct)
79
+ table.add(direct.id, seedConfidenceFor(direct.kind, 'node_id'), 'symbol');
80
+ for (const id of (index.nodesByLabel.get(token.toLowerCase()) ?? []).slice(0, perToken)) {
81
+ const node = index.nodesById.get(id);
82
+ if (node)
83
+ table.add(node.id, seedConfidenceFor(node.kind, 'label'), 'symbol');
84
+ }
85
+ }
86
+ function addExactPathSeeds(table, index, token, perToken) {
87
+ const candidate = token.replace(/^\.\//, '').replace(/\/+$/, '');
88
+ if (!candidate.includes('/') || !isWorkspaceRelativePosixPath(candidate))
89
+ return;
90
+ for (const id of (index.nodesByPath.get(candidate) ?? []).slice(0, perToken)) {
91
+ table.add(id, 'file_path', 'path');
92
+ }
93
+ }
94
+ function addBasenameSeeds(table, index, tokens, perToken, budget) {
95
+ const wanted = new Set();
96
+ for (const token of tokens) {
97
+ if (token.includes('/') || !token.includes('.'))
98
+ continue;
99
+ wanted.add(token.toLowerCase());
100
+ }
101
+ if (wanted.size === 0)
102
+ return;
103
+ let added = 0;
104
+ for (const key of index.nodesByPath.keys()) {
105
+ if (budget.scanned >= SEED_SCAN_BUDGET) {
106
+ budget.exhausted = true;
107
+ return;
108
+ }
109
+ budget.scanned += 1;
110
+ const base = key.slice(key.lastIndexOf('/') + 1).toLowerCase();
111
+ if (!wanted.has(base))
112
+ continue;
113
+ for (const id of (index.nodesByPath.get(key) ?? []).slice(0, perToken)) {
114
+ table.add(id, 'file_path', 'path');
115
+ added += 1;
116
+ }
117
+ if (added >= perToken * wanted.size)
118
+ return;
119
+ }
120
+ }
121
+ function addTextSeeds(table, index, lowerTokens, config, budget) {
122
+ const needles = lowerTokens.filter((token) => token.length >= config.lexicalMinTokenLength);
123
+ if (needles.length === 0)
124
+ return;
125
+ const hits = [];
126
+ const sweep = (keys, idsOf) => {
127
+ for (const key of keys) {
128
+ if (budget.scanned >= SEED_SCAN_BUDGET) {
129
+ budget.exhausted = true;
130
+ return false;
131
+ }
132
+ budget.scanned += 1;
133
+ const lower = key.toLowerCase();
134
+ if (!needles.some((needle) => lower.includes(needle)))
135
+ continue;
136
+ for (const id of idsOf(key))
137
+ hits.push(id);
138
+ }
139
+ return true;
140
+ };
141
+ if (sweep(index.nodesByLabel.keys(), (key) => index.nodesByLabel.get(key) ?? [])) {
142
+ sweep(index.nodesByPath.keys(), (key) => index.nodesByPath.get(key) ?? []);
143
+ }
144
+ const ordered = [...new Set(hits)].sort(compareContextGraphIds).slice(0, config.maxLexicalSeeds);
145
+ for (const id of ordered) {
146
+ if (table.has(id))
147
+ continue;
148
+ table.add(id, 'text_candidate', 'text');
149
+ }
150
+ }
151
+ function toSeed(draft) {
152
+ return {
153
+ nodeId: draft.nodeId,
154
+ confidence: draft.confidence,
155
+ origin: draft.channel === 'text' ? 'lexical' : 'exact',
156
+ channel: draft.channel,
157
+ ...(draft.path === undefined ? {} : { path: draft.path }),
158
+ ...(draft.line === undefined ? {} : { line: draft.line })
159
+ };
160
+ }
161
+ export function acquireContextGraphSeeds(input) {
162
+ const config = input.config ?? CONTEXT_GRAPH_RANKING_CONFIG;
163
+ const index = input.index;
164
+ const focusPaths = contextGraphFocusPaths(input.focusPaths);
165
+ const normalized = normalizeContextGraphQuery(input.query, config);
166
+ const table = new SeedTable(index, config, focusPaths);
167
+ const budget = { scanned: 0, exhausted: false };
168
+ const perToken = config.maxSeedsPerToken;
169
+ for (const focus of focusPaths) {
170
+ for (const id of (index.nodesByPath.get(focus) ?? []).slice(0, perToken)) {
171
+ table.add(id, 'file_path', 'path');
172
+ }
173
+ }
174
+ for (const token of normalized.tokens) {
175
+ addSymbolSeeds(table, index, token, perToken);
176
+ addExactPathSeeds(table, index, token, perToken);
177
+ }
178
+ addBasenameSeeds(table, index, normalized.tokens, perToken, budget);
179
+ if (table.exactCount() < config.minExactSeeds) {
180
+ addTextSeeds(table, index, normalized.lowerTokens, config, budget);
181
+ }
182
+ const maxSeeds = Math.max(0, input.maxSeeds ?? CONTEXT_GRAPH_TRAVERSAL_CAPS.maxSeeds);
183
+ const seeds = table.ranked(maxSeeds).map(toSeed);
184
+ const counts = { symbol: 0, path: 0, text: 0 };
185
+ let exactSeeds = 0;
186
+ for (const seed of seeds) {
187
+ counts[seed.channel] += 1;
188
+ if (isExactContextGraphSeedConfidence(seed.confidence))
189
+ exactSeeds += 1;
190
+ }
191
+ return {
192
+ seeds,
193
+ counts,
194
+ exactSeeds,
195
+ scannedKeys: budget.scanned,
196
+ scanBudgetExhausted: budget.exhausted,
197
+ tokens: normalized.tokens
198
+ };
199
+ }
200
+ export function workspaceRelativeSeedPath(value) {
201
+ const candidate = String(value ?? '').trim().replace(/\\/g, '/').replace(/^\.\//, '');
202
+ if (!candidate || path.posix.isAbsolute(candidate))
203
+ return null;
204
+ return isWorkspaceRelativePosixPath(candidate) ? candidate : null;
205
+ }
Binary file
@@ -127,9 +127,9 @@ export async function searchCapabilities(root = process.cwd()) {
127
127
  context: {
128
128
  available: true,
129
129
  provider: 'triwiki',
130
- engine: 'triwiki+codepack',
130
+ engine: 'triwiki+context-graph',
131
131
  externalBinaryRequired: false,
132
- notes: [`root=${path.resolve(root)}`, 'No vector DB']
132
+ notes: [`root=${path.resolve(root)}`, 'No vector DB', 'A missing, stale, or corrupt graph returns context_graph_missing|context_graph_stale|context_graph_corrupt with a repair command; it never falls back to lexical search']
133
133
  }
134
134
  },
135
135
  rust: {
@@ -9,6 +9,7 @@ const SECRET_ENV_NAMES = [
9
9
  'GITHUB_PAT'
10
10
  ];
11
11
  const SECRET_PATTERNS = [
12
+ /-----BEGIN (?:RSA |EC |OPENSSH |DSA )?PRIVATE KEY-----[\s\S]*?-----END (?:RSA |EC |OPENSSH |DSA )?PRIVATE KEY-----/g,
12
13
  /\bsk-proj-[A-Za-z0-9_-]{12,}\b/g,
13
14
  /\bsk-or-v1-[A-Za-z0-9_-]{12,}\b/g,
14
15
  /\bsk-or-[A-Za-z0-9_-]{12,}\b/g,
@@ -16,6 +17,11 @@ const SECRET_PATTERNS = [
16
17
  /\bsk-clb-[A-Za-z0-9_-]{8,}\b/g,
17
18
  /\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,
18
19
  /\bghp_[A-Za-z0-9_]{20,}\b/g,
20
+ /\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/g,
21
+ /\bAIza[0-9A-Za-z_-]{30,}\b/g,
22
+ /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g,
23
+ /\bnpm_[A-Za-z0-9]{30,}\b/g,
24
+ /\b(?:glpat|pypi|hf)_[A-Za-z0-9_-]{20,}\b/g,
19
25
  /\bBearer\s+[A-Za-z0-9._~+/=-]{16,}\b/gi,
20
26
  /\bAuthorization\s*:\s*[^\r\n,}]+/gi,
21
27
  /\b(?:Cookie|Set-Cookie)\s*:\s*[^\r\n,}]+/gi,