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,64 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import fsp from 'node:fs/promises';
5
- import path from 'node:path';
6
- import { fileURLToPath } from 'node:url';
7
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
8
- const srcRoot = path.join(root, 'src');
9
- const distRoot = path.join(root, 'dist');
10
- await fsp.mkdir(distRoot, { recursive: true });
11
- await removeDistMjs(distRoot);
12
- await copyRuntimeConfigFiles();
13
- await removeDistNonRuntimeArtifacts(distRoot);
14
- await import('./write-build-manifest.js');
15
- async function removeDistMjs(dir) {
16
- if (!fs.existsSync(dir))
17
- return;
18
- for (const entry of await fsp.readdir(dir, { withFileTypes: true })) {
19
- const file = path.join(dir, entry.name);
20
- if (entry.isDirectory())
21
- await removeDistMjs(file);
22
- else if (entry.isFile() && entry.name.endsWith('.mjs'))
23
- await fsp.rm(file, { force: true });
24
- }
25
- }
26
- async function removeDistNonRuntimeArtifacts(dir) {
27
- if (!fs.existsSync(dir))
28
- return;
29
- for (const entry of await fsp.readdir(dir, { withFileTypes: true })) {
30
- const file = path.join(dir, entry.name);
31
- if (entry.isDirectory())
32
- await removeDistNonRuntimeArtifacts(file);
33
- else if (entry.isFile() && (entry.name.endsWith('.js.map') || entry.name.endsWith('.d.ts.map') || entry.name.endsWith('.d.ts'))) {
34
- await fsp.rm(file, { force: true });
35
- }
36
- }
37
- }
38
- async function copyRuntimeConfigFiles() {
39
- const configs = ['core/performance-budgets.json'];
40
- for (const rel of configs) {
41
- const from = path.join(srcRoot, rel);
42
- const to = path.join(distRoot, rel);
43
- if (!fs.existsSync(from))
44
- continue;
45
- await fsp.mkdir(path.dirname(to), { recursive: true });
46
- await fsp.copyFile(from, to);
47
- }
48
- await copyDirIfPresent(path.join(srcRoot, 'vendor', 'openai-codex'), path.join(distRoot, 'vendor', 'openai-codex'));
49
- }
50
- async function copyDirIfPresent(from, to) {
51
- if (!fs.existsSync(from))
52
- return;
53
- await fsp.rm(to, { recursive: true, force: true });
54
- await fsp.mkdir(to, { recursive: true });
55
- for (const entry of await fsp.readdir(from, { withFileTypes: true })) {
56
- const source = path.join(from, entry.name);
57
- const target = path.join(to, entry.name);
58
- if (entry.isDirectory())
59
- await copyDirIfPresent(source, target);
60
- else if (entry.isFile())
61
- await fsp.copyFile(source, target);
62
- }
63
- }
64
- //# sourceMappingURL=build-dist.js.map
@@ -1,135 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { spawnSync } from 'node:child_process';
6
- const root = process.cwd();
7
- const failures = [];
8
- const waivers = loadWaivers();
9
- runGate('pipeline-budget:check');
10
- runGate('pipeline-runtime:check');
11
- checkFacade('src/core/pipeline-runtime.ts', 300);
12
- checkLargeFiles();
13
- checkTsImports();
14
- checkDistRuntime();
15
- if (failures.length) {
16
- console.error('Architecture check failed:');
17
- for (const failure of failures)
18
- console.error(`- ${failure}`);
19
- process.exit(1);
20
- }
21
- console.log('Architecture check passed');
22
- function runGate(script) {
23
- const result = spawnSync('npm', ['run', script], { cwd: root, encoding: 'utf8', stdio: 'pipe' });
24
- if (result.status !== 0)
25
- failures.push(`${script}: ${result.stderr || result.stdout}`.trim());
26
- }
27
- function checkFacade(relPath, maxLines) {
28
- const file = path.join(root, relPath);
29
- if (!fs.existsSync(file))
30
- return failures.push(`${relPath}: missing`);
31
- const text = fs.readFileSync(file, 'utf8');
32
- const lines = text.split(/\r?\n/).length;
33
- if (lines > maxLines)
34
- failures.push(`${relPath}: line count ${lines} > ${maxLines}`);
35
- if (/from ['"].*\b(team|qa|research|ppt|image-ux-review|db|gx)\b/i.test(text))
36
- failures.push(`${relPath}: imports route implementation domains directly`);
37
- }
38
- function checkLargeFiles() {
39
- const files = [];
40
- walk(path.join(root, 'src'), files);
41
- for (const file of files) {
42
- const relPath = path.relative(root, file).split(path.sep).join('/');
43
- const lines = fs.readFileSync(file, 'utf8').split(/\r?\n/).length;
44
- if (isWaivedGenerated(relPath))
45
- continue;
46
- const max = architectureLineLimit(relPath);
47
- if (lines > max)
48
- failures.push(`${relPath}: handwritten file ${lines} lines > ${max} architecture gate`);
49
- if (!isRouteDomainAggregator(relPath) && importsUnrelatedRouteDomains(file))
50
- failures.push(`${relPath}: imports 5+ unrelated route domains`);
51
- }
52
- }
53
- function architectureLineLimit(relPath) {
54
- if (/^src\/core\/(?:pipeline|trust-kernel|evidence|proof)\//.test(relPath))
55
- return 1200;
56
- if (/^src\/core\/(?:pipeline|trust-kernel|evidence|proof)/.test(relPath))
57
- return 1200;
58
- if (/^src\/commands\//.test(relPath) || /^src\/core\/commands\//.test(relPath))
59
- return 900;
60
- return 1800;
61
- }
62
- function isRouteDomainAggregator(relPath) {
63
- return [
64
- 'src/core/pipeline-internals/runtime-core.ts',
65
- 'src/core/pipeline-internals/runtime-gates.ts'
66
- ].includes(relPath);
67
- }
68
- function importsUnrelatedRouteDomains(file) {
69
- const text = fs.readFileSync(file, 'utf8');
70
- const domains = new Set();
71
- const imports = importSpecs(text);
72
- for (const domain of ['team', 'qa-loop', 'research', 'ppt', 'image-ux-review', 'db', 'gx', 'wiki']) {
73
- if (imports.some((spec) => new RegExp(`(^|[/_-])${domain}([/_-]|\\.|$)`, 'i').test(spec)))
74
- domains.add(domain);
75
- }
76
- return domains.size >= 5;
77
- }
78
- function importSpecs(text) {
79
- const specs = [];
80
- const re = /^\s*import\s+(?:[^'"]*?\s+from\s+)?['"]([^'"]+)['"]/gm;
81
- let match;
82
- while ((match = re.exec(text)))
83
- specs.push(match[1]);
84
- return specs;
85
- }
86
- function walk(dir, out) {
87
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
88
- const file = path.join(dir, entry.name);
89
- if (entry.isDirectory())
90
- walk(file, out);
91
- else if (entry.isFile() && /\.(mjs|js|ts)$/.test(entry.name))
92
- out.push(file);
93
- }
94
- }
95
- function checkTsImports() {
96
- const files = [];
97
- walk(path.join(root, 'src'), files);
98
- for (const file of files.filter((item) => item.endsWith('.ts'))) {
99
- const relPath = path.relative(root, file).split(path.sep).join('/');
100
- const text = fs.readFileSync(file, 'utf8');
101
- if (/from\s+['"][^'"]+\.mjs['"]|import\(\s*['"][^'"]+\.mjs['"]\s*\)/.test(text)) {
102
- failures.push(`${relPath}: TypeScript imports .mjs runtime`);
103
- }
104
- }
105
- }
106
- function checkDistRuntime() {
107
- const dist = path.join(root, 'dist');
108
- if (!fs.existsSync(dist))
109
- return;
110
- const files = [];
111
- walk(dist, files);
112
- for (const file of files) {
113
- const relPath = path.relative(root, file).split(path.sep).join('/');
114
- if (relPath.endsWith('.mjs'))
115
- failures.push(`${relPath}: dist .mjs runtime forbidden`);
116
- }
117
- }
118
- function loadWaivers() {
119
- const file = path.join(root, 'src', 'generated', 'architecture-waivers.json');
120
- try {
121
- const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
122
- return Array.isArray(parsed.waivers) ? parsed.waivers : [];
123
- }
124
- catch {
125
- return [];
126
- }
127
- }
128
- function isWaivedGenerated(relPath) {
129
- return /^src\/generated\//.test(relPath)
130
- || waivers.some((waiver) => waiver?.schema === 'sks.architecture-waiver.v1'
131
- && waiver.file === relPath
132
- && waiver.reason === 'generated'
133
- && waiver.expires_version);
134
- }
135
- //# sourceMappingURL=check-architecture.js.map
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs/promises';
4
- import path from 'node:path';
5
- const root = process.cwd();
6
- const mainPath = path.join(root, 'src', 'cli', 'main.ts');
7
- const registryPath = path.join(root, 'src', 'cli', 'command-registry.ts');
8
- const main = await fs.readFile(mainPath, 'utf8');
9
- const registry = await fs.readFile(registryPath, 'utf8');
10
- const oldMaintenanceModule = ['maintenance', 'commands.mjs'].join('-');
11
- const oldMainModule = ['legacy', 'main.mjs'].join('-');
12
- const oldLazyShape = ['lazy:', 'legacy'].join(' ');
13
- const imports = [...main.matchAll(/^import\s+/gm)];
14
- const lineCount = main.split(/\r?\n/).length;
15
- const heavy = [
16
- '../core/routes.js',
17
- `./${oldMaintenanceModule}`,
18
- `./${oldMainModule}`,
19
- '../core/pipeline.js',
20
- '../core/research.js',
21
- '../core/ppt.js',
22
- '../core/image-ux-review.js',
23
- '../core/hooks-runtime.js'
24
- ].filter((needle) => main.includes(needle));
25
- const issues = [];
26
- if (imports.length > 2)
27
- issues.push(`main_import_count:${imports.length}`);
28
- if (lineCount > 25)
29
- issues.push(`main_line_count:${lineCount}`);
30
- for (const item of heavy)
31
- issues.push(`heavy_import:${item}`);
32
- if (!/\bimport\(/.test(registry))
33
- issues.push('registry_lazy_import_missing');
34
- if (registry.includes(oldMainModule) || registry.includes(oldLazyShape))
35
- issues.push('legacy_fallback_present');
36
- if (issues.length) {
37
- console.error(`CLI entrypoint check failed: ${issues.join(', ')}`);
38
- process.exitCode = 1;
39
- }
40
- else {
41
- console.log('CLI entrypoint check passed');
42
- }
43
- //# sourceMappingURL=check-cli-entrypoint.js.map
@@ -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 dir = path.join(root, 'src', 'core', 'commands');
7
- const failures = [];
8
- for (const file of fs.readdirSync(dir).filter((name) => name.endsWith('-command.ts'))) {
9
- const absolute = path.join(dir, file);
10
- const text = fs.readFileSync(absolute, 'utf8');
11
- const lines = text.split(/\r?\n/).length;
12
- const imports = [...text.matchAll(/^\s*import\s+/gm)].length;
13
- if (lines > 1200)
14
- failures.push(`${file}: line count ${lines} > 1200`);
15
- if (imports > 35)
16
- failures.push(`${file}: import count ${imports} > 35`);
17
- }
18
- if (failures.length) {
19
- console.error('Command module budget check failed:');
20
- for (const failure of failures)
21
- console.error(`- ${failure}`);
22
- process.exit(1);
23
- }
24
- console.log('Command module budget check passed');
25
- //# sourceMappingURL=check-command-module-budget.js.map
@@ -1,100 +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
- import crypto from 'node:crypto';
7
- import { sourceSnapshot } from './lib/ensure-dist-fresh.js';
8
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
9
- const distRoot = path.join(root, 'dist');
10
- const issues = [];
11
- if (!fs.existsSync(distRoot))
12
- issues.push('dist_missing');
13
- requiredFile('dist/bin/sks.js');
14
- requiredFile('dist/cli/command-registry.js');
15
- requiredFile('dist/build-manifest.json');
16
- const bmPath = path.join(root, 'dist/build-manifest.json');
17
- if (fs.existsSync(bmPath)) {
18
- try {
19
- const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
20
- const manifest = JSON.parse(fs.readFileSync(bmPath, 'utf8'));
21
- const source = sourceSnapshot();
22
- if (manifest.schema !== 'sks.dist-build.v2')
23
- issues.push(`build_manifest_schema:${manifest.schema || 'missing'}`);
24
- if (manifest.version !== pkg.version || manifest.package_version !== pkg.version)
25
- issues.push(`build_manifest_version:${manifest.version || manifest.package_version || 'missing'}!=${pkg.version}`);
26
- if (!manifest.source_digest)
27
- issues.push('build_manifest_source_digest_missing');
28
- if (manifest.source_digest !== source.digest)
29
- issues.push('build_manifest_source_digest_stale');
30
- if (manifest.source_file_count !== source.file_count)
31
- issues.push('build_manifest_source_file_count_stale');
32
- if (manifest.source_list_hash !== sha256(source.files.join('\n')))
33
- issues.push('build_manifest_source_list_hash_stale');
34
- if (!Number.isFinite(Number(manifest.compiled_js_count)))
35
- issues.push('build_manifest_compiled_js_count_missing');
36
- if (!Number.isFinite(Number(manifest.compiled_dts_count)))
37
- issues.push('build_manifest_compiled_dts_count_missing');
38
- if (Number(manifest.src_mjs_runtime_files) !== 0)
39
- issues.push(`build_manifest_src_mjs:${manifest.src_mjs_runtime_files}`);
40
- if (Object.hasOwn(manifest, 'generated_at'))
41
- issues.push('build_manifest_generated_at_non_deterministic');
42
- const mjs = Number(manifest.mjs_runtime_files);
43
- if (Number.isFinite(mjs) && mjs !== 0)
44
- issues.push(`build_manifest_mjs:${mjs}`);
45
- }
46
- catch (err) {
47
- issues.push(`build_manifest_invalid:${err?.message || err}`);
48
- }
49
- }
50
- for (const file of walk(path.join(root, 'src'))) {
51
- const rel = path.relative(root, file).split(path.sep).join('/');
52
- if (rel.endsWith('.mjs'))
53
- issues.push(`src_mjs:${rel}`);
54
- }
55
- const bin = path.join(root, 'dist/bin/sks.js');
56
- if (fs.existsSync(bin) && (fs.statSync(bin).mode & 0o111) === 0)
57
- issues.push('bin_not_executable:dist/bin/sks.js');
58
- if (fs.existsSync(distRoot)) {
59
- for (const file of walk(distRoot)) {
60
- const rel = path.relative(root, file).split(path.sep).join('/');
61
- if (rel.endsWith('.mjs'))
62
- issues.push(`dist_mjs:${rel}`);
63
- if (!rel.endsWith('.js'))
64
- continue;
65
- const text = fs.readFileSync(file, 'utf8');
66
- if (text.includes('contract_only'))
67
- issues.push(`contract_only:${rel}`);
68
- if (/from\s+['"][^'"]+\.mjs['"]|import\(\s*['"][^'"]+\.mjs['"]\s*\)/.test(text)) {
69
- issues.push(`imports_mjs:${rel}`);
70
- }
71
- }
72
- }
73
- const result = {
74
- schema: 'sks.dist-runtime-check.v1',
75
- ok: issues.length === 0,
76
- issues
77
- };
78
- console.log(JSON.stringify(result, null, 2));
79
- if (!result.ok)
80
- process.exitCode = 1;
81
- function requiredFile(rel) {
82
- if (!fs.existsSync(path.join(root, rel)))
83
- issues.push(`missing:${rel}`);
84
- }
85
- function walk(dir, out = []) {
86
- if (!fs.existsSync(dir))
87
- return out;
88
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
89
- const file = path.join(dir, entry.name);
90
- if (entry.isDirectory())
91
- walk(file, out);
92
- else if (entry.isFile())
93
- out.push(file);
94
- }
95
- return out;
96
- }
97
- function sha256(text) {
98
- return crypto.createHash('sha256').update(text).digest('hex');
99
- }
100
- //# sourceMappingURL=check-dist-runtime.js.map
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import { buildFeatureRegistry, runtimeRoutesNotStaticContract } from '../core/feature-registry.js';
4
- import { FEATURE_QUALITY_LEVELS, validateFeatureFixtures } from '../core/feature-fixtures.js';
5
- import { packageRoot } from '../core/fsx.js';
6
- const json = process.argv.includes('--json');
7
- const releaseGate = process.argv.includes('--release') || process.argv.includes('--stable') || process.argv.includes('--rc');
8
- const root = packageRoot();
9
- const registry = await buildFeatureRegistry({ root });
10
- const fixtures = validateFeatureFixtures(registry.features);
11
- const routeQuality = runtimeRoutesNotStaticContract(registry.features);
12
- const qualityCounts = registry.feature_quality_summary || registry.fixture_summary?.quality_counts || {};
13
- const missingLevels = FEATURE_QUALITY_LEVELS.filter((level) => !Object.hasOwn(qualityCounts, level));
14
- const blockers = [
15
- ...fixtures.blockers,
16
- ...routeQuality.blockers,
17
- ...missingLevels.map((level) => `quality_level_missing:${level}`),
18
- ...(releaseGate ? releaseQualityBlockers(qualityCounts) : [])
19
- ];
20
- const result = {
21
- schema: 'sks.feature-quality-check.v1',
22
- ok: blockers.length === 0,
23
- quality_levels: FEATURE_QUALITY_LEVELS,
24
- quality_counts: qualityCounts,
25
- fixture_status_counts: registry.fixture_summary?.counts || {},
26
- runtime_route_static_contract_blockers: routeQuality.blockers,
27
- blockers
28
- };
29
- if (json)
30
- console.log(JSON.stringify(result, null, 2));
31
- else {
32
- console.log(`Feature quality: ${result.ok ? 'ok' : 'blocked'}`);
33
- console.log(Object.entries(qualityCounts).map(([level, count]) => `${level}=${count}`).join(', '));
34
- for (const blocker of blockers)
35
- console.log(`- ${blocker}`);
36
- }
37
- if (!result.ok)
38
- process.exitCode = 1;
39
- function releaseQualityBlockers(counts = {}) {
40
- const blockers = [];
41
- if (Number(counts.runtime_verified || 0) < 22)
42
- blockers.push(`runtime_verified_below_release_target:${counts.runtime_verified || 0}<22`);
43
- if (Number(counts.runtime_mock_verified || 0) < 45)
44
- blockers.push(`runtime_mock_verified_below_release_target:${counts.runtime_mock_verified || 0}<45`);
45
- if (Number(counts.integration_optional || 0) > 6)
46
- blockers.push(`integration_optional_above_release_target:${counts.integration_optional || 0}>6`);
47
- if (Number(counts.static_contract || 0) > 45)
48
- blockers.push(`static_contract_above_release_target:${counts.static_contract || 0}>45`);
49
- if (Number(counts.missing || 0) !== 0)
50
- blockers.push(`missing_above_release_target:${counts.missing || 0}`);
51
- return blockers;
52
- }
53
- //# sourceMappingURL=check-feature-quality.js.map
@@ -1,66 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs/promises';
4
- import path from 'node:path';
5
- const root = process.cwd();
6
- const issues = [];
7
- const oldMainModule = ['legacy', 'main.mjs'].join('-');
8
- const oldMaintenanceModule = ['maintenance', 'commands.mjs'].join('-');
9
- const registry = await read('src/cli/command-registry.ts');
10
- if (registry.includes(oldMainModule))
11
- issues.push('registry_legacy_main');
12
- if (/lazy\s*:\s*legacy/.test(registry))
13
- issues.push('registry_lazy_legacy');
14
- if (/const\s+legacy\s*=/.test(registry))
15
- issues.push('registry_legacy_const');
16
- for (const file of await listFiles(path.join(root, 'src', 'commands'))) {
17
- const text = await fs.readFile(file, 'utf8');
18
- if (text.includes(oldMaintenanceModule))
19
- issues.push(`${rel(file)}:maintenance_import`);
20
- if (text.includes(oldMainModule))
21
- issues.push(`${rel(file)}:legacy_import`);
22
- }
23
- for (const file of await listFiles(path.join(root, 'src'))) {
24
- const text = await fs.readFile(file, 'utf8');
25
- if (/lazy\s*:\s*legacy/.test(text))
26
- issues.push(`${rel(file)}:lazy_legacy`);
27
- }
28
- const bin = await read('src/bin/sks.ts');
29
- const main = await read('src/cli/main.ts');
30
- const router = await read('src/cli/router.ts');
31
- if (!bin.includes('../cli/main.js'))
32
- issues.push('bin_entrypoint');
33
- if (!main.includes('./router.js'))
34
- issues.push('main_router');
35
- if (!router.includes('command-registry.js'))
36
- issues.push('router_registry');
37
- if (router.includes(oldMainModule))
38
- issues.push('router_legacy_main');
39
- const pkg = JSON.parse(await read('package.json'));
40
- if ((pkg.files || []).some((entry) => String(entry).startsWith('archive')))
41
- issues.push('archive_in_package_files');
42
- if (issues.length) {
43
- console.error(`Legacy-free check failed: ${issues.join(', ')}`);
44
- process.exitCode = 1;
45
- }
46
- else {
47
- console.log('Legacy-free check passed');
48
- }
49
- async function read(relPath) {
50
- return fs.readFile(path.join(root, relPath), 'utf8');
51
- }
52
- async function listFiles(dir) {
53
- const out = [];
54
- for (const entry of await fs.readdir(dir, { withFileTypes: true }).catch(() => [])) {
55
- const file = path.join(dir, entry.name);
56
- if (entry.isDirectory())
57
- out.push(...await listFiles(file));
58
- else if (entry.isFile() && file.endsWith('.mjs'))
59
- out.push(file);
60
- }
61
- return out;
62
- }
63
- function rel(file) {
64
- return path.relative(root, file).split(path.sep).join('/');
65
- }
66
- //# sourceMappingURL=check-legacy-free.js.map
@@ -1,108 +0,0 @@
1
- #!/usr/bin/env node
2
- // @ts-nocheck
3
- import fs from 'node:fs';
4
- import os from 'node:os';
5
- import path from 'node:path';
6
- import { spawnSync } from 'node:child_process';
7
- import { fileURLToPath } from 'node:url';
8
- import { currentDistFreshness } from './lib/ensure-dist-fresh.js';
9
- const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
10
- const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm';
11
- const issues = [];
12
- const noRebuild = process.env.SKS_ENSURE_DIST_NO_REBUILD === '1' || process.env.SKS_RELEASE_DIST_FRESHNESS_NO_REBUILD === '1';
13
- if (noRebuild) {
14
- const freshness = currentDistFreshness();
15
- if (!freshness.ok)
16
- issues.push(`dist_not_fresh:${freshness.issues.join(',')}`);
17
- }
18
- else {
19
- const build = spawnSync(npmBin, ['run', 'build'], { cwd: root, encoding: 'utf8', stdio: 'pipe' });
20
- if (build.status !== 0)
21
- issues.push(`build_failed:${tail(build.stderr || build.stdout)}`);
22
- }
23
- const pack = spawnSync(npmBin, ['pack', '--dry-run', '--json', '--ignore-scripts'], {
24
- cwd: root,
25
- encoding: 'utf8',
26
- stdio: 'pipe',
27
- env: { ...process.env, npm_config_cache: path.join(os.tmpdir(), 'sks-package-boundary-cache') }
28
- });
29
- if (pack.status !== 0)
30
- issues.push(`pack_failed:${tail(pack.stderr || pack.stdout)}`);
31
- let files = [];
32
- if (pack.status === 0) {
33
- try {
34
- files = JSON.parse(pack.stdout)[0].files.map((file) => file.path);
35
- }
36
- catch (err) {
37
- issues.push(`pack_json:${err.message}`);
38
- }
39
- }
40
- for (const required of ['package.json', 'README.md', 'LICENSE', 'dist/bin/sks.js', 'dist/cli/command-registry.js', 'schemas/codex/image-ux-issue-ledger.schema.json', 'schemas/codex/ux-review-callout-extraction.schema.json']) {
41
- if (!files.includes(required))
42
- issues.push(`packed_missing:${required}`);
43
- }
44
- const ALLOWED_PACKED_SCRIPTS = new Set();
45
- for (const forbidden of files.filter((file) => /^(src|scripts|test|\.sneakoscope|\.codex|\.agents)\//.test(file) && !ALLOWED_PACKED_SCRIPTS.has(file))) {
46
- issues.push(`packed_forbidden:${forbidden}`);
47
- }
48
- for (const forbidden of files.filter((file) => file.endsWith('.mjs') && !ALLOWED_PACKED_SCRIPTS.has(file))) {
49
- issues.push(`packed_mjs_forbidden:${forbidden}`);
50
- }
51
- const importIssues = checkImportClosure(path.join(root, 'dist'));
52
- issues.push(...importIssues);
53
- const result = {
54
- schema: 'sks.package-boundary-check.v1',
55
- ok: issues.length === 0,
56
- files: files.length,
57
- bin: 'dist/bin/sks.js',
58
- import_closure_issues: importIssues,
59
- issues
60
- };
61
- console.log(JSON.stringify(result, null, 2));
62
- if (!result.ok)
63
- process.exitCode = 1;
64
- function checkImportClosure(dir) {
65
- const out = [];
66
- if (!fs.existsSync(dir))
67
- return ['dist_missing'];
68
- for (const file of walk(dir)) {
69
- const text = fs.readFileSync(file, 'utf8');
70
- for (const spec of importSpecs(text)) {
71
- if (!spec.startsWith('.'))
72
- continue;
73
- const resolved = path.resolve(path.dirname(file), spec);
74
- const candidates = [resolved, `${resolved}.js`, `${resolved}.mjs`, path.join(resolved, 'index.js'), path.join(resolved, 'index.mjs')];
75
- if (!candidates.some((candidate) => fs.existsSync(candidate))) {
76
- out.push(`missing_import:${path.relative(root, file)}->${spec}`);
77
- }
78
- }
79
- }
80
- return out;
81
- }
82
- function walk(dir, out = []) {
83
- for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
84
- const file = path.join(dir, entry.name);
85
- if (entry.isDirectory())
86
- walk(file, out);
87
- else if (entry.isFile() && /\.(mjs|js)$/.test(entry.name))
88
- out.push(file);
89
- }
90
- return out;
91
- }
92
- function importSpecs(text) {
93
- const specs = [];
94
- text = text.replace(/\/\*[\s\S]*?\*\//g, '').replace(/^\s*\/\/.*$/gm, '');
95
- const re = /\bimport\s*(?:\([^)]*?['"]([^'"]+)['"]\)|(?:[^'"]*?\sfrom\s*)?['"]([^'"]+)['"])/g;
96
- let match;
97
- while ((match = re.exec(text))) {
98
- const previous = text[match.index - 1] || '';
99
- if (previous === '"' || previous === "'" || previous === '`')
100
- continue;
101
- specs.push(match[1] || match[2]);
102
- }
103
- return specs.filter(Boolean);
104
- }
105
- function tail(value) {
106
- return String(value || '').slice(-500).replace(/\s+/g, ' ').trim();
107
- }
108
- //# sourceMappingURL=check-package-boundary.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
- const root = process.cwd();
6
- const failures = [];
7
- const facade = path.join(root, 'src', 'core', 'pipeline.ts');
8
- const facadeLines = lineCount(facade);
9
- if (facadeLines > 200)
10
- failures.push(`src/core/pipeline.ts: line count ${facadeLines} > 200`);
11
- const runtimeFacade = path.join(root, 'src', 'core', 'pipeline-runtime.ts');
12
- if (fs.existsSync(runtimeFacade)) {
13
- const runtimeLines = lineCount(runtimeFacade);
14
- if (runtimeLines > 300)
15
- failures.push(`src/core/pipeline-runtime.ts: line count ${runtimeLines} > 300`);
16
- const text = fs.readFileSync(runtimeFacade, 'utf8');
17
- if (/from ['"].*\\b(team|qa|research|ppt|image-ux-review|db|gx)\\b/i.test(text)) {
18
- failures.push('src/core/pipeline-runtime.ts: compatibility facade imports route implementation modules directly');
19
- }
20
- }
21
- const moduleDir = path.join(root, 'src', 'core', 'pipeline');
22
- for (const file of fs.readdirSync(moduleDir).filter((name) => name.endsWith('.ts'))) {
23
- const absolute = path.join(moduleDir, file);
24
- const lines = lineCount(absolute);
25
- if (lines > 1000)
26
- failures.push(`src/core/pipeline/${file}: line count ${lines} > 1000`);
27
- const imports = fs.readFileSync(absolute, 'utf8').match(/\\bfrom\\s+['"][^'"]+['"]/g) || [];
28
- if (imports.length > 35)
29
- failures.push(`src/core/pipeline/${file}: import count ${imports.length} > 35`);
30
- }
31
- const required = [
32
- 'plan-schema.ts',
33
- 'stage-policy.ts',
34
- 'agent-stage-policy.ts',
35
- 'route-prep.ts',
36
- 'route-prep-team.ts',
37
- 'route-prep-research.ts',
38
- 'route-prep-qa.ts',
39
- 'route-prep-ppt.ts',
40
- 'route-prep-image-ux.ts',
41
- 'route-prep-db.ts',
42
- 'route-prep-gx.ts',
43
- 'stop-gate.ts',
44
- 'stop-gate-context7.ts',
45
- 'stop-gate-subagents.ts',
46
- 'stop-gate-proof.ts',
47
- 'active-context.ts',
48
- 'prompt-context.ts',
49
- 'prompt-context-dfix.ts',
50
- 'prompt-context-answer.ts',
51
- 'prompt-context-computer-use.ts',
52
- 'pipeline-plan-writer.ts',
53
- 'validation.ts'
54
- ];
55
- for (const file of required) {
56
- if (!fs.existsSync(path.join(moduleDir, file)))
57
- failures.push(`src/core/pipeline/${file}: missing`);
58
- }
59
- if (failures.length) {
60
- console.error('Pipeline budget check failed:');
61
- for (const failure of failures)
62
- console.error(`- ${failure}`);
63
- process.exit(1);
64
- }
65
- console.log('Pipeline budget check passed');
66
- function lineCount(file) {
67
- return fs.readFileSync(file, 'utf8').split(/\r?\n/).length;
68
- }
69
- //# sourceMappingURL=check-pipeline-budget.js.map