sneakoscope 4.2.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +34 -7
  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/command-registry.js +3 -1
  7. package/dist/cli/ultra-search-command.js +163 -0
  8. package/dist/cli/xai-command.js +28 -168
  9. package/dist/core/agents/agent-codex-cockpit.js +3 -3
  10. package/dist/core/agents/agent-runner-ollama.js +2 -0
  11. package/dist/core/agents/agent-wrongness.js +1 -1
  12. package/dist/core/agents/native-worker-backend-router.js +3 -0
  13. package/dist/core/bench.js +115 -0
  14. package/dist/core/code-structure.js +399 -11
  15. package/dist/core/codex-control/codex-fake-sdk-adapter.js +67 -9
  16. package/dist/core/codex-control/gpt-final-arbiter.js +4 -1
  17. package/dist/core/codex-control/gpt-final-review-schema.js +58 -0
  18. package/dist/core/codex-native/core-skill-manifest.js +23 -0
  19. package/dist/core/commands/bench-command.js +11 -2
  20. package/dist/core/commands/code-structure-command.js +34 -2
  21. package/dist/core/commands/run-command.js +92 -2
  22. package/dist/core/commands/seo-command.js +130 -0
  23. package/dist/core/feature-fixtures.js +6 -0
  24. package/dist/core/feature-registry.js +3 -1
  25. package/dist/core/fsx.js +1 -1
  26. package/dist/core/hooks-runtime.js +8 -0
  27. package/dist/core/init.js +8 -6
  28. package/dist/core/lean-engineering-policy.js +159 -0
  29. package/dist/core/pipeline-internals/runtime-core.js +15 -5
  30. package/dist/core/proof/auto-finalize.js +3 -2
  31. package/dist/core/proof/proof-schema.js +2 -1
  32. package/dist/core/proof/proof-writer.js +1 -0
  33. package/dist/core/proof/route-adapter.js +4 -2
  34. package/dist/core/proof/route-finalizer.js +35 -3
  35. package/dist/core/release-parallel-full-coverage.js +1 -1
  36. package/dist/core/routes.js +77 -10
  37. package/dist/core/search-visibility/adapter-registry.js +26 -0
  38. package/dist/core/search-visibility/adapters/next-app.js +6 -0
  39. package/dist/core/search-visibility/adapters/next-pages.js +6 -0
  40. package/dist/core/search-visibility/adapters/static-site.js +6 -0
  41. package/dist/core/search-visibility/analyzers.js +377 -0
  42. package/dist/core/search-visibility/artifacts.js +183 -0
  43. package/dist/core/search-visibility/discovery.js +347 -0
  44. package/dist/core/search-visibility/index.js +199 -0
  45. package/dist/core/search-visibility/mission.js +67 -0
  46. package/dist/core/search-visibility/mutation.js +314 -0
  47. package/dist/core/search-visibility/types.js +2 -0
  48. package/dist/core/search-visibility/verifier.js +60 -0
  49. package/dist/core/source-intelligence/source-intelligence-policy.js +45 -26
  50. package/dist/core/source-intelligence/source-intelligence-proof.js +10 -16
  51. package/dist/core/source-intelligence/source-intelligence-runner.js +56 -42
  52. package/dist/core/trust-kernel/trust-report.js +3 -5
  53. package/dist/core/ultra-search/index.js +3 -0
  54. package/dist/core/ultra-search/runtime.js +502 -0
  55. package/dist/core/ultra-search/types.js +3 -0
  56. package/dist/core/version.js +1 -1
  57. package/dist/scripts/agent-visual-consistency-check.js +1 -1
  58. package/dist/scripts/check-architecture.js +40 -7
  59. package/dist/scripts/check-command-module-budget.js +43 -5
  60. package/dist/scripts/check-pipeline-budget.js +17 -30
  61. package/dist/scripts/check-publish-tag.js +33 -6
  62. package/dist/scripts/check-route-modularity.js +25 -33
  63. package/dist/scripts/check-runtime-schemas.js +22 -0
  64. package/dist/scripts/core-skill-immutable-sync-check.js +3 -2
  65. package/dist/scripts/core-skill-integrity-blackbox.js +3 -2
  66. package/dist/scripts/core-skill-manifest-check.js +7 -2
  67. package/dist/scripts/geo-claim-evidence-check.js +18 -0
  68. package/dist/scripts/geo-cli-blackbox-check.js +18 -0
  69. package/dist/scripts/geo-crawler-policy-check.js +16 -0
  70. package/dist/scripts/geo-llms-txt-optional-check.js +19 -0
  71. package/dist/scripts/gpt-final-arbiter-check.js +4 -1
  72. package/dist/scripts/release-metadata-1-19-check.js +2 -2
  73. package/dist/scripts/release-parallel-check.js +17 -2
  74. package/dist/scripts/release-parallel-full-coverage-check.js +1 -1
  75. package/dist/scripts/release-readiness-report.js +6 -6
  76. package/dist/scripts/release-registry-check.js +33 -14
  77. package/dist/scripts/search-visibility-gate-lib.js +124 -0
  78. package/dist/scripts/seo-audit-fixture-check.js +16 -0
  79. package/dist/scripts/seo-canonical-locale-check.js +19 -0
  80. package/dist/scripts/seo-cli-blackbox-check.js +18 -0
  81. package/dist/scripts/seo-geo-feature-fixture-quality-check.js +18 -0
  82. package/dist/scripts/seo-geo-geo-disambiguation-check.js +12 -0
  83. package/dist/scripts/seo-geo-no-unsupported-ranking-claims-check.js +18 -0
  84. package/dist/scripts/seo-geo-route-identity-check.js +12 -0
  85. package/dist/scripts/seo-geo-skill-rich-content-check.js +22 -0
  86. package/dist/scripts/seo-mutation-rollback-check.js +23 -0
  87. package/dist/scripts/seo-no-mutation-by-default-check.js +17 -0
  88. package/dist/scripts/seo-structured-data-visible-content-check.js +19 -0
  89. package/dist/scripts/sks-1-18-gate-lib.js +2 -2
  90. package/dist/scripts/sks-3-1-5-directive-check-lib.js +10 -1
  91. package/dist/scripts/source-intelligence-all-modes-check.js +9 -19
  92. package/dist/scripts/source-intelligence-policy-check.js +6 -6
  93. package/dist/scripts/ultra-search-provider-interface-check.js +27 -0
  94. package/package.json +21 -3
  95. package/schemas/search-visibility/finding-ledger.schema.json +36 -0
  96. package/schemas/search-visibility/gate.schema.json +22 -0
  97. package/schemas/search-visibility/mutation-plan.schema.json +27 -0
  98. package/schemas/search-visibility/site-inventory.schema.json +21 -0
  99. package/schemas/search-visibility/verification-report.schema.json +23 -0
  100. package/dist/core/mcp/xai-mcp-detector.js +0 -157
  101. package/dist/core/mcp/xai-search-adapter.js +0 -100
  102. package/dist/scripts/xai-mcp-capability-check.js +0 -14
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- // @ts-nocheck
3
2
  import fs from 'node:fs';
4
3
  import path from 'node:path';
5
4
  const root = process.cwd();
@@ -8,6 +7,19 @@ const facade = path.join(root, 'src', 'core', 'pipeline.ts');
8
7
  const facadeLines = lineCount(facade);
9
8
  if (facadeLines > 200)
10
9
  failures.push(`src/core/pipeline.ts: line count ${facadeLines} > 200`);
10
+ const facadeText = fs.readFileSync(facade, 'utf8');
11
+ for (const exportName of [
12
+ 'buildPipelinePlan',
13
+ 'writePipelinePlan',
14
+ 'validatePipelinePlan',
15
+ 'promptPipelineContext',
16
+ 'prepareRoute',
17
+ 'activeRouteContext',
18
+ 'evaluateStop'
19
+ ]) {
20
+ if (!facadeText.includes(exportName))
21
+ failures.push(`src/core/pipeline.ts: missing exported pipeline API ${exportName}`);
22
+ }
11
23
  const runtimeFacade = path.join(root, 'src', 'core', 'pipeline-runtime.ts');
12
24
  if (fs.existsSync(runtimeFacade)) {
13
25
  const runtimeLines = lineCount(runtimeFacade);
@@ -19,7 +31,10 @@ if (fs.existsSync(runtimeFacade)) {
19
31
  }
20
32
  }
21
33
  const moduleDir = path.join(root, 'src', 'core', 'pipeline');
22
- for (const file of fs.readdirSync(moduleDir).filter((name) => name.endsWith('.ts'))) {
34
+ const moduleFiles = fs.readdirSync(moduleDir).filter((name) => name.endsWith('.ts'));
35
+ if (moduleFiles.length < 8)
36
+ failures.push(`src/core/pipeline: split module count ${moduleFiles.length} < 8`);
37
+ for (const file of moduleFiles) {
23
38
  const absolute = path.join(moduleDir, file);
24
39
  const lines = lineCount(absolute);
25
40
  if (lines > 1000)
@@ -28,34 +43,6 @@ for (const file of fs.readdirSync(moduleDir).filter((name) => name.endsWith('.ts
28
43
  if (imports.length > 35)
29
44
  failures.push(`src/core/pipeline/${file}: import count ${imports.length} > 35`);
30
45
  }
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
46
  if (failures.length) {
60
47
  console.error('Pipeline budget check failed:');
61
48
  for (const failure of failures)
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- // @ts-nocheck
3
2
  import fs from 'node:fs';
4
3
  import path from 'node:path';
5
4
  import { fileURLToPath } from 'node:url';
@@ -10,21 +9,49 @@ const isPrerelease = version.includes('-');
10
9
  const publishLifecycle = process.env.npm_lifecycle_event === 'prepublishOnly';
11
10
  const npmTag = process.env.npm_config_tag || process.env.NPM_CONFIG_TAG || '';
12
11
  const publishConfigTag = pkg.publishConfig?.tag || '';
12
+ const npmrcTag = readRootNpmrcTag();
13
13
  const configuredTag = publishLifecycle && (!npmTag || npmTag === 'latest')
14
- ? (publishConfigTag || npmTag || 'latest')
15
- : (npmTag || publishConfigTag || 'latest');
16
- const expectedTag = isPrerelease ? 'rc' : 'latest';
14
+ ? (npmrcTag || publishConfigTag || npmTag || 'latest')
15
+ : (npmTag || npmrcTag || publishConfigTag || 'latest');
16
+ const isBackfill = !isPrerelease && /^backfill(?:[-_][a-z0-9.-]+)?$/i.test(configuredTag);
17
+ const expectedTag = isPrerelease ? 'rc' : isBackfill ? configuredTag : 'latest';
18
+ if (publishConfigTag && npmrcTag && publishConfigTag !== npmrcTag) {
19
+ console.error('package.json publishConfig.tag and root .npmrc tag disagree.');
20
+ console.error(`publishConfig.tag: ${publishConfigTag}`);
21
+ console.error(`.npmrc tag: ${npmrcTag}`);
22
+ process.exit(2);
23
+ }
24
+ if (publishConfigTag && /^backfill(?:[-_][a-z0-9.-]+)?$/i.test(publishConfigTag) && !npmrcTag && !npmTag) {
25
+ console.error('Backfill releases must set root .npmrc tag so `npm publish --ignore-scripts` does not use latest.');
26
+ console.error(`Expected .npmrc: tag=${publishConfigTag}`);
27
+ process.exit(2);
28
+ }
17
29
  if (configuredTag !== expectedTag) {
18
30
  if (isPrerelease) {
19
31
  console.error(`Prerelease ${pkg.name}@${version} must be published with the rc dist-tag.`);
20
32
  console.error('Set package.json publishConfig.tag to rc or pass `--tag rc` to npm publish.');
21
33
  }
22
34
  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`.');
35
+ console.error(`Stable release ${pkg.name}@${version} must be published with the latest dist-tag unless it is an explicit backfill.`);
36
+ console.error('Use latest for forward releases, or a backfill-* publishConfig.tag for intentional unpublished lower-version backfills.');
25
37
  }
26
38
  console.error(`Current npm tag config: ${configuredTag || 'missing'}`);
27
39
  process.exit(2);
28
40
  }
29
41
  console.log(`Publish tag check passed: ${pkg.name}@${version} -> ${configuredTag}`);
42
+ function readRootNpmrcTag() {
43
+ const npmrcPath = path.join(root, '.npmrc');
44
+ if (!fs.existsSync(npmrcPath))
45
+ return '';
46
+ const text = fs.readFileSync(npmrcPath, 'utf8');
47
+ for (const line of text.split(/\r?\n/)) {
48
+ const trimmed = line.trim();
49
+ if (!trimmed || trimmed.startsWith('#') || trimmed.startsWith(';'))
50
+ continue;
51
+ const match = trimmed.match(/^tag\s*=\s*(.+)$/);
52
+ if (match)
53
+ return String(match[1] || '').trim();
54
+ }
55
+ return '';
56
+ }
30
57
  //# sourceMappingURL=check-publish-tag.js.map
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- // @ts-nocheck
3
2
  import fs from 'node:fs';
4
3
  import path from 'node:path';
5
4
  const root = process.cwd();
@@ -7,37 +6,23 @@ const failures = [];
7
6
  const routeCli = path.join(root, 'src', 'core', 'commands', 'route-cli.mjs');
8
7
  if (fs.existsSync(routeCli))
9
8
  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`);
9
+ const legacyCommandsDir = path.join(root, 'src', 'commands');
10
+ if (fs.existsSync(legacyCommandsDir)) {
11
+ for (const file of listFiles(legacyCommandsDir, '.mjs')) {
12
+ const text = fs.readFileSync(file, 'utf8');
13
+ if (text.includes('route-cli.mjs'))
14
+ failures.push(`${rel(file)} imports route-cli.mjs`);
15
+ }
14
16
  }
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}`);
17
+ for (const relModule of registeredCommandModules()) {
18
+ if (!fs.existsSync(path.join(root, relModule)))
19
+ failures.push(`registered command module missing: ${relModule}`);
35
20
  }
36
21
  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']
22
+ 'qa-loop-command.ts': ['research-command', 'ppt-command', 'team-command', 'gx-command'],
23
+ 'research-command.ts': ['qa-loop-command', 'ppt-command', 'team-command', 'gx-command'],
24
+ 'db-command.ts': ['image-ux-review-command', 'ppt-command', 'computer-use-command'],
25
+ 'wiki-command.ts': ['team-command', 'research-command', 'qa-loop-command', 'ppt-command']
41
26
  };
42
27
  for (const [name, needles] of Object.entries(disallowedImports)) {
43
28
  const file = commandModulePath(name);
@@ -56,6 +41,16 @@ if (failures.length) {
56
41
  process.exit(1);
57
42
  }
58
43
  console.log('Route modularity check passed');
44
+ function registeredCommandModules() {
45
+ const registry = fs.readFileSync(path.join(root, 'src', 'cli', 'command-registry.ts'), 'utf8');
46
+ const out = new Set();
47
+ for (const match of registry.matchAll(/['"]dist\/core\/commands\/([^'"]+)\.js['"]/g)) {
48
+ const stem = match[1];
49
+ if (stem)
50
+ out.add(`src/core/commands/${stem}.ts`);
51
+ }
52
+ return [...out].sort();
53
+ }
59
54
  function listFiles(dir, ext) {
60
55
  const out = [];
61
56
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
@@ -72,11 +67,8 @@ function rel(file) {
72
67
  }
73
68
  function commandModulePath(name) {
74
69
  const base = path.join(root, 'src', 'core', 'commands');
75
- const mjs = path.join(base, name);
70
+ const mjs = path.join(base, name.replace(/\.ts$/, '.mjs'));
76
71
  const ts = path.join(base, name.replace(/\.mjs$/, '.ts'));
77
72
  return fs.existsSync(mjs) ? mjs : ts;
78
73
  }
79
- function commandModuleExists(name) {
80
- return fs.existsSync(commandModulePath(name));
81
- }
82
74
  //# sourceMappingURL=check-route-modularity.js.map
@@ -80,6 +80,28 @@ for (const file of [
80
80
  issues.push(`codex_schema_invalid_json:${file}:${err.message}`);
81
81
  }
82
82
  }
83
+ const searchVisibilitySchemaDir = path.join(root, 'schemas', 'search-visibility');
84
+ for (const file of [
85
+ 'site-inventory.schema.json',
86
+ 'finding-ledger.schema.json',
87
+ 'gate.schema.json',
88
+ 'mutation-plan.schema.json',
89
+ 'verification-report.schema.json'
90
+ ]) {
91
+ const full = path.join(searchVisibilitySchemaDir, file);
92
+ if (!fs.existsSync(full)) {
93
+ issues.push(`search_visibility_schema_missing:${file}`);
94
+ continue;
95
+ }
96
+ try {
97
+ const parsed = JSON.parse(fs.readFileSync(full, 'utf8'));
98
+ if (parsed.type !== 'object' || !parsed.$id)
99
+ issues.push(`search_visibility_schema_shape:${file}`);
100
+ }
101
+ catch (err) {
102
+ issues.push(`search_visibility_schema_invalid_json:${file}:${err.message}`);
103
+ }
104
+ }
83
105
  const result = { schema: 'sks.runtime-schema-check.v1', ok: issues.length === 0, validators_ok: validatorsOk, issues };
84
106
  console.log(JSON.stringify(result, null, 2));
85
107
  if (!result.ok)
@@ -3,11 +3,12 @@ import fs from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { assertGate, emitGate, makeTempRoot, writeText } from './sks-3-1-8-check-lib.js';
5
5
  import { syncCoreSkillsIntegrity } from '../core/codex-native/core-skill-integrity.js';
6
- import { renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
6
+ import { buildSksCoreSkillManifest, renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
7
7
  const root = await makeTempRoot('sks-core-immutable-');
8
8
  const skillsRoot = path.join(root, '.agents', 'skills');
9
+ const expectedSkillCount = buildSksCoreSkillManifest('1970-01-01T00:00:00.000Z').skills.length;
9
10
  const first = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
10
- assertGate(first.installed.length === 8, 'first immutable sync must install missing managed core skills', first);
11
+ assertGate(first.installed.length === expectedSkillCount, 'first immutable sync must install missing managed core skills', first);
11
12
  const second = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
12
13
  assertGate(second.installed.length === 0 && second.restored.length === 0, 'second immutable sync must be idempotent', second);
13
14
  await writeText(path.join(skillsRoot, 'loop', 'SKILL.md'), `${renderCoreSkillTemplate('loop')}\ncorruption\n`);
@@ -3,10 +3,11 @@ import fs from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { assertGate, emitGate, makeTempRoot, writeText, writeUserSkill } from './sks-3-1-8-check-lib.js';
5
5
  import { syncCoreSkillsIntegrity } from '../core/codex-native/core-skill-integrity.js';
6
- import { renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
6
+ import { buildSksCoreSkillManifest, renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
7
7
  import { initProject } from '../core/init.js';
8
8
  const root = await makeTempRoot('sks-core-blackbox-');
9
9
  const skillsRoot = path.join(root, '.agents', 'skills');
10
+ const expectedSkillCount = buildSksCoreSkillManifest('1970-01-01T00:00:00.000Z').skills.length;
10
11
  const first = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
11
12
  const second = await syncCoreSkillsIntegrity({ root, apply: true, skillsRoot });
12
13
  await writeText(path.join(skillsRoot, 'research', 'SKILL.md'), `${renderCoreSkillTemplate('research')}\nmutated\n`);
@@ -21,7 +22,7 @@ const setupIntegrity = await syncCoreSkillsIntegrity({ root: setupRoot, apply: f
21
22
  await writeText(path.join(setupRoot, '.agents', 'skills', 'loop', 'SKILL.md'), `${renderCoreSkillTemplate('loop')}\nmutated by setup blackbox\n`);
22
23
  const setupRestore = await initProject(setupRoot, { force: true, installScope: 'project', localOnly: true, globalCommand: 'sks' });
23
24
  const restoredSetupText = await fs.readFile(path.join(setupRoot, '.agents', 'skills', 'loop', 'SKILL.md'), 'utf8');
24
- assertGate(first.installed.length === 8, 'blackbox A: first sync installs missing core skills', first);
25
+ assertGate(first.installed.length === expectedSkillCount, 'blackbox A: first sync installs missing core skills', first);
25
26
  assertGate(second.installed.length === 0 && second.restored.length === 0, 'blackbox B: second sync changes nothing', second);
26
27
  assertGate(third.restored.length === 1 && restoredText === renderCoreSkillTemplate('research'), 'blackbox C: managed drift restored exactly', third);
27
28
  assertGate(user.skipped_user_authored.length === 1, 'blackbox D: user skill is not overwritten', user);
@@ -1,10 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { assertGate, emitGate } from './sks-3-1-8-check-lib.js';
3
- import { CORE_SKILL_TEMPLATE_VERSION, buildSksCoreSkillManifest, renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
3
+ import { CORE_SKILL_TEMPLATE_VERSION, buildSksCoreSkillManifest, coreSkillDefinitions, renderCoreSkillTemplate } from '../core/codex-native/core-skill-manifest.js';
4
4
  import { sha256 } from '../core/fsx.js';
5
5
  const manifest = buildSksCoreSkillManifest('1970-01-01T00:00:00.000Z');
6
+ const definitions = coreSkillDefinitions();
6
7
  assertGate(manifest.schema === 'sks.core-skill-manifest.v1', 'manifest schema mismatch', manifest);
7
- assertGate(manifest.skills.length === 8, 'manifest must list eight immutable core skills', manifest.skills.map((skill) => skill.canonical_name));
8
+ assertGate(manifest.skills.length === definitions.length, 'manifest must list every immutable core skill definition', {
9
+ manifest: manifest.skills.map((skill) => skill.canonical_name),
10
+ definitions: definitions.map((skill) => skill.canonical_name)
11
+ });
12
+ assertGate(new Set(manifest.skills.map((skill) => skill.canonical_name)).size === manifest.skills.length, 'manifest core skill names must be unique', manifest.skills.map((skill) => skill.canonical_name));
8
13
  assertGate(CORE_SKILL_TEMPLATE_VERSION === 'sks-core-skill-template.v1', 'core skill template version must be content-schema based, not package-version based', { CORE_SKILL_TEMPLATE_VERSION });
9
14
  for (const skill of manifest.skills) {
10
15
  const content = renderCoreSkillTemplate(skill.canonical_name);
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import { assertGate, assertMissionArtifact, emitGate, makeSearchVisibilityFixture, runSksJson } from './search-visibility-gate-lib.js';
6
+ const fixture = makeSearchVisibilityFixture('geo-claims', {
7
+ title: 'Fixture That Guarantees AI Citation',
8
+ description: 'Fixture that guarantees AI citation and traffic lift.',
9
+ });
10
+ fs.appendFileSync(path.join(fixture, 'README.md'), '\nThis fixture guarantees AI citation and traffic lift.\n');
11
+ const audit = runSksJson(['seo-geo-optimizer', 'audit', '--mode', 'geo', '--root', fixture, '--target', 'package', '--offline', '--json'], { allowFailure: true }).json;
12
+ const claims = assertMissionArtifact(audit.mission_id, 'claim-evidence-ledger.json', fixture);
13
+ const findings = assertMissionArtifact(audit.mission_id, 'geo-findings.json', fixture);
14
+ assertGate(claims.claims.some((claim) => claim.safe_to_publish === false && /citation|traffic/i.test(claim.claim)), 'unsupported GEO claim must be unsafe to publish', claims);
15
+ assertGate(findings.findings.some((finding) => finding.category === 'claim-evidence' && finding.severity === 'critical'), 'unsafe claim must become critical claim-evidence finding', findings);
16
+ assertGate(audit.ok === false || findings.findings.some((finding) => finding.blocking), 'critical unsafe claims must block the gate', { audit, findings });
17
+ emitGate('geo:claim-evidence', { mission_id: audit.mission_id, claims: claims.claims.length });
18
+ //# sourceMappingURL=geo-claim-evidence-check.js.map
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import { assertGate, emitGate, runSks, runSksJson } from './search-visibility-gate-lib.js';
4
+ const commands = runSksJson(['commands', '--json']).json;
5
+ assertGate(commands.commands.some((row) => row.name === 'seo-geo-optimizer' && /unified SEO\/GEO optimizer/i.test(row.description)), 'commands --json must expose seo-geo-optimizer');
6
+ assertGate(!commands.commands.some((row) => row.name === 'seo' || row.name === 'geo'), 'commands --json must not expose split seo/geo command surfaces');
7
+ const optimizerUsage = runSks(['usage', 'seo-geo-optimizer']);
8
+ assertGate(/sks seo-geo-optimizer \[seo\|geo\] doctor\|audit\|plan\|apply\|verify\|status\|rollback\|fixture/.test(optimizerUsage.stdout), 'usage seo-geo-optimizer must expose unified lifecycle');
9
+ const doctor = runSksJson(['seo-geo-optimizer', 'doctor', '--mode', 'geo', '--json']).json;
10
+ assertGate(doctor.route === '$SEO-GEO-OPTIMIZER' && doctor.schema === 'sks.search-visibility.doctor-command.v1', 'optimizer geo doctor must preserve unified route identity', doctor);
11
+ const invalid = runSks(['seo-geo-optimizer', 'nonsense-subcommand', '--mode', 'geo'], { allowFailure: true });
12
+ assertGate(invalid.status === 2 && /Usage: sks seo-geo-optimizer/.test(invalid.stderr), 'invalid optimizer subcommand must exit 2 with usage', {
13
+ status: invalid.status,
14
+ stdout: invalid.stdout,
15
+ stderr: invalid.stderr,
16
+ });
17
+ emitGate('geo:cli-blackbox', { adapter: doctor.adapter, confidence: doctor.confidence });
18
+ //# sourceMappingURL=geo-cli-blackbox-check.js.map
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import { assertGate, assertMissionArtifact, emitGate, makeSearchVisibilityFixture, runSksJson } from './search-visibility-gate-lib.js';
4
+ const fixture = makeSearchVisibilityFixture('geo-crawlers');
5
+ const audit = runSksJson(['seo-geo-optimizer', 'audit', '--mode', 'geo', '--root', fixture, '--target', 'package', '--offline', '--json']).json;
6
+ const policy = assertMissionArtifact(audit.mission_id, 'ai-crawler-policy.json', fixture);
7
+ const purposes = new Set(policy.entries.map((entry) => entry.purpose));
8
+ const agents = new Set(policy.entries.map((entry) => entry.userAgent));
9
+ assertGate(policy.policy.single_allow_ai_toggle === false && policy.policy.purpose_split_required === true, 'AI crawler policy must split purposes instead of one allow_ai toggle', policy);
10
+ for (const purpose of ['search', 'training', 'user_retrieval'])
11
+ assertGate(purposes.has(purpose), `crawler purpose missing: ${purpose}`, policy);
12
+ for (const agent of ['OAI-SearchBot', 'GPTBot', 'ChatGPT-User', 'Claude-SearchBot', 'ClaudeBot', 'Claude-User'])
13
+ assertGate(agents.has(agent), `crawler user agent missing: ${agent}`, policy);
14
+ assertGate(policy.entries.every((entry) => entry.officialSource && entry.observedAt && entry.expiresAt), 'crawler registry entries must carry dated official sources', policy);
15
+ emitGate('geo:crawler-purpose-policy', { mission_id: audit.mission_id, entries: policy.entries.length });
16
+ //# sourceMappingURL=geo-crawler-policy-check.js.map
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ // @ts-nocheck
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import { assertGate, assertMissionArtifact, emitGate, makeSearchVisibilityFixture, runSksJson } from './search-visibility-gate-lib.js';
6
+ const fixture = makeSearchVisibilityFixture('geo-llms');
7
+ const audit = runSksJson(['seo-geo-optimizer', 'audit', '--mode', 'geo', '--root', fixture, '--target', 'package', '--offline', '--json']).json;
8
+ const plan = runSksJson(['seo-geo-optimizer', 'plan', audit.mission_id, '--mode', 'geo', '--root', fixture, '--json']).json;
9
+ const llmsPlan = assertMissionArtifact(audit.mission_id, 'llms-txt-plan.json', fixture);
10
+ assertGate(audit.ok === true, 'missing llms.txt must not block GEO gate', audit);
11
+ assertGate(plan.operations === 0, 'GEO plan must not create llms.txt unless --include-llms-txt is explicit', plan);
12
+ assertGate(llmsPlan.required_for_gate === false && llmsPlan.experimental_assistive_surface === true, 'llms.txt must be optional and experimental', llmsPlan);
13
+ assertGate(!fs.existsSync(path.join(fixture, 'llms.txt')), 'llms.txt must not be created by default');
14
+ const explicitPlan = runSksJson(['seo-geo-optimizer', 'plan', audit.mission_id, '--mode', 'geo', '--root', fixture, '--include-llms-txt', '--json']).json;
15
+ assertGate(explicitPlan.operations === 1, 'explicit --include-llms-txt should plan managed llms.txt creation', explicitPlan);
16
+ const apply = runSksJson(['seo-geo-optimizer', 'apply', audit.mission_id, '--mode', 'geo', '--root', fixture, '--include-llms-txt', '--apply', '--json']).json;
17
+ assertGate(apply.ok === true && fs.existsSync(path.join(fixture, 'llms.txt')), 'explicit llms.txt apply must create managed file', apply);
18
+ emitGate('geo:llms-txt-optional', { mission_id: audit.mission_id });
19
+ //# sourceMappingURL=geo-llms-txt-optional-check.js.map
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- // @ts-nocheck
3
2
  import fs from 'node:fs/promises';
4
3
  import os from 'node:os';
5
4
  import path from 'node:path';
@@ -15,13 +14,17 @@ try {
15
14
  assertGate(approved.ok === true, 'GPT final arbiter fixture must approve safe candidate', approved);
16
15
  assertGate(approved.backend === 'codex-sdk', 'GPT final arbiter backend must be codex-sdk');
17
16
  assertGate(approved.result.status === 'approved', 'safe candidate must return approved');
17
+ assertGate(approved.result.lean_review?.status === 'pass', 'safe candidate must pass lean review');
18
+ assertGate(approved.result.lean_review?.selected_rung === 'minimal-custom', 'lean review must record selected rung');
18
19
  assertGate(approved.final_gate.ok === true, 'approved arbiter result must pass final gate');
19
20
  const artifact = await readJsonFile(path.join(tmp, 'gpt-final-arbiter.json'));
20
21
  assertGate(artifact.result.schema === 'sks.gpt-final-arbiter-result.v1', 'arbiter artifact must contain schema-valid result');
22
+ assertGate(artifact.result.lean_review?.verification_minimum_present === true, 'arbiter artifact must record lean verification minimum');
21
23
  const unsafeTmp = await fs.mkdtemp(path.join(os.tmpdir(), 'sks-gpt-final-arbiter-unsafe-'));
22
24
  const rejected = await mod.runGptFinalArbiter({ ...fixtureInput('unsafe'), candidate_diff: 'unsafe delete all credential patch' }, { cwd: root, mutationLedgerRoot: unsafeTmp });
23
25
  assertGate(rejected.ok === false, 'unsafe candidate must not pass final arbiter');
24
26
  assertGate(rejected.result.status === 'rejected', 'unsafe candidate must be rejected');
27
+ assertGate(rejected.result.lean_review?.status === 'rejected', 'unsafe candidate must reject lean review');
25
28
  assertGate(rejected.blockers.includes('unsafe_candidate_patch'), 'unsafe rejection blocker must be preserved');
26
29
  emitGate('local-collab:gpt-final-arbiter', { approved: approved.result.status, rejected: rejected.result.status });
27
30
  }
@@ -21,7 +21,7 @@ const requiredDocs = [
21
21
  'README.md',
22
22
  'CHANGELOG.md',
23
23
  'docs/source-intelligence-layer.md',
24
- 'docs/xai-context7-codex-web-policy.md',
24
+ 'docs/ultra-search-source-intelligence-policy.md',
25
25
  'docs/main-no-scout-worker-scout-policy.md',
26
26
  'docs/agent-terminal-lanes.md',
27
27
  'docs/migration/tmux-to-zellij.md',
@@ -97,7 +97,7 @@ const requiredScripts = [
97
97
  'agent:janitor',
98
98
  'agent:multi-project-isolation',
99
99
  'verification:parallel-engine',
100
- 'xai-mcp:capability',
100
+ 'ultra-search:provider-interface',
101
101
  'source-intelligence:policy',
102
102
  'source-intelligence:all-modes',
103
103
  'codex-web:adapter',
@@ -34,10 +34,25 @@ const tasks = [
34
34
  task('agent:janitor', 'npm run agent:janitor --silent', { dependencies: ['build'] }),
35
35
  task('agent:multi-project-isolation', 'npm run agent:multi-project-isolation --silent', { dependencies: ['build'] }),
36
36
  task('verification:parallel-engine', 'npm run verification:parallel-engine --silent', { dependencies: ['build'] }),
37
- task('xai-mcp:capability', 'npm run xai-mcp:capability --silent', { dependencies: ['build'] }),
37
+ task('ultra-search:provider-interface', 'npm run ultra-search:provider-interface --silent', { dependencies: ['build'] }),
38
38
  task('source-intelligence:policy', 'npm run source-intelligence:policy --silent', { dependencies: ['build'] }),
39
- task('source-intelligence:all-modes', 'npm run source-intelligence:all-modes --silent', { dependencies: ['build', 'source-intelligence:policy', 'xai-mcp:capability', 'codex-web:adapter'] }),
39
+ task('source-intelligence:all-modes', 'npm run source-intelligence:all-modes --silent', { dependencies: ['build', 'source-intelligence:policy', 'ultra-search:provider-interface', 'codex-web:adapter'] }),
40
40
  task('codex-web:adapter', 'npm run codex-web:adapter --silent', { dependencies: ['build'] }),
41
+ task('seo:cli-blackbox', 'npm run seo:cli-blackbox --silent', { dependencies: ['build'] }),
42
+ task('seo:audit-fixture', 'npm run seo:audit-fixture --silent', { dependencies: ['build'] }),
43
+ task('seo:no-mutation-by-default', 'npm run seo:no-mutation-by-default --silent', { dependencies: ['build'] }),
44
+ task('seo:mutation-rollback', 'npm run seo:mutation-rollback --silent', { dependencies: ['build'] }),
45
+ task('seo:canonical-sitemap-locale', 'npm run seo:canonical-sitemap-locale --silent', { dependencies: ['build'] }),
46
+ task('seo:structured-data-visible-content', 'npm run seo:structured-data-visible-content --silent', { dependencies: ['build'] }),
47
+ task('geo:cli-blackbox', 'npm run geo:cli-blackbox --silent', { dependencies: ['build'] }),
48
+ task('geo:claim-evidence', 'npm run geo:claim-evidence --silent', { dependencies: ['build'] }),
49
+ task('geo:crawler-purpose-policy', 'npm run geo:crawler-purpose-policy --silent', { dependencies: ['build'] }),
50
+ task('geo:llms-txt-optional', 'npm run geo:llms-txt-optional --silent', { dependencies: ['build'] }),
51
+ task('seo-geo:route-identity', 'npm run seo-geo:route-identity --silent', { dependencies: ['build'] }),
52
+ task('seo-geo:geo-disambiguation', 'npm run seo-geo:geo-disambiguation --silent', { dependencies: ['build'] }),
53
+ task('seo-geo:skill-rich-content', 'npm run seo-geo:skill-rich-content --silent', { dependencies: ['build'] }),
54
+ task('seo-geo:no-unsupported-ranking-claims', 'npm run seo-geo:no-unsupported-ranking-claims --silent', { dependencies: ['build'] }),
55
+ task('seo-geo:feature-fixture-quality', 'npm run seo-geo:feature-fixture-quality --silent', { dependencies: ['build'] }),
41
56
  task('doctor:codex-doctor-parity', 'npm run doctor:codex-doctor-parity --silent', { dependencies: ['build'] }),
42
57
  task('codex:permission-profiles', 'npm run codex:permission-profiles --silent', { dependencies: ['build'] }),
43
58
  task('codex:legacy-profile-consumers-removed', 'npm run codex:legacy-profile-consumers-removed --silent', { dependencies: ['build'] }),
@@ -6,7 +6,7 @@ import { assertGate, emitGate, importDist, packageScripts, root } from './sks-1-
6
6
  const mod = await importDist('core/release-parallel-full-coverage.js');
7
7
  const pkgScripts = packageScripts();
8
8
  const parallelSource = fs.readFileSync(path.join(root, 'src/scripts/release-parallel-check.ts'), 'utf8');
9
- const current = [...new Set(Object.keys(pkgScripts).filter((name) => parallelSource.includes(name)).concat(Object.keys(pkgScripts).filter((name) => /^xai-mcp|^source-intelligence|^codex-web|^goal-mode|^agent:main-no-scout|^agent:worker-scout-limited|^agent:background-terminals|^agent:zellij-runtime|^agent:visual-consistency|^release:parallel-full-coverage|^priority:full-closure/.test(name))))];
9
+ const current = [...new Set(Object.keys(pkgScripts).filter((name) => parallelSource.includes(name)).concat(Object.keys(pkgScripts).filter((name) => /^ultra-search|^source-intelligence|^codex-web|^goal-mode|^agent:main-no-scout|^agent:worker-scout-limited|^agent:background-terminals|^agent:zellij-runtime|^agent:visual-consistency|^release:parallel-full-coverage|^priority:full-closure/.test(name))))];
10
10
  const report = mod.evaluateReleaseParallelFullCoverage(current);
11
11
  assertGate(report.ok === true, 'release parallel DAG must preserve previous gates and include 1.18 gates', report);
12
12
  emitGate('release:parallel-full-coverage', { previous_gate_count: report.previous_gate_count, current_gate_count: report.current_gate_count });
@@ -103,7 +103,7 @@ const checks = {
103
103
  computer_use_live_evidence: scriptContains('release:check', 'computer-use:live-evidence'),
104
104
  docs_truthfulness: scriptContains('release:check', 'docs:truthfulness'),
105
105
  release_readiness: scriptContains('release:check:parallel', 'release:readiness'),
106
- xai_mcp_capability: scriptContains('release:check:parallel', 'xai-mcp:capability'),
106
+ ultra_search_provider_interface: scriptContains('release:check:parallel', 'ultra-search:provider-interface'),
107
107
  source_intelligence_policy: scriptContains('release:check:parallel', 'source-intelligence:policy'),
108
108
  source_intelligence_all_modes: scriptContains('release:check:parallel', 'source-intelligence:all-modes'),
109
109
  codex_web_adapter: scriptContains('release:check:parallel', 'codex-web:adapter'),
@@ -318,7 +318,7 @@ for (const [name, ok] of Object.entries({
318
318
  verification_parallel_engine: checks.verification_parallel_engine,
319
319
  release_metadata: checks.release_metadata,
320
320
  release_readiness: checks.release_readiness,
321
- xai_mcp_capability: checks.xai_mcp_capability,
321
+ ultra_search_provider_interface: checks.ultra_search_provider_interface,
322
322
  source_intelligence_policy: checks.source_intelligence_policy,
323
323
  source_intelligence_all_modes: checks.source_intelligence_all_modes,
324
324
  codex_web_adapter: checks.codex_web_adapter,
@@ -809,13 +809,13 @@ const report = {
809
809
  flagship_proof_graph_v4_report_ok: runtimeChecks.flagship_proof_graph_v4
810
810
  },
811
811
  source_intelligence_1_18: {
812
- status: checks.xai_mcp_capability
812
+ status: checks.ultra_search_provider_interface
813
813
  && checks.source_intelligence_policy
814
814
  && checks.source_intelligence_all_modes
815
815
  && checks.codex_web_adapter ? 'present' : 'missing',
816
- mode_default: 'context7_codex_web',
817
- xai_when_available: checks.xai_mcp_capability,
818
- xai_missing_fallback: checks.source_intelligence_all_modes,
816
+ mode_default: 'ultra_balanced',
817
+ x_search_public_discovery: checks.ultra_search_provider_interface,
818
+ no_xai_runtime_dependency: checks.source_intelligence_all_modes,
819
819
  codex_web_adapter: checks.codex_web_adapter
820
820
  },
821
821
  agent_terminal_zellij_1_18: {