sneakoscope 7.6.0 → 8.0.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 (147) 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/config/skills-manifest.json +59 -59
  10. package/dist/core/agent-bridge/agent-manifest.js +6 -11
  11. package/dist/core/align/align-route.js +471 -40
  12. package/dist/core/codex-app/menubar/constants.js +1 -4
  13. package/dist/core/codex-app/menubar/installer.js +20 -1
  14. package/dist/core/codex-app/menubar/migration.js +241 -1
  15. package/dist/core/codex-app/menubar/status.js +19 -1
  16. package/dist/core/codex-lb/capability-runner.js +15 -4
  17. package/dist/core/codex-lb/desktop-controller.js +91 -23
  18. package/dist/core/codex-lb/probes/bridge-probe.js +3 -1
  19. package/dist/core/codex-lb/probes/catalog-probe.js +21 -10
  20. package/dist/core/codex-lb/probes/cli-image-tool-probe.js +200 -0
  21. package/dist/core/codex-lb/probes/image-generation-probe.js +10 -4
  22. package/dist/core/codex-native/core-skill-manifest.js +35 -10
  23. package/dist/core/commands/align-command.js +115 -19
  24. package/dist/core/commands/mad-sks-command.js +30 -28
  25. package/dist/core/commands/mad-sks-headless.js +44 -0
  26. package/dist/core/commands/remote-command.js +5 -4
  27. package/dist/core/db-safety.js +10 -0
  28. package/dist/core/doctor/retired-managed-residue-private.js +1 -1
  29. package/dist/core/doctor/retired-managed-residue-state.js +3 -1
  30. package/dist/core/feature-fixtures.js +5 -8
  31. package/dist/core/imagegen/imagegen-capability.js +16 -2
  32. package/dist/core/imagegen/require-imagegen.js +2 -1
  33. package/dist/core/init/skills.js +21 -17
  34. package/dist/core/install/installed-package-smoke.js +1 -1
  35. package/dist/core/locks/file-lock.js +27 -11
  36. package/dist/core/perf/release-latency-slo.js +1 -60
  37. package/dist/core/pipeline-internals/runtime-core.js +12 -3
  38. package/dist/core/release/release-gate-contract.js +1 -0
  39. package/dist/core/release/release-pack-receipt.js +2 -0
  40. package/dist/core/release/release-upgrade-baseline.js +3 -3
  41. package/dist/core/remote/index.js +0 -2
  42. package/dist/core/remote/owner-proof.js +2 -2
  43. package/dist/core/remote/protocol.js +2 -2
  44. package/dist/core/remote/types.js +2 -3
  45. package/dist/core/remote/worker.js +11 -387
  46. package/dist/core/routes/dollar-manifest-lite.js +1 -1
  47. package/dist/core/routes.js +3 -4
  48. package/dist/core/safety/command-contract/contracts.js +4 -9
  49. package/dist/core/skill-forge.js +21 -6
  50. package/dist/core/skills/skill-agent-metadata.js +348 -0
  51. package/dist/core/stop-gate/stop-gate-resolver.js +47 -2
  52. package/dist/core/subagents/official-subagent-prompt.js +32 -74
  53. package/dist/core/triwiki/context-graph/extractors/topology/commands.js +0 -1
  54. package/dist/core/update/update-migration-state.js +17 -4
  55. package/dist/core/update-check.js +17 -2
  56. package/dist/core/version.js +1 -1
  57. package/dist/core/work-order-ledger.js +7 -1
  58. package/dist/core/zellij/zellij-official-subagent-activity.js +53 -0
  59. package/dist/native/sks-menubar/Sources/AppDelegate.swift +0 -9
  60. package/dist/native/sks-menubar/Sources/ControlCenterWindowController.swift +1 -6
  61. package/dist/native/sks-menubar/Sources/OverviewSummary.swift +0 -27
  62. package/dist/native/sks-menubar/Sources/OverviewViewController.swift +9 -16
  63. package/dist/native/sks-menubar/Sources/ProcessClient.swift +2 -9
  64. package/dist/native/sks-menubar/Sources/ProvidersViewController.swift +15 -1
  65. package/dist/native/sks-menubar/Sources/RemoteCodingViewController.swift +49 -0
  66. package/dist/native/sks-menubar/Sources/SidebarItem.swift +2 -2
  67. package/dist/native/sks-menubar/Tests/ProcessClientTests.swift +0 -17
  68. package/dist/scripts/current-command-surface-check.js +4 -2
  69. package/dist/scripts/docs-truthfulness-check.js +11 -12
  70. package/dist/scripts/packlist-performance-check.js +2 -0
  71. package/dist/scripts/release-latency-slo-check.js +7 -3
  72. package/dist/scripts/skill-surface-modernization-check.js +544 -0
  73. package/package.json +2 -3
  74. package/release-gates.v2.json +30 -0
  75. package/runtime-required-scripts.json +10 -0
  76. package/dist/cli/root-fast.js +0 -47
  77. package/dist/commands/aliases.js +0 -2
  78. package/dist/commands/autoresearch.js +0 -5
  79. package/dist/commands/bootstrap.js +0 -2
  80. package/dist/commands/computer-use.js +0 -4
  81. package/dist/commands/context7.js +0 -5
  82. package/dist/commands/deps.js +0 -5
  83. package/dist/commands/dollar-commands.js +0 -2
  84. package/dist/commands/eval.js +0 -5
  85. package/dist/commands/fix-path.js +0 -2
  86. package/dist/commands/gc.js +0 -2
  87. package/dist/commands/goal.js +0 -5
  88. package/dist/commands/gx.js +0 -5
  89. package/dist/commands/postinstall.js +0 -2
  90. package/dist/commands/quickstart.js +0 -2
  91. package/dist/commands/reasoning.js +0 -2
  92. package/dist/commands/run.js +0 -4
  93. package/dist/commands/selftest.js +0 -2
  94. package/dist/commands/setup.js +0 -2
  95. package/dist/commands/skill-dream.js +0 -5
  96. package/dist/commands/stats.js +0 -2
  97. package/dist/commands/trust.js +0 -4
  98. package/dist/commands/usage.js +0 -2
  99. package/dist/commands/validate-artifacts.js +0 -2
  100. package/dist/core/agents/agent-heartbeat.js +0 -1
  101. package/dist/core/codex/app-mentions.js +0 -13
  102. package/dist/core/codex/codex-resume-inventory.js +0 -28
  103. package/dist/core/codex-app/codex-app-provider-badge.js +0 -34
  104. package/dist/core/codex-compat/codex-0-132.js +0 -104
  105. package/dist/core/codex-control/codex-0140-probe-runner.js +0 -4
  106. package/dist/core/codex-control/codex-0140-real-probe-summary.js +0 -11
  107. package/dist/core/codex-control/codex-multi-agent-event-normalizer.js +0 -18
  108. package/dist/core/codex-native/codex-native-capability-cache.js +0 -20
  109. package/dist/core/codex-native/native-media-computer-repair.js +0 -4
  110. package/dist/core/codex-plugins/codex-plugin-cache.js +0 -37
  111. package/dist/core/codex-plugins/codex-plugin-diff.js +0 -72
  112. package/dist/core/commands/command-suggestions.js +0 -12
  113. package/dist/core/commands/telegram-command.js +0 -654
  114. package/dist/core/doctor/macos-tcc-diagnostic.js +0 -18
  115. package/dist/core/dogfood-loop.js +0 -37
  116. package/dist/core/effort-orchestrator.js +0 -111
  117. package/dist/core/from-chat-img-forensics.js +0 -103
  118. package/dist/core/git/git-worktree-cache-policy.js +0 -35
  119. package/dist/core/git/git-worktree-pool.js +0 -26
  120. package/dist/core/local-llm/local-llm-config.js +0 -19
  121. package/dist/core/local-llm/local-llm-prompt-cache.js +0 -11
  122. package/dist/core/local-llm/local-llm-scheduler.js +0 -28
  123. package/dist/core/local-llm/local-llm-warmup.js +0 -19
  124. package/dist/core/loops/loop-iteration-runner.js +0 -1
  125. package/dist/core/remote/codex-public-activity.js +0 -283
  126. package/dist/core/remote/session-binding.js +0 -153
  127. package/dist/core/telegram/bot-api.js +0 -174
  128. package/dist/core/telegram/center-snapshot.js +0 -718
  129. package/dist/core/telegram/config.js +0 -232
  130. package/dist/core/telegram/hub.js +0 -502
  131. package/dist/core/telegram/index.js +0 -12
  132. package/dist/core/telegram/ingress-spool.js +0 -419
  133. package/dist/core/telegram/ledgers.js +0 -366
  134. package/dist/core/telegram/messages.js +0 -318
  135. package/dist/core/telegram/owner-lock.js +0 -137
  136. package/dist/core/telegram/runtime-projection.js +0 -126
  137. package/dist/core/telegram/runtime.js +0 -613
  138. package/dist/core/telegram/service.js +0 -310
  139. package/dist/core/telegram/setup.js +0 -438
  140. package/dist/core/telegram/types.js +0 -1
  141. package/dist/native/sks-menubar/Sources/RemoteTelegramCenterState.swift +0 -447
  142. package/dist/native/sks-menubar/Sources/RemoteTelegramRendering.swift +0 -484
  143. package/dist/native/sks-menubar/Sources/RemoteTelegramViewController.swift +0 -470
  144. package/dist/native/sks-menubar/Sources/TelegramHubSupervisor.swift +0 -469
  145. package/dist/native/sks-menubar/Tests/NativeTelegramRegressionRunner.swift +0 -55
  146. package/dist/native/sks-menubar/Tests/RemoteTelegramCenterStateTests.swift +0 -56
  147. package/dist/native/sks-menubar/Tests/TelegramHubSupervisorTests.swift +0 -55
@@ -1,89 +1,325 @@
1
+ import fs from 'node:fs';
1
2
  import path from 'node:path';
2
- import { nowIso, readJson, writeJsonAtomic } from '../fsx.js';
3
+ import { commandManifestNames } from '../../cli/command-manifest-lite.js';
4
+ import { nowIso, readJson, sha256, writeJsonAtomic } from '../fsx.js';
5
+ import { MANAGED_ROUTE_SKILL_NAMES } from '../routes.js';
3
6
  export const ALIGN_PLAN_ARTIFACT = 'align-plan.json';
4
7
  export const ALIGN_LEDGER_ARTIFACT = 'align-ledger.json';
5
8
  export const ALIGN_GATE_ARTIFACT = 'align-gate.json';
6
- export const ALIGN_OFFICIAL_GUIDES = Object.freeze([
7
- 'https://developers.openai.com/api/docs/guides/latest-model',
8
- 'https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling',
9
- 'https://developers.openai.com/api/docs/guides/agents',
10
- 'https://github.com/openai/skills'
9
+ export const ALIGN_OFFICIAL_SOURCES = Object.freeze([
10
+ Object.freeze({
11
+ source_id: 'gpt_5_6_migration_prompting',
12
+ url: 'https://developers.openai.com/api/docs/guides/latest-model'
13
+ }),
14
+ Object.freeze({
15
+ source_id: 'programmatic_tool_calling',
16
+ url: 'https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling'
17
+ }),
18
+ Object.freeze({
19
+ source_id: 'agents_guide',
20
+ url: 'https://developers.openai.com/api/docs/guides/agents'
21
+ }),
22
+ Object.freeze({
23
+ source_id: 'codex_skills',
24
+ url: 'https://developers.openai.com/codex/skills'
25
+ }),
26
+ Object.freeze({
27
+ source_id: 'codex_plugins',
28
+ url: 'https://developers.openai.com/codex/plugins'
29
+ }),
30
+ Object.freeze({
31
+ source_id: 'openai_plugins_repository',
32
+ url: 'https://github.com/openai/plugins'
33
+ })
34
+ ]);
35
+ export const ALIGN_DEPRECATED_MIGRATION_SOURCES = Object.freeze([
36
+ Object.freeze({
37
+ source_id: 'openai_skills_repository',
38
+ url: 'https://github.com/openai/skills',
39
+ disposition: 'deprecated_migration_evidence'
40
+ })
11
41
  ]);
12
42
  export const ALIGN_WORKSTREAMS = Object.freeze([
13
43
  'latest_model_prompt_grammar',
14
44
  'programmatic_tool_calling',
15
45
  'agents_guidance',
16
- 'openai_skills_and_plugins',
46
+ 'plugins_guidance_and_skills_migration',
17
47
  'latest_only_cleanup',
18
48
  'deduplicate_prompt_config'
19
49
  ]);
50
+ export const ALIGN_REQUIRED_VERIFICATIONS = Object.freeze([
51
+ 'typecheck',
52
+ 'build',
53
+ 'focused_tests',
54
+ 'skill_surface_audit',
55
+ 'release_affected'
56
+ ]);
57
+ export const ALIGN_PROMPT_EVALUATION_MIN_CASES = 12;
20
58
  export function buildAlignPlan(missionId, task) {
59
+ const surfaceInventory = buildAlignSurfaceInventory();
21
60
  return {
22
- schema: 'sks.align-plan.v1',
23
- schema_version: 1,
61
+ schema: 'sks.align-plan.v2',
62
+ schema_version: 2,
24
63
  generated_at: nowIso(),
25
64
  mission_id: missionId,
26
65
  task: String(task || '').trim() || 'Align SKS prompts, settings, and skills to the latest GPT-5.6 official guides',
27
- official_guides: ALIGN_OFFICIAL_GUIDES,
66
+ official_sources: ALIGN_OFFICIAL_SOURCES,
67
+ deprecated_migration_sources: ALIGN_DEPRECATED_MIGRATION_SOURCES,
28
68
  workstreams: ALIGN_WORKSTREAMS,
69
+ required_verifications: ALIGN_REQUIRED_VERIFICATIONS,
70
+ prompt_evaluation_min_cases: ALIGN_PROMPT_EVALUATION_MIN_CASES,
71
+ surface_inventory: surfaceInventory,
29
72
  policy: {
30
73
  latest_only: true,
31
74
  no_legacy_compat: true,
32
75
  deduplicate: true,
33
- immutable_core_skills_protected: true
76
+ immutable_core_skills_protected: true,
77
+ exhaustive_command_skill_audit: true,
78
+ evidence_required: true
34
79
  },
35
80
  next_actions: [
36
- 'Fetch and apply the latest GPT-5.6 prompting / programmatic tool calling / agents guides',
37
- 'Deep-analyze openai/skills and current Plugins guidance, then improve every SKS command/skill surface',
38
- 'Keep latest-version only: delete unnecessary legacy settings and compatibility knobs',
39
- 'Deduplicate redundant prompt and config content',
40
- 'Protect immutable core skills (mutable_by_doctor/update/setup=false)',
41
- 'Record align-ledger.json and pass align-gate.json, then finish with Honest Mode'
81
+ 'Retrieve every exact official source and record a receipt with evidence',
82
+ 'Apply GPT-5.6 prompting, programmatic tool calling, Agents, Codex Skills, and Codex Plugins guidance',
83
+ 'Treat openai/skills only as deprecated migration evidence; use openai/plugins as the active repository',
84
+ 'Audit the plan-sealed command and skill inventories with exact exhaustive receipts and zero missing surfaces',
85
+ 'Record evidence-backed Programmatic Tool Calling and Agents SDK adoption decisions',
86
+ `Run at least ${ALIGN_PROMPT_EVALUATION_MIN_CASES} prompt evaluation cases, immutable core integrity, and verification checks`,
87
+ 'Record changed paths; keep latest-version only, delete legacy settings, and record deduplication results or an evidenced none-required review',
88
+ 'Pass align-gate.json with mission-consistent evidence and no blockers, then finish with Honest Mode'
42
89
  ]
43
90
  };
44
91
  }
45
92
  export function buildAlignLedgerSeed(missionId) {
93
+ const surfaceInventory = buildAlignSurfaceInventory();
94
+ const emptyCoverage = (inventory) => ({
95
+ receipt_kind: 'exhaustive_inventory_audit',
96
+ inventory_sha256: inventory.sha256,
97
+ expected_count: inventory.count,
98
+ audited_count: 0,
99
+ audited_surfaces: [],
100
+ missing_surfaces: [...inventory.surfaces],
101
+ evidence: []
102
+ });
103
+ const pendingDecision = () => ({
104
+ decision: 'pending',
105
+ reason: '',
106
+ evidence: []
107
+ });
46
108
  return {
47
- schema: 'sks.align-ledger.v1',
48
- schema_version: 1,
109
+ schema: 'sks.align-ledger.v2',
110
+ schema_version: 2,
49
111
  generated_at: nowIso(),
50
112
  mission_id: missionId,
51
- completed_workstreams: [],
113
+ workstream_receipts: ALIGN_WORKSTREAMS.map((workstream) => ({
114
+ workstream,
115
+ status: 'pending',
116
+ evidence: []
117
+ })),
118
+ official_source_receipts: [],
119
+ deprecated_source_receipts: [],
120
+ surface_coverage: {
121
+ commands: emptyCoverage(surfaceInventory.commands),
122
+ skills: emptyCoverage(surfaceInventory.skills)
123
+ },
124
+ decisions: {
125
+ programmatic_tool_calling: pendingDecision(),
126
+ agents_sdk: pendingDecision()
127
+ },
128
+ prompt_evaluation: {
129
+ status: 'pending',
130
+ cases_expected: 0,
131
+ cases_passed: 0,
132
+ failures: [],
133
+ evidence: []
134
+ },
135
+ immutable_core_integrity: {
136
+ status: 'pending',
137
+ evidence: []
138
+ },
139
+ verification_receipts: [],
52
140
  changed_paths: [],
141
+ change_review: {
142
+ outcome: 'pending',
143
+ evidence: []
144
+ },
53
145
  deleted_legacy_settings: [],
54
146
  deduplicated_surfaces: [],
147
+ deduplication_review: {
148
+ outcome: 'pending',
149
+ reviewed_surfaces: [],
150
+ evidence: []
151
+ },
55
152
  blockers: [],
56
153
  notes: []
57
154
  };
58
155
  }
59
- export function evaluateAlignGate(plan, ledger, missionId) {
156
+ export function evaluateAlignGate(plan, ledger, missionId, options = {}) {
60
157
  const blockers = [];
61
- const planPresent = Boolean(plan && plan.schema === 'sks.align-plan.v1');
62
- const ledgerPresent = Boolean(ledger && ledger.schema === 'sks.align-ledger.v1');
158
+ const officialSourceReceipts = arrayOrEmpty(ledger?.official_source_receipts);
159
+ const deprecatedSourceReceipts = arrayOrEmpty(ledger?.deprecated_source_receipts);
160
+ const workstreamReceipts = arrayOrEmpty(ledger?.workstream_receipts);
161
+ const verificationReceipts = arrayOrEmpty(ledger?.verification_receipts);
162
+ const currentSurfaceInventory = buildAlignSurfaceInventory();
163
+ const planPresent = Boolean(plan && plan.schema === 'sks.align-plan.v2' && plan.schema_version === 2);
164
+ const ledgerPresent = Boolean(ledger && ledger.schema === 'sks.align-ledger.v2' && ledger.schema_version === 2);
63
165
  if (!planPresent)
64
- blockers.push('align_plan_missing');
166
+ blockers.push('align_plan_v2_missing');
65
167
  if (!ledgerPresent)
66
- blockers.push('align_ledger_missing');
67
- const completed = new Set(ledger?.completed_workstreams || []);
68
- const workstreamsComplete = ALIGN_WORKSTREAMS.every((item) => completed.has(item));
69
- if (ledgerPresent && !workstreamsComplete)
70
- blockers.push('align_workstreams_incomplete');
168
+ blockers.push('align_ledger_v2_missing');
169
+ const missionIdConsistent = Boolean(planPresent
170
+ && ledgerPresent
171
+ && missionId
172
+ && plan?.mission_id === missionId
173
+ && ledger?.mission_id === missionId);
174
+ if (planPresent && ledgerPresent && !missionIdConsistent)
175
+ blockers.push('align_mission_id_mismatch');
176
+ const artifactMetadataValid = Boolean(planPresent
177
+ && ledgerPresent
178
+ && isIsoTimestamp(plan?.generated_at)
179
+ && isIsoTimestamp(ledger?.generated_at)
180
+ && isNonEmptyString(plan?.task));
181
+ if (!artifactMetadataValid)
182
+ blockers.push('align_artifact_metadata_invalid');
183
+ const officialSourcePlanComplete = hasExactSourceSet(plan?.official_sources, ALIGN_OFFICIAL_SOURCES);
184
+ if (!officialSourcePlanComplete)
185
+ blockers.push('align_official_source_plan_incomplete');
186
+ const deprecatedSourcePlanComplete = hasExactDeprecatedSourceSet(plan?.deprecated_migration_sources, ALIGN_DEPRECATED_MIGRATION_SOURCES);
187
+ if (!deprecatedSourcePlanComplete)
188
+ blockers.push('align_deprecated_source_plan_incomplete');
189
+ const workstreamPlanComplete = exactStringSet(plan?.workstreams, ALIGN_WORKSTREAMS);
190
+ if (!workstreamPlanComplete)
191
+ blockers.push('align_workstream_plan_incomplete');
192
+ const surfaceInventoryPlanComplete = inventoryMatches(plan?.surface_inventory?.commands, currentSurfaceInventory.commands) && inventoryMatches(plan?.surface_inventory?.skills, currentSurfaceInventory.skills);
193
+ if (!surfaceInventoryPlanComplete)
194
+ blockers.push('align_surface_inventory_plan_stale_or_incomplete');
195
+ const verificationPlanComplete = exactStringSet(plan?.required_verifications, ALIGN_REQUIRED_VERIFICATIONS);
196
+ if (!verificationPlanComplete)
197
+ blockers.push('align_required_verification_plan_incomplete');
198
+ const promptEvaluationPlanComplete = (plan?.prompt_evaluation_min_cases === ALIGN_PROMPT_EVALUATION_MIN_CASES);
199
+ if (!promptEvaluationPlanComplete)
200
+ blockers.push('align_prompt_evaluation_plan_incomplete');
201
+ const policyContractComplete = Boolean(plan?.policy?.latest_only === true
202
+ && plan?.policy?.no_legacy_compat === true
203
+ && plan?.policy?.deduplicate === true
204
+ && plan?.policy?.immutable_core_skills_protected === true
205
+ && plan?.policy?.exhaustive_command_skill_audit === true
206
+ && plan?.policy?.evidence_required === true);
207
+ if (!policyContractComplete)
208
+ blockers.push('align_policy_contract_incomplete');
209
+ const deprecatedUrl = ALIGN_DEPRECATED_MIGRATION_SOURCES[0].url;
210
+ const deprecatedSourceNotActive = !containsUrl(plan?.official_sources, deprecatedUrl)
211
+ && !containsUrl(officialSourceReceipts, deprecatedUrl);
212
+ if (!deprecatedSourceNotActive)
213
+ blockers.push('deprecated_openai_skills_source_active');
214
+ const officialSourceReceiptsComplete = ALIGN_OFFICIAL_SOURCES.every((required) => {
215
+ const matches = officialSourceReceipts.filter((receipt) => (receipt?.source_id === required.source_id && receipt?.url === required.url));
216
+ return matches.length === 1
217
+ && matches[0]?.status === 'verified'
218
+ && isIsoTimestamp(matches[0]?.retrieved_at)
219
+ && evidenceComplete(matches[0]?.evidence, options);
220
+ }) && officialSourceReceipts.length === ALIGN_OFFICIAL_SOURCES.length;
221
+ if (!officialSourceReceiptsComplete)
222
+ blockers.push('align_official_source_receipts_incomplete');
223
+ const deprecatedSourceMigrationRecorded = ALIGN_DEPRECATED_MIGRATION_SOURCES.every((required) => {
224
+ const matches = deprecatedSourceReceipts.filter((receipt) => (receipt?.source_id === required.source_id && receipt?.url === required.url));
225
+ return matches.length === 1
226
+ && matches[0]?.disposition === required.disposition
227
+ && evidenceComplete(matches[0]?.evidence, options);
228
+ }) && deprecatedSourceReceipts.length === ALIGN_DEPRECATED_MIGRATION_SOURCES.length;
229
+ if (!deprecatedSourceMigrationRecorded)
230
+ blockers.push('deprecated_openai_skills_migration_evidence_missing');
231
+ const workstreamsComplete = ALIGN_WORKSTREAMS.every((required) => {
232
+ const matches = workstreamReceipts.filter((receipt) => receipt?.workstream === required);
233
+ return matches.length === 1
234
+ && matches[0]?.status === 'complete'
235
+ && evidenceComplete(matches[0]?.evidence, options);
236
+ }) && workstreamReceipts.length === ALIGN_WORKSTREAMS.length;
237
+ if (!workstreamsComplete)
238
+ blockers.push('align_workstream_evidence_incomplete');
239
+ const commandCoverageComplete = coverageComplete(ledger?.surface_coverage?.commands, plan?.surface_inventory?.commands, currentSurfaceInventory.commands, options);
240
+ const skillCoverageComplete = coverageComplete(ledger?.surface_coverage?.skills, plan?.surface_inventory?.skills, currentSurfaceInventory.skills, options);
241
+ if (!commandCoverageComplete)
242
+ blockers.push('align_command_surface_coverage_incomplete');
243
+ if (!skillCoverageComplete)
244
+ blockers.push('align_skill_surface_coverage_incomplete');
245
+ const programmaticToolCallingDecisionRecorded = decisionComplete(ledger?.decisions?.programmatic_tool_calling, options);
246
+ const agentsSdkDecisionRecorded = decisionComplete(ledger?.decisions?.agents_sdk, options);
247
+ if (!programmaticToolCallingDecisionRecorded)
248
+ blockers.push('align_programmatic_tool_calling_decision_missing');
249
+ if (!agentsSdkDecisionRecorded)
250
+ blockers.push('align_agents_sdk_decision_missing');
251
+ const promptEvaluationPassed = Boolean(promptEvaluationPlanComplete
252
+ && ledger?.prompt_evaluation?.status === 'pass'
253
+ && Number.isInteger(ledger.prompt_evaluation.cases_expected)
254
+ && ledger.prompt_evaluation.cases_expected >= ALIGN_PROMPT_EVALUATION_MIN_CASES
255
+ && ledger.prompt_evaluation.cases_passed === ledger.prompt_evaluation.cases_expected
256
+ && Array.isArray(ledger.prompt_evaluation.failures)
257
+ && ledger.prompt_evaluation.failures.length === 0
258
+ && evidenceComplete(ledger.prompt_evaluation.evidence, options));
259
+ if (!promptEvaluationPassed)
260
+ blockers.push('align_prompt_evaluation_not_passed');
261
+ const immutableCoreIntegrityPassed = Boolean(ledger?.immutable_core_integrity?.status === 'pass'
262
+ && evidenceComplete(ledger.immutable_core_integrity.evidence, options));
263
+ if (!immutableCoreIntegrityPassed)
264
+ blockers.push('align_immutable_core_integrity_not_passed');
265
+ const verificationReceiptsPassed = verificationPlanComplete
266
+ && ALIGN_REQUIRED_VERIFICATIONS.every((kind) => {
267
+ const matches = verificationReceipts.filter((receipt) => receipt?.kind === kind);
268
+ return matches.length === 1
269
+ && matches[0]?.status === 'pass'
270
+ && matches[0]?.exit_code === 0
271
+ && verificationCommandMatchesKind(kind, matches[0]?.command)
272
+ && evidenceComplete(matches[0]?.evidence, options);
273
+ })
274
+ && verificationReceipts.length === ALIGN_REQUIRED_VERIFICATIONS.length;
275
+ if (!verificationReceiptsPassed)
276
+ blockers.push('align_verification_receipts_not_passed');
71
277
  const latestOnly = plan?.policy?.latest_only === true;
72
278
  const noLegacyCompat = plan?.policy?.no_legacy_compat === true;
73
279
  if (!latestOnly)
74
280
  blockers.push('latest_only_policy_missing');
75
281
  if (!noLegacyCompat)
76
282
  blockers.push('no_legacy_compat_policy_missing');
77
- const dedupeRecorded = Boolean(ledgerPresent && Array.isArray(ledger?.deduplicated_surfaces));
78
- if (ledgerPresent && !dedupeRecorded)
79
- blockers.push('dedupe_surface_missing');
283
+ const changedPaths = ledger?.changed_paths;
284
+ const changeReview = ledger?.change_review;
285
+ const changedPathsRecorded = Boolean(evidenceComplete(changeReview?.evidence, options)
286
+ && (changeReview?.outcome === 'changed'
287
+ ? hasUniqueStringList(changedPaths)
288
+ : changeReview?.outcome === 'none_required'
289
+ && hasUniqueStringList(changedPaths, { allowEmpty: true })
290
+ && changedPaths.length === 0));
291
+ if (!changedPathsRecorded)
292
+ blockers.push('align_changed_paths_missing');
293
+ const latestOnlyCleanupReviewComplete = Boolean(workstreamReceiptComplete(ledger, 'latest_only_cleanup', options)
294
+ && hasUniqueStringList(ledger?.deleted_legacy_settings, { allowEmpty: true }));
295
+ if (!latestOnlyCleanupReviewComplete)
296
+ blockers.push('align_latest_only_cleanup_review_incomplete');
297
+ const deduplicatedSurfaces = ledger?.deduplicated_surfaces;
298
+ const deduplicationReview = ledger?.deduplication_review;
299
+ const reviewedSurfaces = deduplicationReview?.reviewed_surfaces;
300
+ const deduplicationReviewComplete = Boolean(workstreamReceiptComplete(ledger, 'deduplicate_prompt_config', options)
301
+ && hasUniqueStringList(reviewedSurfaces)
302
+ && evidenceComplete(deduplicationReview?.evidence, options)
303
+ && (deduplicationReview?.outcome === 'deduplicated'
304
+ ? hasUniqueStringList(deduplicatedSurfaces)
305
+ && deduplicatedSurfaces.every((surface) => reviewedSurfaces?.includes(surface))
306
+ : deduplicationReview?.outcome === 'none_required'
307
+ && hasUniqueStringList(deduplicatedSurfaces, { allowEmpty: true })
308
+ && deduplicatedSurfaces.length === 0));
309
+ if (!deduplicationReviewComplete)
310
+ blockers.push('dedupe_evidence_missing');
311
+ const ledgerBlockersClear = Boolean(ledgerPresent
312
+ && Array.isArray(ledger?.blockers)
313
+ && ledger.blockers.length === 0);
314
+ if (ledgerPresent && !Array.isArray(ledger?.blockers))
315
+ blockers.push('align_blocker_ledger_missing');
80
316
  if (Array.isArray(ledger?.blockers) && ledger.blockers.length > 0) {
81
317
  blockers.push(...ledger.blockers.map((item) => `ledger:${item}`));
82
318
  }
83
319
  const passed = blockers.length === 0;
84
320
  return {
85
- schema: 'sks.align-gate.v1',
86
- schema_version: 1,
321
+ schema: 'sks.align-gate.v2',
322
+ schema_version: 2,
87
323
  generated_at: nowIso(),
88
324
  mission_id: missionId,
89
325
  passed,
@@ -91,17 +327,41 @@ export function evaluateAlignGate(plan, ledger, missionId) {
91
327
  status: passed ? 'pass' : 'blocked',
92
328
  plan_present: planPresent,
93
329
  ledger_present: ledgerPresent,
330
+ mission_id_consistent: missionIdConsistent,
331
+ artifact_metadata_valid: artifactMetadataValid,
332
+ official_source_plan_complete: officialSourcePlanComplete,
333
+ deprecated_source_plan_complete: deprecatedSourcePlanComplete,
334
+ workstream_plan_complete: workstreamPlanComplete,
335
+ surface_inventory_plan_complete: surfaceInventoryPlanComplete,
336
+ official_source_receipts_complete: officialSourceReceiptsComplete,
337
+ deprecated_source_migration_recorded: deprecatedSourceMigrationRecorded,
338
+ deprecated_source_not_active: deprecatedSourceNotActive,
94
339
  workstreams_complete: workstreamsComplete,
340
+ command_coverage_complete: commandCoverageComplete,
341
+ skill_coverage_complete: skillCoverageComplete,
342
+ verification_plan_complete: verificationPlanComplete,
343
+ prompt_evaluation_plan_complete: promptEvaluationPlanComplete,
344
+ policy_contract_complete: policyContractComplete,
345
+ programmatic_tool_calling_decision_recorded: programmaticToolCallingDecisionRecorded,
346
+ agents_sdk_decision_recorded: agentsSdkDecisionRecorded,
347
+ prompt_evaluation_passed: promptEvaluationPassed,
348
+ immutable_core_integrity_passed: immutableCoreIntegrityPassed,
349
+ verification_receipts_passed: verificationReceiptsPassed,
350
+ changed_paths_recorded: changedPathsRecorded,
351
+ latest_only_cleanup_review_complete: latestOnlyCleanupReviewComplete,
352
+ deduplication_review_complete: deduplicationReviewComplete,
353
+ ledger_blockers_clear: ledgerBlockersClear,
354
+ no_blockers: passed,
95
355
  latest_only: latestOnly,
96
356
  no_legacy_compat: noLegacyCompat,
97
- dedupe_recorded: dedupeRecorded,
357
+ dedupe_recorded: deduplicationReviewComplete,
98
358
  blockers
99
359
  };
100
360
  }
101
361
  export async function writeAlignRouteArtifacts(dir, missionId, task) {
102
362
  const plan = buildAlignPlan(missionId, task);
103
363
  const ledger = buildAlignLedgerSeed(missionId);
104
- const gate = evaluateAlignGate(plan, ledger, missionId);
364
+ const gate = evaluateAlignGate(plan, ledger, missionId, { missionDir: dir });
105
365
  await writeJsonAtomic(path.join(dir, ALIGN_PLAN_ARTIFACT), plan);
106
366
  await writeJsonAtomic(path.join(dir, ALIGN_LEDGER_ARTIFACT), ledger);
107
367
  await writeJsonAtomic(path.join(dir, ALIGN_GATE_ARTIFACT), gate);
@@ -113,15 +373,186 @@ export async function readAlignGate(dir) {
113
373
  export async function refreshAlignGate(dir, missionId) {
114
374
  const plan = await readJson(path.join(dir, ALIGN_PLAN_ARTIFACT), null);
115
375
  const ledger = await readJson(path.join(dir, ALIGN_LEDGER_ARTIFACT), null);
116
- const gate = evaluateAlignGate(plan, ledger, missionId);
376
+ const gate = evaluateAlignGate(plan, ledger, missionId, { missionDir: dir });
117
377
  await writeJsonAtomic(path.join(dir, ALIGN_GATE_ARTIFACT), gate);
118
378
  return { plan, ledger, gate };
119
379
  }
120
380
  export function alignNextActionText(missionId) {
121
381
  return [
122
382
  `Execute the $sks-align modernization mission ${missionId}.`,
123
- 'Read align-plan.json, fetch the official GPT-5.6 / programmatic tool calling / agents / openai/skills guides,',
124
- 'update SKS prompts/settings/skills to latest-only grammar, delete legacy compat knobs, deduplicate redundant config,',
125
- 'protect immutable core skills, update align-ledger.json, pass align-gate.json, then finish with Honest Mode.'
383
+ 'Read align-plan.json and retrieve every exact active GPT-5.6, Programmatic Tool Calling, Agents, Codex Skills, Codex Plugins, and openai/plugins source.',
384
+ 'Treat openai/skills only as deprecated migration evidence. Audit every command and skill surface, record PTC and Agents SDK decisions,',
385
+ 'run prompt evaluation, immutable-core integrity, and verification checks, then pass the mission-consistent align-gate.json with no blockers.'
126
386
  ].join(' ');
127
387
  }
388
+ function coverageComplete(coverage, planInventory, currentInventory, options) {
389
+ return Boolean(coverage
390
+ && coverage.receipt_kind === 'exhaustive_inventory_audit'
391
+ && inventoryMatches(planInventory, currentInventory)
392
+ && coverage.inventory_sha256 === currentInventory.sha256
393
+ && coverage.expected_count === currentInventory.count
394
+ && coverage.audited_count === coverage.expected_count
395
+ && exactStringSet(coverage.audited_surfaces, currentInventory.surfaces)
396
+ && Array.isArray(coverage.missing_surfaces)
397
+ && coverage.missing_surfaces.length === 0
398
+ && evidenceComplete(coverage.evidence, options));
399
+ }
400
+ function decisionComplete(record, options) {
401
+ return Boolean(record
402
+ && record.decision !== 'pending'
403
+ && ['adopt', 'do_not_adopt', 'not_applicable'].includes(record.decision)
404
+ && isNonEmptyString(record.reason)
405
+ && evidenceComplete(record.evidence, options));
406
+ }
407
+ function workstreamReceiptComplete(ledger, workstream, options) {
408
+ const matches = arrayOrEmpty(ledger?.workstream_receipts)
409
+ .filter((receipt) => receipt?.workstream === workstream);
410
+ return matches.length === 1
411
+ && matches[0]?.status === 'complete'
412
+ && evidenceComplete(matches[0]?.evidence, options);
413
+ }
414
+ function hasExactSourceSet(actual, expected) {
415
+ if (!Array.isArray(actual) || actual.length !== expected.length)
416
+ return false;
417
+ return expected.every((required) => (actual.filter((source) => (source?.source_id === required.source_id && source?.url === required.url)).length === 1));
418
+ }
419
+ function hasExactDeprecatedSourceSet(actual, expected) {
420
+ if (!Array.isArray(actual) || actual.length !== expected.length)
421
+ return false;
422
+ return expected.every((required) => (actual.filter((source) => (source?.source_id === required.source_id
423
+ && source?.url === required.url
424
+ && source?.disposition === required.disposition)).length === 1));
425
+ }
426
+ function containsUrl(actual, url) {
427
+ return Array.isArray(actual) && actual.some((source) => source?.url === url);
428
+ }
429
+ function hasStringList(value) {
430
+ return Array.isArray(value) && value.length > 0 && value.every(isNonEmptyString);
431
+ }
432
+ function hasUniqueStringList(value, options = {}) {
433
+ if (!Array.isArray(value))
434
+ return false;
435
+ if (!options.allowEmpty && value.length === 0)
436
+ return false;
437
+ if (!value.every(isNonEmptyString))
438
+ return false;
439
+ if (!value.every((item) => item === item.trim()))
440
+ return false;
441
+ const normalized = value.map((item) => item.trim());
442
+ return new Set(normalized).size === normalized.length;
443
+ }
444
+ function evidenceComplete(value, options) {
445
+ if (!hasStringList(value))
446
+ return false;
447
+ const references = value;
448
+ if (!references.every(isSafeMissionEvidenceReference))
449
+ return false;
450
+ if (new Set(references).size !== references.length)
451
+ return false;
452
+ if (!options.missionDir)
453
+ return true;
454
+ const missionDir = path.resolve(options.missionDir);
455
+ let realMissionDir;
456
+ try {
457
+ realMissionDir = fs.realpathSync(missionDir);
458
+ }
459
+ catch {
460
+ return false;
461
+ }
462
+ return references.every((reference) => {
463
+ const target = path.resolve(missionDir, reference);
464
+ if (!isPathInside(missionDir, target))
465
+ return false;
466
+ try {
467
+ const realTarget = fs.realpathSync(target);
468
+ if (!isPathInside(realMissionDir, realTarget))
469
+ return false;
470
+ const stat = fs.lstatSync(target);
471
+ return stat.isFile() && !stat.isSymbolicLink() && stat.size > 0;
472
+ }
473
+ catch {
474
+ return false;
475
+ }
476
+ });
477
+ }
478
+ function isSafeMissionEvidenceReference(value) {
479
+ if (!value.startsWith('evidence/') || value.includes('\\') || value.includes('\0'))
480
+ return false;
481
+ if (path.isAbsolute(value))
482
+ return false;
483
+ const segments = value.split('/');
484
+ return segments.length > 1
485
+ && segments.every((segment) => (segment.length > 0
486
+ && segment !== '.'
487
+ && segment !== '..'
488
+ && /^[a-zA-Z0-9._-]+$/.test(segment)));
489
+ }
490
+ function isPathInside(root, target) {
491
+ const relative = path.relative(root, target);
492
+ return relative.length > 0
493
+ && relative !== '..'
494
+ && !relative.startsWith(`..${path.sep}`)
495
+ && !path.isAbsolute(relative);
496
+ }
497
+ function isNonEmptyString(value) {
498
+ return typeof value === 'string' && value.trim().length > 0;
499
+ }
500
+ function isIsoTimestamp(value) {
501
+ if (!isNonEmptyString(value))
502
+ return false;
503
+ const parsed = Date.parse(value);
504
+ return Number.isFinite(parsed) && new Date(parsed).toISOString() === value;
505
+ }
506
+ function verificationCommandMatchesKind(kind, value) {
507
+ if (!isNonEmptyString(value))
508
+ return false;
509
+ const command = value.trim().replace(/\s+/g, ' ');
510
+ if (/[;&|`$<>]/u.test(command))
511
+ return false;
512
+ switch (kind) {
513
+ case 'typecheck':
514
+ return /^npm run typecheck(?: --silent)?$/.test(command);
515
+ case 'build':
516
+ return /^npm run build(?::(?:clean|incremental))?(?: --silent)?$/.test(command);
517
+ case 'focused_tests':
518
+ return /^(?:bun test(?: .+)?|npm test(?: -- .+)?)$/.test(command);
519
+ case 'skill_surface_audit':
520
+ return command === 'node ./dist/scripts/skill-surface-modernization-check.js';
521
+ case 'release_affected':
522
+ return /^npm run release:check:affected(?: --silent)?$/.test(command);
523
+ }
524
+ }
525
+ function arrayOrEmpty(value) {
526
+ return Array.isArray(value) ? [...value] : [];
527
+ }
528
+ function buildAlignSurfaceInventory() {
529
+ const commands = uniqueSorted(commandManifestNames());
530
+ const skills = uniqueSorted(MANAGED_ROUTE_SKILL_NAMES);
531
+ return {
532
+ commands: sealedInventory(commands),
533
+ skills: sealedInventory(skills)
534
+ };
535
+ }
536
+ function sealedInventory(surfaces) {
537
+ return {
538
+ count: surfaces.length,
539
+ sha256: sha256(JSON.stringify(surfaces)),
540
+ surfaces
541
+ };
542
+ }
543
+ function inventoryMatches(actual, expected) {
544
+ return Boolean(actual
545
+ && actual.count === expected.count
546
+ && actual.sha256 === expected.sha256
547
+ && exactStringSet(actual.surfaces, expected.surfaces));
548
+ }
549
+ function exactStringSet(actual, expected) {
550
+ const expectedSorted = [...expected].sort();
551
+ return Array.isArray(actual)
552
+ && actual.length === expected.length
553
+ && actual.every(isNonEmptyString)
554
+ && [...actual].sort().every((item, index) => item === expectedSorted[index]);
555
+ }
556
+ function uniqueSorted(values) {
557
+ return [...new Set(values.filter(isNonEmptyString))].sort();
558
+ }
@@ -25,10 +25,7 @@ export const NATIVE_SOURCE_FILES = [
25
25
  'ProvidersOpenRouter.swift',
26
26
  'ProvidersRoleModels.swift',
27
27
  'ProvidersMultiProvider.swift',
28
- 'TelegramHubSupervisor.swift',
29
- 'RemoteTelegramViewController.swift',
30
- 'RemoteTelegramCenterState.swift',
31
- 'RemoteTelegramRendering.swift',
28
+ 'RemoteCodingViewController.swift',
32
29
  'DiagnosticsViewController.swift',
33
30
  'SettingsViewController.swift',
34
31
  'OperationCoordinator.swift',
@@ -9,7 +9,7 @@ import { MENU_ITEMS, SKS_MENUBAR_LABEL } from './constants.js';
9
9
  import { resolveCodexBundleId, writeDefaultMenuBarConfig } from './config.js';
10
10
  import { applyMenuBarGenerationTransaction, commitMenuBarGenerationTransaction, installGenerationPairs, MenuBarGenerationTransactionError, recoverMenuBarGenerationTransaction, rollbackGenerationPairs } from './generation-transaction.js';
11
11
  import { launchAgentSource, launchMenuBar, seedMenuBarPreferredPosition } from './launch-agent.js';
12
- import { cleanupMacLaunchSecretEnvironment } from './migration.js';
12
+ import { cleanupMacLaunchSecretEnvironment, cleanupRetiredRemoteBridgeLaunchAgent, quarantineRetiredRemoteBridgeBindings } from './migration.js';
13
13
  import { sksMenuBarPaths } from './paths.js';
14
14
  import { infoPlistSource, inspectInstalledResources, loadNativeMenuBarSources, nativeResourceHashes } from './resources.js';
15
15
  import { inspectMenuBarArtifactSet, normalizeLegacyMenuBarBuildStamp, rollbackSksMenuBar } from './rollback.js';
@@ -70,6 +70,25 @@ export async function installSksMenuBar(opts = {}) {
70
70
  if (recovery.status === 'completed_commit')
71
71
  actions.push(`completed committed Menu Bar ${pending.purpose} transaction cleanup`);
72
72
  }
73
+ const retiredRemoteBridge = await cleanupRetiredRemoteBridgeLaunchAgent({
74
+ home: paths.home,
75
+ env
76
+ });
77
+ warnings.push(...retiredRemoteBridge.warnings);
78
+ if (!retiredRemoteBridge.ok) {
79
+ return blocked(retiredRemoteBridge.blockers[0] || 'retired_remote_bridge_cleanup_failed', 'The retired SKS remote bridge LaunchAgent could not be stopped safely.');
80
+ }
81
+ if (retiredRemoteBridge.removed) {
82
+ actions.push('stopped and removed the retired SKS remote bridge LaunchAgent');
83
+ }
84
+ const retiredBindings = await quarantineRetiredRemoteBridgeBindings(paths.root);
85
+ warnings.push(...retiredBindings.warnings);
86
+ if (!retiredBindings.ok) {
87
+ return blocked(retiredBindings.blockers[0] || 'retired_remote_bridge_binding_cleanup_failed', 'Retired remote bridge bindings could not be quarantined safely.');
88
+ }
89
+ if (retiredBindings.status === 'quarantined') {
90
+ actions.push(`quarantined ${retiredBindings.retired_binding_count} retired remote bridge binding(s)`);
91
+ }
73
92
  cleanup = await cleanupMacLaunchSecretEnvironment({ env });
74
93
  if (!cleanup.ok)
75
94
  warnings.push('launch_secret_env_cleanup_incomplete');