scai 0.1.178 → 1.0.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 +162 -267
- package/dist/__tests__/CommitSuggesterCmd.test.js +112 -0
- package/dist/__tests__/CommitSuggesterCmd.test.js.map +1 -0
- package/dist/__tests__/EvalReportCmd.test.js +645 -0
- package/dist/__tests__/EvalReportCmd.test.js.map +1 -0
- package/dist/__tests__/ModelCmd.test.js +64 -0
- package/dist/__tests__/ModelCmd.test.js.map +1 -0
- package/dist/__tests__/agents/agentActions.test.js +345 -0
- package/dist/__tests__/agents/agentActions.test.js.map +1 -0
- package/dist/__tests__/agents/agentFeedback.test.js +118 -0
- package/dist/__tests__/agents/agentFeedback.test.js.map +1 -0
- package/dist/__tests__/agents/agentGeneralScope.test.js +74 -0
- package/dist/__tests__/agents/agentGeneralScope.test.js.map +1 -0
- package/dist/__tests__/agents/agentLoop.test.js +1723 -0
- package/dist/__tests__/agents/agentLoop.test.js.map +1 -0
- package/dist/__tests__/agents/agentPolicyState.test.js +948 -0
- package/dist/__tests__/agents/agentPolicyState.test.js.map +1 -0
- package/dist/__tests__/agents/agentReadEvidence.test.js +170 -0
- package/dist/__tests__/agents/agentReadEvidence.test.js.map +1 -0
- package/dist/__tests__/agents/agentReadPersistence.test.js +129 -0
- package/dist/__tests__/agents/agentReadPersistence.test.js.map +1 -0
- package/dist/__tests__/agents/agentResumeCheckpoint.test.js +90 -0
- package/dist/__tests__/agents/agentResumeCheckpoint.test.js.map +1 -0
- package/dist/__tests__/agents/agentSearchBatchPlanner.test.js +289 -0
- package/dist/__tests__/agents/agentSearchBatchPlanner.test.js.map +1 -0
- package/dist/__tests__/agents/agentSearchOwnership.test.js +166 -0
- package/dist/__tests__/agents/agentSearchOwnership.test.js.map +1 -0
- package/dist/__tests__/agents/agentSearchRanking.test.js +139 -0
- package/dist/__tests__/agents/agentSearchRanking.test.js.map +1 -0
- package/dist/__tests__/agents/agentSearchRouting.test.js +584 -0
- package/dist/__tests__/agents/agentSearchRouting.test.js.map +1 -0
- package/dist/__tests__/agents/agentSearchScoring.test.js +23 -0
- package/dist/__tests__/agents/agentSearchScoring.test.js.map +1 -0
- package/dist/__tests__/agents/agentSearchShared.test.js +78 -0
- package/dist/__tests__/agents/agentSearchShared.test.js.map +1 -0
- package/dist/__tests__/agents/agentStateMachine.test.js +58 -0
- package/dist/__tests__/agents/agentStateMachine.test.js.map +1 -0
- package/dist/__tests__/agents/agentTaskPersistence.test.js +156 -0
- package/dist/__tests__/agents/agentTaskPersistence.test.js.map +1 -0
- package/dist/__tests__/agents/agentTools.test.js +69 -0
- package/dist/__tests__/agents/agentTools.test.js.map +1 -0
- package/dist/__tests__/agents/agentTransform.test.js +779 -0
- package/dist/__tests__/agents/agentTransform.test.js.map +1 -0
- package/dist/__tests__/agents/analysisPlanGenStep.test.js +157 -0
- package/dist/__tests__/agents/analysisPlanGenStep.test.js.map +1 -0
- package/dist/__tests__/agents/answerOnlyCompletion.test.js +75 -0
- package/dist/__tests__/agents/answerOnlyCompletion.test.js.map +1 -0
- package/dist/__tests__/agents/decideNextAction.test.js +1662 -0
- package/dist/__tests__/agents/decideNextAction.test.js.map +1 -0
- package/dist/__tests__/agents/deriveFocusFromSearchStep.test.js +258 -0
- package/dist/__tests__/agents/deriveFocusFromSearchStep.test.js.map +1 -0
- package/dist/__tests__/agents/evidenceVerifierStep.test.js +113 -0
- package/dist/__tests__/agents/evidenceVerifierStep.test.js.map +1 -0
- package/dist/__tests__/agents/executionPolicyResolver.test.js +208 -0
- package/dist/__tests__/agents/executionPolicyResolver.test.js.map +1 -0
- package/dist/__tests__/agents/fileCheckStep.test.js +299 -0
- package/dist/__tests__/agents/fileCheckStep.test.js.map +1 -0
- package/dist/__tests__/agents/giveUpEvaluatorStep.test.js +35 -0
- package/dist/__tests__/agents/giveUpEvaluatorStep.test.js.map +1 -0
- package/dist/__tests__/agents/guardState.test.js +297 -0
- package/dist/__tests__/agents/guardState.test.js.map +1 -0
- package/dist/__tests__/agents/mainAgentHeuristics.test.js +72 -0
- package/dist/__tests__/agents/mainAgentHeuristics.test.js.map +1 -0
- package/dist/__tests__/agents/objectiveEvaluatorStep.test.js +60 -0
- package/dist/__tests__/agents/objectiveEvaluatorStep.test.js.map +1 -0
- package/dist/__tests__/agents/outerLoopRecoveryEvaluator.test.js +207 -0
- package/dist/__tests__/agents/outerLoopRecoveryEvaluator.test.js.map +1 -0
- package/dist/__tests__/agents/prompting.test.js +363 -0
- package/dist/__tests__/agents/prompting.test.js.map +1 -0
- package/dist/__tests__/agents/readinessGateStep.test.js +180 -0
- package/dist/__tests__/agents/readinessGateStep.test.js.map +1 -0
- package/dist/__tests__/agents/reasonNextStep.test.js +56 -0
- package/dist/__tests__/agents/reasonNextStep.test.js.map +1 -0
- package/dist/__tests__/agents/reasonNextTaskStep.test.js +284 -0
- package/dist/__tests__/agents/reasonNextTaskStep.test.js.map +1 -0
- package/dist/__tests__/agents/resolveAgentTargetClassification.test.js +170 -0
- package/dist/__tests__/agents/resolveAgentTargetClassification.test.js.map +1 -0
- package/dist/__tests__/agents/resolveProgressState.test.js +526 -0
- package/dist/__tests__/agents/resolveProgressState.test.js.map +1 -0
- package/dist/__tests__/agents/resumeCheckpoint.test.js +50 -0
- package/dist/__tests__/agents/resumeCheckpoint.test.js.map +1 -0
- package/dist/__tests__/agents/routingDecisionStep.test.js +134 -0
- package/dist/__tests__/agents/routingDecisionStep.test.js.map +1 -0
- package/dist/__tests__/agents/scopeClassificationStep.test.js +118 -0
- package/dist/__tests__/agents/scopeClassificationStep.test.js.map +1 -0
- package/dist/__tests__/agents/searchContext.test.js +97 -0
- package/dist/__tests__/agents/searchContext.test.js.map +1 -0
- package/dist/__tests__/agents/selectRelevantSourcesStep.test.js +73 -0
- package/dist/__tests__/agents/selectRelevantSourcesStep.test.js.map +1 -0
- package/dist/__tests__/agents/structuredOutput.test.js +45 -0
- package/dist/__tests__/agents/structuredOutput.test.js.map +1 -0
- package/dist/__tests__/agents/transformPlanGenStep.fallback.test.js +59 -0
- package/dist/__tests__/agents/transformPlanGenStep.fallback.test.js.map +1 -0
- package/dist/__tests__/agents/transformPlanGenStep.test.js +92 -0
- package/dist/__tests__/agents/transformPlanGenStep.test.js.map +1 -0
- package/dist/__tests__/agents/understandIntentStep.test.js +237 -0
- package/dist/__tests__/agents/understandIntentStep.test.js.map +1 -0
- package/dist/__tests__/agents/understandResumeContext.test.js +65 -0
- package/dist/__tests__/agents/understandResumeContext.test.js.map +1 -0
- package/dist/__tests__/agents/understandScope.test.js +227 -0
- package/dist/__tests__/agents/understandScope.test.js.map +1 -0
- package/dist/__tests__/agents/validateChangesStep.test.js +52 -0
- package/dist/__tests__/agents/validateChangesStep.test.js.map +1 -0
- package/dist/__tests__/askCommandTaskBinding.test.js +176 -0
- package/dist/__tests__/askCommandTaskBinding.test.js.map +1 -0
- package/dist/__tests__/commandVisibility.test.js +25 -0
- package/dist/__tests__/commandVisibility.test.js.map +1 -0
- package/dist/__tests__/config.devOutput.test.js +82 -0
- package/dist/__tests__/config.devOutput.test.js.map +1 -0
- package/dist/__tests__/currentContext.test.js +43 -0
- package/dist/__tests__/currentContext.test.js.map +1 -0
- package/dist/__tests__/daemonWorker.test.js +51 -0
- package/dist/__tests__/daemonWorker.test.js.map +1 -0
- package/dist/__tests__/dialogState.test.js +113 -0
- package/dist/__tests__/dialogState.test.js.map +1 -0
- package/dist/__tests__/evalCommands.test.js +506 -0
- package/dist/__tests__/evalCommands.test.js.map +1 -0
- package/dist/__tests__/evalCommandsSummary.test.js +68 -0
- package/dist/__tests__/evalCommandsSummary.test.js.map +1 -0
- package/dist/__tests__/example.test.js +1 -0
- package/dist/__tests__/example.test.js.map +1 -0
- package/dist/__tests__/factory.commitCommand.test.js +45 -0
- package/dist/__tests__/factory.commitCommand.test.js.map +1 -0
- package/dist/__tests__/factory.devOutputCommand.test.js +122 -0
- package/dist/__tests__/factory.devOutputCommand.test.js.map +1 -0
- package/dist/__tests__/factory.evalCommands.test.js +38 -0
- package/dist/__tests__/factory.evalCommands.test.js.map +1 -0
- package/dist/__tests__/factory.planCommand.test.js +35 -0
- package/dist/__tests__/factory.planCommand.test.js.map +1 -0
- package/dist/__tests__/factory.setupCommand.test.js +34 -0
- package/dist/__tests__/factory.setupCommand.test.js.map +1 -0
- package/dist/__tests__/factory.statusCommand.test.js +54 -0
- package/dist/__tests__/factory.statusCommand.test.js.map +1 -0
- package/dist/__tests__/fileRules/queryTokenRules.test.js +35 -0
- package/dist/__tests__/fileRules/queryTokenRules.test.js.map +1 -0
- package/dist/__tests__/fileRules/searchPathClassification.test.js +57 -0
- package/dist/__tests__/fileRules/searchPathClassification.test.js.map +1 -0
- package/dist/__tests__/generate.ollamaRecovery.test.js +344 -0
- package/dist/__tests__/generate.ollamaRecovery.test.js.map +1 -0
- package/dist/__tests__/index.modelStartup.test.js +24 -0
- package/dist/__tests__/index.modelStartup.test.js.map +1 -0
- package/dist/__tests__/indexCmd.test.js +85 -0
- package/dist/__tests__/indexCmd.test.js.map +1 -0
- package/dist/__tests__/indexSlashCommand.test.js +50 -0
- package/dist/__tests__/indexSlashCommand.test.js.map +1 -0
- package/dist/__tests__/ollamaService.test.js +103 -0
- package/dist/__tests__/ollamaService.test.js.map +1 -0
- package/dist/__tests__/pipeline/modules/codeTransformModule.small-file.test.js +68 -0
- package/dist/__tests__/pipeline/modules/codeTransformModule.small-file.test.js.map +1 -0
- package/dist/__tests__/pipeline/modules/commitSuggesterModule.test.js +68 -0
- package/dist/__tests__/pipeline/modules/commitSuggesterModule.test.js.map +1 -0
- package/dist/__tests__/pipeline/modules/fileSearchModule.test.js +284 -0
- package/dist/__tests__/pipeline/modules/fileSearchModule.test.js.map +1 -0
- package/dist/__tests__/pipeline/modules/finalAnswerModule.test.js +1139 -0
- package/dist/__tests__/pipeline/modules/finalAnswerModule.test.js.map +1 -0
- package/dist/__tests__/pipeline/modules/readFileModule.test.js +146 -0
- package/dist/__tests__/pipeline/modules/readFileModule.test.js.map +1 -0
- package/dist/__tests__/pipeline/modules/semanticAnalysisModule.test.js +192 -0
- package/dist/__tests__/pipeline/modules/semanticAnalysisModule.test.js.map +1 -0
- package/dist/__tests__/repoIdentity.test.js +31 -0
- package/dist/__tests__/repoIdentity.test.js.map +1 -0
- package/dist/__tests__/resumeContext.test.js +87 -0
- package/dist/__tests__/resumeContext.test.js.map +1 -0
- package/dist/__tests__/resumeState.test.js +239 -0
- package/dist/__tests__/resumeState.test.js.map +1 -0
- package/dist/__tests__/search/SearchOrchestrator.test.js +836 -0
- package/dist/__tests__/search/SearchOrchestrator.test.js.map +1 -0
- package/dist/__tests__/shellDialogUi.test.js +52 -0
- package/dist/__tests__/shellDialogUi.test.js.map +1 -0
- package/dist/__tests__/shellSession.test.js +102 -0
- package/dist/__tests__/shellSession.test.js.map +1 -0
- package/dist/__tests__/statusOwner.test.js +215 -0
- package/dist/__tests__/statusOwner.test.js.map +1 -0
- package/dist/__tests__/testing/contextEval.test.js +244 -0
- package/dist/__tests__/testing/contextEval.test.js.map +1 -0
- package/dist/__tests__/testing/harnessArtifacts.test.js +124 -0
- package/dist/__tests__/testing/harnessArtifacts.test.js.map +1 -0
- package/dist/__tests__/testing/llmTraceSession.test.js +67 -0
- package/dist/__tests__/testing/llmTraceSession.test.js.map +1 -0
- package/dist/__tests__/testing/registerDevCliCommands.test.js +35 -0
- package/dist/__tests__/testing/registerDevCliCommands.test.js.map +1 -0
- package/dist/__tests__/testing/runDiagnosis.test.js +159 -0
- package/dist/__tests__/testing/runDiagnosis.test.js.map +1 -0
- package/dist/__tests__/testing/runtimeLogReader.test.js +66 -0
- package/dist/__tests__/testing/runtimeLogReader.test.js.map +1 -0
- package/dist/__tests__/testing/testCommands.test.js +53 -0
- package/dist/__tests__/testing/testCommands.test.js.map +1 -0
- package/dist/__tests__/utils/compileSearchQuery.test.js +38 -0
- package/dist/__tests__/utils/compileSearchQuery.test.js.map +1 -0
- package/dist/__tests__/utils/consolePresentation.test.js +105 -0
- package/dist/__tests__/utils/consolePresentation.test.js.map +1 -0
- package/dist/__tests__/utils/extractFileReferences.test.js +41 -0
- package/dist/__tests__/utils/extractFileReferences.test.js.map +1 -0
- package/dist/__tests__/utils/log.test.js +34 -0
- package/dist/__tests__/utils/log.test.js.map +1 -0
- package/dist/__tests__/utils/runtimeLogger.test.js +200 -0
- package/dist/__tests__/utils/runtimeLogger.test.js.map +1 -0
- package/dist/__tests__/utils/spinner.test.js +31 -0
- package/dist/__tests__/utils/spinner.test.js.map +1 -0
- package/dist/__tests__/utils/verifyFocusPreference.test.js +41 -0
- package/dist/__tests__/utils/verifyFocusPreference.test.js.map +1 -0
- package/dist/agent/actions/index.js +301 -0
- package/dist/agent/actions/index.js.map +1 -0
- package/dist/agent/actions/normalize.js +360 -0
- package/dist/agent/actions/normalize.js.map +1 -0
- package/dist/agent/actions/schemas.js +129 -0
- package/dist/agent/actions/schemas.js.map +1 -0
- package/dist/agent/evidence/index.js +320 -0
- package/dist/agent/evidence/index.js.map +1 -0
- package/dist/agent/feedback/index.js +187 -0
- package/dist/agent/feedback/index.js.map +1 -0
- package/dist/agent/finalization/index.js +35 -0
- package/dist/agent/finalization/index.js.map +1 -0
- package/dist/agent/index.js +126 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/logging/index.js +350 -0
- package/dist/agent/logging/index.js.map +1 -0
- package/dist/agent/persistence/boot.js +58 -0
- package/dist/agent/persistence/boot.js.map +1 -0
- package/dist/agent/persistence/currentTask.js +36 -0
- package/dist/agent/persistence/currentTask.js.map +1 -0
- package/dist/agent/persistence/hydrate.js +42 -0
- package/dist/agent/persistence/hydrate.js.map +1 -0
- package/dist/agent/persistence/index.js +15 -0
- package/dist/agent/persistence/index.js.map +1 -0
- package/dist/agent/persistence/snapshots.js +97 -0
- package/dist/agent/persistence/snapshots.js.map +1 -0
- package/dist/agent/persistence/steps.js +95 -0
- package/dist/agent/persistence/steps.js.map +1 -0
- package/dist/agent/persistence/tasks.js +195 -0
- package/dist/agent/persistence/tasks.js.map +1 -0
- package/dist/agent/persistence/turns.js +92 -0
- package/dist/agent/persistence/turns.js.map +1 -0
- package/dist/agent/policy/ambiguityResolution.js +226 -0
- package/dist/agent/policy/ambiguityResolution.js.map +1 -0
- package/dist/agent/policy/contracts.js +2 -0
- package/dist/agent/policy/contracts.js.map +1 -0
- package/dist/agent/policy/coveragePolicy.js +309 -0
- package/dist/agent/policy/coveragePolicy.js.map +1 -0
- package/dist/agent/policy/endDecisionPolicy.js +31 -0
- package/dist/agent/policy/endDecisionPolicy.js.map +1 -0
- package/dist/agent/policy/index.js +344 -0
- package/dist/agent/policy/index.js.map +1 -0
- package/dist/agent/policy/loopReview.js +778 -0
- package/dist/agent/policy/loopReview.js.map +1 -0
- package/dist/agent/policy/readinessPolicy.js +108 -0
- package/dist/agent/policy/readinessPolicy.js.map +1 -0
- package/dist/agent/policy/resolutionPipeline.js +356 -0
- package/dist/agent/policy/resolutionPipeline.js.map +1 -0
- package/dist/agent/policy/targetClassification.js +33 -0
- package/dist/agent/policy/targetClassification.js.map +1 -0
- package/dist/agent/prompting/actionChoice.js +90 -0
- package/dist/agent/prompting/actionChoice.js.map +1 -0
- package/dist/agent/prompting/finalAnswer.js +38 -0
- package/dist/agent/prompting/finalAnswer.js.map +1 -0
- package/dist/agent/prompting/index.js +14 -0
- package/dist/agent/prompting/index.js.map +1 -0
- package/dist/agent/prompting/plan.js +59 -0
- package/dist/agent/prompting/plan.js.map +1 -0
- package/dist/agent/prompting/transform.js +175 -0
- package/dist/agent/prompting/transform.js.map +1 -0
- package/dist/agent/prompting/understand.js +70 -0
- package/dist/agent/prompting/understand.js.map +1 -0
- package/dist/agent/read/freshness.js +29 -0
- package/dist/agent/read/freshness.js.map +1 -0
- package/dist/agent/read/fullReadPrompt.js +43 -0
- package/dist/agent/read/fullReadPrompt.js.map +1 -0
- package/dist/agent/read/index.js +140 -0
- package/dist/agent/read/index.js.map +1 -0
- package/dist/agent/read/persistence.js +88 -0
- package/dist/agent/read/persistence.js.map +1 -0
- package/dist/agent/read/summarizeReadEvidence.js +733 -0
- package/dist/agent/read/summarizeReadEvidence.js.map +1 -0
- package/dist/agent/read/targetResolution.js +126 -0
- package/dist/agent/read/targetResolution.js.map +1 -0
- package/dist/agent/resume/checkpoint.js +41 -0
- package/dist/agent/resume/checkpoint.js.map +1 -0
- package/dist/agent/runtime/lifecycle.js +67 -0
- package/dist/agent/runtime/lifecycle.js.map +1 -0
- package/dist/agent/runtime/progress.js +178 -0
- package/dist/agent/runtime/progress.js.map +1 -0
- package/dist/agent/runtime/runAgentLoop.js +402 -0
- package/dist/agent/runtime/runAgentLoop.js.map +1 -0
- package/dist/agent/runtime/runAgentPlanOnly.js +127 -0
- package/dist/agent/runtime/runAgentPlanOnly.js.map +1 -0
- package/dist/agent/runtime/understand.js +336 -0
- package/dist/agent/runtime/understand.js.map +1 -0
- package/dist/agent/search/batchPlanner.js +274 -0
- package/dist/agent/search/batchPlanner.js.map +1 -0
- package/dist/agent/search/candidateRetentionPolicy.js +184 -0
- package/dist/agent/search/candidateRetentionPolicy.js.map +1 -0
- package/dist/agent/search/directory.js +51 -0
- package/dist/agent/search/directory.js.map +1 -0
- package/dist/agent/search/exactTarget.js +151 -0
- package/dist/agent/search/exactTarget.js.map +1 -0
- package/dist/agent/search/fragment.js +110 -0
- package/dist/agent/search/fragment.js.map +1 -0
- package/dist/agent/search/index.js +166 -0
- package/dist/agent/search/index.js.map +1 -0
- package/dist/agent/search/laneClassifier.js +119 -0
- package/dist/agent/search/laneClassifier.js.map +1 -0
- package/dist/agent/search/limits.js +10 -0
- package/dist/agent/search/limits.js.map +1 -0
- package/dist/agent/search/ranking.js +22 -0
- package/dist/agent/search/ranking.js.map +1 -0
- package/dist/agent/search/regex.js +83 -0
- package/dist/agent/search/regex.js.map +1 -0
- package/dist/agent/search/routePolicy.js +11 -0
- package/dist/agent/search/routePolicy.js.map +1 -0
- package/dist/agent/search/searchContext.js +128 -0
- package/dist/agent/search/searchContext.js.map +1 -0
- package/dist/agent/search/semantic.js +113 -0
- package/dist/agent/search/semantic.js.map +1 -0
- package/dist/agent/search/semanticIndexSearch.js +202 -0
- package/dist/agent/search/semanticIndexSearch.js.map +1 -0
- package/dist/agent/search/shared.js +283 -0
- package/dist/agent/search/shared.js.map +1 -0
- package/dist/agent/search/shell.js +202 -0
- package/dist/agent/search/shell.js.map +1 -0
- package/dist/agent/search/snippetEvidence.js +57 -0
- package/dist/agent/search/snippetEvidence.js.map +1 -0
- package/dist/agent/search/types.js +2 -0
- package/dist/agent/search/types.js.map +1 -0
- package/dist/agent/state/index.js +99 -0
- package/dist/agent/state/index.js.map +1 -0
- package/dist/agent/state/memory.js +56 -0
- package/dist/agent/state/memory.js.map +1 -0
- package/dist/agent/structuredOutput/index.js +28 -0
- package/dist/agent/structuredOutput/index.js.map +1 -0
- package/dist/agent/tools/index.js +199 -0
- package/dist/agent/tools/index.js.map +1 -0
- package/dist/agent/transform/index.js +519 -0
- package/dist/agent/transform/index.js.map +1 -0
- package/dist/agent/transform/syntax.js +49 -0
- package/dist/agent/transform/syntax.js.map +1 -0
- package/dist/agent/types.js +20 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/agents/actionRegistry.js +114 -0
- package/dist/agents/actionRegistry.js.map +1 -0
- package/dist/agents/agent.js +5 -0
- package/dist/agents/agent.js.map +1 -0
- package/dist/agents/agentActions.js +5 -0
- package/dist/agents/agentActions.js.map +1 -0
- package/dist/agents/agentEvidence.js +5 -0
- package/dist/agents/agentEvidence.js.map +1 -0
- package/dist/agents/agentFeedback.js +5 -0
- package/dist/agents/agentFeedback.js.map +1 -0
- package/dist/agents/agentLogging.js +5 -0
- package/dist/agents/agentLogging.js.map +1 -0
- package/dist/agents/agentLoop.js +5 -0
- package/dist/agents/agentLoop.js.map +1 -0
- package/dist/agents/agentMemory.js +5 -0
- package/dist/agents/agentMemory.js.map +1 -0
- package/dist/agents/agentPlanMode.js +5 -0
- package/dist/agents/agentPlanMode.js.map +1 -0
- package/dist/agents/agentPolicyState.js +5 -0
- package/dist/agents/agentPolicyState.js.map +1 -0
- package/dist/agents/agentProgress.js +93 -0
- package/dist/agents/agentProgress.js.map +1 -0
- package/dist/agents/agentSchemas.js +5 -0
- package/dist/agents/agentSchemas.js.map +1 -0
- package/dist/agents/agentSearchScoring.js +5 -0
- package/dist/agents/agentSearchScoring.js.map +1 -0
- package/dist/agents/agentStateMachine.js +5 -0
- package/dist/agents/agentStateMachine.js.map +1 -0
- package/dist/agents/agentTools.js +5 -0
- package/dist/agents/agentTools.js.map +1 -0
- package/dist/agents/agentTypes.js +5 -0
- package/dist/agents/agentTypes.js.map +1 -0
- package/dist/agents/agentUnderstand.js +5 -0
- package/dist/agents/agentUnderstand.js.map +1 -0
- package/dist/agents/analysisPlanGenStep.js +194 -17
- package/dist/agents/analysisPlanGenStep.js.map +1 -0
- package/dist/agents/answerOnlyCompletion.js +32 -0
- package/dist/agents/answerOnlyCompletion.js.map +1 -0
- package/dist/agents/collaboratorStep.js +1 -0
- package/dist/agents/collaboratorStep.js.map +1 -0
- package/dist/agents/decideNextAction.js +444 -0
- package/dist/agents/decideNextAction.js.map +1 -0
- package/dist/agents/deriveFocusFromSearchStep.js +83 -0
- package/dist/agents/deriveFocusFromSearchStep.js.map +1 -0
- package/dist/agents/evidenceVerifierStep.js +104 -13
- package/dist/agents/evidenceVerifierStep.js.map +1 -0
- package/dist/agents/fileCheckStep.js +381 -12
- package/dist/agents/fileCheckStep.js.map +1 -0
- package/dist/agents/giveUpEvaluatorStep.js +63 -0
- package/dist/agents/giveUpEvaluatorStep.js.map +1 -0
- package/dist/agents/guardPolicy.js +20 -0
- package/dist/agents/guardPolicy.js.map +1 -0
- package/dist/agents/guards/executionPolicyResolver.js +165 -0
- package/dist/agents/guards/executionPolicyResolver.js.map +1 -0
- package/dist/agents/guards/guardState.js +195 -0
- package/dist/agents/guards/guardState.js.map +1 -0
- package/dist/agents/guards/resolveProgressState.js +403 -0
- package/dist/agents/guards/resolveProgressState.js.map +1 -0
- package/dist/agents/infoPlanGenStep.js +66 -8
- package/dist/agents/infoPlanGenStep.js.map +1 -0
- package/dist/agents/integrateFeedbackStep.js +1 -0
- package/dist/agents/integrateFeedbackStep.js.map +1 -0
- package/dist/agents/iterationFileSelector.js +8 -7
- package/dist/agents/iterationFileSelector.js.map +1 -0
- package/dist/agents/mainAgentActivityLog.js +85 -0
- package/dist/agents/mainAgentActivityLog.js.map +1 -0
- package/dist/agents/mainAgentHeuristics.js +173 -0
- package/dist/agents/mainAgentHeuristics.js.map +1 -0
- package/dist/agents/mainAgentVerify.js +159 -0
- package/dist/agents/mainAgentVerify.js.map +1 -0
- package/dist/agents/objectiveEvaluatorStep.js +103 -0
- package/dist/agents/objectiveEvaluatorStep.js.map +1 -0
- package/dist/agents/outerLoopRecoveryEvaluator.js +108 -0
- package/dist/agents/outerLoopRecoveryEvaluator.js.map +1 -0
- package/dist/agents/readinessGateStep.js +95 -9
- package/dist/agents/readinessGateStep.js.map +1 -0
- package/dist/agents/reasonNextStep.js +9 -8
- package/dist/agents/reasonNextStep.js.map +1 -0
- package/dist/agents/reasonNextTaskStep.js +267 -144
- package/dist/agents/reasonNextTaskStep.js.map +1 -0
- package/dist/agents/researchPlanGenStep.js +61 -25
- package/dist/agents/researchPlanGenStep.js.map +1 -0
- package/dist/agents/resolveAgentTargetClassification.js +5 -0
- package/dist/agents/resolveAgentTargetClassification.js.map +1 -0
- package/dist/agents/resolveExecutionModeStep.js +1 -0
- package/dist/agents/resolveExecutionModeStep.js.map +1 -0
- package/dist/agents/resolveExplicitTargetsStep.js +74 -0
- package/dist/agents/resolveExplicitTargetsStep.js.map +1 -0
- package/dist/agents/routingDecisionStep.js +58 -11
- package/dist/agents/routingDecisionStep.js.map +1 -0
- package/dist/agents/scopeClassificationStep.js +66 -3
- package/dist/agents/scopeClassificationStep.js.map +1 -0
- package/dist/agents/selectRelevantSourcesStep.js +13 -5
- package/dist/agents/selectRelevantSourcesStep.js.map +1 -0
- package/dist/agents/structuralPreloadStep.js +3 -4
- package/dist/agents/structuralPreloadStep.js.map +1 -0
- package/dist/agents/transformPlanGenStep.js +105 -18
- package/dist/agents/transformPlanGenStep.js.map +1 -0
- package/dist/agents/understandIntentStep.js +237 -17
- package/dist/agents/understandIntentStep.js.map +1 -0
- package/dist/agents/validateChangesStep.js +16 -2
- package/dist/agents/validateChangesStep.js.map +1 -0
- package/dist/agents/writeFileStep.js +1 -0
- package/dist/agents/writeFileStep.js.map +1 -0
- package/dist/commands/AskCmd.js +139 -44
- package/dist/commands/AskCmd.js.map +1 -0
- package/dist/commands/BackupCmd.js +1 -0
- package/dist/commands/BackupCmd.js.map +1 -0
- package/dist/commands/ChangeLogUpdateCmd.js +1 -0
- package/dist/commands/ChangeLogUpdateCmd.js.map +1 -0
- package/dist/commands/CommitSuggesterCmd.js +55 -13
- package/dist/commands/CommitSuggesterCmd.js.map +1 -0
- package/dist/commands/DaemonCmd.js +52 -14
- package/dist/commands/DaemonCmd.js.map +1 -0
- package/dist/commands/DeleteIndex.js +1 -0
- package/dist/commands/DeleteIndex.js.map +1 -0
- package/dist/commands/EvalReportCmd.js +374 -0
- package/dist/commands/EvalReportCmd.js.map +1 -0
- package/dist/commands/FindCmd.js +1 -0
- package/dist/commands/FindCmd.js.map +1 -0
- package/dist/commands/GitCmd.js +1 -0
- package/dist/commands/GitCmd.js.map +1 -0
- package/dist/commands/IndexCmd.js +11 -79
- package/dist/commands/IndexCmd.js.map +1 -0
- package/dist/commands/InspectCmd.js +1 -0
- package/dist/commands/InspectCmd.js.map +1 -0
- package/dist/commands/ModelCmd.js +24 -0
- package/dist/commands/ModelCmd.js.map +1 -0
- package/dist/commands/ReadlineSingleton.js +1 -0
- package/dist/commands/ReadlineSingleton.js.map +1 -0
- package/dist/commands/ResetDbCmd.js +18 -1
- package/dist/commands/ResetDbCmd.js.map +1 -0
- package/dist/commands/ReviewCmd.js +1 -0
- package/dist/commands/ReviewCmd.js.map +1 -0
- package/dist/commands/StatusCmd.js +22 -0
- package/dist/commands/StatusCmd.js.map +1 -0
- package/dist/commands/StopDaemonCmd.js +1 -0
- package/dist/commands/StopDaemonCmd.js.map +1 -0
- package/dist/commands/SummaryCmd.js +1 -0
- package/dist/commands/SummaryCmd.js.map +1 -0
- package/dist/commands/SwitchCmd.js +9 -15
- package/dist/commands/SwitchCmd.js.map +1 -0
- package/dist/commands/TasksCmd.js +142 -57
- package/dist/commands/TasksCmd.js.map +1 -0
- package/dist/commands/TestCmd.js +66 -0
- package/dist/commands/TestCmd.js.map +1 -0
- package/dist/commands/WorkflowCmd.js +1 -0
- package/dist/commands/WorkflowCmd.js.map +1 -0
- package/dist/commands/commandVisibility.js +27 -0
- package/dist/commands/commandVisibility.js.map +1 -0
- package/dist/commands/evalCommands.js +1337 -0
- package/dist/commands/evalCommands.js.map +1 -0
- package/dist/commands/factory.js +206 -38
- package/dist/commands/factory.js.map +1 -0
- package/dist/config.js +62 -11
- package/dist/config.js.map +1 -0
- package/dist/constants.js +21 -3
- package/dist/constants.js.map +1 -0
- package/dist/context.js +33 -32
- package/dist/context.js.map +1 -0
- package/dist/daemon/daemonQueues.js +1 -20
- package/dist/daemon/daemonQueues.js.map +1 -0
- package/dist/daemon/daemonWorker.js +26 -37
- package/dist/daemon/daemonWorker.js.map +1 -0
- package/dist/daemon/generateSummaries.js +1 -0
- package/dist/daemon/generateSummaries.js.map +1 -0
- package/dist/daemon/runFolderCapsuleBatch.js +1 -0
- package/dist/daemon/runFolderCapsuleBatch.js.map +1 -0
- package/dist/daemon/runIndexingBatch.js +1 -0
- package/dist/daemon/runIndexingBatch.js.map +1 -0
- package/dist/daemon/runKgBatch.js +9 -1
- package/dist/daemon/runKgBatch.js.map +1 -0
- package/dist/db/backup.js +1 -0
- package/dist/db/backup.js.map +1 -0
- package/dist/db/client.js +18 -3
- package/dist/db/client.js.map +1 -0
- package/dist/db/fileIndex.js +110 -152
- package/dist/db/fileIndex.js.map +1 -0
- package/dist/db/functionExtractors/extractFromJava.js +1 -0
- package/dist/db/functionExtractors/extractFromJava.js.map +1 -0
- package/dist/db/functionExtractors/extractFromJs.js +1 -0
- package/dist/db/functionExtractors/extractFromJs.js.map +1 -0
- package/dist/db/functionExtractors/extractFromTs.js +1 -0
- package/dist/db/functionExtractors/extractFromTs.js.map +1 -0
- package/dist/db/functionExtractors/extractFromXML.js +1 -0
- package/dist/db/functionExtractors/extractFromXML.js.map +1 -0
- package/dist/db/functionExtractors/index.js +1 -0
- package/dist/db/functionExtractors/index.js.map +1 -0
- package/dist/db/functionIndex.js +9 -0
- package/dist/db/functionIndex.js.map +1 -0
- package/dist/db/schema.js +314 -99
- package/dist/db/schema.js.map +1 -0
- package/dist/db/sqlTemplates.js +1 -0
- package/dist/db/sqlTemplates.js.map +1 -0
- package/dist/fileRules/builtins.js +1 -0
- package/dist/fileRules/builtins.js.map +1 -0
- package/dist/fileRules/classifyFile.js +1 -0
- package/dist/fileRules/classifyFile.js.map +1 -0
- package/dist/fileRules/codeAllowedExtensions.js +1 -0
- package/dist/fileRules/codeAllowedExtensions.js.map +1 -0
- package/dist/fileRules/detectFileType.js +1 -0
- package/dist/fileRules/detectFileType.js.map +1 -0
- package/dist/fileRules/fileClassifier.js +1 -0
- package/dist/fileRules/fileClassifier.js.map +1 -0
- package/dist/fileRules/fileExceptions.js +1 -0
- package/dist/fileRules/fileExceptions.js.map +1 -0
- package/dist/fileRules/ignoredExtensions.js +1 -0
- package/dist/fileRules/ignoredExtensions.js.map +1 -0
- package/dist/fileRules/ignoredPaths.js +48 -5
- package/dist/fileRules/ignoredPaths.js.map +1 -0
- package/dist/fileRules/queryTokenRules.js +176 -0
- package/dist/fileRules/queryTokenRules.js.map +1 -0
- package/dist/fileRules/searchPathClassification.js +58 -0
- package/dist/fileRules/searchPathClassification.js.map +1 -0
- package/dist/fileRules/shouldIgnoreFiles.js +1 -0
- package/dist/fileRules/shouldIgnoreFiles.js.map +1 -0
- package/dist/fileRules/stopWords.js +9 -0
- package/dist/fileRules/stopWords.js.map +1 -0
- package/dist/fileRules/wellKnownRepoFiles.js +1 -0
- package/dist/fileRules/wellKnownRepoFiles.js.map +1 -0
- package/dist/git/commitSummary.js +227 -0
- package/dist/git/commitSummary.js.map +1 -0
- package/dist/github/api.js +1 -0
- package/dist/github/api.js.map +1 -0
- package/dist/github/auth.js +1 -0
- package/dist/github/auth.js.map +1 -0
- package/dist/github/github.js +1 -0
- package/dist/github/github.js.map +1 -0
- package/dist/github/githubAuthCheck.js +1 -0
- package/dist/github/githubAuthCheck.js.map +1 -0
- package/dist/github/postComments.js +1 -0
- package/dist/github/postComments.js.map +1 -0
- package/dist/github/repo.js +15 -24
- package/dist/github/repo.js.map +1 -0
- package/dist/github/token.js +1 -0
- package/dist/github/token.js.map +1 -0
- package/dist/github/types.js +1 -0
- package/dist/github/types.js.map +1 -0
- package/dist/index.js +318 -37
- package/dist/index.js.map +1 -0
- package/dist/lib/generate.js +264 -20
- package/dist/lib/generate.js.map +1 -0
- package/dist/lib/generateFolderCapsules.js +1 -0
- package/dist/lib/generateFolderCapsules.js.map +1 -0
- package/dist/lib/ollamaModelPolicy.js +59 -0
- package/dist/lib/ollamaModelPolicy.js.map +1 -0
- package/dist/lib/spinner.js +29 -9
- package/dist/lib/spinner.js.map +1 -0
- package/dist/modelSetup.js +25 -78
- package/dist/modelSetup.js.map +1 -0
- package/dist/pipeline/modules/changeLogModule.js +10 -1
- package/dist/pipeline/modules/changeLogModule.js.map +1 -0
- package/dist/pipeline/modules/cleanupModule.js +1 -0
- package/dist/pipeline/modules/cleanupModule.js.map +1 -0
- package/dist/pipeline/modules/codeTransformModule.js +10 -16
- package/dist/pipeline/modules/codeTransformModule.js.map +1 -0
- package/dist/pipeline/modules/commentModule.js +12 -0
- package/dist/pipeline/modules/commentModule.js.map +1 -0
- package/dist/pipeline/modules/commitSuggesterModule.js +82 -12
- package/dist/pipeline/modules/commitSuggesterModule.js.map +1 -0
- package/dist/pipeline/modules/contextReviewModule.js +12 -1
- package/dist/pipeline/modules/contextReviewModule.js.map +1 -0
- package/dist/pipeline/modules/dialogAnswerModule.js +58 -0
- package/dist/pipeline/modules/dialogAnswerModule.js.map +1 -0
- package/dist/pipeline/modules/fileSearchModule.js +5 -143
- package/dist/pipeline/modules/fileSearchModule.js.map +1 -0
- package/dist/pipeline/modules/finalAnswerModule.js +1176 -151
- package/dist/pipeline/modules/finalAnswerModule.js.map +1 -0
- package/dist/pipeline/modules/kgModule.js +18 -1
- package/dist/pipeline/modules/kgModule.js.map +1 -0
- package/dist/pipeline/modules/planAnswerModule.js +99 -0
- package/dist/pipeline/modules/planAnswerModule.js.map +1 -0
- package/dist/pipeline/modules/readFileModule.js +300 -0
- package/dist/pipeline/modules/readFileModule.js.map +1 -0
- package/dist/pipeline/modules/reviewModule.js +10 -1
- package/dist/pipeline/modules/reviewModule.js.map +1 -0
- package/dist/pipeline/modules/searchDbModule.js +159 -0
- package/dist/pipeline/modules/searchDbModule.js.map +1 -0
- package/dist/pipeline/modules/searchListDirectoryModule.js +62 -0
- package/dist/pipeline/modules/searchListDirectoryModule.js.map +1 -0
- package/dist/pipeline/modules/searchModuleShared.js +71 -0
- package/dist/pipeline/modules/searchModuleShared.js.map +1 -0
- package/dist/pipeline/modules/searchRegexModule.js +59 -0
- package/dist/pipeline/modules/searchRegexModule.js.map +1 -0
- package/dist/pipeline/modules/semanticAnalysisModule.js +185 -28
- package/dist/pipeline/modules/semanticAnalysisModule.js.map +1 -0
- package/dist/pipeline/modules/summaryModule.js +11 -1
- package/dist/pipeline/modules/summaryModule.js.map +1 -0
- package/dist/pipeline/registry/moduleRegistry.js +9 -0
- package/dist/pipeline/registry/moduleRegistry.js.map +1 -0
- package/dist/pipeline/runModulePipeline.js +1 -0
- package/dist/pipeline/runModulePipeline.js.map +1 -0
- package/dist/scripts/dbScriptSupport.js +172 -0
- package/dist/scripts/dbScriptSupport.js.map +1 -0
- package/dist/scripts/dbcheck.js +173 -267
- package/dist/scripts/dbcheck.js.map +1 -0
- package/dist/scripts/dboverview.js +161 -0
- package/dist/scripts/dboverview.js.map +1 -0
- package/dist/scripts/migrateDb.js +1 -0
- package/dist/scripts/migrateDb.js.map +1 -0
- package/dist/search/SearchOrchestrator.js +928 -0
- package/dist/search/SearchOrchestrator.js.map +1 -0
- package/dist/search/sharedRankingPolicy.js +283 -0
- package/dist/search/sharedRankingPolicy.js.map +1 -0
- package/dist/setup/reindexOwner.js +97 -0
- package/dist/setup/reindexOwner.js.map +1 -0
- package/dist/setup/setupOwner.js +100 -0
- package/dist/setup/setupOwner.js.map +1 -0
- package/dist/shell/dialogUi.js +81 -0
- package/dist/shell/dialogUi.js.map +1 -0
- package/dist/shellSession.js +126 -0
- package/dist/shellSession.js.map +1 -0
- package/dist/status/statusOwner.js +239 -0
- package/dist/status/statusOwner.js.map +1 -0
- package/dist/testing/contextEval.js +514 -0
- package/dist/testing/contextEval.js.map +1 -0
- package/dist/testing/fixtures/transform/small-file.input.js +5 -0
- package/dist/testing/fixtures/transform/small-file.input.js.map +1 -0
- package/dist/testing/harnessArtifacts.js +112 -0
- package/dist/testing/harnessArtifacts.js.map +1 -0
- package/dist/testing/llmTraceSession.js +67 -0
- package/dist/testing/llmTraceSession.js.map +1 -0
- package/dist/testing/registerDevCliCommands.js +43 -0
- package/dist/testing/registerDevCliCommands.js.map +1 -0
- package/dist/testing/runDiagnosis.js +248 -0
- package/dist/testing/runDiagnosis.js.map +1 -0
- package/dist/testing/runtimeLogReader.js +144 -0
- package/dist/testing/runtimeLogReader.js.map +1 -0
- package/dist/testing/testCommands.js +35 -303
- package/dist/testing/testCommands.js.map +1 -0
- package/dist/testing/testRegistry.js +233 -0
- package/dist/testing/testRegistry.js.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/buildContextualPrompt.js +26 -75
- package/dist/utils/buildContextualPrompt.js.map +1 -0
- package/dist/utils/changeLogPrompt.js +1 -0
- package/dist/utils/changeLogPrompt.js.map +1 -0
- package/dist/utils/checkModel.js +17 -92
- package/dist/utils/checkModel.js.map +1 -0
- package/dist/utils/commentMap.js +1 -0
- package/dist/utils/commentMap.js.map +1 -0
- package/dist/utils/compileSearchQuery.js +23 -9
- package/dist/utils/compileSearchQuery.js.map +1 -0
- package/dist/utils/consolePresentation.js +208 -0
- package/dist/utils/consolePresentation.js.map +1 -0
- package/dist/utils/contentUtils.js +17 -2
- package/dist/utils/contentUtils.js.map +1 -0
- package/dist/utils/debugContext.js +1 -0
- package/dist/utils/debugContext.js.map +1 -0
- package/dist/utils/dialogState.js +201 -0
- package/dist/utils/dialogState.js.map +1 -0
- package/dist/utils/editor.js +1 -0
- package/dist/utils/editor.js.map +1 -0
- package/dist/utils/executionEvidence.js +50 -0
- package/dist/utils/executionEvidence.js.map +1 -0
- package/dist/utils/extractFileReferences.js +140 -6
- package/dist/utils/extractFileReferences.js.map +1 -0
- package/dist/utils/fileEvidenceCache.js +50 -0
- package/dist/utils/fileEvidenceCache.js.map +1 -0
- package/dist/utils/fileTree.js +1 -0
- package/dist/utils/fileTree.js.map +1 -0
- package/dist/utils/loadRelevantFolderCapsules.js +35 -5
- package/dist/utils/loadRelevantFolderCapsules.js.map +1 -0
- package/dist/utils/log.js +10 -1
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/normalizeData.js +1 -0
- package/dist/utils/normalizeData.js.map +1 -0
- package/dist/utils/ollamaModelStatus.js +28 -0
- package/dist/utils/ollamaModelStatus.js.map +1 -0
- package/dist/utils/ollamaService.js +294 -0
- package/dist/utils/ollamaService.js.map +1 -0
- package/dist/utils/outputFormatter.js +1 -0
- package/dist/utils/outputFormatter.js.map +1 -0
- package/dist/utils/parseTaggedContent.js +1 -0
- package/dist/utils/parseTaggedContent.js.map +1 -0
- package/dist/utils/planActions.js +27 -46
- package/dist/utils/planActions.js.map +1 -0
- package/dist/utils/promptBuilderHelper.js +1 -0
- package/dist/utils/promptBuilderHelper.js.map +1 -0
- package/dist/utils/promptLogHelper.js +29 -13
- package/dist/utils/promptLogHelper.js.map +1 -0
- package/dist/utils/queryAnchors.js +71 -0
- package/dist/utils/queryAnchors.js.map +1 -0
- package/dist/utils/repoIdentity.js +82 -0
- package/dist/utils/repoIdentity.js.map +1 -0
- package/dist/utils/repoKey.js +1 -0
- package/dist/utils/repoKey.js.map +1 -0
- package/dist/utils/resolveTargetsToFiles.js +1 -0
- package/dist/utils/resolveTargetsToFiles.js.map +1 -0
- package/dist/utils/resumeContext.js +219 -0
- package/dist/utils/resumeContext.js.map +1 -0
- package/dist/utils/resumeState.js +310 -0
- package/dist/utils/resumeState.js.map +1 -0
- package/dist/utils/rollingPlan.js +118 -0
- package/dist/utils/rollingPlan.js.map +1 -0
- package/dist/utils/runQueryWithDaemonControl.js +11 -3
- package/dist/utils/runQueryWithDaemonControl.js.map +1 -0
- package/dist/utils/runtimeLogger.js +252 -0
- package/dist/utils/runtimeLogger.js.map +1 -0
- package/dist/utils/sanitizeQuery.js +1 -0
- package/dist/utils/sanitizeQuery.js.map +1 -0
- package/dist/utils/sharedUtils.js +1 -0
- package/dist/utils/sharedUtils.js.map +1 -0
- package/dist/utils/sleep.js +1 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/splitCodeIntoChunk.js +1 -0
- package/dist/utils/splitCodeIntoChunk.js.map +1 -0
- package/dist/utils/time.js +66 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/verifyFocusPreference.js +107 -0
- package/dist/utils/verifyFocusPreference.js.map +1 -0
- package/dist/utils/vscode.js +1 -0
- package/dist/utils/vscode.js.map +1 -0
- package/dist/workflow/workflowResolver.js +1 -0
- package/dist/workflow/workflowResolver.js.map +1 -0
- package/dist/workflow/workflowRunner.js +1 -0
- package/dist/workflow/workflowRunner.js.map +1 -0
- package/package.json +3 -3
- package/dist/agents/MainAgent.js +0 -1886
- package/dist/agents/contextReviewStep.js +0 -101
- package/dist/agents/finalPlanGenStep.js +0 -107
- package/dist/agents/structuralAnalysisStep.js +0 -46
- package/dist/agents/validationAnalysisStep.js +0 -87
- package/dist/pipeline/modules/chunkManagerModule.js +0 -24
- package/dist/pipeline/modules/cleanGeneratedTestsModule.js +0 -33
- package/dist/pipeline/modules/fileReaderModule.js +0 -72
- package/dist/pipeline/modules/gatherInfoModule.js +0 -181
- package/dist/pipeline/modules/generateTestsModule.js +0 -68
- package/dist/pipeline/modules/preserveCodeModule.js +0 -195
- package/dist/pipeline/modules/refactorModule.js +0 -40
- package/dist/pipeline/modules/repairTestsModule.js +0 -48
- package/dist/pipeline/modules/runTestsModule.js +0 -37
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies the shared search orchestrator keeps discovery modes separate and stable.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists:
|
|
5
|
+
* - exact target, fragment, semantic, and operator search now route through one packet
|
|
6
|
+
* - fake explicit refs and ambiguous targets were known regressions
|
|
7
|
+
* - snippet and pattern modes must preserve raw matches without inventing execution state
|
|
8
|
+
*/
|
|
9
|
+
import fs from "fs";
|
|
10
|
+
import os from "os";
|
|
11
|
+
import path from "path";
|
|
12
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
13
|
+
const mocks = vi.hoisted(() => ({
|
|
14
|
+
resolveSymbolRows: vi.fn(),
|
|
15
|
+
resolveSymbolRowsByPattern: vi.fn(),
|
|
16
|
+
semanticSearchFiles: vi.fn(),
|
|
17
|
+
plannerSearchFiles: vi.fn(),
|
|
18
|
+
buildMethodSelectionRetrievalQuery: vi.fn(() => null),
|
|
19
|
+
isMethodSelectionRetrievalQuery: vi.fn(() => false),
|
|
20
|
+
scoreCandidateFiles: vi.fn((filePaths) => filePaths.map((filePath, index) => ({
|
|
21
|
+
filePath,
|
|
22
|
+
score: 10 - index,
|
|
23
|
+
reasons: [],
|
|
24
|
+
}))),
|
|
25
|
+
}));
|
|
26
|
+
vi.mock("../../db/client.js", () => ({
|
|
27
|
+
getDbForRepo: vi.fn(() => ({})),
|
|
28
|
+
}));
|
|
29
|
+
vi.mock("../../db/fileIndex.js", () => ({
|
|
30
|
+
resolveSymbolRows: mocks.resolveSymbolRows,
|
|
31
|
+
resolveSymbolRowsByPattern: mocks.resolveSymbolRowsByPattern,
|
|
32
|
+
resolveTargetRows: vi.fn(),
|
|
33
|
+
semanticSearchFiles: mocks.semanticSearchFiles,
|
|
34
|
+
plannerSearchFiles: mocks.plannerSearchFiles,
|
|
35
|
+
}));
|
|
36
|
+
vi.mock("../../search/sharedRankingPolicy.js", () => ({
|
|
37
|
+
buildMethodSelectionRetrievalQuery: mocks.buildMethodSelectionRetrievalQuery,
|
|
38
|
+
isMethodSelectionRetrievalQuery: mocks.isMethodSelectionRetrievalQuery,
|
|
39
|
+
scoreCandidateFiles: mocks.scoreCandidateFiles,
|
|
40
|
+
}));
|
|
41
|
+
vi.mock("child_process", () => ({
|
|
42
|
+
execFileSync: vi.fn(() => {
|
|
43
|
+
const error = new Error("rg missing");
|
|
44
|
+
error.code = "ENOENT";
|
|
45
|
+
throw error;
|
|
46
|
+
}),
|
|
47
|
+
}));
|
|
48
|
+
import { SearchOrchestrator } from "../../search/SearchOrchestrator.js";
|
|
49
|
+
describe("SearchOrchestrator", () => {
|
|
50
|
+
const tempDirs = [];
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
vi.clearAllMocks();
|
|
53
|
+
mocks.resolveSymbolRows.mockReturnValue([]);
|
|
54
|
+
mocks.resolveSymbolRowsByPattern.mockReturnValue([]);
|
|
55
|
+
mocks.semanticSearchFiles.mockResolvedValue([]);
|
|
56
|
+
mocks.plannerSearchFiles.mockResolvedValue([]);
|
|
57
|
+
mocks.buildMethodSelectionRetrievalQuery.mockReturnValue(null);
|
|
58
|
+
mocks.isMethodSelectionRetrievalQuery.mockReturnValue(false);
|
|
59
|
+
mocks.scoreCandidateFiles.mockImplementation((filePaths) => filePaths.map((filePath, index) => ({
|
|
60
|
+
filePath,
|
|
61
|
+
score: 10 - index,
|
|
62
|
+
reasons: [],
|
|
63
|
+
})));
|
|
64
|
+
});
|
|
65
|
+
afterEach(() => {
|
|
66
|
+
while (tempDirs.length > 0) {
|
|
67
|
+
const dir = tempDirs.pop();
|
|
68
|
+
if (dir)
|
|
69
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
it("resolves exact files, folders, symbols, and rejects fake explicit refs", async () => {
|
|
73
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
74
|
+
tempDirs.push(repoRoot);
|
|
75
|
+
const targetFile = path.join(repoRoot, "cli", "src", "commands", "EvalReportCmd.ts");
|
|
76
|
+
const folderPath = path.join(repoRoot, "cli", "src", "agents");
|
|
77
|
+
fs.mkdirSync(path.dirname(targetFile), { recursive: true });
|
|
78
|
+
fs.mkdirSync(folderPath, { recursive: true });
|
|
79
|
+
fs.writeFileSync(targetFile, "export const report = true;\n", "utf8");
|
|
80
|
+
mocks.resolveSymbolRows.mockReturnValue([
|
|
81
|
+
{
|
|
82
|
+
id: 7,
|
|
83
|
+
path: targetFile,
|
|
84
|
+
filename: "EvalReportCmd.ts",
|
|
85
|
+
summary: null,
|
|
86
|
+
type: "ts",
|
|
87
|
+
lastModified: new Date(0).toISOString(),
|
|
88
|
+
},
|
|
89
|
+
]);
|
|
90
|
+
const result = await new SearchOrchestrator().run({
|
|
91
|
+
context: {
|
|
92
|
+
initContext: {
|
|
93
|
+
userQuery: "Trace EvalReportCmd in cli/src/agents and run runSearch, not task.id",
|
|
94
|
+
executionPath: repoRoot,
|
|
95
|
+
repoRootPath: repoRoot,
|
|
96
|
+
},
|
|
97
|
+
analysis: {
|
|
98
|
+
intent: {
|
|
99
|
+
intent: "trace",
|
|
100
|
+
intentCategory: "explanation",
|
|
101
|
+
normalizedQuery: "Trace EvalReportCmd in cli/src/agents and run runSearch, not task.id",
|
|
102
|
+
confidence: 0.9,
|
|
103
|
+
targetFiles: ["EvalReportCmd", "cli/src/agents", "task.id"],
|
|
104
|
+
targetSymbols: ["runSearch"],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
query: "Trace EvalReportCmd in cli/src/agents and run runSearch, not task.id",
|
|
109
|
+
mode: "exact-target",
|
|
110
|
+
});
|
|
111
|
+
expect(result.mode).toBe("exact-target");
|
|
112
|
+
expect(result.resolvedFiles.map(item => item.path)).toContain(targetFile);
|
|
113
|
+
expect(result.resolvedFolders).toContain(folderPath);
|
|
114
|
+
expect(result.resolvedSymbols).toEqual([{ symbol: "runSearch", filePath: targetFile }]);
|
|
115
|
+
expect(result.unresolvedRefs).toContain("task.id");
|
|
116
|
+
expect(result.ambiguousRefs).toEqual([]);
|
|
117
|
+
});
|
|
118
|
+
it("falls back to pattern symbol resolution when exact symbol lookup misses", async () => {
|
|
119
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
120
|
+
tempDirs.push(repoRoot);
|
|
121
|
+
const targetFile = path.join(repoRoot, "cli", "src", "agents", "MainAgent.ts");
|
|
122
|
+
fs.mkdirSync(path.dirname(targetFile), { recursive: true });
|
|
123
|
+
fs.writeFileSync(targetFile, "export function runSearchNow() {}\n", "utf8");
|
|
124
|
+
mocks.resolveSymbolRows.mockReturnValue([]);
|
|
125
|
+
mocks.resolveSymbolRowsByPattern.mockReturnValue([
|
|
126
|
+
{
|
|
127
|
+
id: 9,
|
|
128
|
+
path: targetFile,
|
|
129
|
+
filename: "MainAgent.ts",
|
|
130
|
+
summary: null,
|
|
131
|
+
type: "ts",
|
|
132
|
+
lastModified: new Date(0).toISOString(),
|
|
133
|
+
},
|
|
134
|
+
]);
|
|
135
|
+
const result = await new SearchOrchestrator().run({
|
|
136
|
+
context: {
|
|
137
|
+
initContext: {
|
|
138
|
+
userQuery: "Trace run search now",
|
|
139
|
+
executionPath: repoRoot,
|
|
140
|
+
repoRootPath: repoRoot,
|
|
141
|
+
},
|
|
142
|
+
analysis: {
|
|
143
|
+
intent: {
|
|
144
|
+
intent: "trace",
|
|
145
|
+
intentCategory: "explanation",
|
|
146
|
+
normalizedQuery: "Trace run search now",
|
|
147
|
+
confidence: 0.9,
|
|
148
|
+
targetFiles: [],
|
|
149
|
+
targetSymbols: ["run search now"],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
query: "Trace run search now",
|
|
154
|
+
mode: "exact-target",
|
|
155
|
+
});
|
|
156
|
+
expect(result.resolvedSymbols).toEqual([{ symbol: "run search now", filePath: targetFile }]);
|
|
157
|
+
expect(result.unresolvedRefs).toEqual([]);
|
|
158
|
+
});
|
|
159
|
+
it("marks pattern symbol fallback with multiple hits as ambiguous", async () => {
|
|
160
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
161
|
+
tempDirs.push(repoRoot);
|
|
162
|
+
const firstFile = path.join(repoRoot, "cli", "src", "agents", "MainAgent.ts");
|
|
163
|
+
const secondFile = path.join(repoRoot, "cli", "src", "search", "SearchOrchestrator.ts");
|
|
164
|
+
fs.mkdirSync(path.dirname(firstFile), { recursive: true });
|
|
165
|
+
fs.mkdirSync(path.dirname(secondFile), { recursive: true });
|
|
166
|
+
fs.writeFileSync(firstFile, "export function runSearchNow() {}\n", "utf8");
|
|
167
|
+
fs.writeFileSync(secondFile, "export function runSearchNow() {}\n", "utf8");
|
|
168
|
+
mocks.resolveSymbolRows.mockReturnValue([]);
|
|
169
|
+
mocks.resolveSymbolRowsByPattern.mockReturnValue([
|
|
170
|
+
{
|
|
171
|
+
id: 9,
|
|
172
|
+
path: firstFile,
|
|
173
|
+
filename: "MainAgent.ts",
|
|
174
|
+
summary: null,
|
|
175
|
+
type: "ts",
|
|
176
|
+
lastModified: new Date(0).toISOString(),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 10,
|
|
180
|
+
path: secondFile,
|
|
181
|
+
filename: "SearchOrchestrator.ts",
|
|
182
|
+
summary: null,
|
|
183
|
+
type: "ts",
|
|
184
|
+
lastModified: new Date(0).toISOString(),
|
|
185
|
+
},
|
|
186
|
+
]);
|
|
187
|
+
const result = await new SearchOrchestrator().run({
|
|
188
|
+
context: {
|
|
189
|
+
initContext: {
|
|
190
|
+
userQuery: "Trace run search now",
|
|
191
|
+
executionPath: repoRoot,
|
|
192
|
+
repoRootPath: repoRoot,
|
|
193
|
+
},
|
|
194
|
+
analysis: {
|
|
195
|
+
intent: {
|
|
196
|
+
intent: "trace",
|
|
197
|
+
intentCategory: "explanation",
|
|
198
|
+
normalizedQuery: "Trace run search now",
|
|
199
|
+
confidence: 0.9,
|
|
200
|
+
targetFiles: [],
|
|
201
|
+
targetSymbols: ["run search now"],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
query: "Trace run search now",
|
|
206
|
+
mode: "exact-target",
|
|
207
|
+
});
|
|
208
|
+
expect(result.resolvedSymbols).toEqual([]);
|
|
209
|
+
expect(result.ambiguousRefs).toContain("run search now");
|
|
210
|
+
});
|
|
211
|
+
it("marks ambiguous exact file refs instead of silently broadening", async () => {
|
|
212
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
213
|
+
tempDirs.push(repoRoot);
|
|
214
|
+
const firstFile = path.join(repoRoot, "cli", "src", "agents", "MainAgent.ts");
|
|
215
|
+
const secondFile = path.join(repoRoot, "dashboard", "src", "MainAgent.ts");
|
|
216
|
+
fs.mkdirSync(path.dirname(firstFile), { recursive: true });
|
|
217
|
+
fs.mkdirSync(path.dirname(secondFile), { recursive: true });
|
|
218
|
+
fs.writeFileSync(firstFile, "export const first = true;\n", "utf8");
|
|
219
|
+
fs.writeFileSync(secondFile, "export const second = true;\n", "utf8");
|
|
220
|
+
const result = await new SearchOrchestrator().run({
|
|
221
|
+
context: {
|
|
222
|
+
initContext: {
|
|
223
|
+
userQuery: "Trace MainAgent.ts",
|
|
224
|
+
executionPath: repoRoot,
|
|
225
|
+
repoRootPath: repoRoot,
|
|
226
|
+
},
|
|
227
|
+
analysis: {
|
|
228
|
+
intent: {
|
|
229
|
+
intent: "trace",
|
|
230
|
+
intentCategory: "explanation",
|
|
231
|
+
normalizedQuery: "Trace MainAgent.ts",
|
|
232
|
+
confidence: 0.9,
|
|
233
|
+
targetFiles: ["MainAgent.ts"],
|
|
234
|
+
targetSymbols: [],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
query: "Trace MainAgent.ts",
|
|
239
|
+
mode: "exact-target",
|
|
240
|
+
});
|
|
241
|
+
expect(result.resolvedFiles).toHaveLength(0);
|
|
242
|
+
expect(result.ambiguousRefs).toContain("MainAgent.ts");
|
|
243
|
+
});
|
|
244
|
+
it("resolves basename-only and natural-language folder refs into folder-scoped child candidates", async () => {
|
|
245
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
246
|
+
tempDirs.push(repoRoot);
|
|
247
|
+
const guardsDir = path.join(repoRoot, "cli", "src", "agents", "guards");
|
|
248
|
+
const guardFiles = [
|
|
249
|
+
path.join(guardsDir, "executionPolicyResolver.ts"),
|
|
250
|
+
path.join(guardsDir, "guardState.ts"),
|
|
251
|
+
path.join(guardsDir, "resolveProgressState.ts"),
|
|
252
|
+
];
|
|
253
|
+
fs.mkdirSync(guardsDir, { recursive: true });
|
|
254
|
+
for (const filePath of guardFiles) {
|
|
255
|
+
fs.writeFileSync(filePath, "export const guard = true;\n", "utf8");
|
|
256
|
+
}
|
|
257
|
+
const context = {
|
|
258
|
+
initContext: {
|
|
259
|
+
userQuery: "please tell me what the three files in the guards folder do?",
|
|
260
|
+
executionPath: repoRoot,
|
|
261
|
+
repoRootPath: repoRoot,
|
|
262
|
+
},
|
|
263
|
+
analysis: {
|
|
264
|
+
intent: {
|
|
265
|
+
intent: "explain",
|
|
266
|
+
intentCategory: "explanation",
|
|
267
|
+
normalizedQuery: "please tell me what the three files in the guards folder do?",
|
|
268
|
+
confidence: 0.9,
|
|
269
|
+
targetFiles: ["guards"],
|
|
270
|
+
targetSymbols: [],
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
const result = await new SearchOrchestrator().run({
|
|
275
|
+
context,
|
|
276
|
+
query: "please tell me what the three files in the guards folder do?",
|
|
277
|
+
mode: "exact-target",
|
|
278
|
+
});
|
|
279
|
+
expect(result.resolvedFolders).toEqual([guardsDir]);
|
|
280
|
+
expect(result.fileCandidates.map(item => item.path).sort()).toEqual(guardFiles.sort());
|
|
281
|
+
expect(result.unresolvedRefs).toEqual([]);
|
|
282
|
+
});
|
|
283
|
+
it("marks ambiguous basename-only folder refs instead of picking one silently", async () => {
|
|
284
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
285
|
+
tempDirs.push(repoRoot);
|
|
286
|
+
const firstFolder = path.join(repoRoot, "cli", "src", "agents", "guards");
|
|
287
|
+
const secondFolder = path.join(repoRoot, "dashboard", "guards");
|
|
288
|
+
fs.mkdirSync(firstFolder, { recursive: true });
|
|
289
|
+
fs.mkdirSync(secondFolder, { recursive: true });
|
|
290
|
+
const result = await new SearchOrchestrator().run({
|
|
291
|
+
context: {
|
|
292
|
+
initContext: {
|
|
293
|
+
userQuery: "check guards",
|
|
294
|
+
executionPath: repoRoot,
|
|
295
|
+
repoRootPath: repoRoot,
|
|
296
|
+
},
|
|
297
|
+
analysis: {
|
|
298
|
+
intent: {
|
|
299
|
+
intent: "check",
|
|
300
|
+
intentCategory: "explanation",
|
|
301
|
+
normalizedQuery: "check guards",
|
|
302
|
+
confidence: 0.9,
|
|
303
|
+
targetFiles: ["guards"],
|
|
304
|
+
targetSymbols: [],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
query: "check guards",
|
|
309
|
+
mode: "exact-target",
|
|
310
|
+
});
|
|
311
|
+
expect(result.resolvedFolders).toEqual([]);
|
|
312
|
+
expect(result.ambiguousRefs).toContain("guards");
|
|
313
|
+
});
|
|
314
|
+
it("marks missing folder refs as unresolved", async () => {
|
|
315
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
316
|
+
tempDirs.push(repoRoot);
|
|
317
|
+
const result = await new SearchOrchestrator().run({
|
|
318
|
+
context: {
|
|
319
|
+
initContext: {
|
|
320
|
+
userQuery: "check missing-folder",
|
|
321
|
+
executionPath: repoRoot,
|
|
322
|
+
repoRootPath: repoRoot,
|
|
323
|
+
},
|
|
324
|
+
analysis: {
|
|
325
|
+
intent: {
|
|
326
|
+
intent: "check",
|
|
327
|
+
intentCategory: "explanation",
|
|
328
|
+
normalizedQuery: "check missing-folder",
|
|
329
|
+
confidence: 0.9,
|
|
330
|
+
targetFiles: ["missing-folder"],
|
|
331
|
+
targetSymbols: [],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
query: "check missing-folder",
|
|
336
|
+
mode: "exact-target",
|
|
337
|
+
});
|
|
338
|
+
expect(result.resolvedFolders).toEqual([]);
|
|
339
|
+
expect(result.unresolvedRefs).toContain("missing-folder");
|
|
340
|
+
});
|
|
341
|
+
it("falls back to semantic retrieval when exact-target resolves nothing at all", async () => {
|
|
342
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
343
|
+
tempDirs.push(repoRoot);
|
|
344
|
+
mocks.semanticSearchFiles.mockResolvedValue([
|
|
345
|
+
{
|
|
346
|
+
id: 31,
|
|
347
|
+
path: path.join(repoRoot, "cli", "src", "commands", "TasksCmd.ts"),
|
|
348
|
+
filename: "TasksCmd.ts",
|
|
349
|
+
summary: null,
|
|
350
|
+
type: "ts",
|
|
351
|
+
lastModified: new Date(0).toISOString(),
|
|
352
|
+
},
|
|
353
|
+
]);
|
|
354
|
+
const result = await new SearchOrchestrator().run({
|
|
355
|
+
context: {
|
|
356
|
+
initContext: {
|
|
357
|
+
userQuery: "How does /resume work?",
|
|
358
|
+
executionPath: repoRoot,
|
|
359
|
+
repoRootPath: repoRoot,
|
|
360
|
+
},
|
|
361
|
+
analysis: {
|
|
362
|
+
intent: {
|
|
363
|
+
intent: "explain",
|
|
364
|
+
intentCategory: "explanation",
|
|
365
|
+
normalizedQuery: "How does /resume work?",
|
|
366
|
+
confidence: 0.9,
|
|
367
|
+
targetFiles: ["/resume"],
|
|
368
|
+
targetSymbols: [],
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
query: "How does /resume work?",
|
|
373
|
+
mode: "exact-target",
|
|
374
|
+
});
|
|
375
|
+
expect(result.mode).toBe("exact-target");
|
|
376
|
+
expect(result.stagesRun).toContain("explicit-target-resolver");
|
|
377
|
+
expect(result.stagesRun).toContain("fallback-semantic-retriever");
|
|
378
|
+
expect(result.fallbackUsed).toBe(true);
|
|
379
|
+
expect(result.unresolvedRefs).toContain("/resume");
|
|
380
|
+
expect(result.fileCandidates.map(item => item.path)).toEqual([path.join(repoRoot, "cli", "src", "commands", "TasksCmd.ts")]);
|
|
381
|
+
});
|
|
382
|
+
it("does not fall back when exact-target is ambiguous", async () => {
|
|
383
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
384
|
+
tempDirs.push(repoRoot);
|
|
385
|
+
const firstFile = path.join(repoRoot, "cli", "src", "agents", "MainAgent.ts");
|
|
386
|
+
const secondFile = path.join(repoRoot, "dashboard", "src", "MainAgent.ts");
|
|
387
|
+
fs.mkdirSync(path.dirname(firstFile), { recursive: true });
|
|
388
|
+
fs.mkdirSync(path.dirname(secondFile), { recursive: true });
|
|
389
|
+
fs.writeFileSync(firstFile, "export const first = true;\n", "utf8");
|
|
390
|
+
fs.writeFileSync(secondFile, "export const second = true;\n", "utf8");
|
|
391
|
+
mocks.semanticSearchFiles.mockResolvedValue([
|
|
392
|
+
{
|
|
393
|
+
id: 32,
|
|
394
|
+
path: path.join(repoRoot, "cli", "src", "commands", "TasksCmd.ts"),
|
|
395
|
+
filename: "TasksCmd.ts",
|
|
396
|
+
summary: null,
|
|
397
|
+
type: "ts",
|
|
398
|
+
lastModified: new Date(0).toISOString(),
|
|
399
|
+
},
|
|
400
|
+
]);
|
|
401
|
+
const result = await new SearchOrchestrator().run({
|
|
402
|
+
context: {
|
|
403
|
+
initContext: {
|
|
404
|
+
userQuery: "Trace MainAgent.ts",
|
|
405
|
+
executionPath: repoRoot,
|
|
406
|
+
repoRootPath: repoRoot,
|
|
407
|
+
},
|
|
408
|
+
analysis: {
|
|
409
|
+
intent: {
|
|
410
|
+
intent: "trace",
|
|
411
|
+
intentCategory: "explanation",
|
|
412
|
+
normalizedQuery: "Trace MainAgent.ts",
|
|
413
|
+
confidence: 0.9,
|
|
414
|
+
targetFiles: ["MainAgent.ts"],
|
|
415
|
+
targetSymbols: [],
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
query: "Trace MainAgent.ts",
|
|
420
|
+
mode: "exact-target",
|
|
421
|
+
});
|
|
422
|
+
expect(result.ambiguousRefs).toContain("MainAgent.ts");
|
|
423
|
+
expect(result.fallbackUsed).toBe(false);
|
|
424
|
+
expect(result.stagesRun).not.toContain("fallback-semantic-retriever");
|
|
425
|
+
expect(mocks.semanticSearchFiles).not.toHaveBeenCalled();
|
|
426
|
+
});
|
|
427
|
+
it("preserves identical sentence fragments across multiple files", async () => {
|
|
428
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
429
|
+
tempDirs.push(repoRoot);
|
|
430
|
+
const firstFile = path.join(repoRoot, "src", "a.ts");
|
|
431
|
+
const secondFile = path.join(repoRoot, "src", "b.ts");
|
|
432
|
+
fs.mkdirSync(path.dirname(firstFile), { recursive: true });
|
|
433
|
+
fs.writeFileSync(firstFile, "const value = \"alpha beta gamma\";\n", "utf8");
|
|
434
|
+
fs.writeFileSync(secondFile, "const value = \"alpha beta gamma\";\n", "utf8");
|
|
435
|
+
const result = await new SearchOrchestrator().run({
|
|
436
|
+
context: {
|
|
437
|
+
initContext: {
|
|
438
|
+
userQuery: "\"alpha beta gamma\"",
|
|
439
|
+
executionPath: repoRoot,
|
|
440
|
+
repoRootPath: repoRoot,
|
|
441
|
+
},
|
|
442
|
+
analysis: { intent: { intent: "", intentCategory: "explanation", normalizedQuery: "\"alpha beta gamma\"", confidence: 0.8 } },
|
|
443
|
+
},
|
|
444
|
+
query: "\"alpha beta gamma\"",
|
|
445
|
+
mode: "sentence-fragment",
|
|
446
|
+
});
|
|
447
|
+
expect(result.fragmentMatches).toHaveLength(2);
|
|
448
|
+
expect(result.fileCandidates.map(item => item.path).sort()).toEqual([firstFile, secondFile].sort());
|
|
449
|
+
});
|
|
450
|
+
it("prefers sentence-fragment mode for pure quoted snippets even when intent extracted symbols", async () => {
|
|
451
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
452
|
+
tempDirs.push(repoRoot);
|
|
453
|
+
const firstFile = path.join(repoRoot, "src", "analysisPlanGenStep.ts");
|
|
454
|
+
const secondFile = path.join(repoRoot, "src", "transformPlanGenStep.ts");
|
|
455
|
+
const snippet = "const currentQuestionId = currentStep.questionId ?? (orderedQuestions.length === 1 ? orderedQuestions[0].id : undefined);";
|
|
456
|
+
fs.mkdirSync(path.dirname(firstFile), { recursive: true });
|
|
457
|
+
fs.writeFileSync(firstFile, `${snippet}\n`, "utf8");
|
|
458
|
+
fs.writeFileSync(secondFile, `${snippet}\n`, "utf8");
|
|
459
|
+
const result = await new SearchOrchestrator().run({
|
|
460
|
+
context: {
|
|
461
|
+
initContext: {
|
|
462
|
+
userQuery: `\"${snippet}\"`,
|
|
463
|
+
executionPath: repoRoot,
|
|
464
|
+
repoRootPath: repoRoot,
|
|
465
|
+
},
|
|
466
|
+
analysis: {
|
|
467
|
+
intent: {
|
|
468
|
+
intent: "Locate the quoted code snippet",
|
|
469
|
+
intentCategory: "codingTask",
|
|
470
|
+
normalizedQuery: snippet,
|
|
471
|
+
confidence: 0.95,
|
|
472
|
+
targetFiles: [],
|
|
473
|
+
targetSymbols: ["currentQuestionId", "currentStep", "questionId", "orderedQuestions", "id"],
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
query: `\"${snippet}\"`,
|
|
478
|
+
mode: "auto",
|
|
479
|
+
});
|
|
480
|
+
expect(result.mode).toBe("sentence-fragment");
|
|
481
|
+
expect(result.fragmentMatches).toHaveLength(2);
|
|
482
|
+
expect(result.fileCandidates.map(item => item.path).sort()).toEqual([firstFile, secondFile].sort());
|
|
483
|
+
});
|
|
484
|
+
it("returns raw operator-pattern matches without semantic guessing", async () => {
|
|
485
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
486
|
+
tempDirs.push(repoRoot);
|
|
487
|
+
const filePath = path.join(repoRoot, "src", "search.ts");
|
|
488
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
489
|
+
fs.writeFileSync(filePath, [
|
|
490
|
+
"function runSearch() {}",
|
|
491
|
+
"function semanticSearchFiles() {}",
|
|
492
|
+
"function plannerSearchFiles() {}",
|
|
493
|
+
].join("\n"), "utf8");
|
|
494
|
+
const result = await new SearchOrchestrator().run({
|
|
495
|
+
context: {
|
|
496
|
+
initContext: {
|
|
497
|
+
userQuery: "runSearch|semanticSearchFiles|plannerSearchFiles",
|
|
498
|
+
executionPath: repoRoot,
|
|
499
|
+
repoRootPath: repoRoot,
|
|
500
|
+
},
|
|
501
|
+
analysis: { intent: { intent: "", intentCategory: "explanation", normalizedQuery: "", confidence: 0.8 } },
|
|
502
|
+
},
|
|
503
|
+
query: "runSearch|semanticSearchFiles|plannerSearchFiles",
|
|
504
|
+
mode: "operator-pattern",
|
|
505
|
+
});
|
|
506
|
+
expect(result.patternMatches.length).toBeGreaterThan(0);
|
|
507
|
+
expect(result.fileCandidates.map(item => item.path)).toContain(filePath);
|
|
508
|
+
});
|
|
509
|
+
it("routes natural-language generate() questions to semantic retrieval", async () => {
|
|
510
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
511
|
+
tempDirs.push(repoRoot);
|
|
512
|
+
const targetFile = path.join(repoRoot, "cli", "src", "lib", "generate.ts");
|
|
513
|
+
mocks.semanticSearchFiles.mockResolvedValue([
|
|
514
|
+
{
|
|
515
|
+
id: 41,
|
|
516
|
+
path: targetFile,
|
|
517
|
+
filename: "generate.ts",
|
|
518
|
+
summary: null,
|
|
519
|
+
type: "ts",
|
|
520
|
+
lastModified: new Date(0).toISOString(),
|
|
521
|
+
},
|
|
522
|
+
]);
|
|
523
|
+
const result = await new SearchOrchestrator().run({
|
|
524
|
+
context: {
|
|
525
|
+
initContext: {
|
|
526
|
+
userQuery: "Trace how generate() timing reaches structured logs",
|
|
527
|
+
executionPath: repoRoot,
|
|
528
|
+
repoRootPath: repoRoot,
|
|
529
|
+
},
|
|
530
|
+
analysis: { intent: { intent: "trace", intentCategory: "explanation", normalizedQuery: "", confidence: 0.8 } },
|
|
531
|
+
},
|
|
532
|
+
query: "Trace how generate() timing reaches structured logs",
|
|
533
|
+
mode: "auto",
|
|
534
|
+
});
|
|
535
|
+
expect(result.mode).toBe("semantic-retrieval");
|
|
536
|
+
expect(result.fileCandidates.map(item => item.path)).toEqual([targetFile]);
|
|
537
|
+
});
|
|
538
|
+
it("falls back to semantic retrieval when operator-pattern search is empty", async () => {
|
|
539
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
540
|
+
tempDirs.push(repoRoot);
|
|
541
|
+
const targetFile = path.join(repoRoot, "cli", "src", "lib", "generate.ts");
|
|
542
|
+
mocks.semanticSearchFiles.mockResolvedValue([
|
|
543
|
+
{
|
|
544
|
+
id: 42,
|
|
545
|
+
path: targetFile,
|
|
546
|
+
filename: "generate.ts",
|
|
547
|
+
summary: null,
|
|
548
|
+
type: "ts",
|
|
549
|
+
lastModified: new Date(0).toISOString(),
|
|
550
|
+
},
|
|
551
|
+
]);
|
|
552
|
+
const result = await new SearchOrchestrator().run({
|
|
553
|
+
context: {
|
|
554
|
+
initContext: {
|
|
555
|
+
userQuery: "foo.*bar",
|
|
556
|
+
executionPath: repoRoot,
|
|
557
|
+
repoRootPath: repoRoot,
|
|
558
|
+
},
|
|
559
|
+
analysis: { intent: { intent: "", intentCategory: "explanation", normalizedQuery: "", confidence: 0.8 } },
|
|
560
|
+
},
|
|
561
|
+
query: "foo.*bar",
|
|
562
|
+
mode: "operator-pattern",
|
|
563
|
+
});
|
|
564
|
+
expect(result.mode).toBe("operator-pattern");
|
|
565
|
+
expect(result.patternMatches).toEqual([]);
|
|
566
|
+
expect(result.stagesRun).toContain("fallback-semantic-retriever");
|
|
567
|
+
expect(result.fallbackUsed).toBe(true);
|
|
568
|
+
expect(result.fileCandidates.map(item => item.path)).toEqual([targetFile]);
|
|
569
|
+
});
|
|
570
|
+
it("does not treat shell command mentions as exact-target refs in auto mode", async () => {
|
|
571
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
572
|
+
tempDirs.push(repoRoot);
|
|
573
|
+
const targetFile = path.join(repoRoot, "cli", "src", "commands", "TasksCmd.ts");
|
|
574
|
+
mocks.semanticSearchFiles.mockResolvedValue([
|
|
575
|
+
{
|
|
576
|
+
id: 43,
|
|
577
|
+
path: targetFile,
|
|
578
|
+
filename: "TasksCmd.ts",
|
|
579
|
+
summary: null,
|
|
580
|
+
type: "ts",
|
|
581
|
+
lastModified: new Date(0).toISOString(),
|
|
582
|
+
},
|
|
583
|
+
]);
|
|
584
|
+
const result = await new SearchOrchestrator().run({
|
|
585
|
+
context: {
|
|
586
|
+
initContext: {
|
|
587
|
+
userQuery: "How does /resume work?",
|
|
588
|
+
executionPath: repoRoot,
|
|
589
|
+
repoRootPath: repoRoot,
|
|
590
|
+
},
|
|
591
|
+
analysis: { intent: { intent: "explain", intentCategory: "explanation", normalizedQuery: "", confidence: 0.8 } },
|
|
592
|
+
},
|
|
593
|
+
query: "How does /resume work?",
|
|
594
|
+
mode: "auto",
|
|
595
|
+
});
|
|
596
|
+
expect(result.mode).toBe("semantic-retrieval");
|
|
597
|
+
expect(result.unresolvedRefs).toEqual([]);
|
|
598
|
+
expect(result.fileCandidates.map(item => item.path)).toEqual([targetFile]);
|
|
599
|
+
});
|
|
600
|
+
it("keeps semantic retrieval separate from exact-target resolution", async () => {
|
|
601
|
+
mocks.semanticSearchFiles.mockResolvedValue([
|
|
602
|
+
{
|
|
603
|
+
id: 11,
|
|
604
|
+
path: "/repo/src/search.ts",
|
|
605
|
+
filename: "search.ts",
|
|
606
|
+
summary: null,
|
|
607
|
+
type: "ts",
|
|
608
|
+
lastModified: new Date(0).toISOString(),
|
|
609
|
+
bm25Score: -1,
|
|
610
|
+
},
|
|
611
|
+
]);
|
|
612
|
+
const result = await new SearchOrchestrator().run({
|
|
613
|
+
context: {
|
|
614
|
+
initContext: {
|
|
615
|
+
userQuery: "find the code that handles search",
|
|
616
|
+
executionPath: "/repo",
|
|
617
|
+
repoRootPath: "/repo",
|
|
618
|
+
},
|
|
619
|
+
analysis: { intent: { intent: "", intentCategory: "explanation", normalizedQuery: "", confidence: 0.8 } },
|
|
620
|
+
},
|
|
621
|
+
query: "find the code that handles search",
|
|
622
|
+
mode: "semantic-retrieval",
|
|
623
|
+
});
|
|
624
|
+
expect(result.resolvedFiles).toEqual([]);
|
|
625
|
+
expect(result.fileCandidates.map(item => item.path)).toEqual(["/repo/src/search.ts"]);
|
|
626
|
+
});
|
|
627
|
+
it("passes parsed intent into semantic retrieval", async () => {
|
|
628
|
+
mocks.semanticSearchFiles.mockResolvedValue([]);
|
|
629
|
+
await new SearchOrchestrator().run({
|
|
630
|
+
context: {
|
|
631
|
+
initContext: {
|
|
632
|
+
userQuery: "trace db client setup",
|
|
633
|
+
executionPath: "/repo",
|
|
634
|
+
repoRootPath: "/repo",
|
|
635
|
+
},
|
|
636
|
+
analysis: {
|
|
637
|
+
intent: {
|
|
638
|
+
intent: "trace",
|
|
639
|
+
intentCategory: "explanation",
|
|
640
|
+
normalizedQuery: "trace db client setup",
|
|
641
|
+
confidence: 0.8,
|
|
642
|
+
targetFiles: ["db/client.ts"],
|
|
643
|
+
targetSymbols: ["getDbForRepo"],
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
},
|
|
647
|
+
query: "trace db client setup",
|
|
648
|
+
mode: "semantic-retrieval",
|
|
649
|
+
});
|
|
650
|
+
expect(mocks.semanticSearchFiles).toHaveBeenCalledWith("trace db client setup", 8, expect.objectContaining({
|
|
651
|
+
targetFiles: ["db/client.ts"],
|
|
652
|
+
targetSymbols: ["getDbForRepo"],
|
|
653
|
+
}));
|
|
654
|
+
});
|
|
655
|
+
it("runs planner retrieval for each ordered question in multi-question asks", async () => {
|
|
656
|
+
mocks.plannerSearchFiles.mockImplementation(async (_query, plannerQuery) => {
|
|
657
|
+
if (plannerQuery === "Where is search routed?") {
|
|
658
|
+
return [{
|
|
659
|
+
id: 21,
|
|
660
|
+
path: "/repo/cli/src/agents/routingDecisionStep.ts",
|
|
661
|
+
filename: "routingDecisionStep.ts",
|
|
662
|
+
summary: null,
|
|
663
|
+
type: "ts",
|
|
664
|
+
lastModified: new Date(0).toISOString(),
|
|
665
|
+
}];
|
|
666
|
+
}
|
|
667
|
+
if (plannerQuery === "How is verify triggered?") {
|
|
668
|
+
return [{
|
|
669
|
+
id: 22,
|
|
670
|
+
path: "/repo/cli/src/agents/mainAgentVerify.ts",
|
|
671
|
+
filename: "mainAgentVerify.ts",
|
|
672
|
+
summary: null,
|
|
673
|
+
type: "ts",
|
|
674
|
+
lastModified: new Date(0).toISOString(),
|
|
675
|
+
}];
|
|
676
|
+
}
|
|
677
|
+
return [];
|
|
678
|
+
});
|
|
679
|
+
const result = await new SearchOrchestrator().run({
|
|
680
|
+
context: {
|
|
681
|
+
initContext: {
|
|
682
|
+
userQuery: "Where is search routed? How is verify triggered?",
|
|
683
|
+
executionPath: "/repo",
|
|
684
|
+
repoRootPath: "/repo",
|
|
685
|
+
},
|
|
686
|
+
analysis: {
|
|
687
|
+
intent: {
|
|
688
|
+
intent: "trace routing and verify",
|
|
689
|
+
intentCategory: "question",
|
|
690
|
+
normalizedQuery: "Where is search routed and how is verify triggered?",
|
|
691
|
+
confidence: 0.95,
|
|
692
|
+
questions: [
|
|
693
|
+
{ id: "q1", order: 0, text: "Where is search routed?" },
|
|
694
|
+
{ id: "q2", order: 1, text: "How is verify triggered?" },
|
|
695
|
+
],
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
},
|
|
699
|
+
query: "Where is search routed? How is verify triggered?",
|
|
700
|
+
mode: "semantic-retrieval",
|
|
701
|
+
});
|
|
702
|
+
expect(mocks.plannerSearchFiles).toHaveBeenCalledWith("Where is search routed? How is verify triggered?", "Where is search routed?", 6);
|
|
703
|
+
expect(mocks.plannerSearchFiles).toHaveBeenCalledWith("Where is search routed? How is verify triggered?", "How is verify triggered?", 6);
|
|
704
|
+
expect(result.fileCandidates.map(item => item.path)).toEqual([
|
|
705
|
+
"/repo/cli/src/agents/routingDecisionStep.ts",
|
|
706
|
+
"/repo/cli/src/agents/mainAgentVerify.ts",
|
|
707
|
+
]);
|
|
708
|
+
});
|
|
709
|
+
it("adds path-scored implementation supplements for verify-focus queries", async () => {
|
|
710
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
711
|
+
tempDirs.push(repoRoot);
|
|
712
|
+
const verifyFile = path.join(repoRoot, "cli", "src", "agents", "mainAgentVerify.ts");
|
|
713
|
+
const fileCheckFile = path.join(repoRoot, "cli", "src", "agents", "fileCheckStep.ts");
|
|
714
|
+
const readmeFile = path.join(repoRoot, "README.md");
|
|
715
|
+
fs.mkdirSync(path.dirname(verifyFile), { recursive: true });
|
|
716
|
+
fs.writeFileSync(verifyFile, "export function runVerify() {}\n", "utf8");
|
|
717
|
+
fs.writeFileSync(fileCheckFile, "export function fileCheckStep() {}\n", "utf8");
|
|
718
|
+
fs.writeFileSync(readmeFile, "selectedFiles candidateFiles verify\n", "utf8");
|
|
719
|
+
mocks.scoreCandidateFiles.mockImplementation(((filePaths, ...rest) => {
|
|
720
|
+
const retrievalQuery = String(rest[1] ?? "");
|
|
721
|
+
if (!retrievalQuery.includes("selectedFiles")) {
|
|
722
|
+
return filePaths.map((filePath, index) => ({ filePath, score: 5 - index, reasons: [] }));
|
|
723
|
+
}
|
|
724
|
+
return [
|
|
725
|
+
{ filePath: verifyFile, score: 80, reasons: ["verify-focus"] },
|
|
726
|
+
{ filePath: fileCheckFile, score: 74, reasons: ["verify-focus"] },
|
|
727
|
+
{ filePath: readmeFile, score: 8, reasons: ["doc"] },
|
|
728
|
+
];
|
|
729
|
+
}));
|
|
730
|
+
const result = await new SearchOrchestrator().run({
|
|
731
|
+
context: {
|
|
732
|
+
initContext: {
|
|
733
|
+
userQuery: "Trace how selectedFiles and candidateFiles evolve across verify waves for this query.",
|
|
734
|
+
executionPath: repoRoot,
|
|
735
|
+
repoRootPath: repoRoot,
|
|
736
|
+
},
|
|
737
|
+
analysis: {
|
|
738
|
+
intent: {
|
|
739
|
+
intent: "trace verify focus",
|
|
740
|
+
intentCategory: "explanation",
|
|
741
|
+
normalizedQuery: "Trace how selectedFiles and candidateFiles evolve across verify waves for this query.",
|
|
742
|
+
confidence: 0.95,
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
},
|
|
746
|
+
query: "Trace how selectedFiles and candidateFiles evolve across verify waves for this query.",
|
|
747
|
+
mode: "semantic-retrieval",
|
|
748
|
+
});
|
|
749
|
+
expect(result.fileCandidates.map(item => item.path)).toContain(verifyFile);
|
|
750
|
+
expect(result.fileCandidates.map(item => item.path)).toContain(fileCheckFile);
|
|
751
|
+
expect(result.fileCandidates.map(item => item.path)).not.toContain(readmeFile);
|
|
752
|
+
});
|
|
753
|
+
it("excludes hidden junk when exact-target resolves a folder", async () => {
|
|
754
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
755
|
+
tempDirs.push(repoRoot);
|
|
756
|
+
const artifactsDir = path.join(repoRoot, "artifacts");
|
|
757
|
+
const nestedDir = path.join(artifactsDir, "integration");
|
|
758
|
+
fs.mkdirSync(nestedDir, { recursive: true });
|
|
759
|
+
fs.writeFileSync(path.join(artifactsDir, ".DS_Store"), "junk", "utf8");
|
|
760
|
+
fs.writeFileSync(path.join(artifactsDir, "report.md"), "# report\n", "utf8");
|
|
761
|
+
fs.writeFileSync(path.join(nestedDir, "deep.txt"), "deep\n", "utf8");
|
|
762
|
+
const result = await new SearchOrchestrator().run({
|
|
763
|
+
context: {
|
|
764
|
+
initContext: {
|
|
765
|
+
userQuery: "check artifacts",
|
|
766
|
+
executionPath: repoRoot,
|
|
767
|
+
repoRootPath: repoRoot,
|
|
768
|
+
},
|
|
769
|
+
analysis: {
|
|
770
|
+
intent: {
|
|
771
|
+
intent: "check",
|
|
772
|
+
intentCategory: "explanation",
|
|
773
|
+
normalizedQuery: "check artifacts",
|
|
774
|
+
confidence: 0.8,
|
|
775
|
+
targetFiles: ["artifacts"],
|
|
776
|
+
targetSymbols: [],
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
query: "check artifacts",
|
|
781
|
+
mode: "exact-target",
|
|
782
|
+
});
|
|
783
|
+
expect(result.fileCandidates.map(item => path.basename(item.path)).sort()).toEqual(["deep.txt", "report.md"]);
|
|
784
|
+
});
|
|
785
|
+
it("returns a structured invalid-regex failure for broken regex specs", async () => {
|
|
786
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
787
|
+
tempDirs.push(repoRoot);
|
|
788
|
+
const result = await new SearchOrchestrator().runRegexSearch({
|
|
789
|
+
context: {
|
|
790
|
+
initContext: {
|
|
791
|
+
userQuery: "find broken regex results",
|
|
792
|
+
executionPath: repoRoot,
|
|
793
|
+
repoRootPath: repoRoot,
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
spec: {
|
|
797
|
+
target: "path",
|
|
798
|
+
pattern: "[broken",
|
|
799
|
+
},
|
|
800
|
+
});
|
|
801
|
+
expect(result.mode).toBe("regex-execution");
|
|
802
|
+
expect(result.failure?.failureClass).toBe("invalid-regex");
|
|
803
|
+
});
|
|
804
|
+
it("lists direct directory children without recursing", async () => {
|
|
805
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), "scai-search-orchestrator-"));
|
|
806
|
+
tempDirs.push(repoRoot);
|
|
807
|
+
const artifactsDir = path.join(repoRoot, "artifacts");
|
|
808
|
+
const nestedDir = path.join(artifactsDir, "integration");
|
|
809
|
+
fs.mkdirSync(nestedDir, { recursive: true });
|
|
810
|
+
fs.writeFileSync(path.join(artifactsDir, ".DS_Store"), "junk", "utf8");
|
|
811
|
+
fs.writeFileSync(path.join(artifactsDir, "report.md"), "# report\n", "utf8");
|
|
812
|
+
fs.writeFileSync(path.join(nestedDir, "deep.txt"), "deep\n", "utf8");
|
|
813
|
+
const result = new SearchOrchestrator().runDirectoryListing({
|
|
814
|
+
context: {
|
|
815
|
+
initContext: {
|
|
816
|
+
userQuery: "what files are in the artifacts folder?",
|
|
817
|
+
executionPath: repoRoot,
|
|
818
|
+
repoRootPath: repoRoot,
|
|
819
|
+
},
|
|
820
|
+
analysis: {
|
|
821
|
+
intent: {
|
|
822
|
+
targetFiles: ["artifacts"],
|
|
823
|
+
},
|
|
824
|
+
},
|
|
825
|
+
},
|
|
826
|
+
query: "what files are in the artifacts folder?",
|
|
827
|
+
});
|
|
828
|
+
expect(result.mode).toBe("directory-listing");
|
|
829
|
+
expect(result.directoryEntries).toEqual([
|
|
830
|
+
{ path: path.join(artifactsDir, "integration"), name: "integration", kind: "folder" },
|
|
831
|
+
{ path: path.join(artifactsDir, "report.md"), name: "report.md", kind: "file" },
|
|
832
|
+
]);
|
|
833
|
+
expect(result.fileCandidates).toEqual([]);
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
//# sourceMappingURL=SearchOrchestrator.test.js.map
|