sneakoscope 5.7.0 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/config/competitor-scorecard-baseline.json +97 -0
- package/config/perf-budgets.v1.json +10 -0
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/bin/sks.js +61 -1
- package/dist/cli/command-registry.js +2 -3
- package/dist/cli/commands-fast.js +20 -0
- package/dist/cli/root-fast.js +48 -0
- package/dist/cli/router.js +3 -0
- package/dist/cli/super-search-command.js +221 -0
- package/dist/cli/xai-command.js +7 -7
- package/dist/commands/doctor.js +56 -24
- package/dist/config/skills-manifest.json +63 -70
- package/dist/core/agents/agent-codex-cockpit.js +3 -3
- package/dist/core/agents/agent-orchestrator.js +20 -2
- package/dist/core/agents/agent-wrongness.js +1 -1
- package/dist/core/agents/native-cli-session-swarm.js +14 -1
- package/dist/core/agents/parallel-runtime-proof.js +82 -8
- package/dist/core/agents/parallel-write-fixture.js +301 -0
- package/dist/core/commands/gc-command.js +12 -6
- package/dist/core/commands/run-command.js +20 -18
- package/dist/core/doctor/doctor-idempotence.js +93 -0
- package/dist/core/errors/blocker-humanizer.js +13 -0
- package/dist/core/errors/next-action-map.js +56 -0
- package/dist/core/feature-fixtures.js +15 -8
- package/dist/core/fsx.js +1 -1
- package/dist/core/init/skills.js +1 -2
- package/dist/core/install/installed-package-smoke.js +121 -0
- package/dist/core/mission.js +41 -15
- package/dist/core/naruto/naruto-active-pool.js +6 -2
- package/dist/core/perf/perf-budget.js +145 -0
- package/dist/core/quality/competitor-scorecard.js +116 -0
- package/dist/core/release/gate-timing.js +103 -0
- package/dist/core/release-parallel-full-coverage.js +1 -1
- package/dist/core/retention/retention-budget.js +62 -0
- package/dist/core/retention.js +1 -1
- package/dist/core/routes/constants.js +2 -2
- package/dist/core/routes.js +155 -53
- package/dist/core/source-intelligence/source-intelligence-policy.js +5 -5
- package/dist/core/source-intelligence/source-intelligence-proof.js +8 -8
- package/dist/core/source-intelligence/source-intelligence-runner.js +16 -16
- package/dist/core/strategy/strategy-gate.js +2 -1
- package/dist/core/super-search/doctor.js +63 -0
- package/dist/core/super-search/runtime-helpers.js +289 -0
- package/dist/core/super-search/runtime.js +270 -0
- package/dist/core/super-search/source-records.js +96 -0
- package/dist/core/super-search/types.js +3 -0
- package/dist/core/trust-kernel/trust-report.js +3 -3
- package/dist/core/verification/real-evidence-policy.js +55 -0
- package/dist/core/version.js +1 -1
- package/dist/scripts/agent-fast-mode-default-check.js +10 -1
- package/dist/scripts/agent-visual-consistency-check.js +1 -1
- package/dist/scripts/check-architecture.js +0 -1
- package/dist/scripts/competitor-scorecard-check.js +25 -0
- package/dist/scripts/doctor-idempotence-check.js +8 -0
- package/dist/scripts/gate-timing-check.js +8 -0
- package/dist/scripts/hook-latency-quantum-check.js +122 -0
- package/dist/scripts/installed-package-smoke-check.js +12 -0
- package/dist/scripts/lib/native-cli-session-swarm-check-lib.js +2 -0
- package/dist/scripts/mutation-callsite-coverage-check.js +7 -0
- package/dist/scripts/package-published-contract-check.js +7 -0
- package/dist/scripts/packlist-performance-check.js +31 -3
- package/dist/scripts/parallel-production-smoke-check.js +21 -0
- package/dist/scripts/perf-budget-check.js +14 -0
- package/dist/scripts/quantum-baseline-report.js +38 -0
- package/dist/scripts/release-check-stamp.js +117 -16
- package/dist/scripts/release-metadata-1-19-check.js +2 -2
- package/dist/scripts/release-parallel-check.js +2 -2
- package/dist/scripts/release-parallel-full-coverage-check.js +1 -1
- package/dist/scripts/retention-budget-check.js +8 -0
- package/dist/scripts/route-intent-regression-check.js +44 -0
- package/dist/scripts/sks-1-18-gate-lib.js +2 -2
- package/dist/scripts/source-intelligence-all-modes-check.js +2 -2
- package/dist/scripts/source-intelligence-policy-check.js +1 -1
- package/dist/scripts/super-search-live-smoke-check.js +70 -0
- package/dist/scripts/super-search-name-guard-check.js +98 -0
- package/dist/scripts/super-search-offline-contract-check.js +45 -0
- package/dist/scripts/{ultra-search-provider-interface-check.js → super-search-provider-interface-check.js} +9 -9
- package/dist/scripts/trust-fixture-check.js +19 -6
- package/package.json +26 -8
- package/schemas/agents/parallel-runtime-proof.schema.json +17 -1
- package/dist/cli/insane-search-command.js +0 -195
- package/dist/core/ultra-search/runtime.js +0 -502
- package/dist/core/ultra-search/types.js +0 -3
- package/dist/scripts/release-readiness-report.js +0 -1262
- /package/dist/core/{ultra-search → super-search}/index.js +0 -0
package/dist/core/routes.js
CHANGED
|
@@ -408,19 +408,19 @@ export const ROUTES = [
|
|
|
408
408
|
examples: ['$Research investigate this idea']
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
|
-
id: '
|
|
412
|
-
command: '$
|
|
413
|
-
mode: '
|
|
411
|
+
id: 'SuperSearch',
|
|
412
|
+
command: '$Super-Search',
|
|
413
|
+
mode: 'SUPER_SEARCH',
|
|
414
414
|
route: 'provider-independent source intelligence',
|
|
415
|
-
description: 'Run
|
|
416
|
-
requiredSkills: ['
|
|
417
|
-
|
|
418
|
-
lifecycle: ['source_intent', 'query_variants', 'provider_plan', 'source_ledgers', 'claim_ledgers', '
|
|
415
|
+
description: 'Run Super-Search source acquisition, source normalization, claim/proof ledgers, and provider-independent citation evidence without requiring xAI/Grok.',
|
|
416
|
+
requiredSkills: ['super-search', 'pipeline-runner', 'context7-docs', 'honest-mode'],
|
|
417
|
+
appSkillAliases: ['super-search'],
|
|
418
|
+
lifecycle: ['source_intent', 'query_variants', 'provider_plan', 'source_ledgers', 'claim_ledgers', 'super_search_gate', 'honest_mode'],
|
|
419
419
|
context7Policy: 'if_external_docs',
|
|
420
420
|
reasoningPolicy: 'high',
|
|
421
|
-
stopGate: '
|
|
422
|
-
cliEntrypoint: 'sks
|
|
423
|
-
examples: ['$
|
|
421
|
+
stopGate: 'super-search/super-search-gate.json',
|
|
422
|
+
cliEntrypoint: 'sks super-search doctor|run|x|fetch|status|inspect|sources|claims|cache|bench',
|
|
423
|
+
examples: ['$Super-Search run "current package release notes"', '$Super-Search x "site:x.com product launch"']
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
id: 'SEOGEOOptimizer',
|
|
@@ -599,9 +599,8 @@ export const COMMAND_CATALOG = [
|
|
|
599
599
|
{ name: 'image-ux-review', usage: 'sks ux-review run --image <path> --fix --json | sks image-ux-review status <mission-id|latest> [--json]', description: 'Run or inspect $Image-UX-Review gpt-image-2/imagegen annotated UI/UX review artifacts, issue ledgers, safe fix loops, recapture, and proof gates.' },
|
|
600
600
|
{ name: 'computer-use', usage: 'sks computer-use import|status|smoke|require ... [--json]', description: 'Record native Mac/non-web Computer Use visual evidence while keeping web verification on the Chrome Extension path.' },
|
|
601
601
|
{ name: 'context7', usage: 'sks context7 check|setup|tools|resolve|docs|evidence ...', description: 'Check, configure, and call the local Context7 MCP requirement.' },
|
|
602
|
-
{ name: '
|
|
603
|
-
{ name: '
|
|
604
|
-
{ name: 'xai', usage: 'sks xai check|status|docs', description: 'Deprecated compatibility notice; use sks insane-search.' },
|
|
602
|
+
{ name: 'super-search', usage: 'sks super-search doctor|run|x|fetch|status|inspect|sources|claims|cache|bench', description: 'Run Super-Search provider-independent source intelligence.' },
|
|
603
|
+
{ name: 'xai', usage: 'sks xai check|status|docs', description: 'Deprecated compatibility notice; use sks super-search.' },
|
|
605
604
|
{ name: 'recallpulse', usage: 'sks recallpulse run|status|eval|governance|checklist <mission-id|latest>', description: 'Run report-only RecallPulse active recall, durable status, proof capsule, evidence envelope, and governance checks.' },
|
|
606
605
|
{ name: 'pipeline', usage: 'sks pipeline status|resume|plan|answer ...', description: 'Inspect the active skill-first route, materialized execution plan, ambiguity gates, and completion gates.' },
|
|
607
606
|
{ name: 'guard', usage: 'sks guard check [--json]', description: 'Check SKS harness self-protection lock, fingerprints, and source-repo exception state.' },
|
|
@@ -643,7 +642,7 @@ export const COMMAND_CATALOG = [
|
|
|
643
642
|
{ name: 'gx', usage: 'sks gx init|render|validate|drift|snapshot [name]', description: 'Create and verify deterministic SVG/HTML visual context cartridges.' },
|
|
644
643
|
{ name: 'profile', usage: 'sks profile show|set <model>', description: 'Inspect or set the current SKS model profile metadata.' },
|
|
645
644
|
{ name: 'gc', usage: 'sks gc [--dry-run] [--json]', description: 'Compact oversized logs and prune stale runtime artifacts.' },
|
|
646
|
-
{ name: 'stats', usage: 'sks stats [--json]', description: 'Show package and .sneakoscope storage size.' },
|
|
645
|
+
{ name: 'stats', usage: 'sks stats [--full] [--json]', description: 'Show package and .sneakoscope storage size.' },
|
|
647
646
|
{ name: 'mcp-server', usage: 'sks mcp-server [--expose-exec] [--probe]', description: 'Run a stdio MCP server exposing SKS read-only commands as tools for any MCP-capable agent host; --expose-exec also exposes non-read-only commands; --probe round-trips initialize/tools-list and exits.' },
|
|
648
647
|
{ name: 'agent-bridge', usage: 'sks agent-bridge setup [--json]', description: 'Publish the agent-bridge manifest, print host registration snippets (generic MCP host, Codex CLI, non-interactive contract), and run a live non-interactive smoke test.' }
|
|
649
648
|
];
|
|
@@ -785,80 +784,160 @@ export function looksLikeGenerativeEngineOptimizationRequest(prompt = '') {
|
|
|
785
784
|
const text = String(prompt || '');
|
|
786
785
|
return /\b(?:GEO|generative\s+engine\s+optimization|AI\s+(?:answer|search)\s+(?:visibility|discoverability)|LLM\s+(?:citation|answer|visibility|discoverability)|answerability|entity\s+(?:facts?|clarity)|claim\s+evidence|crawler\s+policy|OAI-SearchBot|GPTBot|ChatGPT-User|Claude-SearchBot|ClaudeBot|Claude-User|llms\.txt|AI\s*검색\s*가시성|AI\s*답변\s*가시성|생성형\s*엔진\s*최적화)\b/i.test(text);
|
|
787
786
|
}
|
|
788
|
-
export function
|
|
787
|
+
export function looksLikeSuperSearchRequest(prompt = '') {
|
|
789
788
|
const text = String(prompt || '');
|
|
790
|
-
return /\b(?:
|
|
789
|
+
return /\b(?:SuperSearch|Super-Search|source\s+intelligence|provider-independent\s+source|source\s+acquisition|citation\s+proof|x-search|site:x\.com|site:twitter\.com)\b|슈퍼\s*서치|소스\s*인텔리전스/i.test(text);
|
|
791
790
|
}
|
|
792
791
|
export function routePrompt(prompt) {
|
|
793
792
|
const text = stripVisibleDecisionAnswerBlocks(prompt);
|
|
793
|
+
const intentScores = scorePromptIntent(text);
|
|
794
|
+
const select = (route) => withPromptIntentScores(route, intentScores);
|
|
794
795
|
if (/^\$?plan\b/i.test(text))
|
|
795
|
-
return routeById('Planner');
|
|
796
|
+
return select(routeById('Planner'));
|
|
796
797
|
if (/^\$?work\b/i.test(text))
|
|
797
|
-
return routeById('Naruto');
|
|
798
|
+
return select(routeById('Naruto'));
|
|
798
799
|
if (/^\$?swarm\b/i.test(text))
|
|
799
|
-
return routeById('Naruto');
|
|
800
|
+
return select(routeById('Naruto'));
|
|
800
801
|
const command = dollarCommand(text);
|
|
801
802
|
if (command) {
|
|
802
803
|
if (command === 'MAD-SKS') {
|
|
803
804
|
const afterModifier = stripMadSksSignal(text);
|
|
804
805
|
const nestedCommand = dollarCommand(afterModifier);
|
|
805
806
|
if (nestedCommand)
|
|
806
|
-
return routeByDollarCommand(nestedCommand) || routeById('MadSKS');
|
|
807
|
+
return select(routeByDollarCommand(nestedCommand) || routeById('MadSKS'));
|
|
807
808
|
if (looksLikeAnswerOnlyRequest(afterModifier))
|
|
808
|
-
return routeById('Answer');
|
|
809
|
+
return select(routeById('Answer'));
|
|
809
810
|
if (looksLikeCodeChangingWork(afterModifier) || looksLikeDirectWorkRequest(afterModifier))
|
|
810
|
-
return routeById('Naruto');
|
|
811
|
-
return routeById('MadSKS');
|
|
811
|
+
return select(routeById('Naruto'));
|
|
812
|
+
return select(routeById('MadSKS'));
|
|
812
813
|
}
|
|
813
814
|
const route = routeByDollarCommand(command) || routeById('SKS');
|
|
814
815
|
if (route?.id === 'SKS' && looksLikeTeamDefaultWork(stripDollarCommand(text)))
|
|
815
|
-
return routeById('Naruto');
|
|
816
|
+
return select(routeById('Naruto'));
|
|
816
817
|
if (route?.id === 'Team')
|
|
817
|
-
return routeById('Naruto');
|
|
818
|
-
return route;
|
|
818
|
+
return select(routeById('Naruto'));
|
|
819
|
+
return select(route);
|
|
819
820
|
}
|
|
820
821
|
if (hasFromChatImgSignal(text))
|
|
821
|
-
return routeById('Naruto');
|
|
822
|
+
return select(routeById('Naruto'));
|
|
822
823
|
const simpleGitRoute = simpleGitOnlyRouteId(text);
|
|
823
824
|
if (simpleGitRoute)
|
|
824
|
-
return routeById(simpleGitRoute);
|
|
825
|
+
return select(routeById(simpleGitRoute));
|
|
825
826
|
if (looksLikePresentationArtifactRequest(text))
|
|
826
|
-
return routeById('PPT');
|
|
827
|
+
return select(routeById('PPT'));
|
|
827
828
|
if (looksLikeImageUxReviewRequest(text))
|
|
828
|
-
return routeById('ImageUXReview');
|
|
829
|
+
return select(routeById('ImageUXReview'));
|
|
829
830
|
if (looksLikeComputerUseFastLane(text))
|
|
830
|
-
return routeById('ComputerUse');
|
|
831
|
+
return select(routeById('ComputerUse'));
|
|
831
832
|
if (looksLikeTinyDirectFix(text))
|
|
832
|
-
return routeById('DFix');
|
|
833
|
+
return select(routeById('DFix'));
|
|
834
|
+
if (/\b(SQL|Supabase|Postgres|migration|RLS|Prisma|Drizzle|Knex|database|DB|execute_sql)\b/i.test(text))
|
|
835
|
+
return select(routeById('DB'));
|
|
836
|
+
if (looksLikeSuperSearchRequest(text) && !looksLikeCodeChangingWork(text))
|
|
837
|
+
return select(routeById('SuperSearch'));
|
|
833
838
|
if (looksLikeQuestionShapedDirective(text))
|
|
834
|
-
return routeById('Naruto');
|
|
839
|
+
return select(routeById('Naruto'));
|
|
840
|
+
if (looksLikeDirectWorkRequest(text))
|
|
841
|
+
return select(routeById('Naruto'));
|
|
835
842
|
if (looksLikeAnswerOnlyRequest(text))
|
|
836
|
-
return routeById('Answer');
|
|
837
|
-
if (/\b(SQL|Supabase|Postgres|migration|RLS|Prisma|Drizzle|Knex|database|DB|execute_sql)\b/i.test(text))
|
|
838
|
-
return routeById('DB');
|
|
843
|
+
return select(routeById('Answer'));
|
|
839
844
|
if (/\b(team|multi-agent|subagent|parallel agents|agent team)\b|병렬|팀/i.test(text))
|
|
840
|
-
return routeById('Naruto');
|
|
845
|
+
return select(routeById('Naruto'));
|
|
841
846
|
if (looksLikeChatCaptureRequest(text) && !looksLikeAnswerOnlyRequest(text))
|
|
842
|
-
return routeById('Naruto');
|
|
847
|
+
return select(routeById('Naruto'));
|
|
843
848
|
if (/\b(qa[-\s]?loop|qaloop|e2e\s+qa|qa\s+e2e)\b/i.test(text))
|
|
844
|
-
return routeById('QALoop');
|
|
845
|
-
if (
|
|
846
|
-
return routeById('
|
|
849
|
+
return select(routeById('QALoop'));
|
|
850
|
+
if (looksLikeSuperSearchRequest(text) && !looksLikeCodeChangingWork(text) && !looksLikeAnswerOnlyRequest(text))
|
|
851
|
+
return select(routeById('SuperSearch'));
|
|
847
852
|
if (looksLikeGenerativeEngineOptimizationRequest(text))
|
|
848
|
-
return routeById('SEOGEOOptimizer');
|
|
853
|
+
return select(routeById('SEOGEOOptimizer'));
|
|
849
854
|
if (looksLikeSeoRequest(text))
|
|
850
|
-
return routeById('SEOGEOOptimizer');
|
|
855
|
+
return select(routeById('SEOGEOOptimizer'));
|
|
851
856
|
if (/\b(autoresearch|experiment|benchmark|ranking|optimi[sz]e|improve metric|github stars?|npm downloads?|스타|다운로드)\b/i.test(text))
|
|
852
|
-
return routeById('AutoResearch');
|
|
857
|
+
return select(routeById('AutoResearch'));
|
|
853
858
|
if (/\b(research|hypothesis|falsify|novelty|frontier|조사|연구)\b/i.test(text))
|
|
854
|
-
return routeById('Research');
|
|
859
|
+
return select(routeById('Research'));
|
|
855
860
|
if (/(wiki\s+(refresh|pack|validate|prune)|triwiki\s+(refresh|pack|validate)|위키\s*(갱신|리프레시|정리|검증|패킹)|트라이위키|triwiki)/i.test(text) && !looksLikeDirectWorkRequest(text))
|
|
856
|
-
return routeById('Wiki');
|
|
861
|
+
return select(routeById('Wiki'));
|
|
857
862
|
if (/\b(GX|vgraph|visual context|render cartridge|wiki coordinate|rgba|trig|llm wiki)\b/i.test(text))
|
|
858
|
-
return routeById('GX');
|
|
863
|
+
return select(routeById('GX'));
|
|
859
864
|
if (looksLikeTeamDefaultWork(text))
|
|
860
|
-
return routeById('Naruto');
|
|
861
|
-
return routeById('SKS');
|
|
865
|
+
return select(routeById('Naruto'));
|
|
866
|
+
return select(routeById('SKS'));
|
|
867
|
+
}
|
|
868
|
+
export function scorePromptIntent(prompt = '') {
|
|
869
|
+
const text = String(prompt || '').trim();
|
|
870
|
+
const reasons = new Set();
|
|
871
|
+
const questionShape = /(?:\?|^(?:why|what|how|when|where|who|which|can|could|should|would)\b|^(?:왜|뭐|무엇|어떻게|언제|어디|누구|가능|인가|인지)\b)/i.test(text);
|
|
872
|
+
const conditionalWork = looksLikeConditionalWorkRequest(text);
|
|
873
|
+
const complaintDirective = looksLikeComplaintDirectiveRequest(text);
|
|
874
|
+
const commandSignal = Boolean(dollarCommand(text));
|
|
875
|
+
const tinyDirectFix = looksLikeTinyDirectFix(text);
|
|
876
|
+
const directWork = looksLikeDirectWorkRequest(text);
|
|
877
|
+
const answerOnly = looksLikeAnswerOnlyRequest(text);
|
|
878
|
+
let answerOnlyScore = 0;
|
|
879
|
+
let directWorkScore = 0;
|
|
880
|
+
let tinyDirectFixScore = 0;
|
|
881
|
+
let researchScore = 0;
|
|
882
|
+
let dbScore = 0;
|
|
883
|
+
let superSearchScore = 0;
|
|
884
|
+
if (questionShape) {
|
|
885
|
+
answerOnlyScore += 1;
|
|
886
|
+
reasons.add('question_shape');
|
|
887
|
+
}
|
|
888
|
+
if (commandSignal)
|
|
889
|
+
reasons.add('command_signal');
|
|
890
|
+
if (tinyDirectFix) {
|
|
891
|
+
tinyDirectFixScore += 5;
|
|
892
|
+
directWorkScore += 2;
|
|
893
|
+
reasons.add('tiny_direct_fix');
|
|
894
|
+
}
|
|
895
|
+
if (conditionalWork) {
|
|
896
|
+
directWorkScore += 5;
|
|
897
|
+
reasons.add('conditional_work');
|
|
898
|
+
}
|
|
899
|
+
if (complaintDirective) {
|
|
900
|
+
directWorkScore += 4;
|
|
901
|
+
reasons.add('complaint_directive');
|
|
902
|
+
}
|
|
903
|
+
if (looksLikeQuestionShapedDirective(text)) {
|
|
904
|
+
directWorkScore += 4;
|
|
905
|
+
reasons.add('question_shaped_directive');
|
|
906
|
+
}
|
|
907
|
+
if (directWork) {
|
|
908
|
+
directWorkScore += 3;
|
|
909
|
+
reasons.add('direct_work');
|
|
910
|
+
}
|
|
911
|
+
if (answerOnly) {
|
|
912
|
+
answerOnlyScore += 4;
|
|
913
|
+
reasons.add('answer_only');
|
|
914
|
+
}
|
|
915
|
+
if (/\b(research|hypothesis|falsify|novelty|frontier|조사|연구)\b/i.test(text)) {
|
|
916
|
+
researchScore += 2;
|
|
917
|
+
reasons.add('research');
|
|
918
|
+
}
|
|
919
|
+
if (/\b(SQL|Supabase|Postgres|migration|RLS|Prisma|Drizzle|Knex|database|DB|execute_sql)\b/i.test(text)) {
|
|
920
|
+
dbScore += 3;
|
|
921
|
+
reasons.add('db');
|
|
922
|
+
}
|
|
923
|
+
if (looksLikeSuperSearchRequest(text)) {
|
|
924
|
+
superSearchScore += 4;
|
|
925
|
+
reasons.add('super_search');
|
|
926
|
+
}
|
|
927
|
+
return {
|
|
928
|
+
answerOnly: answerOnlyScore,
|
|
929
|
+
directWork: directWorkScore,
|
|
930
|
+
tinyDirectFix: tinyDirectFixScore,
|
|
931
|
+
research: researchScore,
|
|
932
|
+
db: dbScore,
|
|
933
|
+
superSearch: superSearchScore,
|
|
934
|
+
reasons: [...reasons]
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
function withPromptIntentScores(route, intentScores) {
|
|
938
|
+
if (!route)
|
|
939
|
+
return route;
|
|
940
|
+
return { ...route, intent_scores: intentScores };
|
|
862
941
|
}
|
|
863
942
|
export function looksLikeComputerUseFastLane(prompt = '') {
|
|
864
943
|
const text = String(prompt || '');
|
|
@@ -883,6 +962,10 @@ export function looksLikeAnswerOnlyRequest(prompt = '') {
|
|
|
883
962
|
return false;
|
|
884
963
|
if (looksLikeQuestionShapedDirective(text))
|
|
885
964
|
return false;
|
|
965
|
+
if (looksLikeConditionalWorkRequest(text))
|
|
966
|
+
return false;
|
|
967
|
+
if (looksLikeComplaintDirectiveRequest(text))
|
|
968
|
+
return false;
|
|
886
969
|
const infoCue = /(왜|뭐야|무엇|뭔가|어떤|어떻게|언제|어디|누구|얼마|가능해|맞아|인가|인지|차이|의미|원리|이유|방법|설명|알려줘|요약|정리|비교|찾아줘|찾아봐|검색|조사|근거|출처|fact|source|cite|explain|what|why|how|when|where|who|which|whether|compare|summari[sz]e|search|look up|research|tell me|question|\?)/i.test(text);
|
|
887
970
|
if (!infoCue)
|
|
888
971
|
return false;
|
|
@@ -892,15 +975,18 @@ export function looksLikeQuestionShapedDirective(prompt = '') {
|
|
|
892
975
|
const text = String(prompt || '').trim();
|
|
893
976
|
if (!text)
|
|
894
977
|
return false;
|
|
895
|
-
const complaint =
|
|
978
|
+
const complaint = looksLikeComplaintDirectiveRequest(text);
|
|
896
979
|
if (looksLikeMethodQuestion(text) && !looksLikePoliteDirectWorkRequest(text) && !looksLikeExplicitDirectWorkDirective(text) && !complaint)
|
|
897
980
|
return false;
|
|
981
|
+
const questionDirective = /(?:\?|왜|why)[\s\S]{0,160}(?:질문|물음표|answer|라우팅|route|routing)[\s\S]{0,160}(?:고쳐|수정|변경|막아|fix|patch|change|update)/i.test(text);
|
|
898
982
|
const directive = /(반드시|필수|무조건|해야\s*(?:해|함|돼|한다|하지|한다는|되는)|해야지|해야돼|해야한다|알지|기억해|파악해야|구분해야|막아야|보장해야|강제|기본적으로)/i.test(text);
|
|
899
983
|
const pipelineCue = /(질문|질문형|암묵|지시|파이프라인|라우팅|route|routing|team|팀|sks|기본|구성|게이트|gate|작업|수정|구현|실행)/i.test(text);
|
|
900
|
-
return (directive && pipelineCue) || complaint;
|
|
984
|
+
return questionDirective || (directive && pipelineCue) || complaint;
|
|
901
985
|
}
|
|
902
986
|
export function looksLikeDirectWorkRequest(prompt = '') {
|
|
903
987
|
const text = String(prompt || '');
|
|
988
|
+
if (/(?:설명만|설명\s*만|just\s+explain|explain\s+only|only\s+explain)/i.test(text))
|
|
989
|
+
return false;
|
|
904
990
|
const explicitDirective = looksLikeExplicitDirectWorkDirective(text);
|
|
905
991
|
if (looksLikeDirectFixQuestion(text) && !explicitDirective)
|
|
906
992
|
return false;
|
|
@@ -908,11 +994,27 @@ export function looksLikeDirectWorkRequest(prompt = '') {
|
|
|
908
994
|
return false;
|
|
909
995
|
return looksLikeCodeChangingWork(text)
|
|
910
996
|
|| looksLikeChatCaptureRequest(text)
|
|
997
|
+
|| looksLikeConditionalWorkRequest(text)
|
|
911
998
|
|| looksLikeQuestionShapedDirective(text)
|
|
912
999
|
|| explicitDirective
|
|
913
1000
|
|| /(작업|파이프라인|구현|수정|변경|추가|적용|반영|처리|수행|검수|설치|해결|리드미|README).*(해줘|해달|해라|해야|되게|줘야|줘야지|달라)/i.test(text)
|
|
914
1001
|
|| /(진행해|수행해|작업해|처리해|적용해|반영해|검수해|고쳐줘|바꿔줘|해결해줘|만들어줘|해줘야|해줘야지|해달라|해야지|되게 해|install|run|execute|test|deploy|commit|push)/i.test(text);
|
|
915
1002
|
}
|
|
1003
|
+
function looksLikeConditionalWorkRequest(prompt = '') {
|
|
1004
|
+
const text = String(prompt || '').trim();
|
|
1005
|
+
if (!text)
|
|
1006
|
+
return false;
|
|
1007
|
+
return /(확인하고|검토하고|봐서|보고|문제\s*있으면|가능한지).*(고쳐|수정|변경|처리|해결|진행|반영|해줘|해달)/i.test(text)
|
|
1008
|
+
|| /\b(?:check|inspect|verify|see)\b[\s\S]{0,120}\b(?:if|whether|when)\b[\s\S]{0,120}\b(?:fix|patch|update|change|repair|resolve)\b/i.test(text)
|
|
1009
|
+
|| /\b(?:if|when)\b[\s\S]{0,120}\b(?:problem|issue|bug|broken|fails?)\b[\s\S]{0,120}\b(?:fix|patch|update|change|repair|resolve)\b/i.test(text);
|
|
1010
|
+
}
|
|
1011
|
+
function looksLikeComplaintDirectiveRequest(prompt = '') {
|
|
1012
|
+
const text = String(prompt || '').trim();
|
|
1013
|
+
if (!text)
|
|
1014
|
+
return false;
|
|
1015
|
+
return /(왜|근데|그런데).*(안\s*하|안\s*되|없이|누락|빠뜨|생략|스킵|못\s*하).*(많|자주|계속|이렇게|함|하지|하냐|하니|\?)/i.test(text)
|
|
1016
|
+
|| /\bwhy\b[\s\S]{0,80}\b(?:not|missing|skipped|failed|still|keeps?)\b[\s\S]{0,120}\b(?:fix|patch|route|routing|work|do|done)\b/i.test(text);
|
|
1017
|
+
}
|
|
916
1018
|
function looksLikeExplicitDirectWorkDirective(prompt = '') {
|
|
917
1019
|
const text = String(prompt || '').trim();
|
|
918
1020
|
if (!text)
|
|
@@ -945,7 +1047,7 @@ export function routeRequiresSubagents(route, prompt = '') {
|
|
|
945
1047
|
return false;
|
|
946
1048
|
if (route.id === 'ImageUXReview')
|
|
947
1049
|
return false;
|
|
948
|
-
if (route.id === '
|
|
1050
|
+
if (route.id === 'SuperSearch')
|
|
949
1051
|
return false;
|
|
950
1052
|
if (route.id === 'SEOGEOOptimizer')
|
|
951
1053
|
return false;
|
|
@@ -1030,7 +1132,7 @@ export function routeReasoning(route, prompt = '') {
|
|
|
1030
1132
|
return narutoRouteReasoning(text);
|
|
1031
1133
|
if (route?.id === 'Research' || route?.id === 'AutoResearch')
|
|
1032
1134
|
return reasoning('xhigh', 'research_or_experiment_route');
|
|
1033
|
-
if (route?.id === '
|
|
1135
|
+
if (route?.id === 'SuperSearch')
|
|
1034
1136
|
return reasoning('high', 'source_intelligence_route');
|
|
1035
1137
|
if (route?.id === 'SEOGEOOptimizer')
|
|
1036
1138
|
return reasoning('high', 'search_visibility_route');
|
|
@@ -23,7 +23,7 @@ export function buildSourceIntelligencePolicy(input = {}) {
|
|
|
23
23
|
wrongnessKinds.push('context7_missing');
|
|
24
24
|
}
|
|
25
25
|
if (!offline && codex.status === 'unavailable') {
|
|
26
|
-
warnings.push('
|
|
26
|
+
warnings.push('codex_web_search_unavailable_degraded_to_super_cache_or_docs');
|
|
27
27
|
wrongnessKinds.push('codex_web_search_missing');
|
|
28
28
|
}
|
|
29
29
|
if (input.xaiDetection)
|
|
@@ -37,8 +37,8 @@ export function buildSourceIntelligencePolicy(input = {}) {
|
|
|
37
37
|
: xIntent
|
|
38
38
|
? 'x_search'
|
|
39
39
|
: /deep|exhaustive|가능한 전부|누락 없이|완벽하게 조사/i.test(query)
|
|
40
|
-
? '
|
|
41
|
-
: '
|
|
40
|
+
? 'super_deep'
|
|
41
|
+
: 'super_balanced');
|
|
42
42
|
const selected = new Set();
|
|
43
43
|
if (docsIntent && context7Available)
|
|
44
44
|
selected.add('context7');
|
|
@@ -56,8 +56,8 @@ export function buildSourceIntelligencePolicy(input = {}) {
|
|
|
56
56
|
mode,
|
|
57
57
|
requirements: {
|
|
58
58
|
official_sources: docsIntent,
|
|
59
|
-
full_content: mode !== '
|
|
60
|
-
counter_search: mode === '
|
|
59
|
+
full_content: mode !== 'super_fast',
|
|
60
|
+
counter_search: mode === 'super_deep' || mode === 'super_exhaustive',
|
|
61
61
|
claim_ledger: true,
|
|
62
62
|
social_recency: xIntent || mode === 'x_search',
|
|
63
63
|
code_execution_verification: /\b(code|implementation|test|runtime|구현)\b/i.test(query)
|
|
@@ -3,19 +3,19 @@ export function buildSourceIntelligenceProof(policy, evidence) {
|
|
|
3
3
|
const blockers = [...policy.blockers];
|
|
4
4
|
const wrongnessKinds = [...policy.wrongness_kinds];
|
|
5
5
|
const context7Ok = policy.context7.required ? evidence.context7?.ok === true : true;
|
|
6
|
-
const
|
|
6
|
+
const superSearchOk = evidence.super_search?.proof.provider_independent === true && evidence.super_search?.proof.xai_runtime_dependency === false;
|
|
7
7
|
const appshotsRequired = evidence.appshots?.capability.visual_required === true;
|
|
8
8
|
const appshotsOk = appshotsRequired ? evidence.appshots?.ok === true : true;
|
|
9
9
|
if (policy.context7.required && !context7Ok) {
|
|
10
10
|
blockers.push('context7_missing');
|
|
11
11
|
wrongnessKinds.push('context7_missing');
|
|
12
12
|
}
|
|
13
|
-
if (!
|
|
14
|
-
blockers.push('
|
|
15
|
-
wrongnessKinds.push('
|
|
13
|
+
if (!superSearchOk) {
|
|
14
|
+
blockers.push('super_search_provider_independent_proof_missing');
|
|
15
|
+
wrongnessKinds.push('super_search_provider_independent_proof_missing');
|
|
16
16
|
}
|
|
17
|
-
if (evidence.
|
|
18
|
-
blockers.push(...evidence.
|
|
17
|
+
if (evidence.super_search?.proof.blockers.length)
|
|
18
|
+
blockers.push(...evidence.super_search.proof.blockers);
|
|
19
19
|
if (appshotsRequired && !appshotsOk) {
|
|
20
20
|
blockers.push('appshots_operator_action_missing');
|
|
21
21
|
wrongnessKinds.push('appshots_operator_action_missing');
|
|
@@ -28,8 +28,8 @@ export function buildSourceIntelligenceProof(policy, evidence) {
|
|
|
28
28
|
context7_required: policy.context7.required,
|
|
29
29
|
context7_ok: context7Ok,
|
|
30
30
|
codex_web_required: policy.codex_web_search.required,
|
|
31
|
-
|
|
32
|
-
provider_independent: evidence.
|
|
31
|
+
super_search_ok: superSearchOk,
|
|
32
|
+
provider_independent: evidence.super_search?.proof.provider_independent === true,
|
|
33
33
|
appshots_required: appshotsRequired,
|
|
34
34
|
appshots_ok: appshotsOk
|
|
35
35
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { ensureDir, nowIso, sha256, writeJsonAtomic, writeTextAtomic } from '../fsx.js';
|
|
3
3
|
import { detectCodexWebSearchCapability } from '../codex/codex-web-search-adapter.js';
|
|
4
|
-
import {
|
|
4
|
+
import { runSuperSearch } from '../super-search/index.js';
|
|
5
5
|
import { buildSourceIntelligencePolicy, writeSourceIntelligencePolicyArtifact } from './source-intelligence-policy.js';
|
|
6
6
|
import { buildSourceIntelligenceProof } from './source-intelligence-proof.js';
|
|
7
7
|
import { buildAppshotsEvidence, writeAppshotsEvidenceArtifact } from './appshots-evidence.js';
|
|
@@ -29,13 +29,13 @@ export async function runSourceIntelligence(input) {
|
|
|
29
29
|
offline: input.offline === true,
|
|
30
30
|
...(input.context7 ? { context7: input.context7 } : {})
|
|
31
31
|
});
|
|
32
|
-
const
|
|
33
|
-
const
|
|
32
|
+
const superSearchMode = sourceModeToSuperSearchMode(policy.mode);
|
|
33
|
+
const superSearch = await runSuperSearch({
|
|
34
34
|
root,
|
|
35
35
|
missionDir,
|
|
36
36
|
route: input.route || 'unknown',
|
|
37
37
|
query: input.query,
|
|
38
|
-
mode:
|
|
38
|
+
mode: superSearchMode,
|
|
39
39
|
...(input.offline === undefined ? {} : { offline: input.offline }),
|
|
40
40
|
...(input.context7 ? { context7: input.context7 } : {}),
|
|
41
41
|
...(input.codexWebSearch ? { codexWebSearch: input.codexWebSearch } : {}),
|
|
@@ -54,13 +54,13 @@ export async function runSourceIntelligence(input) {
|
|
|
54
54
|
const providersRequested = policy.selected_providers;
|
|
55
55
|
const providersCompleted = [
|
|
56
56
|
...(context7.ok && policy.context7.required ? ['context7'] : []),
|
|
57
|
-
...(
|
|
58
|
-
...(
|
|
59
|
-
'
|
|
57
|
+
...(superSearch.sources.some((source) => source.provider_id === 'codex_web') ? ['codex_web'] : []),
|
|
58
|
+
...(superSearch.sources.some((source) => source.provider_id === 'x_public') ? ['x_public'] : []),
|
|
59
|
+
'super_search'
|
|
60
60
|
];
|
|
61
|
-
const proof = buildSourceIntelligenceProof(policy, { context7,
|
|
61
|
+
const proof = buildSourceIntelligenceProof(policy, { context7, super_search: superSearch, appshots });
|
|
62
62
|
const blockers = [...new Set([...policy.blockers, ...context7.blockers, ...appshots.blockers, ...proof.blockers])];
|
|
63
|
-
const warnings = [...new Set([...policy.warnings, ...
|
|
63
|
+
const warnings = [...new Set([...policy.warnings, ...superSearch.warnings, ...appshots.warnings])];
|
|
64
64
|
const cacheKey = sha256(JSON.stringify({ route: input.route || 'unknown', query: input.query, mode: policy.mode })).slice(0, 16);
|
|
65
65
|
const evidence = {
|
|
66
66
|
schema: SOURCE_INTELLIGENCE_EVIDENCE_SCHEMA,
|
|
@@ -77,12 +77,12 @@ export async function runSourceIntelligence(input) {
|
|
|
77
77
|
cache: {
|
|
78
78
|
key: cacheKey,
|
|
79
79
|
local_only: true,
|
|
80
|
-
|
|
80
|
+
super_search_hit: superSearch.cache.hit
|
|
81
81
|
},
|
|
82
82
|
policy,
|
|
83
83
|
context7,
|
|
84
84
|
codex_web_search: null,
|
|
85
|
-
|
|
85
|
+
super_search: superSearch,
|
|
86
86
|
appshots,
|
|
87
87
|
proof,
|
|
88
88
|
blockers,
|
|
@@ -102,7 +102,7 @@ export function renderSourceIntelligenceEvidenceMarkdown(evidence) {
|
|
|
102
102
|
`- Route: ${evidence.route}`,
|
|
103
103
|
`- Mode: ${evidence.mode}`,
|
|
104
104
|
`- Context7: ${evidence.context7.status}`,
|
|
105
|
-
`-
|
|
105
|
+
`- Super-Search: ${evidence.super_search.proof.ok ? 'ok' : 'partial'}`,
|
|
106
106
|
`- Legacy x-search MCP: not_required`,
|
|
107
107
|
`- Appshots: ${evidence.appshots?.status || 'not_required'}`,
|
|
108
108
|
`- Providers completed: ${evidence.parallel.providers_completed.join(', ') || 'none'}`,
|
|
@@ -110,12 +110,12 @@ export function renderSourceIntelligenceEvidenceMarkdown(evidence) {
|
|
|
110
110
|
''
|
|
111
111
|
].join('\n');
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (mode === '
|
|
113
|
+
function sourceModeToSuperSearchMode(mode) {
|
|
114
|
+
if (mode === 'super_fast')
|
|
115
115
|
return 'fast';
|
|
116
|
-
if (mode === '
|
|
116
|
+
if (mode === 'super_deep')
|
|
117
117
|
return 'deep';
|
|
118
|
-
if (mode === '
|
|
118
|
+
if (mode === 'super_exhaustive')
|
|
119
119
|
return 'exhaustive';
|
|
120
120
|
if (mode === 'url_acquisition')
|
|
121
121
|
return 'url_acquisition';
|
|
@@ -3,6 +3,7 @@ import { nowIso, writeJsonAtomic } from '../fsx.js';
|
|
|
3
3
|
export const STRATEGY_GATE_SCHEMA = 'sks.strategy-gate.v1';
|
|
4
4
|
export function evaluateStrategyGate(input) {
|
|
5
5
|
const writeCapable = input.writeCapable === true;
|
|
6
|
+
const sourceIntelligenceRequired = input.sourceIntelligenceRequired !== false;
|
|
6
7
|
const gate = input.compiled.gate;
|
|
7
8
|
const strategyFirstRequired = writeCapable || gate.visual_appshot_required_count > 0 || input.visualRequired === true;
|
|
8
9
|
const blockers = [
|
|
@@ -13,7 +14,7 @@ export function evaluateStrategyGate(input) {
|
|
|
13
14
|
...(writeCapable && input.visualRequired === true && input.appshotsOk !== true
|
|
14
15
|
? ['appshots_operator_action_missing_for_visual_proof']
|
|
15
16
|
: []),
|
|
16
|
-
...(writeCapable && input.sourceIntelligenceOk === false ? ['source_intelligence_gate_failed'] : [])
|
|
17
|
+
...(writeCapable && sourceIntelligenceRequired && input.sourceIntelligenceOk === false ? ['source_intelligence_gate_failed'] : [])
|
|
17
18
|
];
|
|
18
19
|
return {
|
|
19
20
|
schema: STRATEGY_GATE_SCHEMA,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { humanizeBlockers } from '../errors/blocker-humanizer.js';
|
|
2
|
+
export function buildSuperSearchDoctorReport(args = [], env = process.env) {
|
|
3
|
+
const offline = args.includes('--offline');
|
|
4
|
+
const codexWebAvailable = env.SKS_CODEX_WEB_SEARCH_AVAILABLE === '1' || env.CODEX_WEB_SEARCH_AVAILABLE === '1';
|
|
5
|
+
const directUrlFetchAvailable = typeof globalThis.fetch === 'function';
|
|
6
|
+
const minimumAcquisitionPathReady = directUrlFetchAvailable || codexWebAvailable;
|
|
7
|
+
const status = offline
|
|
8
|
+
? 'offline_usable'
|
|
9
|
+
: minimumAcquisitionPathReady
|
|
10
|
+
? 'usable'
|
|
11
|
+
: 'degraded';
|
|
12
|
+
const blockers = status === 'degraded' ? ['source_acquisition_unavailable'] : [];
|
|
13
|
+
const diagnostics = humanizeBlockers(blockers, []);
|
|
14
|
+
return {
|
|
15
|
+
schema: 'sks.super-search-doctor.v2',
|
|
16
|
+
ok: status === 'usable' || status === 'offline_usable',
|
|
17
|
+
status,
|
|
18
|
+
core_ready: true,
|
|
19
|
+
minimum_acquisition_path_ready: minimumAcquisitionPathReady,
|
|
20
|
+
xai_required: false,
|
|
21
|
+
providers: {
|
|
22
|
+
direct_url_fetch: {
|
|
23
|
+
status: directUrlFetchAvailable ? 'available' : 'not_available',
|
|
24
|
+
real_smoke_passed: directUrlFetchAvailable
|
|
25
|
+
},
|
|
26
|
+
codex_web: {
|
|
27
|
+
status: codexWebAvailable ? 'available' : 'not_bound'
|
|
28
|
+
},
|
|
29
|
+
context7: {
|
|
30
|
+
status: 'not_bound'
|
|
31
|
+
},
|
|
32
|
+
x_public: {
|
|
33
|
+
status: 'discovery_only'
|
|
34
|
+
},
|
|
35
|
+
offline_cache: {
|
|
36
|
+
status: offline ? 'available' : 'explicit_offline_only'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
optional: {
|
|
40
|
+
context7: 'external_runtime_optional_by_intent',
|
|
41
|
+
codex_web: codexWebAvailable ? 'available' : 'not_bound',
|
|
42
|
+
authenticated_chrome: 'operator_consented_optional',
|
|
43
|
+
official_x_api: 'credentials_optional_not_required'
|
|
44
|
+
},
|
|
45
|
+
blockers,
|
|
46
|
+
human_summary: diagnostics.human_summary,
|
|
47
|
+
next_actions: diagnostics.next_actions,
|
|
48
|
+
evidence_paths: diagnostics.evidence_paths,
|
|
49
|
+
warnings: []
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function printSuperSearchDoctorReport(report, json) {
|
|
53
|
+
if (json) {
|
|
54
|
+
console.log(JSON.stringify(report, null, 2));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
console.log(`Super-Search doctor: ${report.status}; xAI/Grok is not required.`);
|
|
58
|
+
if (report.blockers.length) {
|
|
59
|
+
console.log(`Blockers: ${report.blockers.join(', ')}`);
|
|
60
|
+
console.log(`Next actions: ${report.next_actions.join('; ')}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=doctor.js.map
|