groundswell 0.0.1 → 0.0.2
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/.claude/commands/subtask-planning/prp-base-create.md +120 -0
- package/.claude/commands/subtask-planning/prp-base-execute.md +65 -0
- package/.claude/commands/task-breakdown.md +94 -0
- package/.claude/system_prompts/task-breakdown.md +1 -0
- package/CHANGELOG.md +188 -0
- package/PRD.md +543 -0
- package/README.md +99 -5
- package/examples/README.md +15 -1
- package/examples/examples/11-reparenting-workflows.ts +269 -0
- package/examples/index.ts +4 -0
- package/package-lock.json +2398 -0
- package/package.json +3 -1
- package/plan/001_d3bb02af4886/TEST_RESULTS.md +259 -0
- package/plan/001_d3bb02af4886/bug_fix_tasks.json +484 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S1/PRP.md +488 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S2/PRP.md +581 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S3/PRP.md +687 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S1/PRP.md +492 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/PRP.md +932 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/concurrent_error_testing_patterns.md +1109 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/vitest_concurrent_testing.md +802 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/workflow_engine_test_references.md +603 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S1/PRP.md +564 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S3/PRP.md +518 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S4/PRP.md +1252 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/PRP.md +364 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/CODEBASE_INVENTORY.md +114 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/DECORATOR_DOCUMENTATION_PATTERNS.md +205 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/PRD_LOCATION_ANALYSIS.md +199 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/ULTRATHINK_PRP_PLAN.md +134 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S1/PRP.md +495 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S1/research/console_error_inventory.md +435 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S2/PRP.md +506 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S3/PRP.md +612 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T2S2/PRP.md +558 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T2S2/research/external_research.md +788 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S2/PRP.md +460 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S3/PRP.md +454 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/PRP.md +520 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/RECOMMENDATION.md +417 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/research/external_workflow_engines_research.md +760 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/research/security_implications_analysis.md +245 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S2/PRP.md +792 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S1/PRP.md +535 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S1/TEST_EXECUTION_REPORT.md +190 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/PRP.md +654 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/TEST_FIX_REPORT.md +227 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/KEY_FINDINGS.md +345 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/QUICK_REFERENCE.md +193 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/test_maintenance_research.md +1323 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S1/BREAKING_CHANGES_AUDIT.md +1011 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S1/PRP.md +927 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S2/PRP.md +505 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/architecture/logger_child_signature_analysis.md +401 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/child_implementation_research.md +142 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/test_patterns_research.md +112 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/vitest_patterns_research.md +159 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/PRP.md +549 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/VERIFICATION_REPORT.md +368 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/edge_case_analysis.md +172 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/usage_inventory.md +175 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T1S2/PRP.md +696 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T1S4/PRP.md +860 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/PRP.md +1066 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/01-testing-aggregated-errors.md +1103 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/01_typescript_error_aggregation_patterns.md +789 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/02-error-merge-strategy-testing-guide.md +1098 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/02_aggregate_error_patterns.md +1037 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/03-promise-allsettled-testing-patterns.md +916 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/03_error_merging_strategies.md +1045 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/04_github_stackoverflow_examples.md +890 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/05_comprehensive_summary.md +822 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/INDEX.md +668 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/QUICK_REFERENCE.md +706 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/README.md +265 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/RESEARCH_REPORT.md +655 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S4/research/vitest_testing_patterns.md +1103 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T3S2/PRP.md +426 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/PRP.md +506 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/QUICK_REFERENCE.md +114 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/RESEARCH_SUMMARY.md +316 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/vitest_observer_error_logging_best_practices.md +754 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S3/PRP.md +612 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/PRP.md +719 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/README.md +215 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/analysis.md +765 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S3/PRP.md +718 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/DECISION.md +149 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/PRP.md +470 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/ULTRATHINK_PLAN.md +332 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/codebase_workflow_name_analysis.md +167 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/external_best_practices.md +265 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/validation_patterns.md +273 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T4S1/workflow_engine_ancestry_api_research.md +760 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T4S3-PRP.md +434 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S1/PRP.md +717 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/PRP.md +472 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/VALIDATION_REPORT.md +125 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/research/ULTRATHINK_PRP_PLAN.md +301 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/error-logging-best-practices.md +1170 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/research_typescript_partial_and_overloads.md +940 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/vitest-quick-reference.md +151 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/vitest-research.md +650 -0
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/prd_snapshot.md +259 -0
- package/plan/001_d3bb02af4886/bugfix/P1M1T1S1/PRP.md +457 -0
- package/plan/001_d3bb02af4886/bugfix/RESEARCH_SUMMARY.md +346 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/codebase_structure.md +311 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/concurrent_execution_best_practices.md +1565 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/error_handling_patterns.md +288 -0
- package/plan/001_d3bb02af4886/bugfix/architecture/promise_all_analysis.md +741 -0
- package/plan/001_d3bb02af4886/docs/PRP/P1M1T1S4-functional-workflow-error-state-capture-test.md +652 -0
- package/plan/001_d3bb02af4886/docs/PRP/PRP.md +527 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S1-PRP.md +415 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S2-PRP.md +378 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S4-PRP.md +713 -0
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M2T1S4-PRP.md +370 -0
- package/plan/001_d3bb02af4886/docs/PRP_P1M3T1S3.md +499 -0
- package/plan/001_d3bb02af4886/docs/TEST_RESULTS.md +230 -0
- package/plan/001_d3bb02af4886/docs/bugfix/ANALYSIS_PRD_VS_IMPLEMENTATION.md +1134 -0
- package/plan/001_d3bb02af4886/docs/bugfix/GAP_ANALYSIS_SUMMARY.md +179 -0
- package/plan/001_d3bb02af4886/docs/bugfix/P1M4T2S1/PRP.md +629 -0
- package/plan/001_d3bb02af4886/docs/bugfix/P1M4T2S1/validation-report.md +214 -0
- package/plan/001_d3bb02af4886/docs/bugfix/PRP_P1M4T2S3.md +629 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_PRP.md +529 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_QUICK_REFERENCE.md +142 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_README.md +304 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_TEST_RESULTS.md +558 -0
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_VALIDATION_SUMMARY.md +256 -0
- package/plan/001_d3bb02af4886/docs/bugfix/system_context.md +346 -0
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/bug_analysis.md +415 -0
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/implementation_patterns.md +489 -0
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/system_context.md +218 -0
- package/plan/001_d3bb02af4886/docs/bugfix_INITIATION_SUMMARY.md +380 -0
- package/plan/001_d3bb02af4886/docs/research/CYCLE_DETECTION_PATTERNS.md +1923 -0
- package/plan/001_d3bb02af4886/docs/research/CYCLE_DETECTION_QUICK_REF.md +319 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/codebase-context.md +115 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/cycle-detection-algorithms.md +134 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/test-patterns.md +153 -0
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/workflow-class.md +132 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/DECORATOR_DOCUMENTATION_BEST_PRACTICES.md +716 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/DECORATOR_DOCUMENTATION_QUICK_REF.md +186 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/GROUNDSWELL_DECORATOR_EXAMPLES.md +604 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/INDEX.md +213 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/codebase_structure.md +30 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/existing_test_pattern.md +56 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/getRootObservers_implementation.md +53 -0
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/test_conventions.md +49 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/PRP.md +958 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/QUICK_REFERENCE.md +339 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/README.md +305 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/SUMMARY.md +433 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/bidirectional-tree-consistency-testing.md +1574 -0
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/test-pattern-examples.md +1014 -0
- package/plan/001_d3bb02af4886/docs/research/PROMISE_ALLSETTLED_QUICK_REF.md +376 -0
- package/plan/001_d3bb02af4886/docs/research/PROMISE_ALLSETTLED_RESEARCH.md +1507 -0
- package/plan/001_d3bb02af4886/docs/research/bugfix_typescript_patterns.md +949 -0
- package/plan/001_d3bb02af4886/docs/research/error-testing-research.md +619 -0
- package/plan/001_d3bb02af4886/docs/research/error_handling_patterns.md +723 -0
- package/plan/{research → 001_d3bb02af4886/docs/research/general}/introspection-security-guide.md +56 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/PRP_TEMPLATE.md +460 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/QUICK_REFERENCE.md +324 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/README.md +175 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/RESEARCH_REPORT.md +499 -0
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/SUMMARY.md +163 -0
- package/plan/bugfix/BUG_FIX_SUMMARY.md +961 -0
- package/src/__tests__/adversarial/attachChild-performance.test.ts +216 -0
- package/src/__tests__/adversarial/circular-reference.test.ts +101 -0
- package/src/__tests__/adversarial/complex-circular-reference.test.ts +139 -0
- package/src/__tests__/adversarial/concurrent-task-failures.test.ts +571 -0
- package/src/__tests__/adversarial/deep-analysis.test.ts +729 -0
- package/src/__tests__/adversarial/deep-hierarchy-stress.test.ts +213 -0
- package/src/__tests__/adversarial/e2e-prd-validation.test.ts +448 -0
- package/src/__tests__/adversarial/edge-case.test.ts +703 -0
- package/src/__tests__/adversarial/error-merge-strategy.test.ts +760 -0
- package/src/__tests__/adversarial/incremental-performance.test.ts +140 -0
- package/src/__tests__/adversarial/node-map-update-benchmarks.test.ts +457 -0
- package/src/__tests__/adversarial/observer-propagation.test.ts +487 -0
- package/src/__tests__/adversarial/parent-validation.test.ts +143 -0
- package/src/__tests__/adversarial/prd-12-2-compliance.test.ts +611 -0
- package/src/__tests__/adversarial/prd-compliance.test.ts +731 -0
- package/src/__tests__/compatibility/backward-compatibility.test.ts +1572 -0
- package/src/__tests__/helpers/index.ts +18 -0
- package/src/__tests__/helpers/tree-verification.ts +257 -0
- package/src/__tests__/integration/bidirectional-consistency.test.ts +847 -0
- package/src/__tests__/integration/observer-logging.test.ts +643 -0
- package/src/__tests__/integration/tree-mirroring.test.ts +37 -0
- package/src/__tests__/integration/workflow-reparenting.test.ts +303 -0
- package/src/__tests__/unit/context.test.ts +79 -0
- package/src/__tests__/unit/logger.test.ts +293 -0
- package/src/__tests__/unit/observable.test.ts +321 -0
- package/src/__tests__/unit/tree-debugger-incremental.test.ts +170 -0
- package/src/__tests__/unit/utils/workflow-error-utils.test.ts +209 -0
- package/src/__tests__/unit/workflow-detachChild.test.ts +100 -0
- package/src/__tests__/unit/workflow-emitEvent-childDetached.test.ts +153 -0
- package/src/__tests__/unit/workflow-isDescendantOf.test.ts +180 -0
- package/src/__tests__/unit/workflow.test.ts +277 -1
- package/src/core/agent.ts +21 -1
- package/src/core/logger.ts +27 -2
- package/src/core/workflow-context.ts +6 -4
- package/src/core/workflow.ts +252 -14
- package/src/debugger/tree-debugger.ts +52 -7
- package/src/decorators/task.ts +65 -2
- package/src/index.ts +4 -2
- package/src/types/decorators.ts +8 -1
- package/src/types/events.ts +1 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/observable.ts +32 -3
- package/src/utils/workflow-error-utils.ts +56 -0
- package/tsconfig.json +1 -1
- package/llms_full.txt +0 -5890
- package/tasks.json +0 -0
- /package/plan/{backlog.json → 001_d3bb02af4886/backlog.json} +0 -0
- /package/plan/{P1P2/PRP.md → 001_d3bb02af4886/docs/PRP/P1P2-PRP.md} +0 -0
- /package/plan/{P3P4/PRP.md → 001_d3bb02af4886/docs/PRP/P3P4-PRP.md} +0 -0
- /package/plan/{P4P5/PRP.md → 001_d3bb02af4886/docs/PRP/P4P5-PRP.md} +0 -0
- /package/plan/{architecture → 001_d3bb02af4886/docs/architecture}/external_deps.md +0 -0
- /package/plan/{architecture → 001_d3bb02af4886/docs/architecture}/system_context.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_BEST_PRACTICES.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_CODE_PATTERNS.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_INTEGRATION_GUIDE.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/LRU_CACHE_RESEARCH_INDEX.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/REFLECTION_INDEX.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/REFLECTION_RESEARCH_REPORT.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/RESEARCH_SUMMARY.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/anthropic-sdk.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/async-local-storage.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-code-patterns.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-decision-matrix.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-implementation-guide.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-integration-guide.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-patterns.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/reflection-quick-reference.md +0 -0
- /package/plan/{P1P2/research → 001_d3bb02af4886/docs/research/P1P2}/zod-schema.md +0 -0
- /package/plan/{P3P4/research → 001_d3bb02af4886/docs/research/P3P4}/caching-lru.md +0 -0
- /package/plan/{P3P4/research → 001_d3bb02af4886/docs/research/P3P4}/introspection-tools.md +0 -0
- /package/plan/{P3P4/research → 001_d3bb02af4886/docs/research/P3P4}/reflection-patterns.md +0 -0
- /package/plan/{P4P5/research → 001_d3bb02af4886/docs/research/P4P5}/RESEARCH_SUMMARY.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/INTROSPECTION_RESEARCH_SUMMARY.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/README-INTROSPECTION.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/agent-introspection-patterns.md +0 -0
- /package/plan/{research → 001_d3bb02af4886/docs/research/general}/introspection-tool-examples.md +0 -0
- /package/{PRPs/PRDs/001-hierarchical-workflow-engine.md → plan/001_d3bb02af4886/prd_snapshot.md} +0 -0
package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/ULTRATHINK_PLAN.md
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
# ULTRATHINK PRP Writing Plan
|
|
2
|
+
|
|
3
|
+
## Research Summary Complete ✓
|
|
4
|
+
|
|
5
|
+
### Research Files Created:
|
|
6
|
+
1. `research/codebase_workflow_name_analysis.md` - Current implementation state, test evidence, patterns
|
|
7
|
+
2. `research/external_best_practices.md` - Industry standards (Kubernetes, Airflow, AWS, etc.)
|
|
8
|
+
3. `research/validation_patterns.md` - Codebase validation patterns and test patterns
|
|
9
|
+
|
|
10
|
+
### Key Findings:
|
|
11
|
+
|
|
12
|
+
**Current State:**
|
|
13
|
+
- Empty strings accepted (test in edge-case.test.ts:107-117 proves this)
|
|
14
|
+
- No validation exists in Workflow constructor (src/core/workflow.ts:83-108)
|
|
15
|
+
- Whitespace-only strings accepted
|
|
16
|
+
- Default falls back to class name when undefined
|
|
17
|
+
|
|
18
|
+
**Issue 8 Context:**
|
|
19
|
+
- Minor severity
|
|
20
|
+
- "Should probably be non-empty string"
|
|
21
|
+
- Two options: validate OR document that empty names are valid
|
|
22
|
+
- This is a DECISION task - the output is documentation of requirements
|
|
23
|
+
|
|
24
|
+
**Codebase Patterns:**
|
|
25
|
+
- Validation uses `throw new Error()` with descriptive messages
|
|
26
|
+
- Tests use regex matching: `expect(() => ...).toThrow(/pattern/i)`
|
|
27
|
+
- No custom error classes - standard `Error`
|
|
28
|
+
- Error messages include values in quotes
|
|
29
|
+
|
|
30
|
+
**External Best Practices:**
|
|
31
|
+
- All workflow engines validate names
|
|
32
|
+
- Common rules: non-empty, no spaces, length limits
|
|
33
|
+
- AWS/Airflow pattern: alphanumeric + hyphens/underscores
|
|
34
|
+
- Recommended for Groundswell: minimal validation (non-empty after trim)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## PRP Section-by-Section Structure Plan
|
|
39
|
+
|
|
40
|
+
### Section 1: Goal
|
|
41
|
+
**Content to Fill:**
|
|
42
|
+
- **Feature Goal:** Determine and document workflow name validation requirements
|
|
43
|
+
- **Deliverable:** Decision document with validation rules (if chosen) OR documentation that empty names are valid
|
|
44
|
+
- **Success Definition:** Clear decision documented with rationale, ready for P1.M3.T3.S2 implementation
|
|
45
|
+
|
|
46
|
+
**Information Sources:**
|
|
47
|
+
- Issue 8 description from TEST_RESULTS.md
|
|
48
|
+
- P1.M3.T3 task description from bug_fix_tasks.json
|
|
49
|
+
|
|
50
|
+
### Section 2: User Persona (if applicable)
|
|
51
|
+
**Content to Fill:**
|
|
52
|
+
- This is an internal bug fix task - no end user persona
|
|
53
|
+
- Target: Development team implementing validation
|
|
54
|
+
- Consider whether to skip or adapt this section
|
|
55
|
+
|
|
56
|
+
### Section 3: Why
|
|
57
|
+
**Content to Fill:**
|
|
58
|
+
- Business value: Prevent confusing workflow names in tree debugger
|
|
59
|
+
- User impact: Empty names provide no useful information in UI
|
|
60
|
+
- Integration with Issue 8 bug fix
|
|
61
|
+
- Problems solved: Confusion from empty/whitespace names
|
|
62
|
+
|
|
63
|
+
### Section 4: What
|
|
64
|
+
**Content to Fill:**
|
|
65
|
+
- Research task: analyze PRD, review examples, consult with team
|
|
66
|
+
- Decision on: validation OR document empty names as valid
|
|
67
|
+
- If validation: specify exact rules (non-empty? whitespace? length?)
|
|
68
|
+
- Output: decision document with rationale
|
|
69
|
+
|
|
70
|
+
**Success Criteria:**
|
|
71
|
+
- [ ] Decision documented with clear rationale
|
|
72
|
+
- [ ] If validation chosen: exact rules specified
|
|
73
|
+
- [ ] If no validation: documentation explaining why
|
|
74
|
+
- [ ] Ready for implementation in P1.M3.T3.S2
|
|
75
|
+
|
|
76
|
+
### Section 5: All Needed Context (CRITICAL - Context Completeness)
|
|
77
|
+
|
|
78
|
+
#### 5.1 Documentation & References (YAML)
|
|
79
|
+
**Files to Include:**
|
|
80
|
+
```yaml
|
|
81
|
+
- file: plan/001_d3bb02af4886/TEST_RESULTS.md
|
|
82
|
+
why: Contains Issue 8 bug report with expected vs actual behavior
|
|
83
|
+
section: Lines 196-217 (Issue 8 section)
|
|
84
|
+
critical: Shows empty string is currently accepted but "should probably be non-empty"
|
|
85
|
+
|
|
86
|
+
- file: plan/001_d3bb02af4886/bug_fix_tasks.json
|
|
87
|
+
why: Contains P1.M3.T3 task description and subtasks
|
|
88
|
+
section: Lines 301-338
|
|
89
|
+
critical: Shows this is S1 (research) before S2 (implementation)
|
|
90
|
+
|
|
91
|
+
- file: PRD.md
|
|
92
|
+
why: Check if PRD specifies workflow name requirements
|
|
93
|
+
section: Section 3.1 - WorkflowNode Interface (lines 56-72)
|
|
94
|
+
critical: PRD only specifies `name: string` with no validation requirements
|
|
95
|
+
|
|
96
|
+
- file: src/core/workflow.ts
|
|
97
|
+
why: Current implementation with no validation
|
|
98
|
+
section: Lines 83-108 (constructor)
|
|
99
|
+
pattern: Note how name is set without validation
|
|
100
|
+
gotcha: Both class-based and functional constructor patterns
|
|
101
|
+
|
|
102
|
+
- file: src/__tests__/adversarial/edge-case.test.ts
|
|
103
|
+
why: Current test explicitly verifies empty names work
|
|
104
|
+
section: Lines 107-117
|
|
105
|
+
critical: Will need modification if validation is added
|
|
106
|
+
|
|
107
|
+
- file: src/__tests__/unit/workflow.test.ts
|
|
108
|
+
why: Examples of name testing patterns
|
|
109
|
+
section: Lines 20-28
|
|
110
|
+
pattern: Tests for default class name and custom name
|
|
111
|
+
|
|
112
|
+
- docfile: research/external_best_practices.md
|
|
113
|
+
why: Industry standards for workflow name validation
|
|
114
|
+
section: Recommendation for Groundswell section
|
|
115
|
+
|
|
116
|
+
- docfile: research/validation_patterns.md
|
|
117
|
+
why: Codebase validation patterns to follow
|
|
118
|
+
section: Implementation Recommendations section
|
|
119
|
+
|
|
120
|
+
- docfile: research/codebase_workflow_name_analysis.md
|
|
121
|
+
why: Complete analysis of current state
|
|
122
|
+
section: Validation Decision Point section
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### 5.2 Current Codebase Tree
|
|
126
|
+
**Need to run:**
|
|
127
|
+
```bash
|
|
128
|
+
tree -L 3 -I 'node_modules|dist|build' /home/dustin/projects/groundswell
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### 5.3 Desired Codebase Tree (for this task)
|
|
132
|
+
Since this is a research task, the only output is the decision document:
|
|
133
|
+
```bash
|
|
134
|
+
plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S1/
|
|
135
|
+
├── PRP.md # This PRP
|
|
136
|
+
├── research/ # Created during research phase
|
|
137
|
+
│ ├── codebase_workflow_name_analysis.md
|
|
138
|
+
│ ├── external_best_practices.md
|
|
139
|
+
│ └── validation_patterns.md
|
|
140
|
+
└── DECISION.md # OUTPUT: Decision document with rationale
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### 5.4 Known Gotchas
|
|
144
|
+
```typescript
|
|
145
|
+
// CRITICAL: Two constructor patterns exist
|
|
146
|
+
// 1. Class-based: new Workflow('name')
|
|
147
|
+
// 2. Functional: new Workflow({ name: 'name' }, executor)
|
|
148
|
+
// Validation must handle both
|
|
149
|
+
|
|
150
|
+
// CRITICAL: Current test expects empty names to work
|
|
151
|
+
// File: src/__tests__/adversarial/edge-case.test.ts:107-117
|
|
152
|
+
// If validation added, this test must be updated
|
|
153
|
+
|
|
154
|
+
// CRITICAL: Undefined names fall back to class name
|
|
155
|
+
// This is desired behavior - only validate non-undefined strings
|
|
156
|
+
|
|
157
|
+
// CRITICAL: No validation patterns exist for strings in codebase
|
|
158
|
+
// Must establish first pattern for string validation
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Section 6: Implementation Blueprint
|
|
162
|
+
|
|
163
|
+
#### 6.1 Data Models and Structure
|
|
164
|
+
**For this research task:** No data models - output is documentation
|
|
165
|
+
|
|
166
|
+
#### 6.2 Implementation Tasks (ordered by dependencies)
|
|
167
|
+
```yaml
|
|
168
|
+
Task 1: REVIEW PRD.md for workflow name requirements
|
|
169
|
+
- READ: Section 3.1 - WorkflowNode Interface
|
|
170
|
+
- CHECK: Any validation rules specified
|
|
171
|
+
- DOCUMENT: Findings (none currently specified)
|
|
172
|
+
|
|
173
|
+
Task 2: ANALYZE existing workflow name examples
|
|
174
|
+
- SEARCH: Codebase for workflow instantiations
|
|
175
|
+
- CATALOG: Common naming patterns (PascalCase, descriptive, etc.)
|
|
176
|
+
- CHECK: Any empty name examples beyond test
|
|
177
|
+
- DOCUMENT: Pattern analysis
|
|
178
|
+
|
|
179
|
+
Task 3: RESEARCH external best practices (COMPLETED)
|
|
180
|
+
- REVIEW: Industry standards (Kubernetes, Airflow, AWS)
|
|
181
|
+
- IDENTIFY: Common validation rules
|
|
182
|
+
- STORE: In research/external_best_practices.md
|
|
183
|
+
|
|
184
|
+
Task 4: MAKE DECISION on validation approach
|
|
185
|
+
- EVALUATE: Arguments for validation (confusion, industry standard)
|
|
186
|
+
- EVALUATE: Arguments against (backward compatibility, permissiveness)
|
|
187
|
+
- DECIDE: Add validation OR document empty names as valid
|
|
188
|
+
- IF VALIDATION: Specify exact rules (non-empty? trim? length?)
|
|
189
|
+
- DOCUMENT: Decision with rationale
|
|
190
|
+
|
|
191
|
+
Task 5: CREATE DECISION.md document
|
|
192
|
+
- INCLUDE: Decision (validate or not)
|
|
193
|
+
- INCLUDE: Rationale (why this decision)
|
|
194
|
+
- IF VALIDATION: Include exact rules to implement
|
|
195
|
+
- IF NO VALIDATION: Include why empty names are acceptable
|
|
196
|
+
- REFERENCE: Issue 8, PRD sections, external research
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### 6.3 Implementation Patterns & Key Details
|
|
200
|
+
**For research task:**
|
|
201
|
+
```typescript
|
|
202
|
+
// Decision document structure
|
|
203
|
+
## Decision
|
|
204
|
+
[CHOSEN APPROACH]
|
|
205
|
+
|
|
206
|
+
## Rationale
|
|
207
|
+
1. [Reason 1]
|
|
208
|
+
2. [Reason 2]
|
|
209
|
+
3. [Reason 3]
|
|
210
|
+
|
|
211
|
+
## Validation Rules (if applicable)
|
|
212
|
+
- Rule 1: [specific rule]
|
|
213
|
+
- Rule 2: [specific rule]
|
|
214
|
+
- Rule 3: [specific rule]
|
|
215
|
+
|
|
216
|
+
## References
|
|
217
|
+
- Issue 8: [findings]
|
|
218
|
+
- PRD Section 3.1: [findings]
|
|
219
|
+
- External research: [summary]
|
|
220
|
+
- Codebase patterns: [summary]
|
|
221
|
+
|
|
222
|
+
## Next Steps
|
|
223
|
+
- P1.M3.T3.S2: Implement validation in constructor
|
|
224
|
+
- P1.M3.T3.S3: Add/update tests
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
#### 6.4 Integration Points
|
|
228
|
+
```yaml
|
|
229
|
+
NO INTEGRATION:
|
|
230
|
+
- This is pure research/documentation task
|
|
231
|
+
- No code changes in this subtask
|
|
232
|
+
- Output feeds into P1.M3.T3.S2 implementation
|
|
233
|
+
|
|
234
|
+
RELATED TASKS:
|
|
235
|
+
- P1.M3.T3.S2: Will use decision to implement validation
|
|
236
|
+
- P1.M3.T3.S3: Will create tests based on validation rules
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Section 7: Validation Loop
|
|
240
|
+
|
|
241
|
+
#### 7.1 Level 1: Syntax & Style
|
|
242
|
+
**For research task:**
|
|
243
|
+
```bash
|
|
244
|
+
# Not applicable - no code generated
|
|
245
|
+
# DECISION.md should be well-formatted markdown
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
#### 7.2 Level 2: Unit Tests
|
|
249
|
+
**For research task:**
|
|
250
|
+
```bash
|
|
251
|
+
# Not applicable - no code to test
|
|
252
|
+
# Decision should be reviewed by team
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### 7.3 Level 3: Integration Testing
|
|
256
|
+
**For research task:**
|
|
257
|
+
```bash
|
|
258
|
+
# Verify decision is documented
|
|
259
|
+
cat plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S1/DECISION.md
|
|
260
|
+
|
|
261
|
+
# Should contain clear decision and rationale
|
|
262
|
+
# If validation: should contain exact rules
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### 7.4 Level 4: Creative & Domain-Specific Validation
|
|
266
|
+
**For research task:**
|
|
267
|
+
```bash
|
|
268
|
+
# Review by project lead or team
|
|
269
|
+
# Verify decision aligns with project goals
|
|
270
|
+
# Check if implementation requirements are clear
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Section 8: Final Validation Checklist
|
|
274
|
+
|
|
275
|
+
#### Technical Validation
|
|
276
|
+
- [ ] Decision document created at specified path
|
|
277
|
+
- [ ] All research files present in research/ subdirectory
|
|
278
|
+
- [ ] Decision includes clear rationale
|
|
279
|
+
- [ ] References to Issue 8, PRD, and external research included
|
|
280
|
+
|
|
281
|
+
#### Feature Validation
|
|
282
|
+
- [ ] Decision addresses Issue 8 concern
|
|
283
|
+
- [ ] Rationale is well-reasoned and complete
|
|
284
|
+
- [ ] If validation: rules are specific and implementable
|
|
285
|
+
- [ ] If no validation: justification is clear
|
|
286
|
+
|
|
287
|
+
#### Code Quality Validation
|
|
288
|
+
- [ ] Decision document is well-structured markdown
|
|
289
|
+
- [ ] Research documents follow clear organization
|
|
290
|
+
- [ ] All references include specific line numbers/sections
|
|
291
|
+
|
|
292
|
+
#### Documentation & Deployment
|
|
293
|
+
- [ ] Decision ready for P1.M3.T3.S2 implementation
|
|
294
|
+
- [ ] Research findings documented for future reference
|
|
295
|
+
- [ ] External best practices catalogued
|
|
296
|
+
|
|
297
|
+
### Section 9: Anti-Patterns to Avoid
|
|
298
|
+
- ❌ Don't make implementation changes in this subtask (that's P1.M3.T3.S2)
|
|
299
|
+
- ❌ Don't skip documenting rationale - team needs to understand why
|
|
300
|
+
- ❌ Don't ignore external research - industry standards matter
|
|
301
|
+
- ❌ Don't forget backward compatibility implications
|
|
302
|
+
- ❌ Don't leave decision ambiguous - must be clear yes/no on validation
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Pre-Writing Validation
|
|
307
|
+
|
|
308
|
+
### Context Completeness Check ✅
|
|
309
|
+
|
|
310
|
+
**"No Prior Knowledge" Test:**
|
|
311
|
+
If someone knew nothing about this codebase, would they have everything needed?
|
|
312
|
+
|
|
313
|
+
- [x] Issue 8 context - YES (TEST_RESULTS.md reference)
|
|
314
|
+
- [x] Current implementation - YES (src/core/workflow.ts lines)
|
|
315
|
+
- [x] Existing test behavior - YES (edge-case.test.ts reference)
|
|
316
|
+
- [x] Codebase validation patterns - YES (validation_patterns.md)
|
|
317
|
+
- [x] External best practices - YES (external_best_practices.md)
|
|
318
|
+
- [x] PRD requirements - YES (PRD.md reference)
|
|
319
|
+
|
|
320
|
+
### Information Density Standards
|
|
321
|
+
- [x] All YAML references include specific file paths and line numbers
|
|
322
|
+
- [x] Research files include specific code snippets
|
|
323
|
+
- [x] External research includes URLs and specific patterns
|
|
324
|
+
- [x] Implementation tasks reference exact locations
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Ready to Write PRP ✅
|
|
329
|
+
|
|
330
|
+
All research complete. All findings documented. Structure planned.
|
|
331
|
+
|
|
332
|
+
Next: Write the PRP.md file following this plan.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Codebase Workflow Name Analysis
|
|
2
|
+
|
|
3
|
+
## Current Implementation State
|
|
4
|
+
|
|
5
|
+
### Workflow Constructor Location
|
|
6
|
+
**File:** `src/core/workflow.ts` (lines 83-108)
|
|
7
|
+
|
|
8
|
+
### Constructor Patterns
|
|
9
|
+
|
|
10
|
+
**Class-based pattern:**
|
|
11
|
+
```typescript
|
|
12
|
+
// Line 94: Default name from class name if not provided
|
|
13
|
+
this.config = { name: name ?? this.constructor.name };
|
|
14
|
+
|
|
15
|
+
// Line 101: Node name fallback to constructor name
|
|
16
|
+
name: this.config.name ?? this.constructor.name,
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Functional pattern:**
|
|
20
|
+
```typescript
|
|
21
|
+
// Line 89: Uses config object
|
|
22
|
+
this.config = name;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Current Name Handling
|
|
26
|
+
|
|
27
|
+
| Input Type | Behavior |
|
|
28
|
+
|------------|----------|
|
|
29
|
+
| `undefined` | Falls back to `this.constructor.name` |
|
|
30
|
+
| `null` | Falls back to `this.constructor.name` |
|
|
31
|
+
| `''` (empty string) | **Accepted** - sets `node.name = ''` |
|
|
32
|
+
| `' '` (whitespace) | **Accepted** - sets `node.name = ' '` |
|
|
33
|
+
| Any string | **Accepted** - no validation |
|
|
34
|
+
|
|
35
|
+
### Key Code Locations
|
|
36
|
+
|
|
37
|
+
**Constructor validation (none exists):**
|
|
38
|
+
```typescript
|
|
39
|
+
// src/core/workflow.ts:83-108
|
|
40
|
+
constructor(name?: string | WorkflowConfig, parentOrExecutor?: Workflow | WorkflowExecutor<T>) {
|
|
41
|
+
if (typeof name === 'object' && name !== null) {
|
|
42
|
+
this.config = name;
|
|
43
|
+
this.executor = parentOrExecutor as WorkflowExecutor<T>;
|
|
44
|
+
this.parent = null;
|
|
45
|
+
} else {
|
|
46
|
+
this.config = { name: name ?? this.constructor.name };
|
|
47
|
+
this.parent = (parentOrExecutor as Workflow) ?? null;
|
|
48
|
+
}
|
|
49
|
+
// NO VALIDATION OF NAME VALUE
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Type definition:**
|
|
54
|
+
```typescript
|
|
55
|
+
// src/types/workflow.ts:24
|
|
56
|
+
export interface WorkflowNode {
|
|
57
|
+
/** Human-readable name */
|
|
58
|
+
name: string; // No constraints specified
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Test Evidence
|
|
63
|
+
|
|
64
|
+
### Empty String Test (Currently Passing)
|
|
65
|
+
**File:** `src/__tests__/adversarial/edge-case.test.ts` (lines 107-117)
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
it('should handle empty string workflow name', async () => {
|
|
69
|
+
const workflow = new TestWorkflow('');
|
|
70
|
+
expect(workflow.node.name).toBe(''); // PASSES - empty name accepted
|
|
71
|
+
await workflow.run();
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Other Name Tests
|
|
76
|
+
**File:** `src/__tests__/unit/workflow.test.ts`
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
// Lines 20-23: Default class name usage
|
|
80
|
+
it('should use class name as default workflow name', () => {
|
|
81
|
+
const wf = new SimpleWorkflow();
|
|
82
|
+
expect(wf.getNode().name).toBe('SimpleWorkflow');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Lines 25-28: Custom name assignment
|
|
86
|
+
it('should use custom name when provided', () => {
|
|
87
|
+
const wf = new SimpleWorkflow('CustomName');
|
|
88
|
+
expect(wf.getNode().name).toBe('CustomName');
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Common Naming Patterns Found
|
|
93
|
+
|
|
94
|
+
| Pattern | Example | Location |
|
|
95
|
+
|---------|---------|----------|
|
|
96
|
+
| PascalCase class name | `DataProcessingWorkflow` | examples/01-basic-workflow.ts:72 |
|
|
97
|
+
| PascalCase string | `'DataProcessor'` | examples/01-basic-workflow.ts:72 |
|
|
98
|
+
| Descriptive names | `'Parent'`, `'Child'`, `'Worker'` | Various test files |
|
|
99
|
+
| Sequential names | `'Workflow-1'`, `'child-1-0'` | Tree debugger |
|
|
100
|
+
|
|
101
|
+
## Validation Decision Point
|
|
102
|
+
|
|
103
|
+
**Current State:** Empty and whitespace-only names are accepted
|
|
104
|
+
**Issue 8:** Suggests validation OR documentation that empty names are valid
|
|
105
|
+
**Decision Needed:** Should we validate or document?
|
|
106
|
+
|
|
107
|
+
### Arguments For Validation
|
|
108
|
+
- Empty names provide no useful information
|
|
109
|
+
- Whitespace-only names are visually confusing
|
|
110
|
+
- Tree debugger display with empty names is unhelpful
|
|
111
|
+
- Industry standard (most workflow engines validate names)
|
|
112
|
+
|
|
113
|
+
### Arguments Against Validation
|
|
114
|
+
- Current tests explicitly verify empty names work
|
|
115
|
+
- May be intentionally permissive for flexibility
|
|
116
|
+
- Backward compatibility concern
|
|
117
|
+
|
|
118
|
+
## Related Code Patterns
|
|
119
|
+
|
|
120
|
+
### Parameter Validation Patterns in Codebase
|
|
121
|
+
|
|
122
|
+
**Example 1: Null check with descriptive error**
|
|
123
|
+
```typescript
|
|
124
|
+
// src/context.ts:requireExecutionContext()
|
|
125
|
+
if (!context) {
|
|
126
|
+
throw new Error(
|
|
127
|
+
`${operation} called outside of workflow context. ` +
|
|
128
|
+
`Agent/Prompt operations must be executed within a workflow step.`
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Example 2: Unique registration validation**
|
|
134
|
+
```typescript
|
|
135
|
+
// src/core/mcp-handler.ts:registerServer()
|
|
136
|
+
if (this.servers.has(server.name)) {
|
|
137
|
+
throw new Error(`MCP server '${server.name}' is already registered`);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Example 3: Circular reference detection**
|
|
142
|
+
```typescript
|
|
143
|
+
// src/core/workflow.ts:attachChild()
|
|
144
|
+
if (visited.has(current)) {
|
|
145
|
+
throw new Error('Circular parent-child relationship detected');
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Implementation Location
|
|
150
|
+
|
|
151
|
+
If validation is to be added, it should be placed at:
|
|
152
|
+
**File:** `src/core/workflow.ts`
|
|
153
|
+
**Location:** After `this.config` is set, before `this.node` is created (around line 100)
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
// Suggested location for validation
|
|
157
|
+
this.config = { name: name ?? this.constructor.name };
|
|
158
|
+
|
|
159
|
+
// ADD VALIDATION HERE
|
|
160
|
+
// Validate workflow name
|
|
161
|
+
if (!this.config.name || typeof this.config.name !== 'string') {
|
|
162
|
+
throw new Error('Workflow name must be a non-empty string');
|
|
163
|
+
}
|
|
164
|
+
if (this.config.name.trim().length === 0) {
|
|
165
|
+
throw new Error('Workflow name cannot be whitespace only');
|
|
166
|
+
}
|
|
167
|
+
```
|