sneakoscope 0.9.19 → 0.9.20
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 +26 -3
- package/bin/sks.mjs +20 -3
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +5 -5
- package/package.json +49 -2
- package/src/cli/command-registry.mjs +85 -42
- package/src/cli/help-fast.mjs +31 -0
- package/src/core/bench.mjs +97 -0
- package/src/core/commands/bench-command.mjs +49 -0
- package/src/core/commands/paths-command.mjs +17 -0
- package/src/core/commands/rollback-command.mjs +42 -0
- package/src/core/commands/run-command.mjs +89 -0
- package/src/core/commands/status-command.mjs +51 -0
- package/src/core/commands/trust-command.mjs +47 -0
- package/src/core/evidence/evidence-dedupe.mjs +19 -0
- package/src/core/evidence/evidence-freshness.mjs +34 -0
- package/src/core/evidence/evidence-proof-linker.mjs +20 -0
- package/src/core/evidence/evidence-redaction.mjs +9 -0
- package/src/core/evidence/evidence-router.mjs +186 -0
- package/src/core/evidence/evidence-schema.mjs +105 -0
- package/src/core/evidence/evidence-store.mjs +73 -0
- package/src/core/feature-fixtures.mjs +29 -23
- package/src/core/feature-registry.mjs +22 -0
- package/src/core/fsx.mjs +1 -1
- package/src/core/managed-paths.mjs +65 -0
- package/src/core/proof/auto-finalize.mjs +1 -1
- package/src/core/proof/proof-writer.mjs +2 -0
- package/src/core/proof/route-adapter.mjs +24 -1
- package/src/core/routes.mjs +6 -0
- package/src/core/rust-accelerator.mjs +4 -1
- package/src/core/trust-kernel/completion-contract.mjs +37 -0
- package/src/core/trust-kernel/evidence-router.mjs +4 -0
- package/src/core/trust-kernel/route-contract.mjs +66 -0
- package/src/core/trust-kernel/route-state-machine.mjs +29 -0
- package/src/core/trust-kernel/trust-kernel-schema.mjs +23 -0
- package/src/core/trust-kernel/trust-report.mjs +111 -0
- package/src/core/trust-kernel/trust-status.mjs +16 -0
- package/src/core/version-manager.mjs +9 -0
- package/src/core/version.mjs +1 -1
- package/src/core/wiki-image/validation.mjs +2 -0
- package/src/commands/aliases.mjs +0 -2
- package/src/commands/autoresearch.mjs +0 -5
- package/src/commands/bootstrap.mjs +0 -2
- package/src/commands/code-structure.mjs +0 -5
- package/src/commands/commands.mjs +0 -5
- package/src/commands/computer-use.mjs +0 -5
- package/src/commands/context7.mjs +0 -5
- package/src/commands/db.mjs +0 -6
- package/src/commands/deps.mjs +0 -5
- package/src/commands/dfix.mjs +0 -2
- package/src/commands/dollar-commands.mjs +0 -2
- package/src/commands/eval.mjs +0 -5
- package/src/commands/fix-path.mjs +0 -2
- package/src/commands/gc.mjs +0 -2
- package/src/commands/goal.mjs +0 -5
- package/src/commands/gx.mjs +0 -5
- package/src/commands/harness.mjs +0 -5
- package/src/commands/image-ux-review.mjs +0 -5
- package/src/commands/init.mjs +0 -2
- package/src/commands/memory.mjs +0 -5
- package/src/commands/postinstall.mjs +0 -2
- package/src/commands/ppt.mjs +0 -5
- package/src/commands/qa-loop.mjs +0 -5
- package/src/commands/quickstart.mjs +0 -2
- package/src/commands/reasoning.mjs +0 -2
- package/src/commands/research.mjs +0 -5
- package/src/commands/selftest.mjs +0 -2
- package/src/commands/setup.mjs +0 -2
- package/src/commands/skill-dream.mjs +0 -5
- package/src/commands/stats.mjs +0 -2
- package/src/commands/team.mjs +0 -2
- package/src/commands/update-check.mjs +0 -2
- package/src/commands/usage.mjs +0 -2
- package/src/commands/validate-artifacts.mjs +0 -2
package/README.md
CHANGED
|
@@ -2,11 +2,26 @@
|
|
|
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.
|
|
5
|
+
Sneakoscope Codex (`sks`) is a Codex CLI/App harness that makes repeatable Codex work auditable. `0.9.20` adds the SKS Trust Kernel: serious route finalization now writes Completion Proof, a route completion contract, an evidence index, and a trust report through one release-gated core loop.
|
|
6
|
+
|
|
7
|
+
SKS does not try to clone every other harness. It focuses on one thing: making Codex work auditable, visual-evidence-bound, safety-gated, and reproducible through Completion Proof.
|
|
6
8
|
|
|
7
9
|

|
|
8
10
|
|
|
9
|
-
## 0.9.
|
|
11
|
+
## 0.9.20 Current Release
|
|
12
|
+
|
|
13
|
+
0.9.20 strengthens the core trust loop instead of expanding route names. The new `sks trust` surface validates `route-completion-contract.json`, `evidence-index.json`, stale/mock/static evidence rules, and Completion Proof status. `sks run` and `sks status` give novices a smaller control surface while preserving the existing Team, QA, Research, PPT, Image UX, DB, Wiki, GX, and Goal routes.
|
|
14
|
+
|
|
15
|
+
Highlights:
|
|
16
|
+
|
|
17
|
+
- `sks trust report latest --json`, `sks trust validate latest --json`, and `sks trust explain latest` expose the route trust kernel.
|
|
18
|
+
- Route finalization writes mission-local `route-completion-contract.json`, `evidence-index.json`, `evidence.jsonl`, and `trust-report.json`.
|
|
19
|
+
- Mock/static evidence stays `verified_partial` or lower; it cannot support a real `verified` route claim.
|
|
20
|
+
- Visual route validation blocks stale image/voxel anchors.
|
|
21
|
+
- `sks bench core --json` writes `.sneakoscope/reports/performance/core-bench.json` and `.md`.
|
|
22
|
+
- `sks paths managed --json` and `sks rollback list --json` document SKS-owned project paths and explicit rollback actions.
|
|
23
|
+
|
|
24
|
+
## 0.9.19 Release
|
|
10
25
|
|
|
11
26
|
0.9.19 makes SKS Scout evidence parse-bound and package-install verified. Real Codex/tmux/Codex App subagent engines must write parseable scout output before consensus can use them as primary evidence. If an engine is unavailable or output cannot be parsed, SKS records a blocked or verified-partial result instead of substituting static evidence. Packed package checks now cover temp install, npx one-shot, and global shim behavior.
|
|
12
27
|
|
|
@@ -34,10 +49,16 @@ Highlights:
|
|
|
34
49
|
|
|
35
50
|
Learn more:
|
|
36
51
|
- Completion Proof: [docs/completion-proof.md](docs/completion-proof.md)
|
|
52
|
+
- Trust Kernel: [docs/trust-kernel.md](docs/trust-kernel.md)
|
|
53
|
+
- Core dominance: [docs/core-dominance.md](docs/core-dominance.md)
|
|
54
|
+
- Performance budgets: [docs/performance-budgets.md](docs/performance-budgets.md)
|
|
37
55
|
- Five-Scout Pipeline: [docs/five-scout-pipeline.md](docs/five-scout-pipeline.md)
|
|
38
56
|
- Image Voxel TriWiki: [docs/image-voxel-ledger.md](docs/image-voxel-ledger.md)
|
|
39
57
|
- Route finalization: [docs/route-finalization.md](docs/route-finalization.md)
|
|
40
58
|
- Feature fixtures: [docs/feature-fixtures.md](docs/feature-fixtures.md)
|
|
59
|
+
- Managed paths: [docs/managed-paths.md](docs/managed-paths.md)
|
|
60
|
+
- Rollback: [docs/rollback.md](docs/rollback.md)
|
|
61
|
+
- Known gaps: [docs/known-gaps.md](docs/known-gaps.md)
|
|
41
62
|
- Scout engines: [docs/scout-engines.md](docs/scout-engines.md)
|
|
42
63
|
- Hermetic E2E: [docs/testing-hermetic-e2e.md](docs/testing-hermetic-e2e.md)
|
|
43
64
|
- Pipeline architecture: [docs/pipeline-architecture.md](docs/pipeline-architecture.md)
|
|
@@ -51,6 +72,8 @@ Learn more:
|
|
|
51
72
|
npm i -g sneakoscope
|
|
52
73
|
sks root
|
|
53
74
|
sks doctor
|
|
75
|
+
sks status
|
|
76
|
+
sks trust report latest
|
|
54
77
|
sks codex-app check
|
|
55
78
|
sks selftest --mock
|
|
56
79
|
sks rust smoke --json
|
|
@@ -60,7 +83,7 @@ sks rust smoke --json
|
|
|
60
83
|
|
|
61
84
|
1. Completion Proof for every serious route
|
|
62
85
|
2. Image Voxel TriWiki anchors and relations for every visual route
|
|
63
|
-
3. Codex App, codex-lb, hooks, Rust fallback parity, DB, route modularity, and generated fixtures verified by release gates
|
|
86
|
+
3. Route contracts, evidence indexes, trust reports, Codex App, codex-lb, hooks, Rust fallback parity, DB, route modularity, and generated fixtures verified by release gates
|
|
64
87
|
|
|
65
88
|
## Install Options
|
|
66
89
|
|
package/bin/sks.mjs
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { main } from '../src/cli/main.mjs';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
const FAST_PACKAGE_VERSION = '0.9.20';
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
|
|
8
|
+
console.log(`sneakoscope ${FAST_PACKAGE_VERSION}`);
|
|
9
|
+
} else if (args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
|
|
10
|
+
if (args.length > 1) {
|
|
11
|
+
const { helpCommand } = await import('../src/core/commands/basic-cli.mjs');
|
|
12
|
+
await helpCommand(args.slice(1));
|
|
13
|
+
} else {
|
|
14
|
+
const { helpFast } = await import('../src/cli/help-fast.mjs');
|
|
15
|
+
helpFast();
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
const { main } = await import('../src/cli/main.mjs');
|
|
19
|
+
await main(args);
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
5
22
|
const message = err && err.stack ? err.stack : String(err);
|
|
6
23
|
console.error(message);
|
|
7
24
|
process.exitCode = 1;
|
|
8
|
-
}
|
|
25
|
+
}
|
|
@@ -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.
|
|
7
|
+
Some("--version") => println!("sks-rs 0.9.20"),
|
|
8
8
|
Some("compact-info") => {
|
|
9
9
|
let mut input = String::new();
|
|
10
10
|
let _ = io::stdin().read_to_string(&mut input);
|
|
@@ -28,7 +28,7 @@ fn main() {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
Some("image-hash") => {
|
|
31
|
+
Some("image-hash") | Some("image-voxel-index") => {
|
|
32
32
|
let path = args.next().unwrap_or_default();
|
|
33
33
|
match image_hash(&path) {
|
|
34
34
|
Ok((sha, bytes)) => println!("{{\"ok\":true,\"engine\":\"rust\",\"path\":\"{}\",\"sha256\":\"{}\",\"bytes\":{}}}", json_escape(&path), sha, bytes),
|
|
@@ -38,7 +38,7 @@ fn main() {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
Some("voxel-validate") => {
|
|
41
|
+
Some("voxel-validate") | Some("image-voxel-validate-fast") => {
|
|
42
42
|
let path = args.next().unwrap_or_default();
|
|
43
43
|
let mut require_anchors = false;
|
|
44
44
|
let mut require_relations = false;
|
|
@@ -58,7 +58,7 @@ fn main() {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
Some("secret-scan") => {
|
|
61
|
+
Some("secret-scan") | Some("evidence-secret-scan") => {
|
|
62
62
|
let path = args.next().unwrap_or_default();
|
|
63
63
|
match std::fs::read_to_string(&path) {
|
|
64
64
|
Ok(text) => {
|
|
@@ -75,7 +75,7 @@ fn main() {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
_ => {
|
|
78
|
-
eprintln!("sks-rs optional accelerator. Commands: --version, compact-info, jsonl-tail, secret-scan, image-hash, voxel-validate");
|
|
78
|
+
eprintln!("sks-rs optional accelerator. Commands: --version, compact-info, jsonl-tail, secret-scan, evidence-secret-scan, image-hash, image-voxel-index, voxel-validate, image-voxel-validate-fast");
|
|
79
79
|
std::process::exit(2);
|
|
80
80
|
}
|
|
81
81
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sneakoscope",
|
|
3
3
|
"displayName": "ㅅㅋㅅ",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.20",
|
|
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",
|
|
@@ -23,6 +23,46 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"bin",
|
|
25
25
|
"src",
|
|
26
|
+
"!src/commands/aliases.mjs",
|
|
27
|
+
"!src/commands/autoresearch.mjs",
|
|
28
|
+
"!src/commands/bench.mjs",
|
|
29
|
+
"!src/commands/bootstrap.mjs",
|
|
30
|
+
"!src/commands/code-structure.mjs",
|
|
31
|
+
"!src/commands/commands.mjs",
|
|
32
|
+
"!src/commands/computer-use.mjs",
|
|
33
|
+
"!src/commands/context7.mjs",
|
|
34
|
+
"!src/commands/db.mjs",
|
|
35
|
+
"!src/commands/deps.mjs",
|
|
36
|
+
"!src/commands/dfix.mjs",
|
|
37
|
+
"!src/commands/dollar-commands.mjs",
|
|
38
|
+
"!src/commands/eval.mjs",
|
|
39
|
+
"!src/commands/fix-path.mjs",
|
|
40
|
+
"!src/commands/gc.mjs",
|
|
41
|
+
"!src/commands/goal.mjs",
|
|
42
|
+
"!src/commands/gx.mjs",
|
|
43
|
+
"!src/commands/harness.mjs",
|
|
44
|
+
"!src/commands/image-ux-review.mjs",
|
|
45
|
+
"!src/commands/init.mjs",
|
|
46
|
+
"!src/commands/memory.mjs",
|
|
47
|
+
"!src/commands/paths.mjs",
|
|
48
|
+
"!src/commands/postinstall.mjs",
|
|
49
|
+
"!src/commands/ppt.mjs",
|
|
50
|
+
"!src/commands/qa-loop.mjs",
|
|
51
|
+
"!src/commands/quickstart.mjs",
|
|
52
|
+
"!src/commands/reasoning.mjs",
|
|
53
|
+
"!src/commands/research.mjs",
|
|
54
|
+
"!src/commands/rollback.mjs",
|
|
55
|
+
"!src/commands/run.mjs",
|
|
56
|
+
"!src/commands/selftest.mjs",
|
|
57
|
+
"!src/commands/setup.mjs",
|
|
58
|
+
"!src/commands/skill-dream.mjs",
|
|
59
|
+
"!src/commands/stats.mjs",
|
|
60
|
+
"!src/commands/status.mjs",
|
|
61
|
+
"!src/commands/team.mjs",
|
|
62
|
+
"!src/commands/trust.mjs",
|
|
63
|
+
"!src/commands/update-check.mjs",
|
|
64
|
+
"!src/commands/usage.mjs",
|
|
65
|
+
"!src/commands/validate-artifacts.mjs",
|
|
26
66
|
"!src/core/pipeline/route-prep-*.mjs",
|
|
27
67
|
"!src/core/pipeline/prompt-context-*.mjs",
|
|
28
68
|
"!src/core/pipeline/stop-gate-*.mjs",
|
|
@@ -44,6 +84,7 @@
|
|
|
44
84
|
"changelog:check": "node ./scripts/changelog-check.mjs",
|
|
45
85
|
"cli-entrypoint:check": "node ./scripts/check-cli-entrypoint.mjs",
|
|
46
86
|
"legacy-free:check": "node ./scripts/check-legacy-free.mjs",
|
|
87
|
+
"architecture:check": "node ./scripts/check-architecture.mjs",
|
|
47
88
|
"route-modularity:check": "node ./scripts/check-route-modularity.mjs",
|
|
48
89
|
"command-budget:check": "node ./scripts/check-command-module-budget.mjs",
|
|
49
90
|
"pipeline-budget:check": "node ./scripts/check-pipeline-budget.mjs",
|
|
@@ -59,6 +100,11 @@
|
|
|
59
100
|
"scouts:parser-check": "node --test \"test/unit/scout-output-parser.test.mjs\"",
|
|
60
101
|
"scouts:selftest": "node ./bin/sks.mjs scouts run latest --engine local-static --mock --json",
|
|
61
102
|
"scouts:check": "node ./bin/sks.mjs scouts validate latest --strict --json",
|
|
103
|
+
"trust:check": "node ./bin/sks.mjs trust validate latest --json || node ./scripts/trust-fixture-check.mjs",
|
|
104
|
+
"evidence:check": "node ./scripts/evidence-fixture-check.mjs",
|
|
105
|
+
"safety:check": "node ./scripts/safety-check.mjs",
|
|
106
|
+
"chaos:check": "node --test \"test/chaos/**/*.test.mjs\"",
|
|
107
|
+
"bench:core": "node ./bin/sks.mjs bench core --json",
|
|
62
108
|
"perf:cold-start": "node ./bin/sks.mjs perf cold-start --json",
|
|
63
109
|
"perf:gate": "node ./scripts/perf-gate.mjs",
|
|
64
110
|
"test": "node --test \"test/**/*.test.mjs\"",
|
|
@@ -69,11 +115,12 @@
|
|
|
69
115
|
"blackbox:pack-install": "node ./scripts/blackbox-pack-install.mjs",
|
|
70
116
|
"blackbox:npx": "node ./scripts/blackbox-npx-one-shot.mjs",
|
|
71
117
|
"blackbox:global-shim": "node ./scripts/blackbox-global-shim.mjs",
|
|
118
|
+
"blackbox:matrix": "node ./scripts/blackbox-matrix.mjs",
|
|
72
119
|
"blackbox:check": "npm run blackbox:pack-install && npm run blackbox:npx && npm run blackbox:global-shim",
|
|
73
120
|
"rust:check": "cargo check --manifest-path crates/sks-core/Cargo.toml",
|
|
74
121
|
"rust:smoke": "node ./scripts/rust-smoke.mjs",
|
|
75
122
|
"coverage": "node --experimental-test-coverage --test \"test/**/*.test.mjs\"",
|
|
76
|
-
"release:check": "npm run repo-audit && npm run changelog:check && npm run cli-entrypoint:check && npm run legacy-free:check && npm run route-modularity:check && npm run command-budget:check && npm run pipeline-budget:check && npm run pipeline-runtime:check && npm run packcheck && npm run feature:check && npm run feature-quality:check && npm run all-features:selftest && npm run scout-engines:check && npm run scouts:parser-check && 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 blackbox:check && npm run sizecheck && npm run registry:check",
|
|
123
|
+
"release:check": "npm run repo-audit && npm run changelog:check && npm run cli-entrypoint:check && npm run legacy-free:check && npm run architecture:check && npm run route-modularity:check && npm run command-budget:check && npm run pipeline-budget:check && npm run pipeline-runtime:check && npm run packcheck && npm run feature:check && npm run feature-quality:check && npm run all-features:selftest && npm run scout-engines:check && npm run scouts:parser-check && npm run scouts:selftest && npm run scouts:check && npm run trust:check && npm run evidence:check && npm run safety:check && npm run chaos:check && npm run bench:core && 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 blackbox:matrix && npm run blackbox:check && npm run sizecheck && npm run registry:check",
|
|
77
124
|
"publish:dry": "npm run release:check && npm --cache /tmp/sks-npm-cache publish --dry-run --registry https://registry.npmjs.org/ --access public",
|
|
78
125
|
"publish:npm": "npm --cache /tmp/sks-npm-cache publish --registry https://registry.npmjs.org/ --access public",
|
|
79
126
|
"prepublishOnly": "npm run release:check && node ./scripts/release-registry-check.mjs --require-unpublished"
|
|
@@ -1,19 +1,60 @@
|
|
|
1
|
+
function argsCommand(loader, exportName) {
|
|
2
|
+
return async () => {
|
|
3
|
+
const mod = await loader();
|
|
4
|
+
return { run: (_command, args = []) => mod[exportName](args) };
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function noArgsCommand(loader, exportName) {
|
|
9
|
+
return async () => {
|
|
10
|
+
const mod = await loader();
|
|
11
|
+
return { run: () => mod[exportName]() };
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function commandArgsCommand(loader, exportName) {
|
|
16
|
+
return async () => {
|
|
17
|
+
const mod = await loader();
|
|
18
|
+
return { run: (command, args = []) => mod[exportName](command, args) };
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function subcommand(loader, exportName, fallbackSubcommand) {
|
|
23
|
+
return async () => {
|
|
24
|
+
const mod = await loader();
|
|
25
|
+
return {
|
|
26
|
+
run: (_command, args = []) => {
|
|
27
|
+
const [subcommandName = fallbackSubcommand, ...rest] = args;
|
|
28
|
+
return mod[exportName](subcommandName, rest);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const basicArgs = (exportName) => argsCommand(() => import('../core/commands/basic-cli.mjs'), exportName);
|
|
35
|
+
const basicNoArgs = (exportName) => noArgsCommand(() => import('../core/commands/basic-cli.mjs'), exportName);
|
|
36
|
+
const gcArgs = (exportName) => argsCommand(() => import('../core/commands/gc-command.mjs'), exportName);
|
|
37
|
+
|
|
1
38
|
export const COMMANDS = {
|
|
2
39
|
help: { maturity: 'stable', summary: 'Show SKS help', lazy: () => import('../commands/help.mjs') },
|
|
3
40
|
version: { maturity: 'stable', summary: 'Show SKS version', lazy: () => import('../commands/version.mjs') },
|
|
4
|
-
commands: { maturity: 'stable', summary: 'List SKS commands', lazy: (
|
|
41
|
+
commands: { maturity: 'stable', summary: 'List SKS commands', lazy: basicArgs('commandsCommand') },
|
|
42
|
+
run: { maturity: 'beta', summary: 'Classify and start a task through the SKS trust kernel', lazy: argsCommand(() => import('../core/commands/run-command.mjs'), 'runCommand') },
|
|
43
|
+
status: { maturity: 'stable', summary: 'Show concise active mission and trust status', lazy: argsCommand(() => import('../core/commands/status-command.mjs'), 'statusCommand') },
|
|
5
44
|
root: { maturity: 'stable', summary: 'Show active SKS root', lazy: () => import('../commands/root.mjs') },
|
|
6
|
-
'update-check': { maturity: 'stable', summary: 'Check npm package freshness', lazy: (
|
|
7
|
-
wizard: { maturity: 'stable', summary: 'Open setup wizard help', lazy: (
|
|
8
|
-
usage: { maturity: 'stable', summary: 'Show focused usage topic', lazy: (
|
|
9
|
-
quickstart: { maturity: 'stable', summary: 'Show quickstart flow', lazy: (
|
|
10
|
-
setup: { maturity: 'stable', summary: 'Initialize SKS state', lazy: (
|
|
11
|
-
bootstrap: { maturity: 'stable', summary: 'Initialize SKS project files', lazy: (
|
|
12
|
-
init: { maturity: 'stable', summary: 'Initialize local control surface', lazy: (
|
|
13
|
-
deps: { maturity: 'stable', summary: 'Check local dependencies', lazy: () => import('../commands/
|
|
14
|
-
'fix-path': { maturity: 'stable', summary: 'Repair hook command paths', lazy: (
|
|
45
|
+
'update-check': { maturity: 'stable', summary: 'Check npm package freshness', lazy: basicArgs('updateCheckCommand') },
|
|
46
|
+
wizard: { maturity: 'stable', summary: 'Open setup wizard help', lazy: basicNoArgs('quickstartCommand') },
|
|
47
|
+
usage: { maturity: 'stable', summary: 'Show focused usage topic', lazy: basicArgs('usageCommand') },
|
|
48
|
+
quickstart: { maturity: 'stable', summary: 'Show quickstart flow', lazy: basicNoArgs('quickstartCommand') },
|
|
49
|
+
setup: { maturity: 'stable', summary: 'Initialize SKS state', lazy: basicArgs('setupCommand') },
|
|
50
|
+
bootstrap: { maturity: 'stable', summary: 'Initialize SKS project files', lazy: basicArgs('bootstrapCommand') },
|
|
51
|
+
init: { maturity: 'stable', summary: 'Initialize local control surface', lazy: basicArgs('initCommand') },
|
|
52
|
+
deps: { maturity: 'stable', summary: 'Check local dependencies', lazy: subcommand(() => import('../core/commands/basic-cli.mjs'), 'depsCommand', 'check') },
|
|
53
|
+
'fix-path': { maturity: 'stable', summary: 'Repair hook command paths', lazy: basicArgs('fixPathCommand') },
|
|
15
54
|
doctor: { maturity: 'stable', summary: 'Check and repair SKS install', lazy: () => import('../commands/doctor.mjs') },
|
|
16
|
-
|
|
55
|
+
paths: { maturity: 'beta', summary: 'Inspect SKS managed paths', lazy: argsCommand(() => import('../core/commands/paths-command.mjs'), 'pathsCommand') },
|
|
56
|
+
rollback: { maturity: 'beta', summary: 'List or apply managed-path rollback actions', lazy: argsCommand(() => import('../core/commands/rollback-command.mjs'), 'rollbackCommand') },
|
|
57
|
+
postinstall: { maturity: 'stable', summary: 'Run postinstall bootstrap', lazy: basicArgs('postinstallCommand') },
|
|
17
58
|
'codex-app': { maturity: 'beta', summary: 'Check Codex App readiness', lazy: () => import('../commands/codex-app.mjs') },
|
|
18
59
|
'codex-lb': { maturity: 'beta', summary: 'Inspect codex-lb status and circuit health', lazy: () => import('../commands/codex-lb.mjs') },
|
|
19
60
|
auth: { maturity: 'beta', summary: 'Alias for codex-lb auth commands', lazy: () => import('../commands/codex-lb.mjs') },
|
|
@@ -24,24 +65,24 @@ export const COMMANDS = {
|
|
|
24
65
|
'mad-sks': { maturity: 'beta', summary: 'MAD-SKS scoped permission modifier', lazy: () => import('../commands/mad-sks.mjs') },
|
|
25
66
|
'auto-review': { maturity: 'beta', summary: 'Manage auto-review profile', lazy: () => import('../commands/auto-review.mjs') },
|
|
26
67
|
autoreview: { maturity: 'beta', summary: 'Alias for auto-review', lazy: () => import('../commands/auto-review.mjs') },
|
|
27
|
-
'dollar-commands': { maturity: 'stable', summary: 'List Codex App dollar commands', lazy: (
|
|
28
|
-
dollars: { maturity: 'stable', summary: 'Alias for dollar-commands', lazy: (
|
|
29
|
-
'$': { maturity: 'stable', summary: 'Alias for dollar-commands', lazy: (
|
|
68
|
+
'dollar-commands': { maturity: 'stable', summary: 'List Codex App dollar commands', lazy: basicArgs('dollarCommandsCommand') },
|
|
69
|
+
dollars: { maturity: 'stable', summary: 'Alias for dollar-commands', lazy: basicArgs('dollarCommandsCommand') },
|
|
70
|
+
'$': { maturity: 'stable', summary: 'Alias for dollar-commands', lazy: basicArgs('dollarCommandsCommand') },
|
|
30
71
|
commit: { maturity: 'stable', summary: 'Create a simple git commit', lazy: () => import('../commands/commit.mjs') },
|
|
31
72
|
'commit-and-push': { maturity: 'stable', summary: 'Create a simple git commit and push', lazy: () => import('../commands/commit-and-push.mjs') },
|
|
32
|
-
dfix: { maturity: 'stable', summary: 'Explain DFix route', lazy: (
|
|
33
|
-
team: { maturity: 'beta', summary: 'Create and observe Team missions', lazy: () => import('../commands/team.mjs') },
|
|
34
|
-
'qa-loop': { maturity: 'beta', summary: 'Run QA loop missions', lazy: () => import('../commands/qa-loop.mjs') },
|
|
35
|
-
research: { maturity: 'labs', summary: 'Run research missions', lazy: () => import('../commands/research.mjs') },
|
|
36
|
-
autoresearch: { maturity: 'labs', summary: 'Alias for research/autoresearch route', lazy: () => import('../commands/autoresearch.mjs') },
|
|
37
|
-
ppt: { maturity: 'labs', summary: 'Inspect/build PPT artifacts', lazy: () => import('../commands/ppt.mjs') },
|
|
38
|
-
'image-ux-review': { maturity: 'labs', summary: 'Inspect image UX artifacts', lazy: () => import('../commands/image-ux-review.mjs') },
|
|
39
|
-
'ux-review': { maturity: 'labs', summary: 'Alias for image UX review', lazy: () => import('../commands/image-ux-review.mjs') },
|
|
40
|
-
'visual-review': { maturity: 'labs', summary: 'Alias for image UX review', lazy: () => import('../commands/image-ux-review.mjs') },
|
|
41
|
-
'ui-ux-review': { maturity: 'labs', summary: 'Alias for image UX review', lazy: () => import('../commands/image-ux-review.mjs') },
|
|
42
|
-
'computer-use': { maturity: 'beta', summary: 'Record Computer Use visual evidence', lazy: () => import('../commands/computer-use.mjs') },
|
|
43
|
-
cu: { maturity: 'beta', summary: 'Alias for Computer Use', lazy: () => import('../commands/computer-use.mjs') },
|
|
44
|
-
context7: { maturity: 'beta', summary: 'Context7 checks and docs', lazy: () => import('
|
|
73
|
+
dfix: { maturity: 'stable', summary: 'Explain DFix route', lazy: basicNoArgs('dfixCommand') },
|
|
74
|
+
team: { maturity: 'beta', summary: 'Create and observe Team missions', lazy: argsCommand(() => import('../core/commands/team-command.mjs'), 'team') },
|
|
75
|
+
'qa-loop': { maturity: 'beta', summary: 'Run QA loop missions', lazy: subcommand(() => import('../core/commands/qa-loop-command.mjs'), 'qaLoopCommand') },
|
|
76
|
+
research: { maturity: 'labs', summary: 'Run research missions', lazy: subcommand(() => import('../core/commands/research-command.mjs'), 'researchCommand') },
|
|
77
|
+
autoresearch: { maturity: 'labs', summary: 'Alias for research/autoresearch route', lazy: subcommand(() => import('../core/commands/autoresearch-command.mjs'), 'autoresearchCommand', 'status') },
|
|
78
|
+
ppt: { maturity: 'labs', summary: 'Inspect/build PPT artifacts', lazy: commandArgsCommand(() => import('../core/commands/ppt-command.mjs'), 'pptCommand') },
|
|
79
|
+
'image-ux-review': { maturity: 'labs', summary: 'Inspect image UX artifacts', lazy: commandArgsCommand(() => import('../core/commands/image-ux-review-command.mjs'), 'imageUxReviewCommand') },
|
|
80
|
+
'ux-review': { maturity: 'labs', summary: 'Alias for image UX review', lazy: commandArgsCommand(() => import('../core/commands/image-ux-review-command.mjs'), 'imageUxReviewCommand') },
|
|
81
|
+
'visual-review': { maturity: 'labs', summary: 'Alias for image UX review', lazy: commandArgsCommand(() => import('../core/commands/image-ux-review-command.mjs'), 'imageUxReviewCommand') },
|
|
82
|
+
'ui-ux-review': { maturity: 'labs', summary: 'Alias for image UX review', lazy: commandArgsCommand(() => import('../core/commands/image-ux-review-command.mjs'), 'imageUxReviewCommand') },
|
|
83
|
+
'computer-use': { maturity: 'beta', summary: 'Record Computer Use visual evidence', lazy: commandArgsCommand(() => import('../core/commands/computer-use-command.mjs'), 'computerUseCommand') },
|
|
84
|
+
cu: { maturity: 'beta', summary: 'Alias for Computer Use', lazy: commandArgsCommand(() => import('../core/commands/computer-use-command.mjs'), 'computerUseCommand') },
|
|
85
|
+
context7: { maturity: 'beta', summary: 'Context7 checks and docs', lazy: subcommand(() => import('./context7-command.mjs'), 'context7Command', 'check') },
|
|
45
86
|
recallpulse: { maturity: 'labs', summary: 'RecallPulse evidence route', lazy: () => import('../commands/recallpulse.mjs') },
|
|
46
87
|
pipeline: { maturity: 'beta', summary: 'Inspect pipeline missions', lazy: () => import('../commands/pipeline.mjs') },
|
|
47
88
|
scouts: { maturity: 'beta', summary: 'Run the default read-only 5-scout intake phase', lazy: () => import('../commands/scouts.mjs') },
|
|
@@ -49,30 +90,32 @@ export const COMMANDS = {
|
|
|
49
90
|
guard: { maturity: 'beta', summary: 'Check harness guard', lazy: () => import('../commands/guard.mjs') },
|
|
50
91
|
conflicts: { maturity: 'beta', summary: 'Check harness conflicts', lazy: () => import('../commands/conflicts.mjs') },
|
|
51
92
|
versioning: { maturity: 'stable', summary: 'Manage release version metadata', lazy: () => import('../commands/versioning.mjs') },
|
|
52
|
-
reasoning: { maturity: 'labs', summary: 'Show reasoning route', lazy: (
|
|
53
|
-
aliases: { maturity: 'stable', summary: 'Show command aliases', lazy: (
|
|
54
|
-
selftest: { maturity: 'stable', summary: 'Run local mock selftest', lazy: (
|
|
55
|
-
goal: { maturity: 'beta', summary: 'Manage Goal bridge workflow', lazy: () => import('../commands/goal.mjs') },
|
|
93
|
+
reasoning: { maturity: 'labs', summary: 'Show reasoning route', lazy: basicArgs('reasoningCommand') },
|
|
94
|
+
aliases: { maturity: 'stable', summary: 'Show command aliases', lazy: basicNoArgs('aliasesCommand') },
|
|
95
|
+
selftest: { maturity: 'stable', summary: 'Run local mock selftest', lazy: basicArgs('selftestCommand') },
|
|
96
|
+
goal: { maturity: 'beta', summary: 'Manage Goal bridge workflow', lazy: subcommand(() => import('../core/commands/goal-command.mjs'), 'goalCommand') },
|
|
56
97
|
hook: { maturity: 'beta', summary: 'Codex hook entrypoint', lazy: () => import('../commands/hook.mjs') },
|
|
57
98
|
profile: { maturity: 'labs', summary: 'Inspect/set profile', lazy: () => import('../commands/profile.mjs') },
|
|
58
99
|
hproof: { maturity: 'beta', summary: 'Evaluate H-Proof gate', lazy: () => import('../commands/hproof.mjs') },
|
|
59
|
-
'validate-artifacts': { maturity: 'beta', summary: 'Validate mission artifacts', lazy: () => import('../commands/validate-artifacts.mjs') },
|
|
100
|
+
'validate-artifacts': { maturity: 'beta', summary: 'Validate mission artifacts', lazy: argsCommand(() => import('../core/commands/validate-artifacts-command.mjs'), 'validateArtifactsCommand') },
|
|
60
101
|
proof: { maturity: 'beta', summary: 'Show and validate completion proof', lazy: () => import('../commands/proof.mjs') },
|
|
102
|
+
trust: { maturity: 'beta', summary: 'Report and validate route trust kernel evidence', lazy: argsCommand(() => import('../core/commands/trust-command.mjs'), 'trustCommand') },
|
|
61
103
|
'proof-field': { maturity: 'beta', summary: 'Scan proof field', lazy: () => import('../commands/proof-field.mjs') },
|
|
62
|
-
'skill-dream': { maturity: 'labs', summary: 'Track skill dream counters', lazy: () => import('../commands/skill-dream.mjs') },
|
|
63
|
-
'code-structure': { maturity: 'labs', summary: 'Scan source structure', lazy: () => import('../commands/code-structure.mjs') },
|
|
104
|
+
'skill-dream': { maturity: 'labs', summary: 'Track skill dream counters', lazy: subcommand(() => import('../core/commands/skill-dream-command.mjs'), 'skillDreamCommand', 'status') },
|
|
105
|
+
'code-structure': { maturity: 'labs', summary: 'Scan source structure', lazy: subcommand(() => import('../core/commands/code-structure-command.mjs'), 'codeStructureCommand', 'scan') },
|
|
64
106
|
rust: { maturity: 'beta', summary: 'Inspect optional Rust accelerator status and smoke parity', lazy: () => import('../commands/rust.mjs') },
|
|
65
|
-
memory: { maturity: 'labs', summary: 'Run retention checks', lazy: () => import('../commands/
|
|
66
|
-
gx: { maturity: 'labs', summary: 'Render/validate GX cartridges', lazy: () => import('../commands/gx.mjs') },
|
|
67
|
-
db: { maturity: 'beta', summary: 'Inspect DB safety policy', lazy: () => import('../commands/db.mjs') },
|
|
68
|
-
eval: { maturity: 'labs', summary: 'Run eval reports', lazy: () => import('../commands/eval.mjs') },
|
|
69
|
-
harness: { maturity: 'labs', summary: 'Run harness fixtures', lazy: () => import('../commands/harness.mjs') },
|
|
107
|
+
memory: { maturity: 'labs', summary: 'Run retention checks', lazy: subcommand(() => import('../core/commands/gc-command.mjs'), 'memoryCommand') },
|
|
108
|
+
gx: { maturity: 'labs', summary: 'Render/validate GX cartridges', lazy: subcommand(() => import('../core/commands/gx-command.mjs'), 'gxCommand', 'validate') },
|
|
109
|
+
db: { maturity: 'beta', summary: 'Inspect DB safety policy', lazy: subcommand(() => import('../core/commands/db-command.mjs'), 'dbCommand', 'policy') },
|
|
110
|
+
eval: { maturity: 'labs', summary: 'Run eval reports', lazy: subcommand(() => import('../core/commands/eval-command.mjs'), 'evalCommand', 'run') },
|
|
111
|
+
harness: { maturity: 'labs', summary: 'Run harness fixtures', lazy: subcommand(() => import('../core/commands/harness-command.mjs'), 'harnessCommand', 'fixture') },
|
|
70
112
|
wiki: { maturity: 'beta', summary: 'Manage TriWiki and image voxel ledgers', lazy: () => import('../commands/wiki.mjs') },
|
|
71
|
-
gc: { maturity: 'labs', summary: 'Compact/prune runtime state', lazy: (
|
|
72
|
-
stats: { maturity: 'labs', summary: 'Show storage stats', lazy: (
|
|
113
|
+
gc: { maturity: 'labs', summary: 'Compact/prune runtime state', lazy: gcArgs('gcCommand') },
|
|
114
|
+
stats: { maturity: 'labs', summary: 'Show storage stats', lazy: gcArgs('statsCommand') },
|
|
73
115
|
features: { maturity: 'beta', summary: 'Validate feature registry', lazy: () => import('../commands/features.mjs') },
|
|
74
116
|
'all-features': { maturity: 'beta', summary: 'Run all-features selftest', lazy: () => import('../commands/all-features.mjs') },
|
|
75
|
-
perf: { maturity: 'beta', summary: 'Run performance checks', lazy: () => import('../commands/perf.mjs') }
|
|
117
|
+
perf: { maturity: 'beta', summary: 'Run performance checks', lazy: () => import('../commands/perf.mjs') },
|
|
118
|
+
bench: { maturity: 'beta', summary: 'Run core trust-kernel benchmark budgets', lazy: argsCommand(() => import('../core/commands/bench-command.mjs'), 'benchCommand') }
|
|
76
119
|
};
|
|
77
120
|
|
|
78
121
|
export const COMMAND_ALIASES = {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { COMMANDS } from './command-registry.mjs';
|
|
2
|
+
import { PACKAGE_VERSION } from '../core/version.mjs';
|
|
3
|
+
import { COMMAND_CATALOG } from '../core/routes.mjs';
|
|
4
|
+
|
|
5
|
+
export function helpFast() {
|
|
6
|
+
console.log(`SKS
|
|
7
|
+
SNEAKOSCOPE CODEX v${PACKAGE_VERSION}
|
|
8
|
+
|
|
9
|
+
Usage
|
|
10
|
+
|
|
11
|
+
sks
|
|
12
|
+
sks help [topic]
|
|
13
|
+
sks commands [--json]
|
|
14
|
+
sks dollar-commands [--json]
|
|
15
|
+
sks proof show --json
|
|
16
|
+
`);
|
|
17
|
+
for (const row of commandRows().filter((entry) => entry.maturity !== 'labs')) {
|
|
18
|
+
console.log(` ${row.usage.padEnd(58)} ${row.description}`);
|
|
19
|
+
}
|
|
20
|
+
console.log('\nThree core promises: Completion Proof for serious routes, Image Voxel TriWiki for visual routes, and release-gated Codex App/codex-lb/hooks/Rust evidence.');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function commandRows() {
|
|
24
|
+
const registry = new Map(Object.entries(COMMANDS).map(([name, meta]) => [name, meta]));
|
|
25
|
+
return COMMAND_CATALOG.map((entry) => ({
|
|
26
|
+
name: entry.name,
|
|
27
|
+
usage: entry.usage,
|
|
28
|
+
description: entry.description,
|
|
29
|
+
maturity: registry.get(entry.name)?.maturity || entry.maturity || 'labs'
|
|
30
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
31
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { performance } from 'node:perf_hooks';
|
|
3
|
+
import { ensureDir, nowIso, packageRoot, projectRoot, runProcess, writeJsonAtomic, writeTextAtomic } from './fsx.mjs';
|
|
4
|
+
import { percentile } from './perf-bench.mjs';
|
|
5
|
+
|
|
6
|
+
export const CORE_BENCH_BUDGETS = Object.freeze({
|
|
7
|
+
'sks --version': 50,
|
|
8
|
+
'sks help': 80,
|
|
9
|
+
'sks root --json': 80,
|
|
10
|
+
'sks commands --json': 120,
|
|
11
|
+
'sks proof validate --json': 250,
|
|
12
|
+
'sks trust validate latest --json': 300,
|
|
13
|
+
'sks wiki image-validate --json': 300,
|
|
14
|
+
'sks features check --json': 1200,
|
|
15
|
+
'sks scouts engines --json': 1000
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const CORE_COMMANDS = Object.freeze([
|
|
19
|
+
['sks --version', ['--version']],
|
|
20
|
+
['sks help', ['help']],
|
|
21
|
+
['sks root --json', ['root', '--json']],
|
|
22
|
+
['sks commands --json', ['commands', '--json']],
|
|
23
|
+
['sks proof validate --json', ['proof', 'validate', '--json']],
|
|
24
|
+
['sks trust validate latest --json', ['trust', 'validate', 'latest', '--json']],
|
|
25
|
+
['sks wiki image-validate --json', ['wiki', 'image-validate', '--json']],
|
|
26
|
+
['sks features check --json', ['features', 'check', '--json']],
|
|
27
|
+
['sks scouts engines --json', ['scouts', 'engines', '--json']]
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export async function runCoreBench(root = process.cwd(), { iterations = 3 } = {}) {
|
|
31
|
+
const script = path.join(packageRoot(), 'bin', 'sks.mjs');
|
|
32
|
+
await ensureBenchTrustMission(root, script);
|
|
33
|
+
const rows = [];
|
|
34
|
+
for (const [label, args] of CORE_COMMANDS) {
|
|
35
|
+
const values = [];
|
|
36
|
+
const failures = [];
|
|
37
|
+
for (let i = 0; i < Math.max(1, Number(iterations) || 1); i += 1) {
|
|
38
|
+
const t0 = performance.now();
|
|
39
|
+
const result = await runProcess(process.execPath, [script, ...args], {
|
|
40
|
+
cwd: root,
|
|
41
|
+
timeoutMs: 30_000,
|
|
42
|
+
maxOutputBytes: 256 * 1024,
|
|
43
|
+
env: { SKS_SKIP_NPM_FRESHNESS_CHECK: '1', SKS_DISABLE_UPDATE_CHECK: '1', CI: 'true' }
|
|
44
|
+
});
|
|
45
|
+
values.push(performance.now() - t0);
|
|
46
|
+
if (result.code !== 0) failures.push({ code: result.code, stderr_tail: result.stderr.slice(-400), stdout_tail: result.stdout.slice(-400) });
|
|
47
|
+
}
|
|
48
|
+
const p95 = Math.round(percentile(values, 95));
|
|
49
|
+
rows.push({
|
|
50
|
+
command: label,
|
|
51
|
+
budget_p95_ms: CORE_BENCH_BUDGETS[label],
|
|
52
|
+
p95_ms: p95,
|
|
53
|
+
ok: failures.length === 0 && p95 <= CORE_BENCH_BUDGETS[label],
|
|
54
|
+
failures,
|
|
55
|
+
raw_ms: values.map((value) => Math.round(value))
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const report = {
|
|
59
|
+
schema: 'sks.core-bench.v1',
|
|
60
|
+
generated_at: nowIso(),
|
|
61
|
+
iterations: Math.max(1, Number(iterations) || 1),
|
|
62
|
+
ok: rows.every((row) => row.ok),
|
|
63
|
+
commands: rows
|
|
64
|
+
};
|
|
65
|
+
await writeCoreBenchArtifacts(root, report);
|
|
66
|
+
return report;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function ensureBenchTrustMission(root, script) {
|
|
70
|
+
await runProcess(process.execPath, [script, 'run', 'bench trust fixture', '--mock', '--json'], {
|
|
71
|
+
cwd: root,
|
|
72
|
+
timeoutMs: 60_000,
|
|
73
|
+
maxOutputBytes: 256 * 1024,
|
|
74
|
+
env: { SKS_SKIP_NPM_FRESHNESS_CHECK: '1', SKS_DISABLE_UPDATE_CHECK: '1', CI: 'true' }
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export async function writeCoreBenchArtifacts(root, report) {
|
|
79
|
+
const dir = path.join(root, '.sneakoscope', 'reports', 'performance');
|
|
80
|
+
await ensureDir(dir);
|
|
81
|
+
await writeJsonAtomic(path.join(dir, 'core-bench.json'), report);
|
|
82
|
+
const lines = [
|
|
83
|
+
'# SKS Core Bench',
|
|
84
|
+
'',
|
|
85
|
+
`Generated: ${report.generated_at}`,
|
|
86
|
+
`Status: ${report.ok ? 'pass' : 'verified_partial_or_blocked'}`,
|
|
87
|
+
'',
|
|
88
|
+
'| Command | Budget p95 | Result p95 | Status |',
|
|
89
|
+
'| --- | ---: | ---: | --- |'
|
|
90
|
+
];
|
|
91
|
+
for (const row of report.commands) lines.push(`| \`${row.command}\` | ${row.budget_p95_ms}ms | ${row.p95_ms}ms | ${row.ok ? 'pass' : 'blocked'} |`);
|
|
92
|
+
await writeTextAtomic(path.join(dir, 'core-bench.md'), `${lines.join('\n')}\n`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export async function benchRoot() {
|
|
96
|
+
return projectRoot();
|
|
97
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { benchRoot, runCoreBench } from '../bench.mjs';
|
|
2
|
+
import { runProcess } from '../fsx.mjs';
|
|
3
|
+
import { flag, readFlagValue } from './command-utils.mjs';
|
|
4
|
+
|
|
5
|
+
export async function benchCommand(args = []) {
|
|
6
|
+
const action = args[0] || 'core';
|
|
7
|
+
const root = await benchRoot();
|
|
8
|
+
if (action === 'core' || action === 'trust-kernel') {
|
|
9
|
+
const report = await runCoreBench(root, { iterations: readFlagValue(args, '--iterations', 3) });
|
|
10
|
+
const result = action === 'trust-kernel'
|
|
11
|
+
? { schema: 'sks.trust-kernel-bench.v1', ok: report.commands.find((row) => row.command === 'sks trust validate latest --json')?.ok === true, core: report }
|
|
12
|
+
: report;
|
|
13
|
+
if (flag(args, '--json')) return console.log(JSON.stringify(result, null, 2));
|
|
14
|
+
console.log(`${action}: ${result.ok ? 'pass' : 'blocked'}`);
|
|
15
|
+
if (!result.ok) process.exitCode = 1;
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
if (action === 'route-fixtures') return commandBench('sks.route-fixture-bench.v1', ['all-features', 'selftest', '--mock', '--execute-fixtures', '--strict-artifacts', '--json'], args);
|
|
19
|
+
if (action === 'blackbox') return commandBench('sks.blackbox-bench.v1', ['blackbox-matrix-placeholder'], args);
|
|
20
|
+
console.error('Usage: sks bench core|route-fixtures|blackbox|trust-kernel [--json] [--iterations N]');
|
|
21
|
+
process.exitCode = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function commandBench(schema, commandArgs, args = []) {
|
|
25
|
+
if (schema === 'sks.blackbox-bench.v1') {
|
|
26
|
+
const result = {
|
|
27
|
+
schema,
|
|
28
|
+
ok: true,
|
|
29
|
+
status: 'verified_partial',
|
|
30
|
+
note: 'Use npm run blackbox:matrix for full package install matrix; bench records the matrix budget surface without running package installs by default.'
|
|
31
|
+
};
|
|
32
|
+
if (flag(args, '--json')) return console.log(JSON.stringify(result, null, 2));
|
|
33
|
+
console.log(`${schema}: ${result.status}`);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
const root = await benchRoot();
|
|
37
|
+
const start = Date.now();
|
|
38
|
+
const result = await runProcess(process.execPath, [new URL('../../../bin/sks.mjs', import.meta.url).pathname, ...commandArgs], {
|
|
39
|
+
cwd: root,
|
|
40
|
+
timeoutMs: 120_000,
|
|
41
|
+
maxOutputBytes: 512 * 1024,
|
|
42
|
+
env: { SKS_SKIP_NPM_FRESHNESS_CHECK: '1', CI: 'true' }
|
|
43
|
+
});
|
|
44
|
+
const report = { schema, ok: result.code === 0, duration_ms: Date.now() - start, command: ['sks', ...commandArgs].join(' '), status: result.code === 0 ? 'verified_partial' : 'blocked' };
|
|
45
|
+
if (flag(args, '--json')) return console.log(JSON.stringify(report, null, 2));
|
|
46
|
+
console.log(`${schema}: ${report.status}`);
|
|
47
|
+
if (!report.ok) process.exitCode = 1;
|
|
48
|
+
return report;
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { projectRoot } from '../fsx.mjs';
|
|
2
|
+
import { managedPathManifest } from '../managed-paths.mjs';
|
|
3
|
+
import { flag } from './command-utils.mjs';
|
|
4
|
+
|
|
5
|
+
export async function pathsCommand(args = []) {
|
|
6
|
+
const action = args[0] || 'managed';
|
|
7
|
+
if (action !== 'managed') {
|
|
8
|
+
console.error('Usage: sks paths managed [--json]');
|
|
9
|
+
process.exitCode = 2;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const root = await projectRoot();
|
|
13
|
+
const manifest = await managedPathManifest(root);
|
|
14
|
+
if (flag(args, '--json')) return console.log(JSON.stringify({ ...manifest, root }, null, 2));
|
|
15
|
+
console.log('SKS managed paths');
|
|
16
|
+
for (const row of manifest.paths || []) console.log(`- ${row.path} (${row.rollback ? 'rollback' : 'preserve'})`);
|
|
17
|
+
}
|