sneakoscope 0.9.15 → 0.9.17

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 (89) hide show
  1. package/README.md +20 -4
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/package.json +7 -2
  6. package/src/cli/command-registry.mjs +3 -0
  7. package/src/cli/install-helpers.mjs +1 -1
  8. package/src/commands/autoresearch.mjs +2 -2
  9. package/src/commands/code-structure.mjs +1 -1
  10. package/src/commands/computer-use.mjs +2 -28
  11. package/src/commands/db.mjs +1 -1
  12. package/src/commands/doctor.mjs +23 -3
  13. package/src/commands/eval.mjs +1 -1
  14. package/src/commands/gc.mjs +1 -1
  15. package/src/commands/goal.mjs +1 -1
  16. package/src/commands/gx.mjs +1 -1
  17. package/src/commands/harness.mjs +1 -1
  18. package/src/commands/hook.mjs +2 -4
  19. package/src/commands/hproof.mjs +1 -1
  20. package/src/commands/image-ux-review.mjs +2 -35
  21. package/src/commands/mad-sks.mjs +1 -1
  22. package/src/commands/memory.mjs +1 -1
  23. package/src/commands/perf.mjs +1 -1
  24. package/src/commands/pipeline.mjs +2 -22
  25. package/src/commands/ppt.mjs +3 -42
  26. package/src/commands/profile.mjs +1 -1
  27. package/src/commands/proof-field.mjs +1 -1
  28. package/src/commands/qa-loop.mjs +1 -1
  29. package/src/commands/recallpulse.mjs +3 -2
  30. package/src/commands/research.mjs +1 -1
  31. package/src/commands/rust.mjs +5 -0
  32. package/src/commands/scouts.mjs +5 -0
  33. package/src/commands/skill-dream.mjs +1 -1
  34. package/src/commands/stats.mjs +1 -1
  35. package/src/commands/team.mjs +1 -1
  36. package/src/commands/validate-artifacts.mjs +1 -1
  37. package/src/commands/wiki.mjs +3 -92
  38. package/src/core/commands/autoresearch-command.mjs +5 -0
  39. package/src/core/commands/code-structure-command.mjs +18 -0
  40. package/src/core/commands/command-utils.mjs +77 -0
  41. package/src/core/commands/computer-use-command.mjs +78 -0
  42. package/src/core/commands/db-command.mjs +91 -0
  43. package/src/core/commands/eval-command.mjs +68 -0
  44. package/src/core/commands/gc-command.mjs +28 -0
  45. package/src/core/commands/goal-command.mjs +60 -0
  46. package/src/core/commands/gx-command.mjs +99 -0
  47. package/src/core/commands/harness-command.mjs +17 -0
  48. package/src/core/commands/hproof-command.mjs +11 -0
  49. package/src/core/commands/image-ux-review-command.mjs +83 -0
  50. package/src/core/commands/mad-sks-command.mjs +129 -0
  51. package/src/core/commands/perf-command.mjs +33 -0
  52. package/src/core/commands/pipeline-command.mjs +58 -0
  53. package/src/core/commands/ppt-command.mjs +93 -0
  54. package/src/core/commands/profile-command.mjs +15 -0
  55. package/src/core/commands/proof-field-command.mjs +28 -0
  56. package/src/core/commands/qa-loop-command.mjs +188 -0
  57. package/src/core/commands/recallpulse-command.mjs +5 -0
  58. package/src/core/commands/research-command.mjs +298 -0
  59. package/src/core/commands/rust-command.mjs +76 -0
  60. package/src/core/commands/scouts-command.mjs +201 -0
  61. package/src/core/commands/skill-dream-command.mjs +40 -0
  62. package/src/core/commands/team-command.mjs +336 -0
  63. package/src/core/commands/validate-artifacts-command.mjs +45 -0
  64. package/src/core/commands/wiki-command.mjs +467 -0
  65. package/src/core/feature-fixture-runner.mjs +134 -26
  66. package/src/core/feature-fixtures.mjs +18 -13
  67. package/src/core/feature-registry.mjs +89 -16
  68. package/src/core/fsx.mjs +1 -1
  69. package/src/core/hooks-runtime.mjs +5 -2
  70. package/src/core/init.mjs +2 -0
  71. package/src/core/pipeline.mjs +35 -6
  72. package/src/core/proof/auto-finalize.mjs +81 -0
  73. package/src/core/proof/proof-schema.mjs +1 -0
  74. package/src/core/proof/proof-writer.mjs +1 -0
  75. package/src/core/proof/route-finalizer.mjs +6 -2
  76. package/src/core/proof/route-proof-gate.mjs +11 -1
  77. package/src/core/proof/route-proof-policy.mjs +1 -0
  78. package/src/core/routes.mjs +4 -1
  79. package/src/core/rust-accelerator.mjs +68 -7
  80. package/src/core/scouts/scout-artifacts.mjs +95 -0
  81. package/src/core/scouts/scout-consensus.mjs +103 -0
  82. package/src/core/scouts/scout-gate.mjs +75 -0
  83. package/src/core/scouts/scout-plan.mjs +149 -0
  84. package/src/core/scouts/scout-proof-evidence.mjs +39 -0
  85. package/src/core/scouts/scout-runner.mjs +283 -0
  86. package/src/core/scouts/scout-schema.mjs +79 -0
  87. package/src/core/scouts/scout-triwiki.mjs +19 -0
  88. package/src/core/version.mjs +1 -1
  89. package/src/core/commands/route-cli.mjs +0 -2443
package/README.md CHANGED
@@ -2,11 +2,22 @@
2
2
 
3
3
  Fast legacy-free proof-first Codex trust layer with image-based Voxel TriWiki.
4
4
 
5
- Sneakoscope Codex (`sks`) is a Codex CLI/App harness that makes repeatable Codex work auditable. `0.9.15` runs through split command modules, automatically seals serious routes with Completion Proof, binds visual/UI claims to Image Voxel TriWiki anchors and relations, and release-gates hooks, codex-lb, executable fixtures, Rust parity, and DB safety evidence.
5
+ Sneakoscope Codex (`sks`) is a Codex CLI/App harness that makes repeatable Codex work auditable. `0.9.17` removes the old route command monolith, adds a read-only five-scout intake before serious route implementation, automatically seals serious route fixture paths with Completion Proof, binds visual/UI claims to Image Voxel TriWiki anchors and relations, and release-gates real command fixtures, route modularity, Rust fallback parity, and DB safety evidence.
6
6
 
7
- ## 0.9.15 Current Release
7
+ ![Sneakoscope Codex architecture and pipeline](https://raw.githubusercontent.com/mandarange/Sneakoscope-Codex/dev/docs/assets/sneakoscope-architecture-pipeline.jpg)
8
8
 
9
- `0.9.15` preserves the 0.9.14 legacy-free trust layer and fixes global npm postinstall auto-bootstrap.
9
+ ## 0.9.17 Current Release
10
+
11
+ `0.9.17` completes the route modularity cleanup that started in 0.9.14. `src/core/commands/route-cli.mjs` is gone; every serious route now owns a focused command module, and release checks fail if the monolith returns or if command modules drift past their budget.
12
+
13
+ Highlights:
14
+
15
+ - Serious route mock/fixture commands call `maybeFinalizeRoute`, so Team, QA-LOOP, Research, PPT, Image UX Review, Computer Use, DB, Wiki, and GX fixtures produce route-local `completion-proof.json` without a separate repair/finalize step.
16
+ - Serious routes run or validate five read-only scouts for code surface, verification, safety/DB, visual/Voxel evidence, and simplification/integration before proof is written.
17
+ - E2E route tests run actual route commands such as `sks team fixture --mock --json`, `sks qa-loop run <mission> --mock --json`, and `sks wiki image-ingest ... --json`.
18
+ - Feature fixtures execute deterministic allowlisted commands and validate artifacts generated by those commands, including mission-local proof, visual ledgers, DB reports, and GX/Wiki evidence.
19
+ - `sks rust status|smoke --json` reports optional Rust availability, detects stale native binaries, and proves JS fallback parity when native Rust is missing or version-mismatched.
20
+ - `npm run release:check` includes `route-modularity:check`, `command-budget:check`, and `feature-fixtures:strict`.
10
21
 
11
22
  `0.9.14` turned SKS into a legacy-free proof-first trust layer for Codex work:
12
23
 
@@ -21,7 +32,11 @@ Sneakoscope Codex (`sks`) is a Codex CLI/App harness that makes repeatable Codex
21
32
 
22
33
  Learn more:
23
34
  - Completion Proof: [docs/completion-proof.md](docs/completion-proof.md)
35
+ - Five-Scout Pipeline: [docs/five-scout-pipeline.md](docs/five-scout-pipeline.md)
24
36
  - Image Voxel TriWiki: [docs/image-voxel-ledger.md](docs/image-voxel-ledger.md)
37
+ - Route finalization: [docs/route-finalization.md](docs/route-finalization.md)
38
+ - Feature fixtures: [docs/feature-fixtures.md](docs/feature-fixtures.md)
39
+ - Rust accelerator: [docs/rust-accelerator.md](docs/rust-accelerator.md)
25
40
  - Codex App Hooks/PAT: [docs/hooks-pat.md](docs/hooks-pat.md)
26
41
  - codex-lb: [docs/codex-lb.md](docs/codex-lb.md)
27
42
 
@@ -33,13 +48,14 @@ sks root
33
48
  sks doctor
34
49
  sks codex-app check
35
50
  sks selftest --mock
51
+ sks rust smoke --json
36
52
  ```
37
53
 
38
54
  ## Three core promises
39
55
 
40
56
  1. Completion Proof for every serious route
41
57
  2. Image Voxel TriWiki anchors and relations for every visual route
42
- 3. Codex App, codex-lb, hooks, Rust, DB, and fixtures verified by release gates
58
+ 3. Codex App, codex-lb, hooks, Rust fallback parity, DB, route modularity, and generated fixtures verified by release gates
43
59
 
44
60
  ## Install Options
45
61
 
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "0.9.15"
79
+ version = "0.9.17"
80
80
  dependencies = [
81
81
  "serde_json",
82
82
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "0.9.15"
3
+ version = "0.9.17"
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 0.9.15"),
7
+ Some("--version") => println!("sks-rs 0.9.17"),
8
8
  Some("compact-info") => {
9
9
  let mut input = String::new();
10
10
  let _ = io::stdin().read_to_string(&mut input);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sneakoscope",
3
3
  "displayName": "ㅅㅋㅅ",
4
- "version": "0.9.15",
4
+ "version": "0.9.17",
5
5
  "description": "Sneakoscope Codex: fast proof-first Codex trust layer with image-based Voxel TriWiki.",
6
6
  "type": "module",
7
7
  "homepage": "https://github.com/mandarange/Sneakoscope-Codex#readme",
@@ -41,11 +41,16 @@
41
41
  "changelog:check": "node ./scripts/changelog-check.mjs",
42
42
  "cli-entrypoint:check": "node ./scripts/check-cli-entrypoint.mjs",
43
43
  "legacy-free:check": "node ./scripts/check-legacy-free.mjs",
44
+ "route-modularity:check": "node ./scripts/check-route-modularity.mjs",
45
+ "command-budget:check": "node ./scripts/check-command-module-budget.mjs",
44
46
  "sizecheck": "node ./scripts/sizecheck.mjs",
45
47
  "registry:check": "node ./scripts/release-registry-check.mjs",
46
48
  "feature:check": "node ./bin/sks.mjs features check --json",
47
49
  "all-features:selftest": "node ./bin/sks.mjs all-features selftest --mock --json",
48
50
  "all-features:execute-fixtures": "node ./bin/sks.mjs all-features selftest --mock --execute-fixtures --strict-artifacts --json",
51
+ "feature-fixtures:strict": "node ./bin/sks.mjs all-features selftest --mock --execute-fixtures --strict-artifacts --json",
52
+ "scouts:selftest": "node ./bin/sks.mjs scouts run latest --mock --json",
53
+ "scouts:check": "node ./bin/sks.mjs scouts validate latest --json",
49
54
  "perf:cold-start": "node ./bin/sks.mjs perf cold-start --json",
50
55
  "perf:gate": "node ./scripts/perf-gate.mjs",
51
56
  "test": "node --test \"test/**/*.test.mjs\"",
@@ -55,7 +60,7 @@
55
60
  "rust:check": "cargo check --manifest-path crates/sks-core/Cargo.toml",
56
61
  "rust:smoke": "node ./scripts/rust-smoke.mjs",
57
62
  "coverage": "node --experimental-test-coverage --test \"test/**/*.test.mjs\"",
58
- "release:check": "npm run repo-audit && npm run changelog:check && npm run cli-entrypoint:check && npm run legacy-free:check && npm run packcheck && npm run feature:check && npm run all-features:selftest && npm run all-features:execute-fixtures && npm run selftest && npm run test:unit && npm run test:integration:mock && npm run test:e2e:mock && npm run rust:check && npm run rust:smoke && npm run perf:gate && npm run sizecheck && npm run registry:check",
63
+ "release:check": "npm run repo-audit && npm run changelog:check && npm run cli-entrypoint:check && npm run legacy-free:check && npm run packcheck && npm run route-modularity:check && npm run command-budget:check && npm run feature:check && npm run all-features:selftest && npm run scouts:selftest && npm run scouts:check && npm run feature-fixtures:strict && npm run selftest && npm run test:unit && npm run test:integration:mock && npm run test:e2e:mock && npm run rust:check && npm run rust:smoke && npm run perf:gate && npm run sizecheck && npm run registry:check",
59
64
  "publish:dry": "npm run release:check && npm --cache /tmp/sks-npm-cache publish --dry-run --registry https://registry.npmjs.org/ --access public",
60
65
  "publish:npm": "npm --cache /tmp/sks-npm-cache publish --registry https://registry.npmjs.org/ --access public",
61
66
  "prepublishOnly": "npm run release:check && node ./scripts/release-registry-check.mjs --require-unpublished"
@@ -44,6 +44,8 @@ export const COMMANDS = {
44
44
  context7: { maturity: 'beta', summary: 'Context7 checks and docs', lazy: () => import('../commands/context7.mjs') },
45
45
  recallpulse: { maturity: 'labs', summary: 'RecallPulse evidence route', lazy: () => import('../commands/recallpulse.mjs') },
46
46
  pipeline: { maturity: 'beta', summary: 'Inspect pipeline missions', lazy: () => import('../commands/pipeline.mjs') },
47
+ scouts: { maturity: 'beta', summary: 'Run the default read-only 5-scout intake phase', lazy: () => import('../commands/scouts.mjs') },
48
+ scout: { maturity: 'beta', summary: 'Alias for scouts', lazy: () => import('../commands/scouts.mjs') },
47
49
  guard: { maturity: 'beta', summary: 'Check harness guard', lazy: () => import('../commands/guard.mjs') },
48
50
  conflicts: { maturity: 'beta', summary: 'Check harness conflicts', lazy: () => import('../commands/conflicts.mjs') },
49
51
  versioning: { maturity: 'stable', summary: 'Manage release version metadata', lazy: () => import('../commands/versioning.mjs') },
@@ -59,6 +61,7 @@ export const COMMANDS = {
59
61
  'proof-field': { maturity: 'beta', summary: 'Scan proof field', lazy: () => import('../commands/proof-field.mjs') },
60
62
  'skill-dream': { maturity: 'labs', summary: 'Track skill dream counters', lazy: () => import('../commands/skill-dream.mjs') },
61
63
  'code-structure': { maturity: 'labs', summary: 'Scan source structure', lazy: () => import('../commands/code-structure.mjs') },
64
+ rust: { maturity: 'beta', summary: 'Inspect optional Rust accelerator status and smoke parity', lazy: () => import('../commands/rust.mjs') },
62
65
  memory: { maturity: 'labs', summary: 'Run retention checks', lazy: () => import('../commands/memory.mjs') },
63
66
  gx: { maturity: 'labs', summary: 'Render/validate GX cartridges', lazy: () => import('../commands/gx.mjs') },
64
67
  db: { maturity: 'beta', summary: 'Inspect DB safety policy', lazy: () => import('../commands/db.mjs') },
@@ -2349,7 +2349,7 @@ export async function selftestCodexLb(tmp) {
2349
2349
  if (!codexLbLaunch.includes('sks-codex-lb.env')) throw new Error('selftest: tmux launch command does not source codex-lb env file');
2350
2350
  if (!codexLbLaunch.includes("'--model' 'gpt-5.5'")) throw new Error('selftest: tmux launch command without args did not force GPT-5.5');
2351
2351
  if (!codexLbLaunch.includes('SKS_TMUX_LOGO_ANIMATION') || !codexLbLaunch.includes('SNEAKOSCOPE CODEX')) throw new Error('selftest: tmux launch command does not include the animated SKS logo intro');
2352
- const madLaunchSource = await safeReadText(path.join(packageRoot(), 'src', 'core', 'commands', 'route-cli.mjs'));
2352
+ const madLaunchSource = await safeReadText(path.join(packageRoot(), 'src', 'core', 'commands', 'mad-sks-command.mjs'));
2353
2353
  if (!madLaunchSource.includes('const lb = await deps.maybePromptCodexLbSetupForLaunch(args)') || !madLaunchSource.includes("const launchLb = lb.status === 'present'") || !madLaunchSource.includes('codexLbImmediateLaunchOpts(cleanArgs, launchLb') || !madLaunchSource.includes('bypass_codex_lb') || !madLaunchSource.includes('model_provider="openai"') || !madLaunchSource.includes('codexLbFreshSession: true')) throw new Error('selftest: MAD launch does not sync codex-lb auth and fresh-session launch options');
2354
2354
 
2355
2355
  }
@@ -1,5 +1,5 @@
1
- import { researchCommand } from '../core/commands/route-cli.mjs';
1
+ import { autoresearchCommand } from '../core/commands/autoresearch-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'status', ...rest] = args;
4
- return researchCommand(sub, rest);
4
+ return autoresearchCommand(sub, rest);
5
5
  }
@@ -1,4 +1,4 @@
1
- import { codeStructureCommand } from '../core/commands/route-cli.mjs';
1
+ import { codeStructureCommand } from '../core/commands/code-structure-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'scan', ...rest] = args;
4
4
  return codeStructureCommand(sub, rest);
@@ -1,31 +1,5 @@
1
- import { projectRoot } from '../core/fsx.mjs';
2
- import { findLatestMission } from '../core/mission.mjs';
3
- import { flag } from '../cli/args.mjs';
4
- import { printJson } from '../cli/output.mjs';
5
- import { finalizeRouteWithProof } from '../core/proof/route-finalizer.mjs';
1
+ import { computerUseCommand } from '../core/commands/computer-use-command.mjs';
6
2
 
7
3
  export async function run(command, args = []) {
8
- const root = await projectRoot();
9
- const missionArg = args.find((arg) => !String(arg).startsWith('--')) || 'latest';
10
- const missionId = missionArg === 'latest' ? await findLatestMission(root) : missionArg;
11
- if (!missionId) {
12
- const result = { schema: 'sks.computer-use-evidence.v1', ok: false, status: 'missing_mission' };
13
- if (flag(args, '--json')) return printJson(result);
14
- console.error('No mission found.');
15
- process.exitCode = 1;
16
- return;
17
- }
18
- const route = command === 'cu' ? '$CU' : '$Computer-Use';
19
- const proof = await finalizeRouteWithProof(root, {
20
- missionId,
21
- route,
22
- mock: flag(args, '--mock'),
23
- requireRelation: flag(args, '--fix-claim') || flag(args, '--require-relation'),
24
- artifacts: ['computer-use-evidence-ledger.json', 'screen-capture-ledger.json', 'image-voxel-ledger.json', 'visual-anchors.json'],
25
- claims: [{ id: 'computer-use-evidence', status: flag(args, '--mock') ? 'verified_partial' : 'supported' }]
26
- });
27
- const result = { schema: 'sks.computer-use-evidence.v1', ok: proof.ok, mission_id: missionId, route, proof: proof.validation };
28
- if (flag(args, '--json')) return printJson(result);
29
- console.log(`Computer Use evidence: ${proof.ok ? 'ok' : 'blocked'} ${missionId}`);
30
- if (!proof.ok) process.exitCode = 1;
4
+ return computerUseCommand(command, args);
31
5
  }
@@ -1,4 +1,4 @@
1
- import { dbCommand } from '../core/commands/route-cli.mjs';
1
+ import { dbCommand } from '../core/commands/db-command.mjs';
2
2
 
3
3
  export async function run(_command, args = []) {
4
4
  const [sub = 'policy', ...rest] = args;
@@ -5,11 +5,23 @@ import { getCodexInfo } from '../core/codex-adapter.mjs';
5
5
  import { rustInfo } from '../core/rust-accelerator.mjs';
6
6
  import { codexAppIntegrationStatus } from '../core/codex-app.mjs';
7
7
  import { codexLbMetrics, readCodexLbCircuit } from '../core/codex-lb-circuit.mjs';
8
+ import { ensureGlobalCodexSkillsDuringInstall } from '../cli/install-helpers.mjs';
9
+ import { normalizeInstallScope } from '../core/init.mjs';
8
10
 
9
11
  export async function run(_command, args = []) {
12
+ let repair = null;
10
13
  if (flag(args, '--fix')) {
11
14
  const { setupCommand } = await import('../core/commands/basic-cli.mjs');
12
- await setupCommand(['--force', '--local-only']);
15
+ const installScope = installScopeFromArgs(args);
16
+ const setupArgs = ['--force', '--install-scope', installScope];
17
+ if (flag(args, '--local-only')) setupArgs.push('--local-only');
18
+ await setupCommand(setupArgs);
19
+ repair = {
20
+ install_scope: installScope,
21
+ global_skills: installScope === 'global' && !flag(args, '--local-only')
22
+ ? await ensureGlobalCodexSkillsDuringInstall({ force: true })
23
+ : { status: 'skipped', reason: 'project or local-only repair' }
24
+ };
13
25
  }
14
26
  const root = await projectRoot();
15
27
  const codex = await getCodexInfo().catch((err) => ({ available: false, error: err.message }));
@@ -27,7 +39,8 @@ export async function run(_command, args = []) {
27
39
  codex_app: codexApp,
28
40
  codex_lb: codexLb,
29
41
  sneakoscope: { ok: await exists(`${root}/.sneakoscope`) },
30
- package: { bytes: pkgBytes, human: formatBytes(pkgBytes) }
42
+ package: { bytes: pkgBytes, human: formatBytes(pkgBytes) },
43
+ repair
31
44
  };
32
45
  if (flag(args, '--json')) {
33
46
  printJson(result);
@@ -38,9 +51,16 @@ export async function run(_command, args = []) {
38
51
  console.log(`Root: ${root}`);
39
52
  console.log(`Node: ${result.node.ok ? 'ok' : 'fail'} ${result.node.version}`);
40
53
  console.log(`Codex: ${codex.bin ? 'ok' : 'missing'} ${codex.version || ''}`);
41
- console.log(`Rust acc.: ${rust.available ? rust.version : 'optional-missing'}`);
54
+ console.log(`Rust acc.: ${rust.mode || (rust.available ? 'rust_accelerated' : 'js_fallback')} ${rust.version || rust.status || ''}`);
42
55
  console.log(`Codex App: ${codexApp.ok ? 'ok' : 'needs setup'}`);
43
56
  console.log(`codex-lb: ${codexLb.ok ? 'ok' : `blocked ${codexLb.circuit?.state || 'unknown'}`}`);
44
57
  console.log(`Ready: ${result.ok ? 'yes' : 'no'}`);
45
58
  if (!result.ok) process.exitCode = 1;
46
59
  }
60
+
61
+ function installScopeFromArgs(args = []) {
62
+ if (flag(args, '--project')) return 'project';
63
+ if (flag(args, '--global')) return 'global';
64
+ const index = args.indexOf('--install-scope');
65
+ return normalizeInstallScope(index >= 0 && args[index + 1] ? args[index + 1] : 'global');
66
+ }
@@ -1,4 +1,4 @@
1
- import { evalCommand } from '../core/commands/route-cli.mjs';
1
+ import { evalCommand } from '../core/commands/eval-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'run', ...rest] = args;
4
4
  return evalCommand(sub, rest);
@@ -1,2 +1,2 @@
1
- import { gcCommand } from '../core/commands/route-cli.mjs';
1
+ import { gcCommand } from '../core/commands/gc-command.mjs';
2
2
  export async function run(_command, args = []) { return gcCommand(args); }
@@ -1,4 +1,4 @@
1
- import { goalCommand } from '../core/commands/route-cli.mjs';
1
+ import { goalCommand } from '../core/commands/goal-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub, ...rest] = args;
4
4
  return goalCommand(sub, rest);
@@ -1,4 +1,4 @@
1
- import { gxCommand } from '../core/commands/route-cli.mjs';
1
+ import { gxCommand } from '../core/commands/gx-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'validate', ...rest] = args;
4
4
  return gxCommand(sub, rest);
@@ -1,4 +1,4 @@
1
- import { harnessCommand } from '../core/commands/route-cli.mjs';
1
+ import { harnessCommand } from '../core/commands/harness-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'fixture', ...rest] = args;
4
4
  return harnessCommand(sub, rest);
@@ -1,8 +1,6 @@
1
- import { hookMain } from '../core/hooks-runtime.mjs';
2
- import { printJson } from '../cli/output.mjs';
1
+ import { emitHook } from '../core/hooks-runtime.mjs';
3
2
 
4
3
  export async function run(_command, args = []) {
5
4
  const [name = 'user-prompt-submit'] = args;
6
- const result = await hookMain(name);
7
- return printJson(result);
5
+ return emitHook(name);
8
6
  }
@@ -1,4 +1,4 @@
1
- import { hproofCommand } from '../core/commands/route-cli.mjs';
1
+ import { hproofCommand } from '../core/commands/hproof-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'check', ...rest] = args;
4
4
  return hproofCommand(sub, rest);
@@ -1,38 +1,5 @@
1
- import path from 'node:path';
2
- import { projectRoot, readJson } from '../core/fsx.mjs';
3
- import { findLatestMission, loadMission } from '../core/mission.mjs';
4
- import { flag } from '../cli/args.mjs';
5
- import { printJson } from '../cli/output.mjs';
6
- import { writeImageUxReviewRouteArtifacts } from '../core/image-ux-review.mjs';
7
- import { finalizeRouteWithProof } from '../core/proof/route-finalizer.mjs';
1
+ import { imageUxReviewCommand } from '../core/commands/image-ux-review-command.mjs';
8
2
 
9
3
  export async function run(command, args = []) {
10
- const root = await projectRoot();
11
- const action = args[0] || 'status';
12
- const missionArg = args[1] && !String(args[1]).startsWith('--') ? args[1] : 'latest';
13
- const missionId = missionArg === 'latest' ? await findLatestMission(root) : missionArg;
14
- if (!missionId) {
15
- const result = { schema: 'sks.image-ux-review-status.v1', ok: false, status: 'missing_mission' };
16
- if (flag(args, '--json')) return printJson(result);
17
- console.error('No mission found.');
18
- process.exitCode = 1;
19
- return;
20
- }
21
- const { dir, mission } = await loadMission(root, missionId);
22
- const contract = await readJson(path.join(dir, 'decision-contract.json'), { prompt: mission.prompt, answers: {}, sealed_hash: null });
23
- if (action === 'build' || action === 'run' || (action === 'status' && flag(args, '--mock'))) {
24
- const artifacts = await writeImageUxReviewRouteArtifacts(dir, contract);
25
- const route = command === 'ux-review' ? '$UX-Review' : command === 'visual-review' ? '$Visual-Review' : command === 'ui-ux-review' ? '$UI-UX-Review' : '$Image-UX-Review';
26
- const proof = await finalizeRouteWithProof(root, { missionId, route, mock: flag(args, '--mock'), artifacts: Object.keys(artifacts), claims: [{ id: 'image-ux-review-fixture', status: 'verified_partial' }] });
27
- const result = { schema: 'sks.image-ux-review-build.v1', ok: proof.ok, mission_id: missionId, artifacts, proof: proof.validation };
28
- if (flag(args, '--json')) return printJson(result);
29
- console.log(`Image UX review: ${proof.ok ? 'ok' : 'blocked'} ${missionId}`);
30
- if (!proof.ok) process.exitCode = 1;
31
- return;
32
- }
33
- const gate = await readJson(path.join(dir, 'image-ux-review-gate.json'), null);
34
- const result = { schema: 'sks.image-ux-review-status.v1', ok: true, mission_id: missionId, gate };
35
- if (flag(args, '--json')) return printJson(result);
36
- console.log(`Image UX Review mission: ${missionId}`);
37
- console.log(`Gate: ${gate?.passed ? 'passed' : gate ? 'present' : 'missing'}`);
4
+ return imageUxReviewCommand(command, args);
38
5
  }
@@ -1,4 +1,4 @@
1
- import { madHighCommand } from '../core/commands/route-cli.mjs';
1
+ import { madHighCommand } from '../core/commands/mad-sks-command.mjs';
2
2
  import { maybePromptCodexUpdateForLaunch, maybePromptCodexLbSetupForLaunch } from '../cli/install-helpers.mjs';
3
3
  import { PACKAGE_VERSION } from '../core/fsx.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { memoryCommand } from '../core/commands/route-cli.mjs';
1
+ import { memoryCommand } from '../core/commands/gc-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub, ...rest] = args;
4
4
  return memoryCommand(sub, rest);
@@ -25,7 +25,7 @@ export async function run(_command, args = []) {
25
25
  if (!result.ok) process.exitCode = 1;
26
26
  return;
27
27
  }
28
- const { perfCommand } = await import('../core/commands/route-cli.mjs');
28
+ const { perfCommand } = await import('../core/commands/perf-command.mjs');
29
29
  return perfCommand(action, args.slice(1));
30
30
  }
31
31
 
@@ -1,25 +1,5 @@
1
- import { projectRoot, readJson } from '../core/fsx.mjs';
2
- import { stateFile } from '../core/mission.mjs';
3
- import { flag } from '../cli/args.mjs';
4
- import { printJson } from '../cli/output.mjs';
5
- import { projectGateStatus } from '../core/pipeline.mjs';
1
+ import { pipelineCommand } from '../core/commands/pipeline-command.mjs';
6
2
 
7
3
  export async function run(_command, args = []) {
8
- const root = await projectRoot();
9
- const action = args[0] || 'status';
10
- const state = await readJson(stateFile(root), {});
11
- if (action === 'status') {
12
- const result = { schema: 'sks.pipeline-status.v1', ok: true, state };
13
- if (flag(args, '--json')) return printJson(result);
14
- console.log(`Pipeline: ${state.mission_id || 'none'} ${state.route_command || state.mode || ''}`.trim());
15
- return;
16
- }
17
- if (action === 'plan') {
18
- const result = await projectGateStatus(root, state);
19
- if (flag(args, '--json')) return printJson(result);
20
- console.log(`Pipeline gate: ${result.ok ? 'pass' : 'blocked'}`);
21
- return;
22
- }
23
- console.error('Usage: sks pipeline status|plan [--json]');
24
- process.exitCode = 1;
4
+ return pipelineCommand(args);
25
5
  }
@@ -1,44 +1,5 @@
1
- import path from 'node:path';
2
- import { projectRoot, readJson, writeJsonAtomic } from '../core/fsx.mjs';
3
- import { findLatestMission, loadMission } from '../core/mission.mjs';
4
- import { flag } from '../cli/args.mjs';
5
- import { printJson } from '../cli/output.mjs';
6
- import { writePptBuildArtifacts, writePptRouteArtifacts } from '../core/ppt.mjs';
7
- import { finalizeRouteWithProof } from '../core/proof/route-finalizer.mjs';
1
+ import { pptCommand } from '../core/commands/ppt-command.mjs';
8
2
 
9
- export async function run(_command, args = []) {
10
- const root = await projectRoot();
11
- const action = args[0] || 'status';
12
- const missionArg = args[1] && !String(args[1]).startsWith('--') ? args[1] : 'latest';
13
- const missionId = missionArg === 'latest' ? await findLatestMission(root) : missionArg;
14
- if (!missionId) {
15
- const result = { schema: 'sks.ppt-status.v1', ok: false, status: 'missing_mission' };
16
- if (flag(args, '--json')) return printJson(result);
17
- console.error('No mission found.');
18
- process.exitCode = 1;
19
- return;
20
- }
21
- const { dir, mission } = await loadMission(root, missionId);
22
- const contract = await readJson(path.join(dir, 'decision-contract.json'), { prompt: mission.prompt, answers: {}, sealed_hash: null });
23
- if (action === 'build') {
24
- await writePptRouteArtifacts(dir, contract);
25
- const build = await writePptBuildArtifacts(dir, contract);
26
- const proof = await finalizeRouteWithProof(root, { missionId, route: '$PPT', mock: flag(args, '--mock'), artifacts: build.files || [], claims: [{ id: 'ppt-build-fixture', status: 'verified_partial' }] });
27
- const result = { schema: 'sks.ppt-build.v1', ok: proof.ok, mission_id: missionId, build, proof: proof.validation };
28
- if (flag(args, '--json')) return printJson(result);
29
- console.log(`PPT build: ${proof.ok ? 'ok' : 'blocked'} ${missionId}`);
30
- if (!proof.ok) process.exitCode = 1;
31
- return;
32
- }
33
- if (action === 'status') {
34
- const gate = await readJson(path.join(dir, 'ppt-gate.json'), null);
35
- const result = { schema: 'sks.ppt-status.v1', ok: true, mission_id: missionId, gate };
36
- if (flag(args, '--json')) return printJson(result);
37
- console.log(`PPT mission: ${missionId}`);
38
- console.log(`Gate: ${gate?.passed ? 'passed' : gate ? 'present' : 'missing'}`);
39
- return;
40
- }
41
- await writeJsonAtomic(path.join(dir, 'ppt-command-error.json'), { action, args });
42
- console.error('Usage: sks ppt build|status <mission-id|latest> [--json] [--mock]');
43
- process.exitCode = 1;
3
+ export async function run(command, args = []) {
4
+ return pptCommand(command, args);
44
5
  }
@@ -1,4 +1,4 @@
1
- import { profileCommand } from '../core/commands/route-cli.mjs';
1
+ import { profileCommand } from '../core/commands/profile-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'show', ...rest] = args;
4
4
  return profileCommand(sub, rest);
@@ -1,4 +1,4 @@
1
- import { proofFieldCommand } from '../core/commands/route-cli.mjs';
1
+ import { proofFieldCommand } from '../core/commands/proof-field-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'scan', ...rest] = args;
4
4
  return proofFieldCommand(sub, rest);
@@ -1,4 +1,4 @@
1
- import { qaLoopCommand } from '../core/commands/route-cli.mjs';
1
+ import { qaLoopCommand } from '../core/commands/qa-loop-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub, ...rest] = args;
4
4
  return qaLoopCommand(sub, rest);
@@ -1,5 +1,6 @@
1
- import { recallPulseCommand } from '../cli/recallpulse-command.mjs';
1
+ import { recallpulseCommand } from '../core/commands/recallpulse-command.mjs';
2
+
2
3
  export async function run(_command, args = []) {
3
4
  const [sub = 'status', ...rest] = args;
4
- return recallPulseCommand(sub, rest);
5
+ return recallpulseCommand(sub, rest);
5
6
  }
@@ -1,4 +1,4 @@
1
- import { researchCommand } from '../core/commands/route-cli.mjs';
1
+ import { researchCommand } from '../core/commands/research-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub, ...rest] = args;
4
4
  return researchCommand(sub, rest);
@@ -0,0 +1,5 @@
1
+ import { rustCommand } from '../core/commands/rust-command.mjs';
2
+
3
+ export async function run(_command, args = []) {
4
+ return rustCommand(args);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { scoutsCommand } from '../core/commands/scouts-command.mjs';
2
+
3
+ export async function run(_command, args = []) {
4
+ return scoutsCommand(args);
5
+ }
@@ -1,4 +1,4 @@
1
- import { skillDreamCommand } from '../core/commands/route-cli.mjs';
1
+ import { skillDreamCommand } from '../core/commands/skill-dream-command.mjs';
2
2
  export async function run(_command, args = []) {
3
3
  const [sub = 'status', ...rest] = args;
4
4
  return skillDreamCommand(sub, rest);
@@ -1,2 +1,2 @@
1
- import { statsCommand } from '../core/commands/route-cli.mjs';
1
+ import { statsCommand } from '../core/commands/gc-command.mjs';
2
2
  export async function run(_command, args = []) { return statsCommand(args); }
@@ -1,2 +1,2 @@
1
- import { team } from '../core/commands/route-cli.mjs';
1
+ import { team } from '../core/commands/team-command.mjs';
2
2
  export async function run(_command, args = []) { return team(args); }
@@ -1,2 +1,2 @@
1
- import { validateArtifactsCommand } from '../core/commands/route-cli.mjs';
1
+ import { validateArtifactsCommand } from '../core/commands/validate-artifacts-command.mjs';
2
2
  export async function run(_command, args = []) { return validateArtifactsCommand(args); }