@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,477 @@
|
|
|
1
|
+
# Security Flow Synchronizations
|
|
2
|
+
# Continuous security assurance throughout the workflow
|
|
3
|
+
#
|
|
4
|
+
# WYSIWID Principle: This YAML IS the security workflow logic
|
|
5
|
+
# Read this file to understand exactly when security checks run
|
|
6
|
+
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
description: |
|
|
9
|
+
Implements security-by-design with checks at every workflow phase:
|
|
10
|
+
- Threat modeling after story capture
|
|
11
|
+
- Architecture validation for security patterns
|
|
12
|
+
- Implementation scanning for vulnerabilities
|
|
13
|
+
- Pre-commit verification as final gate
|
|
14
|
+
|
|
15
|
+
configuration:
|
|
16
|
+
# Severity thresholds for blocking
|
|
17
|
+
block_on:
|
|
18
|
+
- critical # Always block on critical
|
|
19
|
+
- high # Block on high by default
|
|
20
|
+
|
|
21
|
+
# Allow override with user approval
|
|
22
|
+
allow_override:
|
|
23
|
+
high: true # User can approve high-severity with justification
|
|
24
|
+
critical: false # Never allow override for critical
|
|
25
|
+
|
|
26
|
+
# Parallel execution settings
|
|
27
|
+
parallel:
|
|
28
|
+
threat_model: true # Run parallel with code-analysis
|
|
29
|
+
scan_implementation: true # Run parallel with quality.review
|
|
30
|
+
|
|
31
|
+
synchronizations:
|
|
32
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
33
|
+
# Phase 1: Story → Threat Model
|
|
34
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
35
|
+
#
|
|
36
|
+
# Generates threat model immediately after story capture.
|
|
37
|
+
# Runs in parallel with code-analysis.
|
|
38
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
39
|
+
|
|
40
|
+
- id: "story-to-threat-model"
|
|
41
|
+
description: "Generate threat model when story is ready"
|
|
42
|
+
when:
|
|
43
|
+
concept: "story"
|
|
44
|
+
action: "create"
|
|
45
|
+
status: "completed"
|
|
46
|
+
where:
|
|
47
|
+
query: "story.status == 'ready'"
|
|
48
|
+
then:
|
|
49
|
+
- concept: "security"
|
|
50
|
+
action: "threat_model"
|
|
51
|
+
model: "sonnet"
|
|
52
|
+
parallel: true # Runs in parallel with code-analysis
|
|
53
|
+
inputs:
|
|
54
|
+
story_id: "${story.id}"
|
|
55
|
+
title: "${story.title}"
|
|
56
|
+
description: "${story.description}"
|
|
57
|
+
acceptance_criteria: "${story.acceptance_criteria}"
|
|
58
|
+
|
|
59
|
+
slo_expectations:
|
|
60
|
+
expected_duration_ms: 3000
|
|
61
|
+
max_duration_ms: 15000
|
|
62
|
+
expected_cost_usd: 0.002
|
|
63
|
+
max_cost_usd: 0.005
|
|
64
|
+
success_rate_target: 0.95
|
|
65
|
+
|
|
66
|
+
on_timeout:
|
|
67
|
+
action: "warn" # Don't block workflow, but log warning
|
|
68
|
+
continue: true
|
|
69
|
+
|
|
70
|
+
provenance:
|
|
71
|
+
flow_id: "${flow.id}"
|
|
72
|
+
reason: "Story ready - generating threat model"
|
|
73
|
+
security_phase: "threat_modeling"
|
|
74
|
+
|
|
75
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
76
|
+
# Phase 2: Architecture → Security Validation
|
|
77
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
78
|
+
#
|
|
79
|
+
# Validates architecture design against threat model and
|
|
80
|
+
# OWASP security patterns. Can block if critical gaps found.
|
|
81
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
|
|
83
|
+
- id: "arch-to-security-validation"
|
|
84
|
+
description: "Validate architecture against security requirements"
|
|
85
|
+
when:
|
|
86
|
+
concept: "architecture"
|
|
87
|
+
action: "design"
|
|
88
|
+
status: "completed"
|
|
89
|
+
where:
|
|
90
|
+
query: "architecture.status == 'completed'"
|
|
91
|
+
then:
|
|
92
|
+
- concept: "security"
|
|
93
|
+
action: "validate_architecture"
|
|
94
|
+
model: "sonnet"
|
|
95
|
+
inputs:
|
|
96
|
+
arch_id: "${architecture.id}"
|
|
97
|
+
story_id: "${story.id}"
|
|
98
|
+
threat_model_id: "${security.threat_model.id}"
|
|
99
|
+
decisions: "${architecture.decisions}"
|
|
100
|
+
patterns: "${architecture.patterns}"
|
|
101
|
+
|
|
102
|
+
slo_expectations:
|
|
103
|
+
expected_duration_ms: 4000
|
|
104
|
+
max_duration_ms: 20000
|
|
105
|
+
expected_cost_usd: 0.002
|
|
106
|
+
max_cost_usd: 0.005
|
|
107
|
+
success_rate_target: 0.95
|
|
108
|
+
|
|
109
|
+
on_timeout:
|
|
110
|
+
action: "retry"
|
|
111
|
+
max_retries: 1
|
|
112
|
+
backoff_ms: 2000
|
|
113
|
+
|
|
114
|
+
provenance:
|
|
115
|
+
flow_id: "${flow.id}"
|
|
116
|
+
reason: "Architecture complete - validating security patterns"
|
|
117
|
+
security_phase: "architecture_validation"
|
|
118
|
+
|
|
119
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
120
|
+
# Architecture Security Blocked
|
|
121
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
+
#
|
|
123
|
+
# When architecture fails security validation, return to
|
|
124
|
+
# architecture for revision.
|
|
125
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
126
|
+
|
|
127
|
+
- id: "security-arch-blocked"
|
|
128
|
+
description: "When architecture fails security validation"
|
|
129
|
+
when:
|
|
130
|
+
concept: "security"
|
|
131
|
+
action: "validate_architecture"
|
|
132
|
+
status: "completed"
|
|
133
|
+
where:
|
|
134
|
+
query: "security.decision == 'block'"
|
|
135
|
+
then:
|
|
136
|
+
- action: "ask_user"
|
|
137
|
+
questions:
|
|
138
|
+
- question: "Architecture failed security validation. Issues: ${security.issues}. How to proceed?"
|
|
139
|
+
header: "Security Block"
|
|
140
|
+
multiSelect: false
|
|
141
|
+
options:
|
|
142
|
+
- label: "Revise architecture"
|
|
143
|
+
description: "Return to architecture to address security gaps"
|
|
144
|
+
- label: "Override with justification"
|
|
145
|
+
description: "Proceed anyway (requires documented justification)"
|
|
146
|
+
- label: "Cancel feature"
|
|
147
|
+
description: "Stop the workflow"
|
|
148
|
+
|
|
149
|
+
on_answer:
|
|
150
|
+
"Revise architecture":
|
|
151
|
+
- concept: "architecture"
|
|
152
|
+
action: "revise"
|
|
153
|
+
model: "opus"
|
|
154
|
+
inputs:
|
|
155
|
+
original_architecture_id: "${architecture.id}"
|
|
156
|
+
security_issues: "${security.issues}"
|
|
157
|
+
constraint: "Address security requirements: ${security.requirements}"
|
|
158
|
+
|
|
159
|
+
"Override with justification":
|
|
160
|
+
- action: "ask_user"
|
|
161
|
+
questions:
|
|
162
|
+
- question: "Enter security justification for override:"
|
|
163
|
+
header: "Justification"
|
|
164
|
+
multiSelect: false
|
|
165
|
+
options:
|
|
166
|
+
- label: "Risk accepted for MVP"
|
|
167
|
+
description: "Will address before production"
|
|
168
|
+
- label: "Mitigated by other controls"
|
|
169
|
+
description: "External controls reduce risk"
|
|
170
|
+
- label: "False positive"
|
|
171
|
+
description: "Analysis incorrect"
|
|
172
|
+
- action: "set_flag"
|
|
173
|
+
flag: "security.override"
|
|
174
|
+
value: true
|
|
175
|
+
- action: "log"
|
|
176
|
+
level: "warn"
|
|
177
|
+
message: "Security override: ${answer.justification} for ${security.issues}"
|
|
178
|
+
|
|
179
|
+
"Cancel feature":
|
|
180
|
+
- action: "cancel_workflow"
|
|
181
|
+
reason: "Security validation failed - user cancelled"
|
|
182
|
+
|
|
183
|
+
provenance:
|
|
184
|
+
flow_id: "${flow.id}"
|
|
185
|
+
reason: "Architecture security blocked - user decision required"
|
|
186
|
+
decision_point: true
|
|
187
|
+
security_phase: "architecture_validation"
|
|
188
|
+
|
|
189
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
190
|
+
# Phase 3: Implementation → Vulnerability Scan
|
|
191
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
192
|
+
#
|
|
193
|
+
# Scans implementation code for vulnerabilities.
|
|
194
|
+
# Runs in parallel with quality.review.
|
|
195
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
196
|
+
|
|
197
|
+
- id: "impl-to-security-scan"
|
|
198
|
+
description: "Scan implementation for vulnerabilities"
|
|
199
|
+
when:
|
|
200
|
+
concept: "implementation"
|
|
201
|
+
action: "generate"
|
|
202
|
+
status: "completed"
|
|
203
|
+
where:
|
|
204
|
+
query: "implementation.status == 'completed'"
|
|
205
|
+
then:
|
|
206
|
+
- concept: "security"
|
|
207
|
+
action: "scan_implementation"
|
|
208
|
+
model: "sonnet"
|
|
209
|
+
parallel: true # Runs in parallel with quality.review
|
|
210
|
+
inputs:
|
|
211
|
+
impl_id: "${implementation.id}"
|
|
212
|
+
arch_id: "${architecture.id}"
|
|
213
|
+
files_created: "${implementation.files_created}"
|
|
214
|
+
files_modified: "${implementation.files_modified}"
|
|
215
|
+
threat_model_id: "${security.threat_model.id}"
|
|
216
|
+
|
|
217
|
+
slo_expectations:
|
|
218
|
+
expected_duration_ms: 4000
|
|
219
|
+
max_duration_ms: 20000
|
|
220
|
+
expected_cost_usd: 0.002
|
|
221
|
+
max_cost_usd: 0.005
|
|
222
|
+
success_rate_target: 0.95
|
|
223
|
+
|
|
224
|
+
on_timeout:
|
|
225
|
+
action: "warn"
|
|
226
|
+
continue: true
|
|
227
|
+
message: "Security scan timed out - manual review recommended"
|
|
228
|
+
|
|
229
|
+
provenance:
|
|
230
|
+
flow_id: "${flow.id}"
|
|
231
|
+
reason: "Implementation complete - scanning for vulnerabilities"
|
|
232
|
+
security_phase: "vulnerability_scanning"
|
|
233
|
+
|
|
234
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
235
|
+
# Security Scan Found Critical Issues
|
|
236
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
237
|
+
|
|
238
|
+
- id: "security-scan-critical"
|
|
239
|
+
description: "When scan finds critical vulnerabilities"
|
|
240
|
+
when:
|
|
241
|
+
concept: "security"
|
|
242
|
+
action: "scan_implementation"
|
|
243
|
+
status: "completed"
|
|
244
|
+
where:
|
|
245
|
+
query: "security.vulnerabilities.critical > 0"
|
|
246
|
+
then:
|
|
247
|
+
- action: "notify"
|
|
248
|
+
level: "error"
|
|
249
|
+
message: |
|
|
250
|
+
CRITICAL SECURITY VULNERABILITIES FOUND
|
|
251
|
+
|
|
252
|
+
${security.vulnerabilities.critical} critical issues must be fixed:
|
|
253
|
+
${security.critical_issues}
|
|
254
|
+
|
|
255
|
+
Workflow blocked until resolved.
|
|
256
|
+
|
|
257
|
+
- concept: "implementation"
|
|
258
|
+
action: "fix_security"
|
|
259
|
+
model: "sonnet"
|
|
260
|
+
inputs:
|
|
261
|
+
impl_id: "${implementation.id}"
|
|
262
|
+
vulnerabilities: "${security.critical_issues}"
|
|
263
|
+
recommendations: "${security.recommendations}"
|
|
264
|
+
|
|
265
|
+
provenance:
|
|
266
|
+
flow_id: "${flow.id}"
|
|
267
|
+
reason: "Critical security vulnerabilities - automatic fix triggered"
|
|
268
|
+
security_phase: "vulnerability_remediation"
|
|
269
|
+
severity: "critical"
|
|
270
|
+
|
|
271
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
272
|
+
# Security Scan Found High Issues (User Decision)
|
|
273
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
274
|
+
|
|
275
|
+
- id: "security-scan-high"
|
|
276
|
+
description: "When scan finds high-severity vulnerabilities"
|
|
277
|
+
when:
|
|
278
|
+
concept: "security"
|
|
279
|
+
action: "scan_implementation"
|
|
280
|
+
status: "completed"
|
|
281
|
+
where:
|
|
282
|
+
query: "security.vulnerabilities.critical == 0 AND security.vulnerabilities.high > 0"
|
|
283
|
+
then:
|
|
284
|
+
- action: "ask_user"
|
|
285
|
+
questions:
|
|
286
|
+
- question: "${security.vulnerabilities.high} high-severity issues found. How to proceed?"
|
|
287
|
+
header: "Security Issues"
|
|
288
|
+
multiSelect: false
|
|
289
|
+
options:
|
|
290
|
+
- label: "Fix issues (Recommended)"
|
|
291
|
+
description: "Fix high-severity vulnerabilities before commit"
|
|
292
|
+
- label: "Proceed with warning"
|
|
293
|
+
description: "Accept risk and continue (requires justification)"
|
|
294
|
+
- label: "Cancel"
|
|
295
|
+
description: "Stop and review issues"
|
|
296
|
+
|
|
297
|
+
on_answer:
|
|
298
|
+
"Fix issues (Recommended)":
|
|
299
|
+
- concept: "implementation"
|
|
300
|
+
action: "fix_security"
|
|
301
|
+
model: "sonnet"
|
|
302
|
+
inputs:
|
|
303
|
+
impl_id: "${implementation.id}"
|
|
304
|
+
vulnerabilities: "${security.high_issues}"
|
|
305
|
+
|
|
306
|
+
"Proceed with warning":
|
|
307
|
+
- action: "set_flag"
|
|
308
|
+
flag: "security.high_accepted"
|
|
309
|
+
value: true
|
|
310
|
+
- action: "log"
|
|
311
|
+
level: "warn"
|
|
312
|
+
message: "High-severity issues accepted: ${security.high_issues}"
|
|
313
|
+
|
|
314
|
+
"Cancel":
|
|
315
|
+
- action: "notify"
|
|
316
|
+
message: "Review security issues in koan/security/scan-${implementation.id}.yaml"
|
|
317
|
+
|
|
318
|
+
provenance:
|
|
319
|
+
flow_id: "${flow.id}"
|
|
320
|
+
reason: "High-severity security issues - user decision required"
|
|
321
|
+
decision_point: true
|
|
322
|
+
security_phase: "vulnerability_remediation"
|
|
323
|
+
|
|
324
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
325
|
+
# Phase 4: Pre-Commit → Security Verification
|
|
326
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
327
|
+
#
|
|
328
|
+
# Final security gate before version.commit.
|
|
329
|
+
# Verifies all issues resolved and generates attestation.
|
|
330
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
331
|
+
|
|
332
|
+
- id: "pre-commit-security-verify"
|
|
333
|
+
description: "Final security verification before commit"
|
|
334
|
+
when:
|
|
335
|
+
concept: "quality"
|
|
336
|
+
action: "review"
|
|
337
|
+
status: "completed"
|
|
338
|
+
where:
|
|
339
|
+
query: "review.status == 'approved'"
|
|
340
|
+
|
|
341
|
+
# Wait for security scan to complete
|
|
342
|
+
depends_on:
|
|
343
|
+
required:
|
|
344
|
+
- id: "impl-to-security-scan"
|
|
345
|
+
status: "completed"
|
|
346
|
+
timeout_ms: 20000
|
|
347
|
+
|
|
348
|
+
then:
|
|
349
|
+
- concept: "security"
|
|
350
|
+
action: "verify_commit"
|
|
351
|
+
model: "sonnet"
|
|
352
|
+
inputs:
|
|
353
|
+
impl_id: "${implementation.id}"
|
|
354
|
+
scan_id: "${security.scan.id}"
|
|
355
|
+
files_to_commit: "${implementation.files_changed}"
|
|
356
|
+
|
|
357
|
+
slo_expectations:
|
|
358
|
+
expected_duration_ms: 3000
|
|
359
|
+
max_duration_ms: 15000
|
|
360
|
+
expected_cost_usd: 0.002
|
|
361
|
+
max_cost_usd: 0.005
|
|
362
|
+
success_rate_target: 0.99
|
|
363
|
+
|
|
364
|
+
provenance:
|
|
365
|
+
flow_id: "${flow.id}"
|
|
366
|
+
reason: "Quality approved - final security verification"
|
|
367
|
+
security_phase: "commit_verification"
|
|
368
|
+
|
|
369
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
370
|
+
# Security Verified → Proceed to Commit
|
|
371
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
372
|
+
|
|
373
|
+
- id: "security-verified-to-commit"
|
|
374
|
+
description: "When security verification passes, allow commit"
|
|
375
|
+
when:
|
|
376
|
+
concept: "security"
|
|
377
|
+
action: "verify_commit"
|
|
378
|
+
status: "completed"
|
|
379
|
+
where:
|
|
380
|
+
query: "security.decision == 'approve'"
|
|
381
|
+
then:
|
|
382
|
+
- concept: "version"
|
|
383
|
+
action: "commit"
|
|
384
|
+
model: "sonnet"
|
|
385
|
+
inputs:
|
|
386
|
+
implementation_id: "${implementation.id}"
|
|
387
|
+
story_id: "${story.id}"
|
|
388
|
+
flow_id: "${flow.id}"
|
|
389
|
+
security_attestation: "${security.attestation.id}"
|
|
390
|
+
|
|
391
|
+
provenance:
|
|
392
|
+
flow_id: "${flow.id}"
|
|
393
|
+
reason: "Security verified - proceeding to commit"
|
|
394
|
+
security_attestation: "${security.attestation.id}"
|
|
395
|
+
|
|
396
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
397
|
+
# Secrets Detected → Block Commit
|
|
398
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
399
|
+
|
|
400
|
+
- id: "secrets-detected-block"
|
|
401
|
+
description: "Block commit when secrets detected in files"
|
|
402
|
+
when:
|
|
403
|
+
concept: "security"
|
|
404
|
+
action: "verify_commit"
|
|
405
|
+
status: "completed"
|
|
406
|
+
where:
|
|
407
|
+
query: "security.secrets_detected == true"
|
|
408
|
+
then:
|
|
409
|
+
- action: "notify"
|
|
410
|
+
level: "error"
|
|
411
|
+
message: |
|
|
412
|
+
SECRETS DETECTED IN STAGED FILES
|
|
413
|
+
|
|
414
|
+
Files with secrets:
|
|
415
|
+
${security.secrets_files}
|
|
416
|
+
|
|
417
|
+
Commit blocked. Remove secrets before proceeding.
|
|
418
|
+
|
|
419
|
+
- action: "set_flag"
|
|
420
|
+
flag: "version.blocked"
|
|
421
|
+
value: true
|
|
422
|
+
reason: "Secrets detected in staged files"
|
|
423
|
+
|
|
424
|
+
provenance:
|
|
425
|
+
flow_id: "${flow.id}"
|
|
426
|
+
reason: "Secrets detected - commit blocked"
|
|
427
|
+
security_phase: "commit_verification"
|
|
428
|
+
severity: "critical"
|
|
429
|
+
|
|
430
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
431
|
+
# Security Flow Summary
|
|
432
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
433
|
+
#
|
|
434
|
+
# Complete security flow:
|
|
435
|
+
#
|
|
436
|
+
# Story ─────────────────┬──> Threat Model (parallel)
|
|
437
|
+
# │
|
|
438
|
+
# Architecture ──────────┴──> Security Validation
|
|
439
|
+
# │
|
|
440
|
+
# ┌─────────┴─────────┐
|
|
441
|
+
# │ │
|
|
442
|
+
# [approved] [blocked]
|
|
443
|
+
# │ │
|
|
444
|
+
# v v
|
|
445
|
+
# Implementation ───┴──> Security Scan (parallel with quality)
|
|
446
|
+
# │
|
|
447
|
+
# ┌─────────┴─────────┐
|
|
448
|
+
# │ │
|
|
449
|
+
# [clean/low] [critical/high]
|
|
450
|
+
# │ │
|
|
451
|
+
# v v
|
|
452
|
+
# Quality ─────────────> Security Verify │
|
|
453
|
+
# │ │
|
|
454
|
+
# ┌─────────┴─────────┤
|
|
455
|
+
# │ │
|
|
456
|
+
# [approved] [blocked]
|
|
457
|
+
# │ │
|
|
458
|
+
# v v
|
|
459
|
+
# Commit Fix Issues
|
|
460
|
+
#
|
|
461
|
+
# Security Phases:
|
|
462
|
+
# 1. Threat Modeling - Identify assets, threats, requirements
|
|
463
|
+
# 2. Architecture Validation - Check design against OWASP
|
|
464
|
+
# 3. Vulnerability Scanning - Detect issues in code
|
|
465
|
+
# 4. Commit Verification - Final gate with attestation
|
|
466
|
+
#
|
|
467
|
+
# Cost per Feature:
|
|
468
|
+
# - Threat model: $0.002
|
|
469
|
+
# - Arch validation: $0.002
|
|
470
|
+
# - Impl scan: $0.002
|
|
471
|
+
# - Commit verify: $0.002
|
|
472
|
+
# - Total: ~$0.008
|
|
473
|
+
#
|
|
474
|
+
# Blocking Behavior:
|
|
475
|
+
# - Critical vulnerabilities: Always block
|
|
476
|
+
# - High vulnerabilities: Block by default, user override allowed
|
|
477
|
+
# - Secrets detected: Always block, no override
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# SLO Monitoring Synchronizations
|
|
2
|
+
# Automatic post-action SLO validation for all concepts
|
|
3
|
+
#
|
|
4
|
+
# WYSIWID Principle: This YAML defines when SLO monitoring happens
|
|
5
|
+
|
|
6
|
+
synchronizations:
|
|
7
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
# Universal SLO Monitoring
|
|
9
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
10
|
+
# Triggered after ANY concept action completes
|
|
11
|
+
# Only runs if the triggering sync rule has slo_expectations defined
|
|
12
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
13
|
+
|
|
14
|
+
- id: "post-action-slo-monitor"
|
|
15
|
+
description: "After any action completes, validate against SLO expectations"
|
|
16
|
+
when:
|
|
17
|
+
concept: "*" # Any concept
|
|
18
|
+
action: "*" # Any action
|
|
19
|
+
status: "completed" # Only successful completions
|
|
20
|
+
where:
|
|
21
|
+
# Only monitor if the sync rule that triggered this action has SLOs defined
|
|
22
|
+
query: "sync_rule.slo_expectations != null"
|
|
23
|
+
then:
|
|
24
|
+
- concept: "slo"
|
|
25
|
+
action: "monitor"
|
|
26
|
+
model: "sonnet" # Fast numeric analysis, <500ms overhead
|
|
27
|
+
inputs:
|
|
28
|
+
action_id: "${action.id}"
|
|
29
|
+
concept: "${action.concept}"
|
|
30
|
+
sync_id: "${sync.id}"
|
|
31
|
+
slo_config: "${sync_rule.slo_expectations}"
|
|
32
|
+
provenance:
|
|
33
|
+
flow_id: "${flow.id}"
|
|
34
|
+
reason: "Post-action SLO validation"
|
|
35
|
+
slo_monitoring: true
|
|
36
|
+
|
|
37
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
38
|
+
# SLO Violation Handlers
|
|
39
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
40
|
+
# These rules handle specific violation types
|
|
41
|
+
# Triggered by slo.monitor when violations detected
|
|
42
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
43
|
+
|
|
44
|
+
- id: "slo-timeout-retry"
|
|
45
|
+
description: "Retry action when timeout occurs and retries available"
|
|
46
|
+
when:
|
|
47
|
+
concept: "slo"
|
|
48
|
+
action: "monitor"
|
|
49
|
+
status: "completed"
|
|
50
|
+
where:
|
|
51
|
+
query: "violations.any(v => v.type == 'timeout') AND handler.action == 'retry' AND handler.retries_remaining > 0"
|
|
52
|
+
then:
|
|
53
|
+
# Retry the original action that timed out
|
|
54
|
+
- concept: "${violation.concept}"
|
|
55
|
+
action: "${violation.action}"
|
|
56
|
+
model: "${violation.model}"
|
|
57
|
+
inputs: "${violation.original_inputs}"
|
|
58
|
+
retry: true
|
|
59
|
+
retry_count: "${handler.retry_count + 1}"
|
|
60
|
+
backoff_ms: "${handler.backoff_ms}"
|
|
61
|
+
provenance:
|
|
62
|
+
flow_id: "${flow.id}"
|
|
63
|
+
reason: "SLO timeout violation - retry attempt ${handler.retry_count + 1}"
|
|
64
|
+
triggered_by_violation: "${violation.id}"
|
|
65
|
+
|
|
66
|
+
- id: "slo-timeout-escalate"
|
|
67
|
+
description: "Escalate to human when retries exhausted"
|
|
68
|
+
when:
|
|
69
|
+
concept: "slo"
|
|
70
|
+
action: "monitor"
|
|
71
|
+
status: "completed"
|
|
72
|
+
where:
|
|
73
|
+
query: "violations.any(v => v.type == 'timeout') AND handler.action == 'retry' AND handler.retries_remaining == 0"
|
|
74
|
+
then:
|
|
75
|
+
- action: "ask_user"
|
|
76
|
+
questions:
|
|
77
|
+
- question: "Action '${violation.concept}.${violation.action}' exceeded timeout (${violation.actual}ms > ${violation.threshold}ms). Retries exhausted. How to proceed?"
|
|
78
|
+
header: "SLO Timeout Escalation"
|
|
79
|
+
multiSelect: false
|
|
80
|
+
options:
|
|
81
|
+
- label: "Continue anyway"
|
|
82
|
+
description: "Accept the timeout and continue workflow"
|
|
83
|
+
- label: "Increase timeout"
|
|
84
|
+
description: "Increase max_duration_ms and retry"
|
|
85
|
+
- label: "Cancel workflow"
|
|
86
|
+
description: "Stop this workflow due to performance issue"
|
|
87
|
+
on_answer:
|
|
88
|
+
"Continue anyway":
|
|
89
|
+
- concept: "slo"
|
|
90
|
+
action: "alert"
|
|
91
|
+
model: "sonnet"
|
|
92
|
+
inputs:
|
|
93
|
+
violation: "${violation}"
|
|
94
|
+
user_decision: "accepted"
|
|
95
|
+
|
|
96
|
+
"Increase timeout":
|
|
97
|
+
- concept: "slo"
|
|
98
|
+
action: "update_threshold"
|
|
99
|
+
model: "sonnet"
|
|
100
|
+
inputs:
|
|
101
|
+
sync_id: "${violation.sync_id}"
|
|
102
|
+
threshold: "max_duration_ms"
|
|
103
|
+
new_value: "${violation.threshold * 1.5}"
|
|
104
|
+
- concept: "${violation.concept}"
|
|
105
|
+
action: "${violation.action}"
|
|
106
|
+
model: "${violation.model}"
|
|
107
|
+
inputs: "${violation.original_inputs}"
|
|
108
|
+
retry: true
|
|
109
|
+
|
|
110
|
+
"Cancel workflow":
|
|
111
|
+
- concept: "story"
|
|
112
|
+
action: "cancel"
|
|
113
|
+
model: "sonnet"
|
|
114
|
+
inputs:
|
|
115
|
+
story_id: "${story.id}"
|
|
116
|
+
reason: "User cancelled due to timeout violations"
|
|
117
|
+
provenance:
|
|
118
|
+
flow_id: "${flow.id}"
|
|
119
|
+
reason: "SLO timeout escalated - retries exhausted"
|
|
120
|
+
decision_point: true
|
|
121
|
+
user_interaction: "ask_user_question"
|
|
122
|
+
|
|
123
|
+
- id: "slo-cost-exceeded-alert"
|
|
124
|
+
description: "Alert when cost threshold exceeded"
|
|
125
|
+
when:
|
|
126
|
+
concept: "slo"
|
|
127
|
+
action: "monitor"
|
|
128
|
+
status: "completed"
|
|
129
|
+
where:
|
|
130
|
+
query: "violations.any(v => v.type == 'cost_exceeded')"
|
|
131
|
+
then:
|
|
132
|
+
- concept: "slo"
|
|
133
|
+
action: "alert"
|
|
134
|
+
model: "sonnet"
|
|
135
|
+
inputs:
|
|
136
|
+
violation: "${violations.find(v => v.type == 'cost_exceeded')}"
|
|
137
|
+
handler_config: "${sync_rule.slo_expectations.on_cost_exceeded}"
|
|
138
|
+
provenance:
|
|
139
|
+
flow_id: "${flow.id}"
|
|
140
|
+
reason: "SLO cost violation - sending alert"
|
|
141
|
+
|
|
142
|
+
- id: "slo-context-exceeded-investigate"
|
|
143
|
+
description: "Create investigation task when context limit exceeded"
|
|
144
|
+
when:
|
|
145
|
+
concept: "slo"
|
|
146
|
+
action: "monitor"
|
|
147
|
+
status: "completed"
|
|
148
|
+
where:
|
|
149
|
+
query: "violations.any(v => v.type == 'context_exceeded') AND handler.investigate == true"
|
|
150
|
+
then:
|
|
151
|
+
- concept: "slo"
|
|
152
|
+
action: "alert"
|
|
153
|
+
model: "sonnet"
|
|
154
|
+
inputs:
|
|
155
|
+
violation: "${violations.find(v => v.type == 'context_exceeded')}"
|
|
156
|
+
handler_config: "${sync_rule.slo_expectations.on_context_exceeded}"
|
|
157
|
+
create_task: true
|
|
158
|
+
task_description: "Investigate context token violation: ${violation.actual} tokens > ${violation.threshold} tokens. Check Phase 2 optimizations."
|
|
159
|
+
provenance:
|
|
160
|
+
flow_id: "${flow.id}"
|
|
161
|
+
reason: "SLO context violation - investigation task created"
|
|
162
|
+
investigation: true
|
|
163
|
+
|
|
164
|
+
- id: "slo-quality-escalate"
|
|
165
|
+
description: "Escalate when quality falls below target"
|
|
166
|
+
when:
|
|
167
|
+
concept: "slo"
|
|
168
|
+
action: "monitor"
|
|
169
|
+
status: "completed"
|
|
170
|
+
where:
|
|
171
|
+
query: "violations.any(v => v.type == 'quality_below_target')"
|
|
172
|
+
then:
|
|
173
|
+
- concept: "slo"
|
|
174
|
+
action: "alert"
|
|
175
|
+
model: "sonnet"
|
|
176
|
+
inputs:
|
|
177
|
+
violation: "${violations.find(v => v.type == 'quality_below_target')}"
|
|
178
|
+
handler_config: "${sync_rule.slo_expectations.on_quality_below_target}"
|
|
179
|
+
escalate: true
|
|
180
|
+
provenance:
|
|
181
|
+
flow_id: "${flow.id}"
|
|
182
|
+
reason: "SLO quality violation - escalating"
|
|
183
|
+
|
|
184
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
185
|
+
# SLO Monitoring Summary
|
|
186
|
+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
187
|
+
#
|
|
188
|
+
# Flow:
|
|
189
|
+
# 1. Any concept action completes
|
|
190
|
+
# 2. post-action-slo-monitor triggers (if rule has SLOs)
|
|
191
|
+
# 3. slo.monitor compares actual vs expected
|
|
192
|
+
# 4. If violations:
|
|
193
|
+
# - timeout → retry (if retries available) → escalate (if exhausted)
|
|
194
|
+
# - cost_exceeded → alert
|
|
195
|
+
# - context_exceeded → alert + investigate
|
|
196
|
+
# - quality_below_target → escalate
|
|
197
|
+
# 5. Update monthly metrics
|
|
198
|
+
# 6. Record violations
|
|
199
|
+
#
|
|
200
|
+
# Performance:
|
|
201
|
+
# - SLO monitoring adds <500ms per action (Sonnet)
|
|
202
|
+
# - Only runs when slo_expectations defined
|
|
203
|
+
# - No monitoring = no overhead
|
|
204
|
+
#
|
|
205
|
+
# Integration:
|
|
206
|
+
# - Works with all concepts (story, architecture, implementation, etc.)
|
|
207
|
+
# - Reads from provenance (no data duplication)
|
|
208
|
+
# - Writes to koan/slo/ (monthly aggregation)
|
|
209
|
+
#
|