sneakoscope 7.6.0 → 8.0.1

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 (152) hide show
  1. package/README.md +4 -10
  2. package/config/perf-budgets.v1.json +0 -1
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/dist/cli/command-manifest-lite.js +8 -15
  6. package/dist/cli/command-registry.js +8 -16
  7. package/dist/cli/router.js +0 -3
  8. package/dist/commands/codex-lb.js +10 -5
  9. package/dist/commands/doctor-profile.js +1 -0
  10. package/dist/commands/doctor.js +39 -0
  11. package/dist/config/skills-manifest.json +59 -59
  12. package/dist/core/agent-bridge/agent-manifest.js +6 -11
  13. package/dist/core/align/align-route.js +471 -40
  14. package/dist/core/codex-app/menubar/constants.js +1 -4
  15. package/dist/core/codex-app/menubar/installer.js +20 -1
  16. package/dist/core/codex-app/menubar/migration.js +241 -1
  17. package/dist/core/codex-app/menubar/status.js +19 -1
  18. package/dist/core/codex-lb/capability-runner.js +15 -4
  19. package/dist/core/codex-lb/codex-lb-env.js +28 -4
  20. package/dist/core/codex-lb/desktop-controller.js +91 -23
  21. package/dist/core/codex-lb/probes/bridge-probe.js +3 -1
  22. package/dist/core/codex-lb/probes/catalog-probe.js +21 -10
  23. package/dist/core/codex-lb/probes/cli-image-tool-probe.js +200 -0
  24. package/dist/core/codex-lb/probes/image-generation-probe.js +10 -4
  25. package/dist/core/codex-native/core-skill-manifest.js +35 -10
  26. package/dist/core/commands/align-command.js +115 -19
  27. package/dist/core/commands/mad-sks-command.js +30 -28
  28. package/dist/core/commands/mad-sks-headless.js +44 -0
  29. package/dist/core/commands/remote-command.js +5 -4
  30. package/dist/core/db-safety.js +10 -0
  31. package/dist/core/doctor/codex-config-syntax-repair.js +253 -0
  32. package/dist/core/doctor/retired-managed-residue-private.js +1 -1
  33. package/dist/core/doctor/retired-managed-residue-state.js +3 -1
  34. package/dist/core/feature-fixtures.js +5 -8
  35. package/dist/core/imagegen/imagegen-capability.js +16 -2
  36. package/dist/core/imagegen/require-imagegen.js +2 -1
  37. package/dist/core/init/skills.js +21 -17
  38. package/dist/core/install/installed-package-smoke.js +1 -1
  39. package/dist/core/locks/file-lock.js +27 -11
  40. package/dist/core/perf/release-latency-slo.js +1 -60
  41. package/dist/core/pipeline-internals/runtime-core.js +12 -3
  42. package/dist/core/release/release-gate-contract.js +1 -0
  43. package/dist/core/release/release-pack-receipt.js +2 -0
  44. package/dist/core/release/release-upgrade-baseline.js +3 -3
  45. package/dist/core/remote/index.js +0 -2
  46. package/dist/core/remote/owner-proof.js +2 -2
  47. package/dist/core/remote/protocol.js +2 -2
  48. package/dist/core/remote/types.js +2 -3
  49. package/dist/core/remote/worker.js +11 -387
  50. package/dist/core/routes/dollar-manifest-lite.js +1 -1
  51. package/dist/core/routes.js +3 -4
  52. package/dist/core/safety/command-contract/contracts.js +4 -9
  53. package/dist/core/skill-forge.js +21 -6
  54. package/dist/core/skills/skill-agent-metadata.js +348 -0
  55. package/dist/core/stop-gate/stop-gate-resolver.js +47 -2
  56. package/dist/core/subagents/official-subagent-prompt.js +32 -74
  57. package/dist/core/triwiki/context-graph/extractors/topology/commands.js +0 -1
  58. package/dist/core/update/update-migration-state.js +17 -4
  59. package/dist/core/update-check.js +76 -12
  60. package/dist/core/version.js +1 -1
  61. package/dist/core/work-order-ledger.js +7 -1
  62. package/dist/core/zellij/zellij-official-subagent-activity.js +53 -0
  63. package/dist/native/sks-menubar/Sources/AppDelegate.swift +0 -9
  64. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +1 -6
  65. package/dist/native/sks-menubar/Sources/OperationCoordinator.swift +1 -1
  66. package/dist/native/sks-menubar/Sources/OverviewSummary.swift +0 -27
  67. package/dist/native/sks-menubar/Sources/OverviewViewController.swift +9 -16
  68. package/dist/native/sks-menubar/Sources/ProcessClient.swift +2 -9
  69. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +15 -1
  70. package/dist/native/sks-menubar/Sources/RemoteCodingViewController.swift +49 -0
  71. package/dist/native/sks-menubar/Sources/SidebarItem.swift +2 -2
  72. package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +0 -17
  73. package/dist/scripts/current-command-surface-check.js +4 -2
  74. package/dist/scripts/docs-truthfulness-check.js +11 -12
  75. package/dist/scripts/packlist-performance-check.js +2 -0
  76. package/dist/scripts/release-latency-slo-check.js +7 -3
  77. package/dist/scripts/skill-surface-modernization-check.js +544 -0
  78. package/package.json +2 -3
  79. package/release-gates.v2.json +30 -0
  80. package/runtime-required-scripts.json +10 -0
  81. package/dist/cli/root-fast.js +0 -47
  82. package/dist/commands/aliases.js +0 -2
  83. package/dist/commands/autoresearch.js +0 -5
  84. package/dist/commands/bootstrap.js +0 -2
  85. package/dist/commands/computer-use.js +0 -4
  86. package/dist/commands/context7.js +0 -5
  87. package/dist/commands/deps.js +0 -5
  88. package/dist/commands/dollar-commands.js +0 -2
  89. package/dist/commands/eval.js +0 -5
  90. package/dist/commands/fix-path.js +0 -2
  91. package/dist/commands/gc.js +0 -2
  92. package/dist/commands/goal.js +0 -5
  93. package/dist/commands/gx.js +0 -5
  94. package/dist/commands/postinstall.js +0 -2
  95. package/dist/commands/quickstart.js +0 -2
  96. package/dist/commands/reasoning.js +0 -2
  97. package/dist/commands/run.js +0 -4
  98. package/dist/commands/selftest.js +0 -2
  99. package/dist/commands/setup.js +0 -2
  100. package/dist/commands/skill-dream.js +0 -5
  101. package/dist/commands/stats.js +0 -2
  102. package/dist/commands/trust.js +0 -4
  103. package/dist/commands/usage.js +0 -2
  104. package/dist/commands/validate-artifacts.js +0 -2
  105. package/dist/core/agents/agent-heartbeat.js +0 -1
  106. package/dist/core/codex/app-mentions.js +0 -13
  107. package/dist/core/codex/codex-resume-inventory.js +0 -28
  108. package/dist/core/codex-app/codex-app-provider-badge.js +0 -34
  109. package/dist/core/codex-compat/codex-0-132.js +0 -104
  110. package/dist/core/codex-control/codex-0140-probe-runner.js +0 -4
  111. package/dist/core/codex-control/codex-0140-real-probe-summary.js +0 -11
  112. package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +0 -18
  113. package/dist/core/codex-native/codex-native-capability-cache.js +0 -20
  114. package/dist/core/codex-native/native-media-computer-repair.js +0 -4
  115. package/dist/core/codex-plugins/codex-plugin-cache.js +0 -37
  116. package/dist/core/codex-plugins/codex-plugin-diff.js +0 -72
  117. package/dist/core/commands/command-suggestions.js +0 -12
  118. package/dist/core/commands/telegram-command.js +0 -654
  119. package/dist/core/doctor/macos-tcc-diagnostic.js +0 -18
  120. package/dist/core/dogfood-loop.js +0 -37
  121. package/dist/core/effort-orchestrator.js +0 -111
  122. package/dist/core/from-chat-img-forensics.js +0 -103
  123. package/dist/core/git/git-worktree-cache-policy.js +0 -35
  124. package/dist/core/git/git-worktree-pool.js +0 -26
  125. package/dist/core/local-llm/local-llm-config.js +0 -19
  126. package/dist/core/local-llm/local-llm-prompt-cache.js +0 -11
  127. package/dist/core/local-llm/local-llm-scheduler.js +0 -28
  128. package/dist/core/local-llm/local-llm-warmup.js +0 -19
  129. package/dist/core/loops/loop-iteration-runner.js +0 -1
  130. package/dist/core/remote/codex-public-activity.js +0 -283
  131. package/dist/core/remote/session-binding.js +0 -153
  132. package/dist/core/telegram/bot-api.js +0 -174
  133. package/dist/core/telegram/center-snapshot.js +0 -718
  134. package/dist/core/telegram/config.js +0 -232
  135. package/dist/core/telegram/hub.js +0 -502
  136. package/dist/core/telegram/index.js +0 -12
  137. package/dist/core/telegram/ingress-spool.js +0 -419
  138. package/dist/core/telegram/ledgers.js +0 -366
  139. package/dist/core/telegram/messages.js +0 -318
  140. package/dist/core/telegram/owner-lock.js +0 -137
  141. package/dist/core/telegram/runtime-projection.js +0 -126
  142. package/dist/core/telegram/runtime.js +0 -613
  143. package/dist/core/telegram/service.js +0 -310
  144. package/dist/core/telegram/setup.js +0 -438
  145. package/dist/core/telegram/types.js +0 -1
  146. package/dist/native/sks-menubar/Sources/RemoteTelegramCenterState.swift +0 -447
  147. package/dist/native/sks-menubar/Sources/RemoteTelegramRendering.swift +0 -484
  148. package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +0 -470
  149. package/dist/native/sks-menubar/Sources/TelegramHubSupervisor.swift +0 -469
  150. package/dist/native/sks-menubar/Tests/NativeTelegramRegressionRunner.swift +0 -55
  151. package/dist/native/sks-menubar/Tests/RemoteTelegramCenterStateTests.swift +0 -56
  152. package/dist/native/sks-menubar/Tests/TelegramHubSupervisorTests.swift +0 -55
package/README.md CHANGED
@@ -22,7 +22,7 @@ Proof-first orchestration for Codex CLI, ChatGPT Desktop, AI coding agents, mult
22
22
  Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
23
23
  <!-- END SKS SEARCH VISIBILITY MARKETING -->
24
24
 
25
- This README documents package **SKS 7.6.0** — its own identity, read from `package.json` and verified by the release gate, not advice about what to install.
25
+ This README documents package **SKS 8.0.1** — its own identity, read from `package.json` and subject to release-gate verification, not advice about what to install.
26
26
 
27
27
  Use the official latest stable SKS and Codex CLI releases. SKS stays version-agnostic: older hosts keep working where capabilities allow, while Menu Bar / Center induce updates to the latest stable build. Run `sks update-check` for what is installed and read the capability report for what is actually supported — feature availability is decided by capability probes, not by a version number printed in a document. It resolves managed SKS skills from the authoritative global install, preserves a runnable Naruto child slot when `max_threads=2`, and keeps Menu Bar repair transactional so stamped generations remain verifiable. Naruto uses stable opt-in multi-agent V2 when the host exposes it. Local code search is mode-separated (`sks search files|text|structure|symbol|context`); `context` is answered by the compiled TriWiki Context Graph with evidence paths rather than lexical guessing — see [docs/architecture/context-graph.md](docs/architecture/context-graph.md) and [docs/architecture/search-engine-target.md](docs/architecture/search-engine-target.md). See [CHANGELOG.md](CHANGELOG.md).
28
28
 
@@ -63,17 +63,11 @@ The SKS menu bar shows the installed Codex CLI version and latest known version.
63
63
 
64
64
  **Manage MCP Servers…** opens a native macOS manager for the global `~/.codex/config.toml`. It can add remote URL or local stdio servers, enable/disable existing entries, remove entries after confirmation, and refresh the current state. Mutations are lock-protected, backed up, TOML-validated, and written with mode `0600`; configured environment values and command arguments are never rendered in the list. Changes apply to new Codex sessions. The same plumbing is available through the canonical `sks mcp config list|get|add|edit|duplicate|enable|disable|remove|test|login|logout|backups|restore` surface for diagnostics and automation.
65
65
 
66
- ### Telegram remote coding on this Mac
66
+ ### Remote coding: Orca (external option)
67
67
 
68
- Open **SKS Center Remote & Telegram**, create a bot with BotFather, send `/start` to that bot from the Telegram account you want to pair, then choose **Connect This Project…** and paste the token. SKS verifies the bot, stores the token only in macOS Keychain, pairs only that private chat/user, and registers one dedicated session bound to the current project. Choose **Start Hub**, then send ordinary text to the bot. On the first real message, the Hub creates the Codex thread and starts its first turn in the same App Server connection so the thread is durably resumable; later messages resume that exact thread and return the final response to Telegram.
68
+ SKS no longer provides a first-party Telegram coding bridge. If you want to monitor or steer coding work from another device, consider [Orca](https://github.com/stablyai/orca), an external MIT-licensed project that can launch Codex in a worktree. Orca is not bundled with SKS, supported by SKS, or required to use SKS; SKS adds no Orca dependency or configuration.
69
69
 
70
- Telegram runtime configuration is v2-only. A legacy v1 file cannot start the Hub; Center shows a one-time reconnect prompt, and explicit reconnect/setup atomically writes the verified bot/private-pair identity, token fingerprint, and generation contract as `sks.telegram-config.v2`.
71
-
72
- After connection, Center exposes the registered-session selector, the real user/Codex conversation from that Telegram-bound App Server thread, and a live public activity feed for turn, tool, command, file, search, and subagent lifecycle events. **Older**, **Newer**, and **Latest** page the complete stored turn history through opaque App Server cursors. On Latest, Center checks only the bounded local journal every 2.5 seconds and reloads the heavier App Server conversation when a completed-turn revision changes or the user refreshes/navigates; an older page never jumps away while you read it. The feed intentionally excludes reasoning text, raw tool output, arguments/results, credentials, and paths outside the project, and each page/activity view keeps explicit byte and item bounds. Center also shows the ordinary-text workflow and every supported Telegram command.
73
-
74
- The Hub runs as a user LaunchAgent and uses `caffeinate -i` while the logged-in Mac is available. The Mac still needs to remain powered on, logged in, awake, and network-connected; closing the lid or logging out can stop access. Telegram input has no arbitrary shell path, runs with approvals disabled and network access disabled inside the Codex workspace sandbox, and cannot target an unpaired chat or another project.
75
-
76
- SKS Center is the menu bar companion: install it with `sks menubar install`, then click the SKS icon in the macOS menu bar and choose **Open SKS Control Center…**. Every GUI step above has a CLI equivalent (`sks telegram setup --bot-token-stdin`, `sks telegram hub start`, `sks telegram status`). The hub uses long polling, so a bot with an existing webhook must have that webhook removed before the hub can start; SKS fails closed with `telegram_webhook_conflict` and never clears it automatically. See **[docs/telegram-and-center.md](docs/telegram-and-center.md)** for the complete BotFather setup, optional command menu and privacy-mode guidance, secure token rotation, verification, and troubleshooting.
70
+ Orca's mobile companion and Remote Orca Servers are beta. Their desktop/server runtime remains the source of truth and must keep running; remote access may require a private LAN or Tailscale path. See [the Orca migration and remote-coding guide](docs/orca-remote-coding.md) for scope, setup links, and former Telegram-user migration notes.
77
71
 
78
72
  ## The Front Door
79
73
 
@@ -18,7 +18,6 @@
18
18
  { "id": "control_center_open", "budget_p95_ms": 400, "measured_runs": 5 },
19
19
  { "id": "mcp_static_list", "budget_p95_ms": 250, "measured_runs": 9 },
20
20
  { "id": "update_cache_read", "budget_p95_ms": 50, "measured_runs": 15 },
21
- { "id": "telegram_callback_ack", "budget_p95_ms": 1000, "measured_runs": 7 },
22
21
  { "id": "ssh_worker_hello", "budget_p95_ms": 3000, "measured_runs": 5 }
23
22
  ]
24
23
  }
@@ -259,7 +259,7 @@ dependencies = [
259
259
 
260
260
  [[package]]
261
261
  name = "sks-core"
262
- version = "7.6.0"
262
+ version = "8.0.1"
263
263
  dependencies = [
264
264
  "globset",
265
265
  "grep-matcher",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "7.6.0"
3
+ version = "8.0.1"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -37,7 +37,6 @@ const COMMAND_MANIFEST_LITE_BASE = [
37
37
  { name: 'codex-lb', summary: 'Inspect codex-lb status and circuit health', maturity: 'beta', skipMigrationGate: true },
38
38
  { name: 'menubar', summary: 'Inspect/install/restart/uninstall SKS menu bar', maturity: 'beta', skipMigrationGate: true, allowedDuringActiveRoute: true, diagnostic: true },
39
39
  { name: 'remote', summary: 'Inspect official Remote readiness and run the proof-aware SSH stdio worker', maturity: 'beta' },
40
- { name: 'telegram', summary: 'Pair and run the private local Codex Telegram Hub', maturity: 'beta' },
41
40
  { name: 'hooks', summary: 'Explain and inspect Codex hooks', maturity: 'beta', skipMigrationGate: true },
42
41
  { name: 'zellij-lane', summary: 'Render a Zellij lane frame for SKS sessions', maturity: 'beta' },
43
42
  { name: 'zellij-slot-pane', summary: 'Render a compact Zellij worker slot pane', maturity: 'beta' },
@@ -73,7 +72,7 @@ const COMMAND_MANIFEST_LITE_BASE = [
73
72
  { name: 'versioning', summary: 'Manage release version metadata', maturity: 'stable' },
74
73
  { name: 'reasoning', summary: 'Show reasoning route', maturity: 'labs' },
75
74
  { name: 'aliases', summary: 'Show command aliases', maturity: 'stable' },
76
- { name: 'align', summary: 'Prepare or inspect the $sks-align GPT-5.6 / openai/skills modernization mission', maturity: 'beta', mutatesRouteState: true },
75
+ { name: 'align', summary: 'Prepare or inspect the evidence-gated $sks-align GPT-5.6 / Plugins modernization mission', maturity: 'beta', mutatesRouteState: true },
77
76
  { name: 'selftest', summary: 'Run local mock selftest', maturity: 'stable' },
78
77
  { name: 'goal', summary: 'Print stateless Codex native Goal controls', maturity: 'beta' },
79
78
  { name: 'seo-geo-optimizer', summary: 'Run unified SEO/GEO optimizer audit/plan/apply/verify plus research/strategy (--include-marketing) on the search-visibility kernel', maturity: 'beta' },
@@ -107,7 +106,6 @@ const SAFE_COMMAND_CONTRACT_LITE = {
107
106
  latency: 'normal',
108
107
  supportsJson: false,
109
108
  remoteAllowed: false,
110
- telegramAllowed: false,
111
109
  inputProfile: 'none',
112
110
  requiredCapabilities: []
113
111
  };
@@ -122,8 +120,7 @@ const COMMAND_CONTRACT_OVERRIDES_LITE = {
122
120
  'dollar-commands': { risk: 'R2', latency: 'normal' },
123
121
  eval: { latency: 'long' },
124
122
  gates: {
125
- risk: 'R1', latency: 'long', supportsJson: true, remoteAllowed: true, telegramAllowed: true,
126
- inputProfile: 'gates', requiredCapabilities: ['project.git', 'proof.gates']
123
+ risk: 'R1', latency: 'long', supportsJson: true, remoteAllowed: true, inputProfile: 'gates', requiredCapabilities: ['project.git', 'proof.gates']
127
124
  },
128
125
  harness: { latency: 'long' },
129
126
  'image-ux-review': { latency: 'long' },
@@ -131,8 +128,7 @@ const COMMAND_CONTRACT_OVERRIDES_LITE = {
131
128
  'mad-sks': { risk: 'R3', latency: 'long' },
132
129
  mcp: { risk: 'R2', latency: 'long', supportsJson: true, inputProfile: 'json-only' },
133
130
  naruto: {
134
- risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, telegramAllowed: false,
135
- inputProfile: 'naruto'
131
+ risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, inputProfile: 'naruto'
136
132
  },
137
133
  paths: {
138
134
  supportsJson: true, remoteAllowed: true, inputProfile: 'paths',
@@ -146,13 +142,12 @@ const COMMAND_CONTRACT_OVERRIDES_LITE = {
146
142
  postinstall: { latency: 'long' },
147
143
  ppt: { latency: 'long' },
148
144
  proof: {
149
- risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, telegramAllowed: true,
150
- inputProfile: 'proof', requiredCapabilities: ['proof.read']
145
+ risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, inputProfile: 'proof', requiredCapabilities: ['proof.read']
151
146
  },
152
147
  'qa-loop': { latency: 'long' },
153
148
  recallpulse: { latency: 'long' },
154
149
  release: { risk: 'R1', latency: 'long' },
155
- remote: { risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, telegramAllowed: false, inputProfile: 'json-only' },
150
+ remote: { risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, inputProfile: 'json-only' },
156
151
  research: { latency: 'long' },
157
152
  review: { risk: 'R1' },
158
153
  run: { latency: 'long' },
@@ -162,18 +157,16 @@ const COMMAND_CONTRACT_OVERRIDES_LITE = {
162
157
  requiredCapabilities: ['project.fs.read']
163
158
  },
164
159
  status: {
165
- supportsJson: true, remoteAllowed: true, telegramAllowed: true, inputProfile: 'json-only',
160
+ supportsJson: true, remoteAllowed: true, inputProfile: 'json-only',
166
161
  requiredCapabilities: ['proof.read']
167
162
  },
168
163
  'stop-gate': {
169
- supportsJson: true, remoteAllowed: true, telegramAllowed: true, inputProfile: 'stop-gate',
164
+ supportsJson: true, remoteAllowed: true, inputProfile: 'stop-gate',
170
165
  requiredCapabilities: ['proof.stop-gate']
171
166
  },
172
167
  task: { risk: 'R1', latency: 'long' },
173
- telegram: { risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, telegramAllowed: false, inputProfile: 'json-only' },
174
168
  trust: {
175
- risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, telegramAllowed: true,
176
- inputProfile: 'trust', requiredCapabilities: ['proof.trust']
169
+ risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, inputProfile: 'trust', requiredCapabilities: ['proof.trust']
177
170
  },
178
171
  uninstall: { risk: 'R3', latency: 'long' },
179
172
  update: { latency: 'long' },
@@ -4,7 +4,6 @@ const SAFE_COMMAND_CONTRACT = {
4
4
  latency: 'normal',
5
5
  supportsJson: false,
6
6
  remoteAllowed: false,
7
- telegramAllowed: false,
8
7
  inputProfile: 'none',
9
8
  requiredCapabilities: []
10
9
  };
@@ -134,7 +133,6 @@ function applyCommandManifestContract(commands) {
134
133
  latency: manifest.latency,
135
134
  supportsJson: manifest.supportsJson,
136
135
  remoteAllowed: manifest.remoteAllowed,
137
- telegramAllowed: manifest.telegramAllowed,
138
136
  inputProfile: manifest.inputProfile,
139
137
  requiredCapabilities: [...manifest.requiredCapabilities]
140
138
  });
@@ -187,7 +185,6 @@ const COMMAND_DEFINITIONS = {
187
185
  'codex-lb': skipMigrationGate(entry('beta', 'Inspect codex-lb status and circuit health', 'dist/commands/codex-lb.js', directCommand(() => import('../commands/codex-lb.js'), 'dist/commands/codex-lb.js'))),
188
186
  menubar: activeRouteDiagnostic(entry('beta', 'Inspect/install/restart/uninstall SKS menu bar', 'dist/core/commands/menubar-command.js', subcommand(() => import('../core/commands/menubar-command.js'), 'menubarCommand', 'dist/core/commands/menubar-command.js', 'status'))),
189
187
  remote: entry('beta', 'Inspect official Remote readiness and run the proof-aware SSH stdio worker', 'dist/core/commands/remote-command.js', argsCommand(() => import('../core/commands/remote-command.js'), 'remoteCommand', 'dist/core/commands/remote-command.js')),
190
- telegram: entry('beta', 'Pair and run the private local Codex Telegram Hub', 'dist/core/commands/telegram-command.js', argsCommand(() => import('../core/commands/telegram-command.js'), 'telegramCommand', 'dist/core/commands/telegram-command.js')),
191
188
  hooks: skipMigrationGate(entry('beta', 'Explain and inspect Codex hooks', 'dist/commands/hooks.js', directCommand(() => import('../commands/hooks.js'), 'dist/commands/hooks.js'))),
192
189
  'zellij-lane': entry('beta', 'Render a Zellij lane frame for SKS sessions', 'dist/commands/zellij-lane.js', directCommand(() => import('../commands/zellij-lane.js'), 'dist/commands/zellij-lane.js')),
193
190
  'zellij-slot-pane': entry('beta', 'Render a compact Zellij worker slot pane', 'dist/commands/zellij-slot-pane.js', directCommand(() => import('../commands/zellij-slot-pane.js'), 'dist/commands/zellij-slot-pane.js')),
@@ -223,7 +220,7 @@ const COMMAND_DEFINITIONS = {
223
220
  versioning: entry('stable', 'Manage release version metadata', 'dist/commands/versioning.js', directCommand(() => import('../commands/versioning.js'), 'dist/commands/versioning.js')),
224
221
  reasoning: entry('labs', 'Show reasoning route', 'dist/core/commands/basic-cli.js', basicArgs('reasoningCommand')),
225
222
  aliases: entry('stable', 'Show command aliases', 'dist/core/commands/basic-cli.js', basicNoArgs('aliasesCommand')),
226
- align: routeStateMutator(entry('beta', 'Prepare or inspect the $sks-align GPT-5.6 / openai/skills modernization mission', 'dist/core/commands/align-command.js', subcommand(() => import('../core/commands/align-command.js'), 'alignCommand', 'dist/core/commands/align-command.js', 'prepare')), ['align-gate.json']),
223
+ align: routeStateMutator(entry('beta', 'Prepare or inspect the evidence-gated $sks-align GPT-5.6 / Plugins modernization mission', 'dist/core/commands/align-command.js', subcommand(() => import('../core/commands/align-command.js'), 'alignCommand', 'dist/core/commands/align-command.js', 'prepare')), ['align-gate.json']),
227
224
  selftest: entry('stable', 'Run local mock selftest', 'dist/core/commands/basic-cli.js', basicArgs('selftestCommand')),
228
225
  goal: entry('beta', 'Print stateless Codex native Goal controls', 'dist/core/commands/goal-command.js', subcommand(() => import('../core/commands/goal-command.js'), 'goalCommand', 'dist/core/commands/goal-command.js')),
229
226
  'seo-geo-optimizer': entry('beta', 'Run unified SEO/GEO optimizer audit/plan/apply/verify plus research/strategy (--include-marketing) on the search-visibility kernel', 'dist/core/commands/seo-command.js', argsCommand(() => import('../core/commands/seo-command.js'), 'seoGeoOptimizerCommand', 'dist/core/commands/seo-command.js')),
@@ -266,8 +263,7 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
266
263
  dfix: { latency: 'long' },
267
264
  eval: { latency: 'long' },
268
265
  gates: {
269
- risk: 'R1', latency: 'long', supportsJson: true, remoteAllowed: true, telegramAllowed: true,
270
- inputProfile: 'gates', requiredCapabilities: ['project.git', 'proof.gates']
266
+ risk: 'R1', latency: 'long', supportsJson: true, remoteAllowed: true, inputProfile: 'gates', requiredCapabilities: ['project.git', 'proof.gates']
271
267
  },
272
268
  harness: { latency: 'long' },
273
269
  'image-ux-review': { latency: 'long' },
@@ -275,8 +271,7 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
275
271
  'mad-sks': { risk: 'R3', latency: 'long' },
276
272
  mcp: { risk: 'R2', latency: 'long', supportsJson: true, inputProfile: 'json-only' },
277
273
  naruto: {
278
- risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, telegramAllowed: false,
279
- inputProfile: 'naruto'
274
+ risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, inputProfile: 'naruto'
280
275
  },
281
276
  paths: {
282
277
  supportsJson: true, remoteAllowed: true, inputProfile: 'paths',
@@ -290,13 +285,12 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
290
285
  postinstall: { latency: 'long' },
291
286
  ppt: { latency: 'long' },
292
287
  proof: {
293
- risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, telegramAllowed: true,
294
- inputProfile: 'proof', requiredCapabilities: ['proof.read']
288
+ risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, inputProfile: 'proof', requiredCapabilities: ['proof.read']
295
289
  },
296
290
  'qa-loop': { latency: 'long' },
297
291
  recallpulse: { latency: 'long' },
298
292
  release: { risk: 'R1', latency: 'long' },
299
- remote: { risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, telegramAllowed: false, inputProfile: 'json-only' },
293
+ remote: { risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, inputProfile: 'json-only' },
300
294
  research: { latency: 'long' },
301
295
  review: { risk: 'R1' },
302
296
  run: { latency: 'long' },
@@ -305,18 +299,16 @@ const COMMANDS_WITH_LEGACY_CONTRACT_OVERRIDES = applyCommandContractOverrides(CO
305
299
  requiredCapabilities: ['project.fs.read']
306
300
  },
307
301
  status: {
308
- supportsJson: true, remoteAllowed: true, telegramAllowed: true, inputProfile: 'json-only',
302
+ supportsJson: true, remoteAllowed: true, inputProfile: 'json-only',
309
303
  requiredCapabilities: ['proof.read']
310
304
  },
311
305
  'stop-gate': {
312
- supportsJson: true, remoteAllowed: true, telegramAllowed: true, inputProfile: 'stop-gate',
306
+ supportsJson: true, remoteAllowed: true, inputProfile: 'stop-gate',
313
307
  requiredCapabilities: ['proof.stop-gate']
314
308
  },
315
309
  task: { risk: 'R1', latency: 'long' },
316
- telegram: { risk: 'R2', latency: 'long', supportsJson: true, remoteAllowed: false, telegramAllowed: false, inputProfile: 'json-only' },
317
310
  trust: {
318
- risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, telegramAllowed: true,
319
- inputProfile: 'trust', requiredCapabilities: ['proof.trust']
311
+ risk: 'R0', latency: 'fast', supportsJson: true, remoteAllowed: true, inputProfile: 'trust', requiredCapabilities: ['proof.trust']
320
312
  },
321
313
  uninstall: { risk: 'R3', latency: 'long' },
322
314
  update: { latency: 'long' },
@@ -212,9 +212,6 @@ export function safeReadOnlySubcommand(command, args) {
212
212
  if (command === 'remote' && ['machines', 'machine'].includes(sub) && ['list', 'validate'].includes(nested)) {
213
213
  return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
214
214
  }
215
- if (command === 'telegram' && (sub === 'center-snapshot' || sub === 'center-live' || sub === 'validate-config' || (sub === 'hub' && nested === 'status'))) {
216
- return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
217
- }
218
215
  if (!['status', 'show', 'list', 'observe', 'watch', 'doctor', 'help'].includes(sub))
219
216
  return false;
220
217
  return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
@@ -777,11 +777,16 @@ async function readDeepEvidenceOptions(args = []) {
777
777
  : []
778
778
  };
779
779
  }
780
- function controllerOptions(args = []) {
780
+ export function controllerOptions(args = []) {
781
781
  const rawGatewayAuth = flag(args, '--compat-bearer')
782
782
  ? 'authorization-bearer-compat'
783
- : normalizeGatewayAuthChoice(readOption(args, '--gateway-auth', readOption(args, '--gateway-auth-transport', 'x-codex-lb-api-key')));
784
- const gatewayAuthTransport = parseCodexLbGatewayAuthTransport(rawGatewayAuth);
783
+ : (() => {
784
+ const explicit = readOption(args, '--gateway-auth', readOption(args, '--gateway-auth-transport', null));
785
+ return explicit === null ? null : normalizeGatewayAuthChoice(explicit);
786
+ })();
787
+ const gatewayAuthTransport = rawGatewayAuth === null
788
+ ? null
789
+ : parseCodexLbGatewayAuthTransport(rawGatewayAuth);
785
790
  const home = readOption(args, '--home', null);
786
791
  const configPath = readOption(args, '--config', readOption(args, '--config-path', null));
787
792
  const authPath = readOption(args, '--auth', readOption(args, '--auth-path', null));
@@ -799,7 +804,7 @@ function controllerOptions(args = []) {
799
804
  const capabilityTimeoutText = readOption(args, '--capability-timeout-ms', null);
800
805
  const capabilityTimeoutMs = capabilityTimeoutText === null ? null : Number(capabilityTimeoutText);
801
806
  return {
802
- gatewayAuthTransport,
807
+ ...(gatewayAuthTransport ? { gatewayAuthTransport } : {}),
803
808
  restartApp: flag(args, '--restart-app') || flag(args, '--restart'),
804
809
  networkProbes: !flag(args, '--no-network'),
805
810
  ...(home ? { home: String(home) } : {}),
@@ -816,7 +821,7 @@ function controllerOptions(args = []) {
816
821
  settings: {
817
822
  ...(normalizedListenHost ? { listen_host: normalizedListenHost } : {}),
818
823
  ...(listenPort !== null && Number.isInteger(listenPort) ? { listen_port: listenPort } : {}),
819
- gateway_auth_transport: gatewayAuthTransport
824
+ ...(gatewayAuthTransport ? { gateway_auth_transport: gatewayAuthTransport } : {})
820
825
  }
821
826
  }
822
827
  : {})
@@ -35,6 +35,7 @@ export function doctorPhaseIdsForProfile(profile) {
35
35
  const required = [
36
36
  'codex_startup_repair',
37
37
  'startup_config_repair',
38
+ 'codex_config_syntax_repair',
38
39
  'context7_repair',
39
40
  'context7_mcp_repair',
40
41
  'hook_trust_repair',
@@ -559,6 +559,20 @@ async function runDoctor(args = [], root, doctorFix) {
559
559
  : null;
560
560
  const codexDoctorDiff = compareCodexDoctorBridge(codexDoctorBefore, preRepairCodexDoctor);
561
561
  codexStartupRepair = mergeObservedCodexStartupWarnings(codexStartupRepair, preRepairCodexDoctor);
562
+ const codexConfigSyntaxRepair = doctorPhaseIds.includes('codex_config_syntax_repair')
563
+ ? await (await import('../core/doctor/codex-config-syntax-repair.js')).runCodexConfigSyntaxRepair({ root, fix: doctorFix }).catch((err) => ({
564
+ schema: 'sks.codex-config-syntax-repair.v1',
565
+ ok: false,
566
+ generated_at: new Date().toISOString(),
567
+ fix: doctorFix,
568
+ configs: [],
569
+ actions: [],
570
+ manual_actions: [],
571
+ blockers: [err?.message || String(err)],
572
+ warnings: [],
573
+ report_path: `${root}/.sneakoscope/reports/codex-config-syntax-repair.json`
574
+ }))
575
+ : null;
562
576
  const codex = codexBin
563
577
  ? { bin: codexBin, version: 'fixture-or-explicit', available: true }
564
578
  : await getCodexInfo().catch(() => ({ bin: null, version: null, available: false }));
@@ -858,6 +872,17 @@ async function runDoctor(args = [], root, doctorFix) {
858
872
  rollback_evidence: startupConfigRepair?.backup_path || 'startup_config_repair_idempotent_report'
859
873
  })
860
874
  },
875
+ {
876
+ id: 'codex_config_syntax_repair',
877
+ run: async () => ({
878
+ id: 'codex_config_syntax_repair',
879
+ ok: codexConfigSyntaxRepair?.ok !== false,
880
+ repaired: doctorFix && (codexConfigSyntaxRepair?.configs || []).some((entry) => entry.changed),
881
+ blockers: codexConfigSyntaxRepair?.blockers || [],
882
+ warnings: codexConfigSyntaxRepair?.warnings || [],
883
+ rollback_evidence: codexConfigSyntaxRepair?.report_path || 'codex_config_syntax_repair_report'
884
+ })
885
+ },
861
886
  {
862
887
  id: 'context7_repair',
863
888
  run: async () => ({
@@ -1232,6 +1257,7 @@ async function runDoctor(args = [], root, doctorFix) {
1232
1257
  context7_repair: context7Repair,
1233
1258
  codex_startup_repair: codexStartupRepair,
1234
1259
  startup_config_repair: startupConfigRepair,
1260
+ codex_config_syntax_repair: codexConfigSyntaxRepair,
1235
1261
  context7_mcp_repair: context7McpRepair,
1236
1262
  supabase_mcp_repair: supabaseMcpRepair,
1237
1263
  doctor_fix_transaction: doctorFixTransaction,
@@ -1254,6 +1280,7 @@ async function runDoctor(args = [], root, doctorFix) {
1254
1280
  ...(configRepair?.operator_actions || []),
1255
1281
  ...(zellijRepair && !zellijRepair.ok && zellijRepair.command ? [`Run: ${zellijRepair.command}`] : []),
1256
1282
  ...(codexStartupRepair.manual_actions || []),
1283
+ ...(codexConfigSyntaxRepair?.manual_actions || []),
1257
1284
  ...(pluginPolicy?.doctor_warnings || [])
1258
1285
  ]
1259
1286
  });
@@ -1310,6 +1337,7 @@ async function runDoctor(args = [], root, doctorFix) {
1310
1337
  && (!sksUpdate || sksUpdate.ok !== false)
1311
1338
  && commandAliasCleanup.ok !== false
1312
1339
  && codexStartupRepair.ok !== false
1340
+ && codexConfigSyntaxRepair?.ok !== false
1313
1341
  && agentRoleConfigRepair.ok !== false
1314
1342
  && openRouterProviderRepair.ok !== false
1315
1343
  && (officialSubagentConfig.blockers || []).length === 0
@@ -1345,6 +1373,7 @@ async function runDoctor(args = [], root, doctorFix) {
1345
1373
  context7_repair: context7Repair,
1346
1374
  codex_startup_repair: codexStartupRepair,
1347
1375
  startup_config_repair: startupConfigRepair,
1376
+ codex_config_syntax_repair: codexConfigSyntaxRepair,
1348
1377
  context7_mcp_repair: context7McpRepair,
1349
1378
  supabase_mcp_repair: supabaseMcpRepair,
1350
1379
  doctor_fix_transaction: doctorFixTransaction,
@@ -1443,6 +1472,16 @@ async function runDoctor(args = [], root, doctorFix) {
1443
1472
  console.log(` manual: ${action}`);
1444
1473
  for (const warning of codexStartupRepair.warnings || [])
1445
1474
  console.log(` warning: ${warning}`);
1475
+ if (codexConfigSyntaxRepair) {
1476
+ console.log('Codex config syntax:');
1477
+ console.log(` repair: ${codexConfigSyntaxRepair.ok ? 'ok' : 'blocked'}`);
1478
+ for (const action of codexConfigSyntaxRepair.actions || [])
1479
+ console.log(` - ${action}`);
1480
+ for (const action of codexConfigSyntaxRepair.manual_actions || [])
1481
+ console.log(` manual: ${action}`);
1482
+ for (const warning of codexConfigSyntaxRepair.warnings || [])
1483
+ console.log(` warning: ${warning}`);
1484
+ }
1446
1485
  console.log(` codex doctor: ${formatCodexDoctorConsoleStatus(authoritativeCodexDoctor)}`);
1447
1486
  console.log(`Rust acc.: ${rust.mode || (rust.available ? 'rust_accelerated' : 'js_fallback')} ${rust.version || rust.status || ''}`);
1448
1487
  console.log(`Codex App: ${ready.codex_app_ready ? 'ok' : 'optional_missing'}`);