@codeyam/codeyam-cli 0.1.0-staging.c90f8c9 → 0.1.0-staging.c9dc00c
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +7 -7
- package/analyzer-template/packages/ai/index.ts +10 -2
- package/analyzer-template/packages/ai/package.json +2 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +86 -18
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +67 -9
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +41 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.ts +10 -17
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +308 -50
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +15 -6
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +837 -243
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +54 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +60 -15
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.ts +70 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +80 -5
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +179 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +393 -97
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +58 -3
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +283 -1
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +9 -5
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +11 -3
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +297 -7
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/isolateScopes.ts +51 -3
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +25 -13
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +4 -3
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
- package/analyzer-template/packages/analyze/index.ts +2 -0
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +113 -26
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +71 -9
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +19 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +0 -3
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +1315 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +61 -13
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +37 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +229 -19
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +117 -9
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +459 -39
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
- package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/database/package.json +1 -1
- package/analyzer-template/packages/database/src/lib/analysisBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/analysisToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/branchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitBranchToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/commitToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/fileToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +14 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
- package/analyzer-template/packages/database/src/lib/kysely/tables/labsRequestsTable.ts +52 -0
- package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
- package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
- package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +12 -0
- package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
- package/analyzer-template/packages/database/src/lib/projectToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/saveFiles.ts +1 -1
- package/analyzer-template/packages/database/src/lib/scenarioToDb.ts +1 -1
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +7 -14
- package/analyzer-template/packages/database/src/lib/userScenarioToDb.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/analysisToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/branchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitBranchToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/commitToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/fileToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +11 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts +23 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/projectToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/saveFiles.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/scenarioToDb.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +5 -4
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +5 -5
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
- package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +7 -0
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +6 -5
- package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +7 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +5 -5
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/playwright/capture.ts +20 -8
- package/analyzer-template/playwright/captureStatic.ts +1 -1
- package/analyzer-template/project/analyzeBaselineCommit.ts +5 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +5 -0
- package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
- package/analyzer-template/project/constructMockCode.ts +90 -10
- package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
- package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
- package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +11 -6
- package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
- package/analyzer-template/project/orchestrateCapture.ts +45 -6
- package/analyzer-template/project/start.ts +35 -11
- package/analyzer-template/project/writeMockDataTsx.ts +181 -8
- package/analyzer-template/project/writeScenarioComponents.ts +60 -12
- package/analyzer-template/project/writeSimpleRoot.ts +21 -11
- package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
- package/background/src/lib/local/createLocalAnalyzer.js +1 -1
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +75 -4
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +4 -4
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +38 -6
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +32 -11
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +162 -4
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +60 -15
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +21 -11
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +180 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -1
- package/codeyam-cli/src/cli.js +4 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +2 -0
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +2 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +9 -5
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +14 -4
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/detect-universal-mocks.js +2 -0
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +1 -1
- package/codeyam-cli/src/commands/init.js +42 -184
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +264 -0
- package/codeyam-cli/src/commands/memory.js.map +1 -0
- package/codeyam-cli/src/commands/recapture.js +2 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/setup-sandbox.js +2 -0
- package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
- package/codeyam-cli/src/commands/setup-simulations.js +284 -0
- package/codeyam-cli/src/commands/setup-simulations.js.map +1 -0
- package/codeyam-cli/src/commands/test-startup.js +2 -0
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/verify.js +2 -0
- package/codeyam-cli/src/commands/verify.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +128 -86
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +7 -0
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +4 -0
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +71 -46
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/labsAutoCheck.js +48 -0
- package/codeyam-cli/src/utils/labsAutoCheck.js.map +1 -0
- package/codeyam-cli/src/utils/progress.js +7 -0
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +4 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js +10 -0
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js +82 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/confusionDetector.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +230 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +67 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js +105 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/captureFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js +34 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/loadCapturedFixture.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js +162 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/runClaude.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +75 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +378 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +115 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js +127 -0
- package/codeyam-cli/src/utils/ruleReflection/__tests__/transcriptParser.test.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js +50 -0
- package/codeyam-cli/src/utils/ruleReflection/confusionDetector.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js +116 -0
- package/codeyam-cli/src/utils/ruleReflection/contextBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/index.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js +44 -0
- package/codeyam-cli/src/utils/ruleReflection/promptBuilder.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js +85 -0
- package/codeyam-cli/src/utils/ruleReflection/transcriptParser.js.map +1 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js +5 -0
- package/codeyam-cli/src/utils/ruleReflection/types.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js +293 -0
- package/codeyam-cli/src/utils/rules/__tests__/ruleState.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/index.js +6 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -0
- package/codeyam-cli/src/utils/rules/parser.js +83 -0
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js +18 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
- package/codeyam-cli/src/utils/rules/ruleState.js +150 -0
- package/codeyam-cli/src/utils/rules/ruleState.js.map +1 -0
- package/codeyam-cli/src/utils/rules/staleness.js +137 -0
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +20 -43
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +15 -3
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +31 -0
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-CA3JxPb7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-B86KKU7e.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DLqD3qNt.js → EntityTypeBadge-B5ctlSYt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-Ba2JVPzP.js → EntityTypeIcon-BqY8gDAW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-C8lyxW9k.js → InlineSpinner-ClaLpuOo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-aht4aafF.js → InteractivePreview-BDhPilK7.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVtiBnY5.js → LibraryFunctionPreview-VeqEBv9v.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-B0GLXMsr.js → LoadingDots-Bs7Nn1Jr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-xgeCVgSM.js → LogViewer-Bm3PmcCz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-D4TZhLuw.js → ReportIssueModal-C6PKeMYR.js} +3 -13
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-DuDvi0jm.js → SafeScreenshot-Gq3Ocjo6.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DEx02QDa.js → ScenarioViewer-BNLaXBHR.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-DyFZkK0l.js → TruncatedFilePath-CiwXDxLh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BwqWJOgH.js → _index-B3TDXxnk.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DoLIqZX2.js → activity.(_tab)-BtBFH820.js} +6 -16
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-CN61MOMa.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.labs-survey-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.labs-unlock-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.save-fixture-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/book-open-PttOB2SF.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-Cx24_aWc.js → chevron-down-TJp6ofnp.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-CXRTFQ3F.js → chunk-JZWAC4HX-JE9ZIoBl.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BOARzkeR.js → circle-check-CXhHQYrI.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/copy-6y9ALfGT.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-BdhJEx6B.js → createLucideIcon-Ca9fAY46.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-C5lqplTC.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-C2N4Op8e.js → entity._sha._-n38keI1k.js} +10 -10
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js → entity._sha.scenarios._scenarioId.fullscreen-CBoafmVs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-D1T4TGjf.js → entity._sha_.create-scenario-DGgZjdFg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CTBG2mmz.js → entity._sha_.edit._scenarioId-38yPijoD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-CS2cb_eZ.js → entry.client-BSHEfydn.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DMJ7zii9.js → fileTableUtils-DCPhhSMo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-0N0YJQv7.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{git-B4RJRvYB.js → git-DXnyr8uP.js} +8 -8
- package/codeyam-cli/src/webserver/build/client/assets/globals-EVn6Z9pz.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-lzqtyFU8.js → index-CcsFv748.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-B1h680n5.js → index-ChN9-fAY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-CmBYA0PH.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-B7B9V-bu.js → loader-circle-CTqLEAGU.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-aa4ff97b.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-BSlqS1QA.js +81 -0
- package/codeyam-cli/src/webserver/build/client/assets/pause-D6vreykR.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-DVAbJY8B.js +62 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-CxXUmBSd.js → search-B8VUL8nl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-BK-cnzp-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-DwFIBT09.js → simulations-CPoAg7Zo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/terminal-BrCP7uQo.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-B6LgvRJg.js → triangle-alert-BZz2NjYa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-C1v1PQzo.js → useCustomSizes-DNwUduNu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-aSv48UbS.js → useLastLogLine-COky1GVF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DYxHZQuP.js → useReportContext-CpZgwliL.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-mBRpZPiu.js → useToast-Bv9JFvUO.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-Cz2RkDCa.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CUVsWicu.js +260 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/templates/{codeyam-power-rules-hook.sh → codeyam-memory-hook.sh} +12 -13
- package/codeyam-cli/templates/codeyam:diagnose.md +195 -496
- package/codeyam-cli/templates/codeyam:memory.md +403 -0
- package/codeyam-cli/templates/codeyam:new-rule.md +2 -2
- package/codeyam-cli/templates/codeyam:setup.md +12 -0
- package/codeyam-cli/templates/rule-notification-hook.py +56 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +627 -0
- package/codeyam-cli/templates/rules-instructions.md +136 -0
- package/package.json +8 -6
- package/packages/ai/index.js +3 -2
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +68 -13
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +54 -8
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/methodSemantics.js +41 -17
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js +10 -14
- package/packages/ai/src/lib/astScopes/patterns/forInStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +239 -43
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +654 -166
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +5 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +52 -3
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +55 -11
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js +63 -0
- package/packages/ai/src/lib/dataStructure/helpers/coerceObjectsToPrimitivesBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +73 -5
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +173 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +333 -86
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +46 -2
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +205 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +7 -1
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +10 -2
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +209 -3
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/isolateScopes.js +39 -3
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +70 -51
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/resolvePathToControllable.js +24 -14
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
- package/packages/analyze/index.js +1 -0
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +96 -26
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +54 -6
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +17 -4
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +5 -0
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +0 -3
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +880 -0
- package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +56 -10
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +33 -8
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +150 -17
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +56 -8
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +399 -31
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
- package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/index.js +1 -0
- package/packages/analyze/src/lib/index.js.map +1 -1
- package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
- package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
- package/packages/database/src/lib/analysisBranchToDb.js +1 -1
- package/packages/database/src/lib/analysisBranchToDb.js.map +1 -1
- package/packages/database/src/lib/analysisToDb.js +1 -1
- package/packages/database/src/lib/analysisToDb.js.map +1 -1
- package/packages/database/src/lib/branchToDb.js +1 -1
- package/packages/database/src/lib/branchToDb.js.map +1 -1
- package/packages/database/src/lib/commitBranchToDb.js +1 -1
- package/packages/database/src/lib/commitBranchToDb.js.map +1 -1
- package/packages/database/src/lib/commitToDb.js +1 -1
- package/packages/database/src/lib/commitToDb.js.map +1 -1
- package/packages/database/src/lib/fileToDb.js +1 -1
- package/packages/database/src/lib/fileToDb.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +11 -1
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js +35 -0
- package/packages/database/src/lib/kysely/tables/labsRequestsTable.js.map +1 -0
- package/packages/database/src/lib/loadAnalysis.js +8 -0
- package/packages/database/src/lib/loadAnalysis.js.map +1 -1
- package/packages/database/src/lib/loadBranch.js +11 -1
- package/packages/database/src/lib/loadBranch.js.map +1 -1
- package/packages/database/src/lib/loadCommit.js +7 -0
- package/packages/database/src/lib/loadCommit.js.map +1 -1
- package/packages/database/src/lib/loadCommits.js +9 -0
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadEntityBranches.js +9 -0
- package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
- package/packages/database/src/lib/projectToDb.js +1 -1
- package/packages/database/src/lib/projectToDb.js.map +1 -1
- package/packages/database/src/lib/saveFiles.js +1 -1
- package/packages/database/src/lib/saveFiles.js.map +1 -1
- package/packages/database/src/lib/scenarioToDb.js +1 -1
- package/packages/database/src/lib/scenarioToDb.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +5 -4
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +8 -76
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-BXhEawa3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BRb-0kQl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-Cs4MdYtv.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-commit-horizontal-CysbcZxi.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/globals-DMUaGAqV.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-f874c610.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-Bz5TunQg.js +0 -57
- package/codeyam-cli/src/webserver/build/client/assets/rules-hEkvVw2-.js +0 -97
- package/codeyam-cli/src/webserver/build/client/assets/settings-CS5f3WzT.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-uNNbimct.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-B08qC4Y7.js +0 -257
- package/codeyam-cli/templates/codeyam:power-rules.md +0 -449
- /package/codeyam-cli/src/webserver/build/client/assets/{api.rules-l0sNRNKZ.js → api.agent-transcripts-l0sNRNKZ.js} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Entity } from '~codeyam/types';
|
|
2
2
|
import isolateScopes from './isolateScopes';
|
|
3
3
|
import analyzeScope from './analyzeScope';
|
|
4
|
-
import { FileAnalyzer } from '~codeyam/analyze';
|
|
4
|
+
import { FileAnalyzer, transformationTracer } from '~codeyam/analyze';
|
|
5
5
|
import { AI, SerializableDataStructure } from '~codeyam/ai';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
resetScopeDataStructureMetrics,
|
|
8
|
+
ScopeDataStructure,
|
|
9
|
+
} from './dataStructure/ScopeDataStructure';
|
|
7
10
|
|
|
8
11
|
// import { awsLog } from '~codeyam/utils';
|
|
9
12
|
|
|
@@ -91,8 +94,60 @@ export default async function generateEntityDataStructure({
|
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
// Inspect the runtime type of dataStructure to see if it must be serialized
|
|
97
|
+
// Note: When worker threads are used, dataStructure is already serialized (no toSerializable).
|
|
98
|
+
// Workers are disabled when CODEYAM_TRACE_TRANSFORMS=1 to enable full tracing.
|
|
94
99
|
if ('toSerializable' in entityScope.dataStructure) {
|
|
95
|
-
|
|
100
|
+
const scopeDataStructure =
|
|
101
|
+
entityScope.dataStructure as unknown as ScopeDataStructure;
|
|
102
|
+
|
|
103
|
+
// Trace the internal state BEFORE serialization - captures what methods return
|
|
104
|
+
if (transformationTracer.isEnabled()) {
|
|
105
|
+
transformationTracer.startEntity({
|
|
106
|
+
name: entity.name,
|
|
107
|
+
entityType: entity.entityType ?? 'unknown',
|
|
108
|
+
filePath: entity.filePath,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Capture internal state - this is what getReturnValue/getFunctionSignature return
|
|
112
|
+
transformationTracer.snapshot(entity.name, 'scopeDataStructure', {
|
|
113
|
+
signatureSchema: scopeDataStructure.getFunctionSignature({
|
|
114
|
+
fillInUnknowns: true,
|
|
115
|
+
}),
|
|
116
|
+
returnValueSchema: scopeDataStructure.getReturnValue({
|
|
117
|
+
fillInUnknowns: true,
|
|
118
|
+
}),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const serialized = scopeDataStructure.toSerializable();
|
|
123
|
+
|
|
124
|
+
// Trace AFTER serialization - shows what gets output
|
|
125
|
+
if (transformationTracer.isEnabled()) {
|
|
126
|
+
// Build schema from external function calls for comparison
|
|
127
|
+
const externalSchemas: Record<string, string> = {};
|
|
128
|
+
for (const efc of serialized.externalFunctionCalls ?? []) {
|
|
129
|
+
for (const [path, type] of Object.entries(efc.schema ?? {})) {
|
|
130
|
+
externalSchemas[path] = type;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
transformationTracer.snapshot(entity.name, 'serialized', {
|
|
135
|
+
signatureSchema:
|
|
136
|
+
serialized.functionResults?.[entity.name]?.signatureWithUnknowns,
|
|
137
|
+
returnValueSchema:
|
|
138
|
+
serialized.functionResults?.[entity.name]?.returnValueWithUnknowns,
|
|
139
|
+
// Include external function schemas to detect serialization gaps
|
|
140
|
+
dependencySchemas: {
|
|
141
|
+
externalFunctions: {
|
|
142
|
+
combined: {
|
|
143
|
+
returnValueSchema: externalSchemas,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return serialized;
|
|
96
151
|
}
|
|
97
152
|
return entityScope.dataStructure;
|
|
98
153
|
}
|
|
@@ -16,7 +16,9 @@ import validateJson from './validateJson';
|
|
|
16
16
|
import { awsLog, awsLogDebugLevel } from '~codeyam/utils';
|
|
17
17
|
import { AI, parseJsonSafe } from '~codeyam/ai';
|
|
18
18
|
import convertNullToUndefinedBySchema from './dataStructure/helpers/convertNullToUndefinedBySchema';
|
|
19
|
+
import convertTypeAnnotationsToValues from './dataStructure/helpers/convertTypeAnnotationsToValues';
|
|
19
20
|
import fixNullIdsBySchema from './dataStructure/helpers/fixNullIdsBySchema';
|
|
21
|
+
import coerceObjectsToPrimitivesBySchema from './dataStructure/helpers/coerceObjectsToPrimitivesBySchema';
|
|
20
22
|
import { JsonTypeDefinition } from '~codeyam/types';
|
|
21
23
|
import { deepMerge } from '~codeyam/generate';
|
|
22
24
|
import {
|
|
@@ -459,6 +461,193 @@ function fillMissingMockDataKeysWithDefaults(
|
|
|
459
461
|
}
|
|
460
462
|
}
|
|
461
463
|
|
|
464
|
+
/**
|
|
465
|
+
* Enforce execution flow requiredValues by setting falsy paths to null.
|
|
466
|
+
*
|
|
467
|
+
* The LLM doesn't reliably generate null for `comparison: 'falsy'` requirements.
|
|
468
|
+
* For example, a flow like "diffView: falsy" should hide a modal, but the LLM
|
|
469
|
+
* might generate a truthy object, causing the modal to show in all screenshots.
|
|
470
|
+
*
|
|
471
|
+
* This function:
|
|
472
|
+
* 1. Gets requiredValues from covered flows
|
|
473
|
+
* 2. For 'falsy' comparisons: sets the value to null
|
|
474
|
+
* 3. For 'truthy' comparisons with falsy values: generates a default truthy value
|
|
475
|
+
*/
|
|
476
|
+
function enforceRequiredValues(
|
|
477
|
+
mockData: Record<string, unknown>,
|
|
478
|
+
coveredFlowIds: string[],
|
|
479
|
+
executionFlows: ExecutionFlow[],
|
|
480
|
+
): void {
|
|
481
|
+
if (!coveredFlowIds.length || !executionFlows.length) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Get all requiredValues from covered flows
|
|
486
|
+
const coveredFlows = executionFlows.filter((flow) =>
|
|
487
|
+
coveredFlowIds.includes(flow.id),
|
|
488
|
+
);
|
|
489
|
+
|
|
490
|
+
for (const flow of coveredFlows) {
|
|
491
|
+
if (!flow.requiredValues) continue;
|
|
492
|
+
|
|
493
|
+
for (const rv of flow.requiredValues) {
|
|
494
|
+
if (!rv.attributePath) continue;
|
|
495
|
+
|
|
496
|
+
// Find the value in mockData - the path could be nested
|
|
497
|
+
// e.g., attributePath: "diffView" could be at mockData['useDiffModal()'].diffView
|
|
498
|
+
const result = findAndSetValueInMockData(
|
|
499
|
+
mockData,
|
|
500
|
+
rv.attributePath,
|
|
501
|
+
rv.comparison,
|
|
502
|
+
rv.valueType,
|
|
503
|
+
);
|
|
504
|
+
|
|
505
|
+
if (result.found) {
|
|
506
|
+
awsLog(
|
|
507
|
+
`CodeYam: Enforced ${rv.comparison} for ${rv.attributePath} (set to ${result.newValue === null ? 'null' : typeof result.newValue})`,
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Find a value in mockData by attributePath and enforce the comparison.
|
|
516
|
+
* The attributePath could be a simple key or a nested path.
|
|
517
|
+
*
|
|
518
|
+
* Returns { found: boolean, newValue: unknown }
|
|
519
|
+
*/
|
|
520
|
+
function findAndSetValueInMockData(
|
|
521
|
+
mockData: Record<string, unknown>,
|
|
522
|
+
attributePath: string,
|
|
523
|
+
comparison: string,
|
|
524
|
+
valueType?: string,
|
|
525
|
+
): { found: boolean; newValue?: unknown } {
|
|
526
|
+
// Try to find the path at various nesting levels
|
|
527
|
+
// The attributePath might be "diffView" but the actual location is
|
|
528
|
+
// mockData['useDiffModal()'].diffView
|
|
529
|
+
|
|
530
|
+
// Strategy 1: Direct path (e.g., mockData[attributePath])
|
|
531
|
+
if (attributePath in mockData) {
|
|
532
|
+
const currentValue = mockData[attributePath];
|
|
533
|
+
const { shouldChange, newValue } = getEnforcedValue(
|
|
534
|
+
currentValue,
|
|
535
|
+
comparison,
|
|
536
|
+
valueType,
|
|
537
|
+
);
|
|
538
|
+
if (shouldChange) {
|
|
539
|
+
mockData[attributePath] = newValue;
|
|
540
|
+
return { found: true, newValue };
|
|
541
|
+
}
|
|
542
|
+
return { found: true, newValue: currentValue };
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// Strategy 2: Search in nested objects
|
|
546
|
+
for (const [key, value] of Object.entries(mockData)) {
|
|
547
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
548
|
+
const nestedObj = value as Record<string, unknown>;
|
|
549
|
+
|
|
550
|
+
// Check if attributePath exists in this nested object
|
|
551
|
+
if (attributePath in nestedObj) {
|
|
552
|
+
const currentValue = nestedObj[attributePath];
|
|
553
|
+
const { shouldChange, newValue } = getEnforcedValue(
|
|
554
|
+
currentValue,
|
|
555
|
+
comparison,
|
|
556
|
+
valueType,
|
|
557
|
+
);
|
|
558
|
+
if (shouldChange) {
|
|
559
|
+
nestedObj[attributePath] = newValue;
|
|
560
|
+
return { found: true, newValue };
|
|
561
|
+
}
|
|
562
|
+
return { found: true, newValue: currentValue };
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// Also check dot-notation paths (e.g., "diffView.type")
|
|
566
|
+
if (attributePath.includes('.')) {
|
|
567
|
+
const parts = attributePath.split('.');
|
|
568
|
+
const firstPart = parts[0];
|
|
569
|
+
if (firstPart in nestedObj) {
|
|
570
|
+
// Recurse with the rest of the path
|
|
571
|
+
const result = findAndSetValueInMockData(
|
|
572
|
+
nestedObj,
|
|
573
|
+
attributePath,
|
|
574
|
+
comparison,
|
|
575
|
+
valueType,
|
|
576
|
+
);
|
|
577
|
+
if (result.found) return result;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Recursively search deeper
|
|
582
|
+
const result = findAndSetValueInMockData(
|
|
583
|
+
nestedObj,
|
|
584
|
+
attributePath,
|
|
585
|
+
comparison,
|
|
586
|
+
valueType,
|
|
587
|
+
);
|
|
588
|
+
if (result.found) return result;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return { found: false };
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Determine if a value should be changed to match a comparison requirement.
|
|
597
|
+
*
|
|
598
|
+
* For 'falsy' comparison: truthy values should become null
|
|
599
|
+
* For 'truthy' comparison: falsy values should become a default truthy value
|
|
600
|
+
*/
|
|
601
|
+
function getEnforcedValue(
|
|
602
|
+
currentValue: unknown,
|
|
603
|
+
comparison: string,
|
|
604
|
+
valueType?: string,
|
|
605
|
+
): { shouldChange: boolean; newValue: unknown } {
|
|
606
|
+
const isTruthy = Boolean(currentValue);
|
|
607
|
+
|
|
608
|
+
if (comparison === 'falsy') {
|
|
609
|
+
// Value should be falsy
|
|
610
|
+
if (isTruthy) {
|
|
611
|
+
return { shouldChange: true, newValue: null };
|
|
612
|
+
}
|
|
613
|
+
return { shouldChange: false, newValue: currentValue };
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
if (comparison === 'truthy') {
|
|
617
|
+
// Value should be truthy
|
|
618
|
+
if (!isTruthy) {
|
|
619
|
+
// Generate a default truthy value based on valueType
|
|
620
|
+
const defaultValue = generateDefaultTruthyValue(valueType);
|
|
621
|
+
return { shouldChange: true, newValue: defaultValue };
|
|
622
|
+
}
|
|
623
|
+
return { shouldChange: false, newValue: currentValue };
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// For other comparisons (equals, exists, etc.), don't auto-enforce
|
|
627
|
+
return { shouldChange: false, newValue: currentValue };
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Generate a default truthy value for a given type.
|
|
632
|
+
*/
|
|
633
|
+
function generateDefaultTruthyValue(valueType?: string): unknown {
|
|
634
|
+
if (!valueType) return { _placeholder: true };
|
|
635
|
+
|
|
636
|
+
switch (valueType.toLowerCase()) {
|
|
637
|
+
case 'string':
|
|
638
|
+
return 'default-value';
|
|
639
|
+
case 'number':
|
|
640
|
+
return 1;
|
|
641
|
+
case 'boolean':
|
|
642
|
+
return true;
|
|
643
|
+
case 'array':
|
|
644
|
+
return [{ _placeholder: true }];
|
|
645
|
+
case 'object':
|
|
646
|
+
default:
|
|
647
|
+
return { _placeholder: true };
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
462
651
|
type ScenarioDataWithoutDescription = Omit<ScenarioData, 'scenarioDescription'>;
|
|
463
652
|
|
|
464
653
|
interface GenerateEntityScenarioDataArgs {
|
|
@@ -869,6 +1058,19 @@ export async function generateDataForScenario({
|
|
|
869
1058
|
);
|
|
870
1059
|
}
|
|
871
1060
|
|
|
1061
|
+
// Coerce objects/arrays to primitives when the schema expects a primitive type.
|
|
1062
|
+
// The LLM sometimes generates an object where the schema expects "string",
|
|
1063
|
+
// e.g., { body: { "env": "production" } } instead of { body: "some string" }.
|
|
1064
|
+
// This causes runtime errors like "TypeError: body.match is not a function".
|
|
1065
|
+
// Must run BEFORE convertCommaSeparatedStringsToArrays, which intentionally
|
|
1066
|
+
// overrides schema types for array-like field names.
|
|
1067
|
+
if (structure.dataForMocks && fullScenarioData.data.mockData) {
|
|
1068
|
+
coerceObjectsToPrimitivesBySchema(
|
|
1069
|
+
fullScenarioData.data.mockData,
|
|
1070
|
+
structure.dataForMocks,
|
|
1071
|
+
);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
872
1074
|
// Convert comma-separated strings to arrays when appropriate.
|
|
873
1075
|
// The LLM sometimes generates strings like "color,size" instead of arrays
|
|
874
1076
|
// like ["color", "size"] when the schema type is incorrectly inferred as
|
|
@@ -878,6 +1080,16 @@ export async function generateDataForScenario({
|
|
|
878
1080
|
convertCommaSeparatedStringsToArrays(fullScenarioData.data.mockData);
|
|
879
1081
|
}
|
|
880
1082
|
|
|
1083
|
+
// Convert type annotation strings that appear as values to actual values.
|
|
1084
|
+
// The LLM sometimes echoes the schema type annotation as the value.
|
|
1085
|
+
// For example, if the schema says { filePath: "string | undefined" },
|
|
1086
|
+
// the LLM might return { filePath: "string | undefined" } instead of
|
|
1087
|
+
// generating an actual value. This converts those type strings to
|
|
1088
|
+
// appropriate default values (e.g., "string | undefined" → undefined).
|
|
1089
|
+
if (fullScenarioData.data.mockData) {
|
|
1090
|
+
convertTypeAnnotationsToValues(fullScenarioData.data.mockData);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
881
1093
|
// Fix null values for ID fields when the schema indicates they should be non-null.
|
|
882
1094
|
// The LLM sometimes generates `null` for ID fields (e.g., `"id": null`) when
|
|
883
1095
|
// the schema type is `"number"`. This causes runtime issues when code checks
|
|
@@ -886,6 +1098,18 @@ export async function generateDataForScenario({
|
|
|
886
1098
|
fixNullIdsBySchema(fullScenarioData.data.mockData, structure.dataForMocks);
|
|
887
1099
|
}
|
|
888
1100
|
|
|
1101
|
+
// Enforce execution flow requiredValues by setting falsy paths to null.
|
|
1102
|
+
// The LLM doesn't reliably generate null for falsy requirements (e.g., diffView: falsy
|
|
1103
|
+
// to hide a modal). This post-processing ensures that scenarios match their
|
|
1104
|
+
// covered flows' requiredValues.
|
|
1105
|
+
if (fullScenarioData.data.mockData && executionFlows) {
|
|
1106
|
+
enforceRequiredValues(
|
|
1107
|
+
fullScenarioData.data.mockData,
|
|
1108
|
+
scenario.metadata?.coveredFlows || [],
|
|
1109
|
+
executionFlows,
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
889
1113
|
if (structure.arguments && fullScenarioData.data.argumentsData) {
|
|
890
1114
|
for (let i = 0; i < fullScenarioData.data.argumentsData.length; i++) {
|
|
891
1115
|
if (structure.arguments[i]) {
|
|
@@ -1075,6 +1299,60 @@ export default async function generateEntityScenarioData({
|
|
|
1075
1299
|
defaultScenarioData.data.argumentsData.map((arg) => ({ ...arg }));
|
|
1076
1300
|
}
|
|
1077
1301
|
|
|
1302
|
+
// Enforce requiredValues AFTER merge for non-default scenarios
|
|
1303
|
+
// This ensures that if a non-default scenario doesn't cover a certain flow,
|
|
1304
|
+
// it inherits the enforcement from the default scenario
|
|
1305
|
+
if (scenarioData.data?.mockData && executionFlows) {
|
|
1306
|
+
// Get the flows covered by this scenario
|
|
1307
|
+
const scenarioCoveredFlows =
|
|
1308
|
+
nonDefaultScenarios.find(
|
|
1309
|
+
(s) => s.name === result.scenarioData.scenarioDescription,
|
|
1310
|
+
)?.metadata?.coveredFlows || [];
|
|
1311
|
+
|
|
1312
|
+
// Get the paths that the scenario's flows affect
|
|
1313
|
+
const scenarioAffectedPaths = new Set<string>();
|
|
1314
|
+
for (const flowId of scenarioCoveredFlows) {
|
|
1315
|
+
const flow = executionFlows.find((f) => f.id === flowId);
|
|
1316
|
+
if (flow?.requiredValues) {
|
|
1317
|
+
for (const rv of flow.requiredValues) {
|
|
1318
|
+
if (rv.attributePath) {
|
|
1319
|
+
// Extract base path (e.g., "diffView" from "diffView.type")
|
|
1320
|
+
const basePath = rv.attributePath.split('.')[0];
|
|
1321
|
+
scenarioAffectedPaths.add(basePath);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
// Get the default scenario's flows
|
|
1328
|
+
const defaultCoveredFlows =
|
|
1329
|
+
defaultScenario.metadata?.coveredFlows || [];
|
|
1330
|
+
|
|
1331
|
+
// For paths NOT affected by the scenario, apply default's enforcement
|
|
1332
|
+
const defaultFlowsForUnaffectedPaths = defaultCoveredFlows.filter(
|
|
1333
|
+
(flowId) => {
|
|
1334
|
+
const flow = executionFlows.find((f) => f.id === flowId);
|
|
1335
|
+
if (!flow?.requiredValues) return false;
|
|
1336
|
+
|
|
1337
|
+
// Check if this flow affects a path that the scenario doesn't cover
|
|
1338
|
+
return flow.requiredValues.some((rv) => {
|
|
1339
|
+
if (!rv.attributePath) return false;
|
|
1340
|
+
const basePath = rv.attributePath.split('.')[0];
|
|
1341
|
+
return !scenarioAffectedPaths.has(basePath);
|
|
1342
|
+
});
|
|
1343
|
+
},
|
|
1344
|
+
);
|
|
1345
|
+
|
|
1346
|
+
// Apply enforcement from default scenario for unaffected paths
|
|
1347
|
+
if (defaultFlowsForUnaffectedPaths.length > 0) {
|
|
1348
|
+
enforceRequiredValues(
|
|
1349
|
+
scenarioData.data.mockData,
|
|
1350
|
+
defaultFlowsForUnaffectedPaths,
|
|
1351
|
+
executionFlows,
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1078
1356
|
return scenarioData;
|
|
1079
1357
|
});
|
|
1080
1358
|
|
|
@@ -1104,7 +1382,8 @@ Generate COMPLETE, robust data for the entire data structure.
|
|
|
1104
1382
|
: `## Non-Default Scenario
|
|
1105
1383
|
Generate ONLY the differences from the default scenario.
|
|
1106
1384
|
- Include only fields that need to change
|
|
1107
|
-
-
|
|
1385
|
+
- For object/scalar fields: set to \`null\` to remove/unset the data
|
|
1386
|
+
- For array fields: use \`[]\` for empty arrays (not \`null\`) unless the schema type explicitly includes \`| null\`
|
|
1108
1387
|
- Omit unchanged fields—they merge from default`;
|
|
1109
1388
|
|
|
1110
1389
|
// Only include the "NO ERROR DATA" instruction when the scenario doesn't require error data
|
|
@@ -1188,6 +1467,7 @@ Use simple elements only (\`<div>\`, \`<span>\`). No custom components.
|
|
|
1188
1467
|
- Arrays should have many items (at least 4) unless specified otherwise
|
|
1189
1468
|
- Each item must follow the exact structure provided
|
|
1190
1469
|
- In general we want robust data, not minimal data unless specified otherwise
|
|
1470
|
+
- For empty arrays, use \`[]\` (not \`null\`) unless the schema type explicitly includes \`| null\` and the scenario requires the attribute be removed
|
|
1191
1471
|
|
|
1192
1472
|
## CRITICAL: Preserve Exact Structure
|
|
1193
1473
|
Your response MUST mirror the EXACT nested structure provided in mockData Structure.
|
|
@@ -1267,6 +1547,7 @@ Use simple elements only (\`<div>\`, \`<span>\`). No custom components.
|
|
|
1267
1547
|
### Arrays
|
|
1268
1548
|
- Arrays should have many items (at least 4) unless specified otherwise
|
|
1269
1549
|
- Each item must follow the exact structure provided
|
|
1550
|
+
- For empty arrays, use \`[]\` (not \`null\`) unless the schema type explicitly includes \`| null\` and the scenario requires the attribute be removed
|
|
1270
1551
|
|
|
1271
1552
|
## CRITICAL: Preserve Exact Structure
|
|
1272
1553
|
Your response MUST mirror the EXACT nested structure provided for the missing keys.
|
|
@@ -1395,4 +1676,5 @@ NEVER include "error" fields in responses. Skip them entirely.
|
|
|
1395
1676
|
- No \`undefined\`—use \`null\` or omit
|
|
1396
1677
|
- Generate data for ALL keys in the chunk (don't skip any)
|
|
1397
1678
|
- Arrays should have many items (at least 4) unless specified otherwise
|
|
1679
|
+
- For empty arrays, use \`[]\` (not \`null\`) unless the schema type explicitly includes \`| null\` and the scenario requires the attribute be removed
|
|
1398
1680
|
`;
|
|
@@ -176,11 +176,15 @@ export default async function generateEntityScenarios({
|
|
|
176
176
|
return { scenarios: [], llmCall };
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
const dataScenarios = result[`${error ? 'errorD' : 'd'}ataScenarios`];
|
|
180
|
+
|
|
181
|
+
// Gracefully handle missing dataScenarios (e.g., when LLM returns unexpected format
|
|
182
|
+
// or when test fixtures don't include the expected key)
|
|
183
|
+
if (!Array.isArray(dataScenarios)) {
|
|
184
|
+
return { scenarios: [], llmCall };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const scenarios = (dataScenarios as unknown as ScenarioResult[]).map(
|
|
184
188
|
(scenarioInfo) =>
|
|
185
189
|
({
|
|
186
190
|
projectId: entity.projectId,
|
|
@@ -143,6 +143,7 @@ export default function generateExecutionFlows({
|
|
|
143
143
|
childIsolated.equivalentSignatureVariables ?? {},
|
|
144
144
|
compoundConditionals: childIsolated.compoundConditionals ?? [],
|
|
145
145
|
gatingConditions,
|
|
146
|
+
jsxRenderingUsages: childIsolated.jsxRenderingUsages ?? [],
|
|
146
147
|
};
|
|
147
148
|
}
|
|
148
149
|
}
|
|
@@ -159,6 +160,7 @@ export default function generateExecutionFlows({
|
|
|
159
160
|
? childComponentData
|
|
160
161
|
: undefined,
|
|
161
162
|
derivedVariables,
|
|
163
|
+
sourceEquivalencies: mergedDataStructure.sourceEquivalencies,
|
|
162
164
|
});
|
|
163
165
|
|
|
164
166
|
console.log(
|
|
@@ -253,7 +255,7 @@ export default function generateExecutionFlows({
|
|
|
253
255
|
*/
|
|
254
256
|
function buildGatingPathToChildrenMap(
|
|
255
257
|
childBoundaryGatingConditions: Record<string, ConditionalUsage[]>,
|
|
256
|
-
equivalentSignatureVariables: Record<string, string>,
|
|
258
|
+
equivalentSignatureVariables: Record<string, string | string[]>,
|
|
257
259
|
attributesMap: Record<string, string>,
|
|
258
260
|
fullToShortPathMap: Record<string, string>,
|
|
259
261
|
): Map<string, string[]> {
|
|
@@ -279,10 +281,13 @@ function buildGatingPathToChildrenMap(
|
|
|
279
281
|
fullToShortPathMap,
|
|
280
282
|
);
|
|
281
283
|
|
|
284
|
+
// Get the equivalent, handling array case (use first element if array)
|
|
285
|
+
const equiv = equivalentSignatureVariables[gatingPath];
|
|
286
|
+
const equivPath = Array.isArray(equiv) ? equiv[0] : equiv;
|
|
282
287
|
const finalPath =
|
|
283
288
|
resolution.isControllable && resolution.resolvedPath
|
|
284
289
|
? resolution.resolvedPath
|
|
285
|
-
: (
|
|
290
|
+
: (equivPath ?? gatingPath);
|
|
286
291
|
|
|
287
292
|
// Add this child to the list of children gated by this path
|
|
288
293
|
const existing = gatingPathToChildren.get(finalPath) ?? [];
|
|
@@ -303,10 +308,13 @@ function buildGatingPathToChildrenMap(
|
|
|
303
308
|
equivalentSignatureVariables,
|
|
304
309
|
fullToShortPathMap,
|
|
305
310
|
);
|
|
311
|
+
// Get the equivalent, handling array case (use first element if array)
|
|
312
|
+
const varEquiv = equivalentSignatureVariables[varName];
|
|
313
|
+
const varEquivPath = Array.isArray(varEquiv) ? varEquiv[0] : varEquiv;
|
|
306
314
|
const resolvedVarPath =
|
|
307
315
|
varResolution.isControllable && varResolution.resolvedPath
|
|
308
316
|
? varResolution.resolvedPath
|
|
309
|
-
: (
|
|
317
|
+
: (varEquivPath ?? varName);
|
|
310
318
|
|
|
311
319
|
const varExisting = gatingPathToChildren.get(resolvedVarPath) ?? [];
|
|
312
320
|
if (!varExisting.includes(childName)) {
|
package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface GenerateExecutionFlowsOptions {
|
|
|
18
18
|
/** Map of controllable paths to their types (for path resolution) */
|
|
19
19
|
attributesMap?: Record<string, string>;
|
|
20
20
|
/** Map from local variable names to data sources */
|
|
21
|
-
equivalentSignatureVariables?: Record<string, string>;
|
|
21
|
+
equivalentSignatureVariables?: Record<string, string | string[]>;
|
|
22
22
|
/** Map from full paths to short paths */
|
|
23
23
|
fullToShortPathMap?: Record<string, string>;
|
|
24
24
|
/**
|