sneakoscope 10.6.2 → 10.7.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 (105) hide show
  1. package/README.md +2 -2
  2. package/config/perf-budgets.v1.json +1 -2
  3. package/config/skills-hash-ledger.v1.json +7 -2
  4. package/crates/sks-core/Cargo.lock +1 -1
  5. package/crates/sks-core/Cargo.toml +1 -1
  6. package/dist/bin/sks-dispatch.js +6 -3
  7. package/dist/cli/args.js +3 -1
  8. package/dist/cli/command-manifest-lite.js +48 -114
  9. package/dist/cli/command-registry.js +1 -18
  10. package/dist/cli/commands-fast.js +11 -4
  11. package/dist/cli/help-fast.js +11 -22
  12. package/dist/cli/help.js +3 -3
  13. package/dist/cli/install-helpers.js +1 -1
  14. package/dist/cli/router.js +12 -26
  15. package/dist/commands/codex-app.js +2 -2
  16. package/dist/commands/doctor-helpers.js +1 -1
  17. package/dist/commands/mad-sks.js +2 -2
  18. package/dist/config/skills-manifest.json +13 -8
  19. package/dist/core/agent-bridge/async-command.js +2 -2
  20. package/dist/core/agents/agent-recursion-guard.js +0 -2
  21. package/dist/core/auto-review.js +15 -172
  22. package/dist/core/code-structure.js +0 -1
  23. package/dist/core/codex-control/codex-reliability-shield.js +64 -15
  24. package/dist/core/codex-control/codex-sdk-adapter.js +38 -5
  25. package/dist/core/commands/agent-bridge-command.js +1 -1
  26. package/dist/core/commands/basic-cli.js +60 -233
  27. package/dist/core/commands/command-utils.js +1 -1
  28. package/dist/core/commands/gc-command.js +30 -29
  29. package/dist/core/commands/image-ux-review-command.js +1 -1
  30. package/dist/core/commands/install-package-command.js +1 -1
  31. package/dist/core/commands/intent-normalization/normalizer.js +2 -2
  32. package/dist/core/commands/pipeline-command.js +13 -5
  33. package/dist/core/commands/plan-command.js +2 -3
  34. package/dist/core/commands/research-command.js +0 -3
  35. package/dist/core/commands/review-command.js +1 -1
  36. package/dist/core/commands/seo-command.js +27 -20
  37. package/dist/core/commands/status-command.js +8 -2
  38. package/dist/core/doctor/command-alias-cleanup.js +6 -6
  39. package/dist/core/evaluation.js +1 -1
  40. package/dist/core/feature-fixtures.js +9 -43
  41. package/dist/core/feature-registry.js +9 -27
  42. package/dist/core/git-hygiene/shared-memory-publish.js +1 -1
  43. package/dist/core/hooks-runtime/stop-repeat-guard.js +0 -13
  44. package/dist/core/init/skills.js +5 -13
  45. package/dist/core/init.js +0 -9
  46. package/dist/core/install/installed-package-smoke.js +3 -1
  47. package/dist/core/perf/import-graph-budget.js +0 -1
  48. package/dist/core/perf/release-latency-slo.js +2 -30
  49. package/dist/core/pipeline-internals/pipeline-stage-builder.js +2 -4
  50. package/dist/core/pipeline-internals/runtime-core.js +2 -38
  51. package/dist/core/proof/route-proof-policy.js +2 -4
  52. package/dist/core/proof/runtime-truth-matrix.js +2 -2
  53. package/dist/core/proof-field.js +104 -39
  54. package/dist/core/questions.js +11 -7
  55. package/dist/core/release/gate-affected-globs.js +0 -2
  56. package/dist/core/research/research-reviewer-contract.js +34 -0
  57. package/dist/core/research/research-work-graph.js +1 -1
  58. package/dist/core/research.js +1 -1
  59. package/dist/core/routes/constants.js +0 -1
  60. package/dist/core/routes/diagnostic-allowlist.js +1 -3
  61. package/dist/core/routes/light-routes.js +1 -2
  62. package/dist/core/routes.js +1 -1
  63. package/dist/core/safety/command-contract/contracts.js +5 -1
  64. package/dist/core/search-visibility/marketing-truthfulness.js +10 -7
  65. package/dist/core/search-visibility/marketing.js +194 -149
  66. package/dist/core/skill-forge.js +1 -361
  67. package/dist/core/strategy/adhd-orchestrating-gate.js +3 -3
  68. package/dist/core/triwiki/context-graph/extractors/topology/commands.js +2 -6
  69. package/dist/core/triwiki-wrongness/wrongness-cli.js +9 -27
  70. package/dist/core/version.js +1 -1
  71. package/package.json +1 -2
  72. package/release-gates.v2.json +1 -32
  73. package/dist/cli/recallpulse-command.js +0 -144
  74. package/dist/commands/auto-review.js +0 -5
  75. package/dist/commands/codex-native.js +0 -77
  76. package/dist/commands/recallpulse.js +0 -5
  77. package/dist/core/codex-native/codex-native-interop-policy.js +0 -127
  78. package/dist/core/commands/autoresearch-command.js +0 -4
  79. package/dist/core/commands/code-structure-command.js +0 -52
  80. package/dist/core/commands/goal-command.js +0 -43
  81. package/dist/core/commands/recallpulse-command.js +0 -4
  82. package/dist/core/commands/remote-command.js +0 -119
  83. package/dist/core/commands/skill-dream-command.js +0 -43
  84. package/dist/core/commands/wrongness-command.js +0 -2
  85. package/dist/core/goal-workflow.js +0 -80
  86. package/dist/core/mcp/mcp-tool-name-normalizer.js +0 -28
  87. package/dist/core/recallpulse/policy.js +0 -207
  88. package/dist/core/recallpulse.js +0 -947
  89. package/dist/core/remote/audit-idempotency.js +0 -241
  90. package/dist/core/remote/index.js +0 -10
  91. package/dist/core/remote/machine-registry.js +0 -167
  92. package/dist/core/remote/owner-proof.js +0 -216
  93. package/dist/core/remote/protocol.js +0 -249
  94. package/dist/core/remote/readiness.js +0 -156
  95. package/dist/core/remote/session-index.js +0 -61
  96. package/dist/core/remote/session-snapshot.js +0 -197
  97. package/dist/core/remote/ssh-worker-client.js +0 -377
  98. package/dist/core/remote/types.js +0 -10
  99. package/dist/core/remote/worker.js +0 -360
  100. package/dist/core/search/context-graph-seeds.js +0 -15
  101. package/dist/core/verification/context-graph-affected.js +0 -312
  102. package/dist/core/verification/verification-artifact-lock.js +0 -21
  103. package/dist/core/verification/verification-dag.js +0 -89
  104. package/dist/core/verification/verification-result.js +0 -19
  105. package/dist/core/verification/verification-worker-pool.js +0 -204
@@ -1,35 +1,24 @@
1
- import { COMMAND_MANIFEST_LITE } from './command-manifest-lite.js';
1
+ import { visibleCommandManifest } from './command-manifest-lite.js';
2
2
  import { PACKAGE_VERSION } from '../core/version.js';
3
3
  export function helpFast() {
4
4
  console.log(`SKS
5
5
  SNEAKOSCOPE CODEX v${PACKAGE_VERSION}
6
6
 
7
- 3-pillar frontdoor
7
+ Ask Codex for work directly; the main agent does ordinary work and SKS hooks keep it safe.
8
8
 
9
9
  $sks-plan "task" plan only; writes .sneakoscope/plans, no code edits
10
10
  $sks-work execute the latest plan with Naruto child agents
11
11
 
12
- Local surfaces
13
-
14
12
  sks review --staged machine-first diff review
15
- sks doctor --fix repair/validate the harness
16
-
17
- Discovery
13
+ sks doctor --fix repair and validate the install
14
+ sks help <command> usage of one command (or a $ route)
15
+ sks dollar-commands every Codex App $ route
18
16
 
19
- sks commands [--json] all commands
20
- sks dollar-commands all Codex App $ routes
21
- sks help [topic] focused help
17
+ Commands
22
18
  `);
23
- for (const row of commandRows().filter((entry) => entry.maturity !== 'labs').slice(0, 18)) {
24
- console.log(` ${row.usage.padEnd(58)} ${row.description}`);
25
- }
26
- console.log('\nRun `sks commands` for the full catalog.');
27
- }
28
- function commandRows() {
29
- return COMMAND_MANIFEST_LITE.map((entry) => ({
30
- name: entry.name,
31
- usage: `sks ${entry.name}`,
32
- description: entry.summary,
33
- maturity: entry.maturity
34
- })).sort((a, b) => a.name.localeCompare(b.name));
19
+ const commands = visibleCommandManifest().filter((entry) => entry.maturity !== 'labs');
20
+ const width = Math.max(...commands.map((entry) => entry.name.length)) + 2;
21
+ for (const entry of commands)
22
+ console.log(` sks ${entry.name.padEnd(width)}${entry.summary}`);
23
+ console.log('\nLabs commands (optional routes) are listed by `sks commands`.');
35
24
  }
package/dist/cli/help.js CHANGED
@@ -6,10 +6,10 @@ export function isHelpRequest(args) {
6
6
  export function renderManifestHelp(command, entry) {
7
7
  if (!entry)
8
8
  return `Usage: sks ${command}\n\nNo manifest entry is registered for this command.`;
9
- const lines = [`Usage: sks ${entry.name} [options]`, '', entry.summary];
9
+ const lines = [`Usage: ${entry.usage || `sks ${entry.name} [options]`}`, '', entry.summary];
10
+ if (entry.description && entry.description !== entry.summary)
11
+ lines.push(entry.description);
10
12
  const notes = [];
11
- if (entry.deprecated)
12
- notes.push('deprecated — kept only for compatibility');
13
13
  if (entry.maturity !== 'stable')
14
14
  notes.push(`maturity: ${entry.maturity}`);
15
15
  if (entry.readonly)
@@ -24,7 +24,7 @@ export async function postinstall({ bootstrap }) {
24
24
  if (menuBar.status === 'skipped')
25
25
  console.log(describePostinstallMenuBar(menuBar));
26
26
  console.log('Next: run `sks bootstrap` when you are ready to initialize SKS.');
27
- console.log('Dependency diagnostics remain explicit: sks deps check');
27
+ console.log('Dependency diagnostics remain explicit: sks doctor');
28
28
  console.log('Explicit lifecycle opt-in: SKS_POSTINSTALL_BOOTSTRAP=1 npm i -g sneakoscope');
29
29
  console.log('Optional Homebrew/npm-global tool repair remains off unless SKS_POSTINSTALL_AUTO_INSTALL_CLI_TOOLS=1 is also set.');
30
30
  const reason = process.env.SKS_POSTINSTALL_NO_BOOTSTRAP === '1'
@@ -1,4 +1,3 @@
1
- import { AsyncLocalStorage } from 'node:async_hooks';
2
1
  import { createHash } from 'node:crypto';
3
2
  import { COMMAND_ALIASES_LITE, COMMAND_MANIFEST_BY_NAME, COMMAND_NAME_SET, } from './command-manifest-lite.js';
4
3
  import { ui as cliUi } from './cli-theme.js';
@@ -6,7 +5,6 @@ import { helpResult, isHelpRequest, renderManifestHelp } from './help.js';
6
5
  import { findRetiredGlobalExecutionArgumentErrors } from './global-mode-router.js';
7
6
  import { normalizeIntentCommand, } from '../core/commands/intent-normalization/normalizer.js';
8
7
  import { narutoUsesCurrentSession } from '../core/subagents/naruto-execution-mode.js';
9
- const routerIntentStorage = new AsyncLocalStorage();
10
8
  export function prepareRouterExecutionIntent(argv, inheritance = {}) {
11
9
  const effectiveArgv = argv.length ? [...argv] : ['doctor'];
12
10
  const rawCommand = effectiveArgv[0]?.startsWith('$')
@@ -66,9 +64,8 @@ export function normalizeCommand(args = []) {
66
64
  export async function dispatch(args) {
67
65
  const argv = args ?? process.argv.slice(2);
68
66
  try {
69
- let intent = null;
70
67
  try {
71
- intent = prepareRouterExecutionIntent(argv);
68
+ prepareRouterExecutionIntent(argv);
72
69
  }
73
70
  catch (error) {
74
71
  const code = error instanceof Error ? error.message : String(error);
@@ -85,9 +82,7 @@ export async function dispatch(args) {
85
82
  throw error;
86
83
  }
87
84
  }
88
- return intent
89
- ? await routerIntentStorage.run(intent.contract, () => dispatchInner(argv))
90
- : await dispatchInner(argv);
85
+ return await dispatchInner(argv);
91
86
  }
92
87
  catch (err) {
93
88
  const message = err instanceof Error ? err.message : String(err);
@@ -178,16 +173,14 @@ async function dispatchInner(argv) {
178
173
  process.exitCode = 1;
179
174
  return commandGate;
180
175
  }
181
- const { ensureCurrentMigrationBeforeCommand } = await import('../core/update/update-migration-state.js');
182
- const migrationGate = await ensureCurrentMigrationBeforeCommand({
183
- command,
184
- args: rest,
185
- skipMigrationGate: entry.skipMigrationGate === true
186
- || entry.readonly === true
187
- || safeReadOnlySubcommand(command, rest)
188
- || safeActiveRouteVisualQuery(command, rest)
189
- });
190
- if (!migrationGate.ok) {
176
+ const skipMigrationGate = entry.skipMigrationGate === true
177
+ || entry.readonly === true
178
+ || safeReadOnlySubcommand(command, rest)
179
+ || safeActiveRouteVisualQuery(command, rest);
180
+ const migrationGate = skipMigrationGate
181
+ ? null
182
+ : await (await import('../core/update/update-migration-state.js')).ensureCurrentMigrationBeforeCommand({ command, args: rest, skipMigrationGate: false });
183
+ if (migrationGate && !migrationGate.ok) {
191
184
  console.error('SKS project migration blocked.');
192
185
  console.error(`Scope: ${migrationGate.scope || 'project'}`);
193
186
  console.error(`Stage: ${migrationGate.failed_stage_id || migrationGate.status}`);
@@ -306,12 +299,6 @@ export function safeReadOnlySubcommand(command, args) {
306
299
  if (command === 'codex-app' && ['context-1m', 'context-management'].includes(sub) && (nested === 'status' || nested === '' || nested.startsWith('--'))) {
307
300
  return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
308
301
  }
309
- if (command === 'remote' && ['readiness', 'status', 'show'].includes(sub)) {
310
- return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
311
- }
312
- if (command === 'remote' && ['machines', 'machine'].includes(sub) && ['list', 'validate'].includes(nested)) {
313
- return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
314
- }
315
302
  if (!['status', 'show', 'list', 'observe', 'watch', 'doctor', 'help'].includes(sub))
316
303
  return false;
317
304
  return !args.some((arg) => ['--fix', '--yes', '-y', '--write', '--apply', '--execute', '--force', '--real'].includes(String(arg)));
@@ -367,8 +354,7 @@ export function safeActiveRouteContinuation(command, args, state = {}) {
367
354
  return subcommand === 'run' && !requestedMission;
368
355
  }
369
356
  const expectedRoutes = new Map([
370
- ['research', ['RESEARCH']],
371
- ['autoresearch', ['AUTORESEARCH', 'RESEARCH']],
357
+ ['research', ['RESEARCH', 'AUTORESEARCH']],
372
358
  ['qa-loop', ['QALOOP']]
373
359
  ]).get(command);
374
360
  if (!expectedRoutes)
@@ -410,5 +396,5 @@ function activeRouteStateBlocksCommand(state = {}) {
410
396
  return false;
411
397
  if (/(?:DONE|COMPLETE|CLOSED|BLOCKED|FAILED)$/i.test(String(state.phase || '')))
412
398
  return false;
413
- return Boolean(state.route || state.route_command || ['NARUTO', 'QALOOP', 'RESEARCH', 'MADSKS', 'GOAL'].includes(mode));
399
+ return Boolean(state.route || state.route_command || ['NARUTO', 'QALOOP', 'RESEARCH', 'MADSKS'].includes(mode));
414
400
  }
@@ -70,7 +70,7 @@ export async function run(_command, args = []) {
70
70
  if (action === 'agent-role-sync')
71
71
  return printCodexAppResult(args, await syncCodexAgentRoles({ root: await sksRoot(), apply: flag(args, '--apply') || flag(args, '--fix') }));
72
72
  if (action === 'init-deep')
73
- return printCodexAppResult(args, await runCodexInitDeep({ root: await sksRoot(), apply: !flag(args, '--check-only') && !flag(args, '--dry-run') }));
73
+ return printCodexAppResult(args, await runCodexInitDeep({ root: await sksRoot(), apply: !flag(args, '--check-only') && !flag(args, '--dry-run'), directoryLocal: flag(args, '--directory-local') }));
74
74
  if (action === 'hook-lifecycle')
75
75
  return printCodexAppResult(args, await buildCodexHookLifecycle({ root: await sksRoot(), apply: flag(args, '--apply') || flag(args, '--fix') }));
76
76
  if (action === 'execution-profile')
@@ -151,7 +151,7 @@ export async function run(_command, args = []) {
151
151
  process.exitCode = 1;
152
152
  return;
153
153
  }
154
- console.error('Usage: sks codex-app check|status|restart|context-management [status|on|off]|context-1m [status|on|off] [--no-restart]|harness-matrix|skill-sync|agent-role-sync|init-deep|hook-lifecycle|execution-profile|role-models|set-role-model --role <name> [--provider <id>] --model <catalog-slug> --reasoning <effort>|reset-role-model --role <name>|product-design [--check-only]|ensure-product-design|chrome-extension|pat status|remote-control [--json]');
154
+ console.error('Usage: sks codex-app check|status|restart|context-management [status|on|off]|context-1m [status|on|off] [--no-restart]|harness-matrix|skill-sync|agent-role-sync|init-deep [--directory-local]|hook-lifecycle|execution-profile|role-models|set-role-model --role <name> [--provider <id>] --model <catalog-slug> --reasoning <effort>|reset-role-model --role <name>|product-design [--check-only]|ensure-product-design|chrome-extension|pat status|remote-control [--json]');
155
155
  console.error('Provider routing moved to: sks bridge provider configure|validate|enable; sks bridge catalog sync; sks bridge route set-default.');
156
156
  process.exitCode = 1;
157
157
  }
@@ -19,7 +19,7 @@ export function buildRuntimeReadiness(matrix) {
19
19
  ].join(' '));
20
20
  }
21
21
  if (matrix?.features?.project_memory?.ok !== true)
22
- repairActions.push('Project memory: sks codex-native init-deep --apply --directory-local');
22
+ repairActions.push('Project memory: sks codex-app init-deep --directory-local');
23
23
  return {
24
24
  schema: 'sks.runtime-readiness-story.v1',
25
25
  codex_native: codexNative,
@@ -1,6 +1,6 @@
1
- import { madHighCommand } from '../core/commands/mad-sks-command.js';
2
- import { PACKAGE_VERSION } from '../core/fsx.js';
3
1
  export async function run(_command, args = []) {
2
+ const { madHighCommand } = await import('../core/commands/mad-sks-command.js');
3
+ const { PACKAGE_VERSION } = await import('../core/version.js');
4
4
  return madHighCommand(['--mad-sks', ...args], {
5
5
  packageVersion: PACKAGE_VERSION
6
6
  });
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "schema": "sks.skills-manifest.v1",
3
- "package_version": "10.6.2",
3
+ "package_version": "10.7.0",
4
4
  "skills": [
5
5
  {
6
6
  "canonical_name": "sks",
7
7
  "type": "official",
8
- "content_sha256": "d5adbf63047d4882258d70bb46017e4aa7b6d5804154c68ef4204d0e0e5916d6",
8
+ "content_sha256": "eb09af342c2f2bc3d269e6d1c2f92d718ed069582d1165bfe46600b5c2225a8b",
9
9
  "hash_history": [
10
+ "32d97c9b68a0a97794f48bd2f200bb3c0cd68816c00fef3397e86df671342ac5",
11
+ "d5adbf63047d4882258d70bb46017e4aa7b6d5804154c68ef4204d0e0e5916d6",
10
12
  "8aa34586ba331f0447668c2ce863fe6c9ec4f881828ebed26ca5ecc754d66840",
11
13
  "d0288d27c8bc1c89decb258c6805ed4286cd0d65371ef0eec453be233b39a2a1",
12
14
  "905fc5472d36f0780b56f0e09404f42ea20293b1a4615d2050b7db3043231dbd",
@@ -309,8 +311,9 @@
309
311
  {
310
312
  "canonical_name": "sks-help",
311
313
  "type": "official",
312
- "content_sha256": "17c2a63b163b266dc0d0a503a275d41a5388e1f44be9250b84017f1a549159d4",
314
+ "content_sha256": "3a20901121eb9a11a31ea797a44c8136a09f26f9862f52a923634aba0767dc0c",
313
315
  "hash_history": [
316
+ "17c2a63b163b266dc0d0a503a275d41a5388e1f44be9250b84017f1a549159d4",
314
317
  "8b6d7f0cffbd3b141f53a6937fb3d58ba363d495d6da561d8f463ee3b265d975",
315
318
  "0b67a2ed2eb1f3f80cf1645bee0c189ecc442d2ec84b1e0b218d800298487920"
316
319
  ],
@@ -456,8 +459,9 @@
456
459
  {
457
460
  "canonical_name": "sks-ppt",
458
461
  "type": "official",
459
- "content_sha256": "a25e537ff49b5bffdc093a5f772a8d218003ca1bb81e0aa304561684a9551b31",
462
+ "content_sha256": "93887312718febbb795cab3d09b1d47a30485eee7c6416fb02c78c65ab5c4686",
460
463
  "hash_history": [
464
+ "a25e537ff49b5bffdc093a5f772a8d218003ca1bb81e0aa304561684a9551b31",
461
465
  "fba3f438b9f22dae0813cd12bf310539a7d2b71c8cd9322eb840514e24884eaf",
462
466
  "c9a0d90e12560dd3f04959869051370e6baf46eda6eb63f708ea1661c5c9d041",
463
467
  "1d4de05afd42ee5739c0ed925af9e0ac4785fc746e659c60d3d908d465e6386c",
@@ -493,16 +497,16 @@
493
497
  {
494
498
  "canonical_name": "sks-reasoning-router",
495
499
  "type": "official",
496
- "content_sha256": "2ec66071b1c021e8c2ddd8f1ecefd16502c8325adab2c3c804a9e8d4123b1a8d",
500
+ "content_sha256": "00403fa829bc673966c2e125d5a2d42111ed6fd8c821b1f0e50176127658b888",
497
501
  "hash_history": [
502
+ "2ec66071b1c021e8c2ddd8f1ecefd16502c8325adab2c3c804a9e8d4123b1a8d",
498
503
  "b0f458caa1c3bd7bb7241a09b80fce5700aeb99b340e84c08a9b2b66bc875ba7",
499
504
  "41e14e8d5b93d743096664869ee68c41c86e911b0bbc165bdcd10e4a45faa4b6",
500
505
  "03d68436e568b3cee2bffc6ca58819019ca406f7b648ef4704e3465c7c83c114",
501
506
  "647f730520a1c7dc89c2642f5b8502624c65a861ae41aecf1fb137db40fd0611",
502
507
  "da0ddb58adc68ddeebdb9c45bf111c26eaa64d3e9dffe1dd39d7f30b943b8b88",
503
508
  "1595beabf2d31397217311fa1323bd62c801cf6c87db9029ff544c457efec8bb",
504
- "a7d879d157c6d5b6b81a67dba7b5b731ac18ea986841fe1ab2cafbd6623481c3",
505
- "dc0b8c6a4093269c2c36b58432b25409704d06fea8ca558f43b598625ca0d9de"
509
+ "a7d879d157c6d5b6b81a67dba7b5b731ac18ea986841fe1ab2cafbd6623481c3"
506
510
  ],
507
511
  "deprecated_aliases": []
508
512
  },
@@ -521,8 +525,9 @@
521
525
  {
522
526
  "canonical_name": "sks-release-review",
523
527
  "type": "official",
524
- "content_sha256": "36846d6180051c85e3093e7e405ad9d4d447f7295769f71f8450c18afee50e98",
528
+ "content_sha256": "dfc2af7dd2c41ab2529ed54b2dca0dfd85e2de0d3304afbfe4a420e6627ce01a",
525
529
  "hash_history": [
530
+ "36846d6180051c85e3093e7e405ad9d4d447f7295769f71f8450c18afee50e98",
526
531
  "bb6ef28431fd6c390041c9a2855b906fd01a1f6da02111f094258914cf826bb9",
527
532
  "7cf879a2efd61822d3dccd4eb69fb704bfbab4b114b820b6dfa0d13b5f20e9fa"
528
533
  ],
@@ -9,7 +9,7 @@ import { bridgeClientUrl } from '../codex-lb/desktop-controller-v3/shared.js';
9
9
  import { runProcess } from '../fsx.js';
10
10
  import { createResponsesTransport } from './responses-transport.js';
11
11
  import { latestModelForTier } from '../subagents/model-tiers.js';
12
- const USAGE = 'sks agent-bridge async --prompt "task" [--tools status,stats] [--json]';
12
+ const USAGE = 'sks agent-bridge async --prompt "task" [--tools status,search] [--json]';
13
13
  const MAX_PROMPT_BYTES = 16 * 1024;
14
14
  export function redactAsyncToolOutput(stdout) {
15
15
  try {
@@ -21,7 +21,7 @@ export function redactAsyncToolOutput(stdout) {
21
21
  }
22
22
  export function parseAsyncCommandArgs(args) {
23
23
  let prompt = '';
24
- let selected = 'status,stats';
24
+ let selected = 'status,search';
25
25
  const seen = new Set();
26
26
  for (let i = 0; i < args.length; i++) {
27
27
  const flag = args[i];
@@ -4,9 +4,7 @@ export const AGENT_RECURSION_GUARD_REPORT_SCHEMA = 'sks.agent-recursion-guard.v1
4
4
  export const AGENT_RECURSIVE_COMMAND_DENYLIST = Object.freeze([
5
5
  'sks naruto run',
6
6
  'sks research run',
7
- 'sks autoresearch run',
8
7
  'sks qa-loop',
9
- 'sks goal',
10
8
  '$Naruto',
11
9
  '$Work',
12
10
  '$Research',
@@ -1,7 +1,7 @@
1
1
  import os from 'node:os';
2
2
  import path from 'node:path';
3
3
  import { createHash } from 'node:crypto';
4
- import { ensureDir, exists, readText, writeTextAtomic } from './fsx.js';
4
+ import { ensureDir, readText, writeTextAtomic } from './fsx.js';
5
5
  import { writeCodexConfigGuarded } from './codex/codex-config-guard.js';
6
6
  import { CODEX_FAST_SERVICE_TIER_ID } from './codex/codex-service-tier.js';
7
7
  import { inspectConfinedPath, removeManagedPathVerified } from './managed-path-safety.js';
@@ -9,42 +9,9 @@ import { RETIRED_AUTO_REVIEW_POLICY_TEXTS, RETIRED_SKS_CONFIG_PROFILE_NAMES } fr
9
9
  import { escapeRegExp } from './text/regex.js';
10
10
  export { RETIRED_SKS_CONFIG_PROFILE_NAMES } from './doctor/retired-auto-review-config.js';
11
11
  export const AUTO_REVIEW_REVIEWER = 'auto_review';
12
- export const LEGACY_AUTO_REVIEW_REVIEWER = 'guardian_subagent';
13
- export const AUTO_REVIEW_PROFILE = 'sks-auto-review';
14
- export const AUTO_REVIEW_HIGH_PROFILE = 'sks-auto-review-high';
15
12
  export const MAD_HIGH_PROFILE = 'sks-mad-high';
13
+ const LEGACY_AUTO_REVIEW_REVIEWER = 'guardian_subagent';
16
14
  export const AUTO_REVIEW_POLICY_TEXT = 'In MAD-SKS launches, allow only scoped high-risk work approved for the active invocation and keep catastrophic DB wipe/all-row safeguards active. The explicit $MAD-SKS or sks mad-sks sql|apply-migration invocation is the SQL-plane approval boundary: execute requested execute_sql/apply_migration mutations with mission-local write transport, read-back proof, and final read-only restoration. Supabase project/account/billing/credential control-plane actions remain denied.';
17
- export const REVIEW_NATIVE_AGENT_PLAN = Object.freeze({
18
- schema: 'sks.review-native-agent-plan.v1',
19
- backend: 'native_multi_session_agent_kernel',
20
- central_ledger: 'agents/agent-events.jsonl',
21
- personas: [
22
- {
23
- id: 'review_safety',
24
- role: 'safety',
25
- label: 'Review Safety',
26
- read_only: true,
27
- mandate: 'Review permission, DB, destructive action, and unrequested fallback risks before approval.'
28
- },
29
- {
30
- id: 'review_verifier',
31
- role: 'verifier',
32
- label: 'Review Verifier',
33
- read_only: true,
34
- mandate: 'Check claims, tests, and route evidence before approval.'
35
- },
36
- {
37
- id: 'review_integrator',
38
- role: 'integrator',
39
- label: 'Review Integrator',
40
- read_only: true,
41
- mandate: 'Close approval only after ledger, session cleanup, and proof graph pass.'
42
- }
43
- ],
44
- safety_personas_read_only_by_default: true,
45
- manual_agent_count_syntax: 'sks auto-review fixture --json and sks naruto run "$Review <review task>" --agents 5 --max-threads 4 --json',
46
- dynamic_effort: 'parent assigns high effort to safety/integrator lanes and medium or higher to verification lanes when proof risk is present'
47
- });
48
15
  export function codexHome(env = process.env) {
49
16
  return path.resolve(env.CODEX_HOME || path.join(env.HOME || os.homedir(), '.codex'));
50
17
  }
@@ -54,57 +21,6 @@ export function codexConfigPath(env = process.env) {
54
21
  export function codexProfileConfigPath(profile, env = process.env) {
55
22
  return path.join(codexHome(env), `${String(profile || '').trim()}.config.toml`);
56
23
  }
57
- export function autoReviewProfileName(opts = {}) {
58
- return opts.high ? AUTO_REVIEW_HIGH_PROFILE : AUTO_REVIEW_PROFILE;
59
- }
60
- export async function autoReviewStatus(opts = {}) {
61
- const configPath = opts.configPath || codexConfigPath(opts.env || process.env);
62
- const text = await readText(configPath, '');
63
- const profileText = await readText(path.join(path.dirname(configPath), `${AUTO_REVIEW_PROFILE}.config.toml`), '');
64
- const highProfileText = await readText(path.join(path.dirname(configPath), `${AUTO_REVIEW_HIGH_PROFILE}.config.toml`), '');
65
- const approvalsReviewer = readTomlString(text, 'approvals_reviewer');
66
- const profileReviewer = readTomlString(profileText, 'approvals_reviewer');
67
- const highProfileReviewer = readTomlString(highProfileText, 'approvals_reviewer');
68
- const legacyReviewProfile = readTableString(text, `profiles.${AUTO_REVIEW_PROFILE}`, 'approvals_reviewer');
69
- const legacyHighProfile = readTableString(text, `profiles.${AUTO_REVIEW_HIGH_PROFILE}`, 'approvals_reviewer');
70
- return {
71
- config_path: configPath,
72
- exists: await exists(configPath),
73
- approvals_reviewer: approvalsReviewer,
74
- enabled: approvalsReviewer === AUTO_REVIEW_REVIEWER,
75
- profile: profileReviewer === AUTO_REVIEW_REVIEWER,
76
- high_profile: highProfileReviewer === AUTO_REVIEW_REVIEWER,
77
- legacy_invalid: [approvalsReviewer, profileReviewer, highProfileReviewer, legacyReviewProfile, legacyHighProfile].includes(LEGACY_AUTO_REVIEW_REVIEWER),
78
- policy: readTableString(text, 'auto_review', 'policy') || '',
79
- native_agent_plan: REVIEW_NATIVE_AGENT_PLAN
80
- };
81
- }
82
- export async function enableAutoReview(opts = {}) {
83
- const configPath = opts.configPath || codexConfigPath(opts.env || process.env);
84
- const high = Boolean(opts.high);
85
- await ensureDir(path.dirname(configPath));
86
- const current = await readText(configPath, '');
87
- let next = current || '';
88
- next = upsertTopLevelString(next, 'approvals_reviewer', AUTO_REVIEW_REVIEWER);
89
- next = removeLegacyProfileConfig(next, AUTO_REVIEW_PROFILE);
90
- next = removeLegacyProfileConfig(next, AUTO_REVIEW_HIGH_PROFILE);
91
- next = upsertAutoReviewPolicy(next);
92
- if (!next.endsWith('\n'))
93
- next += '\n';
94
- await writeCodexConfigGuarded({
95
- configPath,
96
- before: current,
97
- cause: 'auto-review-enable',
98
- mutate: () => next
99
- });
100
- await writeProfileConfig(configPath, AUTO_REVIEW_PROFILE, profileConfigBlock({ effort: 'medium' }));
101
- await writeProfileConfig(configPath, AUTO_REVIEW_HIGH_PROFILE, profileConfigBlock({ effort: 'high' }));
102
- return {
103
- ...(await autoReviewStatus({ configPath })),
104
- profile_name: autoReviewProfileName({ high }),
105
- launch_args: ['--profile', autoReviewProfileName({ high })]
106
- };
107
- }
108
24
  export const SKS_CONFIG_PROFILES = [
109
25
  { name: 'sks-task-low', stripTable: true, block: sksProfileFileBlock({ effort: 'low' }) },
110
26
  { name: 'sks-task-medium', stripTable: true, block: sksProfileFileBlock({ effort: 'medium' }) },
@@ -230,68 +146,9 @@ export function buildMadHighLaunchProfileNoWrite(opts = {}) {
230
146
  writes_user_codex_config: false
231
147
  };
232
148
  }
233
- export async function ensureMadHighProfileForSetupOrRepair(opts = {}) {
234
- const configPath = opts.configPath || codexConfigPath(opts.env || process.env);
235
- const env = opts.env || process.env;
236
- await ensureDir(path.dirname(configPath));
237
- const current = await readText(configPath, '');
238
- let next = removeLegacyProfileConfig(current, MAD_HIGH_PROFILE);
239
- next = upsertAutoReviewPolicy(next);
240
- if (!next.endsWith('\n'))
241
- next += '\n';
242
- await writeCodexConfigGuarded({
243
- configPath,
244
- before: current,
245
- cause: 'mad-high-profile-setup',
246
- mutate: () => next
247
- });
248
- await migrateSksProfilesToPerFile({ configPath, env });
249
- await writeProfileConfig(configPath, MAD_HIGH_PROFILE, profileConfigBlock({
250
- effort: 'xhigh',
251
- approvalPolicy: 'never',
252
- sandboxMode: 'danger-full-access'
253
- }));
254
- return {
255
- config_path: configPath,
256
- profile_config_path: path.join(path.dirname(configPath), `${MAD_HIGH_PROFILE}.config.toml`),
257
- profile_name: MAD_HIGH_PROFILE,
258
- launch_args: ['--profile', MAD_HIGH_PROFILE, '--sandbox', 'danger-full-access', '--ask-for-approval', 'never', '-c', `service_tier=${CODEX_FAST_SERVICE_TIER_ID}`, '-c', 'model_reasoning_effort=xhigh'],
259
- sandbox_mode: 'danger-full-access',
260
- approval_policy: 'never',
261
- approvals_reviewer: AUTO_REVIEW_REVIEWER,
262
- model_reasoning_effort: 'xhigh',
263
- service_tier: 'fast',
264
- scope: 'setup_or_repair_only',
265
- writes_user_codex_config: true
266
- };
267
- }
268
- export async function enableMadHighProfile(opts = {}) {
269
- if (opts.allowUserConfigWrite !== true) {
270
- throw new Error('enableMadHighProfile writes Codex user config; use buildMadHighLaunchProfileNoWrite for sks --mad');
271
- }
272
- return ensureMadHighProfileForSetupOrRepair(opts);
273
- }
274
149
  export function madHighProfileName() {
275
150
  return MAD_HIGH_PROFILE;
276
151
  }
277
- export async function disableAutoReview(opts = {}) {
278
- const configPath = opts.configPath || codexConfigPath(opts.env || process.env);
279
- const current = await readText(configPath, '');
280
- let next = upsertTopLevelString(current, 'approvals_reviewer', 'user');
281
- next = removeLegacyProfileConfig(next, AUTO_REVIEW_PROFILE);
282
- next = removeLegacyProfileConfig(next, AUTO_REVIEW_HIGH_PROFILE);
283
- if (!next.endsWith('\n'))
284
- next += '\n';
285
- await writeCodexConfigGuarded({
286
- configPath,
287
- before: current,
288
- cause: 'auto-review-disable',
289
- mutate: () => next
290
- });
291
- await writeProfileConfig(configPath, AUTO_REVIEW_PROFILE, profileConfigBlock({ effort: 'medium', reviewer: 'user' }));
292
- await writeProfileConfig(configPath, AUTO_REVIEW_HIGH_PROFILE, profileConfigBlock({ effort: 'high', reviewer: 'user' }));
293
- return autoReviewStatus({ configPath });
294
- }
295
152
  function readTomlString(text, key) {
296
153
  const re = new RegExp(`^${escapeRegExp(key)}\\s*=\\s*"([^"]*)"\\s*$`, 'm');
297
154
  return text.match(re)?.[1] || null;
@@ -324,33 +181,6 @@ function topLevelBody(text) {
324
181
  const firstTable = lines.findIndex((line) => /^\s*\[.+\]\s*$/.test(line));
325
182
  return (firstTable === -1 ? lines : lines.slice(0, firstTable)).join('\n');
326
183
  }
327
- function upsertTopLevelString(text, key, value) {
328
- const line = `${key} = "${value}"`;
329
- const lines = String(text || '').split('\n');
330
- const firstTable = lines.findIndex((x) => /^\s*\[.+\]\s*$/.test(x));
331
- const end = firstTable === -1 ? lines.length : firstTable;
332
- for (let i = 0; i < end; i++) {
333
- if (new RegExp(`^\\s*${escapeRegExp(key)}\\s*=`).test(lines[i] || '')) {
334
- lines[i] = line;
335
- return lines.join('\n').replace(/\n+$/, '\n');
336
- }
337
- }
338
- lines.splice(end, 0, line);
339
- return lines.join('\n').replace(/^\n+/, '').replace(/\n{3,}/g, '\n\n');
340
- }
341
- function profileConfigBlock(opts = {}) {
342
- const effort = opts.effort || 'medium';
343
- const reviewer = opts.reviewer || AUTO_REVIEW_REVIEWER;
344
- const approvalPolicy = opts.approvalPolicy || 'on-request';
345
- const sandboxMode = opts.sandboxMode || 'workspace-write';
346
- return [
347
- 'service_tier = "fast"',
348
- `approval_policy = "${approvalPolicy}"`,
349
- `approvals_reviewer = "${reviewer}"`,
350
- `sandbox_mode = "${sandboxMode}"`,
351
- `model_reasoning_effort = "${effort}"`
352
- ].join('\n');
353
- }
354
184
  async function writeProfileConfig(configPath, profile, text) {
355
185
  const file = path.join(path.dirname(configPath), `${profile}.config.toml`);
356
186
  await writeTextAtomic(file, `${String(text || '').replace(/\s+$/, '')}\n`);
@@ -423,6 +253,19 @@ function normalizeGeneratedProfileText(text) {
423
253
  .filter(Boolean)
424
254
  .join('\n');
425
255
  }
256
+ function profileConfigBlock(opts = {}) {
257
+ const effort = opts.effort || 'medium';
258
+ const reviewer = opts.reviewer || AUTO_REVIEW_REVIEWER;
259
+ const approvalPolicy = opts.approvalPolicy || 'on-request';
260
+ const sandboxMode = opts.sandboxMode || 'workspace-write';
261
+ return [
262
+ 'service_tier = "fast"',
263
+ `approval_policy = "${approvalPolicy}"`,
264
+ `approvals_reviewer = "${reviewer}"`,
265
+ `sandbox_mode = "${sandboxMode}"`,
266
+ `model_reasoning_effort = "${effort}"`
267
+ ].join('\n');
268
+ }
426
269
  function managedRetiredProfileBodies() {
427
270
  return new Set([
428
271
  sksProfileFileBlock({ effort: 'medium' }),
@@ -574,7 +574,6 @@ function buildSemanticReview(input) {
574
574
  function isLeanOwnedTypeSafetyPath(file) {
575
575
  return [
576
576
  'src/core/code-structure.ts',
577
- 'src/core/commands/code-structure-command.ts',
578
577
  'src/core/lean-engineering-policy.ts',
579
578
  'src/core/codex-control/gpt-final-arbiter.ts',
580
579
  'src/core/codex-control/gpt-final-review-schema.ts',