sneakoscope 5.7.0 → 5.9.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 (88) hide show
  1. package/README.md +1 -1
  2. package/config/competitor-scorecard-baseline.json +97 -0
  3. package/config/perf-budgets.v1.json +10 -0
  4. package/crates/sks-core/Cargo.lock +1 -1
  5. package/crates/sks-core/Cargo.toml +1 -1
  6. package/crates/sks-core/src/main.rs +1 -1
  7. package/dist/bin/sks.js +61 -1
  8. package/dist/cli/command-registry.js +2 -3
  9. package/dist/cli/commands-fast.js +20 -0
  10. package/dist/cli/root-fast.js +48 -0
  11. package/dist/cli/router.js +3 -0
  12. package/dist/cli/super-search-command.js +221 -0
  13. package/dist/cli/xai-command.js +7 -7
  14. package/dist/commands/doctor.js +56 -24
  15. package/dist/config/skills-manifest.json +63 -70
  16. package/dist/core/agents/agent-codex-cockpit.js +3 -3
  17. package/dist/core/agents/agent-orchestrator.js +20 -2
  18. package/dist/core/agents/agent-wrongness.js +1 -1
  19. package/dist/core/agents/native-cli-session-swarm.js +14 -1
  20. package/dist/core/agents/parallel-runtime-proof.js +82 -8
  21. package/dist/core/agents/parallel-write-fixture.js +301 -0
  22. package/dist/core/commands/gc-command.js +12 -6
  23. package/dist/core/commands/run-command.js +20 -18
  24. package/dist/core/doctor/doctor-idempotence.js +93 -0
  25. package/dist/core/errors/blocker-humanizer.js +13 -0
  26. package/dist/core/errors/next-action-map.js +56 -0
  27. package/dist/core/feature-fixtures.js +15 -8
  28. package/dist/core/fsx.js +1 -1
  29. package/dist/core/init/skills.js +1 -2
  30. package/dist/core/install/installed-package-smoke.js +121 -0
  31. package/dist/core/mission.js +41 -15
  32. package/dist/core/naruto/naruto-active-pool.js +6 -2
  33. package/dist/core/perf/perf-budget.js +145 -0
  34. package/dist/core/quality/competitor-scorecard.js +116 -0
  35. package/dist/core/release/gate-timing.js +103 -0
  36. package/dist/core/release-parallel-full-coverage.js +1 -1
  37. package/dist/core/retention/retention-budget.js +62 -0
  38. package/dist/core/retention.js +1 -1
  39. package/dist/core/routes/constants.js +2 -2
  40. package/dist/core/routes.js +155 -53
  41. package/dist/core/source-intelligence/source-intelligence-policy.js +5 -5
  42. package/dist/core/source-intelligence/source-intelligence-proof.js +8 -8
  43. package/dist/core/source-intelligence/source-intelligence-runner.js +16 -16
  44. package/dist/core/strategy/strategy-gate.js +2 -1
  45. package/dist/core/super-search/doctor.js +63 -0
  46. package/dist/core/super-search/runtime-helpers.js +289 -0
  47. package/dist/core/super-search/runtime.js +270 -0
  48. package/dist/core/super-search/source-records.js +96 -0
  49. package/dist/core/super-search/types.js +3 -0
  50. package/dist/core/trust-kernel/trust-report.js +3 -3
  51. package/dist/core/verification/real-evidence-policy.js +55 -0
  52. package/dist/core/version.js +1 -1
  53. package/dist/scripts/agent-fast-mode-default-check.js +10 -1
  54. package/dist/scripts/agent-visual-consistency-check.js +1 -1
  55. package/dist/scripts/check-architecture.js +0 -1
  56. package/dist/scripts/competitor-scorecard-check.js +25 -0
  57. package/dist/scripts/doctor-idempotence-check.js +8 -0
  58. package/dist/scripts/gate-timing-check.js +8 -0
  59. package/dist/scripts/hook-latency-quantum-check.js +122 -0
  60. package/dist/scripts/installed-package-smoke-check.js +12 -0
  61. package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +2 -0
  62. package/dist/scripts/mutation-callsite-coverage-check.js +7 -0
  63. package/dist/scripts/package-published-contract-check.js +7 -0
  64. package/dist/scripts/packlist-performance-check.js +31 -3
  65. package/dist/scripts/parallel-production-smoke-check.js +21 -0
  66. package/dist/scripts/perf-budget-check.js +14 -0
  67. package/dist/scripts/quantum-baseline-report.js +38 -0
  68. package/dist/scripts/release-check-stamp.js +117 -16
  69. package/dist/scripts/release-metadata-1-19-check.js +2 -2
  70. package/dist/scripts/release-parallel-check.js +2 -2
  71. package/dist/scripts/release-parallel-full-coverage-check.js +1 -1
  72. package/dist/scripts/retention-budget-check.js +8 -0
  73. package/dist/scripts/route-intent-regression-check.js +44 -0
  74. package/dist/scripts/sks-1-18-gate-lib.js +2 -2
  75. package/dist/scripts/source-intelligence-all-modes-check.js +2 -2
  76. package/dist/scripts/source-intelligence-policy-check.js +1 -1
  77. package/dist/scripts/super-search-live-smoke-check.js +70 -0
  78. package/dist/scripts/super-search-name-guard-check.js +98 -0
  79. package/dist/scripts/super-search-offline-contract-check.js +45 -0
  80. package/dist/scripts/{ultra-search-provider-interface-check.js → super-search-provider-interface-check.js} +9 -9
  81. package/dist/scripts/trust-fixture-check.js +19 -6
  82. package/package.json +26 -8
  83. package/schemas/agents/parallel-runtime-proof.schema.json +17 -1
  84. package/dist/cli/insane-search-command.js +0 -195
  85. package/dist/core/ultra-search/runtime.js +0 -502
  86. package/dist/core/ultra-search/types.js +0 -3
  87. package/dist/scripts/release-readiness-report.js +0 -1262
  88. /package/dist/core/{ultra-search → super-search}/index.js +0 -0
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  Sneakoscope Codex (`sks`) is a Codex CLI and Codex App harness for people who want parallel AI coding without losing proof. It gives Codex a simple front door, a dynamic worker swarm, a local dashboard, TriWiki project memory, and release gates that separate machine evidence from LLM opinion.
16
16
 
17
- Current release: SKS **5.7.0**. New in this release: repaired Codex App menu bar persistence and Fast Mode actions, codex-lb Fast Mode defaults pinned to the required current Codex model, legacy upgrade repair through `sks update` and `sks doctor --fix`, and a safer `npm publish --ignore-scripts` wrapper that runs the release gates before lifecycle-disabled publish. See [CHANGELOG.md](CHANGELOG.md).
17
+ Current release: SKS **5.9.0**. New in this release: installed-package smoke checks, quantum performance budgets, Super-Search usable/degraded/blocked readiness, production parallel-write smoke, doctor idempotence proof, retention budgets, and an artifact-driven competitor scorecard. See [CHANGELOG.md](CHANGELOG.md).
18
18
 
19
19
  ## Install
20
20
 
@@ -0,0 +1,97 @@
1
+ {
2
+ "schema": "sks.competitor-scorecard-baseline.v1",
3
+ "target": {
4
+ "total_min": 94,
5
+ "each_min": 90
6
+ },
7
+ "categories": {
8
+ "code_stability": [
9
+ {
10
+ "id": "doctor-idempotence",
11
+ "path": ".sneakoscope/reports/doctor-idempotence.json"
12
+ },
13
+ {
14
+ "id": "super-search-offline-contract",
15
+ "path": ".sneakoscope/reports/super-search-offline-contract.json"
16
+ },
17
+ {
18
+ "id": "route-regression",
19
+ "path": ".sneakoscope/reports/route-regression.json"
20
+ }
21
+ ],
22
+ "test_release_gates": [
23
+ {
24
+ "id": "release-readiness",
25
+ "path": ".sneakoscope/reports/release-readiness-5.9.0.json"
26
+ },
27
+ {
28
+ "id": "installed-package-smoke",
29
+ "path": ".sneakoscope/reports/installed-package-smoke.json"
30
+ },
31
+ {
32
+ "id": "release-gate-timing",
33
+ "path": ".sneakoscope/reports/gate-timing.json"
34
+ }
35
+ ],
36
+ "parallel_isolation": [
37
+ {
38
+ "id": "parallel-runtime-proof",
39
+ "path": ".sneakoscope/reports/parallel-production-smoke.json"
40
+ },
41
+ {
42
+ "id": "worktree-runtime",
43
+ "path": ".sneakoscope/reports/parallel-production-smoke.json"
44
+ },
45
+ {
46
+ "id": "patch-merge-proof",
47
+ "path": ".sneakoscope/reports/parallel-production-smoke.json"
48
+ }
49
+ ],
50
+ "speed_performance": [
51
+ {
52
+ "id": "perf-budget",
53
+ "path": ".sneakoscope/reports/perf-budget.json"
54
+ },
55
+ {
56
+ "id": "hook-latency-quantum",
57
+ "path": ".sneakoscope/reports/hook-latency-quantum.json"
58
+ },
59
+ {
60
+ "id": "gate-timing",
61
+ "path": ".sneakoscope/reports/gate-timing.json"
62
+ }
63
+ ],
64
+ "install_operations": [
65
+ {
66
+ "id": "installed-package-smoke",
67
+ "path": ".sneakoscope/reports/installed-package-smoke.json"
68
+ },
69
+ {
70
+ "id": "doctor-idempotence",
71
+ "path": ".sneakoscope/reports/doctor-idempotence.json"
72
+ },
73
+ {
74
+ "id": "package-surface-budget",
75
+ "path": ".sneakoscope/reports/package-surface-budget.json"
76
+ }
77
+ ],
78
+ "maintainability": [
79
+ {
80
+ "id": "architecture-check",
81
+ "command": "architecture:check"
82
+ },
83
+ {
84
+ "id": "route-modularity-check",
85
+ "command": "route-modularity:check"
86
+ },
87
+ {
88
+ "id": "command-budget-check",
89
+ "command": "command-budget:check"
90
+ },
91
+ {
92
+ "id": "package-surface-budget",
93
+ "path": ".sneakoscope/reports/package-surface-budget.json"
94
+ }
95
+ ]
96
+ }
97
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "schema": "sks.perf-budgets.v1",
3
+ "commands": [
4
+ { "name": "version", "argv": ["node", "./dist/bin/sks.js", "--version"], "budget_p50_ms": 170, "budget_p95_ms": 180 },
5
+ { "name": "commands-json", "argv": ["node", "./dist/bin/sks.js", "commands", "--json"], "budget_p50_ms": 260, "budget_p95_ms": 320 },
6
+ { "name": "root-json", "argv": ["node", "./dist/bin/sks.js", "root", "--json"], "budget_p50_ms": 170, "budget_p95_ms": 220 },
7
+ { "name": "doctor-json", "argv": ["node", "./dist/bin/sks.js", "doctor", "--json"], "budget_p50_ms": 2000, "budget_p95_ms": 2500 },
8
+ { "name": "super-search-doctor-json", "argv": ["node", "./dist/bin/sks.js", "super-search", "doctor", "--json"], "budget_p50_ms": 180, "budget_p95_ms": 240 }
9
+ ]
10
+ }
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "5.7.0"
79
+ version = "5.9.0"
80
80
  dependencies = [
81
81
  "serde_json",
82
82
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "5.7.0"
3
+ version = "5.9.0"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -4,7 +4,7 @@ use std::io::{self, Read, Seek, SeekFrom};
4
4
  fn main() {
5
5
  let mut args = std::env::args().skip(1);
6
6
  match args.next().as_deref() {
7
- Some("--version") => println!("sks-rs 5.7.0"),
7
+ Some("--version") => println!("sks-rs 5.9.0"),
8
8
  Some("compact-info") => {
9
9
  let mut input = String::new();
10
10
  let _ = io::stdin().read_to_string(&mut input);
package/dist/bin/sks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const FAST_PACKAGE_VERSION = '5.7.0';
2
+ const FAST_PACKAGE_VERSION = '5.9.0';
3
3
  const args = process.argv.slice(2);
4
4
  try {
5
5
  if (args[0] === '--agent' && args[1] === 'worker') {
@@ -9,6 +9,20 @@ try {
9
9
  else if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
10
10
  console.log(`sneakoscope ${FAST_PACKAGE_VERSION}`);
11
11
  }
12
+ else if (args[0] === 'commands' && args.includes('--json')) {
13
+ const { commandsJsonFast } = await import('../cli/commands-fast.js');
14
+ commandsJsonFast();
15
+ }
16
+ else if (args[0] === 'root' && args.includes('--json')) {
17
+ const getBuiltinModule = process.getBuiltinModule;
18
+ const fs = typeof getBuiltinModule === 'function' ? getBuiltinModule('node:fs') : await import('node:fs');
19
+ rootJsonFastInline(fs);
20
+ }
21
+ else if (args[0] === 'super-search' && args[1] === 'doctor') {
22
+ const { buildSuperSearchDoctorReport, printSuperSearchDoctorReport } = await import('../core/super-search/doctor.js');
23
+ const doctorArgs = args.slice(2);
24
+ printSuperSearchDoctorReport(buildSuperSearchDoctorReport(doctorArgs), doctorArgs.includes('--json'));
25
+ }
12
26
  else if (args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
13
27
  if (args.length > 1) {
14
28
  const { helpCommand } = await import('../core/commands/basic-cli.js');
@@ -29,5 +43,51 @@ catch (err) {
29
43
  console.error(message);
30
44
  process.exitCode = 1;
31
45
  }
46
+ function rootJsonFastInline(fs, cwd = process.cwd()) {
47
+ const project = findProjectRootSync(fs, cwd);
48
+ const global = joinPath(process.env.HOME || process.env.USERPROFILE || cwd, '.sneakoscope');
49
+ const active = project || global;
50
+ process.stdout.write(`${JSON.stringify({
51
+ cwd,
52
+ mode: project ? 'project' : 'global',
53
+ active_root: active,
54
+ project_root: project,
55
+ global_root: global,
56
+ using_global_root: !project
57
+ })}\n`);
58
+ }
59
+ function findProjectRootSync(fs, start) {
60
+ let dir = normalizeStart(start);
61
+ for (;;) {
62
+ if (fs.existsSync(joinPath(dir, '.sneakoscope')))
63
+ return dir;
64
+ if (fs.existsSync(joinPath(dir, 'AGENTS.md')) && fs.existsSync(joinPath(dir, 'package.json')))
65
+ return dir;
66
+ const parent = parentDir(dir);
67
+ if (parent === dir)
68
+ return null;
69
+ dir = parent;
70
+ }
71
+ }
72
+ function normalizeStart(start) {
73
+ const value = stripTrailingSlash(start || process.cwd());
74
+ if (value.startsWith('/'))
75
+ return value || '/';
76
+ return joinPath(process.cwd(), value);
77
+ }
78
+ function joinPath(left, right) {
79
+ const base = stripTrailingSlash(left || '/');
80
+ return `${base === '/' ? '' : base}/${right}`;
81
+ }
82
+ function parentDir(value) {
83
+ const dir = stripTrailingSlash(value);
84
+ if (dir === '/')
85
+ return dir;
86
+ const index = dir.lastIndexOf('/');
87
+ return index <= 0 ? '/' : dir.slice(0, index);
88
+ }
89
+ function stripTrailingSlash(value) {
90
+ return value.replace(/\/+$/, '') || '/';
91
+ }
32
92
  export {};
33
93
  //# sourceMappingURL=sks.js.map
@@ -161,8 +161,7 @@ export const COMMANDS = {
161
161
  'image-ux-review': routeStateMutator(entry('labs', 'Inspect image UX artifacts', 'dist/core/commands/image-ux-review-command.js', commandArgsCommand(() => import('../core/commands/image-ux-review-command.js'), 'imageUxReviewCommand', 'dist/core/commands/image-ux-review-command.js')), ['image-ux-review-gate.json']),
162
162
  'computer-use': routeStateMutator(entry('beta', 'Record native Mac/non-web Computer Use visual evidence', 'dist/core/commands/computer-use-command.js', commandArgsCommand(() => import('../core/commands/computer-use-command.js'), 'computerUseCommand', 'dist/core/commands/computer-use-command.js')), ['computer-use-gate.json']),
163
163
  context7: entry('beta', 'Context7 checks and docs', 'dist/cli/context7-command.js', subcommand(() => import('./context7-command.js'), 'context7Command', 'dist/cli/context7-command.js', 'check')),
164
- 'insane-search': entry('beta', 'Run provider-independent InsaneSearch source intelligence', 'dist/cli/insane-search-command.js', subcommand(() => import('./insane-search-command.js'), 'insaneSearchCommand', 'dist/cli/insane-search-command.js', 'doctor')),
165
- 'ultra-search': entry('beta', 'Compatibility alias for InsaneSearch source intelligence', 'dist/cli/insane-search-command.js', subcommand(() => import('./insane-search-command.js'), 'ultraSearchCommand', 'dist/cli/insane-search-command.js', 'doctor')),
164
+ 'super-search': entry('beta', 'Run Super-Search provider-independent source intelligence', 'dist/cli/super-search-command.js', subcommand(() => import('./super-search-command.js'), 'superSearchCommand', 'dist/cli/super-search-command.js', 'doctor')),
166
165
  xai: entry('beta', 'Deprecated compatibility notice for removed xAI/Grok setup', 'dist/cli/xai-command.js', subcommand(() => import('./xai-command.js'), 'xaiCommand', 'dist/cli/xai-command.js', 'check')),
167
166
  recallpulse: entry('labs', 'RecallPulse evidence route', 'dist/commands/recallpulse.js', directCommand(() => import('../commands/recallpulse.js'), 'dist/commands/recallpulse.js')),
168
167
  pipeline: activeRouteDiagnostic(entry('beta', 'Inspect pipeline missions', 'dist/commands/pipeline.js', directCommand(() => import('../commands/pipeline.js'), 'dist/commands/pipeline.js'))),
@@ -174,7 +173,7 @@ export const COMMANDS = {
174
173
  selftest: entry('stable', 'Run local mock selftest', 'dist/core/commands/basic-cli.js', basicArgs('selftestCommand')),
175
174
  goal: routeStateMutator(entry('beta', 'Manage Goal bridge workflow', 'dist/core/commands/goal-command.js', subcommand(() => import('../core/commands/goal-command.js'), 'goalCommand', 'dist/core/commands/goal-command.js')), ['loop-graph-proof.json']),
176
175
  'seo-geo-optimizer': entry('beta', 'Run unified SEO/GEO optimizer audit/plan/apply/verify 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')),
177
- hook: entry('beta', 'Codex hook entrypoint', 'dist/commands/hook.js', directCommand(() => import('../commands/hook.js'), 'dist/commands/hook.js')),
176
+ hook: skipMigrationGate(entry('beta', 'Codex hook entrypoint', 'dist/commands/hook.js', directCommand(() => import('../commands/hook.js'), 'dist/commands/hook.js'))),
178
177
  profile: entry('labs', 'Inspect/set profile', 'dist/commands/profile.js', directCommand(() => import('../commands/profile.js'), 'dist/commands/profile.js')),
179
178
  hproof: entry('beta', 'Evaluate H-Proof gate', 'dist/commands/hproof.js', directCommand(() => import('../commands/hproof.js'), 'dist/commands/hproof.js')),
180
179
  'validate-artifacts': entry('beta', 'Validate mission artifacts', 'dist/core/commands/validate-artifacts-command.js', argsCommand(() => import('../core/commands/validate-artifacts-command.js'), 'validateArtifactsCommand', 'dist/core/commands/validate-artifacts-command.js')),
@@ -0,0 +1,20 @@
1
+ import { COMMANDS } from './command-registry.js';
2
+ export function commandsJsonFast() {
3
+ const commands = Object.entries(COMMANDS)
4
+ .map(([name, entry]) => fastCommandRow(name, entry))
5
+ .sort((a, b) => a.name.localeCompare(b.name));
6
+ console.log(JSON.stringify({
7
+ schema: 'sks.command-registry.v1',
8
+ aliases: ['sks', 'sneakoscope'],
9
+ commands
10
+ }, null, 2));
11
+ }
12
+ function fastCommandRow(name, entry) {
13
+ return {
14
+ name,
15
+ usage: `sks ${name}`,
16
+ description: entry.summary,
17
+ maturity: entry.maturity
18
+ };
19
+ }
20
+ //# sourceMappingURL=commands-fast.js.map
@@ -0,0 +1,48 @@
1
+ import fs from 'node:fs';
2
+ export function rootJsonFast(cwd = process.cwd()) {
3
+ const project = findProjectRootSync(cwd);
4
+ const global = joinPath(process.env.HOME || process.env.USERPROFILE || cwd, '.sneakoscope');
5
+ const active = project || global;
6
+ console.log(JSON.stringify({
7
+ cwd,
8
+ mode: project ? 'project' : 'global',
9
+ active_root: active,
10
+ project_root: project,
11
+ global_root: global,
12
+ using_global_root: !project
13
+ }, null, 2));
14
+ }
15
+ function findProjectRootSync(start) {
16
+ let dir = normalizeStart(start);
17
+ for (;;) {
18
+ if (fs.existsSync(joinPath(dir, '.sneakoscope')))
19
+ return dir;
20
+ if (fs.existsSync(joinPath(dir, 'AGENTS.md')) && fs.existsSync(joinPath(dir, 'package.json')))
21
+ return dir;
22
+ const parent = parentDir(dir);
23
+ if (parent === dir)
24
+ return null;
25
+ dir = parent;
26
+ }
27
+ }
28
+ function normalizeStart(start) {
29
+ const value = stripTrailingSlash(start || process.cwd());
30
+ if (value.startsWith('/'))
31
+ return value || '/';
32
+ return joinPath(process.cwd(), value);
33
+ }
34
+ function joinPath(left, right) {
35
+ const base = stripTrailingSlash(left || '/');
36
+ return `${base === '/' ? '' : base}/${right}`;
37
+ }
38
+ function parentDir(value) {
39
+ const dir = stripTrailingSlash(value);
40
+ if (dir === '/')
41
+ return dir;
42
+ const index = dir.lastIndexOf('/');
43
+ return index <= 0 ? '/' : dir.slice(0, index);
44
+ }
45
+ function stripTrailingSlash(value) {
46
+ return value.replace(/\/+$/, '') || '/';
47
+ }
48
+ //# sourceMappingURL=root-fast.js.map
@@ -119,6 +119,9 @@ async function ensureActiveRouteCommandGate(command, args) {
119
119
  return { ok: true, status: 'allowed' };
120
120
  if (safeReadOnlySubcommand(args))
121
121
  return { ok: true, status: 'allowed_status_subcommand' };
122
+ if (process.env.SKS_TEST_ISOLATION === '1' && process.env.SKS_RELEASE_FIXTURE_ACTIVE_ROUTE_BYPASS === '1') {
123
+ return { ok: true, status: 'allowed_release_fixture_isolation' };
124
+ }
122
125
  const root = await projectRoot(process.cwd()).catch(() => process.cwd());
123
126
  const state = await readJson(stateFile(root), {}).catch(() => ({}));
124
127
  if (!activeRouteStateBlocksCommand(state))
@@ -0,0 +1,221 @@
1
+ import fs from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { randomUUID } from 'node:crypto';
5
+ import { runSuperSearch } from '../core/super-search/index.js';
6
+ import { buildSuperSearchDoctorReport, printSuperSearchDoctorReport } from '../core/super-search/doctor.js';
7
+ import { evaluateLocalGate } from '../core/commands/route-success-helpers.js';
8
+ import { evaluateRealEvidencePolicy } from '../core/verification/real-evidence-policy.js';
9
+ export async function superSearchCommand(sub = 'help', args = []) {
10
+ const action = sub || 'help';
11
+ if (action === 'run')
12
+ return runCommand(args);
13
+ if (action === 'x')
14
+ return runCommand(['--mode', 'x_search', ...args]);
15
+ if (action === 'fetch')
16
+ return runCommand(['--mode', 'url_acquisition', ...args]);
17
+ if (action === 'doctor')
18
+ return doctorCommand(args);
19
+ if (action === 'status' || action === 'inspect' || action === 'sources' || action === 'claims')
20
+ return inspectCommand(action, args);
21
+ if (action === 'cache')
22
+ return cacheCommand(args);
23
+ if (action === 'bench')
24
+ return benchCommand(args);
25
+ return helpCommand();
26
+ }
27
+ async function runCommand(args) {
28
+ const json = args.includes('--json');
29
+ const mode = readOption(args, '--mode');
30
+ const rawQuery = positional(args).join(' ').trim();
31
+ const query = rawQuery || (mode === 'url_acquisition' ? 'fetch' : '');
32
+ if (!query)
33
+ throw new Error('Usage: sks super-search run "<query>" [--mode fast|balanced|deep|exhaustive] [--json]');
34
+ if (mode && !['fast', 'balanced', 'deep', 'exhaustive', 'x_search', 'url_acquisition'].includes(mode)) {
35
+ throw new Error('Unsupported Super-Search mode: ' + mode);
36
+ }
37
+ const missionDir = await mkMissionDir();
38
+ const result = await runSuperSearch({
39
+ missionDir,
40
+ query,
41
+ ...(mode ? { mode } : {})
42
+ });
43
+ const gate = await evaluateSuperSearchGate(missionDir);
44
+ const finalResult = {
45
+ ...result,
46
+ ok: result.ok === true && gate.ok === true,
47
+ blockers: [...new Set([...(result.blockers || []), ...gate.blockers])],
48
+ gate_evaluation: gate
49
+ };
50
+ if (json)
51
+ console.log(JSON.stringify(finalResult, null, 2));
52
+ else {
53
+ console.log(`Super-Search ${finalResult.ok ? 'completed' : 'partial/blocked'}: ${result.mode}`);
54
+ console.log(`Mission: ${missionDir}`);
55
+ console.log(`Sources: ${result.sources.length}, verified: ${result.proof.verified_source_count}`);
56
+ if (finalResult.blockers.length)
57
+ console.log(`Blockers: ${finalResult.blockers.join(', ')}`);
58
+ }
59
+ if (!finalResult.ok)
60
+ process.exitCode = 1;
61
+ return finalResult;
62
+ }
63
+ async function doctorCommand(args) {
64
+ const json = args.includes('--json');
65
+ const report = buildSuperSearchDoctorReport(args);
66
+ printSuperSearchDoctorReport(report, json);
67
+ return report;
68
+ }
69
+ async function inspectCommand(action, args) {
70
+ const json = args.includes('--json');
71
+ const mission = positional(args)[0] || 'latest';
72
+ const target = mission === 'latest' ? await latestMissionDir() : mission;
73
+ const file = path.join(target, 'super-search', action === 'sources' ? 'source-ledger.json' : action === 'claims' ? 'claim-ledger.json' : 'super-search-result.json');
74
+ const text = await fs.readFile(file, 'utf8').catch(() => null);
75
+ const parsed = text ? JSON.parse(text) : {
76
+ schema: 'sks.super-search-inspect-missing.v1',
77
+ ok: false,
78
+ mission: target,
79
+ blockers: ['super_search_mission_artifact_missing:' + path.relative(process.cwd(), file)]
80
+ };
81
+ const gate = await evaluateSuperSearchGate(target);
82
+ const evidence = await evaluateSuperSearchArtifacts(target);
83
+ const parsedOk = parsed.ok === false ? false : true;
84
+ const result = {
85
+ ...parsed,
86
+ ok: parsedOk && gate.ok === true && evidence.ok === true,
87
+ gate_evaluation: gate,
88
+ real_evidence_policy: evidence,
89
+ blockers: [...new Set([...(parsed.blockers || []), ...gate.blockers, ...evidence.blockers])]
90
+ };
91
+ if (!result.ok)
92
+ process.exitCode = 1;
93
+ if (json)
94
+ console.log(JSON.stringify(result, null, 2));
95
+ else
96
+ console.log(JSON.stringify(result, null, 2));
97
+ return result;
98
+ }
99
+ async function cacheCommand(args) {
100
+ const sub = positional(args)[0] || 'status';
101
+ const report = { schema: 'sks.super-search-cache.v1', ok: true, action: sub, local_only: true };
102
+ console.log(JSON.stringify(report, null, 2));
103
+ return report;
104
+ }
105
+ async function benchCommand(args) {
106
+ const report = {
107
+ schema: 'sks.super-search-bench.v1',
108
+ ok: false,
109
+ suite: readOption(args, '--suite') || 'all',
110
+ status: 'real_benchmark_not_run',
111
+ blockers: ['real_web_or_x_parity_corpus_required']
112
+ };
113
+ console.log(JSON.stringify(report, null, 2));
114
+ return report;
115
+ }
116
+ function helpCommand() {
117
+ console.log([
118
+ 'Usage:',
119
+ ' sks super-search doctor [--json]',
120
+ ' sks super-search run "<query>" [--mode fast|balanced|deep|exhaustive] [--json]',
121
+ ' sks super-search x "<query>" [--json]',
122
+ ' sks super-search fetch "<url>" [--json]',
123
+ ' sks super-search status|inspect|sources|claims <mission|latest> [--json]',
124
+ ' sks super-search cache status|prune|clear [--json]',
125
+ ' sks super-search bench [--suite all|x|web|docs|blocked] [--json]'
126
+ ].join('\n'));
127
+ return { ok: true, status: 'help' };
128
+ }
129
+ function readOption(args, flag) {
130
+ const index = args.indexOf(flag);
131
+ const value = index >= 0 ? args[index + 1] : undefined;
132
+ return value || null;
133
+ }
134
+ function positional(args) {
135
+ const out = [];
136
+ for (let i = 0; i < args.length; i++) {
137
+ const value = args[i];
138
+ if (!value)
139
+ continue;
140
+ if (value.startsWith('--')) {
141
+ if (value !== '--json')
142
+ i++;
143
+ continue;
144
+ }
145
+ out.push(value);
146
+ }
147
+ return out;
148
+ }
149
+ async function mkMissionDir() {
150
+ const dir = path.join(process.cwd(), '.sneakoscope', 'missions', `super-search-${Date.now().toString(36)}-${randomUUID().slice(0, 8)}`);
151
+ await fs.mkdir(dir, { recursive: true });
152
+ return dir;
153
+ }
154
+ async function latestMissionDir() {
155
+ const root = path.join(process.cwd(), '.sneakoscope', 'missions');
156
+ const entries = await fs.readdir(root, { withFileTypes: true }).catch(() => []);
157
+ const dirs = entries.filter((entry) => entry.isDirectory()).map((entry) => path.join(root, entry.name)).sort();
158
+ let latest = null;
159
+ for (const dir of dirs.reverse()) {
160
+ if (await hasSuperSearchArtifactDir(dir)) {
161
+ latest = dir;
162
+ break;
163
+ }
164
+ }
165
+ if (!latest)
166
+ return path.join(os.tmpdir(), 'sks-super-search-missing');
167
+ return latest;
168
+ }
169
+ async function hasSuperSearchArtifactDir(dir) {
170
+ try {
171
+ const stat = await fs.stat(path.join(dir, 'super-search'));
172
+ return stat.isDirectory();
173
+ }
174
+ catch {
175
+ return false;
176
+ }
177
+ }
178
+ async function evaluateSuperSearchGate(missionDir) {
179
+ return evaluateLocalGate({
180
+ root: process.cwd(),
181
+ dir: missionDir,
182
+ gateFile: path.join('super-search', 'super-search-gate.json'),
183
+ requiredArtifacts: [
184
+ path.join('super-search', 'source-ledger.json'),
185
+ path.join('super-search', 'claim-ledger.json'),
186
+ path.join('super-search', 'super-search-proof.json'),
187
+ path.join('super-search', 'super-search-result.json')
188
+ ]
189
+ });
190
+ }
191
+ async function evaluateSuperSearchArtifacts(missionDir) {
192
+ const artifactDir = path.join(missionDir, 'super-search');
193
+ const [result, sourceLedger, claimLedger, proof] = await Promise.all([
194
+ readJsonFile(path.join(artifactDir, 'super-search-result.json')),
195
+ readJsonFile(path.join(artifactDir, 'source-ledger.json')),
196
+ readJsonFile(path.join(artifactDir, 'claim-ledger.json')),
197
+ readJsonFile(path.join(artifactDir, 'super-search-proof.json'))
198
+ ]);
199
+ const sources = Array.isArray(result?.sources) ? result.sources : Array.isArray(sourceLedger?.sources) ? sourceLedger.sources : [];
200
+ const claims = Array.isArray(result?.claims) ? result.claims : Array.isArray(claimLedger?.claims) ? claimLedger.claims : [];
201
+ const proofData = result?.proof || proof || {};
202
+ return evaluateRealEvidencePolicy({
203
+ productionMode: true,
204
+ mode: result?.mode || proofData?.mode,
205
+ sources,
206
+ claims,
207
+ proof: proofData
208
+ });
209
+ }
210
+ async function readJsonFile(file) {
211
+ const text = await fs.readFile(file, 'utf8').catch(() => null);
212
+ if (!text)
213
+ return null;
214
+ try {
215
+ return JSON.parse(text);
216
+ }
217
+ catch {
218
+ return null;
219
+ }
220
+ }
221
+ //# sourceMappingURL=super-search-command.js.map
@@ -9,19 +9,19 @@ export async function xaiCommand(sub = 'check', args = []) {
9
9
  setup_performed: false,
10
10
  xai_required: false,
11
11
  replacement: {
12
- doctor: 'sks insane-search doctor',
13
- x_search: 'sks insane-search x "<query>"',
14
- migration: 'sks insane-search migrate-xai [--apply]'
12
+ doctor: 'sks super-search doctor',
13
+ x_search: 'sks super-search x "<query>"',
14
+ fetch: 'sks super-search fetch "<url>"'
15
15
  },
16
- blockers: action === 'setup' ? ['xai_setup_removed_use_ultra_search'] : [],
16
+ blockers: action === 'setup' ? ['xai_setup_removed_use_super_search'] : [],
17
17
  warnings: ['sks_xai_is_deprecated_and_does_not_configure_mcp_or_require_XAI_API_KEY']
18
18
  };
19
19
  if (json)
20
20
  console.log(JSON.stringify(result, null, 2));
21
21
  else {
22
- console.log('`sks xai` is deprecated. InsaneSearch no longer requires xAI/Grok or XAI_API_KEY.');
23
- console.log('Use: sks insane-search doctor');
24
- console.log('Use: sks insane-search x "<query>"');
22
+ console.log('`sks xai` is deprecated. Super-Search no longer requires xAI/Grok or XAI_API_KEY.');
23
+ console.log('Use: sks super-search doctor');
24
+ console.log('Use: sks super-search x "<query>"');
25
25
  if (action === 'setup') {
26
26
  console.log('No MCP setup was performed.');
27
27
  process.exitCode = 1;