@dragonflymcp/plugin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +26 -0
- package/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/core/annotations.d.ts +71 -0
- package/dist/core/annotations.d.ts.map +1 -0
- package/dist/core/annotations.js +61 -0
- package/dist/core/annotations.js.map +1 -0
- package/dist/core/config.d.ts +66 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +131 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/dispatcher.d.ts +77 -0
- package/dist/core/dispatcher.d.ts.map +1 -0
- package/dist/core/dispatcher.js +132 -0
- package/dist/core/dispatcher.js.map +1 -0
- package/dist/core/server.d.ts +24 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +41 -0
- package/dist/core/server.js.map +1 -0
- package/dist/core/store.d.ts +91 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +157 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/types.d.ts +128 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -0
- package/dist/test-utils/store-harness.d.ts +41 -0
- package/dist/test-utils/store-harness.d.ts.map +1 -0
- package/dist/test-utils/store-harness.js +61 -0
- package/dist/test-utils/store-harness.js.map +1 -0
- package/dist/tools/analytics/aggregators.d.ts +18 -0
- package/dist/tools/analytics/aggregators.d.ts.map +1 -0
- package/dist/tools/analytics/aggregators.js +260 -0
- package/dist/tools/analytics/aggregators.js.map +1 -0
- package/dist/tools/analytics/aggregators.test.d.ts +2 -0
- package/dist/tools/analytics/aggregators.test.d.ts.map +1 -0
- package/dist/tools/analytics/aggregators.test.js +177 -0
- package/dist/tools/analytics/aggregators.test.js.map +1 -0
- package/dist/tools/analytics/drift.d.ts +15 -0
- package/dist/tools/analytics/drift.d.ts.map +1 -0
- package/dist/tools/analytics/drift.js +135 -0
- package/dist/tools/analytics/drift.js.map +1 -0
- package/dist/tools/analytics/drift.test.d.ts +2 -0
- package/dist/tools/analytics/drift.test.d.ts.map +1 -0
- package/dist/tools/analytics/drift.test.js +99 -0
- package/dist/tools/analytics/drift.test.js.map +1 -0
- package/dist/tools/analytics/index.d.ts +10 -0
- package/dist/tools/analytics/index.d.ts.map +1 -0
- package/dist/tools/analytics/index.js +192 -0
- package/dist/tools/analytics/index.js.map +1 -0
- package/dist/tools/analytics/learner.d.ts +29 -0
- package/dist/tools/analytics/learner.d.ts.map +1 -0
- package/dist/tools/analytics/learner.js +135 -0
- package/dist/tools/analytics/learner.js.map +1 -0
- package/dist/tools/analytics/learner.test.d.ts +2 -0
- package/dist/tools/analytics/learner.test.d.ts.map +1 -0
- package/dist/tools/analytics/learner.test.js +118 -0
- package/dist/tools/analytics/learner.test.js.map +1 -0
- package/dist/tools/analytics/observe.d.ts +22 -0
- package/dist/tools/analytics/observe.d.ts.map +1 -0
- package/dist/tools/analytics/observe.js +143 -0
- package/dist/tools/analytics/observe.js.map +1 -0
- package/dist/tools/analytics/observe.test.d.ts +2 -0
- package/dist/tools/analytics/observe.test.d.ts.map +1 -0
- package/dist/tools/analytics/observe.test.js +95 -0
- package/dist/tools/analytics/observe.test.js.map +1 -0
- package/dist/tools/analytics/store.d.ts +29 -0
- package/dist/tools/analytics/store.d.ts.map +1 -0
- package/dist/tools/analytics/store.js +192 -0
- package/dist/tools/analytics/store.js.map +1 -0
- package/dist/tools/analytics/types.d.ts +290 -0
- package/dist/tools/analytics/types.d.ts.map +1 -0
- package/dist/tools/analytics/types.js +7 -0
- package/dist/tools/analytics/types.js.map +1 -0
- package/dist/tools/ast/index.d.ts +8 -0
- package/dist/tools/ast/index.d.ts.map +1 -0
- package/dist/tools/ast/index.js +242 -0
- package/dist/tools/ast/index.js.map +1 -0
- package/dist/tools/ast/indexer.d.ts +41 -0
- package/dist/tools/ast/indexer.d.ts.map +1 -0
- package/dist/tools/ast/indexer.js +617 -0
- package/dist/tools/ast/indexer.js.map +1 -0
- package/dist/tools/ast/store.d.ts +87 -0
- package/dist/tools/ast/store.d.ts.map +1 -0
- package/dist/tools/ast/store.js +280 -0
- package/dist/tools/ast/store.js.map +1 -0
- package/dist/tools/ast/store.test.d.ts +6 -0
- package/dist/tools/ast/store.test.d.ts.map +1 -0
- package/dist/tools/ast/store.test.js +257 -0
- package/dist/tools/ast/store.test.js.map +1 -0
- package/dist/tools/bridge/bridge.d.ts +37 -0
- package/dist/tools/bridge/bridge.d.ts.map +1 -0
- package/dist/tools/bridge/bridge.js +82 -0
- package/dist/tools/bridge/bridge.js.map +1 -0
- package/dist/tools/bridge/bridge.test.d.ts +2 -0
- package/dist/tools/bridge/bridge.test.d.ts.map +1 -0
- package/dist/tools/bridge/bridge.test.js +119 -0
- package/dist/tools/bridge/bridge.test.js.map +1 -0
- package/dist/tools/bridge/index.d.ts +8 -0
- package/dist/tools/bridge/index.d.ts.map +1 -0
- package/dist/tools/bridge/index.js +153 -0
- package/dist/tools/bridge/index.js.map +1 -0
- package/dist/tools/bridge/store.d.ts +45 -0
- package/dist/tools/bridge/store.d.ts.map +1 -0
- package/dist/tools/bridge/store.js +307 -0
- package/dist/tools/bridge/store.js.map +1 -0
- package/dist/tools/bridge/store.test.d.ts +2 -0
- package/dist/tools/bridge/store.test.d.ts.map +1 -0
- package/dist/tools/bridge/store.test.js +180 -0
- package/dist/tools/bridge/store.test.js.map +1 -0
- package/dist/tools/bridge/types.d.ts +44 -0
- package/dist/tools/bridge/types.d.ts.map +1 -0
- package/dist/tools/bridge/types.js +6 -0
- package/dist/tools/bridge/types.js.map +1 -0
- package/dist/tools/evolve/algorithm.d.ts +33 -0
- package/dist/tools/evolve/algorithm.d.ts.map +1 -0
- package/dist/tools/evolve/algorithm.js +64 -0
- package/dist/tools/evolve/algorithm.js.map +1 -0
- package/dist/tools/evolve/algorithm.test.d.ts +6 -0
- package/dist/tools/evolve/algorithm.test.d.ts.map +1 -0
- package/dist/tools/evolve/algorithm.test.js +138 -0
- package/dist/tools/evolve/algorithm.test.js.map +1 -0
- package/dist/tools/evolve/index.d.ts +11 -0
- package/dist/tools/evolve/index.d.ts.map +1 -0
- package/dist/tools/evolve/index.js +300 -0
- package/dist/tools/evolve/index.js.map +1 -0
- package/dist/tools/evolve/store.d.ts +27 -0
- package/dist/tools/evolve/store.d.ts.map +1 -0
- package/dist/tools/evolve/store.js +147 -0
- package/dist/tools/evolve/store.js.map +1 -0
- package/dist/tools/evolve/store.test.d.ts +6 -0
- package/dist/tools/evolve/store.test.d.ts.map +1 -0
- package/dist/tools/evolve/store.test.js +162 -0
- package/dist/tools/evolve/store.test.js.map +1 -0
- package/dist/tools/evolve/types.d.ts +38 -0
- package/dist/tools/evolve/types.d.ts.map +1 -0
- package/dist/tools/evolve/types.js +6 -0
- package/dist/tools/evolve/types.js.map +1 -0
- package/dist/tools/framework/content-loader.d.ts +45 -0
- package/dist/tools/framework/content-loader.d.ts.map +1 -0
- package/dist/tools/framework/content-loader.js +258 -0
- package/dist/tools/framework/content-loader.js.map +1 -0
- package/dist/tools/framework/content-loader.test.d.ts +5 -0
- package/dist/tools/framework/content-loader.test.d.ts.map +1 -0
- package/dist/tools/framework/content-loader.test.js +262 -0
- package/dist/tools/framework/content-loader.test.js.map +1 -0
- package/dist/tools/framework/index.d.ts +30 -0
- package/dist/tools/framework/index.d.ts.map +1 -0
- package/dist/tools/framework/index.js +517 -0
- package/dist/tools/framework/index.js.map +1 -0
- package/dist/tools/framework/session.d.ts +85 -0
- package/dist/tools/framework/session.d.ts.map +1 -0
- package/dist/tools/framework/session.js +311 -0
- package/dist/tools/framework/session.js.map +1 -0
- package/dist/tools/framework/session.test.d.ts +5 -0
- package/dist/tools/framework/session.test.d.ts.map +1 -0
- package/dist/tools/framework/session.test.js +291 -0
- package/dist/tools/framework/session.test.js.map +1 -0
- package/dist/tools/framework/sync-evaluator.d.ts +41 -0
- package/dist/tools/framework/sync-evaluator.d.ts.map +1 -0
- package/dist/tools/framework/sync-evaluator.js +298 -0
- package/dist/tools/framework/sync-evaluator.js.map +1 -0
- package/dist/tools/framework/sync-evaluator.test.d.ts +5 -0
- package/dist/tools/framework/sync-evaluator.test.d.ts.map +1 -0
- package/dist/tools/framework/sync-evaluator.test.js +288 -0
- package/dist/tools/framework/sync-evaluator.test.js.map +1 -0
- package/dist/tools/framework/types.d.ts +279 -0
- package/dist/tools/framework/types.d.ts.map +1 -0
- package/dist/tools/framework/types.js +6 -0
- package/dist/tools/framework/types.js.map +1 -0
- package/dist/tools/framework/workflow-intelligence.d.ts +55 -0
- package/dist/tools/framework/workflow-intelligence.d.ts.map +1 -0
- package/dist/tools/framework/workflow-intelligence.js +199 -0
- package/dist/tools/framework/workflow-intelligence.js.map +1 -0
- package/dist/tools/framework/workflow-intelligence.test.d.ts +6 -0
- package/dist/tools/framework/workflow-intelligence.test.d.ts.map +1 -0
- package/dist/tools/framework/workflow-intelligence.test.js +257 -0
- package/dist/tools/framework/workflow-intelligence.test.js.map +1 -0
- package/dist/tools/framework/workflow-planner.d.ts +10 -0
- package/dist/tools/framework/workflow-planner.d.ts.map +1 -0
- package/dist/tools/framework/workflow-planner.js +214 -0
- package/dist/tools/framework/workflow-planner.js.map +1 -0
- package/dist/tools/framework/workflow-planner.test.d.ts +5 -0
- package/dist/tools/framework/workflow-planner.test.d.ts.map +1 -0
- package/dist/tools/framework/workflow-planner.test.js +137 -0
- package/dist/tools/framework/workflow-planner.test.js.map +1 -0
- package/dist/tools/knowledge/bridge.d.ts +34 -0
- package/dist/tools/knowledge/bridge.d.ts.map +1 -0
- package/dist/tools/knowledge/bridge.js +249 -0
- package/dist/tools/knowledge/bridge.js.map +1 -0
- package/dist/tools/knowledge/bridge.test.d.ts +5 -0
- package/dist/tools/knowledge/bridge.test.d.ts.map +1 -0
- package/dist/tools/knowledge/bridge.test.js +221 -0
- package/dist/tools/knowledge/bridge.test.js.map +1 -0
- package/dist/tools/knowledge/extractor.d.ts +22 -0
- package/dist/tools/knowledge/extractor.d.ts.map +1 -0
- package/dist/tools/knowledge/extractor.js +154 -0
- package/dist/tools/knowledge/extractor.js.map +1 -0
- package/dist/tools/knowledge/index.d.ts +12 -0
- package/dist/tools/knowledge/index.d.ts.map +1 -0
- package/dist/tools/knowledge/index.js +505 -0
- package/dist/tools/knowledge/index.js.map +1 -0
- package/dist/tools/knowledge/retrieval.d.ts +28 -0
- package/dist/tools/knowledge/retrieval.d.ts.map +1 -0
- package/dist/tools/knowledge/retrieval.js +164 -0
- package/dist/tools/knowledge/retrieval.js.map +1 -0
- package/dist/tools/knowledge/store.d.ts +96 -0
- package/dist/tools/knowledge/store.d.ts.map +1 -0
- package/dist/tools/knowledge/store.js +562 -0
- package/dist/tools/knowledge/store.js.map +1 -0
- package/dist/tools/knowledge/store.test.d.ts +6 -0
- package/dist/tools/knowledge/store.test.d.ts.map +1 -0
- package/dist/tools/knowledge/store.test.js +385 -0
- package/dist/tools/knowledge/store.test.js.map +1 -0
- package/dist/tools/knowledge/types.d.ts +168 -0
- package/dist/tools/knowledge/types.d.ts.map +1 -0
- package/dist/tools/knowledge/types.js +6 -0
- package/dist/tools/knowledge/types.js.map +1 -0
- package/dist/tools/memory/evolution.d.ts +31 -0
- package/dist/tools/memory/evolution.d.ts.map +1 -0
- package/dist/tools/memory/evolution.js +130 -0
- package/dist/tools/memory/evolution.js.map +1 -0
- package/dist/tools/memory/index.d.ts +11 -0
- package/dist/tools/memory/index.d.ts.map +1 -0
- package/dist/tools/memory/index.js +239 -0
- package/dist/tools/memory/index.js.map +1 -0
- package/dist/tools/memory/store.d.ts +75 -0
- package/dist/tools/memory/store.d.ts.map +1 -0
- package/dist/tools/memory/store.js +398 -0
- package/dist/tools/memory/store.js.map +1 -0
- package/dist/tools/memory/store.test.d.ts +6 -0
- package/dist/tools/memory/store.test.d.ts.map +1 -0
- package/dist/tools/memory/store.test.js +429 -0
- package/dist/tools/memory/store.test.js.map +1 -0
- package/dist/tools/memory/types.d.ts +171 -0
- package/dist/tools/memory/types.d.ts.map +1 -0
- package/dist/tools/memory/types.js +6 -0
- package/dist/tools/memory/types.js.map +1 -0
- package/dist/tools/pipeline/composer.d.ts +29 -0
- package/dist/tools/pipeline/composer.d.ts.map +1 -0
- package/dist/tools/pipeline/composer.js +225 -0
- package/dist/tools/pipeline/composer.js.map +1 -0
- package/dist/tools/pipeline/composer.test.d.ts +2 -0
- package/dist/tools/pipeline/composer.test.d.ts.map +1 -0
- package/dist/tools/pipeline/composer.test.js +162 -0
- package/dist/tools/pipeline/composer.test.js.map +1 -0
- package/dist/tools/pipeline/index.d.ts +8 -0
- package/dist/tools/pipeline/index.d.ts.map +1 -0
- package/dist/tools/pipeline/index.js +102 -0
- package/dist/tools/pipeline/index.js.map +1 -0
- package/dist/tools/pipeline/planner.d.ts +10 -0
- package/dist/tools/pipeline/planner.d.ts.map +1 -0
- package/dist/tools/pipeline/planner.js +147 -0
- package/dist/tools/pipeline/planner.js.map +1 -0
- package/dist/tools/pipeline/planner.test.d.ts +2 -0
- package/dist/tools/pipeline/planner.test.d.ts.map +1 -0
- package/dist/tools/pipeline/planner.test.js +96 -0
- package/dist/tools/pipeline/planner.test.js.map +1 -0
- package/dist/tools/pipeline/preconditions.d.ts +14 -0
- package/dist/tools/pipeline/preconditions.d.ts.map +1 -0
- package/dist/tools/pipeline/preconditions.js +65 -0
- package/dist/tools/pipeline/preconditions.js.map +1 -0
- package/dist/tools/pipeline/preconditions.test.d.ts +2 -0
- package/dist/tools/pipeline/preconditions.test.d.ts.map +1 -0
- package/dist/tools/pipeline/preconditions.test.js +74 -0
- package/dist/tools/pipeline/preconditions.test.js.map +1 -0
- package/dist/tools/pipeline/types.d.ts +105 -0
- package/dist/tools/pipeline/types.d.ts.map +1 -0
- package/dist/tools/pipeline/types.js +6 -0
- package/dist/tools/pipeline/types.js.map +1 -0
- package/dist/tools/repair/index.d.ts +8 -0
- package/dist/tools/repair/index.d.ts.map +1 -0
- package/dist/tools/repair/index.js +384 -0
- package/dist/tools/repair/index.js.map +1 -0
- package/dist/tools/repair/repairer.d.ts +67 -0
- package/dist/tools/repair/repairer.d.ts.map +1 -0
- package/dist/tools/repair/repairer.js +257 -0
- package/dist/tools/repair/repairer.js.map +1 -0
- package/dist/tools/repair/repairer.test.d.ts +6 -0
- package/dist/tools/repair/repairer.test.d.ts.map +1 -0
- package/dist/tools/repair/repairer.test.js +159 -0
- package/dist/tools/repair/repairer.test.js.map +1 -0
- package/dist/tools/semantic/chunker.d.ts +23 -0
- package/dist/tools/semantic/chunker.d.ts.map +1 -0
- package/dist/tools/semantic/chunker.js +244 -0
- package/dist/tools/semantic/chunker.js.map +1 -0
- package/dist/tools/semantic/embedder.d.ts +16 -0
- package/dist/tools/semantic/embedder.d.ts.map +1 -0
- package/dist/tools/semantic/embedder.js +88 -0
- package/dist/tools/semantic/embedder.js.map +1 -0
- package/dist/tools/semantic/index.d.ts +8 -0
- package/dist/tools/semantic/index.d.ts.map +1 -0
- package/dist/tools/semantic/index.js +144 -0
- package/dist/tools/semantic/index.js.map +1 -0
- package/dist/tools/semantic/store.d.ts +31 -0
- package/dist/tools/semantic/store.d.ts.map +1 -0
- package/dist/tools/semantic/store.js +168 -0
- package/dist/tools/semantic/store.js.map +1 -0
- package/dist/tools/semantic/store.test.d.ts +6 -0
- package/dist/tools/semantic/store.test.d.ts.map +1 -0
- package/dist/tools/semantic/store.test.js +240 -0
- package/dist/tools/semantic/store.test.js.map +1 -0
- package/dist/tools/spec/generator.d.ts +32 -0
- package/dist/tools/spec/generator.d.ts.map +1 -0
- package/dist/tools/spec/generator.js +278 -0
- package/dist/tools/spec/generator.js.map +1 -0
- package/dist/tools/spec/generator.test.d.ts +6 -0
- package/dist/tools/spec/generator.test.d.ts.map +1 -0
- package/dist/tools/spec/generator.test.js +208 -0
- package/dist/tools/spec/generator.test.js.map +1 -0
- package/dist/tools/spec/index.d.ts +11 -0
- package/dist/tools/spec/index.d.ts.map +1 -0
- package/dist/tools/spec/index.js +426 -0
- package/dist/tools/spec/index.js.map +1 -0
- package/dist/tools/spec/store.d.ts +24 -0
- package/dist/tools/spec/store.d.ts.map +1 -0
- package/dist/tools/spec/store.js +104 -0
- package/dist/tools/spec/store.js.map +1 -0
- package/dist/tools/spec/store.test.d.ts +6 -0
- package/dist/tools/spec/store.test.d.ts.map +1 -0
- package/dist/tools/spec/store.test.js +173 -0
- package/dist/tools/spec/store.test.js.map +1 -0
- package/dist/tools/spec/types.d.ts +61 -0
- package/dist/tools/spec/types.d.ts.map +1 -0
- package/dist/tools/spec/types.js +6 -0
- package/dist/tools/spec/types.js.map +1 -0
- package/dist/tools/state/index.d.ts +11 -0
- package/dist/tools/state/index.d.ts.map +1 -0
- package/dist/tools/state/index.js +386 -0
- package/dist/tools/state/index.js.map +1 -0
- package/dist/tools/state/migrate.d.ts +39 -0
- package/dist/tools/state/migrate.d.ts.map +1 -0
- package/dist/tools/state/migrate.js +242 -0
- package/dist/tools/state/migrate.js.map +1 -0
- package/dist/tools/state/migrate.test.d.ts +2 -0
- package/dist/tools/state/migrate.test.d.ts.map +1 -0
- package/dist/tools/state/migrate.test.js +265 -0
- package/dist/tools/state/migrate.test.js.map +1 -0
- package/dist/tools/state/store.d.ts +107 -0
- package/dist/tools/state/store.d.ts.map +1 -0
- package/dist/tools/state/store.js +365 -0
- package/dist/tools/state/store.js.map +1 -0
- package/dist/tools/state/store.test.d.ts +5 -0
- package/dist/tools/state/store.test.d.ts.map +1 -0
- package/dist/tools/state/store.test.js +293 -0
- package/dist/tools/state/store.test.js.map +1 -0
- package/dist/tools/state/types.d.ts +90 -0
- package/dist/tools/state/types.d.ts.map +1 -0
- package/dist/tools/state/types.js +6 -0
- package/dist/tools/state/types.js.map +1 -0
- package/dist/tools/testing/analyzer.d.ts +44 -0
- package/dist/tools/testing/analyzer.d.ts.map +1 -0
- package/dist/tools/testing/analyzer.js +280 -0
- package/dist/tools/testing/analyzer.js.map +1 -0
- package/dist/tools/testing/generator.d.ts +57 -0
- package/dist/tools/testing/generator.d.ts.map +1 -0
- package/dist/tools/testing/generator.js +478 -0
- package/dist/tools/testing/generator.js.map +1 -0
- package/dist/tools/testing/generator.test.d.ts +6 -0
- package/dist/tools/testing/generator.test.d.ts.map +1 -0
- package/dist/tools/testing/generator.test.js +285 -0
- package/dist/tools/testing/generator.test.js.map +1 -0
- package/dist/tools/testing/index.d.ts +8 -0
- package/dist/tools/testing/index.d.ts.map +1 -0
- package/dist/tools/testing/index.js +373 -0
- package/dist/tools/testing/index.js.map +1 -0
- package/dist/utils/embedder.d.ts +7 -0
- package/dist/utils/embedder.d.ts.map +1 -0
- package/dist/utils/embedder.js +13 -0
- package/dist/utils/embedder.js.map +1 -0
- package/dist/utils/execution.d.ts +68 -0
- package/dist/utils/execution.d.ts.map +1 -0
- package/dist/utils/execution.js +467 -0
- package/dist/utils/execution.js.map +1 -0
- package/dist/utils/graph.d.ts +26 -0
- package/dist/utils/graph.d.ts.map +1 -0
- package/dist/utils/graph.js +32 -0
- package/dist/utils/graph.js.map +1 -0
- package/dist/utils/guards.d.ts +32 -0
- package/dist/utils/guards.d.ts.map +1 -0
- package/dist/utils/guards.js +40 -0
- package/dist/utils/guards.js.map +1 -0
- package/dist/utils/ids.d.ts +5 -0
- package/dist/utils/ids.d.ts.map +1 -0
- package/dist/utils/ids.js +7 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/languages.d.ts +34 -0
- package/dist/utils/languages.d.ts.map +1 -0
- package/dist/utils/languages.js +153 -0
- package/dist/utils/languages.js.map +1 -0
- package/dist/utils/lazy.d.ts +17 -0
- package/dist/utils/lazy.d.ts.map +1 -0
- package/dist/utils/lazy.js +35 -0
- package/dist/utils/lazy.js.map +1 -0
- package/dist/utils/project.d.ts +41 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +82 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/responses.d.ts +27 -0
- package/dist/utils/responses.d.ts.map +1 -0
- package/dist/utils/responses.js +72 -0
- package/dist/utils/responses.js.map +1 -0
- package/dist/utils/vectors.d.ts +33 -0
- package/dist/utils/vectors.d.ts.map +1 -0
- package/dist/utils/vectors.js +80 -0
- package/dist/utils/vectors.js.map +1 -0
- package/dist/utils/vectors.test.d.ts +6 -0
- package/dist/utils/vectors.test.d.ts.map +1 -0
- package/dist/utils/vectors.test.js +96 -0
- package/dist/utils/vectors.test.js.map +1 -0
- package/package.json +69 -0
- package/scripts/init.js +142 -0
- package/templates/CLAUDE.md.template +96 -0
- package/templates/agents/architecture-concept.md +237 -0
- package/templates/agents/checkpoint-concept.md +218 -0
- package/templates/agents/code-analysis-concept.md +171 -0
- package/templates/agents/compete-control.md +44 -0
- package/templates/agents/compete-evaluator.md +87 -0
- package/templates/agents/compete-treatment.md +55 -0
- package/templates/agents/context-concept.md +254 -0
- package/templates/agents/debate-advocate.md +127 -0
- package/templates/agents/debate-critic.md +119 -0
- package/templates/agents/debate-synthesis.md +160 -0
- package/templates/agents/documentation-concept.md +294 -0
- package/templates/agents/implementation-concept.md +165 -0
- package/templates/agents/quality-concept.md +299 -0
- package/templates/agents/research-concept.md +169 -0
- package/templates/agents/security-concept.md +255 -0
- package/templates/agents/story-concept.md +207 -0
- package/templates/agents/verification-concept.md +456 -0
- package/templates/agents/version-concept.md +163 -0
- package/templates/anchors/directory.anchor.yaml.template +53 -0
- package/templates/anchors/rules.anchor.yaml.template +70 -0
- package/templates/anchors/safety.anchor.yaml.template +96 -0
- package/templates/claude-md-managed.template +105 -0
- package/templates/commands/cache.md.template +439 -0
- package/templates/commands/checkpoint.md.template +121 -0
- package/templates/commands/classify.md.template +138 -0
- package/templates/commands/compete.md.template +90 -0
- package/templates/commands/costs.md.template +111 -0
- package/templates/commands/estimate.md.template +196 -0
- package/templates/commands/explore.md.template +186 -0
- package/templates/commands/feature.md.template +216 -0
- package/templates/commands/forget.md.template +104 -0
- package/templates/commands/global-recall.md.template +250 -0
- package/templates/commands/global-remember.md.template +187 -0
- package/templates/commands/health.md.template +107 -0
- package/templates/commands/help.md.template +253 -0
- package/templates/commands/observe.md.template +211 -0
- package/templates/commands/pr-review.md.template +164 -0
- package/templates/commands/predict-cost.md.template +251 -0
- package/templates/commands/profile.md.template +142 -0
- package/templates/commands/reasoning.md.template +228 -0
- package/templates/commands/recall.md.template +197 -0
- package/templates/commands/remember.md.template +148 -0
- package/templates/commands/replay.md.template +449 -0
- package/templates/commands/restore.md.template +87 -0
- package/templates/commands/retrospective.md.template +47 -0
- package/templates/commands/slo.md.template +286 -0
- package/templates/commands/spec.md.template +164 -0
- package/templates/commands/status.md.template +53 -0
- package/templates/commands/sync.md.template +321 -0
- package/templates/commands/task.md.template +86 -0
- package/templates/commands/trace.md.template +86 -0
- package/templates/commands/visualize.md.template +216 -0
- package/templates/commands/workflow.md.template +375 -0
- package/templates/concepts/README.md +329 -0
- package/templates/concepts/architecture.md.template +74 -0
- package/templates/concepts/code-analysis.md.template +186 -0
- package/templates/concepts/context-compactor.md.template +393 -0
- package/templates/concepts/context.md.template +62 -0
- package/templates/concepts/documentation.md.template +452 -0
- package/templates/concepts/estimator.md.template +214 -0
- package/templates/concepts/exploration.md.template +257 -0
- package/templates/concepts/global-memory.md.template +222 -0
- package/templates/concepts/implementation.md.template +62 -0
- package/templates/concepts/pr-review.md.template +277 -0
- package/templates/concepts/project-profile.md.template +358 -0
- package/templates/concepts/quality.md.template +63 -0
- package/templates/concepts/react-fallback.md.template +286 -0
- package/templates/concepts/research.md.template +221 -0
- package/templates/concepts/retrospective.md.template +93 -0
- package/templates/concepts/security.md.template +442 -0
- package/templates/concepts/slo.md.template +274 -0
- package/templates/concepts/spec.md.template +71 -0
- package/templates/concepts/story.md.template +50 -0
- package/templates/concepts/tool-router.md.template +289 -0
- package/templates/concepts/verification-synthesizer.md.template +279 -0
- package/templates/concepts/version.md.template +61 -0
- package/templates/config.yaml.template +347 -0
- package/templates/examples/README.md +77 -0
- package/templates/examples/architecture/api-design.yaml.template +286 -0
- package/templates/examples/architecture/oauth-authentication.yaml.template +305 -0
- package/templates/health/status.yaml.template +120 -0
- package/templates/hooks/concept-complete.sh.template +45 -0
- package/templates/hooks/lib/common.sh.template +160 -0
- package/templates/hooks/post-commit.sh.template +37 -0
- package/templates/hooks/post-concept-action.template +39 -0
- package/templates/hooks/post-tool-structure-check.sh.template +138 -0
- package/templates/hooks/post-tool-use.sh.template +51 -0
- package/templates/hooks/pre-compact.sh.template +48 -0
- package/templates/hooks/pre-tool-grounding.template +148 -0
- package/templates/hooks/session-exit-checkpoint.sh.template +35 -0
- package/templates/hooks/session-start.sh.template +67 -0
- package/templates/hooks/statusline.sh.template +148 -0
- package/templates/hooks/stop.sh.template +45 -0
- package/templates/hooks/subagent-stop.sh.template +40 -0
- package/templates/hooks/sync-blocked.sh.template +45 -0
- package/templates/hooks/timeout.sh.template +48 -0
- package/templates/hooks/user-prompt-submit.sh.template +68 -0
- package/templates/koan/README.md +58 -0
- package/templates/memory/index.yaml.template +48 -0
- package/templates/memory/procedural/debugging.yaml.template +24 -0
- package/templates/memory/procedural/workflows.yaml.template +22 -0
- package/templates/memory/semantic/architecture.yaml.template +21 -0
- package/templates/memory/semantic/conventions.yaml.template +18 -0
- package/templates/memory/semantic/patterns.yaml.template +21 -0
- package/templates/memory/semantic/preferences.yaml.template +18 -0
- package/templates/prompts/architecture.yaml.template +349 -0
- package/templates/prompts/context.yaml.template +384 -0
- package/templates/prompts/implementation.yaml.template +365 -0
- package/templates/prompts/planning.yaml.template +303 -0
- package/templates/prompts/quality.yaml.template +345 -0
- package/templates/prompts/retrospective.yaml.template +231 -0
- package/templates/prompts/slo.yaml.template +360 -0
- package/templates/prompts/story.yaml.template +236 -0
- package/templates/prompts/tree-of-thoughts.yaml.template +299 -0
- package/templates/prompts/verification.yaml.template +286 -0
- package/templates/prompts/version.yaml.template +279 -0
- package/templates/schemas/agent-schema.json +98 -0
- package/templates/schemas/architecture.schema.json +69 -0
- package/templates/schemas/config-schema.json +165 -0
- package/templates/schemas/implementation.schema.json +75 -0
- package/templates/schemas/planning.schema.json +243 -0
- package/templates/schemas/provenance.schema.json +111 -0
- package/templates/schemas/retrospective.schema.json +174 -0
- package/templates/schemas/review.schema.json +284 -0
- package/templates/schemas/slo.schema.json +443 -0
- package/templates/schemas/story.schema.json +68 -0
- package/templates/schemas/sync-schema.json +196 -0
- package/templates/schemas/task.schema.json +127 -0
- package/templates/schemas/tree-of-thoughts.schema.json +175 -0
- package/templates/schemas/verification.schema.json +106 -0
- package/templates/settings.full.json.template +135 -0
- package/templates/settings.minimal.json.template +68 -0
- package/templates/settings.standard.json.template +135 -0
- package/templates/skills/acceptance-criteria-generation.md.template +330 -0
- package/templates/skills/accessibility-checking.md.template +341 -0
- package/templates/skills/api-design-patterns.md.template +395 -0
- package/templates/skills/batch-processing.md.template +605 -0
- package/templates/skills/branch-strategy.md.template +362 -0
- package/templates/skills/changelog-generation.md.template +403 -0
- package/templates/skills/code-coverage-analysis.md.template +362 -0
- package/templates/skills/code-style-enforcement.md.template +294 -0
- package/templates/skills/code-template-patterns.md.template +419 -0
- package/templates/skills/concept-development.md.template +159 -0
- package/templates/skills/context-prioritization.md.template +306 -0
- package/templates/skills/cost-optimization.md.template +482 -0
- package/templates/skills/cross-project-knowledge.md.template +316 -0
- package/templates/skills/dependency-impact-analysis.md.template +263 -0
- package/templates/skills/documentation-generation.md.template +409 -0
- package/templates/skills/effort-estimation.md.template +350 -0
- package/templates/skills/error-classification.md.template +709 -0
- package/templates/skills/error-messages.md.template +339 -0
- package/templates/skills/ide-diagnostics.md.template +480 -0
- package/templates/skills/incremental-loading.md.template +574 -0
- package/templates/skills/output-caching.md.template +524 -0
- package/templates/skills/performance-estimation.md.template +325 -0
- package/templates/skills/performance-testing-patterns.md.template +341 -0
- package/templates/skills/phase2-optimizations-summary.md.template +458 -0
- package/templates/skills/progressive-disclosure-pattern.md.template +190 -0
- package/templates/skills/project-structure.md.template +372 -0
- package/templates/skills/provenance-analysis.md.template +609 -0
- package/templates/skills/react-executor.md.template +366 -0
- package/templates/skills/refactoring-patterns.md.template +422 -0
- package/templates/skills/release-management.md.template +373 -0
- package/templates/skills/requirement-prioritization.md.template +357 -0
- package/templates/skills/schema-validation.md.template +321 -0
- package/templates/skills/security-design-patterns.md.template +692 -0
- package/templates/skills/security-vulnerability-scanning.md.template +663 -0
- package/templates/skills/semantic-memory.md.template +266 -0
- package/templates/skills/semantic-versioning.md.template +371 -0
- package/templates/skills/smart-retry.md.template +676 -0
- package/templates/skills/smart-summarization.md.template +358 -0
- package/templates/skills/story-decomposition.md.template +278 -0
- package/templates/skills/synchronization-patterns.md.template +303 -0
- package/templates/skills/test-generation-strategy.md.template +247 -0
- package/templates/skills/workflow-replay.md.template +478 -0
- package/templates/skills/wysiwid-principles.md.template +364 -0
- package/templates/skills-manifest.yaml.template +526 -0
- package/templates/stubs/agents/architecture-concept.md +20 -0
- package/templates/stubs/agents/checkpoint-concept.md +19 -0
- package/templates/stubs/agents/code-analysis-concept.md +36 -0
- package/templates/stubs/agents/context-concept.md +37 -0
- package/templates/stubs/agents/debate-advocate.md +12 -0
- package/templates/stubs/agents/debate-critic.md +12 -0
- package/templates/stubs/agents/debate-synthesis.md +12 -0
- package/templates/stubs/agents/documentation-concept.md +39 -0
- package/templates/stubs/agents/implementation-concept.md +41 -0
- package/templates/stubs/agents/quality-concept.md +41 -0
- package/templates/stubs/agents/research-concept.md +35 -0
- package/templates/stubs/agents/security-concept.md +40 -0
- package/templates/stubs/agents/spec-concept.md +35 -0
- package/templates/stubs/agents/story-concept.md +36 -0
- package/templates/stubs/agents/verification-concept.md +39 -0
- package/templates/stubs/agents/version-concept.md +37 -0
- package/templates/stubs/commands/cache.md.template +2 -0
- package/templates/stubs/commands/checkpoint.md.template +2 -0
- package/templates/stubs/commands/classify.md.template +2 -0
- package/templates/stubs/commands/compete.md.template +2 -0
- package/templates/stubs/commands/costs.md.template +2 -0
- package/templates/stubs/commands/estimate.md.template +2 -0
- package/templates/stubs/commands/explore.md.template +2 -0
- package/templates/stubs/commands/feature.md.template +2 -0
- package/templates/stubs/commands/forget.md.template +2 -0
- package/templates/stubs/commands/global-recall.md.template +2 -0
- package/templates/stubs/commands/global-remember.md.template +2 -0
- package/templates/stubs/commands/health.md.template +2 -0
- package/templates/stubs/commands/help.md.template +2 -0
- package/templates/stubs/commands/observe.md.template +2 -0
- package/templates/stubs/commands/pr-review.md.template +2 -0
- package/templates/stubs/commands/predict-cost.md.template +2 -0
- package/templates/stubs/commands/profile.md.template +2 -0
- package/templates/stubs/commands/reasoning.md.template +2 -0
- package/templates/stubs/commands/recall.md.template +2 -0
- package/templates/stubs/commands/remember.md.template +2 -0
- package/templates/stubs/commands/replay.md.template +2 -0
- package/templates/stubs/commands/restore.md.template +2 -0
- package/templates/stubs/commands/retrospective.md.template +2 -0
- package/templates/stubs/commands/slo.md.template +2 -0
- package/templates/stubs/commands/spec.md.template +2 -0
- package/templates/stubs/commands/sync.md.template +2 -0
- package/templates/stubs/commands/task.md.template +2 -0
- package/templates/stubs/commands/trace.md.template +2 -0
- package/templates/stubs/commands/visualize.md.template +2 -0
- package/templates/stubs/commands/workflow.md.template +2 -0
- package/templates/synchronizations/archive/adaptive-learning.yaml.template +595 -0
- package/templates/synchronizations/archive/code-understanding-flow.yaml.template +533 -0
- package/templates/synchronizations/archive/collaboration-flow.yaml.template +521 -0
- package/templates/synchronizations/archive/context-folding.yaml.template +353 -0
- package/templates/synchronizations/archive/dead-letter-queue.yaml.template +530 -0
- package/templates/synchronizations/archive/documentation-flow.yaml.template +560 -0
- package/templates/synchronizations/archive/error-recovery-flow.yaml.template +1031 -0
- package/templates/synchronizations/archive/execution-loop.yaml.template +336 -0
- package/templates/synchronizations/archive/exploration-flow.yaml.template +369 -0
- package/templates/synchronizations/archive/feature-development.yaml.template +2145 -0
- package/templates/synchronizations/archive/learning-loop.yaml.template +657 -0
- package/templates/synchronizations/archive/multi-verify.yaml.template +346 -0
- package/templates/synchronizations/archive/planning-flow.yaml.template +312 -0
- package/templates/synchronizations/archive/retrospective-flow.yaml.template +277 -0
- package/templates/synchronizations/archive/security-flow.yaml.template +477 -0
- package/templates/synchronizations/archive/slo-monitoring.yaml.template +209 -0
- package/templates/synchronizations/archive/task-routing.yaml.template +489 -0
- package/templates/synchronizations/archive/test-driven.yaml.template +291 -0
- package/templates/synchronizations/archive/tool-routing.yaml.template +326 -0
- package/templates/synchronizations/archive/verification-flow.yaml.template +407 -0
- package/templates/synchronizations/error-policy.yaml.template +188 -0
- package/templates/synchronizations/main.sync.template +319 -0
- package/templates/synchronizations/slo-registry.yaml.template +229 -0
- package/templates/tasks/task.yaml.template +67 -0
- package/templates/zen-profile.yaml.template +14 -0
|
@@ -0,0 +1,1031 @@
|
|
|
1
|
+
# Error Recovery Flow Synchronizations
|
|
2
|
+
# Comprehensive error handling for all workflow phases
|
|
3
|
+
#
|
|
4
|
+
# WYSIWID Principle: This YAML IS the error recovery logic
|
|
5
|
+
# Read this file to understand exactly how errors are handled
|
|
6
|
+
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
description: |
|
|
9
|
+
Centralized error recovery for all concepts and synchronizations.
|
|
10
|
+
Implements retry, escalate, and graceful degradation patterns.
|
|
11
|
+
|
|
12
|
+
# Global SLO defaults for error recovery operations
|
|
13
|
+
slo_defaults:
|
|
14
|
+
expected_duration_ms: 2000
|
|
15
|
+
max_duration_ms: 10000
|
|
16
|
+
expected_cost_usd: 0.001
|
|
17
|
+
max_cost_usd: 0.005
|
|
18
|
+
expected_context_tokens: 500
|
|
19
|
+
success_rate_target: 0.95
|
|
20
|
+
on_timeout:
|
|
21
|
+
action: "skip"
|
|
22
|
+
fallback: "Continue with default error handling"
|
|
23
|
+
on_cost_exceeded:
|
|
24
|
+
action: "proceed"
|
|
25
|
+
message: "Error recovery cost acceptable"
|
|
26
|
+
|
|
27
|
+
# Error Classification
|
|
28
|
+
# Used to determine appropriate recovery action
|
|
29
|
+
error_classifications:
|
|
30
|
+
transient:
|
|
31
|
+
description: "Temporary failures that may succeed on retry"
|
|
32
|
+
examples:
|
|
33
|
+
- "network_timeout"
|
|
34
|
+
- "rate_limit"
|
|
35
|
+
- "service_unavailable"
|
|
36
|
+
default_action: "retry"
|
|
37
|
+
max_retries: 3
|
|
38
|
+
|
|
39
|
+
permanent:
|
|
40
|
+
description: "Failures that require intervention"
|
|
41
|
+
examples:
|
|
42
|
+
- "validation_failed"
|
|
43
|
+
- "security_violation"
|
|
44
|
+
- "missing_required_input"
|
|
45
|
+
default_action: "escalate"
|
|
46
|
+
max_retries: 0
|
|
47
|
+
|
|
48
|
+
degraded:
|
|
49
|
+
description: "Partial failures where fallback is possible"
|
|
50
|
+
examples:
|
|
51
|
+
- "optional_service_unavailable"
|
|
52
|
+
- "enhancement_failed"
|
|
53
|
+
- "mcp_server_unavailable"
|
|
54
|
+
default_action: "fallback"
|
|
55
|
+
max_retries: 1
|
|
56
|
+
|
|
57
|
+
synchronizations:
|
|
58
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
59
|
+
# Story Concept Errors
|
|
60
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
61
|
+
|
|
62
|
+
- id: "story-create-failed"
|
|
63
|
+
description: "Handle story creation failures"
|
|
64
|
+
when:
|
|
65
|
+
concept: "story"
|
|
66
|
+
action: "create"
|
|
67
|
+
status: "failed"
|
|
68
|
+
then:
|
|
69
|
+
- action: "classify_error"
|
|
70
|
+
inputs:
|
|
71
|
+
error: "${error}"
|
|
72
|
+
concept: "story"
|
|
73
|
+
action: "create"
|
|
74
|
+
|
|
75
|
+
- action: "ask_user"
|
|
76
|
+
condition: "${error.classification == 'permanent'}"
|
|
77
|
+
questions:
|
|
78
|
+
- question: "Story creation failed: ${error.message}. How to proceed?"
|
|
79
|
+
header: "Story Error"
|
|
80
|
+
multiSelect: false
|
|
81
|
+
options:
|
|
82
|
+
- label: "Provide more details"
|
|
83
|
+
description: "Add clarification to help create the story"
|
|
84
|
+
- label: "Skip story capture"
|
|
85
|
+
description: "Proceed directly to architecture (not recommended)"
|
|
86
|
+
- label: "Cancel"
|
|
87
|
+
description: "Stop the workflow"
|
|
88
|
+
|
|
89
|
+
on_answer:
|
|
90
|
+
"Provide more details":
|
|
91
|
+
- action: "set_flag"
|
|
92
|
+
flag: "story.needs_clarification"
|
|
93
|
+
value: true
|
|
94
|
+
- action: "notify"
|
|
95
|
+
message: "Please provide additional context for: ${story.description}"
|
|
96
|
+
|
|
97
|
+
"Skip story capture":
|
|
98
|
+
- concept: "architecture"
|
|
99
|
+
action: "design"
|
|
100
|
+
model: "opus"
|
|
101
|
+
inputs:
|
|
102
|
+
requirements: "${user.original_request}"
|
|
103
|
+
skip_story: true
|
|
104
|
+
|
|
105
|
+
"Cancel":
|
|
106
|
+
- action: "cancel_workflow"
|
|
107
|
+
reason: "Story creation failed - user cancelled"
|
|
108
|
+
|
|
109
|
+
slo_expectations:
|
|
110
|
+
expected_duration_ms: 3000
|
|
111
|
+
max_duration_ms: 15000
|
|
112
|
+
expected_cost_usd: 0.002
|
|
113
|
+
max_cost_usd: 0.008
|
|
114
|
+
expected_context_tokens: 1000
|
|
115
|
+
on_timeout:
|
|
116
|
+
action: "escalate"
|
|
117
|
+
message: "Story error recovery timed out"
|
|
118
|
+
on_cost_exceeded:
|
|
119
|
+
action: "proceed"
|
|
120
|
+
|
|
121
|
+
provenance:
|
|
122
|
+
flow_id: "${flow.id}"
|
|
123
|
+
reason: "Story creation error recovery"
|
|
124
|
+
error_recovery: true
|
|
125
|
+
category: "recovery"
|
|
126
|
+
|
|
127
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
128
|
+
# Code Analysis Errors
|
|
129
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
130
|
+
|
|
131
|
+
- id: "code-analysis-failed"
|
|
132
|
+
description: "Handle code analysis failures (MCP unavailable)"
|
|
133
|
+
when:
|
|
134
|
+
concept: "code-analysis"
|
|
135
|
+
action: "context"
|
|
136
|
+
status: "failed"
|
|
137
|
+
then:
|
|
138
|
+
# Mark as skipped so fallback sync triggers
|
|
139
|
+
- action: "set_flag"
|
|
140
|
+
flag: "code_analysis.skipped"
|
|
141
|
+
value: true
|
|
142
|
+
|
|
143
|
+
- action: "log"
|
|
144
|
+
level: "warn"
|
|
145
|
+
message: "Code analysis skipped: ${error.message}. Proceeding without codebase context."
|
|
146
|
+
|
|
147
|
+
# Trigger fallback architecture design
|
|
148
|
+
- concept: "architecture"
|
|
149
|
+
action: "design"
|
|
150
|
+
model: "opus"
|
|
151
|
+
inputs:
|
|
152
|
+
story_id: "${story.id}"
|
|
153
|
+
requirements: "${story.description}"
|
|
154
|
+
note: "Proceeding without code analysis context"
|
|
155
|
+
|
|
156
|
+
slo_expectations:
|
|
157
|
+
expected_duration_ms: 2000
|
|
158
|
+
max_duration_ms: 10000
|
|
159
|
+
expected_cost_usd: 0.001
|
|
160
|
+
max_cost_usd: 0.005
|
|
161
|
+
expected_context_tokens: 500
|
|
162
|
+
on_timeout:
|
|
163
|
+
action: "skip"
|
|
164
|
+
fallback: "Proceed without code analysis"
|
|
165
|
+
on_cost_exceeded:
|
|
166
|
+
action: "proceed"
|
|
167
|
+
|
|
168
|
+
provenance:
|
|
169
|
+
flow_id: "${flow.id}"
|
|
170
|
+
reason: "Code analysis failed - graceful degradation to architecture"
|
|
171
|
+
error_recovery: true
|
|
172
|
+
fallback: true
|
|
173
|
+
category: "recovery"
|
|
174
|
+
|
|
175
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
176
|
+
# Architecture Errors
|
|
177
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
178
|
+
|
|
179
|
+
- id: "arch-design-failed"
|
|
180
|
+
description: "Handle architecture design failures"
|
|
181
|
+
when:
|
|
182
|
+
concept: "architecture"
|
|
183
|
+
action: "design"
|
|
184
|
+
status: "failed"
|
|
185
|
+
then:
|
|
186
|
+
- action: "classify_error"
|
|
187
|
+
inputs:
|
|
188
|
+
error: "${error}"
|
|
189
|
+
concept: "architecture"
|
|
190
|
+
action: "design"
|
|
191
|
+
|
|
192
|
+
# Retry for transient errors
|
|
193
|
+
- action: "retry"
|
|
194
|
+
condition: "${error.classification == 'transient' AND retry_count < 2}"
|
|
195
|
+
concept: "architecture"
|
|
196
|
+
action: "design"
|
|
197
|
+
backoff_ms: 2000
|
|
198
|
+
inputs:
|
|
199
|
+
story_id: "${story.id}"
|
|
200
|
+
requirements: "${story.description}"
|
|
201
|
+
|
|
202
|
+
# Escalate for permanent errors
|
|
203
|
+
- action: "ask_user"
|
|
204
|
+
condition: "${error.classification == 'permanent' OR retry_count >= 2}"
|
|
205
|
+
questions:
|
|
206
|
+
- question: "Architecture design failed after retries: ${error.message}. How to proceed?"
|
|
207
|
+
header: "Architecture Error"
|
|
208
|
+
multiSelect: false
|
|
209
|
+
options:
|
|
210
|
+
- label: "Simplify requirements"
|
|
211
|
+
description: "Reduce scope and try a simpler design"
|
|
212
|
+
- label: "Manual architecture"
|
|
213
|
+
description: "I'll provide the architecture myself"
|
|
214
|
+
- label: "Cancel feature"
|
|
215
|
+
description: "Stop the workflow"
|
|
216
|
+
|
|
217
|
+
on_answer:
|
|
218
|
+
"Simplify requirements":
|
|
219
|
+
- concept: "story"
|
|
220
|
+
action: "simplify"
|
|
221
|
+
model: "sonnet"
|
|
222
|
+
inputs:
|
|
223
|
+
story_id: "${story.id}"
|
|
224
|
+
constraint: "Reduce complexity for simpler architecture"
|
|
225
|
+
|
|
226
|
+
"Manual architecture":
|
|
227
|
+
- action: "notify"
|
|
228
|
+
message: "Please create architecture file at koan/architecture/arch-${story.id}.yaml"
|
|
229
|
+
- action: "wait_for_file"
|
|
230
|
+
path: "koan/architecture/arch-${story.id}.yaml"
|
|
231
|
+
timeout_ms: 300000 # 5 minutes
|
|
232
|
+
|
|
233
|
+
"Cancel feature":
|
|
234
|
+
- action: "cancel_workflow"
|
|
235
|
+
reason: "Architecture design failed - user cancelled"
|
|
236
|
+
|
|
237
|
+
slo_expectations:
|
|
238
|
+
expected_duration_ms: 5000
|
|
239
|
+
max_duration_ms: 30000
|
|
240
|
+
expected_cost_usd: 0.003
|
|
241
|
+
max_cost_usd: 0.015
|
|
242
|
+
expected_context_tokens: 2000
|
|
243
|
+
on_timeout:
|
|
244
|
+
action: "escalate"
|
|
245
|
+
message: "Architecture recovery timed out - user input needed"
|
|
246
|
+
on_cost_exceeded:
|
|
247
|
+
action: "alert"
|
|
248
|
+
continue: true
|
|
249
|
+
|
|
250
|
+
provenance:
|
|
251
|
+
flow_id: "${flow.id}"
|
|
252
|
+
reason: "Architecture design error recovery"
|
|
253
|
+
error_recovery: true
|
|
254
|
+
category: "recovery"
|
|
255
|
+
|
|
256
|
+
- id: "arch-revise-failed"
|
|
257
|
+
description: "Handle architecture revision failures"
|
|
258
|
+
when:
|
|
259
|
+
concept: "architecture"
|
|
260
|
+
action: "revise"
|
|
261
|
+
status: "failed"
|
|
262
|
+
then:
|
|
263
|
+
- action: "ask_user"
|
|
264
|
+
questions:
|
|
265
|
+
- question: "Architecture revision failed: ${error.message}. Original issues: ${verification.issues}"
|
|
266
|
+
header: "Revision Error"
|
|
267
|
+
multiSelect: false
|
|
268
|
+
options:
|
|
269
|
+
- label: "Accept original architecture"
|
|
270
|
+
description: "Proceed with the original design despite issues"
|
|
271
|
+
- label: "Retry revision"
|
|
272
|
+
description: "Try revising again with different approach"
|
|
273
|
+
- label: "Cancel"
|
|
274
|
+
description: "Stop and review manually"
|
|
275
|
+
|
|
276
|
+
on_answer:
|
|
277
|
+
"Accept original architecture":
|
|
278
|
+
- action: "set_flag"
|
|
279
|
+
flag: "architecture.accepted_with_issues"
|
|
280
|
+
value: true
|
|
281
|
+
- concept: "implementation"
|
|
282
|
+
action: "generate"
|
|
283
|
+
model: "sonnet"
|
|
284
|
+
inputs:
|
|
285
|
+
architecture_id: "${original_architecture.id}"
|
|
286
|
+
story_id: "${story.id}"
|
|
287
|
+
note: "Proceeding with original architecture despite verification issues"
|
|
288
|
+
|
|
289
|
+
"Retry revision":
|
|
290
|
+
- concept: "architecture"
|
|
291
|
+
action: "revise"
|
|
292
|
+
model: "opus"
|
|
293
|
+
inputs:
|
|
294
|
+
original_architecture_id: "${original_architecture.id}"
|
|
295
|
+
story_id: "${story.id}"
|
|
296
|
+
constraint: "Alternative approach required"
|
|
297
|
+
|
|
298
|
+
"Cancel":
|
|
299
|
+
- action: "cancel_workflow"
|
|
300
|
+
reason: "Architecture revision failed - user cancelled"
|
|
301
|
+
|
|
302
|
+
slo_expectations:
|
|
303
|
+
expected_duration_ms: 5000
|
|
304
|
+
max_duration_ms: 30000
|
|
305
|
+
expected_cost_usd: 0.003
|
|
306
|
+
max_cost_usd: 0.015
|
|
307
|
+
expected_context_tokens: 2000
|
|
308
|
+
on_timeout:
|
|
309
|
+
action: "escalate"
|
|
310
|
+
message: "Architecture revision recovery timed out"
|
|
311
|
+
on_cost_exceeded:
|
|
312
|
+
action: "alert"
|
|
313
|
+
continue: true
|
|
314
|
+
|
|
315
|
+
provenance:
|
|
316
|
+
flow_id: "${flow.id}"
|
|
317
|
+
reason: "Architecture revision error recovery"
|
|
318
|
+
error_recovery: true
|
|
319
|
+
category: "recovery"
|
|
320
|
+
|
|
321
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
322
|
+
# Verification Errors
|
|
323
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
324
|
+
|
|
325
|
+
- id: "verification-failed"
|
|
326
|
+
description: "Handle verification failures"
|
|
327
|
+
when:
|
|
328
|
+
concept: "verification"
|
|
329
|
+
action: "verify_architecture|verify_implementation"
|
|
330
|
+
status: "failed"
|
|
331
|
+
then:
|
|
332
|
+
- action: "classify_error"
|
|
333
|
+
inputs:
|
|
334
|
+
error: "${error}"
|
|
335
|
+
|
|
336
|
+
# Skip verification if transient (degraded mode)
|
|
337
|
+
- action: "skip_verification"
|
|
338
|
+
condition: "${error.classification == 'transient' AND config.allow_skip_verification}"
|
|
339
|
+
message: "Verification skipped due to ${error.message}"
|
|
340
|
+
continue_workflow: true
|
|
341
|
+
|
|
342
|
+
# Escalate if verification is required
|
|
343
|
+
- action: "ask_user"
|
|
344
|
+
condition: "${error.classification != 'transient' OR NOT config.allow_skip_verification}"
|
|
345
|
+
questions:
|
|
346
|
+
- question: "Verification failed: ${error.message}. This is a quality gate."
|
|
347
|
+
header: "Verification Error"
|
|
348
|
+
multiSelect: false
|
|
349
|
+
options:
|
|
350
|
+
- label: "Retry verification"
|
|
351
|
+
description: "Try running verification again"
|
|
352
|
+
- label: "Skip verification (not recommended)"
|
|
353
|
+
description: "Proceed without verification - may miss issues"
|
|
354
|
+
- label: "Cancel"
|
|
355
|
+
description: "Stop and investigate"
|
|
356
|
+
|
|
357
|
+
on_answer:
|
|
358
|
+
"Retry verification":
|
|
359
|
+
- concept: "verification"
|
|
360
|
+
action: "${verification.action}"
|
|
361
|
+
model: "sonnet"
|
|
362
|
+
inputs:
|
|
363
|
+
target: "${verification.target}"
|
|
364
|
+
retry: true
|
|
365
|
+
|
|
366
|
+
"Skip verification (not recommended)":
|
|
367
|
+
- action: "set_flag"
|
|
368
|
+
flag: "verification.skipped"
|
|
369
|
+
value: true
|
|
370
|
+
- action: "log"
|
|
371
|
+
level: "warn"
|
|
372
|
+
message: "Verification skipped by user - proceeding without quality gate"
|
|
373
|
+
|
|
374
|
+
"Cancel":
|
|
375
|
+
- action: "cancel_workflow"
|
|
376
|
+
reason: "Verification failed - user cancelled"
|
|
377
|
+
|
|
378
|
+
slo_expectations:
|
|
379
|
+
expected_duration_ms: 3000
|
|
380
|
+
max_duration_ms: 15000
|
|
381
|
+
expected_cost_usd: 0.002
|
|
382
|
+
max_cost_usd: 0.008
|
|
383
|
+
expected_context_tokens: 1000
|
|
384
|
+
on_timeout:
|
|
385
|
+
action: "escalate"
|
|
386
|
+
message: "Verification error recovery timed out"
|
|
387
|
+
on_cost_exceeded:
|
|
388
|
+
action: "proceed"
|
|
389
|
+
|
|
390
|
+
provenance:
|
|
391
|
+
flow_id: "${flow.id}"
|
|
392
|
+
reason: "Verification error recovery"
|
|
393
|
+
error_recovery: true
|
|
394
|
+
category: "recovery"
|
|
395
|
+
|
|
396
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
397
|
+
# Implementation Errors
|
|
398
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
399
|
+
|
|
400
|
+
- id: "impl-generate-failed"
|
|
401
|
+
description: "Handle implementation generation failures"
|
|
402
|
+
when:
|
|
403
|
+
concept: "implementation"
|
|
404
|
+
action: "generate"
|
|
405
|
+
status: "failed"
|
|
406
|
+
then:
|
|
407
|
+
- action: "classify_error"
|
|
408
|
+
inputs:
|
|
409
|
+
error: "${error}"
|
|
410
|
+
|
|
411
|
+
# Retry with simpler approach
|
|
412
|
+
- action: "retry"
|
|
413
|
+
condition: "${error.classification == 'transient' AND retry_count < 2}"
|
|
414
|
+
concept: "implementation"
|
|
415
|
+
action: "generate"
|
|
416
|
+
backoff_ms: 1000
|
|
417
|
+
inputs:
|
|
418
|
+
architecture_id: "${architecture.id}"
|
|
419
|
+
story_id: "${story.id}"
|
|
420
|
+
|
|
421
|
+
# Escalate after retries
|
|
422
|
+
- action: "ask_user"
|
|
423
|
+
condition: "${retry_count >= 2 OR error.classification == 'permanent'}"
|
|
424
|
+
questions:
|
|
425
|
+
- question: "Implementation failed: ${error.message}. Architecture may be too complex."
|
|
426
|
+
header: "Implementation Error"
|
|
427
|
+
multiSelect: false
|
|
428
|
+
options:
|
|
429
|
+
- label: "Break into smaller pieces"
|
|
430
|
+
description: "Split architecture into implementable chunks"
|
|
431
|
+
- label: "Revise architecture"
|
|
432
|
+
description: "Simplify the technical design"
|
|
433
|
+
- label: "Implement manually"
|
|
434
|
+
description: "I'll write the code myself"
|
|
435
|
+
- label: "Cancel"
|
|
436
|
+
description: "Stop the workflow"
|
|
437
|
+
|
|
438
|
+
on_answer:
|
|
439
|
+
"Break into smaller pieces":
|
|
440
|
+
- concept: "architecture"
|
|
441
|
+
action: "decompose"
|
|
442
|
+
model: "opus"
|
|
443
|
+
inputs:
|
|
444
|
+
architecture_id: "${architecture.id}"
|
|
445
|
+
reason: "Implementation failed - need smaller units"
|
|
446
|
+
|
|
447
|
+
"Revise architecture":
|
|
448
|
+
- concept: "architecture"
|
|
449
|
+
action: "revise"
|
|
450
|
+
model: "opus"
|
|
451
|
+
inputs:
|
|
452
|
+
original_architecture_id: "${architecture.id}"
|
|
453
|
+
constraint: "Simplify for easier implementation"
|
|
454
|
+
|
|
455
|
+
"Implement manually":
|
|
456
|
+
- action: "notify"
|
|
457
|
+
message: "Please implement and place files according to architecture spec"
|
|
458
|
+
- action: "wait_for_files"
|
|
459
|
+
paths: "${architecture.expected_files}"
|
|
460
|
+
timeout_ms: 600000 # 10 minutes
|
|
461
|
+
|
|
462
|
+
"Cancel":
|
|
463
|
+
- action: "cancel_workflow"
|
|
464
|
+
reason: "Implementation failed - user cancelled"
|
|
465
|
+
|
|
466
|
+
slo_expectations:
|
|
467
|
+
expected_duration_ms: 5000
|
|
468
|
+
max_duration_ms: 30000
|
|
469
|
+
expected_cost_usd: 0.003
|
|
470
|
+
max_cost_usd: 0.015
|
|
471
|
+
expected_context_tokens: 2000
|
|
472
|
+
on_timeout:
|
|
473
|
+
action: "escalate"
|
|
474
|
+
message: "Implementation recovery timed out"
|
|
475
|
+
on_cost_exceeded:
|
|
476
|
+
action: "alert"
|
|
477
|
+
continue: true
|
|
478
|
+
|
|
479
|
+
provenance:
|
|
480
|
+
flow_id: "${flow.id}"
|
|
481
|
+
reason: "Implementation error recovery"
|
|
482
|
+
error_recovery: true
|
|
483
|
+
category: "recovery"
|
|
484
|
+
|
|
485
|
+
- id: "impl-fix-failed"
|
|
486
|
+
description: "Handle implementation fix failures (test-driven fixes)"
|
|
487
|
+
when:
|
|
488
|
+
concept: "implementation"
|
|
489
|
+
action: "fix"
|
|
490
|
+
status: "failed"
|
|
491
|
+
then:
|
|
492
|
+
- action: "ask_user"
|
|
493
|
+
questions:
|
|
494
|
+
- question: "Auto-fix failed for: ${test.failures}. May need manual intervention."
|
|
495
|
+
header: "Fix Failed"
|
|
496
|
+
multiSelect: false
|
|
497
|
+
options:
|
|
498
|
+
- label: "Retry with hints"
|
|
499
|
+
description: "Try again with additional context about the failure"
|
|
500
|
+
- label: "Fix manually"
|
|
501
|
+
description: "I'll fix the failing tests myself"
|
|
502
|
+
- label: "Skip failing tests"
|
|
503
|
+
description: "Mark tests as expected failures (temporary)"
|
|
504
|
+
|
|
505
|
+
on_answer:
|
|
506
|
+
"Retry with hints":
|
|
507
|
+
- action: "ask_user"
|
|
508
|
+
questions:
|
|
509
|
+
- question: "What additional context can help fix ${test.failures[0].name}?"
|
|
510
|
+
header: "Fix Hint"
|
|
511
|
+
multiSelect: false
|
|
512
|
+
options:
|
|
513
|
+
- label: "Mock issue"
|
|
514
|
+
description: "Test mocks/stubs need adjustment"
|
|
515
|
+
- label: "Async timing"
|
|
516
|
+
description: "Test has race conditions"
|
|
517
|
+
- label: "Data setup"
|
|
518
|
+
description: "Test fixtures/data incorrect"
|
|
519
|
+
- concept: "implementation"
|
|
520
|
+
action: "fix"
|
|
521
|
+
model: "sonnet"
|
|
522
|
+
inputs:
|
|
523
|
+
failing_tests: "${test.failures}"
|
|
524
|
+
hint: "${answer}"
|
|
525
|
+
|
|
526
|
+
"Fix manually":
|
|
527
|
+
- action: "notify"
|
|
528
|
+
message: "Please fix the failing tests in: ${test.failures[0].file}"
|
|
529
|
+
|
|
530
|
+
"Skip failing tests":
|
|
531
|
+
- action: "set_flag"
|
|
532
|
+
flag: "test.expected_failures"
|
|
533
|
+
value: "${test.failures}"
|
|
534
|
+
- action: "log"
|
|
535
|
+
level: "warn"
|
|
536
|
+
message: "Tests marked as expected failures: ${test.failures}"
|
|
537
|
+
|
|
538
|
+
slo_expectations:
|
|
539
|
+
expected_duration_ms: 3000
|
|
540
|
+
max_duration_ms: 15000
|
|
541
|
+
expected_cost_usd: 0.002
|
|
542
|
+
max_cost_usd: 0.008
|
|
543
|
+
expected_context_tokens: 1500
|
|
544
|
+
on_timeout:
|
|
545
|
+
action: "escalate"
|
|
546
|
+
message: "Implementation fix recovery timed out"
|
|
547
|
+
on_cost_exceeded:
|
|
548
|
+
action: "proceed"
|
|
549
|
+
|
|
550
|
+
provenance:
|
|
551
|
+
flow_id: "${flow.id}"
|
|
552
|
+
reason: "Implementation fix error recovery"
|
|
553
|
+
error_recovery: true
|
|
554
|
+
category: "recovery"
|
|
555
|
+
|
|
556
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
557
|
+
# Quality Errors
|
|
558
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
559
|
+
|
|
560
|
+
- id: "quality-review-failed"
|
|
561
|
+
description: "Handle code review failures"
|
|
562
|
+
when:
|
|
563
|
+
concept: "quality"
|
|
564
|
+
action: "review"
|
|
565
|
+
status: "failed"
|
|
566
|
+
then:
|
|
567
|
+
# Retry once
|
|
568
|
+
- action: "retry"
|
|
569
|
+
condition: "${retry_count < 1}"
|
|
570
|
+
concept: "quality"
|
|
571
|
+
action: "review"
|
|
572
|
+
backoff_ms: 1000
|
|
573
|
+
inputs:
|
|
574
|
+
implementation_id: "${implementation.id}"
|
|
575
|
+
|
|
576
|
+
# Skip review if retry fails (degraded mode)
|
|
577
|
+
- action: "ask_user"
|
|
578
|
+
condition: "${retry_count >= 1}"
|
|
579
|
+
questions:
|
|
580
|
+
- question: "Code review failed: ${error.message}. Skip or retry?"
|
|
581
|
+
header: "Review Error"
|
|
582
|
+
multiSelect: false
|
|
583
|
+
options:
|
|
584
|
+
- label: "Retry review"
|
|
585
|
+
description: "Try the code review again"
|
|
586
|
+
- label: "Skip review (risk)"
|
|
587
|
+
description: "Proceed without code review"
|
|
588
|
+
- label: "Cancel"
|
|
589
|
+
description: "Stop and investigate"
|
|
590
|
+
|
|
591
|
+
on_answer:
|
|
592
|
+
"Retry review":
|
|
593
|
+
- concept: "quality"
|
|
594
|
+
action: "review"
|
|
595
|
+
model: "sonnet"
|
|
596
|
+
inputs:
|
|
597
|
+
implementation_id: "${implementation.id}"
|
|
598
|
+
|
|
599
|
+
"Skip review (risk)":
|
|
600
|
+
- action: "set_flag"
|
|
601
|
+
flag: "review.skipped"
|
|
602
|
+
value: true
|
|
603
|
+
- action: "set_flag"
|
|
604
|
+
flag: "review.status"
|
|
605
|
+
value: "skipped"
|
|
606
|
+
- action: "log"
|
|
607
|
+
level: "warn"
|
|
608
|
+
message: "Code review skipped - proceeding without review"
|
|
609
|
+
|
|
610
|
+
"Cancel":
|
|
611
|
+
- action: "cancel_workflow"
|
|
612
|
+
reason: "Code review failed - user cancelled"
|
|
613
|
+
|
|
614
|
+
slo_expectations:
|
|
615
|
+
expected_duration_ms: 3000
|
|
616
|
+
max_duration_ms: 15000
|
|
617
|
+
expected_cost_usd: 0.002
|
|
618
|
+
max_cost_usd: 0.008
|
|
619
|
+
expected_context_tokens: 1000
|
|
620
|
+
on_timeout:
|
|
621
|
+
action: "escalate"
|
|
622
|
+
message: "Quality review recovery timed out"
|
|
623
|
+
on_cost_exceeded:
|
|
624
|
+
action: "proceed"
|
|
625
|
+
|
|
626
|
+
provenance:
|
|
627
|
+
flow_id: "${flow.id}"
|
|
628
|
+
reason: "Quality review error recovery"
|
|
629
|
+
error_recovery: true
|
|
630
|
+
category: "recovery"
|
|
631
|
+
|
|
632
|
+
- id: "quality-test-failed"
|
|
633
|
+
description: "Handle test execution failures (not test failures)"
|
|
634
|
+
when:
|
|
635
|
+
concept: "quality"
|
|
636
|
+
action: "test"
|
|
637
|
+
status: "failed"
|
|
638
|
+
where:
|
|
639
|
+
# Distinguish execution failure from test failures
|
|
640
|
+
query: "error.type == 'execution_error' OR error.type == 'timeout'"
|
|
641
|
+
then:
|
|
642
|
+
- action: "classify_error"
|
|
643
|
+
inputs:
|
|
644
|
+
error: "${error}"
|
|
645
|
+
|
|
646
|
+
# Retry for transient
|
|
647
|
+
- action: "retry"
|
|
648
|
+
condition: "${error.classification == 'transient' AND retry_count < 2}"
|
|
649
|
+
concept: "quality"
|
|
650
|
+
action: "test"
|
|
651
|
+
backoff_ms: 2000
|
|
652
|
+
inputs:
|
|
653
|
+
implementation_id: "${implementation.id}"
|
|
654
|
+
|
|
655
|
+
# Escalate
|
|
656
|
+
- action: "ask_user"
|
|
657
|
+
condition: "${retry_count >= 2}"
|
|
658
|
+
questions:
|
|
659
|
+
- question: "Test execution failed: ${error.message}. Tests couldn't run."
|
|
660
|
+
header: "Test Execution Error"
|
|
661
|
+
multiSelect: false
|
|
662
|
+
options:
|
|
663
|
+
- label: "Retry tests"
|
|
664
|
+
description: "Try running tests again"
|
|
665
|
+
- label: "Run tests manually"
|
|
666
|
+
description: "I'll run tests and provide results"
|
|
667
|
+
- label: "Skip tests (risk)"
|
|
668
|
+
description: "Proceed without test verification"
|
|
669
|
+
|
|
670
|
+
on_answer:
|
|
671
|
+
"Retry tests":
|
|
672
|
+
- concept: "quality"
|
|
673
|
+
action: "test"
|
|
674
|
+
model: "sonnet"
|
|
675
|
+
inputs:
|
|
676
|
+
implementation_id: "${implementation.id}"
|
|
677
|
+
|
|
678
|
+
"Run tests manually":
|
|
679
|
+
- action: "notify"
|
|
680
|
+
message: "Run: npm test (or appropriate test command) and report results"
|
|
681
|
+
- action: "wait_for_input"
|
|
682
|
+
prompt: "Test results (pass/fail/coverage):"
|
|
683
|
+
|
|
684
|
+
"Skip tests (risk)":
|
|
685
|
+
- action: "set_flag"
|
|
686
|
+
flag: "test.skipped"
|
|
687
|
+
value: true
|
|
688
|
+
- action: "set_flag"
|
|
689
|
+
flag: "test.status"
|
|
690
|
+
value: "skipped"
|
|
691
|
+
- action: "log"
|
|
692
|
+
level: "warn"
|
|
693
|
+
message: "Tests skipped - proceeding without test verification"
|
|
694
|
+
|
|
695
|
+
slo_expectations:
|
|
696
|
+
expected_duration_ms: 3000
|
|
697
|
+
max_duration_ms: 15000
|
|
698
|
+
expected_cost_usd: 0.002
|
|
699
|
+
max_cost_usd: 0.008
|
|
700
|
+
expected_context_tokens: 1000
|
|
701
|
+
on_timeout:
|
|
702
|
+
action: "escalate"
|
|
703
|
+
message: "Test recovery timed out"
|
|
704
|
+
on_cost_exceeded:
|
|
705
|
+
action: "proceed"
|
|
706
|
+
|
|
707
|
+
provenance:
|
|
708
|
+
flow_id: "${flow.id}"
|
|
709
|
+
reason: "Test execution error recovery"
|
|
710
|
+
error_recovery: true
|
|
711
|
+
category: "recovery"
|
|
712
|
+
|
|
713
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
714
|
+
# Documentation Errors
|
|
715
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
716
|
+
|
|
717
|
+
- id: "documentation-generation-failed"
|
|
718
|
+
description: "Handle documentation generation failures"
|
|
719
|
+
when:
|
|
720
|
+
concept: "documentation"
|
|
721
|
+
action: "generate_requirements|generate_architecture|generate_api|generate_tests"
|
|
722
|
+
status: "failed"
|
|
723
|
+
then:
|
|
724
|
+
# Documentation is optional - log and continue
|
|
725
|
+
- action: "log"
|
|
726
|
+
level: "warn"
|
|
727
|
+
message: "Documentation generation failed: ${error.message}. Continuing workflow."
|
|
728
|
+
|
|
729
|
+
- action: "set_flag"
|
|
730
|
+
flag: "documentation.${action}.skipped"
|
|
731
|
+
value: true
|
|
732
|
+
|
|
733
|
+
# Don't block workflow for documentation failures
|
|
734
|
+
- action: "continue_workflow"
|
|
735
|
+
|
|
736
|
+
slo_expectations:
|
|
737
|
+
expected_duration_ms: 1000
|
|
738
|
+
max_duration_ms: 5000
|
|
739
|
+
expected_cost_usd: 0.0005
|
|
740
|
+
max_cost_usd: 0.002
|
|
741
|
+
expected_context_tokens: 300
|
|
742
|
+
on_timeout:
|
|
743
|
+
action: "skip"
|
|
744
|
+
fallback: "Continue without documentation"
|
|
745
|
+
on_cost_exceeded:
|
|
746
|
+
action: "proceed"
|
|
747
|
+
|
|
748
|
+
provenance:
|
|
749
|
+
flow_id: "${flow.id}"
|
|
750
|
+
reason: "Documentation generation error - graceful degradation"
|
|
751
|
+
error_recovery: true
|
|
752
|
+
non_blocking: true
|
|
753
|
+
category: "recovery"
|
|
754
|
+
|
|
755
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
756
|
+
# Version/Git Errors
|
|
757
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
758
|
+
|
|
759
|
+
- id: "version-commit-failed"
|
|
760
|
+
description: "Handle git commit failures"
|
|
761
|
+
when:
|
|
762
|
+
concept: "version"
|
|
763
|
+
action: "commit"
|
|
764
|
+
status: "failed"
|
|
765
|
+
then:
|
|
766
|
+
- action: "classify_error"
|
|
767
|
+
inputs:
|
|
768
|
+
error: "${error}"
|
|
769
|
+
known_errors:
|
|
770
|
+
- pattern: "pre-commit hook"
|
|
771
|
+
classification: "hook_failure"
|
|
772
|
+
- pattern: "nothing to commit"
|
|
773
|
+
classification: "no_changes"
|
|
774
|
+
- pattern: "merge conflict"
|
|
775
|
+
classification: "conflict"
|
|
776
|
+
|
|
777
|
+
# Hook failure - offer to fix or skip
|
|
778
|
+
- action: "ask_user"
|
|
779
|
+
condition: "${error.classification == 'hook_failure'}"
|
|
780
|
+
questions:
|
|
781
|
+
- question: "Pre-commit hook failed: ${error.message}"
|
|
782
|
+
header: "Hook Failed"
|
|
783
|
+
multiSelect: false
|
|
784
|
+
options:
|
|
785
|
+
- label: "Fix hook issues"
|
|
786
|
+
description: "Address the hook failure automatically"
|
|
787
|
+
- label: "Commit without hooks"
|
|
788
|
+
description: "Skip pre-commit hooks (--no-verify)"
|
|
789
|
+
- label: "Cancel commit"
|
|
790
|
+
description: "Stop and review the issues"
|
|
791
|
+
|
|
792
|
+
on_answer:
|
|
793
|
+
"Fix hook issues":
|
|
794
|
+
- concept: "implementation"
|
|
795
|
+
action: "fix_lint"
|
|
796
|
+
model: "sonnet"
|
|
797
|
+
inputs:
|
|
798
|
+
errors: "${error.hook_output}"
|
|
799
|
+
- concept: "version"
|
|
800
|
+
action: "commit"
|
|
801
|
+
model: "sonnet"
|
|
802
|
+
inputs:
|
|
803
|
+
implementation_id: "${implementation.id}"
|
|
804
|
+
retry: true
|
|
805
|
+
|
|
806
|
+
"Commit without hooks":
|
|
807
|
+
- concept: "version"
|
|
808
|
+
action: "commit"
|
|
809
|
+
model: "sonnet"
|
|
810
|
+
inputs:
|
|
811
|
+
implementation_id: "${implementation.id}"
|
|
812
|
+
skip_hooks: true
|
|
813
|
+
|
|
814
|
+
"Cancel commit":
|
|
815
|
+
- action: "notify"
|
|
816
|
+
message: "Commit cancelled. Hook output: ${error.hook_output}"
|
|
817
|
+
|
|
818
|
+
# No changes - not an error
|
|
819
|
+
- action: "notify"
|
|
820
|
+
condition: "${error.classification == 'no_changes'}"
|
|
821
|
+
message: "No changes to commit. Workflow complete."
|
|
822
|
+
|
|
823
|
+
# Merge conflict - requires manual resolution
|
|
824
|
+
- action: "ask_user"
|
|
825
|
+
condition: "${error.classification == 'conflict'}"
|
|
826
|
+
questions:
|
|
827
|
+
- question: "Merge conflict detected. Manual resolution required."
|
|
828
|
+
header: "Conflict"
|
|
829
|
+
multiSelect: false
|
|
830
|
+
options:
|
|
831
|
+
- label: "I'll resolve manually"
|
|
832
|
+
description: "Open files and resolve conflicts"
|
|
833
|
+
- label: "Abort and restart"
|
|
834
|
+
description: "Reset to before the conflict"
|
|
835
|
+
|
|
836
|
+
slo_expectations:
|
|
837
|
+
expected_duration_ms: 3000
|
|
838
|
+
max_duration_ms: 15000
|
|
839
|
+
expected_cost_usd: 0.002
|
|
840
|
+
max_cost_usd: 0.008
|
|
841
|
+
expected_context_tokens: 1000
|
|
842
|
+
on_timeout:
|
|
843
|
+
action: "escalate"
|
|
844
|
+
message: "Git commit recovery timed out"
|
|
845
|
+
on_cost_exceeded:
|
|
846
|
+
action: "proceed"
|
|
847
|
+
|
|
848
|
+
provenance:
|
|
849
|
+
flow_id: "${flow.id}"
|
|
850
|
+
reason: "Git commit error recovery"
|
|
851
|
+
error_recovery: true
|
|
852
|
+
category: "recovery"
|
|
853
|
+
|
|
854
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
855
|
+
# Context/Memory Errors
|
|
856
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
857
|
+
|
|
858
|
+
- id: "context-compression-failed"
|
|
859
|
+
description: "Handle context compression failures"
|
|
860
|
+
when:
|
|
861
|
+
concept: "context"
|
|
862
|
+
action: "compress"
|
|
863
|
+
status: "failed"
|
|
864
|
+
then:
|
|
865
|
+
# Try more aggressive compression
|
|
866
|
+
- action: "retry"
|
|
867
|
+
condition: "${retry_count < 1}"
|
|
868
|
+
concept: "context"
|
|
869
|
+
action: "compress"
|
|
870
|
+
inputs:
|
|
871
|
+
strategy: "aggressive"
|
|
872
|
+
target_reduction: "90%"
|
|
873
|
+
|
|
874
|
+
# Create checkpoint as fallback
|
|
875
|
+
- action: "fallback"
|
|
876
|
+
condition: "${retry_count >= 1}"
|
|
877
|
+
concept: "context"
|
|
878
|
+
action: "snapshot"
|
|
879
|
+
model: "sonnet"
|
|
880
|
+
inputs:
|
|
881
|
+
strategy: "emergency_snapshot"
|
|
882
|
+
reset_to: "minimal"
|
|
883
|
+
|
|
884
|
+
- action: "log"
|
|
885
|
+
level: "error"
|
|
886
|
+
message: "Context compression failed - emergency snapshot created"
|
|
887
|
+
|
|
888
|
+
slo_expectations:
|
|
889
|
+
expected_duration_ms: 3000
|
|
890
|
+
max_duration_ms: 15000
|
|
891
|
+
expected_cost_usd: 0.002
|
|
892
|
+
max_cost_usd: 0.01
|
|
893
|
+
expected_context_tokens: 1000
|
|
894
|
+
on_timeout:
|
|
895
|
+
action: "escalate"
|
|
896
|
+
message: "Critical - context compression recovery timed out"
|
|
897
|
+
on_cost_exceeded:
|
|
898
|
+
action: "proceed"
|
|
899
|
+
message: "Context management is critical"
|
|
900
|
+
|
|
901
|
+
provenance:
|
|
902
|
+
flow_id: "${flow.id}"
|
|
903
|
+
reason: "Context compression error recovery"
|
|
904
|
+
error_recovery: true
|
|
905
|
+
critical: true
|
|
906
|
+
category: "recovery"
|
|
907
|
+
|
|
908
|
+
- id: "context-snapshot-failed"
|
|
909
|
+
description: "Handle context snapshot failures (critical)"
|
|
910
|
+
when:
|
|
911
|
+
concept: "context"
|
|
912
|
+
action: "snapshot"
|
|
913
|
+
status: "failed"
|
|
914
|
+
then:
|
|
915
|
+
# This is critical - escalate immediately
|
|
916
|
+
- action: "escalate"
|
|
917
|
+
level: "critical"
|
|
918
|
+
message: "Context snapshot failed at ${context.usage_percent}% - risk of context overflow"
|
|
919
|
+
|
|
920
|
+
- action: "notify"
|
|
921
|
+
message: |
|
|
922
|
+
CRITICAL: Context management failed.
|
|
923
|
+
Current usage: ${context.usage_percent}%
|
|
924
|
+
|
|
925
|
+
Recommended actions:
|
|
926
|
+
1. Save important state manually
|
|
927
|
+
2. Start new session with /restore
|
|
928
|
+
3. Review koan/session-state/ for recovery data
|
|
929
|
+
|
|
930
|
+
slo_expectations:
|
|
931
|
+
expected_duration_ms: 2000
|
|
932
|
+
max_duration_ms: 10000
|
|
933
|
+
expected_cost_usd: 0.001
|
|
934
|
+
max_cost_usd: 0.005
|
|
935
|
+
expected_context_tokens: 500
|
|
936
|
+
on_timeout:
|
|
937
|
+
action: "escalate"
|
|
938
|
+
message: "Critical - context snapshot failed"
|
|
939
|
+
on_cost_exceeded:
|
|
940
|
+
action: "proceed"
|
|
941
|
+
message: "Recovery is critical"
|
|
942
|
+
|
|
943
|
+
provenance:
|
|
944
|
+
flow_id: "${flow.id}"
|
|
945
|
+
reason: "Context snapshot critical failure"
|
|
946
|
+
error_recovery: true
|
|
947
|
+
critical: true
|
|
948
|
+
category: "recovery"
|
|
949
|
+
|
|
950
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
951
|
+
# Global Error Handlers
|
|
952
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
953
|
+
|
|
954
|
+
global_handlers:
|
|
955
|
+
# Catch-all for unhandled errors
|
|
956
|
+
unhandled_error:
|
|
957
|
+
description: "Default handler for errors not caught by specific handlers"
|
|
958
|
+
when:
|
|
959
|
+
status: "failed"
|
|
960
|
+
then:
|
|
961
|
+
- action: "classify_error"
|
|
962
|
+
inputs:
|
|
963
|
+
error: "${error}"
|
|
964
|
+
|
|
965
|
+
- action: "log"
|
|
966
|
+
level: "error"
|
|
967
|
+
message: "Unhandled error in ${concept}.${action}: ${error.message}"
|
|
968
|
+
|
|
969
|
+
- action: "ask_user"
|
|
970
|
+
questions:
|
|
971
|
+
- question: "An unexpected error occurred: ${error.message}"
|
|
972
|
+
header: "Error"
|
|
973
|
+
multiSelect: false
|
|
974
|
+
options:
|
|
975
|
+
- label: "Retry"
|
|
976
|
+
description: "Try the operation again"
|
|
977
|
+
- label: "Skip"
|
|
978
|
+
description: "Skip this step and continue"
|
|
979
|
+
- label: "Cancel"
|
|
980
|
+
description: "Stop the workflow"
|
|
981
|
+
|
|
982
|
+
# Rate limit handler
|
|
983
|
+
rate_limited:
|
|
984
|
+
description: "Handle API rate limiting"
|
|
985
|
+
when:
|
|
986
|
+
error_type: "rate_limit"
|
|
987
|
+
then:
|
|
988
|
+
- action: "wait"
|
|
989
|
+
duration_ms: "${error.retry_after_ms || 60000}"
|
|
990
|
+
- action: "retry"
|
|
991
|
+
max_retries: 3
|
|
992
|
+
backoff_multiplier: 2
|
|
993
|
+
|
|
994
|
+
# Timeout handler
|
|
995
|
+
timeout:
|
|
996
|
+
description: "Handle operation timeouts"
|
|
997
|
+
when:
|
|
998
|
+
error_type: "timeout"
|
|
999
|
+
then:
|
|
1000
|
+
- action: "retry"
|
|
1001
|
+
condition: "${retry_count < 2}"
|
|
1002
|
+
timeout_multiplier: 1.5
|
|
1003
|
+
|
|
1004
|
+
- action: "escalate"
|
|
1005
|
+
condition: "${retry_count >= 2}"
|
|
1006
|
+
message: "Operation timed out after ${retry_count} retries"
|
|
1007
|
+
|
|
1008
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1009
|
+
# Error Recovery Summary
|
|
1010
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1011
|
+
#
|
|
1012
|
+
# Recovery Patterns:
|
|
1013
|
+
# 1. Retry - For transient errors (network, rate limit)
|
|
1014
|
+
# 2. Fallback - For degraded mode (skip optional steps)
|
|
1015
|
+
# 3. Escalate - For permanent errors (user decision required)
|
|
1016
|
+
# 4. Graceful degradation - Continue without failed optional component
|
|
1017
|
+
#
|
|
1018
|
+
# Error Classifications:
|
|
1019
|
+
# - transient: Retry up to 3 times with backoff
|
|
1020
|
+
# - permanent: Escalate to user immediately
|
|
1021
|
+
# - degraded: Try fallback, then escalate
|
|
1022
|
+
#
|
|
1023
|
+
# Critical Paths (never skip):
|
|
1024
|
+
# - Security checks
|
|
1025
|
+
# - Test failures (actual failures, not execution errors)
|
|
1026
|
+
# - Context overflow prevention
|
|
1027
|
+
#
|
|
1028
|
+
# Optional Paths (can skip):
|
|
1029
|
+
# - Code analysis (MCP unavailable)
|
|
1030
|
+
# - Documentation generation
|
|
1031
|
+
# - Multi-pass verification
|