sneakoscope 4.0.13 → 4.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +10 -2
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/dist/bin/sks.js +1 -1
  6. package/dist/cli/global-mode-router.js +2 -1
  7. package/dist/core/commands/mad-sks-command.js +3 -0
  8. package/dist/core/fsx.js +1 -1
  9. package/dist/core/providers/glm/bench/glm-bench-model-lock-proof.js +32 -3
  10. package/dist/core/providers/glm/bench/glm-benchmark-runner.js +29 -5
  11. package/dist/core/providers/glm/bench/glm-benchmark-types.js +1 -1
  12. package/dist/core/providers/glm/naruto/glm-naruto-critical-path.js +51 -0
  13. package/dist/core/providers/glm/naruto/glm-naruto-final-seal.js +9 -2
  14. package/dist/core/providers/glm/naruto/glm-naruto-orchestrator.js +101 -15
  15. package/dist/core/providers/glm/naruto/glm-naruto-parallelism-summary.js +55 -0
  16. package/dist/core/providers/glm/naruto/glm-naruto-requirement-coverage.js +92 -0
  17. package/dist/core/providers/glm/naruto/glm-naruto-requirement-ledger.js +42 -0
  18. package/dist/core/providers/glm/naruto/glm-naruto-stage-scheduler.js +85 -0
  19. package/dist/core/providers/glm/naruto/glm-naruto-task-size-classifier.js +12 -0
  20. package/dist/core/providers/glm/naruto/glm-naruto-trace.js +4 -0
  21. package/dist/core/providers/glm/naruto/glm-naruto-verifier-output.js +5 -0
  22. package/dist/core/providers/glm/naruto/glm-naruto-worker-pool.js +130 -44
  23. package/dist/core/providers/glm/naruto/glm-naruto-worker-runtime.js +6 -2
  24. package/dist/core/routes/model-mode-router.js +44 -0
  25. package/dist/core/version.js +1 -1
  26. package/package.json +24 -1
  27. package/dist/scripts/agent-dynamic-pool-fixture.js +0 -80
  28. package/dist/scripts/agent-native-release-gate.js +0 -274
  29. package/dist/scripts/agent-patch-swarm-gate-lib.js +0 -113
  30. package/dist/scripts/agent-real-codex-patch-envelope-smoke.js +0 -126
  31. package/dist/scripts/agent-route-blackbox-lib.js +0 -132
  32. package/dist/scripts/blackbox-command-import-smoke.js +0 -143
  33. package/dist/scripts/blackbox-global-shim.js +0 -77
  34. package/dist/scripts/blackbox-matrix.js +0 -70
  35. package/dist/scripts/blackbox-npx-one-shot.js +0 -69
  36. package/dist/scripts/blackbox-pack-install.js +0 -174
  37. package/dist/scripts/build-dist.js +0 -64
  38. package/dist/scripts/check-architecture.js +0 -135
  39. package/dist/scripts/check-cli-entrypoint.js +0 -43
  40. package/dist/scripts/check-command-module-budget.js +0 -25
  41. package/dist/scripts/check-dist-runtime.js +0 -100
  42. package/dist/scripts/check-feature-quality.js +0 -53
  43. package/dist/scripts/check-legacy-free.js +0 -66
  44. package/dist/scripts/check-package-boundary.js +0 -108
  45. package/dist/scripts/check-pipeline-budget.js +0 -69
  46. package/dist/scripts/check-pipeline-runtime.js +0 -25
  47. package/dist/scripts/check-publish-tag.js +0 -30
  48. package/dist/scripts/check-route-modularity.js +0 -82
  49. package/dist/scripts/check-runtime-schemas.js +0 -87
  50. package/dist/scripts/check-source-runtime.js +0 -4
  51. package/dist/scripts/check-ts-contracts.js +0 -69
  52. package/dist/scripts/check-ts-suppressions.js +0 -58
  53. package/dist/scripts/clean-dist.js +0 -8
  54. package/dist/scripts/codex-0140-feature-gate-lib.js +0 -14
  55. package/dist/scripts/codex-config-eperm-fixture.js +0 -32
  56. package/dist/scripts/codex-lb-missing-env-regression.js +0 -40
  57. package/dist/scripts/codex-native-runtime-e2e-fixture.js +0 -75
  58. package/dist/scripts/codex-project-config-policy-merge-regression.js +0 -92
  59. package/dist/scripts/core-skill-legacy-promotion-api-audit.js +0 -54
  60. package/dist/scripts/ensure-bin-executable.js +0 -10
  61. package/dist/scripts/fixtures/fake-codex-config-loader.js +0 -51
  62. package/dist/scripts/github-release-body-helper.js +0 -65
  63. package/dist/scripts/gpt-image-2-real-file-smoke.js +0 -448
  64. package/dist/scripts/hooks-no-unsupported-handlers.js +0 -15
  65. package/dist/scripts/hooks-runtime-replay-warning-zero-v2.js +0 -26
  66. package/dist/scripts/hooks-runtime-replay-warning-zero.js +0 -10
  67. package/dist/scripts/hooks-trust-warning-zero.js +0 -14
  68. package/dist/scripts/lib/codex-sdk-gate-lib.js +0 -92
  69. package/dist/scripts/lib/ensure-dist-fresh.js +0 -142
  70. package/dist/scripts/lib/git-worktree-fixture.js +0 -33
  71. package/dist/scripts/lib/mad-sks-actual-executor-check-lib.js +0 -255
  72. package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +0 -79
  73. package/dist/scripts/lib/real-codex-parallel-gate.js +0 -94
  74. package/dist/scripts/lib/real-codex-parallel-proof-fixture.js +0 -55
  75. package/dist/scripts/lib/valid-png-fixture.js +0 -25
  76. package/dist/scripts/mad-sks-live-protected-core-smoke.js +0 -5
  77. package/dist/scripts/naruto-real-local-gpt-final-smoke.js +0 -25
  78. package/dist/scripts/perf-gate.js +0 -39
  79. package/dist/scripts/prepublish-release-check-or-fast.js +0 -121
  80. package/dist/scripts/release-3112-required-gates.js +0 -30
  81. package/dist/scripts/release-3113-required-gates.js +0 -25
  82. package/dist/scripts/release-4000-required-gates.js +0 -36
  83. package/dist/scripts/release-4001-required-gates.js +0 -13
  84. package/dist/scripts/release-4002-required-gates.js +0 -14
  85. package/dist/scripts/release-check-dynamic-execute.js +0 -259
  86. package/dist/scripts/release-check-dynamic.js +0 -107
  87. package/dist/scripts/release-check-stamp.js +0 -261
  88. package/dist/scripts/release-gate-dag-runner.js +0 -56
  89. package/dist/scripts/release-gate-existence-audit.js +0 -111
  90. package/dist/scripts/release-gate-planner.js +0 -34
  91. package/dist/scripts/release-gate-worker.js +0 -10
  92. package/dist/scripts/release-speed-summary.js +0 -67
  93. package/dist/scripts/repo-audit.js +0 -83
  94. package/dist/scripts/rust-smoke.js +0 -5
  95. package/dist/scripts/sizecheck.js +0 -146
  96. package/dist/scripts/sks-1-11-gate-lib.js +0 -78
  97. package/dist/scripts/sks-1-18-gate-lib.js +0 -55
  98. package/dist/scripts/tmux-removal-inventory.js +0 -36
  99. package/dist/scripts/write-build-manifest.js +0 -71
  100. package/dist/scripts/zellij-dashboard-watch.js +0 -41
  101. package/dist/scripts/zellij-right-column-geometry-proof.js +0 -162
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- const root = process.cwd();
6
- const file = path.join(root, 'src', 'core', 'pipeline-runtime.ts');
7
- const failures = [];
8
- if (fs.existsSync(file)) {
9
- const text = fs.readFileSync(file, 'utf8');
10
- const lines = text.split(/\r?\n/).length;
11
- if (lines > 300)
12
- failures.push(`src/core/pipeline-runtime.ts: line count ${lines} > 300`);
13
- if (!/pipeline-internals\/runtime-core\.js/.test(text))
14
- failures.push('src/core/pipeline-runtime.ts: expected compatibility re-export facade');
15
- if (/from ['"].*\\b(team|qa|research|ppt|image-ux-review|db|gx)\\b/i.test(text))
16
- failures.push('src/core/pipeline-runtime.ts: imports route implementation modules directly');
17
- }
18
- if (failures.length) {
19
- console.error('Pipeline runtime check failed:');
20
- for (const failure of failures)
21
- console.error(`- ${failure}`);
22
- process.exit(1);
23
- }
24
- console.log('Pipeline runtime check passed');
25
- //# sourceMappingURL=check-pipeline-runtime.js.map
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
7
- const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
8
- const version = String(pkg.version || '');
9
- const isPrerelease = version.includes('-');
10
- const publishLifecycle = process.env.npm_lifecycle_event === 'prepublishOnly';
11
- const npmTag = process.env.npm_config_tag || process.env.NPM_CONFIG_TAG || '';
12
- const publishConfigTag = pkg.publishConfig?.tag || '';
13
- const configuredTag = publishLifecycle && (!npmTag || npmTag === 'latest')
14
- ? (publishConfigTag || npmTag || 'latest')
15
- : (npmTag || publishConfigTag || 'latest');
16
- const expectedTag = isPrerelease ? 'rc' : 'latest';
17
- if (configuredTag !== expectedTag) {
18
- if (isPrerelease) {
19
- console.error(`Prerelease ${pkg.name}@${version} must be published with the rc dist-tag.`);
20
- console.error('Set package.json publishConfig.tag to rc or pass `--tag rc` to npm publish.');
21
- }
22
- else {
23
- console.error(`Stable release ${pkg.name}@${version} must be published with the latest dist-tag.`);
24
- console.error('Remove prerelease tag config and use plain `npm publish`.');
25
- }
26
- console.error(`Current npm tag config: ${configuredTag || 'missing'}`);
27
- process.exit(2);
28
- }
29
- console.log(`Publish tag check passed: ${pkg.name}@${version} -> ${configuredTag}`);
30
- //# sourceMappingURL=check-publish-tag.js.map
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- const root = process.cwd();
6
- const failures = [];
7
- const routeCli = path.join(root, 'src', 'core', 'commands', 'route-cli.mjs');
8
- if (fs.existsSync(routeCli))
9
- failures.push('src/core/commands/route-cli.mjs must not exist in runtime source');
10
- for (const file of listFiles(path.join(root, 'src', 'commands'), '.mjs')) {
11
- const text = fs.readFileSync(file, 'utf8');
12
- if (text.includes('route-cli.mjs'))
13
- failures.push(`${rel(file)} imports route-cli.mjs`);
14
- }
15
- const requiredModules = [
16
- 'team-command.mjs',
17
- 'qa-loop-command.mjs',
18
- 'research-command.mjs',
19
- 'autoresearch-command.mjs',
20
- 'ppt-command.mjs',
21
- 'image-ux-review-command.mjs',
22
- 'computer-use-command.mjs',
23
- 'db-command.mjs',
24
- 'wiki-command.mjs',
25
- 'gx-command.mjs',
26
- 'goal-command.mjs',
27
- 'pipeline-command.mjs',
28
- 'recallpulse-command.mjs',
29
- 'hproof-command.mjs',
30
- 'validate-artifacts-command.mjs'
31
- ];
32
- for (const name of requiredModules) {
33
- if (!commandModuleExists(name))
34
- failures.push(`missing ${name}`);
35
- }
36
- const disallowedImports = {
37
- 'qa-loop-command.mjs': ['research-command', 'ppt-command', 'team-command', 'gx-command'],
38
- 'research-command.mjs': ['qa-loop-command', 'ppt-command', 'team-command', 'gx-command'],
39
- 'db-command.mjs': ['image-ux-review-command', 'ppt-command', 'computer-use-command'],
40
- 'wiki-command.mjs': ['team-command', 'research-command', 'qa-loop-command', 'ppt-command']
41
- };
42
- for (const [name, needles] of Object.entries(disallowedImports)) {
43
- const file = commandModulePath(name);
44
- if (!fs.existsSync(file))
45
- continue;
46
- const text = fs.readFileSync(file, 'utf8');
47
- for (const needle of needles) {
48
- if (text.includes(needle))
49
- failures.push(`${name} imports unrelated ${needle}`);
50
- }
51
- }
52
- if (failures.length) {
53
- console.error('Route modularity check failed:');
54
- for (const failure of failures)
55
- console.error(`- ${failure}`);
56
- process.exit(1);
57
- }
58
- console.log('Route modularity check passed');
59
- function listFiles(dir, ext) {
60
- const out = [];
61
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
62
- const file = path.join(dir, entry.name);
63
- if (entry.isDirectory())
64
- out.push(...listFiles(file, ext));
65
- else if (entry.name.endsWith(ext))
66
- out.push(file);
67
- }
68
- return out;
69
- }
70
- function rel(file) {
71
- return path.relative(root, file).split(path.sep).join('/');
72
- }
73
- function commandModulePath(name) {
74
- const base = path.join(root, 'src', 'core', 'commands');
75
- const mjs = path.join(base, name);
76
- const ts = path.join(base, name.replace(/\.mjs$/, '.ts'));
77
- return fs.existsSync(mjs) ? mjs : ts;
78
- }
79
- function commandModuleExists(name) {
80
- return fs.existsSync(commandModulePath(name));
81
- }
82
- //# sourceMappingURL=check-route-modularity.js.map
@@ -1,87 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import { spawnSync } from 'node:child_process';
4
- import path from 'node:path';
5
- import { pathToFileURL } from 'node:url';
6
- import fs from 'node:fs';
7
- const root = process.cwd();
8
- const tsc = spawnSync(process.platform === 'win32' ? 'npx.cmd' : 'npx', ['tsc', '-p', 'tsconfig.json', '--noEmit'], {
9
- cwd: root,
10
- encoding: 'utf8',
11
- stdio: 'pipe'
12
- });
13
- const issues = [];
14
- if (tsc.status !== 0)
15
- issues.push(`typecheck:${tsc.stderr || tsc.stdout}`.trim());
16
- let validatorsOk = false;
17
- try {
18
- const proof = await import(pathToFileURL(path.join(root, 'dist', 'core', 'proof', 'proof-schema.js')));
19
- const evidence = await import(pathToFileURL(path.join(root, 'dist', 'core', 'evidence', 'evidence-schema.js')));
20
- const voxel = await import(pathToFileURL(path.join(root, 'dist', 'core', 'wiki-image', 'image-voxel-schema.js')));
21
- validatorsOk = proof.isCompletionProof({
22
- schema: 'sks.completion-proof.v1',
23
- mission_id: null,
24
- route: '$Team',
25
- status: 'verified_partial',
26
- evidence: {},
27
- claims: [],
28
- unverified: [],
29
- blockers: []
30
- }) && evidence.isEvidenceRecord({
31
- schema: 'sks.evidence.v1',
32
- id: 'EV-TEST',
33
- mission_id: null,
34
- kind: 'test',
35
- source: 'real',
36
- path: null,
37
- sha256: null,
38
- freshness: 'fresh',
39
- trust: 'high',
40
- redacted: true,
41
- issues: []
42
- }) && voxel.isImageVoxelLedger({
43
- schema: 'sks.image-voxel-ledger.v1',
44
- images: [],
45
- anchors: [],
46
- relations: []
47
- });
48
- }
49
- catch (err) {
50
- issues.push(`validator_import:${err.message}`);
51
- }
52
- if (!validatorsOk)
53
- issues.push('validator_smoke_failed');
54
- const codexSchemaDir = path.join(root, 'schemas', 'codex');
55
- for (const file of [
56
- 'ux-review-callout-extraction.schema.json',
57
- 'image-ux-issue-ledger.schema.json',
58
- 'completion-proof.schema.json',
59
- 'wrongness-record.schema.json',
60
- 'agent-result.schema.json',
61
- 'computer-use-live-evidence.schema.json',
62
- 'ppt-slide-issue-ledger.schema.json',
63
- 'dfix-diagnosis.schema.json',
64
- 'dfix-patch-plan.schema.json',
65
- 'dfix-verification.schema.json',
66
- 'all-feature-completion.schema.json',
67
- 'non-recursive-pipeline-report.schema.json'
68
- ]) {
69
- const full = path.join(codexSchemaDir, file);
70
- if (!fs.existsSync(full)) {
71
- issues.push(`codex_schema_missing:${file}`);
72
- continue;
73
- }
74
- try {
75
- const parsed = JSON.parse(fs.readFileSync(full, 'utf8'));
76
- if (parsed.type !== 'object')
77
- issues.push(`codex_schema_root_type:${file}`);
78
- }
79
- catch (err) {
80
- issues.push(`codex_schema_invalid_json:${file}:${err.message}`);
81
- }
82
- }
83
- const result = { schema: 'sks.runtime-schema-check.v1', ok: issues.length === 0, validators_ok: validatorsOk, issues };
84
- console.log(JSON.stringify(result, null, 2));
85
- if (!result.ok)
86
- process.exitCode = 1;
87
- //# sourceMappingURL=check-runtime-schemas.js.map
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import './runtime-no-src-mjs-check.js';
4
- //# sourceMappingURL=check-source-runtime.js.map
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { pathToFileURL } from 'node:url';
6
- const root = process.cwd();
7
- const requiredFiles = [
8
- 'src/cli/command-registry.ts',
9
- 'src/core/trust-kernel/trust-kernel-schema.ts',
10
- 'src/core/trust-kernel/route-contract.ts',
11
- 'src/core/trust-kernel/completion-contract.ts',
12
- 'src/core/evidence/evidence-schema.ts',
13
- 'src/core/proof/proof-schema.ts',
14
- 'src/core/proof/validation.ts',
15
- 'src/core/wiki-image/image-voxel-schema.ts',
16
- 'src/core/agents/agent-schema.ts',
17
- 'src/core/features/feature-fixtures.ts'
18
- ];
19
- const suppressFreeBootstrap = [
20
- 'src/cli/main.ts',
21
- 'src/cli/router.ts',
22
- 'src/core/fsx.ts',
23
- 'src/core/commands/run-command.ts'
24
- ];
25
- const issues = [];
26
- for (const rel of suppressFreeBootstrap) {
27
- const file = path.join(root, rel);
28
- if (!fs.existsSync(file)) {
29
- issues.push(`${rel}:missing`);
30
- continue;
31
- }
32
- const text = fs.readFileSync(file, 'utf8');
33
- if (/@ts-nocheck\b/.test(text))
34
- issues.push(`${rel}:ts_nocheck`);
35
- if (/@ts-ignore\b/.test(text))
36
- issues.push(`${rel}:ts_ignore`);
37
- }
38
- for (const rel of requiredFiles) {
39
- const file = path.join(root, rel);
40
- if (!fs.existsSync(file)) {
41
- issues.push(`${rel}:missing`);
42
- continue;
43
- }
44
- const text = fs.readFileSync(file, 'utf8');
45
- if (/\bany\b/.test(text))
46
- issues.push(`${rel}:any_token`);
47
- if (!/\bexport\b/.test(text))
48
- issues.push(`${rel}:exports_missing`);
49
- }
50
- const runtimeRegistry = await import(pathToFileURL(path.join(root, 'dist', 'cli', 'command-registry.js')));
51
- const runtimeCommands = Object.keys(runtimeRegistry.COMMANDS || {}).sort();
52
- const typedText = fs.readFileSync(path.join(root, 'src', 'cli', 'command-registry.ts'), 'utf8');
53
- for (const name of ['help', 'version', 'commands', 'run', 'team', 'agent', 'trust', 'proof', 'db', 'git', 'wiki', 'bench', 'features']) {
54
- if (!runtimeCommands.includes(name))
55
- issues.push(`typed_registry_runtime_missing:${name}`);
56
- if (!new RegExp(`\\b${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*:`).test(typedText))
57
- issues.push(`typed_registry_ts_missing:${name}`);
58
- }
59
- const result = {
60
- schema: 'sks.ts-contract-check.v1',
61
- ok: issues.length === 0,
62
- checked_files: requiredFiles.length,
63
- runtime_command_count: runtimeCommands.length,
64
- issues
65
- };
66
- console.log(JSON.stringify(result, null, 2));
67
- if (!result.ok)
68
- process.exitCode = 1;
69
- //# sourceMappingURL=check-ts-contracts.js.map
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- /**
4
- * Fail if runtime TypeScript uses forbidden suppressions (@ts-nocheck, @ts-ignore)
5
- * or @ts-expect-error without an SKS-annotated rationale.
6
- *
7
- * Allowed: generated src/generated/** waivers — must include @ts-expect-error SKS-GEN:
8
- */
9
- import fs from 'node:fs';
10
- import path from 'node:path';
11
- import { fileURLToPath } from 'node:url';
12
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
13
- const srcRoot = path.join(root, 'src');
14
- const failures = [];
15
- function scanFile(abs, rel) {
16
- const txt = fs.readFileSync(abs, 'utf8');
17
- const lines = txt.split(/\r?\n/);
18
- const relPosix = rel.split(path.sep).join('/');
19
- const inGenerated = relPosix.startsWith('generated/');
20
- lines.forEach((line, idx) => {
21
- const trimmed = line.trim();
22
- const lineNo = idx + 1;
23
- if (trimmed.includes('@ts-nocheck'))
24
- failures.push({ file: rel, line: lineNo, rule: '@ts-nocheck' });
25
- if (trimmed.includes('@ts-ignore'))
26
- failures.push({ file: rel, line: lineNo, rule: '@ts-ignore' });
27
- if (/@ts-expect-error\b/.test(line)) {
28
- if (inGenerated) {
29
- if (!/@ts-expect-error\s+SKS-GEN:/.test(trimmed))
30
- failures.push({ file: rel, line: lineNo, rule: '@ts-expect-error missing SKS-GEN reason' });
31
- return;
32
- }
33
- if (!/@ts-expect-error\s+SKS-/.test(trimmed))
34
- failures.push({ file: rel, line: lineNo, rule: '@ts-expect-error missing SKS- reason prefix' });
35
- }
36
- });
37
- }
38
- function walk(dir, relDir = '') {
39
- for (const ent of fs.readdirSync(dir, { withFileTypes: true })) {
40
- const abs = path.join(dir, ent.name);
41
- const rel = relDir ? `${relDir}/${ent.name}` : ent.name;
42
- if (ent.isDirectory())
43
- walk(abs, rel);
44
- else if (ent.isFile() && ent.name.endsWith('.ts'))
45
- scanFile(abs, rel);
46
- }
47
- }
48
- if (fs.existsSync(srcRoot))
49
- walk(srcRoot);
50
- const result = {
51
- schema: 'sks.ts-suppression-check.v1',
52
- ok: failures.length === 0,
53
- failures,
54
- };
55
- console.log(JSON.stringify(result, null, 2));
56
- if (!result.ok)
57
- process.exitCode = 1;
58
- //# sourceMappingURL=check-ts-suppressions.js.map
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fsp from 'node:fs/promises';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
7
- await fsp.rm(path.join(root, 'dist'), { recursive: true, force: true });
8
- //# sourceMappingURL=clean-dist.js.map
@@ -1,14 +0,0 @@
1
- import { assertGate, emitGate } from './sks-1-18-gate-lib.js';
2
- import { detectCodex0140Capability } from '../core/codex-control/codex-0140-capability.js';
3
- export async function runCodex0140FeatureGate(gate, feature) {
4
- process.env.SKS_CODEX_0140_FAKE = '1';
5
- process.env.SKS_CODEX_VERSION_FAKE = 'codex-cli 0.140.0';
6
- process.env.SKS_CODEX_0140_PROBE = '1';
7
- const cap = await detectCodex0140Capability({ codexBin: 'codex' });
8
- assertGate(cap.ok === true && cap.supports_0140 === true, `${gate} requires passing Codex 0.140 capability fixture`, cap);
9
- const state = cap.feature_states[feature];
10
- assertGate(cap.features[feature] === true && state?.supported === true, `${gate} requires feature ${feature}`, cap);
11
- assertGate(state.certainty !== 'assumed_by_version' && state.certainty !== 'unverified' && state.certainty !== 'failed', `${gate} requires probed feature certainty for ${feature}`, state);
12
- emitGate(gate, { feature, schema: cap.schema, certainty: state.certainty });
13
- }
14
- //# sourceMappingURL=codex-0140-feature-gate-lib.js.map
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import { spawnSync } from 'node:child_process';
4
- import fs from 'node:fs/promises';
5
- import os from 'node:os';
6
- import path from 'node:path';
7
- const root = process.cwd();
8
- const fixture = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-eperm-fixture-'));
9
- await fs.mkdir(path.join(fixture, '.codex'), { recursive: true });
10
- await fs.writeFile(path.join(fixture, '.codex', 'config.toml'), 'sandbox_mode = "workspace-write"\n');
11
- const result = spawnSync(process.execPath, [
12
- path.join(root, 'dist', 'scripts', 'codex-config-load-probe.js'),
13
- '--root',
14
- fixture,
15
- '--config',
16
- path.join(fixture, '.codex', 'config.toml'),
17
- '--codex-bin',
18
- path.join(root, 'dist', 'scripts', 'fixtures', 'fake-codex-config-loader.js'),
19
- '--json'
20
- ], {
21
- cwd: root,
22
- env: { ...process.env, SKS_FAKE_CODEX_CONFIG_EPERM: '1' },
23
- encoding: 'utf8'
24
- });
25
- const report = JSON.parse(result.stdout || '{}');
26
- const ok = result.status !== 0
27
- && report.checks?.find((row) => row.name === 'node_read')?.ok === true
28
- && report.blockers?.includes('codex_cli_config_eperm');
29
- console.log(JSON.stringify({ schema: 'sks.codex-config-eperm-fixture.v1', ok, report }, null, 2));
30
- if (!ok)
31
- process.exitCode = 1;
32
- //# sourceMappingURL=codex-config-eperm-fixture.js.map
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs/promises';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { runProcess } from '../core/fsx.js';
7
- const rawPattern = new RegExp(['Missing environment variable:', '\\s*`?CODEX_LB_API_KEY`?'].join(''), 'i');
8
- const home = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-codex-lb-missing-env-'));
9
- const entry = path.resolve('dist/bin/sks.js');
10
- const scenarios = [
11
- ['status', ['codex-lb', 'status', '--json']],
12
- ['doctor', ['codex-lb', 'doctor', '--deep', '--json']],
13
- ['health', ['codex-lb', 'health', '--json']],
14
- ['postinstall', ['postinstall']]
15
- ];
16
- const results = [];
17
- for (const [name, args] of scenarios) {
18
- const run = await runProcess(process.execPath, [entry, ...args], {
19
- env: { ...process.env, HOME: home, CI: 'true', CODEX_LB_API_KEY: '', CODEX_LB_BASE_URL: '', SKS_POSTINSTALL_NO_BOOTSTRAP: '1' },
20
- timeoutMs: 20_000,
21
- maxOutputBytes: 256 * 1024
22
- });
23
- const text = `${run.stdout}\n${run.stderr}`;
24
- results.push({
25
- name,
26
- code: run.code,
27
- raw_missing_env: rawPattern.test(text),
28
- has_setup_guidance: name === 'postinstall' ? true : /setup_needed|Run: sks codex-lb setup|missing_env_key|codex-lb auth/i.test(text)
29
- });
30
- }
31
- const ok = results.every((row) => row.raw_missing_env === false && row.has_setup_guidance);
32
- console.log(JSON.stringify({
33
- schema: 'sks.codex-lb-missing-env-regression.v1',
34
- ok,
35
- home,
36
- results
37
- }, null, 2));
38
- if (!ok)
39
- process.exitCode = 1;
40
- //# sourceMappingURL=codex-lb-missing-env-regression.js.map
@@ -1,75 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- export async function createCodexNativeRuntimeFixture(input) {
5
- const root = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-codex-native-e2e-'));
6
- const missionId = `M-check-${Date.now().toString(36)}`;
7
- const home = path.join(root, 'home');
8
- const codexHome = path.join(root, 'codex-home');
9
- await fs.mkdir(home, { recursive: true });
10
- await fs.mkdir(codexHome, { recursive: true });
11
- await fs.mkdir(path.join(root, '.sneakoscope', 'reports'), { recursive: true });
12
- await fs.mkdir(path.join(root, '.sneakoscope', 'missions', missionId), { recursive: true });
13
- await fs.mkdir(path.join(root, 'src', 'core', 'loops'), { recursive: true });
14
- await fs.mkdir(path.join(root, 'src', 'core', 'qa'), { recursive: true });
15
- await fs.mkdir(path.join(root, 'src', 'core', 'research'), { recursive: true });
16
- await fs.mkdir(path.join(root, 'docs'), { recursive: true });
17
- await fs.writeFile(path.join(root, 'package.json'), '{"name":"fixture","version":"3.1.7","scripts":{}}\n', 'utf8');
18
- await fs.writeFile(path.join(root, 'src', 'core', 'loops', 'fixture.ts'), 'export const loopFixture = true\n', 'utf8');
19
- await fs.writeFile(path.join(root, 'src', 'core', 'qa', 'fixture.ts'), 'export const qaFixture = true\n', 'utf8');
20
- await fs.writeFile(path.join(root, 'src', 'core', 'research', 'fixture.ts'), 'export const researchFixture = true\n', 'utf8');
21
- await fs.writeFile(path.join(root, 'docs', 'fixture.md'), '# Fixture\n', 'utf8');
22
- return {
23
- root,
24
- missionId,
25
- matrixPath: path.join(root, '.sneakoscope', 'reports', 'codex-native-feature-matrix.json'),
26
- env: {
27
- ...process.env,
28
- HOME: home,
29
- USERPROFILE: home,
30
- CODEX_HOME: codexHome,
31
- CODEX_BIN: 'codex',
32
- SKS_CODEX_0138_FAKE: '1',
33
- SKS_CODEX_0138_PROBE: '1',
34
- SKS_CODEX_0139_FAKE: '1',
35
- SKS_CODEX_0139_PROBE: '1',
36
- SKS_CODEX_PLUGIN_JSON_FAKE: '1',
37
- SKS_CODEX_HOOK_APPROVAL_FIXTURE: input.hook,
38
- SKS_CODEX_AGENT_TYPE_FIXTURE: input.agentType,
39
- SKS_CODEX_0138_FAKE_APP_HANDOFF_FAIL: input.appHandoff ? '0' : '1',
40
- SKS_CODEX_0138_FAKE_IMAGE_PATH_FAIL: input.imagePathExposure ? '0' : '1',
41
- SKS_CODEX_0138_FAKE_PLUGIN_JSON_FAIL: '0',
42
- SKS_CODEX_PLUGIN_JSON_FAKE_NO_MCP: input.mcpCandidates ? '0' : '1',
43
- SKS_CODEX_0139_FAKE_WEB_SEARCH_FAIL: input.codeModeWebSearch ? '0' : '1',
44
- SKS_CODEX_0139_FAKE_MARKETPLACE_FAIL: '0',
45
- SKS_CODEX_0139_FAKE_PROFILE_ALIAS_FAIL: '0',
46
- SKS_CODEX_0139_FAKE_INTERRUPT_FAIL: '0',
47
- SKS_CODEX_0139_FAKE_RICH_SCHEMA_FAIL: '0',
48
- SKS_CODEX_0139_FAKE_DOCTOR_ENV_FAIL: '0',
49
- SKS_LOOP_RUNTIME_FIXTURE: '1',
50
- SKS_TEST_RUNTIME_FIXTURE_ALLOWED: '1'
51
- }
52
- };
53
- }
54
- export async function withFixtureEnv(fixture, fn) {
55
- const previous = new Map();
56
- for (const [key, value] of Object.entries(fixture.env)) {
57
- previous.set(key, process.env[key]);
58
- if (value === undefined)
59
- delete process.env[key];
60
- else
61
- process.env[key] = value;
62
- }
63
- try {
64
- return await fn();
65
- }
66
- finally {
67
- for (const [key, value] of previous) {
68
- if (value === undefined)
69
- delete process.env[key];
70
- else
71
- process.env[key] = value;
72
- }
73
- }
74
- }
75
- //# sourceMappingURL=codex-native-runtime-e2e-fixture.js.map
@@ -1,92 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- // Regression coverage for the machine-local config mover (codex-project-config-policy):
4
- // 1. Moved top-level keys (e.g. notify=[...], model_provider) must land BEFORE any
5
- // [table] header in the user config, otherwise TOML parses them as members of the
6
- // trailing table (the `invalid type: sequence, expected a string` corruption).
7
- // 2. Splitting the global CODEX_HOME config against itself must be a no-op.
8
- import fs from 'node:fs/promises';
9
- import os from 'node:os';
10
- import path from 'node:path';
11
- import { pathToFileURL } from 'node:url';
12
- import { ensureDistFresh, root as repoRoot } from './lib/ensure-dist-fresh.js';
13
- const freshness = ensureDistFresh({ rebuild: true });
14
- if (!freshness.ok)
15
- fail('dist_not_fresh', { freshness });
16
- const mod = await import(pathToFileURL(path.join(repoRoot, 'dist', 'core', 'codex', 'codex-project-config-policy.js')).href);
17
- const results = [];
18
- // --- Case 1: trailing table in user config must not capture moved top-level keys ---
19
- {
20
- const fixture = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-config-merge-'));
21
- const codexHome = path.join(fixture, 'home', '.codex');
22
- await fs.mkdir(codexHome, { recursive: true });
23
- // Pre-existing user config whose last block is an env table requiring string values.
24
- await fs.writeFile(path.join(codexHome, 'config.toml'), [
25
- '[mcp_servers.xai-grok]',
26
- 'command = "npx"',
27
- '',
28
- '[mcp_servers.xai-grok.env]',
29
- 'XAI_API_KEY = "xai-existing"',
30
- ''
31
- ].join('\n'));
32
- // Project config carrying machine-local top-level keys, including an array (notify).
33
- await fs.mkdir(path.join(fixture, '.codex'), { recursive: true });
34
- await fs.writeFile(path.join(fixture, '.codex', 'config.toml'), [
35
- 'model_provider = "codex-lb"',
36
- 'notify = ["notify-send", "SKS"]',
37
- 'sandbox_mode = "workspace-write"',
38
- ''
39
- ].join('\n'));
40
- await mod.splitCodexProjectConfigPolicy(fixture, { apply: true, codexHome, writeReport: false });
41
- const user = await fs.readFile(path.join(codexHome, 'config.toml'), 'utf8');
42
- const lines = user.split('\n');
43
- const firstTableIdx = lines.findIndex((l) => /^\s*\[/.test(l));
44
- const idxOf = (re) => lines.findIndex((l) => re.test(l));
45
- const modelIdx = idxOf(/^\s*model_provider\s*=/);
46
- const notifyIdx = idxOf(/^\s*notify\s*=/);
47
- const ok = modelIdx >= 0 &&
48
- notifyIdx >= 0 &&
49
- firstTableIdx >= 0 &&
50
- modelIdx < firstTableIdx &&
51
- notifyIdx < firstTableIdx &&
52
- /XAI_API_KEY = "xai-existing"/.test(user) &&
53
- // The env table must NOT have absorbed the moved keys.
54
- /\[mcp_servers\.xai-grok\.env\][\s\S]*$/.test(user);
55
- results.push({ case: 'moved_keys_before_tables', ok, model_idx: modelIdx, notify_idx: notifyIdx, first_table_idx: firstTableIdx, user });
56
- }
57
- // --- Case 2: splitting CODEX_HOME config against itself is a no-op ---
58
- {
59
- const fixture = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-config-home-'));
60
- const codexHome = path.join(fixture, '.codex');
61
- await fs.mkdir(codexHome, { recursive: true });
62
- const homeConfig = path.join(codexHome, 'config.toml');
63
- const homeText = [
64
- 'model_provider = "codex-lb"',
65
- 'notify = ["notify-send", "SKS"]',
66
- '',
67
- '[mcp_servers.xai-grok.env]',
68
- 'XAI_API_KEY = "xai-existing"',
69
- ''
70
- ].join('\n');
71
- await fs.writeFile(homeConfig, homeText);
72
- const report = await mod.splitCodexProjectConfigPolicy(fixture, {
73
- apply: true,
74
- codexHome,
75
- configPath: homeConfig,
76
- writeReport: false
77
- });
78
- const after = await fs.readFile(homeConfig, 'utf8');
79
- const ok = report.changed === false &&
80
- report.status === 'project_config_is_codex_home_noop' &&
81
- after === homeText;
82
- results.push({ case: 'codex_home_self_split_noop', ok, status: report.status, changed: report.changed, unchanged: after === homeText });
83
- }
84
- const ok = results.every((r) => r.ok);
85
- console.log(JSON.stringify({ schema: 'sks.codex-project-config-policy-merge-regression.v1', ok, results }, null, 2));
86
- if (!ok)
87
- process.exitCode = 1;
88
- function fail(blocker, detail) {
89
- console.log(JSON.stringify({ schema: 'sks.codex-project-config-policy-merge-regression.v1', ok: false, blocker, detail }, null, 2));
90
- process.exit(1);
91
- }
92
- //# sourceMappingURL=codex-project-config-policy-merge-regression.js.map