sneakoscope 4.8.7 → 5.3.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.
- package/README.md +51 -726
- package/config/bench-baseline.json +7 -0
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/bin/install.js +35 -0
- package/dist/bin/sks.js +1 -1
- package/dist/cli/cli-theme.js +51 -0
- package/dist/cli/command-registry.js +15 -4
- package/dist/cli/help-fast.js +18 -8
- package/dist/cli/insane-search-command.js +36 -8
- package/dist/cli/install-helpers.js +32 -0
- package/dist/commands/codex-lb.js +2 -0
- package/dist/commands/doctor.js +94 -9
- package/dist/commands/proof.js +6 -3
- package/dist/config/skills-manifest.json +82 -54
- package/dist/core/agents/agent-conflict-graph.js +5 -0
- package/dist/core/agents/agent-lease.js +5 -0
- package/dist/core/agents/agent-ledger-schemas.js +1 -0
- package/dist/core/agents/agent-lifecycle.js +5 -3
- package/dist/core/agents/agent-orchestrator.js +268 -62
- package/dist/core/agents/agent-output-validator.js +14 -3
- package/dist/core/agents/agent-patch-queue-store.js +95 -2
- package/dist/core/agents/agent-patch-queue.js +6 -3
- package/dist/core/agents/agent-patch-schema.js +13 -0
- package/dist/core/agents/agent-proof-evidence.js +6 -1
- package/dist/core/agents/agent-runner-fake.js +40 -0
- package/dist/core/agents/agent-worker-pipeline.js +36 -2
- package/dist/core/agents/codex-exec-worker-adapter.js +2 -0
- package/dist/core/agents/native-cli-worker.js +0 -1
- package/dist/core/agents/native-worker-backend-router.js +58 -1
- package/dist/core/codex-app/sks-menubar.js +477 -132
- package/dist/core/codex-app.js +1 -0
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-control/codex-sdk-env-policy.js +1 -1
- package/dist/core/codex-control/schemas/agent-worker-result.schema.js +12 -3
- package/dist/core/codex-hooks/codex-hook-managed-install.js +5 -0
- package/dist/core/codex-hooks/codex-hook-state-writer.js +70 -11
- package/dist/core/codex-hooks/codex-hook-trust-doctor.js +2 -2
- package/dist/core/codex-lb/codex-lb-env.js +20 -1
- package/dist/core/commands/basic-cli.js +18 -1
- package/dist/core/commands/check-command.js +37 -5
- package/dist/core/commands/computer-use-command.js +62 -7
- package/dist/core/commands/db-command.js +31 -5
- package/dist/core/commands/fast-mode-command.js +3 -0
- package/dist/core/commands/gate-result-contract.js +43 -0
- package/dist/core/commands/gates-command.js +6 -1
- package/dist/core/commands/gc-command.js +29 -2
- package/dist/core/commands/goal-command.js +9 -2
- package/dist/core/commands/gx-command.js +79 -7
- package/dist/core/commands/image-ux-review-command.js +188 -13
- package/dist/core/commands/mad-db-command.js +85 -176
- package/dist/core/commands/mad-sks-command.js +230 -29
- package/dist/core/commands/menubar-command.js +24 -2
- package/dist/core/commands/naruto-command.js +64 -10
- package/dist/core/commands/plan-command.js +76 -0
- package/dist/core/commands/ppt-command.js +159 -24
- package/dist/core/commands/qa-loop-command.js +6 -2
- package/dist/core/commands/release-command.js +55 -2
- package/dist/core/commands/research-command.js +1 -1
- package/dist/core/commands/review-command.js +217 -0
- package/dist/core/commands/route-success-helpers.js +59 -0
- package/dist/core/commands/run-command.js +19 -7
- package/dist/core/commands/seo-command.js +49 -1
- package/dist/core/commands/ui-command.js +161 -0
- package/dist/core/commands/uninstall-command.js +15 -1
- package/dist/core/db-safety.js +2 -2
- package/dist/core/doctor/doctor-dirty-planner.js +51 -7
- package/dist/core/doctor/doctor-transaction.js +8 -0
- package/dist/core/doctor/doctor-zellij-repair.js +1 -0
- package/dist/core/doctor/imagegen-repair.js +161 -0
- package/dist/core/feature-fixture-runner.js +2 -2
- package/dist/core/feature-fixtures.js +58 -37
- package/dist/core/feature-registry.js +102 -2
- package/dist/core/fsx.js +39 -6
- package/dist/core/image-ux-review/imagegen-adapter.js +48 -11
- package/dist/core/image-ux-review.js +16 -0
- package/dist/core/imagegen/imagegen-capability.js +11 -5
- package/dist/core/imagegen/require-imagegen.js +57 -0
- package/dist/core/init/skills.js +10 -5
- package/dist/core/mad-db/mad-db-coordinator.js +94 -18
- package/dist/core/mad-db/mad-db-policy.js +12 -10
- package/dist/core/mad-sks/executors/executor-base.js +8 -2
- package/dist/core/mad-sks/executors/index.js +4 -0
- package/dist/core/mad-sks/executors/sql-plane-executor.js +194 -0
- package/dist/core/naruto/naruto-active-pool.js +15 -4
- package/dist/core/naruto/naruto-real-worker-child.js +11 -1
- package/dist/core/naruto/naruto-role-policy.js +3 -0
- package/dist/core/naruto/naruto-task-hints.js +10 -0
- package/dist/core/naruto/naruto-work-graph.js +8 -2
- package/dist/core/naruto/naruto-work-item.js +6 -0
- package/dist/core/naruto/solution-tournament.js +101 -0
- package/dist/core/permission-gates.js +30 -0
- package/dist/core/pipeline-internals/runtime-core.js +11 -3
- package/dist/core/pipeline-internals/runtime-gates.js +27 -0
- package/dist/core/ppt-review/index.js +6 -1
- package/dist/core/ppt-review/slide-imagegen-review.js +75 -10
- package/dist/core/ppt.js +70 -2
- package/dist/core/proof/auto-finalize.js +70 -11
- package/dist/core/proof/proof-schema.js +2 -0
- package/dist/core/proof/route-adapter.js +5 -1
- package/dist/core/proof/route-finalizer.js +8 -5
- package/dist/core/proof/selftest-proof-fixtures.js +18 -5
- package/dist/core/proof/validation.js +2 -0
- package/dist/core/provider/model-router.js +53 -0
- package/dist/core/release/release-gate-node.js +3 -0
- package/dist/core/release/release-gate-resource-governor.js +1 -0
- package/dist/core/routes/constants.js +1 -1
- package/dist/core/routes.js +65 -18
- package/dist/core/safety/mutation-guard.js +5 -1
- package/dist/core/stop-gate/gate-evaluator.js +102 -0
- package/dist/core/stop-gate/stop-gate-check.js +16 -1
- package/dist/core/stop-gate/stop-gate-writer.js +4 -0
- package/dist/core/triwiki/agents-md-projector.js +184 -0
- package/dist/core/triwiki-wrongness/wrongness-schema.js +3 -1
- package/dist/core/trust-kernel/trust-kernel-schema.js +1 -0
- package/dist/core/trust-kernel/trust-report.js +1 -1
- package/dist/core/trust-kernel/trust-status.js +2 -0
- package/dist/core/ui/dashboard-html.js +111 -0
- package/dist/core/update/update-migration-state.js +386 -15
- package/dist/core/update-check.js +178 -81
- package/dist/core/verification/diff-quality.js +100 -0
- package/dist/core/verification/impact-scan.js +164 -0
- package/dist/core/verification/machine-feedback.js +146 -0
- package/dist/core/verification/mistake-rule-compiler.js +195 -0
- package/dist/core/version.js +1 -1
- package/dist/core/zellij/zellij-self-heal.js +9 -6
- package/dist/core/zellij/zellij-slot-telemetry.js +1 -1
- package/dist/scripts/check-feature-quality.js +2 -2
- package/dist/scripts/cli-output-consistency-check.js +57 -0
- package/dist/scripts/coding-bench-check.js +136 -0
- package/dist/scripts/doctor-imagegen-repair-check.js +62 -0
- package/dist/scripts/ensure-bin-executable.js +11 -3
- package/dist/scripts/harness-benchmark-check.js +104 -0
- package/dist/scripts/legacy-update-e2e-check.js +228 -0
- package/dist/scripts/mad-db-command-check.js +11 -8
- package/dist/scripts/mad-db-route-identity-check.js +8 -6
- package/dist/scripts/mad-db-safety-conflict-matrix-check.js +31 -8
- package/dist/scripts/mad-db-skill-policy-snapshot-check.js +4 -5
- package/dist/scripts/naruto-real-active-pool-runtime-check.js +26 -1
- package/dist/scripts/ppt-real-imagegen-wiring-check.js +5 -1
- package/dist/scripts/proof-root-cause-policy-check.js +2 -0
- package/dist/scripts/release-dag-full-coverage-check.js +13 -4
- package/dist/scripts/release-gate-dag-runner.js +14 -0
- package/dist/scripts/release-gate-existence-audit.js +2 -1
- package/dist/scripts/release-gate-planner.js +2 -1
- package/dist/scripts/release-gate-script-parity-check.js +45 -17
- package/dist/scripts/release-metadata-1-19-check.js +2 -1
- package/dist/scripts/seo-geo-feature-fixture-quality-check.js +1 -1
- package/dist/scripts/sks-1-11-gate-lib.js +8 -6
- package/dist/scripts/sks-menubar-install-check.js +57 -20
- package/dist/scripts/ux-review-real-loop-fixture-check.js +9 -4
- package/dist/scripts/ux-review-run-wires-imagegen-check.js +4 -0
- package/dist/scripts/zellij-slot-telemetry-runtime-check.js +1 -0
- package/docs/assets/sneakoscope-architecture-pipeline.jpg +0 -0
- package/docs/demo.tape +28 -0
- package/package.json +31 -24
- package/schemas/codex/completion-proof.schema.json +3 -2
- package/schemas/release/release-gate-node.schema.json +2 -1
- package/dist/scripts/agent-backfill-route-blackbox.js +0 -5
- package/dist/scripts/agent-dynamic-pool-route-blackbox.js +0 -5
- package/dist/scripts/agent-parallel-write-blackbox.js +0 -56
- package/dist/scripts/agent-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/agent-route-blackbox-lib.js +0 -132
- package/dist/scripts/blackbox-command-import-smoke.js +0 -143
- package/dist/scripts/blackbox-global-shim.js +0 -77
- package/dist/scripts/blackbox-matrix.js +0 -70
- package/dist/scripts/blackbox-npx-one-shot.js +0 -69
- package/dist/scripts/blackbox-pack-install.js +0 -174
- package/dist/scripts/brand-neutrality-zero-leakage-blackbox.js +0 -4
- package/dist/scripts/build-once-runner-blackbox.js +0 -34
- package/dist/scripts/codex-0140-integration-blackbox.js +0 -13
- package/dist/scripts/codex-agent-type-blackbox.js +0 -4
- package/dist/scripts/codex-app-harness-blackbox.js +0 -4
- package/dist/scripts/codex-app-skill-agent-blackbox.js +0 -4
- package/dist/scripts/codex-hook-approval-blackbox.js +0 -4
- package/dist/scripts/codex-init-deep-directory-local-blackbox.js +0 -4
- package/dist/scripts/codex-native-feature-broker-blackbox.js +0 -4
- package/dist/scripts/codex-native-pattern-analysis-blackbox.js +0 -4
- package/dist/scripts/codex-native-read-repair-split-blackbox.js +0 -55
- package/dist/scripts/codex-native-reference-cache-blackbox.js +0 -41
- package/dist/scripts/core-skill-integrity-blackbox.js +0 -32
- package/dist/scripts/dfix-fast-blackbox-check.js +0 -37
- package/dist/scripts/dfix-parallel-write-blackbox.js +0 -48
- package/dist/scripts/dfix-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/doctor-dirty-repair-blackbox.js +0 -22
- package/dist/scripts/doctor-dirty-semantic-blackbox.js +0 -8
- package/dist/scripts/doctor-native-capability-repair-blackbox.js +0 -39
- package/dist/scripts/doctor-transaction-engine-blackbox.js +0 -28
- package/dist/scripts/doctor-zellij-fix-blackbox.js +0 -4
- package/dist/scripts/doctor-zellij-no-homebrew-blackbox.js +0 -4
- package/dist/scripts/doctor-zellij-upgrade-blackbox.js +0 -4
- package/dist/scripts/gate-pack-runner-blackbox.js +0 -27
- package/dist/scripts/gate-pack-v2-blackbox.js +0 -18
- package/dist/scripts/geo-cli-blackbox-check.js +0 -18
- package/dist/scripts/loop-collision-blackbox.js +0 -3
- package/dist/scripts/loop-concurrency-oversubscription-blackbox.js +0 -3
- package/dist/scripts/loop-fixture-production-misuse-blackbox.js +0 -3
- package/dist/scripts/loop-kill-interrupt-real-blackbox.js +0 -3
- package/dist/scripts/loop-merge-strategy-blackbox.js +0 -3
- package/dist/scripts/loop-mesh-production-e2e-blackbox.js +0 -3
- package/dist/scripts/loop-side-effect-blackbox.js +0 -3
- package/dist/scripts/mad-db-operation-lifecycle-blackbox.js +0 -29
- package/dist/scripts/mad-sks-actual-executor-blackbox.js +0 -5
- package/dist/scripts/mad-zellij-headless-fallback-blackbox.js +0 -4
- package/dist/scripts/mad-zellij-self-heal-blackbox.js +0 -4
- package/dist/scripts/naruto-loop-mesh-blackbox.js +0 -3
- package/dist/scripts/naruto-real-parallelism-blackbox.js +0 -307
- package/dist/scripts/naruto-worktree-coding-blackbox.js +0 -29
- package/dist/scripts/parallel-runtime-real-blackbox.js +0 -44
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -77
- package/dist/scripts/pipeline-codex-native-e2e-blackbox.js +0 -13
- package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -50
- package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +0 -74
- package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -51
- package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -45
- package/dist/scripts/pipeline-execution-profile-routing-blackbox.js +0 -4
- package/dist/scripts/postinstall-global-doctor-blackbox.js +0 -12
- package/dist/scripts/ppt-full-e2e-blackbox-check.js +0 -109
- package/dist/scripts/ppt-imagegen-blackbox-check.js +0 -46
- package/dist/scripts/qa-backfill-route-blackbox.js +0 -5
- package/dist/scripts/qa-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/release-full-parallelism-blackbox.js +0 -41
- package/dist/scripts/release-triwiki-first-runner-blackbox.js +0 -48
- package/dist/scripts/release-wiring-3110-blackbox.js +0 -27
- package/dist/scripts/release-wiring-3112-blackbox.js +0 -17
- package/dist/scripts/release-wiring-3113-blackbox.js +0 -17
- package/dist/scripts/research-backfill-route-blackbox.js +0 -5
- package/dist/scripts/research-final-reviewer-blackbox.js +0 -70
- package/dist/scripts/research-stage-cycle-runtime-blackbox.js +0 -40
- package/dist/scripts/research-synthesis-writer-blackbox.js +0 -24
- package/dist/scripts/route-blackbox-realism-check.js +0 -21
- package/dist/scripts/scheduler-resource-claim-blackbox.js +0 -24
- package/dist/scripts/seo-cli-blackbox-check.js +0 -18
- package/dist/scripts/sks-3110-all-feature-regression-blackbox.js +0 -116
- package/dist/scripts/sks-3112-all-feature-regression-blackbox.js +0 -29
- package/dist/scripts/sks-3113-all-feature-regression-blackbox.js +0 -17
- package/dist/scripts/sks-400-all-feature-regression-blackbox.js +0 -21
- package/dist/scripts/sks-400-extreme-parallel-blackbox.js +0 -8
- package/dist/scripts/sks-400-five-minute-blackbox.js +0 -9
- package/dist/scripts/sks-400-legacy-purge-blackbox.js +0 -8
- package/dist/scripts/sks-401-all-feature-regression-blackbox.js +0 -46
- package/dist/scripts/sks-401-five-minute-actual-blackbox.js +0 -23
- package/dist/scripts/sks-402-all-feature-regression-blackbox.js +0 -9
- package/dist/scripts/sks-402-five-minute-real-blackbox.js +0 -22
- package/dist/scripts/sksd-warm-cache-blackbox.js +0 -12
- package/dist/scripts/team-backfill-route-blackbox.js +0 -5
- package/dist/scripts/team-parallel-write-blackbox.js +0 -55
- package/dist/scripts/team-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/triwiki-affected-graph-blackbox.js +0 -28
- package/dist/scripts/triwiki-proof-bank-blackbox.js +0 -30
- package/dist/scripts/triwiki-proof-bank-lock-blackbox.js +0 -7
- package/dist/scripts/ux-patch-swarm-route-blackbox.js +0 -10
- package/dist/scripts/ux-review-imagegen-blackbox-check.js +0 -67
- package/dist/scripts/zellij-initial-main-only-blackbox.js +0 -28
- package/dist/scripts/zellij-pane-lock-concurrency-blackbox.js +0 -80
- package/dist/scripts/zellij-pane-lock-open-worker-integration-blackbox.js +0 -137
- package/dist/scripts/zellij-self-heal-typed-blackbox.js +0 -4
- package/dist/scripts/zellij-slot-telemetry-real-blackbox.js +0 -20
- package/dist/scripts/zellij-stacked-fallback-integration-blackbox.js +0 -81
- package/dist/scripts/zellij-worker-pane-real-ui-blackbox.js +0 -202
|
@@ -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
|
|
7
|
+
Some("--version") => println!("sks-rs 5.3.0"),
|
|
8
8
|
Some("compact-info") => {
|
|
9
9
|
let mut input = String::new();
|
|
10
10
|
let _ = io::stdin().read_to_string(&mut input);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
const args = process.argv.slice(2);
|
|
4
|
+
const command = args.find((arg) => !arg.startsWith('-')) || 'install';
|
|
5
|
+
const autonomous = args.includes('--no-tui') || args.includes('--yes') || args.includes('-y');
|
|
6
|
+
function run(cmd, cmdArgs) {
|
|
7
|
+
const result = spawnSync(cmd, cmdArgs, { stdio: 'inherit' });
|
|
8
|
+
return result.status ?? 1;
|
|
9
|
+
}
|
|
10
|
+
if (!['install', 'setup', 'bootstrap'].includes(command)) {
|
|
11
|
+
console.error('Usage: npx sneakoscope install [--yes|--no-tui]');
|
|
12
|
+
process.exit(2);
|
|
13
|
+
}
|
|
14
|
+
console.log('SKS installer - proof-first Codex harness');
|
|
15
|
+
const already = spawnSync('sks', ['--version'], { encoding: 'utf8' });
|
|
16
|
+
if (already.status !== 0) {
|
|
17
|
+
console.log('> installing global package (npm i -g sneakoscope)...');
|
|
18
|
+
if (run('npm', ['install', '-g', 'sneakoscope']) !== 0) {
|
|
19
|
+
console.error('global install failed - check npm permissions');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
console.log('> repairing/validating environment (sks doctor --fix)...');
|
|
24
|
+
if (run('sks', ['doctor', '--fix', ...(autonomous ? ['--yes'] : [])]) !== 0) {
|
|
25
|
+
console.error('doctor reported blockers - see report above');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
console.log(`
|
|
29
|
+
SKS ready. 다음 3개만 기억하세요 (Codex 입력창에서):
|
|
30
|
+
$Plan "무엇을 만들지" - 계획만 세움 (코드 안 건드림)
|
|
31
|
+
$Work - 계획을 증거 기반으로 실행
|
|
32
|
+
$Swarm "task" - 동적 병렬 스웜 + 기계 검증 루프
|
|
33
|
+
실시간 화면: sks ui (웹 대시보드) / zellij 세션은 자동
|
|
34
|
+
`);
|
|
35
|
+
//# sourceMappingURL=install.js.map
|
package/dist/bin/sks.js
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PACKAGE_VERSION } from '../core/version.js';
|
|
2
|
+
import { ANSI_CODES, paint, resolveZellijTheme } from '../core/zellij/zellij-theme.js';
|
|
3
|
+
const theme = resolveZellijTheme();
|
|
4
|
+
export const ui = {
|
|
5
|
+
banner(cmd) {
|
|
6
|
+
console.log(paint(theme, ANSI_CODES.dim, `SKS ${PACKAGE_VERSION} · ${cmd}`));
|
|
7
|
+
},
|
|
8
|
+
ok(msg) {
|
|
9
|
+
console.log(`${paint(theme, ANSI_CODES.green, '✔')} ${msg}`);
|
|
10
|
+
},
|
|
11
|
+
warn(msg) {
|
|
12
|
+
console.log(`${paint(theme, ANSI_CODES.yellow, '▲')} ${msg}`);
|
|
13
|
+
},
|
|
14
|
+
fail(msg) {
|
|
15
|
+
console.log(`${paint(theme, ANSI_CODES.red, '✖')} ${msg}`);
|
|
16
|
+
},
|
|
17
|
+
step(msg) {
|
|
18
|
+
console.log(`${paint(theme, ANSI_CODES.dim, '>')} ${msg}`);
|
|
19
|
+
},
|
|
20
|
+
kv(k, v) {
|
|
21
|
+
console.log(` ${paint(theme, ANSI_CODES.dim, k.padEnd(18))} ${v}`);
|
|
22
|
+
},
|
|
23
|
+
table(rows) {
|
|
24
|
+
if (!rows.length)
|
|
25
|
+
return;
|
|
26
|
+
const widths = rows[0]?.map((_cell, index) => Math.max(...rows.map((row) => String(row[index] || '').length))) || [];
|
|
27
|
+
for (const [rowIndex, row] of rows.entries()) {
|
|
28
|
+
const line = row.map((cell, index) => String(cell || '').padEnd(widths[index] || 0)).join(' ').trimEnd();
|
|
29
|
+
console.log(rowIndex === 0 ? paint(theme, ANSI_CODES.dim, line) : line);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export function withHeartbeat(label, work, opts = {}) {
|
|
34
|
+
if (process.env.SKS_UPDATE_QUIET || !process.stderr.isTTY)
|
|
35
|
+
return work;
|
|
36
|
+
const started = Date.now();
|
|
37
|
+
let index = 0;
|
|
38
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
39
|
+
const timer = setInterval(() => {
|
|
40
|
+
const elapsed = Date.now() - started;
|
|
41
|
+
const seconds = Math.floor(elapsed / 1000);
|
|
42
|
+
const warn = opts.warnAfterMs && elapsed > opts.warnAfterMs ? ' (still working; this can be normal)' : '';
|
|
43
|
+
process.stderr.write(`\r ${frames[index++ % frames.length]} ${label} ... ${seconds}s${warn} `);
|
|
44
|
+
}, 120);
|
|
45
|
+
timer.unref?.();
|
|
46
|
+
return work.finally(() => {
|
|
47
|
+
clearInterval(timer);
|
|
48
|
+
process.stderr.write(`\r${' '.repeat(80)}\r`);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=cli-theme.js.map
|
|
@@ -96,7 +96,13 @@ export const COMMANDS = {
|
|
|
96
96
|
triwiki: skipMigrationGate(entry('stable', 'Inspect TriWiki index, affected graph, and proof bank', 'dist/core/commands/triwiki-command.js', argsCommand(() => import('../core/commands/triwiki-command.js'), 'triwikiCommand', 'dist/core/commands/triwiki-command.js'))),
|
|
97
97
|
daemon: skipMigrationGate(entry('stable', 'Inspect or warm the local SKS daemon cache', 'dist/core/commands/daemon-command.js', argsCommand(() => import('../core/commands/daemon-command.js'), 'daemonCommand', 'dist/core/commands/daemon-command.js'))),
|
|
98
98
|
run: entry('beta', 'Classify and execute a task through the SKS trust kernel', 'dist/core/commands/run-command.js', argsCommand(() => import('../core/commands/run-command.js'), 'runCommand', 'dist/core/commands/run-command.js')),
|
|
99
|
+
plan: entry('stable', 'Write a planning-only SKS plan artifact without code edits', 'dist/core/commands/plan-command.js', argsCommand(() => import('../core/commands/plan-command.js'), 'planCommand', 'dist/core/commands/plan-command.js')),
|
|
99
100
|
status: readOnly(entry('stable', 'Show concise active mission and trust status', 'dist/core/commands/status-command.js', argsCommand(() => import('../core/commands/status-command.js'), 'statusCommand', 'dist/core/commands/status-command.js'))),
|
|
101
|
+
review: entry('stable', 'Review a git diff with machine evidence first', 'dist/core/commands/review-command.js', argsCommand(() => import('../core/commands/review-command.js'), 'reviewCommand', 'dist/core/commands/review-command.js'), {
|
|
102
|
+
allowedDuringActiveRoute: true,
|
|
103
|
+
activeRoutePolicy: 'always'
|
|
104
|
+
}),
|
|
105
|
+
ui: readOnly(entry('stable', 'Open the localhost SKS swarm dashboard', 'dist/core/commands/ui-command.js', argsCommand(() => import('../core/commands/ui-command.js'), 'uiCommand', 'dist/core/commands/ui-command.js'))),
|
|
100
106
|
root: readOnly(entry('stable', 'Show active SKS root', 'dist/commands/root.js', directCommand(() => import('../commands/root.js'), 'dist/commands/root.js'))),
|
|
101
107
|
update: skipMigrationGate(entry('stable', 'Update the global SKS npm package', 'dist/core/commands/basic-cli.js', subcommand(() => import(basicModule), 'updateCommand', 'dist/core/commands/basic-cli.js', 'now'))),
|
|
102
108
|
uninstall: entry('stable', 'Uninstall SKS global skills, hooks, config, menu bar, and optional project residue', 'dist/core/commands/uninstall-command.js', argsCommand(() => import('../core/commands/uninstall-command.js'), 'uninstallCommand', 'dist/core/commands/uninstall-command.js'), {
|
|
@@ -132,9 +138,9 @@ export const COMMANDS = {
|
|
|
132
138
|
'zellij-viewport-pane': skipMigrationGate(readOnly(entry('beta', 'Render a dynamically bound Zellij worker viewport pane', 'dist/commands/zellij-viewport-pane.js', directCommand(() => import('../commands/zellij-viewport-pane.js'), 'dist/commands/zellij-viewport-pane.js')))),
|
|
133
139
|
'zellij-slot-column-anchor': entry('beta', 'Render the compact SLOTS anchor pane for first-slot-down Zellij stacks', 'dist/commands/zellij-slot-column-anchor.js', directCommand(() => import('../commands/zellij-slot-column-anchor.js'), 'dist/commands/zellij-slot-column-anchor.js')),
|
|
134
140
|
zellij: activeRouteDiagnostic(entry('beta', 'Inspect Zellij runtime status and explain repair (no auto-install)', 'dist/commands/zellij.js', directCommand(() => import('../commands/zellij.js'), 'dist/commands/zellij.js'))),
|
|
135
|
-
'mad-sks': routeStateMutator(entry('beta', 'MAD-SKS scoped permission modifier', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')), ['mad-sks-gate.json']),
|
|
141
|
+
'mad-sks': routeStateMutator(entry('beta', 'MAD-SKS scoped permission modifier + SQL-plane execution (merged MAD-DB)', 'dist/commands/mad-sks.js', directCommand(() => import('../commands/mad-sks.js'), 'dist/commands/mad-sks.js')), ['mad-sks-gate.json']),
|
|
136
142
|
glm: entry('beta', 'Run GLM 5.2 MAD mode through OpenRouter', 'dist/core/commands/glm-command.js', argsCommand(() => import('../core/commands/glm-command.js'), 'glmCommand', 'dist/core/commands/glm-command.js')),
|
|
137
|
-
'mad-db': routeStateMutator(entry('beta', '
|
|
143
|
+
'mad-db': routeStateMutator(entry('beta', 'Deprecated alias for MAD-SKS SQL-plane execution; redirects to sks mad-sks sql|apply-migration', 'dist/commands/mad-db.js', directCommand(() => import('../commands/mad-db.js'), 'dist/commands/mad-db.js')), ['mad-sks-gate.json']),
|
|
138
144
|
'auto-review': entry('beta', 'Manage auto-review profile', 'dist/commands/auto-review.js', directCommand(() => import('../commands/auto-review.js'), 'dist/commands/auto-review.js')),
|
|
139
145
|
'dollar-commands': entry('stable', 'List Codex App dollar commands', 'dist/core/commands/basic-cli.js', basicArgs('dollarCommandsCommand')),
|
|
140
146
|
'fast-mode': entry('stable', 'Toggle SKS Fast mode default for dollar-command routes', 'dist/core/commands/fast-mode-command.js', argsCommand(() => import('../core/commands/fast-mode-command.js'), 'fastModeCommand', 'dist/core/commands/fast-mode-command.js')),
|
|
@@ -166,7 +172,7 @@ export const COMMANDS = {
|
|
|
166
172
|
reasoning: entry('labs', 'Show reasoning route', 'dist/core/commands/basic-cli.js', basicArgs('reasoningCommand')),
|
|
167
173
|
aliases: entry('stable', 'Show command aliases', 'dist/core/commands/basic-cli.js', basicNoArgs('aliasesCommand')),
|
|
168
174
|
selftest: entry('stable', 'Run local mock selftest', 'dist/core/commands/basic-cli.js', basicArgs('selftestCommand')),
|
|
169
|
-
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')), ['
|
|
175
|
+
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']),
|
|
170
176
|
'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')),
|
|
171
177
|
hook: entry('beta', 'Codex hook entrypoint', 'dist/commands/hook.js', directCommand(() => import('../commands/hook.js'), 'dist/commands/hook.js')),
|
|
172
178
|
profile: entry('labs', 'Inspect/set profile', 'dist/commands/profile.js', directCommand(() => import('../commands/profile.js'), 'dist/commands/profile.js')),
|
|
@@ -184,6 +190,7 @@ export const COMMANDS = {
|
|
|
184
190
|
eval: entry('labs', 'Run eval reports', 'dist/core/commands/eval-command.js', subcommand(() => import('../core/commands/eval-command.js'), 'evalCommand', 'dist/core/commands/eval-command.js', 'run')),
|
|
185
191
|
harness: entry('labs', 'Run harness fixtures', 'dist/core/commands/harness-command.js', subcommand(() => import('../core/commands/harness-command.js'), 'harnessCommand', 'dist/core/commands/harness-command.js', 'fixture')),
|
|
186
192
|
wiki: activeRouteDiagnostic(entry('beta', 'Manage TriWiki and image voxel ledgers', 'dist/commands/wiki.js', directCommand(() => import('../commands/wiki.js'), 'dist/commands/wiki.js'))),
|
|
193
|
+
memory: entry('beta', 'Project TriWiki memory into managed AGENTS.md blocks or run memory GC', 'dist/commands/memory.js', directCommand(() => import('../commands/memory.js'), 'dist/commands/memory.js')),
|
|
187
194
|
gc: activeRouteDiagnostic(entry('labs', 'Compact/prune runtime state', 'dist/core/commands/gc-command.js', gcArgs('gcCommand'))),
|
|
188
195
|
stats: readOnly(entry('labs', 'Show storage stats', 'dist/core/commands/gc-command.js', gcArgs('statsCommand'))),
|
|
189
196
|
features: entry('beta', 'Validate feature registry', 'dist/commands/features.js', directCommand(() => import('../commands/features.js'), 'dist/commands/features.js')),
|
|
@@ -202,8 +209,12 @@ export const COMMAND_ALIASES = {
|
|
|
202
209
|
'--mad': 'mad-sks',
|
|
203
210
|
'--MAD': 'mad-sks',
|
|
204
211
|
'--mad-sks': 'mad-sks',
|
|
212
|
+
'ux-review': 'image-ux-review',
|
|
213
|
+
'visual-review': 'image-ux-review',
|
|
214
|
+
'ui-ux-review': 'image-ux-review',
|
|
205
215
|
'--agent': 'agent',
|
|
206
|
-
'--naruto': 'naruto'
|
|
216
|
+
'--naruto': 'naruto',
|
|
217
|
+
swarm: 'naruto'
|
|
207
218
|
};
|
|
208
219
|
export function commandNames() {
|
|
209
220
|
return Object.keys(COMMANDS).sort();
|
package/dist/cli/help-fast.js
CHANGED
|
@@ -5,18 +5,28 @@ export function helpFast() {
|
|
|
5
5
|
console.log(`SKS
|
|
6
6
|
SNEAKOSCOPE CODEX v${PACKAGE_VERSION}
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
3-pillar frontdoor
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
$Plan "task" plan only; writes .sneakoscope/plans, no code edits
|
|
11
|
+
$Work execute the latest plan with evidence gates
|
|
12
|
+
$Swarm "task" dynamic Naruto swarm with machine verification
|
|
13
|
+
|
|
14
|
+
Local surfaces
|
|
15
|
+
|
|
16
|
+
sks ui localhost live dashboard
|
|
17
|
+
sks review --staged machine-first diff review
|
|
18
|
+
sks doctor --fix repair/validate the harness
|
|
19
|
+
|
|
20
|
+
Discovery
|
|
21
|
+
|
|
22
|
+
sks commands [--json] all commands
|
|
23
|
+
sks dollar-commands all Codex App $ routes
|
|
24
|
+
sks help [topic] focused help
|
|
15
25
|
`);
|
|
16
|
-
for (const row of commandRows().filter((entry) => entry.maturity !== 'labs')) {
|
|
26
|
+
for (const row of commandRows().filter((entry) => entry.maturity !== 'labs').slice(0, 18)) {
|
|
17
27
|
console.log(` ${row.usage.padEnd(58)} ${row.description}`);
|
|
18
28
|
}
|
|
19
|
-
console.log('\
|
|
29
|
+
console.log('\nRun `sks commands` for the full catalog. Core promise: machine-verified completion, not vibes.');
|
|
20
30
|
}
|
|
21
31
|
function commandRows() {
|
|
22
32
|
const registry = new Map(Object.entries(COMMANDS).map(([name, meta]) => [name, meta]));
|
|
@@ -2,6 +2,7 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { runUltraSearch } from '../core/ultra-search/index.js';
|
|
5
|
+
import { evaluateLocalGate } from '../core/commands/route-success-helpers.js';
|
|
5
6
|
export async function insaneSearchCommand(sub = 'help', args = []) {
|
|
6
7
|
const action = sub || 'help';
|
|
7
8
|
if (action === 'run')
|
|
@@ -35,16 +36,25 @@ async function runCommand(args) {
|
|
|
35
36
|
query,
|
|
36
37
|
...(mode ? { mode } : {})
|
|
37
38
|
});
|
|
39
|
+
const gate = await evaluateUltraSearchGate(missionDir);
|
|
40
|
+
const finalResult = {
|
|
41
|
+
...result,
|
|
42
|
+
ok: result.ok === true && gate.ok === true,
|
|
43
|
+
blockers: [...new Set([...(result.blockers || []), ...gate.blockers])],
|
|
44
|
+
gate_evaluation: gate
|
|
45
|
+
};
|
|
38
46
|
if (json)
|
|
39
|
-
console.log(JSON.stringify(
|
|
47
|
+
console.log(JSON.stringify(finalResult, null, 2));
|
|
40
48
|
else {
|
|
41
|
-
console.log(`InsaneSearch ${
|
|
49
|
+
console.log(`InsaneSearch ${finalResult.ok ? 'completed' : 'partial/blocked'}: ${result.mode}`);
|
|
42
50
|
console.log(`Mission: ${missionDir}`);
|
|
43
51
|
console.log(`Sources: ${result.sources.length}, verified: ${result.proof.verified_source_count}`);
|
|
44
|
-
if (
|
|
45
|
-
console.log(`Blockers: ${
|
|
52
|
+
if (finalResult.blockers.length)
|
|
53
|
+
console.log(`Blockers: ${finalResult.blockers.join(', ')}`);
|
|
46
54
|
}
|
|
47
|
-
|
|
55
|
+
if (!finalResult.ok)
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
return finalResult;
|
|
48
58
|
}
|
|
49
59
|
async function doctorCommand(args) {
|
|
50
60
|
const json = args.includes('--json');
|
|
@@ -74,11 +84,16 @@ async function inspectCommand(action, args) {
|
|
|
74
84
|
const target = mission === 'latest' ? await latestMissionDir() : mission;
|
|
75
85
|
const file = path.join(target, 'ultra-search', action === 'sources' ? 'source-ledger.json' : action === 'claims' ? 'claim-ledger.json' : 'ultra-search-result.json');
|
|
76
86
|
const text = await fs.readFile(file, 'utf8');
|
|
87
|
+
const parsed = JSON.parse(text);
|
|
88
|
+
const gate = await evaluateUltraSearchGate(target);
|
|
89
|
+
const result = { ...parsed, ok: parsed.ok === true && gate.ok === true, gate_evaluation: gate, blockers: [...new Set([...(parsed.blockers || []), ...gate.blockers])] };
|
|
90
|
+
if (!result.ok)
|
|
91
|
+
process.exitCode = 1;
|
|
77
92
|
if (json)
|
|
78
|
-
console.log(
|
|
93
|
+
console.log(JSON.stringify(result, null, 2));
|
|
79
94
|
else
|
|
80
|
-
console.log(
|
|
81
|
-
return
|
|
95
|
+
console.log(JSON.stringify(result, null, 2));
|
|
96
|
+
return result;
|
|
82
97
|
}
|
|
83
98
|
async function cacheCommand(args) {
|
|
84
99
|
const sub = positional(args)[0] || 'status';
|
|
@@ -164,4 +179,17 @@ async function latestMissionDir() {
|
|
|
164
179
|
function asyncDirLikelyUltra(dir) {
|
|
165
180
|
return Boolean(dir);
|
|
166
181
|
}
|
|
182
|
+
async function evaluateUltraSearchGate(missionDir) {
|
|
183
|
+
return evaluateLocalGate({
|
|
184
|
+
root: process.cwd(),
|
|
185
|
+
dir: missionDir,
|
|
186
|
+
gateFile: path.join('ultra-search', 'ultra-search-gate.json'),
|
|
187
|
+
requiredArtifacts: [
|
|
188
|
+
path.join('ultra-search', 'source-ledger.json'),
|
|
189
|
+
path.join('ultra-search', 'claim-ledger.json'),
|
|
190
|
+
path.join('ultra-search', 'ultra-search-proof.json'),
|
|
191
|
+
path.join('ultra-search', 'ultra-search-result.json')
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
167
195
|
//# sourceMappingURL=insane-search-command.js.map
|
|
@@ -22,6 +22,7 @@ import { buildCodexLbSetupPlan, codexLbPersistenceSummary, installCodexLbShellPr
|
|
|
22
22
|
import { extractTomlTable, writeCodexConfigGuarded } from '../core/codex/codex-config-guard.js';
|
|
23
23
|
import { cleanupCodexConfigBackups, validateCodexConfigRoundTrip } from '../core/codex/codex-config-toml.js';
|
|
24
24
|
import { runPostinstallGlobalDoctorAndMarkPending } from '../core/update/update-migration-state.js';
|
|
25
|
+
import { repairCodexImagegen } from '../core/doctor/imagegen-repair.js';
|
|
25
26
|
const CODEX_LB_PROVIDER_NAME = 'openai';
|
|
26
27
|
const CODEX_LB_PROVIDER_ENV_KEY = 'CODEX_LB_API_KEY';
|
|
27
28
|
const CODEX_LB_CANONICAL_FAST_SERVICE_TIER = 'priority';
|
|
@@ -90,6 +91,15 @@ export async function postinstall({ bootstrap, args = [] }) {
|
|
|
90
91
|
console.log(`Codex App Fast mode: skipped (${fastModeRepair.reason}).`);
|
|
91
92
|
else if (fastModeRepair.status === 'failed')
|
|
92
93
|
console.log(`Codex App Fast mode: auto repair failed. Run \`sks setup\`. ${fastModeRepair.error || ''}`.trim());
|
|
94
|
+
const imagegenRepair = await ensureCodexImagegenDuringInstall();
|
|
95
|
+
if (imagegenRepair.status === 'ready')
|
|
96
|
+
console.log('Codex App Image Gen: ready ($imagegen/gpt-image-2 detected).');
|
|
97
|
+
else if (imagegenRepair.status === 'recovered')
|
|
98
|
+
console.log('Codex App Image Gen: recovered and re-detected.');
|
|
99
|
+
else if (imagegenRepair.status === 'blocked')
|
|
100
|
+
console.log(`Codex App Image Gen: blocked; run \`sks doctor --fix\`. ${(imagegenRepair.blockers || []).join(', ')}`.trim());
|
|
101
|
+
else if (imagegenRepair.status === 'skipped')
|
|
102
|
+
console.log(`Codex App Image Gen: skipped (${imagegenRepair.reason}).`);
|
|
93
103
|
const postinstallDoctor = await runPostinstallGlobalDoctorAndMarkPending().catch((err) => ({
|
|
94
104
|
ok: false,
|
|
95
105
|
doctor: null,
|
|
@@ -2469,6 +2479,28 @@ async function ensureGlobalGetdesignSkillDuringInstall() {
|
|
|
2469
2479
|
return { status: 'present', command: skillsBin };
|
|
2470
2480
|
return { status: 'failed', command: skillsBin, error: out.trim() || 'skills add failed' };
|
|
2471
2481
|
}
|
|
2482
|
+
export async function ensureCodexImagegenDuringInstall(opts = {}) {
|
|
2483
|
+
if (process.env.SKS_POSTINSTALL_SKIP_IMAGEGEN_REPAIR === '1' || opts.skip === true) {
|
|
2484
|
+
return { status: 'skipped', reason: 'SKS_POSTINSTALL_SKIP_IMAGEGEN_REPAIR' };
|
|
2485
|
+
}
|
|
2486
|
+
const report = await repairCodexImagegen({
|
|
2487
|
+
root: opts.root || process.cwd(),
|
|
2488
|
+
apply: opts.apply !== false,
|
|
2489
|
+
codexBin: opts.codexBin || null,
|
|
2490
|
+
autoInstallCodex: opts.autoInstallCodex === true || process.env.SKS_IMAGEGEN_AUTO_INSTALL_CODEX === '1'
|
|
2491
|
+
}).catch((err) => ({
|
|
2492
|
+
recovered: false,
|
|
2493
|
+
blockers: [err?.message || String(err)],
|
|
2494
|
+
before: null,
|
|
2495
|
+
after: null
|
|
2496
|
+
}));
|
|
2497
|
+
if (report.before?.core_ready === true || (report.after?.core_ready === true && report.attempted === false)) {
|
|
2498
|
+
return { status: 'ready', report };
|
|
2499
|
+
}
|
|
2500
|
+
if (report.recovered === true)
|
|
2501
|
+
return { status: 'recovered', report };
|
|
2502
|
+
return { status: 'blocked', blockers: report.blockers || ['codex_imagegen_unavailable'], report };
|
|
2503
|
+
}
|
|
2472
2504
|
export async function ensureRelatedCliTools(args = []) {
|
|
2473
2505
|
const skip = args.includes('--skip-cli-tools') || process.env.SKS_SKIP_CLI_TOOLS === '1';
|
|
2474
2506
|
const codex = await ensureCodexCliTool({ skip, args });
|
|
@@ -73,6 +73,8 @@ export async function run(command, args = []) {
|
|
|
73
73
|
codex_lb: status,
|
|
74
74
|
chain,
|
|
75
75
|
evidence,
|
|
76
|
+
degraded_models: Array.isArray(chain.degraded_models) ? chain.degraded_models : [],
|
|
77
|
+
quota_low: Boolean(chain.quota_low),
|
|
76
78
|
blockers: [
|
|
77
79
|
...(providerReady ? [] : ['codex_lb_provider_contract_drift']),
|
|
78
80
|
...(chain.ok
|
package/dist/commands/doctor.js
CHANGED
|
@@ -3,6 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import { projectRoot, exists, formatBytes } from '../core/fsx.js';
|
|
4
4
|
import { flag } from '../cli/args.js';
|
|
5
5
|
import { printJson } from '../cli/output.js';
|
|
6
|
+
import { ui as cliUi } from '../cli/cli-theme.js';
|
|
6
7
|
import { getCodexInfo } from '../core/codex-adapter.js';
|
|
7
8
|
import { rustInfo } from '../core/rust-accelerator.js';
|
|
8
9
|
import { codexAppIntegrationStatus } from '../core/codex-app.js';
|
|
@@ -41,12 +42,19 @@ import { planDoctorDirtyRepair } from '../core/doctor/doctor-dirty-planner.js';
|
|
|
41
42
|
import { doctorRepairPostcheck } from '../core/doctor/doctor-repair-postcheck.js';
|
|
42
43
|
import { withSecretPreservationGuard } from '../core/config/config-migration-journal.js';
|
|
43
44
|
import { writeProjectUpdateMigrationReceipt } from '../core/update/update-migration-state.js';
|
|
44
|
-
import { installSksMenuBar } from '../core/codex-app/sks-menubar.js';
|
|
45
|
+
import { inspectSksMenuBarStatus, installSksMenuBar } from '../core/codex-app/sks-menubar.js';
|
|
45
46
|
import { sweepSksTempDirs } from '../core/retention.js';
|
|
46
47
|
import { reconcileSkills } from '../core/init/skills.js';
|
|
48
|
+
import { codexHookTrustDoctor } from '../core/codex-hooks/codex-hook-trust-doctor.js';
|
|
49
|
+
import { detectImagegenCapability } from '../core/imagegen/imagegen-capability.js';
|
|
50
|
+
import { repairCodexImagegen } from '../core/doctor/imagegen-repair.js';
|
|
47
51
|
export async function run(_command, args = []) {
|
|
48
52
|
const root = await projectRoot();
|
|
49
53
|
const doctorFix = flag(args, '--fix');
|
|
54
|
+
if (!flag(args, '--json')) {
|
|
55
|
+
cliUi.banner('doctor');
|
|
56
|
+
cliUi.step(doctorFix ? 'repairing and validating' : 'validating');
|
|
57
|
+
}
|
|
50
58
|
if (doctorFix)
|
|
51
59
|
return withSecretPreservationGuard(root, 'doctor-fix', () => runDoctor(args, root, doctorFix));
|
|
52
60
|
return runDoctor(args, root, doctorFix);
|
|
@@ -302,7 +310,8 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
302
310
|
const sksMenuBar = await installSksMenuBar({
|
|
303
311
|
root,
|
|
304
312
|
apply: doctorFix,
|
|
305
|
-
launch: doctorFix
|
|
313
|
+
launch: doctorFix,
|
|
314
|
+
quiet: machineOnly || flag(args, '--json')
|
|
306
315
|
}).catch((err) => ({
|
|
307
316
|
schema: 'sks.codex-app-sks-menubar.v1',
|
|
308
317
|
ok: false,
|
|
@@ -415,10 +424,22 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
415
424
|
raw_secret_values_recorded: false
|
|
416
425
|
}))
|
|
417
426
|
: null;
|
|
427
|
+
const hookTrustRepair = doctorFix && doctorPhaseIds.includes('hook_trust_repair')
|
|
428
|
+
? await codexHookTrustDoctor(root, { fix: true, managed: true, actual: true }).catch((err) => ({
|
|
429
|
+
schema: 'sks.codex-hook-trust-doctor.v2',
|
|
430
|
+
ok: false,
|
|
431
|
+
actual: true,
|
|
432
|
+
blockers: [`hook_trust_repair_failed:${err?.message || String(err)}`],
|
|
433
|
+
warnings: [],
|
|
434
|
+
repair_actions: ['sks codex trust-doctor --fix --managed --actual']
|
|
435
|
+
}))
|
|
436
|
+
: null;
|
|
418
437
|
const doctorFixTransaction = doctorFix
|
|
419
438
|
? await runDoctorFixTransaction({
|
|
420
439
|
root,
|
|
421
440
|
dirtyPlan: doctorDirtyPlan,
|
|
441
|
+
json: flag(args, '--json'),
|
|
442
|
+
machineOnly,
|
|
422
443
|
phases: [
|
|
423
444
|
{
|
|
424
445
|
id: 'setup',
|
|
@@ -488,19 +509,52 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
488
509
|
rollback_evidence: 'optional_supabase_no_ready_mutation_required'
|
|
489
510
|
})
|
|
490
511
|
},
|
|
512
|
+
{
|
|
513
|
+
id: 'hook_trust_repair',
|
|
514
|
+
run: async () => ({
|
|
515
|
+
id: 'hook_trust_repair',
|
|
516
|
+
ok: hookTrustRepair?.ok !== false,
|
|
517
|
+
repaired: doctorFix,
|
|
518
|
+
blockers: hookTrustRepair?.blockers || [],
|
|
519
|
+
warnings: hookTrustRepair?.warnings || [],
|
|
520
|
+
rollback_evidence: hookTrustRepair?.fixed?.managed_hook_file || 'codex_hook_trust_repair_idempotent'
|
|
521
|
+
})
|
|
522
|
+
},
|
|
491
523
|
{
|
|
492
524
|
id: 'sks_menubar',
|
|
493
525
|
required_for_ready: false,
|
|
494
526
|
run: async () => ({
|
|
495
527
|
id: 'sks_menubar',
|
|
496
|
-
ok: sksMenuBar?.ok
|
|
528
|
+
ok: sksMenuBar?.ok === true,
|
|
497
529
|
repaired: doctorFix && Array.isArray(sksMenuBar?.actions) && sksMenuBar.actions.length > 0,
|
|
498
530
|
required_for_ready: false,
|
|
499
531
|
blockers: sksMenuBar?.blockers || [],
|
|
500
532
|
warnings: sksMenuBar?.warnings || [],
|
|
501
533
|
artifact_path: sksMenuBar?.report_path || null,
|
|
502
534
|
rollback_evidence: sksMenuBar?.launch_agent_path || sksMenuBar?.report_path || 'sks_menubar_optional_no_core_mutation'
|
|
503
|
-
})
|
|
535
|
+
}),
|
|
536
|
+
postcheck: async () => {
|
|
537
|
+
const status = await inspectSksMenuBarStatus({ root }).catch((err) => ({
|
|
538
|
+
ok: false,
|
|
539
|
+
launchd: { ok: false, state: null, pid: null, error: err?.message || String(err) },
|
|
540
|
+
action_target: { ok: false, smoke_code: null, smoke_output: null },
|
|
541
|
+
blockers: [err?.message || String(err)],
|
|
542
|
+
warnings: []
|
|
543
|
+
}));
|
|
544
|
+
const blockers = [
|
|
545
|
+
...(status.launchd?.ok === true ? [] : [`launchd_not_running:${status.launchd?.error || status.launchd?.state || 'unknown'}`]),
|
|
546
|
+
...(status.action_target?.ok === true ? [] : [`action_script_smoke_failed:${status.action_target?.smoke_code ?? 'no_code'}`]),
|
|
547
|
+
...(status.ok === true ? [] : (status.blockers || ['menubar_status_not_ok']))
|
|
548
|
+
];
|
|
549
|
+
return {
|
|
550
|
+
ok: blockers.length === 0,
|
|
551
|
+
blockers,
|
|
552
|
+
warnings: [
|
|
553
|
+
...(status.warnings || []),
|
|
554
|
+
blockers.length === 0 ? 'menubar_postcheck_passed' : 'menubar_postcheck_failed'
|
|
555
|
+
]
|
|
556
|
+
};
|
|
557
|
+
}
|
|
504
558
|
},
|
|
505
559
|
{
|
|
506
560
|
id: 'command_alias_cleanup',
|
|
@@ -572,10 +626,29 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
572
626
|
const globalSksInstallCleanup = flag(args, '--fix') && !flag(args, '--local-only')
|
|
573
627
|
? await cleanDuplicateGlobalSksInstalls({ root, fix: true }).catch((err) => ({ schema: 'sks.global-sks-install-cleanup.v1', ok: false, fix: true, error: err?.message || String(err), blockers: ['global_sks_install_cleanup_exception'] }))
|
|
574
628
|
: null;
|
|
575
|
-
const
|
|
576
|
-
const
|
|
577
|
-
?
|
|
578
|
-
|
|
629
|
+
const imagegen = await detectImagegenCapability({ codexBin: codexBin || undefined }).catch((err) => ({ ok: false, error: err.message, auth_readiness: null, core_ready: false, blockers: ['imagegen_detection_exception'] }));
|
|
630
|
+
const imagegenRepair = imagegen.core_ready === true
|
|
631
|
+
? {
|
|
632
|
+
schema: 'sks.doctor-imagegen-repair.v1',
|
|
633
|
+
ok: true,
|
|
634
|
+
attempted: false,
|
|
635
|
+
apply: doctorFix,
|
|
636
|
+
recovered: true,
|
|
637
|
+
before: imagegen,
|
|
638
|
+
after: imagegen,
|
|
639
|
+
steps: [],
|
|
640
|
+
blockers: [],
|
|
641
|
+
manual_actions: []
|
|
642
|
+
}
|
|
643
|
+
: await repairCodexImagegen({ root, apply: doctorFix, codexBin: codexBin || null }).catch((err) => ({
|
|
644
|
+
schema: 'sks.doctor-imagegen-repair.v1',
|
|
645
|
+
ok: false,
|
|
646
|
+
attempted: true,
|
|
647
|
+
apply: doctorFix,
|
|
648
|
+
recovered: false,
|
|
649
|
+
blockers: [err?.message || String(err)],
|
|
650
|
+
manual_actions: ['Run `sks doctor --fix --json` after enabling Codex App image_generation.']
|
|
651
|
+
}));
|
|
579
652
|
const codex0138Capability = deepDiagnostics
|
|
580
653
|
? await writeCodex0138CapabilityArtifacts(root, { codexBin: codexBin || null }).catch((err) => ({ error: err?.message || String(err), report: null }))
|
|
581
654
|
: { skipped: true, report: null };
|
|
@@ -768,6 +841,7 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
768
841
|
auth_readiness: imagegen.auth_readiness || null,
|
|
769
842
|
codex_app_builtin_available: imagegen.codex_app?.available === true
|
|
770
843
|
},
|
|
844
|
+
imagegen_repair: imagegenRepair,
|
|
771
845
|
codex_0138: {
|
|
772
846
|
capability: codex0138Capability.report || null,
|
|
773
847
|
doctor: codex0138Doctor,
|
|
@@ -782,7 +856,7 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
782
856
|
sneakoscope: { ok: await exists(`${root}/.sneakoscope`) },
|
|
783
857
|
package: { bytes: pkgBytes, human: formatBytes(pkgBytes) },
|
|
784
858
|
skills: skillsReconcile,
|
|
785
|
-
repair: { sks_update: sksUpdate, setup: setupRepair, codex_config: configRepair, migration_journal: migrationJournal, global_sks_installs: globalSksInstallCleanup, agent_role_config: agentRoleConfigRepair, zellij: zellijRepair, context7: context7Repair, codex_startup: codexStartupRepair, startup_config: startupConfigRepair, context7_mcp: context7McpRepair, supabase_mcp: supabaseMcpRepair, sks_menubar: sksMenuBar, doctor_transaction: doctorFixTransaction, doctor_dirty_plan: doctorDirtyPlan, doctor_postcheck: doctorFixPostcheck, codex_native: codexNativeRepair, doctor_native_capability: doctorNativeCapabilityRepair, command_aliases: commandAliasCleanup, skills: skillsReconcile, sks_temp_sweep: sksTempSweep }
|
|
859
|
+
repair: { sks_update: sksUpdate, setup: setupRepair, codex_config: configRepair, migration_journal: migrationJournal, global_sks_installs: globalSksInstallCleanup, agent_role_config: agentRoleConfigRepair, zellij: zellijRepair, context7: context7Repair, codex_startup: codexStartupRepair, startup_config: startupConfigRepair, context7_mcp: context7McpRepair, supabase_mcp: supabaseMcpRepair, imagegen: imagegenRepair, hook_trust: hookTrustRepair, sks_menubar: sksMenuBar, doctor_transaction: doctorFixTransaction, doctor_dirty_plan: doctorDirtyPlan, doctor_postcheck: doctorFixPostcheck, codex_native: codexNativeRepair, doctor_native_capability: doctorNativeCapabilityRepair, command_aliases: commandAliasCleanup, skills: skillsReconcile, sks_temp_sweep: sksTempSweep }
|
|
786
860
|
};
|
|
787
861
|
if (reportFile)
|
|
788
862
|
await writeJsonReportFile(reportFile, result);
|
|
@@ -910,6 +984,13 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
910
984
|
console.log(` next action: ${codexAppUi.next_action}`);
|
|
911
985
|
console.log('SKS Menu Bar:');
|
|
912
986
|
console.log(` status: ${sksMenuBar.status || (sksMenuBar.ok ? 'ok' : 'blocked')}`);
|
|
987
|
+
const menubarPhase = doctorFixTransaction?.phases?.find((phase) => phase?.id === 'sks_menubar');
|
|
988
|
+
if (menubarPhase) {
|
|
989
|
+
const menubarSummary = menubarPhase.ok
|
|
990
|
+
? (menubarPhase.repaired ? 'repaired' : 'verified')
|
|
991
|
+
: `blocked(${(menubarPhase.blockers || []).join(', ') || 'unknown'})`;
|
|
992
|
+
console.log(` menubar: ${menubarSummary}`);
|
|
993
|
+
}
|
|
913
994
|
if (sksMenuBar.app_path)
|
|
914
995
|
console.log(` app: ${sksMenuBar.app_path}`);
|
|
915
996
|
if (sksMenuBar.launch_agent_path)
|
|
@@ -928,6 +1009,9 @@ async function runDoctor(args = [], root, doctorFix) {
|
|
|
928
1009
|
console.log(` - ${action}`);
|
|
929
1010
|
}
|
|
930
1011
|
}
|
|
1012
|
+
console.log(`Image Gen repair: ${imagegenRepair.recovered ? 'ok' : imagegenRepair.attempted ? 'blocked' : 'not-needed'}`);
|
|
1013
|
+
for (const action of imagegenRepair.manual_actions || [])
|
|
1014
|
+
console.log(` - ${action}`);
|
|
931
1015
|
const codex0138 = codex0138Capability.report || {};
|
|
932
1016
|
console.log('Codex current compatibility:');
|
|
933
1017
|
console.log(` target: rust-v0.142.0`);
|
|
@@ -1115,6 +1199,7 @@ function doctorPhaseIdsForProfile(profile) {
|
|
|
1115
1199
|
'startup_config_repair',
|
|
1116
1200
|
'context7_repair',
|
|
1117
1201
|
'context7_mcp_repair',
|
|
1202
|
+
'hook_trust_repair',
|
|
1118
1203
|
'command_alias_cleanup'
|
|
1119
1204
|
];
|
|
1120
1205
|
if (profile === 'migration')
|
package/dist/commands/proof.js
CHANGED
|
@@ -99,6 +99,7 @@ export async function run(_command, args = []) {
|
|
|
99
99
|
const result = await writeRouteCompletionProof(root, {
|
|
100
100
|
missionId,
|
|
101
101
|
route: '$SKS',
|
|
102
|
+
executionClass: 'real',
|
|
102
103
|
status: 'verified_partial',
|
|
103
104
|
evidence,
|
|
104
105
|
summary: {
|
|
@@ -119,8 +120,9 @@ export async function run(_command, args = []) {
|
|
|
119
120
|
if (action === 'smoke') {
|
|
120
121
|
const evidence = await collectProofEvidence(root);
|
|
121
122
|
const result = await writeCompletionProof(root, {
|
|
123
|
+
execution_class: 'mock_fixture',
|
|
122
124
|
route: '$SKS',
|
|
123
|
-
status: '
|
|
125
|
+
status: 'mock_only',
|
|
124
126
|
summary: {
|
|
125
127
|
files_changed: evidence.files?.length || 0,
|
|
126
128
|
commands_run: 1,
|
|
@@ -130,8 +132,9 @@ export async function run(_command, args = []) {
|
|
|
130
132
|
},
|
|
131
133
|
evidence,
|
|
132
134
|
claims: [{ id: 'proof-smoke', status: 'supported', evidence: '.sneakoscope/proof/latest.json' }],
|
|
133
|
-
unverified: ['Smoke proof is fixture evidence, not a real route completion.']
|
|
134
|
-
|
|
135
|
+
unverified: ['Smoke proof is fixture evidence, not a real route completion.'],
|
|
136
|
+
blockers: ['proof_smoke_fixture_cannot_claim_real_completion']
|
|
137
|
+
}, { command: { cmd: 'sks proof smoke', status: 'mock_only' } });
|
|
135
138
|
if (flag(args, '--json'))
|
|
136
139
|
return printJson(result);
|
|
137
140
|
console.log(`Completion proof written: ${result.files.latest_json}`);
|