@winspan/claude-forge 4.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -718
- package/dist/claudemd/claudemd-generator.d.ts +28 -0
- package/dist/claudemd/claudemd-generator.d.ts.map +1 -0
- package/dist/claudemd/claudemd-generator.js +97 -0
- package/dist/claudemd/claudemd-generator.js.map +1 -0
- package/dist/claudemd/index.d.ts +25 -42
- package/dist/claudemd/index.d.ts.map +1 -1
- package/dist/claudemd/index.js +26 -270
- package/dist/claudemd/index.js.map +1 -1
- package/dist/claudemd/persona-manager.d.ts +19 -0
- package/dist/claudemd/persona-manager.d.ts.map +1 -0
- package/dist/claudemd/persona-manager.js +88 -0
- package/dist/claudemd/persona-manager.js.map +1 -0
- package/dist/claudemd/resume-manager.d.ts +29 -0
- package/dist/claudemd/resume-manager.d.ts.map +1 -0
- package/dist/claudemd/resume-manager.js +155 -0
- package/dist/claudemd/resume-manager.js.map +1 -0
- package/dist/claudemd/tech-detector.d.ts +20 -0
- package/dist/claudemd/tech-detector.d.ts.map +1 -0
- package/dist/claudemd/tech-detector.js +142 -0
- package/dist/claudemd/tech-detector.js.map +1 -0
- package/dist/cli/commands/claudemd.d.ts +2 -2
- package/dist/cli/commands/claudemd.d.ts.map +1 -1
- package/dist/cli/commands/claudemd.js +62 -304
- package/dist/cli/commands/claudemd.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +32 -168
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/daemon.d.ts +2 -2
- package/dist/cli/commands/daemon.d.ts.map +1 -1
- package/dist/cli/commands/daemon.js +34 -300
- package/dist/cli/commands/daemon.js.map +1 -1
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +53 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +3 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +83 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/status.d.ts +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +45 -52
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/index.js +15 -48
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/hook-manager.d.ts +19 -0
- package/dist/cli/init/hook-manager.d.ts.map +1 -0
- package/dist/cli/init/hook-manager.js +99 -0
- package/dist/cli/init/hook-manager.js.map +1 -0
- package/dist/core/ai/provider.d.ts +25 -0
- package/dist/core/ai/provider.d.ts.map +1 -0
- package/dist/core/ai/provider.js +68 -0
- package/dist/core/ai/provider.js.map +1 -0
- package/dist/core/ai/types.d.ts +12 -0
- package/dist/core/ai/types.d.ts.map +1 -0
- package/dist/core/ai/types.js +5 -0
- package/dist/core/ai/types.js.map +1 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +72 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/constants.d.ts +39 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +41 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/storage/schema.sql +109 -0
- package/dist/core/storage/sqlite.d.ts +32 -0
- package/dist/core/storage/sqlite.d.ts.map +1 -0
- package/dist/core/storage/sqlite.js +163 -0
- package/dist/core/storage/sqlite.js.map +1 -0
- package/dist/core/types.d.ts +45 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/utils/forge-resume-block.d.ts.map +1 -0
- package/dist/core/utils/forge-resume-block.js.map +1 -0
- package/dist/core/utils/logger.d.ts +17 -0
- package/dist/core/utils/logger.d.ts.map +1 -0
- package/dist/core/utils/logger.js +40 -0
- package/dist/core/utils/logger.js.map +1 -0
- package/dist/core/utils/lru-cache.d.ts +14 -0
- package/dist/core/utils/lru-cache.d.ts.map +1 -0
- package/dist/core/utils/lru-cache.js +42 -0
- package/dist/core/utils/lru-cache.js.map +1 -0
- package/dist/core/utils/path.d.ts +9 -0
- package/dist/core/utils/path.d.ts.map +1 -0
- package/dist/core/utils/path.js +18 -0
- package/dist/core/utils/path.js.map +1 -0
- package/dist/daemon/event-parser.d.ts +1 -1
- package/dist/daemon/event-parser.d.ts.map +1 -1
- package/dist/daemon/event-parser.js +5 -3
- package/dist/daemon/event-parser.js.map +1 -1
- package/dist/daemon/handlers/history-exporter.d.ts +15 -0
- package/dist/daemon/handlers/history-exporter.d.ts.map +1 -0
- package/dist/daemon/handlers/history-exporter.js +94 -0
- package/dist/daemon/handlers/history-exporter.js.map +1 -0
- package/dist/daemon/handlers/post-tool-use.d.ts +16 -0
- package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -0
- package/dist/daemon/handlers/post-tool-use.js +48 -0
- package/dist/daemon/handlers/post-tool-use.js.map +1 -0
- package/dist/daemon/handlers/pre-tool-use.d.ts +19 -0
- package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -0
- package/dist/daemon/handlers/pre-tool-use.js +50 -0
- package/dist/daemon/handlers/pre-tool-use.js.map +1 -0
- package/dist/daemon/handlers/stop.d.ts +19 -0
- package/dist/daemon/handlers/stop.d.ts.map +1 -0
- package/dist/daemon/handlers/stop.js +42 -0
- package/dist/daemon/handlers/stop.js.map +1 -0
- package/dist/daemon/handlers/user-prompt.d.ts +21 -0
- package/dist/daemon/handlers/user-prompt.d.ts.map +1 -0
- package/dist/daemon/handlers/user-prompt.js +69 -0
- package/dist/daemon/handlers/user-prompt.js.map +1 -0
- package/dist/daemon/index.d.ts +10 -0
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +81 -535
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/lifecycle.d.ts +0 -9
- package/dist/daemon/lifecycle.d.ts.map +1 -1
- package/dist/daemon/lifecycle.js +1 -23
- package/dist/daemon/lifecycle.js.map +1 -1
- package/dist/daemon/router.d.ts +13 -0
- package/dist/daemon/router.d.ts.map +1 -0
- package/dist/daemon/router.js +7 -0
- package/dist/daemon/router.js.map +1 -0
- package/dist/daemon/server.d.ts +2 -6
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +2 -21
- package/dist/daemon/server.js.map +1 -1
- package/dist/engine/context-builder.d.ts +23 -0
- package/dist/engine/context-builder.d.ts.map +1 -0
- package/dist/engine/context-builder.js +63 -0
- package/dist/engine/context-builder.js.map +1 -0
- package/dist/engine/conventions/basic-security.yaml +100 -0
- package/dist/engine/conventions/code-quality.yaml +123 -0
- package/dist/engine/conventions/dependency-safety.yaml +131 -0
- package/dist/engine/conventions/git-safety.yaml +105 -0
- package/dist/engine/conventions/strict-security.yaml +30 -0
- package/dist/engine/conventions/ts-quality.yaml +49 -0
- package/dist/engine/dsl/compiler.d.ts +34 -0
- package/dist/engine/dsl/compiler.d.ts.map +1 -0
- package/dist/engine/dsl/compiler.js +620 -0
- package/dist/engine/dsl/compiler.js.map +1 -0
- package/dist/engine/dsl/parser.d.ts +19 -0
- package/dist/engine/dsl/parser.d.ts.map +1 -0
- package/dist/engine/dsl/parser.js +174 -0
- package/dist/engine/dsl/parser.js.map +1 -0
- package/dist/engine/dsl/runtime.d.ts +46 -0
- package/dist/engine/dsl/runtime.d.ts.map +1 -0
- package/dist/engine/dsl/runtime.js +173 -0
- package/dist/engine/dsl/runtime.js.map +1 -0
- package/dist/engine/dsl/types.d.ts +113 -0
- package/dist/engine/dsl/types.d.ts.map +1 -0
- package/dist/engine/dsl/types.js +11 -0
- package/dist/engine/dsl/types.js.map +1 -0
- package/dist/engine/evidence-store.d.ts +44 -0
- package/dist/engine/evidence-store.d.ts.map +1 -0
- package/dist/engine/evidence-store.js +106 -0
- package/dist/engine/evidence-store.js.map +1 -0
- package/dist/engine/rule-engine.d.ts +28 -0
- package/dist/engine/rule-engine.d.ts.map +1 -0
- package/dist/engine/rule-engine.js +196 -0
- package/dist/engine/rule-engine.js.map +1 -0
- package/dist/intelligence/classifier.d.ts +27 -0
- package/dist/intelligence/classifier.d.ts.map +1 -0
- package/dist/intelligence/classifier.js +142 -0
- package/dist/intelligence/classifier.js.map +1 -0
- package/dist/intelligence/distiller.d.ts +22 -0
- package/dist/intelligence/distiller.d.ts.map +1 -0
- package/dist/intelligence/distiller.js +108 -0
- package/dist/intelligence/distiller.js.map +1 -0
- package/dist/intelligence/quality-gate.d.ts +43 -0
- package/dist/intelligence/quality-gate.d.ts.map +1 -0
- package/dist/intelligence/quality-gate.js +168 -0
- package/dist/intelligence/quality-gate.js.map +1 -0
- package/dist/skills/index.d.ts +3 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +3 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/matcher.d.ts +10 -0
- package/dist/skills/matcher.d.ts.map +1 -0
- package/dist/skills/matcher.js +14 -0
- package/dist/skills/matcher.js.map +1 -0
- package/dist/skills/official-skills.d.ts +22 -0
- package/dist/skills/official-skills.d.ts.map +1 -0
- package/dist/skills/official-skills.js +531 -0
- package/dist/skills/official-skills.js.map +1 -0
- package/dist/skills/registry.d.ts +31 -0
- package/dist/skills/registry.d.ts.map +1 -0
- package/dist/skills/registry.js +100 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/web/server.d.ts +9 -8
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +40 -231
- package/dist/web/server.js.map +1 -1
- package/dist/web/static/index.html +140 -0
- package/package.json +3 -26
- package/dist/ai/base-provider.d.ts +0 -48
- package/dist/ai/base-provider.d.ts.map +0 -1
- package/dist/ai/base-provider.js +0 -173
- package/dist/ai/base-provider.js.map +0 -1
- package/dist/ai/factory.d.ts +0 -16
- package/dist/ai/factory.d.ts.map +0 -1
- package/dist/ai/factory.js +0 -22
- package/dist/ai/factory.js.map +0 -1
- package/dist/ai/index.d.ts +0 -40
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -153
- package/dist/ai/index.js.map +0 -1
- package/dist/ai/model-selector.d.ts +0 -24
- package/dist/ai/model-selector.d.ts.map +0 -1
- package/dist/ai/model-selector.js +0 -91
- package/dist/ai/model-selector.js.map +0 -1
- package/dist/ai/ollama-provider.d.ts +0 -20
- package/dist/ai/ollama-provider.d.ts.map +0 -1
- package/dist/ai/ollama-provider.js +0 -47
- package/dist/ai/ollama-provider.js.map +0 -1
- package/dist/ai/openai-provider.d.ts +0 -21
- package/dist/ai/openai-provider.d.ts.map +0 -1
- package/dist/ai/openai-provider.js +0 -53
- package/dist/ai/openai-provider.js.map +0 -1
- package/dist/ai/rate-limiter.d.ts +0 -33
- package/dist/ai/rate-limiter.d.ts.map +0 -1
- package/dist/ai/rate-limiter.js +0 -83
- package/dist/ai/rate-limiter.js.map +0 -1
- package/dist/ai/response-cache.d.ts +0 -24
- package/dist/ai/response-cache.d.ts.map +0 -1
- package/dist/ai/response-cache.js +0 -86
- package/dist/ai/response-cache.js.map +0 -1
- package/dist/ai/token-budget.d.ts +0 -83
- package/dist/ai/token-budget.d.ts.map +0 -1
- package/dist/ai/token-budget.js +0 -171
- package/dist/ai/token-budget.js.map +0 -1
- package/dist/ai/types.d.ts +0 -58
- package/dist/ai/types.d.ts.map +0 -1
- package/dist/ai/types.js +0 -23
- package/dist/ai/types.js.map +0 -1
- package/dist/autopilot/ground-truth-rules.d.ts +0 -64
- package/dist/autopilot/ground-truth-rules.d.ts.map +0 -1
- package/dist/autopilot/ground-truth-rules.js +0 -129
- package/dist/autopilot/ground-truth-rules.js.map +0 -1
- package/dist/autopilot/index.d.ts +0 -2
- package/dist/autopilot/index.d.ts.map +0 -1
- package/dist/autopilot/index.js +0 -2
- package/dist/autopilot/index.js.map +0 -1
- package/dist/autopilot/issue-tracker.d.ts +0 -52
- package/dist/autopilot/issue-tracker.d.ts.map +0 -1
- package/dist/autopilot/issue-tracker.js +0 -138
- package/dist/autopilot/issue-tracker.js.map +0 -1
- package/dist/autopilot/phase-gap-detector.d.ts +0 -26
- package/dist/autopilot/phase-gap-detector.d.ts.map +0 -1
- package/dist/autopilot/phase-gap-detector.js +0 -80
- package/dist/autopilot/phase-gap-detector.js.map +0 -1
- package/dist/autopilot/quality-gate-utils.d.ts +0 -6
- package/dist/autopilot/quality-gate-utils.d.ts.map +0 -1
- package/dist/autopilot/quality-gate-utils.js +0 -48
- package/dist/autopilot/quality-gate-utils.js.map +0 -1
- package/dist/autopilot/quality-gate.d.ts +0 -187
- package/dist/autopilot/quality-gate.d.ts.map +0 -1
- package/dist/autopilot/quality-gate.js +0 -815
- package/dist/autopilot/quality-gate.js.map +0 -1
- package/dist/autopilot/rule-distiller.d.ts +0 -44
- package/dist/autopilot/rule-distiller.d.ts.map +0 -1
- package/dist/autopilot/rule-distiller.js +0 -176
- package/dist/autopilot/rule-distiller.js.map +0 -1
- package/dist/autopilot/task-completion-detector.d.ts +0 -32
- package/dist/autopilot/task-completion-detector.d.ts.map +0 -1
- package/dist/autopilot/task-completion-detector.js +0 -116
- package/dist/autopilot/task-completion-detector.js.map +0 -1
- package/dist/backup/index.d.ts +0 -16
- package/dist/backup/index.d.ts.map +0 -1
- package/dist/backup/index.js +0 -170
- package/dist/backup/index.js.map +0 -1
- package/dist/claudemd/detector.d.ts +0 -55
- package/dist/claudemd/detector.d.ts.map +0 -1
- package/dist/claudemd/detector.js +0 -588
- package/dist/claudemd/detector.js.map +0 -1
- package/dist/claudemd/modules-config.d.ts +0 -37
- package/dist/claudemd/modules-config.d.ts.map +0 -1
- package/dist/claudemd/modules-config.js +0 -80
- package/dist/claudemd/modules-config.js.map +0 -1
- package/dist/claudemd/prompt-injector.d.ts +0 -29
- package/dist/claudemd/prompt-injector.d.ts.map +0 -1
- package/dist/claudemd/prompt-injector.js +0 -143
- package/dist/claudemd/prompt-injector.js.map +0 -1
- package/dist/claudemd/prompts.d.ts +0 -19
- package/dist/claudemd/prompts.d.ts.map +0 -1
- package/dist/claudemd/prompts.js +0 -476
- package/dist/claudemd/prompts.js.map +0 -1
- package/dist/claudemd/writer.d.ts +0 -48
- package/dist/claudemd/writer.d.ts.map +0 -1
- package/dist/claudemd/writer.js +0 -205
- package/dist/claudemd/writer.js.map +0 -1
- package/dist/cli/commands/backup.d.ts +0 -3
- package/dist/cli/commands/backup.d.ts.map +0 -1
- package/dist/cli/commands/backup.js +0 -102
- package/dist/cli/commands/backup.js.map +0 -1
- package/dist/cli/commands/convention.d.ts +0 -3
- package/dist/cli/commands/convention.d.ts.map +0 -1
- package/dist/cli/commands/convention.js +0 -169
- package/dist/cli/commands/convention.js.map +0 -1
- package/dist/cli/commands/distill.d.ts +0 -3
- package/dist/cli/commands/distill.d.ts.map +0 -1
- package/dist/cli/commands/distill.js +0 -57
- package/dist/cli/commands/distill.js.map +0 -1
- package/dist/cli/commands/init/doctor.d.ts +0 -23
- package/dist/cli/commands/init/doctor.d.ts.map +0 -1
- package/dist/cli/commands/init/doctor.js +0 -217
- package/dist/cli/commands/init/doctor.js.map +0 -1
- package/dist/cli/commands/init/hook-manager.d.ts +0 -30
- package/dist/cli/commands/init/hook-manager.d.ts.map +0 -1
- package/dist/cli/commands/init/hook-manager.js +0 -189
- package/dist/cli/commands/init/hook-manager.js.map +0 -1
- package/dist/cli/commands/init/index.d.ts +0 -5
- package/dist/cli/commands/init/index.d.ts.map +0 -1
- package/dist/cli/commands/init/index.js +0 -147
- package/dist/cli/commands/init/index.js.map +0 -1
- package/dist/cli/commands/init/project-doctor.d.ts +0 -15
- package/dist/cli/commands/init/project-doctor.d.ts.map +0 -1
- package/dist/cli/commands/init/project-doctor.js +0 -375
- package/dist/cli/commands/init/project-doctor.js.map +0 -1
- package/dist/cli/commands/logs.d.ts +0 -3
- package/dist/cli/commands/logs.d.ts.map +0 -1
- package/dist/cli/commands/logs.js +0 -520
- package/dist/cli/commands/logs.js.map +0 -1
- package/dist/cli/commands/pattern.d.ts +0 -3
- package/dist/cli/commands/pattern.d.ts.map +0 -1
- package/dist/cli/commands/pattern.js +0 -129
- package/dist/cli/commands/pattern.js.map +0 -1
- package/dist/cli/commands/pipeline.d.ts +0 -3
- package/dist/cli/commands/pipeline.d.ts.map +0 -1
- package/dist/cli/commands/pipeline.js +0 -123
- package/dist/cli/commands/pipeline.js.map +0 -1
- package/dist/cli/commands/project.d.ts +0 -3
- package/dist/cli/commands/project.d.ts.map +0 -1
- package/dist/cli/commands/project.js +0 -72
- package/dist/cli/commands/project.js.map +0 -1
- package/dist/cli/commands/query.d.ts +0 -3
- package/dist/cli/commands/query.d.ts.map +0 -1
- package/dist/cli/commands/query.js +0 -231
- package/dist/cli/commands/query.js.map +0 -1
- package/dist/cli/commands/skill.d.ts +0 -3
- package/dist/cli/commands/skill.d.ts.map +0 -1
- package/dist/cli/commands/skill.js +0 -531
- package/dist/cli/commands/skill.js.map +0 -1
- package/dist/cli/commands/web.d.ts +0 -3
- package/dist/cli/commands/web.d.ts.map +0 -1
- package/dist/cli/commands/web.js +0 -37
- package/dist/cli/commands/web.js.map +0 -1
- package/dist/cli/tui.d.ts +0 -2
- package/dist/cli/tui.d.ts.map +0 -1
- package/dist/cli/tui.js +0 -333
- package/dist/cli/tui.js.map +0 -1
- package/dist/cli/utils/errors.d.ts +0 -17
- package/dist/cli/utils/errors.d.ts.map +0 -1
- package/dist/cli/utils/errors.js +0 -42
- package/dist/cli/utils/errors.js.map +0 -1
- package/dist/cli/utils/output.d.ts +0 -23
- package/dist/cli/utils/output.d.ts.map +0 -1
- package/dist/cli/utils/output.js +0 -98
- package/dist/cli/utils/output.js.map +0 -1
- package/dist/config/defaults.d.ts +0 -3
- package/dist/config/defaults.d.ts.map +0 -1
- package/dist/config/defaults.js +0 -72
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/index.d.ts +0 -25
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -161
- package/dist/config/index.js.map +0 -1
- package/dist/config/schema.d.ts +0 -87
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -129
- package/dist/config/schema.js.map +0 -1
- package/dist/constants.d.ts +0 -406
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -448
- package/dist/constants.js.map +0 -1
- package/dist/convention/convention-evolver.d.ts +0 -31
- package/dist/convention/convention-evolver.d.ts.map +0 -1
- package/dist/convention/convention-evolver.js +0 -175
- package/dist/convention/convention-evolver.js.map +0 -1
- package/dist/convention/convention-loader.d.ts +0 -22
- package/dist/convention/convention-loader.d.ts.map +0 -1
- package/dist/convention/convention-loader.js +0 -184
- package/dist/convention/convention-loader.js.map +0 -1
- package/dist/convention/convention-manager.d.ts +0 -84
- package/dist/convention/convention-manager.d.ts.map +0 -1
- package/dist/convention/convention-manager.js +0 -305
- package/dist/convention/convention-manager.js.map +0 -1
- package/dist/convention/index.d.ts +0 -5
- package/dist/convention/index.d.ts.map +0 -1
- package/dist/convention/index.js +0 -4
- package/dist/convention/index.js.map +0 -1
- package/dist/convention/types.d.ts +0 -226
- package/dist/convention/types.d.ts.map +0 -1
- package/dist/convention/types.js +0 -13
- package/dist/convention/types.js.map +0 -1
- package/dist/daemon/context-injector.d.ts +0 -41
- package/dist/daemon/context-injector.d.ts.map +0 -1
- package/dist/daemon/context-injector.js +0 -100
- package/dist/daemon/context-injector.js.map +0 -1
- package/dist/daemon/engine-registry/init-autopilot.d.ts +0 -11
- package/dist/daemon/engine-registry/init-autopilot.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-autopilot.js +0 -17
- package/dist/daemon/engine-registry/init-autopilot.js.map +0 -1
- package/dist/daemon/engine-registry/init-distill.d.ts +0 -6
- package/dist/daemon/engine-registry/init-distill.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-distill.js +0 -34
- package/dist/daemon/engine-registry/init-distill.js.map +0 -1
- package/dist/daemon/engine-registry/init-governance.d.ts +0 -10
- package/dist/daemon/engine-registry/init-governance.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-governance.js +0 -22
- package/dist/daemon/engine-registry/init-governance.js.map +0 -1
- package/dist/daemon/engine-registry/init-orchestration.d.ts +0 -5
- package/dist/daemon/engine-registry/init-orchestration.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-orchestration.js +0 -13
- package/dist/daemon/engine-registry/init-orchestration.js.map +0 -1
- package/dist/daemon/engine-registry/init-pipeline.d.ts +0 -7
- package/dist/daemon/engine-registry/init-pipeline.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-pipeline.js +0 -16
- package/dist/daemon/engine-registry/init-pipeline.js.map +0 -1
- package/dist/daemon/engine-registry/init-resume.d.ts +0 -6
- package/dist/daemon/engine-registry/init-resume.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-resume.js +0 -20
- package/dist/daemon/engine-registry/init-resume.js.map +0 -1
- package/dist/daemon/engine-registry/init-skill-registry.d.ts +0 -10
- package/dist/daemon/engine-registry/init-skill-registry.d.ts.map +0 -1
- package/dist/daemon/engine-registry/init-skill-registry.js +0 -47
- package/dist/daemon/engine-registry/init-skill-registry.js.map +0 -1
- package/dist/daemon/engine-registry.d.ts +0 -13
- package/dist/daemon/engine-registry.d.ts.map +0 -1
- package/dist/daemon/engine-registry.js +0 -105
- package/dist/daemon/engine-registry.js.map +0 -1
- package/dist/daemon/handler-context.d.ts +0 -59
- package/dist/daemon/handler-context.d.ts.map +0 -1
- package/dist/daemon/handler-context.js +0 -2
- package/dist/daemon/handler-context.js.map +0 -1
- package/dist/daemon/handlers/base-handler.d.ts +0 -14
- package/dist/daemon/handlers/base-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/base-handler.js +0 -18
- package/dist/daemon/handlers/base-handler.js.map +0 -1
- package/dist/daemon/handlers/context-builder.d.ts +0 -45
- package/dist/daemon/handlers/context-builder.d.ts.map +0 -1
- package/dist/daemon/handlers/context-builder.js +0 -363
- package/dist/daemon/handlers/context-builder.js.map +0 -1
- package/dist/daemon/handlers/conversational-config-handler.d.ts +0 -24
- package/dist/daemon/handlers/conversational-config-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/conversational-config-handler.js +0 -177
- package/dist/daemon/handlers/conversational-config-handler.js.map +0 -1
- package/dist/daemon/handlers/orchestration-context.d.ts +0 -39
- package/dist/daemon/handlers/orchestration-context.d.ts.map +0 -1
- package/dist/daemon/handlers/orchestration-context.js +0 -2
- package/dist/daemon/handlers/orchestration-context.js.map +0 -1
- package/dist/daemon/handlers/post-tool-use-handler.d.ts +0 -11
- package/dist/daemon/handlers/post-tool-use-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/post-tool-use-handler.js +0 -308
- package/dist/daemon/handlers/post-tool-use-handler.js.map +0 -1
- package/dist/daemon/handlers/pre-tool-use-handler.d.ts +0 -11
- package/dist/daemon/handlers/pre-tool-use-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/pre-tool-use-handler.js +0 -175
- package/dist/daemon/handlers/pre-tool-use-handler.js.map +0 -1
- package/dist/daemon/handlers/safe-handler.d.ts +0 -15
- package/dist/daemon/handlers/safe-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/safe-handler.js +0 -24
- package/dist/daemon/handlers/safe-handler.js.map +0 -1
- package/dist/daemon/handlers/session-cleanup.d.ts +0 -41
- package/dist/daemon/handlers/session-cleanup.d.ts.map +0 -1
- package/dist/daemon/handlers/session-cleanup.js +0 -392
- package/dist/daemon/handlers/session-cleanup.js.map +0 -1
- package/dist/daemon/handlers/stages/01-failure-signal.d.ts +0 -9
- package/dist/daemon/handlers/stages/01-failure-signal.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/01-failure-signal.js +0 -40
- package/dist/daemon/handlers/stages/01-failure-signal.js.map +0 -1
- package/dist/daemon/handlers/stages/02-active-intervention.d.ts +0 -9
- package/dist/daemon/handlers/stages/02-active-intervention.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/02-active-intervention.js +0 -28
- package/dist/daemon/handlers/stages/02-active-intervention.js.map +0 -1
- package/dist/daemon/handlers/stages/03-init-prompt.d.ts +0 -9
- package/dist/daemon/handlers/stages/03-init-prompt.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/03-init-prompt.js +0 -24
- package/dist/daemon/handlers/stages/03-init-prompt.js.map +0 -1
- package/dist/daemon/handlers/stages/04-skill-suggestions.d.ts +0 -9
- package/dist/daemon/handlers/stages/04-skill-suggestions.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/04-skill-suggestions.js +0 -24
- package/dist/daemon/handlers/stages/04-skill-suggestions.js.map +0 -1
- package/dist/daemon/handlers/stages/05-conv-config.d.ts +0 -11
- package/dist/daemon/handlers/stages/05-conv-config.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/05-conv-config.js +0 -24
- package/dist/daemon/handlers/stages/05-conv-config.js.map +0 -1
- package/dist/daemon/handlers/stages/06-engine-check.d.ts +0 -9
- package/dist/daemon/handlers/stages/06-engine-check.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/06-engine-check.js +0 -14
- package/dist/daemon/handlers/stages/06-engine-check.js.map +0 -1
- package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts +0 -10
- package/dist/daemon/handlers/stages/07-pipeline-reply.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/07-pipeline-reply.js +0 -60
- package/dist/daemon/handlers/stages/07-pipeline-reply.js.map +0 -1
- package/dist/daemon/handlers/stages/08-esc-interrupt.d.ts +0 -9
- package/dist/daemon/handlers/stages/08-esc-interrupt.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/08-esc-interrupt.js +0 -29
- package/dist/daemon/handlers/stages/08-esc-interrupt.js.map +0 -1
- package/dist/daemon/handlers/stages/09-pipeline-active.d.ts +0 -11
- package/dist/daemon/handlers/stages/09-pipeline-active.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/09-pipeline-active.js +0 -75
- package/dist/daemon/handlers/stages/09-pipeline-active.js.map +0 -1
- package/dist/daemon/handlers/stages/10-cooldown.d.ts +0 -9
- package/dist/daemon/handlers/stages/10-cooldown.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/10-cooldown.js +0 -27
- package/dist/daemon/handlers/stages/10-cooldown.js.map +0 -1
- package/dist/daemon/handlers/stages/11-intent-analysis.d.ts +0 -12
- package/dist/daemon/handlers/stages/11-intent-analysis.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/11-intent-analysis.js +0 -88
- package/dist/daemon/handlers/stages/11-intent-analysis.js.map +0 -1
- package/dist/daemon/handlers/stages/12-strategy-advice.d.ts +0 -9
- package/dist/daemon/handlers/stages/12-strategy-advice.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/12-strategy-advice.js +0 -23
- package/dist/daemon/handlers/stages/12-strategy-advice.js.map +0 -1
- package/dist/daemon/handlers/stages/13-template-route.d.ts +0 -9
- package/dist/daemon/handlers/stages/13-template-route.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/13-template-route.js +0 -49
- package/dist/daemon/handlers/stages/13-template-route.js.map +0 -1
- package/dist/daemon/handlers/stages/14-plan-resume.d.ts +0 -9
- package/dist/daemon/handlers/stages/14-plan-resume.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/14-plan-resume.js +0 -47
- package/dist/daemon/handlers/stages/14-plan-resume.js.map +0 -1
- package/dist/daemon/handlers/stages/15-plan-enforcement.d.ts +0 -9
- package/dist/daemon/handlers/stages/15-plan-enforcement.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/15-plan-enforcement.js +0 -42
- package/dist/daemon/handlers/stages/15-plan-enforcement.js.map +0 -1
- package/dist/daemon/handlers/stages/17-simple-task.d.ts +0 -9
- package/dist/daemon/handlers/stages/17-simple-task.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/17-simple-task.js +0 -33
- package/dist/daemon/handlers/stages/17-simple-task.js.map +0 -1
- package/dist/daemon/handlers/stages/18-complex-task.d.ts +0 -15
- package/dist/daemon/handlers/stages/18-complex-task.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/18-complex-task.js +0 -161
- package/dist/daemon/handlers/stages/18-complex-task.js.map +0 -1
- package/dist/daemon/handlers/stages/stage-interface.d.ts +0 -32
- package/dist/daemon/handlers/stages/stage-interface.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/stage-interface.js +0 -2
- package/dist/daemon/handlers/stages/stage-interface.js.map +0 -1
- package/dist/daemon/handlers/stages/stage-scheduler.d.ts +0 -27
- package/dist/daemon/handlers/stages/stage-scheduler.d.ts.map +0 -1
- package/dist/daemon/handlers/stages/stage-scheduler.js +0 -105
- package/dist/daemon/handlers/stages/stage-scheduler.js.map +0 -1
- package/dist/daemon/handlers/stop-handler.d.ts +0 -18
- package/dist/daemon/handlers/stop-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/stop-handler.js +0 -274
- package/dist/daemon/handlers/stop-handler.js.map +0 -1
- package/dist/daemon/handlers/user-prompt-handler.d.ts +0 -34
- package/dist/daemon/handlers/user-prompt-handler.d.ts.map +0 -1
- package/dist/daemon/handlers/user-prompt-handler.js +0 -230
- package/dist/daemon/handlers/user-prompt-handler.js.map +0 -1
- package/dist/daemon/pending-prompts.d.ts +0 -31
- package/dist/daemon/pending-prompts.d.ts.map +0 -1
- package/dist/daemon/pending-prompts.js +0 -57
- package/dist/daemon/pending-prompts.js.map +0 -1
- package/dist/daemon/tool-summary.d.ts +0 -10
- package/dist/daemon/tool-summary.d.ts.map +0 -1
- package/dist/daemon/tool-summary.js +0 -68
- package/dist/daemon/tool-summary.js.map +0 -1
- package/dist/distill/index.d.ts +0 -26
- package/dist/distill/index.d.ts.map +0 -1
- package/dist/distill/index.js +0 -155
- package/dist/distill/index.js.map +0 -1
- package/dist/distill/prompts.d.ts +0 -7
- package/dist/distill/prompts.d.ts.map +0 -1
- package/dist/distill/prompts.js +0 -100
- package/dist/distill/prompts.js.map +0 -1
- package/dist/distill/tree-index.d.ts +0 -40
- package/dist/distill/tree-index.d.ts.map +0 -1
- package/dist/distill/tree-index.js +0 -254
- package/dist/distill/tree-index.js.map +0 -1
- package/dist/distill/trigger.d.ts +0 -49
- package/dist/distill/trigger.d.ts.map +0 -1
- package/dist/distill/trigger.js +0 -182
- package/dist/distill/trigger.js.map +0 -1
- package/dist/distill/writer.d.ts +0 -43
- package/dist/distill/writer.d.ts.map +0 -1
- package/dist/distill/writer.js +0 -210
- package/dist/distill/writer.js.map +0 -1
- package/dist/goal/goal-classifier.d.ts +0 -38
- package/dist/goal/goal-classifier.d.ts.map +0 -1
- package/dist/goal/goal-classifier.js +0 -475
- package/dist/goal/goal-classifier.js.map +0 -1
- package/dist/goal/goal-decomposer.d.ts +0 -45
- package/dist/goal/goal-decomposer.d.ts.map +0 -1
- package/dist/goal/goal-decomposer.js +0 -326
- package/dist/goal/goal-decomposer.js.map +0 -1
- package/dist/goal/goal-planner.d.ts +0 -17
- package/dist/goal/goal-planner.d.ts.map +0 -1
- package/dist/goal/goal-planner.js +0 -149
- package/dist/goal/goal-planner.js.map +0 -1
- package/dist/goal/goal-types.d.ts +0 -93
- package/dist/goal/goal-types.d.ts.map +0 -1
- package/dist/goal/goal-types.js +0 -8
- package/dist/goal/goal-types.js.map +0 -1
- package/dist/goal/index.d.ts +0 -5
- package/dist/goal/index.d.ts.map +0 -1
- package/dist/goal/index.js +0 -4
- package/dist/goal/index.js.map +0 -1
- package/dist/governance/contract-builder.d.ts +0 -39
- package/dist/governance/contract-builder.d.ts.map +0 -1
- package/dist/governance/contract-builder.js +0 -216
- package/dist/governance/contract-builder.js.map +0 -1
- package/dist/governance/engine.d.ts +0 -33
- package/dist/governance/engine.d.ts.map +0 -1
- package/dist/governance/engine.js +0 -183
- package/dist/governance/engine.js.map +0 -1
- package/dist/governance/evidence-collector.d.ts +0 -42
- package/dist/governance/evidence-collector.d.ts.map +0 -1
- package/dist/governance/evidence-collector.js +0 -136
- package/dist/governance/evidence-collector.js.map +0 -1
- package/dist/governance/plugins/correction-plugin.d.ts +0 -20
- package/dist/governance/plugins/correction-plugin.d.ts.map +0 -1
- package/dist/governance/plugins/correction-plugin.js +0 -113
- package/dist/governance/plugins/correction-plugin.js.map +0 -1
- package/dist/governance/plugins/guidance-plugin.d.ts +0 -21
- package/dist/governance/plugins/guidance-plugin.d.ts.map +0 -1
- package/dist/governance/plugins/guidance-plugin.js +0 -69
- package/dist/governance/plugins/guidance-plugin.js.map +0 -1
- package/dist/governance/plugins/memory-plugin.d.ts +0 -22
- package/dist/governance/plugins/memory-plugin.d.ts.map +0 -1
- package/dist/governance/plugins/memory-plugin.js +0 -106
- package/dist/governance/plugins/memory-plugin.js.map +0 -1
- package/dist/governance/plugins/policy-plugin.d.ts +0 -16
- package/dist/governance/plugins/policy-plugin.d.ts.map +0 -1
- package/dist/governance/plugins/policy-plugin.js +0 -69
- package/dist/governance/plugins/policy-plugin.js.map +0 -1
- package/dist/governance/plugins/verification-plugin.d.ts +0 -15
- package/dist/governance/plugins/verification-plugin.d.ts.map +0 -1
- package/dist/governance/plugins/verification-plugin.js +0 -65
- package/dist/governance/plugins/verification-plugin.js.map +0 -1
- package/dist/governance/types.d.ts +0 -202
- package/dist/governance/types.d.ts.map +0 -1
- package/dist/governance/types.js +0 -10
- package/dist/governance/types.js.map +0 -1
- package/dist/knowledge/graph.d.ts +0 -101
- package/dist/knowledge/graph.d.ts.map +0 -1
- package/dist/knowledge/graph.js +0 -338
- package/dist/knowledge/graph.js.map +0 -1
- package/dist/orchestration/index.d.ts +0 -32
- package/dist/orchestration/index.d.ts.map +0 -1
- package/dist/orchestration/index.js +0 -74
- package/dist/orchestration/index.js.map +0 -1
- package/dist/orchestration/notifier.d.ts +0 -11
- package/dist/orchestration/notifier.d.ts.map +0 -1
- package/dist/orchestration/notifier.js +0 -22
- package/dist/orchestration/notifier.js.map +0 -1
- package/dist/orchestration/policy-engine.d.ts +0 -21
- package/dist/orchestration/policy-engine.d.ts.map +0 -1
- package/dist/orchestration/policy-engine.js +0 -78
- package/dist/orchestration/policy-engine.js.map +0 -1
- package/dist/orchestration/tracker.d.ts +0 -45
- package/dist/orchestration/tracker.d.ts.map +0 -1
- package/dist/orchestration/tracker.js +0 -95
- package/dist/orchestration/tracker.js.map +0 -1
- package/dist/pipeline/artifact-collector.d.ts +0 -31
- package/dist/pipeline/artifact-collector.d.ts.map +0 -1
- package/dist/pipeline/artifact-collector.js +0 -134
- package/dist/pipeline/artifact-collector.js.map +0 -1
- package/dist/pipeline/artifact-generator.d.ts +0 -36
- package/dist/pipeline/artifact-generator.d.ts.map +0 -1
- package/dist/pipeline/artifact-generator.js +0 -564
- package/dist/pipeline/artifact-generator.js.map +0 -1
- package/dist/pipeline/artifact-orchestrator.d.ts +0 -22
- package/dist/pipeline/artifact-orchestrator.d.ts.map +0 -1
- package/dist/pipeline/artifact-orchestrator.js +0 -110
- package/dist/pipeline/artifact-orchestrator.js.map +0 -1
- package/dist/pipeline/artifact-validator.d.ts +0 -37
- package/dist/pipeline/artifact-validator.d.ts.map +0 -1
- package/dist/pipeline/artifact-validator.js +0 -160
- package/dist/pipeline/artifact-validator.js.map +0 -1
- package/dist/pipeline/completion-detector.d.ts +0 -57
- package/dist/pipeline/completion-detector.d.ts.map +0 -1
- package/dist/pipeline/completion-detector.js +0 -190
- package/dist/pipeline/completion-detector.js.map +0 -1
- package/dist/pipeline/completion-engine.d.ts +0 -37
- package/dist/pipeline/completion-engine.d.ts.map +0 -1
- package/dist/pipeline/completion-engine.js +0 -146
- package/dist/pipeline/completion-engine.js.map +0 -1
- package/dist/pipeline/completion-gate.d.ts +0 -65
- package/dist/pipeline/completion-gate.d.ts.map +0 -1
- package/dist/pipeline/completion-gate.js +0 -303
- package/dist/pipeline/completion-gate.js.map +0 -1
- package/dist/pipeline/completion-verifier.d.ts +0 -83
- package/dist/pipeline/completion-verifier.d.ts.map +0 -1
- package/dist/pipeline/completion-verifier.js +0 -247
- package/dist/pipeline/completion-verifier.js.map +0 -1
- package/dist/pipeline/custom-node-type-store.d.ts +0 -12
- package/dist/pipeline/custom-node-type-store.d.ts.map +0 -1
- package/dist/pipeline/custom-node-type-store.js +0 -54
- package/dist/pipeline/custom-node-type-store.js.map +0 -1
- package/dist/pipeline/diagnosis-service.d.ts +0 -44
- package/dist/pipeline/diagnosis-service.d.ts.map +0 -1
- package/dist/pipeline/diagnosis-service.js +0 -136
- package/dist/pipeline/diagnosis-service.js.map +0 -1
- package/dist/pipeline/dynamic-node-executor.d.ts +0 -129
- package/dist/pipeline/dynamic-node-executor.d.ts.map +0 -1
- package/dist/pipeline/dynamic-node-executor.js +0 -536
- package/dist/pipeline/dynamic-node-executor.js.map +0 -1
- package/dist/pipeline/dynamic-node-types.d.ts +0 -133
- package/dist/pipeline/dynamic-node-types.d.ts.map +0 -1
- package/dist/pipeline/dynamic-node-types.js +0 -8
- package/dist/pipeline/dynamic-node-types.js.map +0 -1
- package/dist/pipeline/execution-engine.d.ts +0 -74
- package/dist/pipeline/execution-engine.d.ts.map +0 -1
- package/dist/pipeline/execution-engine.js +0 -346
- package/dist/pipeline/execution-engine.js.map +0 -1
- package/dist/pipeline/execution-plan.d.ts +0 -67
- package/dist/pipeline/execution-plan.d.ts.map +0 -1
- package/dist/pipeline/execution-plan.js +0 -61
- package/dist/pipeline/execution-plan.js.map +0 -1
- package/dist/pipeline/i-node-executor.d.ts +0 -84
- package/dist/pipeline/i-node-executor.d.ts.map +0 -1
- package/dist/pipeline/i-node-executor.js +0 -8
- package/dist/pipeline/i-node-executor.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -214
- package/dist/pipeline/index.d.ts.map +0 -1
- package/dist/pipeline/index.js +0 -728
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/node-runtime.d.ts +0 -43
- package/dist/pipeline/node-runtime.d.ts.map +0 -1
- package/dist/pipeline/node-runtime.js +0 -77
- package/dist/pipeline/node-runtime.js.map +0 -1
- package/dist/pipeline/node-type-evolver.d.ts +0 -18
- package/dist/pipeline/node-type-evolver.d.ts.map +0 -1
- package/dist/pipeline/node-type-evolver.js +0 -171
- package/dist/pipeline/node-type-evolver.js.map +0 -1
- package/dist/pipeline/node-type-registry.d.ts +0 -47
- package/dist/pipeline/node-type-registry.d.ts.map +0 -1
- package/dist/pipeline/node-type-registry.js +0 -494
- package/dist/pipeline/node-type-registry.js.map +0 -1
- package/dist/pipeline/node-type-sync.d.ts +0 -17
- package/dist/pipeline/node-type-sync.d.ts.map +0 -1
- package/dist/pipeline/node-type-sync.js +0 -127
- package/dist/pipeline/node-type-sync.js.map +0 -1
- package/dist/pipeline/orchestration-enforcer.d.ts +0 -44
- package/dist/pipeline/orchestration-enforcer.d.ts.map +0 -1
- package/dist/pipeline/orchestration-enforcer.js +0 -141
- package/dist/pipeline/orchestration-enforcer.js.map +0 -1
- package/dist/pipeline/pattern-types.d.ts +0 -148
- package/dist/pipeline/pattern-types.d.ts.map +0 -1
- package/dist/pipeline/pattern-types.js +0 -8
- package/dist/pipeline/pattern-types.js.map +0 -1
- package/dist/pipeline/phase-tool-policy.d.ts +0 -20
- package/dist/pipeline/phase-tool-policy.d.ts.map +0 -1
- package/dist/pipeline/phase-tool-policy.js +0 -75
- package/dist/pipeline/phase-tool-policy.js.map +0 -1
- package/dist/pipeline/pipeline-options.d.ts +0 -19
- package/dist/pipeline/pipeline-options.d.ts.map +0 -1
- package/dist/pipeline/pipeline-options.js +0 -136
- package/dist/pipeline/pipeline-options.js.map +0 -1
- package/dist/pipeline/pipeline-state-machine.d.ts +0 -19
- package/dist/pipeline/pipeline-state-machine.d.ts.map +0 -1
- package/dist/pipeline/pipeline-state-machine.js +0 -53
- package/dist/pipeline/pipeline-state-machine.js.map +0 -1
- package/dist/pipeline/plan-service.d.ts +0 -59
- package/dist/pipeline/plan-service.d.ts.map +0 -1
- package/dist/pipeline/plan-service.js +0 -451
- package/dist/pipeline/plan-service.js.map +0 -1
- package/dist/pipeline/report-generator.d.ts +0 -20
- package/dist/pipeline/report-generator.d.ts.map +0 -1
- package/dist/pipeline/report-generator.js +0 -123
- package/dist/pipeline/report-generator.js.map +0 -1
- package/dist/pipeline/semantic-validator.d.ts +0 -53
- package/dist/pipeline/semantic-validator.d.ts.map +0 -1
- package/dist/pipeline/semantic-validator.js +0 -188
- package/dist/pipeline/semantic-validator.js.map +0 -1
- package/dist/pipeline/step-gate-keeper.d.ts +0 -28
- package/dist/pipeline/step-gate-keeper.d.ts.map +0 -1
- package/dist/pipeline/step-gate-keeper.js +0 -46
- package/dist/pipeline/step-gate-keeper.js.map +0 -1
- package/dist/pipeline/step-orchestrator.d.ts +0 -71
- package/dist/pipeline/step-orchestrator.d.ts.map +0 -1
- package/dist/pipeline/step-orchestrator.js +0 -191
- package/dist/pipeline/step-orchestrator.js.map +0 -1
- package/dist/pipeline/step-prompt-builder.d.ts +0 -32
- package/dist/pipeline/step-prompt-builder.d.ts.map +0 -1
- package/dist/pipeline/step-prompt-builder.js +0 -111
- package/dist/pipeline/step-prompt-builder.js.map +0 -1
- package/dist/pipeline/step-types.d.ts +0 -141
- package/dist/pipeline/step-types.d.ts.map +0 -1
- package/dist/pipeline/step-types.js +0 -7
- package/dist/pipeline/step-types.js.map +0 -1
- package/dist/pipeline/step-validator.d.ts +0 -29
- package/dist/pipeline/step-validator.d.ts.map +0 -1
- package/dist/pipeline/step-validator.js +0 -172
- package/dist/pipeline/step-validator.js.map +0 -1
- package/dist/pipeline/strategy-selector.d.ts +0 -41
- package/dist/pipeline/strategy-selector.d.ts.map +0 -1
- package/dist/pipeline/strategy-selector.js +0 -112
- package/dist/pipeline/strategy-selector.js.map +0 -1
- package/dist/pipeline/template-evolver.d.ts +0 -45
- package/dist/pipeline/template-evolver.d.ts.map +0 -1
- package/dist/pipeline/template-evolver.js +0 -223
- package/dist/pipeline/template-evolver.js.map +0 -1
- package/dist/pipeline/template-registry.d.ts +0 -52
- package/dist/pipeline/template-registry.d.ts.map +0 -1
- package/dist/pipeline/template-registry.js +0 -588
- package/dist/pipeline/template-registry.js.map +0 -1
- package/dist/pipeline/template-router.d.ts +0 -32
- package/dist/pipeline/template-router.d.ts.map +0 -1
- package/dist/pipeline/template-router.js +0 -132
- package/dist/pipeline/template-router.js.map +0 -1
- package/dist/pipeline/template-sync.d.ts +0 -13
- package/dist/pipeline/template-sync.d.ts.map +0 -1
- package/dist/pipeline/template-sync.js +0 -246
- package/dist/pipeline/template-sync.js.map +0 -1
- package/dist/pipeline/types.d.ts +0 -93
- package/dist/pipeline/types.d.ts.map +0 -1
- package/dist/pipeline/types.js +0 -2
- package/dist/pipeline/types.js.map +0 -1
- package/dist/prompts/claudemd-distill.md +0 -31
- package/dist/prompts/distill-analysis.md +0 -25
- package/dist/prompts/intent-analysis.md +0 -135
- package/dist/prompts/pipeline-decompose.md +0 -108
- package/dist/prompts/quality-phase-completion.md +0 -36
- package/dist/prompts/quality-phase-review.md +0 -43
- package/dist/prompts/quality-review.md +0 -41
- package/dist/prompts/registry.d.ts +0 -17
- package/dist/prompts/registry.d.ts.map +0 -1
- package/dist/prompts/registry.js +0 -40
- package/dist/prompts/registry.js.map +0 -1
- package/dist/prompts/retrospective-pattern.md +0 -24
- package/dist/resume/context-gen.d.ts +0 -20
- package/dist/resume/context-gen.d.ts.map +0 -1
- package/dist/resume/context-gen.js +0 -130
- package/dist/resume/context-gen.js.map +0 -1
- package/dist/resume/index.d.ts +0 -33
- package/dist/resume/index.d.ts.map +0 -1
- package/dist/resume/index.js +0 -114
- package/dist/resume/index.js.map +0 -1
- package/dist/resume/state-machine.d.ts +0 -21
- package/dist/resume/state-machine.d.ts.map +0 -1
- package/dist/resume/state-machine.js +0 -58
- package/dist/resume/state-machine.js.map +0 -1
- package/dist/retrospective/failure-detector.d.ts +0 -17
- package/dist/retrospective/failure-detector.d.ts.map +0 -1
- package/dist/retrospective/failure-detector.js +0 -67
- package/dist/retrospective/failure-detector.js.map +0 -1
- package/dist/retrospective/index.d.ts +0 -77
- package/dist/retrospective/index.d.ts.map +0 -1
- package/dist/retrospective/index.js +0 -255
- package/dist/retrospective/index.js.map +0 -1
- package/dist/retrospective/metrics-extractor.d.ts +0 -27
- package/dist/retrospective/metrics-extractor.d.ts.map +0 -1
- package/dist/retrospective/metrics-extractor.js +0 -76
- package/dist/retrospective/metrics-extractor.js.map +0 -1
- package/dist/retrospective/pattern-learner.d.ts +0 -29
- package/dist/retrospective/pattern-learner.d.ts.map +0 -1
- package/dist/retrospective/pattern-learner.js +0 -149
- package/dist/retrospective/pattern-learner.js.map +0 -1
- package/dist/retrospective/report-writer.d.ts +0 -28
- package/dist/retrospective/report-writer.d.ts.map +0 -1
- package/dist/retrospective/report-writer.js +0 -95
- package/dist/retrospective/report-writer.js.map +0 -1
- package/dist/retrospective/satisfaction-inferrer.d.ts +0 -38
- package/dist/retrospective/satisfaction-inferrer.d.ts.map +0 -1
- package/dist/retrospective/satisfaction-inferrer.js +0 -137
- package/dist/retrospective/satisfaction-inferrer.js.map +0 -1
- package/dist/retrospective/strategy-advisor.d.ts +0 -23
- package/dist/retrospective/strategy-advisor.d.ts.map +0 -1
- package/dist/retrospective/strategy-advisor.js +0 -64
- package/dist/retrospective/strategy-advisor.js.map +0 -1
- package/dist/retrospective/types.d.ts +0 -105
- package/dist/retrospective/types.d.ts.map +0 -1
- package/dist/retrospective/types.js +0 -7
- package/dist/retrospective/types.js.map +0 -1
- package/dist/skill-registry/collector.d.ts +0 -75
- package/dist/skill-registry/collector.d.ts.map +0 -1
- package/dist/skill-registry/collector.js +0 -350
- package/dist/skill-registry/collector.js.map +0 -1
- package/dist/skill-registry/evolver/community-distiller.d.ts +0 -10
- package/dist/skill-registry/evolver/community-distiller.d.ts.map +0 -1
- package/dist/skill-registry/evolver/community-distiller.js +0 -117
- package/dist/skill-registry/evolver/community-distiller.js.map +0 -1
- package/dist/skill-registry/evolver/generation-engine.d.ts +0 -7
- package/dist/skill-registry/evolver/generation-engine.d.ts.map +0 -1
- package/dist/skill-registry/evolver/generation-engine.js +0 -71
- package/dist/skill-registry/evolver/generation-engine.js.map +0 -1
- package/dist/skill-registry/evolver/index.d.ts +0 -52
- package/dist/skill-registry/evolver/index.d.ts.map +0 -1
- package/dist/skill-registry/evolver/index.js +0 -196
- package/dist/skill-registry/evolver/index.js.map +0 -1
- package/dist/skill-registry/evolver/keyword-evolver.d.ts +0 -7
- package/dist/skill-registry/evolver/keyword-evolver.d.ts.map +0 -1
- package/dist/skill-registry/evolver/keyword-evolver.js +0 -117
- package/dist/skill-registry/evolver/keyword-evolver.js.map +0 -1
- package/dist/skill-registry/evolver/official-evolver.d.ts +0 -8
- package/dist/skill-registry/evolver/official-evolver.d.ts.map +0 -1
- package/dist/skill-registry/evolver/official-evolver.js +0 -79
- package/dist/skill-registry/evolver/official-evolver.js.map +0 -1
- package/dist/skill-registry/evolver/optimization-engine.d.ts +0 -7
- package/dist/skill-registry/evolver/optimization-engine.d.ts.map +0 -1
- package/dist/skill-registry/evolver/optimization-engine.js +0 -130
- package/dist/skill-registry/evolver/optimization-engine.js.map +0 -1
- package/dist/skill-registry/evolver/repair-engine.d.ts +0 -26
- package/dist/skill-registry/evolver/repair-engine.d.ts.map +0 -1
- package/dist/skill-registry/evolver/repair-engine.js +0 -247
- package/dist/skill-registry/evolver/repair-engine.js.map +0 -1
- package/dist/skill-registry/evolver/retirement-engine.d.ts +0 -7
- package/dist/skill-registry/evolver/retirement-engine.d.ts.map +0 -1
- package/dist/skill-registry/evolver/retirement-engine.js +0 -46
- package/dist/skill-registry/evolver/retirement-engine.js.map +0 -1
- package/dist/skill-registry/evolver/shared.d.ts +0 -18
- package/dist/skill-registry/evolver/shared.d.ts.map +0 -1
- package/dist/skill-registry/evolver/shared.js +0 -74
- package/dist/skill-registry/evolver/shared.js.map +0 -1
- package/dist/skill-registry/fuzzy-matcher.d.ts +0 -15
- package/dist/skill-registry/fuzzy-matcher.d.ts.map +0 -1
- package/dist/skill-registry/fuzzy-matcher.js +0 -41
- package/dist/skill-registry/fuzzy-matcher.js.map +0 -1
- package/dist/skill-registry/index.d.ts +0 -82
- package/dist/skill-registry/index.d.ts.map +0 -1
- package/dist/skill-registry/index.js +0 -219
- package/dist/skill-registry/index.js.map +0 -1
- package/dist/skill-registry/official-sync/index.d.ts +0 -17
- package/dist/skill-registry/official-sync/index.d.ts.map +0 -1
- package/dist/skill-registry/official-sync/index.js +0 -120
- package/dist/skill-registry/official-sync/index.js.map +0 -1
- package/dist/skill-registry/official-sync/skill-definitions.d.ts +0 -24
- package/dist/skill-registry/official-sync/skill-definitions.d.ts.map +0 -1
- package/dist/skill-registry/official-sync/skill-definitions.js +0 -1133
- package/dist/skill-registry/official-sync/skill-definitions.js.map +0 -1
- package/dist/skill-registry/orchestration-config.d.ts +0 -45
- package/dist/skill-registry/orchestration-config.d.ts.map +0 -1
- package/dist/skill-registry/orchestration-config.js +0 -145
- package/dist/skill-registry/orchestration-config.js.map +0 -1
- package/dist/skill-registry/orchestrator.d.ts +0 -61
- package/dist/skill-registry/orchestrator.d.ts.map +0 -1
- package/dist/skill-registry/orchestrator.js +0 -296
- package/dist/skill-registry/orchestrator.js.map +0 -1
- package/dist/skill-registry/pattern-evolver.d.ts +0 -43
- package/dist/skill-registry/pattern-evolver.d.ts.map +0 -1
- package/dist/skill-registry/pattern-evolver.js +0 -214
- package/dist/skill-registry/pattern-evolver.js.map +0 -1
- package/dist/skill-registry/project-learner.d.ts +0 -25
- package/dist/skill-registry/project-learner.d.ts.map +0 -1
- package/dist/skill-registry/project-learner.js +0 -176
- package/dist/skill-registry/project-learner.js.map +0 -1
- package/dist/skill-registry/registry.d.ts +0 -58
- package/dist/skill-registry/registry.d.ts.map +0 -1
- package/dist/skill-registry/registry.js +0 -190
- package/dist/skill-registry/registry.js.map +0 -1
- package/dist/skill-registry/scanner.d.ts +0 -36
- package/dist/skill-registry/scanner.d.ts.map +0 -1
- package/dist/skill-registry/scanner.js +0 -125
- package/dist/skill-registry/scanner.js.map +0 -1
- package/dist/skill-registry/skills-config.d.ts +0 -29
- package/dist/skill-registry/skills-config.d.ts.map +0 -1
- package/dist/skill-registry/skills-config.js +0 -86
- package/dist/skill-registry/skills-config.js.map +0 -1
- package/dist/storage/index.d.ts +0 -241
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -2
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/repositories/api-usage-repository.d.ts +0 -28
- package/dist/storage/repositories/api-usage-repository.d.ts.map +0 -1
- package/dist/storage/repositories/api-usage-repository.js +0 -59
- package/dist/storage/repositories/api-usage-repository.js.map +0 -1
- package/dist/storage/repositories/base-repository.d.ts +0 -14
- package/dist/storage/repositories/base-repository.d.ts.map +0 -1
- package/dist/storage/repositories/base-repository.js +0 -43
- package/dist/storage/repositories/base-repository.js.map +0 -1
- package/dist/storage/repositories/distill-repository.d.ts +0 -37
- package/dist/storage/repositories/distill-repository.d.ts.map +0 -1
- package/dist/storage/repositories/distill-repository.js +0 -91
- package/dist/storage/repositories/distill-repository.js.map +0 -1
- package/dist/storage/repositories/dynamic-pipeline-repository.d.ts +0 -91
- package/dist/storage/repositories/dynamic-pipeline-repository.d.ts.map +0 -1
- package/dist/storage/repositories/dynamic-pipeline-repository.js +0 -425
- package/dist/storage/repositories/dynamic-pipeline-repository.js.map +0 -1
- package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts +0 -13
- package/dist/storage/repositories/dynamic-pipeline-template-repository.d.ts.map +0 -1
- package/dist/storage/repositories/dynamic-pipeline-template-repository.js +0 -117
- package/dist/storage/repositories/dynamic-pipeline-template-repository.js.map +0 -1
- package/dist/storage/repositories/event-repository.d.ts +0 -14
- package/dist/storage/repositories/event-repository.d.ts.map +0 -1
- package/dist/storage/repositories/event-repository.js +0 -226
- package/dist/storage/repositories/event-repository.js.map +0 -1
- package/dist/storage/repositories/failure-repository.d.ts +0 -22
- package/dist/storage/repositories/failure-repository.d.ts.map +0 -1
- package/dist/storage/repositories/failure-repository.js +0 -26
- package/dist/storage/repositories/failure-repository.js.map +0 -1
- package/dist/storage/repositories/graph-traversal.d.ts +0 -37
- package/dist/storage/repositories/graph-traversal.d.ts.map +0 -1
- package/dist/storage/repositories/graph-traversal.js +0 -158
- package/dist/storage/repositories/graph-traversal.js.map +0 -1
- package/dist/storage/repositories/intent-rule-repository.d.ts +0 -20
- package/dist/storage/repositories/intent-rule-repository.d.ts.map +0 -1
- package/dist/storage/repositories/intent-rule-repository.js +0 -38
- package/dist/storage/repositories/intent-rule-repository.js.map +0 -1
- package/dist/storage/repositories/knowledge-repository.d.ts +0 -60
- package/dist/storage/repositories/knowledge-repository.d.ts.map +0 -1
- package/dist/storage/repositories/knowledge-repository.js +0 -131
- package/dist/storage/repositories/knowledge-repository.js.map +0 -1
- package/dist/storage/repositories/latency-repository.d.ts +0 -21
- package/dist/storage/repositories/latency-repository.d.ts.map +0 -1
- package/dist/storage/repositories/latency-repository.js +0 -39
- package/dist/storage/repositories/latency-repository.js.map +0 -1
- package/dist/storage/repositories/maintenance-repository.d.ts +0 -101
- package/dist/storage/repositories/maintenance-repository.d.ts.map +0 -1
- package/dist/storage/repositories/maintenance-repository.js +0 -372
- package/dist/storage/repositories/maintenance-repository.js.map +0 -1
- package/dist/storage/repositories/node-attempt-repository.d.ts +0 -29
- package/dist/storage/repositories/node-attempt-repository.d.ts.map +0 -1
- package/dist/storage/repositories/node-attempt-repository.js +0 -57
- package/dist/storage/repositories/node-attempt-repository.js.map +0 -1
- package/dist/storage/repositories/node-type-repository.d.ts +0 -52
- package/dist/storage/repositories/node-type-repository.d.ts.map +0 -1
- package/dist/storage/repositories/node-type-repository.js +0 -130
- package/dist/storage/repositories/node-type-repository.js.map +0 -1
- package/dist/storage/repositories/pipeline-plan-repository.d.ts +0 -75
- package/dist/storage/repositories/pipeline-plan-repository.d.ts.map +0 -1
- package/dist/storage/repositories/pipeline-plan-repository.js +0 -123
- package/dist/storage/repositories/pipeline-plan-repository.js.map +0 -1
- package/dist/storage/repositories/project-meta-repository.d.ts +0 -19
- package/dist/storage/repositories/project-meta-repository.d.ts.map +0 -1
- package/dist/storage/repositories/project-meta-repository.js +0 -46
- package/dist/storage/repositories/project-meta-repository.js.map +0 -1
- package/dist/storage/repositories/quality-repository.d.ts +0 -16
- package/dist/storage/repositories/quality-repository.d.ts.map +0 -1
- package/dist/storage/repositories/quality-repository.js +0 -36
- package/dist/storage/repositories/quality-repository.js.map +0 -1
- package/dist/storage/repositories/satisfaction-repository.d.ts +0 -21
- package/dist/storage/repositories/satisfaction-repository.d.ts.map +0 -1
- package/dist/storage/repositories/satisfaction-repository.js +0 -26
- package/dist/storage/repositories/satisfaction-repository.js.map +0 -1
- package/dist/storage/repositories/session-repository.d.ts +0 -24
- package/dist/storage/repositories/session-repository.d.ts.map +0 -1
- package/dist/storage/repositories/session-repository.js +0 -116
- package/dist/storage/repositories/session-repository.js.map +0 -1
- package/dist/storage/repositories/task-repository.d.ts +0 -99
- package/dist/storage/repositories/task-repository.d.ts.map +0 -1
- package/dist/storage/repositories/task-repository.js +0 -223
- package/dist/storage/repositories/task-repository.js.map +0 -1
- package/dist/storage/repositories/template-evolution-repository.d.ts +0 -39
- package/dist/storage/repositories/template-evolution-repository.d.ts.map +0 -1
- package/dist/storage/repositories/template-evolution-repository.js +0 -83
- package/dist/storage/repositories/template-evolution-repository.js.map +0 -1
- package/dist/storage/schema/migration-manager.d.ts +0 -15
- package/dist/storage/schema/migration-manager.d.ts.map +0 -1
- package/dist/storage/schema/migration-manager.js +0 -1000
- package/dist/storage/schema/migration-manager.js.map +0 -1
- package/dist/storage/sqlite.d.ts +0 -426
- package/dist/storage/sqlite.d.ts.map +0 -1
- package/dist/storage/sqlite.js +0 -525
- package/dist/storage/sqlite.js.map +0 -1
- package/dist/types/core-types.d.ts +0 -24
- package/dist/types/core-types.d.ts.map +0 -1
- package/dist/types/core-types.js +0 -37
- package/dist/types/core-types.js.map +0 -1
- package/dist/types/event.d.ts +0 -25
- package/dist/types/event.d.ts.map +0 -1
- package/dist/types/event.js +0 -2
- package/dist/types/event.js.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/session.d.ts +0 -14
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/session.js +0 -2
- package/dist/types/session.js.map +0 -1
- package/dist/utils/artifact-manager.d.ts +0 -60
- package/dist/utils/artifact-manager.d.ts.map +0 -1
- package/dist/utils/artifact-manager.js +0 -205
- package/dist/utils/artifact-manager.js.map +0 -1
- package/dist/utils/cache-registry.d.ts +0 -53
- package/dist/utils/cache-registry.d.ts.map +0 -1
- package/dist/utils/cache-registry.js +0 -93
- package/dist/utils/cache-registry.js.map +0 -1
- package/dist/utils/circuit-breaker.d.ts +0 -39
- package/dist/utils/circuit-breaker.d.ts.map +0 -1
- package/dist/utils/circuit-breaker.js +0 -101
- package/dist/utils/circuit-breaker.js.map +0 -1
- package/dist/utils/claude-api.d.ts +0 -31
- package/dist/utils/claude-api.d.ts.map +0 -1
- package/dist/utils/claude-api.js +0 -125
- package/dist/utils/claude-api.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -48
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -251
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/forge-resume-block.d.ts.map +0 -1
- package/dist/utils/forge-resume-block.js.map +0 -1
- package/dist/utils/formatter.d.ts +0 -71
- package/dist/utils/formatter.d.ts.map +0 -1
- package/dist/utils/formatter.js +0 -133
- package/dist/utils/formatter.js.map +0 -1
- package/dist/utils/latency-tracer.d.ts +0 -27
- package/dist/utils/latency-tracer.d.ts.map +0 -1
- package/dist/utils/latency-tracer.js +0 -64
- package/dist/utils/latency-tracer.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -33
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -173
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/memory-manager.d.ts +0 -58
- package/dist/utils/memory-manager.d.ts.map +0 -1
- package/dist/utils/memory-manager.js +0 -165
- package/dist/utils/memory-manager.js.map +0 -1
- package/dist/utils/mutex-lock.d.ts +0 -24
- package/dist/utils/mutex-lock.d.ts.map +0 -1
- package/dist/utils/mutex-lock.js +0 -55
- package/dist/utils/mutex-lock.js.map +0 -1
- package/dist/utils/path.d.ts +0 -6
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/path.js +0 -13
- package/dist/utils/path.js.map +0 -1
- package/dist/utils/pending-prompt-sink.d.ts +0 -14
- package/dist/utils/pending-prompt-sink.d.ts.map +0 -1
- package/dist/utils/pending-prompt-sink.js +0 -7
- package/dist/utils/pending-prompt-sink.js.map +0 -1
- package/dist/utils/plan-reader.d.ts +0 -54
- package/dist/utils/plan-reader.d.ts.map +0 -1
- package/dist/utils/plan-reader.js +0 -238
- package/dist/utils/plan-reader.js.map +0 -1
- package/dist/utils/project-root.d.ts +0 -13
- package/dist/utils/project-root.d.ts.map +0 -1
- package/dist/utils/project-root.js +0 -43
- package/dist/utils/project-root.js.map +0 -1
- package/dist/utils/stage-trace.d.ts +0 -74
- package/dist/utils/stage-trace.d.ts.map +0 -1
- package/dist/utils/stage-trace.js +0 -125
- package/dist/utils/stage-trace.js.map +0 -1
- package/dist/utils/truncate.d.ts +0 -30
- package/dist/utils/truncate.d.ts.map +0 -1
- package/dist/utils/truncate.js +0 -64
- package/dist/utils/truncate.js.map +0 -1
- package/dist/web/middleware/auth.d.ts +0 -3
- package/dist/web/middleware/auth.d.ts.map +0 -1
- package/dist/web/middleware/auth.js +0 -19
- package/dist/web/middleware/auth.js.map +0 -1
- package/dist/web/routes/claudemd.d.ts +0 -4
- package/dist/web/routes/claudemd.d.ts.map +0 -1
- package/dist/web/routes/claudemd.js +0 -205
- package/dist/web/routes/claudemd.js.map +0 -1
- package/dist/web/routes/config.d.ts +0 -6
- package/dist/web/routes/config.d.ts.map +0 -1
- package/dist/web/routes/config.js +0 -331
- package/dist/web/routes/config.js.map +0 -1
- package/dist/web/routes/convention.d.ts +0 -4
- package/dist/web/routes/convention.d.ts.map +0 -1
- package/dist/web/routes/convention.js +0 -235
- package/dist/web/routes/convention.js.map +0 -1
- package/dist/web/routes/daemon.d.ts +0 -4
- package/dist/web/routes/daemon.d.ts.map +0 -1
- package/dist/web/routes/daemon.js +0 -94
- package/dist/web/routes/daemon.js.map +0 -1
- package/dist/web/routes/events.d.ts +0 -4
- package/dist/web/routes/events.d.ts.map +0 -1
- package/dist/web/routes/events.js +0 -99
- package/dist/web/routes/events.js.map +0 -1
- package/dist/web/routes/evolution.d.ts +0 -4
- package/dist/web/routes/evolution.d.ts.map +0 -1
- package/dist/web/routes/evolution.js +0 -61
- package/dist/web/routes/evolution.js.map +0 -1
- package/dist/web/routes/knowledge.d.ts +0 -4
- package/dist/web/routes/knowledge.d.ts.map +0 -1
- package/dist/web/routes/knowledge.js +0 -313
- package/dist/web/routes/knowledge.js.map +0 -1
- package/dist/web/routes/memory.d.ts +0 -7
- package/dist/web/routes/memory.d.ts.map +0 -1
- package/dist/web/routes/memory.js +0 -94
- package/dist/web/routes/memory.js.map +0 -1
- package/dist/web/routes/node-types.d.ts +0 -7
- package/dist/web/routes/node-types.d.ts.map +0 -1
- package/dist/web/routes/node-types.js +0 -192
- package/dist/web/routes/node-types.js.map +0 -1
- package/dist/web/routes/pipelines.d.ts +0 -5
- package/dist/web/routes/pipelines.d.ts.map +0 -1
- package/dist/web/routes/pipelines.js +0 -556
- package/dist/web/routes/pipelines.js.map +0 -1
- package/dist/web/routes/plans.d.ts +0 -5
- package/dist/web/routes/plans.d.ts.map +0 -1
- package/dist/web/routes/plans.js +0 -163
- package/dist/web/routes/plans.js.map +0 -1
- package/dist/web/routes/project-meta.d.ts +0 -8
- package/dist/web/routes/project-meta.d.ts.map +0 -1
- package/dist/web/routes/project-meta.js +0 -63
- package/dist/web/routes/project-meta.js.map +0 -1
- package/dist/web/routes/projects.d.ts +0 -4
- package/dist/web/routes/projects.d.ts.map +0 -1
- package/dist/web/routes/projects.js +0 -156
- package/dist/web/routes/projects.js.map +0 -1
- package/dist/web/routes/quality.d.ts +0 -5
- package/dist/web/routes/quality.d.ts.map +0 -1
- package/dist/web/routes/quality.js +0 -214
- package/dist/web/routes/quality.js.map +0 -1
- package/dist/web/routes/sessions.d.ts +0 -4
- package/dist/web/routes/sessions.d.ts.map +0 -1
- package/dist/web/routes/sessions.js +0 -283
- package/dist/web/routes/sessions.js.map +0 -1
- package/dist/web/routes/skills.d.ts +0 -3
- package/dist/web/routes/skills.d.ts.map +0 -1
- package/dist/web/routes/skills.js +0 -387
- package/dist/web/routes/skills.js.map +0 -1
- package/dist/web/routes/stats.d.ts +0 -4
- package/dist/web/routes/stats.d.ts.map +0 -1
- package/dist/web/routes/stats.js +0 -243
- package/dist/web/routes/stats.js.map +0 -1
- package/dist/web/routes/templates.d.ts +0 -4
- package/dist/web/routes/templates.d.ts.map +0 -1
- package/dist/web/routes/templates.js +0 -117
- package/dist/web/routes/templates.js.map +0 -1
- package/dist/web/sse-broadcaster.d.ts +0 -23
- package/dist/web/sse-broadcaster.d.ts.map +0 -1
- package/dist/web/sse-broadcaster.js +0 -73
- package/dist/web/sse-broadcaster.js.map +0 -1
- package/dist/web/utils/error-response.d.ts +0 -23
- package/dist/web/utils/error-response.d.ts.map +0 -1
- package/dist/web/utils/error-response.js +0 -26
- package/dist/web/utils/error-response.js.map +0 -1
- package/dist/web/utils/errors.d.ts +0 -31
- package/dist/web/utils/errors.d.ts.map +0 -1
- package/dist/web/utils/errors.js +0 -56
- package/dist/web/utils/errors.js.map +0 -1
- package/dist/web/utils/path-validation.d.ts +0 -20
- package/dist/web/utils/path-validation.d.ts.map +0 -1
- package/dist/web/utils/path-validation.js +0 -55
- package/dist/web/utils/path-validation.js.map +0 -1
- package/dist/web/utils/validation.d.ts +0 -112
- package/dist/web/utils/validation.d.ts.map +0 -1
- package/dist/web/utils/validation.js +0 -185
- package/dist/web/utils/validation.js.map +0 -1
- package/dist/web-static/assets/Analytics-Bo_OyY9A.js +0 -36
- package/dist/web-static/assets/BatchProgress-qW-6664M.js +0 -1
- package/dist/web-static/assets/Breadcrumb-C1Mua6se.js +0 -1
- package/dist/web-static/assets/Config-Dn-dtdo9.js +0 -1
- package/dist/web-static/assets/ConfirmDialog-bdDaAlT1.js +0 -1
- package/dist/web-static/assets/Conventions-ByV7r45c.js +0 -1
- package/dist/web-static/assets/Dashboard-C-7N8kYZ.js +0 -1
- package/dist/web-static/assets/ErrorState-CMLoMrQY.js +0 -1
- package/dist/web-static/assets/Events-DHuyQHQe.js +0 -1
- package/dist/web-static/assets/Evolution-Dzr5xOLD.js +0 -1
- package/dist/web-static/assets/Knowledge-ClwX4cnr.js +0 -2
- package/dist/web-static/assets/MiniCharts-DsV2Sqfk.js +0 -1
- package/dist/web-static/assets/NodeTypes-DFt8b5gi.js +0 -1
- package/dist/web-static/assets/Pagination-CR-eJz36.js +0 -1
- package/dist/web-static/assets/PipelineDetail-By1HJlaB.js +0 -4
- package/dist/web-static/assets/Pipelines--MGzCPtR.js +0 -2
- package/dist/web-static/assets/ProjectDetail-CrpekCeY.js +0 -1
- package/dist/web-static/assets/Projects-Dw1qYmjz.js +0 -1
- package/dist/web-static/assets/Quality-CYwODfQP.js +0 -3
- package/dist/web-static/assets/SessionDetail-c8MYnwnk.js +0 -1
- package/dist/web-static/assets/Sessions-BkDd4Mxb.js +0 -2
- package/dist/web-static/assets/Skeleton-DbL04wuz.js +0 -1
- package/dist/web-static/assets/Skills-2OPSAnaU.js +0 -1
- package/dist/web-static/assets/TemplateDetail-DbifRj4h.js +0 -1
- package/dist/web-static/assets/Templates-CDw-GGp8.js +0 -1
- package/dist/web-static/assets/Toast-CrwuIbKC.js +0 -1
- package/dist/web-static/assets/client-C_VWY70M.js +0 -1
- package/dist/web-static/assets/exportCsv-CO51kx6P.js +0 -3
- package/dist/web-static/assets/index-DD2Z15TY.css +0 -2
- package/dist/web-static/assets/index-DR3AaQnu.js +0 -2
- package/dist/web-static/assets/rolldown-runtime-COnpUsM8.js +0 -1
- package/dist/web-static/assets/ui-DpI1N3yJ.js +0 -1
- package/dist/web-static/assets/useDebounce-BLryFdeo.js +0 -1
- package/dist/web-static/assets/vendor-2ObLXPrQ.js +0 -9
- package/dist/web-static/assets/vendor-motion-BryL_tAt.js +0 -9
- package/dist/web-static/assets/vendor-query-CjmRaY7o.js +0 -4
- package/dist/web-static/assets/vendor-react-DZi7brq3.js +0 -11
- package/dist/web-static/index.html +0 -22
- /package/dist/{utils → core/utils}/forge-resume-block.d.ts +0 -0
- /package/dist/{utils → core/utils}/forge-resume-block.js +0 -0
|
@@ -1,815 +0,0 @@
|
|
|
1
|
-
import { logger } from '../utils/logger.js';
|
|
2
|
-
import { PromptRegistry } from '../prompts/registry.js';
|
|
3
|
-
import { cacheRegistry } from '../utils/cache-registry.js';
|
|
4
|
-
import { PHASE_LABELS } from '../types/core-types.js';
|
|
5
|
-
import { IssueTracker } from './issue-tracker.js';
|
|
6
|
-
import { PhaseGapDetector } from './phase-gap-detector.js';
|
|
7
|
-
import { isNonCodeFile, isLowRiskFile, mapCheckToCategory } from './quality-gate-utils.js';
|
|
8
|
-
import { createHash } from 'crypto';
|
|
9
|
-
import fs from 'fs';
|
|
10
|
-
import { QUALITY_GATE, TIME, CONTENT_LIMIT, CACHE, TRUNCATION } from '../constants.js';
|
|
11
|
-
/**
|
|
12
|
-
* QualityGateEngine — AI 驱动的质量门禁
|
|
13
|
-
*
|
|
14
|
-
* 在 PostToolUse 阶段对代码变更进行审查:
|
|
15
|
-
* - spec: 是否符合需求规格
|
|
16
|
-
* - security: 安全性检查
|
|
17
|
-
* - quality: 代码质量
|
|
18
|
-
* - test: 测试覆盖
|
|
19
|
-
* - performance: 性能问题
|
|
20
|
-
*
|
|
21
|
-
* 审查策略根据用户反馈自进化:
|
|
22
|
-
* - 用户接受的审查意见 → 强化该规则
|
|
23
|
-
* - 用户忽略的审查意见 → 弱化该规则
|
|
24
|
-
*/
|
|
25
|
-
export class QualityGateEngine {
|
|
26
|
-
api;
|
|
27
|
-
storage = null; // v5 新增:持久化支持
|
|
28
|
-
currentProjectPath = ''; // v5 新增:当前项目路径
|
|
29
|
-
currentSessionId = ''; // v5 新增:当前会话 ID
|
|
30
|
-
sessionHistoryRestored = false; // 标记当前会话历史是否已恢复,避免重复恢复
|
|
31
|
-
currentRequirement = '';
|
|
32
|
-
currentPipelineId = ''; // 当前 Pipeline ID,供 IssueTracker 使用
|
|
33
|
-
currentTaskType = 'other';
|
|
34
|
-
reviewHistory = [];
|
|
35
|
-
checkCount = 0;
|
|
36
|
-
static REVIEW_INTERVAL = QUALITY_GATE.REVIEW_INTERVAL; // 每 N 次 Write/Edit 触发 1 次审查
|
|
37
|
-
skipPatterns = cacheRegistry.register('quality:skipPatterns', { max: 20, ttl: TIME.WEEK }); // 7天 TTL,Map 模拟 Set
|
|
38
|
-
conventionStandards = []; // 当前项目绑定的 Convention 质量规范
|
|
39
|
-
static MAX_HISTORY_LENGTH = 50; // 限制历史记录长度,避免内存泄漏
|
|
40
|
-
/** AI 审查结果缓存:filePath:contentHash → QualityResult(TTL 1h) */
|
|
41
|
-
reviewCache = cacheRegistry.register('quality:reviewCache', { max: CACHE.QUALITY_REVIEW_MAX, ttl: TIME.HOUR });
|
|
42
|
-
/** 问题台账:跨阶段追踪所有发现的问题 */
|
|
43
|
-
issueTracker = new IssueTracker();
|
|
44
|
-
/** 跨阶段补充触发器:供 执行器 在阶段推进时调用 */
|
|
45
|
-
phaseGapDetector = new PhaseGapDetector(this.issueTracker);
|
|
46
|
-
constructor(api, storage) {
|
|
47
|
-
this.api = api;
|
|
48
|
-
if (storage) {
|
|
49
|
-
this.storage = storage;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* v5 新增:设置当前会话上下文(用于持久化)
|
|
54
|
-
* P1-2 补完:同时恢复 reviewHistory,使跨轮次的忽略计数正确累积
|
|
55
|
-
* 优化:检测会话切换,避免同一会话重复恢复历史
|
|
56
|
-
*
|
|
57
|
-
* @param sessionId - 会话 ID
|
|
58
|
-
* @param projectPath - 项目根目录路径
|
|
59
|
-
*/
|
|
60
|
-
setSessionContext(sessionId, projectPath) {
|
|
61
|
-
// 检测会话是否切换
|
|
62
|
-
const sessionChanged = this.currentSessionId !== sessionId;
|
|
63
|
-
this.currentSessionId = sessionId;
|
|
64
|
-
this.currentProjectPath = projectPath;
|
|
65
|
-
if (this.storage && projectPath) {
|
|
66
|
-
// 从数据库加载未过期的抑制规则(每次都加载,因为可能在运行时更新)
|
|
67
|
-
this.loadSuppressions(projectPath);
|
|
68
|
-
// 只在会话切换时恢复历史,避免重复恢复
|
|
69
|
-
if (sessionChanged && !this.sessionHistoryRestored) {
|
|
70
|
-
this.restoreSessionHistory(sessionId, projectPath);
|
|
71
|
-
this.sessionHistoryRestored = true;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* v5 新增:从数据库加载未过期的抑制规则
|
|
77
|
-
*/
|
|
78
|
-
loadSuppressions(projectPath) {
|
|
79
|
-
if (!this.storage)
|
|
80
|
-
return;
|
|
81
|
-
try {
|
|
82
|
-
const categories = this.storage.getActiveSuppressions(projectPath);
|
|
83
|
-
categories.forEach(c => this.skipPatterns.set(c, true));
|
|
84
|
-
if (categories.length > 0) {
|
|
85
|
-
logger.info(`[Forge:质量检查] 跳过 ${categories.length} 类检查:${categories.join(', ')}(用户已标记为"不再检查")`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
catch (err) {
|
|
89
|
-
logger.warn(`[Forge:质量检查] 加载跳过规则失败:${err}`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* P1-2 新增:从数据库恢复本次会话的审查历史
|
|
94
|
-
* 使 feedback() 的忽略计数在重启后仍能正确累积,最终触发自动抑制
|
|
95
|
-
*/
|
|
96
|
-
restoreSessionHistory(sessionId, projectPath) {
|
|
97
|
-
if (!this.storage)
|
|
98
|
-
return;
|
|
99
|
-
try {
|
|
100
|
-
const rows = this.storage.getSessionQualityHistory(sessionId, projectPath);
|
|
101
|
-
if (rows.length === 0)
|
|
102
|
-
return;
|
|
103
|
-
// 按文件路径分组,重建 reviewHistory 结构
|
|
104
|
-
// 同一文件的所有 check 聚合为一条 QualityResult
|
|
105
|
-
const fileMap = new Map();
|
|
106
|
-
for (const row of rows) {
|
|
107
|
-
const entry = fileMap.get(row.file_path) ?? { checks: [], resolved: false };
|
|
108
|
-
entry.checks.push({
|
|
109
|
-
category: row.category,
|
|
110
|
-
level: row.level,
|
|
111
|
-
message: row.message,
|
|
112
|
-
});
|
|
113
|
-
if (row.resolved)
|
|
114
|
-
entry.resolved = true;
|
|
115
|
-
fileMap.set(row.file_path, entry);
|
|
116
|
-
}
|
|
117
|
-
for (const [filePath, { checks, resolved }] of fileMap) {
|
|
118
|
-
const level = checks.some(c => c.level === 'fail') ? 'fail'
|
|
119
|
-
: checks.some(c => c.level === 'warn') ? 'warn' : 'pass';
|
|
120
|
-
this.reviewHistory.push({
|
|
121
|
-
result: { level, checks, summary: `[已恢复] ${filePath}` },
|
|
122
|
-
accepted: level === 'pass',
|
|
123
|
-
filePath,
|
|
124
|
-
resolved,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
logger.info(`[Forge:质量检查] 恢复了 ${fileMap.size} 个文件的检查记录(跨会话保留)`);
|
|
128
|
-
}
|
|
129
|
-
catch (err) {
|
|
130
|
-
logger.warn(`[Forge:质量检查] 恢复检查记录失败:${err}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* 设置当前需求(从 Pipeline 获取)
|
|
135
|
-
*
|
|
136
|
-
* @param requirement - 用户需求描述
|
|
137
|
-
*/
|
|
138
|
-
setRequirement(requirement) {
|
|
139
|
-
this.currentRequirement = requirement;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* 设置当前任务类型(影响质量检查策略)
|
|
143
|
-
*
|
|
144
|
-
* @param taskType - 任务类型(如 'feature', 'bugfix', 'refactor' 等)
|
|
145
|
-
*/
|
|
146
|
-
setTaskType(taskType) {
|
|
147
|
-
this.currentTaskType = taskType;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* 设置当前 Pipeline ID(供 IssueTracker 使用)
|
|
151
|
-
*
|
|
152
|
-
* @param pipelineId - Pipeline 唯一标识符
|
|
153
|
-
*/
|
|
154
|
-
setPipelineId(pipelineId) {
|
|
155
|
-
this.currentPipelineId = pipelineId;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* 返回问题台账(供 PipelineReportGenerator 使用)
|
|
159
|
-
*
|
|
160
|
-
* @returns IssueTracker 实例
|
|
161
|
-
*/
|
|
162
|
-
getIssueTracker() {
|
|
163
|
-
return this.issueTracker;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* 设置当前项目绑定的 Convention 质量规范
|
|
167
|
-
* must 级别规范将在 reviewForPhase 中作为强制检查维度注入
|
|
168
|
-
*
|
|
169
|
-
* @param standards - 质量规范数组
|
|
170
|
-
*/
|
|
171
|
-
setConventionStandards(standards) {
|
|
172
|
-
this.conventionStandards = standards;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* 审查代码变更
|
|
176
|
-
* 只对 Write/Edit 操作触发,且有节流控制(每 N 次触发 1 次)
|
|
177
|
-
*
|
|
178
|
-
* @param event - Forge 事件对象,包含工具名称、文件路径、内容等
|
|
179
|
-
* @returns 审查结果对象,不满足触发条件时返回 null
|
|
180
|
-
*/
|
|
181
|
-
async review(event) {
|
|
182
|
-
const toolName = event.tool_name || '';
|
|
183
|
-
// 只审查写入操作
|
|
184
|
-
if (toolName !== 'Write' && toolName !== 'Edit')
|
|
185
|
-
return null;
|
|
186
|
-
// 节流:每 REVIEW_INTERVAL 次 Write/Edit 才触发 1 次审查
|
|
187
|
-
this.checkCount++;
|
|
188
|
-
if (this.checkCount % QualityGateEngine.REVIEW_INTERVAL !== 0)
|
|
189
|
-
return null;
|
|
190
|
-
const input = event.tool_input || {};
|
|
191
|
-
const filePath = input.file_path || '';
|
|
192
|
-
let content = input.content ||
|
|
193
|
-
input.new_string || '';
|
|
194
|
-
// 跳过非代码文件
|
|
195
|
-
if (isNonCodeFile(filePath))
|
|
196
|
-
return null;
|
|
197
|
-
// 跳过低风险文件:测试文件、配置文件无需质量审查
|
|
198
|
-
if (isLowRiskFile(filePath))
|
|
199
|
-
return null;
|
|
200
|
-
// Edit 操作:提取 diff 用于增量审查,同时读取完整文件作为回退
|
|
201
|
-
let diff;
|
|
202
|
-
if (toolName === 'Edit' && filePath) {
|
|
203
|
-
const oldStr = input.old_string || '';
|
|
204
|
-
const newStr = input.new_string || '';
|
|
205
|
-
if (oldStr && newStr) {
|
|
206
|
-
diff = { oldStr, newStr };
|
|
207
|
-
}
|
|
208
|
-
// 读取完整文件作为回退(增量审查失败时使用)
|
|
209
|
-
try {
|
|
210
|
-
const fullContent = fs.readFileSync(filePath, 'utf-8');
|
|
211
|
-
if (fullContent.length > 0)
|
|
212
|
-
content = fullContent;
|
|
213
|
-
}
|
|
214
|
-
catch { /* 读取失败时回退到 new_string */ }
|
|
215
|
-
}
|
|
216
|
-
// 跳过太短的变更
|
|
217
|
-
if (content.length < 50 && (!diff || (diff.oldStr.length + diff.newStr.length) < 50))
|
|
218
|
-
return null;
|
|
219
|
-
try {
|
|
220
|
-
return await this.aiReview(filePath, content, toolName, diff);
|
|
221
|
-
}
|
|
222
|
-
catch (err) {
|
|
223
|
-
logger.warn(`[Forge:质量检查] 检查出错:${err}`);
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* v5 新增:检测用户是否修复了历史问题
|
|
229
|
-
* v6 增强:支持部分修复检测(不仅仅是全文件通过)
|
|
230
|
-
*/
|
|
231
|
-
markHistoricalIssuesResolved(filePath, result) {
|
|
232
|
-
if (!this.storage)
|
|
233
|
-
return;
|
|
234
|
-
try {
|
|
235
|
-
// 查询该文件的未解决问题
|
|
236
|
-
const unresolvedIssues = this.storage.getUnresolvedIssues(filePath);
|
|
237
|
-
if (unresolvedIssues.length === 0)
|
|
238
|
-
return;
|
|
239
|
-
// 收集本次检查中出现的问题消息
|
|
240
|
-
const currentMessages = new Set(result.checks.map(c => c.message));
|
|
241
|
-
// 标记不再出现的问题为已解决(按消息内容匹配)
|
|
242
|
-
let resolvedCount = 0;
|
|
243
|
-
for (const issue of unresolvedIssues) {
|
|
244
|
-
if (!currentMessages.has(issue.message)) {
|
|
245
|
-
this.storage.markQualityIssueResolvedByMessage(filePath, issue.message);
|
|
246
|
-
resolvedCount++;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// 更新内存中的 reviewHistory
|
|
250
|
-
if (resolvedCount > 0) {
|
|
251
|
-
for (const h of this.reviewHistory) {
|
|
252
|
-
if (h.filePath === filePath && !currentMessages.has(h.result.summary)) {
|
|
253
|
-
h.resolved = true;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
logger.info(`[Forge:质量检查] ${filePath} 自动解决了 ${resolvedCount} 个历史问题`);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
catch (err) {
|
|
260
|
-
logger.warn(`[Forge:质量检查] 标记问题修复失败:${err}`);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* AI 驱动的代码审查
|
|
265
|
-
* @param diff Edit 操作的变更摘要(old_string → new_string),有则优先用于增量审查
|
|
266
|
-
*/
|
|
267
|
-
async aiReview(filePath, content, operation, diff) {
|
|
268
|
-
// 增量审查:Edit 操作优先只审查 diff 部分,大幅缩短 prompt
|
|
269
|
-
// 当 diff 较小时使用增量模式,否则回退到全文审查
|
|
270
|
-
const useIncrementalReview = diff && (diff.oldStr.length + diff.newStr.length) < CONTENT_LIMIT.INCREMENTAL_REVIEW_DIFF;
|
|
271
|
-
const reviewContent = useIncrementalReview
|
|
272
|
-
? `[增量审查] 只审查本次变更部分:\n旧:\n${diff.oldStr}\n新:\n${diff.newStr}`
|
|
273
|
-
: content;
|
|
274
|
-
// 缓存键:filePath + content hash(增量模式用 diff hash)
|
|
275
|
-
const hashInput = useIncrementalReview ? `${diff.oldStr}:${diff.newStr}` : content;
|
|
276
|
-
const contentHash = createHash('sha256').update(hashInput).digest('hex').slice(0, 16);
|
|
277
|
-
const cacheKey = `${filePath}:${contentHash}`;
|
|
278
|
-
const cached = this.reviewCache.get(cacheKey);
|
|
279
|
-
if (cached) {
|
|
280
|
-
logger.debug(`[质量门禁] 命中缓存:${filePath}`);
|
|
281
|
-
return cached;
|
|
282
|
-
}
|
|
283
|
-
// 构建审查上下文
|
|
284
|
-
const suppressedCategories = Array.from(this.skipPatterns.keys());
|
|
285
|
-
const requirementSection = this.currentRequirement ? `## 需求规格\n${this.currentRequirement}` : '';
|
|
286
|
-
const suppressedSection = suppressedCategories.length > 0 ? `## 已抑制的检查类别(不要重复提)\n${suppressedCategories.join(', ')}` : '';
|
|
287
|
-
// 截断:增量模式已经很短,全文模式限制字符
|
|
288
|
-
const truncatedContent = useIncrementalReview
|
|
289
|
-
? reviewContent
|
|
290
|
-
: (reviewContent.length > TRUNCATION.QUALITY_GATE_CONTENT ? reviewContent.substring(0, TRUNCATION.QUALITY_GATE_CONTENT) + '\n... (内容已截断)' : reviewContent);
|
|
291
|
-
const prompt = PromptRegistry.load('quality-review', {
|
|
292
|
-
operation: useIncrementalReview ? `${operation}(增量)` : operation,
|
|
293
|
-
filePath,
|
|
294
|
-
content: truncatedContent,
|
|
295
|
-
requirementSection,
|
|
296
|
-
suppressedSection,
|
|
297
|
-
});
|
|
298
|
-
logger.debug(`[质量门禁] 正在审查 ${filePath}${useIncrementalReview ? '(增量模式)' : ''}…`);
|
|
299
|
-
const response = await this.api.complete(prompt, 'quality-gate');
|
|
300
|
-
let result;
|
|
301
|
-
try {
|
|
302
|
-
result = this.parseResult(response, filePath);
|
|
303
|
-
}
|
|
304
|
-
catch (err) {
|
|
305
|
-
// AI 响应解析失败,跳过本次检查,不计入统计
|
|
306
|
-
logger.warn(`[Forge:质量检查] ${filePath} 解析失败,跳过本次检查`);
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
// 缓存结果
|
|
310
|
-
this.reviewCache.set(cacheKey, result);
|
|
311
|
-
// v5 新增:检测历史问题是否已修复
|
|
312
|
-
this.markHistoricalIssuesResolved(filePath, result);
|
|
313
|
-
// v5 新增:记录到数据库
|
|
314
|
-
if (this.storage && this.currentSessionId && this.currentProjectPath) {
|
|
315
|
-
for (const check of result.checks) {
|
|
316
|
-
if (check.level !== 'pass') {
|
|
317
|
-
const id = `qgh_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
318
|
-
this.storage.insertQualityGateHistory({
|
|
319
|
-
id,
|
|
320
|
-
session_id: this.currentSessionId,
|
|
321
|
-
project_path: this.currentProjectPath,
|
|
322
|
-
file_path: filePath,
|
|
323
|
-
category: check.category,
|
|
324
|
-
level: check.level,
|
|
325
|
-
message: check.message,
|
|
326
|
-
pipeline_id: this.currentPipelineId || undefined,
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
// 问题台账:追踪 fail/warn 问题,并处理修复循环
|
|
332
|
-
if (this.currentPipelineId && result.level !== 'pass') {
|
|
333
|
-
// 尝试将已有 open 问题标记为 resolved(同文件 pass 时)
|
|
334
|
-
// 此处 result.level !== 'pass',所以只处理新问题
|
|
335
|
-
for (const check of result.checks.filter(c => c.level !== 'pass')) {
|
|
336
|
-
const category = mapCheckToCategory(check.category, 'code');
|
|
337
|
-
const existing = this.issueTracker.getOpenByPhase(this.currentPipelineId, 'code')
|
|
338
|
-
.find(i => i.filePath === filePath && i.category === category && i.message === check.message);
|
|
339
|
-
if (existing) {
|
|
340
|
-
// 已有相同问题,增加修复尝试次数并处理修复循环
|
|
341
|
-
const attempts = this.issueTracker.incrementFixAttempts(existing.id);
|
|
342
|
-
const fixDirective = this.handleFailIssue(existing.id, attempts, result, filePath);
|
|
343
|
-
if (fixDirective && result.directive) {
|
|
344
|
-
result.directive = fixDirective + '\n\n' + result.directive;
|
|
345
|
-
}
|
|
346
|
-
else if (fixDirective) {
|
|
347
|
-
result.directive = fixDirective;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
// 新问题,加入台账
|
|
352
|
-
this.issueTracker.add(this.currentPipelineId, 'code', category, check.level, check.message, check.suggestion, filePath);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return result;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* 根据审查结果生成注入指令
|
|
360
|
-
*/
|
|
361
|
-
generateDirective(result, filePath) {
|
|
362
|
-
if (result.level === 'pass')
|
|
363
|
-
return null;
|
|
364
|
-
const parts = [];
|
|
365
|
-
const mustFix = result.checks.filter(c => c.level === 'fail');
|
|
366
|
-
const shouldFix = result.checks.filter(c => c.level === 'warn');
|
|
367
|
-
// 标题:区分必须修复和建议修复
|
|
368
|
-
if (mustFix.length > 0) {
|
|
369
|
-
parts.push(`[Forge QualityGate] ❌ 必须修复(${mustFix.length}个)/ 建议修复(${shouldFix.length}个)`);
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
parts.push(`[Forge QualityGate] ⚠️ 建议修复(${shouldFix.length}个)`);
|
|
373
|
-
}
|
|
374
|
-
parts.push(`文件: ${filePath}`);
|
|
375
|
-
parts.push('');
|
|
376
|
-
// 必须修复:红色标记,带编号和快速修复建议
|
|
377
|
-
if (mustFix.length > 0) {
|
|
378
|
-
parts.push('🔴 立即修复:');
|
|
379
|
-
mustFix.forEach((check, idx) => {
|
|
380
|
-
parts.push(` ${idx + 1}. [${check.category}] ${check.message}`);
|
|
381
|
-
if (check.suggestion) {
|
|
382
|
-
// 将建议拆分为步骤(如果包含换行或编号)
|
|
383
|
-
const suggestionLines = check.suggestion.split('\n').filter(l => l.trim());
|
|
384
|
-
if (suggestionLines.length > 1) {
|
|
385
|
-
parts.push(` 💡 修复步骤:`);
|
|
386
|
-
suggestionLines.forEach(line => parts.push(` ${line.trim()}`));
|
|
387
|
-
}
|
|
388
|
-
else {
|
|
389
|
-
parts.push(` 💡 ${check.suggestion}`);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
// 建议修复:黄色标记,不阻断
|
|
395
|
-
if (shouldFix.length > 0) {
|
|
396
|
-
if (mustFix.length > 0)
|
|
397
|
-
parts.push('');
|
|
398
|
-
parts.push('🟡 建议修复(不阻断):');
|
|
399
|
-
shouldFix.forEach((check, idx) => {
|
|
400
|
-
parts.push(` ${idx + 1}. [${check.category}] ${check.message}`);
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
if (result.level === 'fail') {
|
|
404
|
-
parts.push('');
|
|
405
|
-
parts.push('请立即修复以上 🔴 标记的问题再继续。');
|
|
406
|
-
}
|
|
407
|
-
return parts.join('\n');
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* 反馈:用户是否接受了审查意见
|
|
411
|
-
*/
|
|
412
|
-
feedback(accepted, categories) {
|
|
413
|
-
if (!accepted && categories) {
|
|
414
|
-
// v5 修改:持久化抑制计数
|
|
415
|
-
for (const cat of categories) {
|
|
416
|
-
if (this.storage && this.currentProjectPath) {
|
|
417
|
-
this.storage.incrementSuppressionCount(cat, this.currentProjectPath);
|
|
418
|
-
}
|
|
419
|
-
// 连续 N 次忽略同一类别,自动抑制(配置天数后恢复)
|
|
420
|
-
const ignoreCount = this.reviewHistory
|
|
421
|
-
.filter(h => !h.accepted && h.result.checks.some(c => c.category === cat))
|
|
422
|
-
.length;
|
|
423
|
-
if (ignoreCount >= QUALITY_GATE.SUPPRESSION_THRESHOLD) {
|
|
424
|
-
this.skipPatterns.set(cat, true);
|
|
425
|
-
logger.info(`[Forge:质量检查] 不再检查 ${cat} 类问题(已忽略 ${ignoreCount} 次,${QUALITY_GATE.SUPPRESSION_EXPIRE_DAYS} 天后自动恢复)`);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* 生成阶段性质量报告
|
|
432
|
-
*/
|
|
433
|
-
generateReport() {
|
|
434
|
-
if (this.reviewHistory.length === 0)
|
|
435
|
-
return '暂无审查记录。';
|
|
436
|
-
// 统一按检查项级别统计(而非文件级别),与分类统计保持一致
|
|
437
|
-
let totalChecks = 0;
|
|
438
|
-
let passedChecks = 0;
|
|
439
|
-
let warnedChecks = 0;
|
|
440
|
-
let failedChecks = 0;
|
|
441
|
-
const categoryStats = {};
|
|
442
|
-
for (const h of this.reviewHistory) {
|
|
443
|
-
for (const check of h.result.checks) {
|
|
444
|
-
totalChecks++;
|
|
445
|
-
if (check.level === 'pass')
|
|
446
|
-
passedChecks++;
|
|
447
|
-
else if (check.level === 'warn')
|
|
448
|
-
warnedChecks++;
|
|
449
|
-
else if (check.level === 'fail')
|
|
450
|
-
failedChecks++;
|
|
451
|
-
if (!categoryStats[check.category]) {
|
|
452
|
-
categoryStats[check.category] = { total: 0, issues: 0 };
|
|
453
|
-
}
|
|
454
|
-
categoryStats[check.category].total++;
|
|
455
|
-
if (check.level !== 'pass')
|
|
456
|
-
categoryStats[check.category].issues++;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
const lines = [
|
|
460
|
-
'## Forge 质量报告',
|
|
461
|
-
'',
|
|
462
|
-
`检查项: ${totalChecks} | 通过: ${passedChecks} | 警告: ${warnedChecks} | 失败: ${failedChecks}`,
|
|
463
|
-
`通过率: ${totalChecks > 0 ? ((passedChecks / totalChecks) * 100).toFixed(0) : 0}%`,
|
|
464
|
-
'',
|
|
465
|
-
'### 按类别统计',
|
|
466
|
-
];
|
|
467
|
-
for (const [cat, stats] of Object.entries(categoryStats)) {
|
|
468
|
-
const rate = ((1 - stats.issues / stats.total) * 100).toFixed(0);
|
|
469
|
-
lines.push(`- ${cat}: ${rate}% 通过 (${stats.issues}/${stats.total} 有问题)`);
|
|
470
|
-
}
|
|
471
|
-
if (this.skipPatterns.size > 0) {
|
|
472
|
-
lines.push('');
|
|
473
|
-
lines.push(`已自动抑制: ${Array.from(this.skipPatterns.keys()).join(', ')}`);
|
|
474
|
-
}
|
|
475
|
-
return lines.join('\n');
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* 返回本次会话中未解决的 fail 级别问题列表
|
|
479
|
-
* resolved=true 的条目(后续审查通过的文件)不计入
|
|
480
|
-
*/
|
|
481
|
-
getUnresolvedFailures() {
|
|
482
|
-
return this.reviewHistory
|
|
483
|
-
.filter(h => h.result.level === 'fail' && !h.resolved)
|
|
484
|
-
.map(h => ({ summary: h.result.summary, checks: h.result.checks.filter(c => c.level === 'fail') }));
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* 返回本次会话质量门禁通过次数(pass + warn)
|
|
488
|
-
* 必须在 reset() 之前调用
|
|
489
|
-
*/
|
|
490
|
-
getPassCount() {
|
|
491
|
-
return this.reviewHistory.filter(h => h.result.level === 'pass' || h.result.level === 'warn').length;
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* 返回本次会话质量门禁失败次数
|
|
495
|
-
* 必须在 reset() 之前调用
|
|
496
|
-
*/
|
|
497
|
-
getFailCount() {
|
|
498
|
-
return this.reviewHistory.filter(h => h.result.level === 'fail').length;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* 重置(新 Pipeline 开始时)
|
|
502
|
-
*/
|
|
503
|
-
reset() {
|
|
504
|
-
if (this.currentPipelineId) {
|
|
505
|
-
this.issueTracker.resetForPipeline(this.currentPipelineId);
|
|
506
|
-
}
|
|
507
|
-
this.currentRequirement = '';
|
|
508
|
-
this.currentPipelineId = '';
|
|
509
|
-
this.currentTaskType = 'other';
|
|
510
|
-
this.reviewHistory = [];
|
|
511
|
-
this.checkCount = 0;
|
|
512
|
-
this.sessionHistoryRestored = false; // 重置恢复标志,允许新会话恢复历史
|
|
513
|
-
// skipPatterns 保留(跨 Pipeline 学习)
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
* 基于阶段描述的质量门禁(无需 Write/Edit 事件,适用于 analyze/design 等文本输出阶段)
|
|
517
|
-
* 返回 null 表示无需拦截(AI 调用失败时 fail-safe 放行)
|
|
518
|
-
*/
|
|
519
|
-
async reviewPhaseCompletion(phase, requirement, phaseContext) {
|
|
520
|
-
const mandatoryCategories = this.getMandatoryCategoriesForPhase(phase);
|
|
521
|
-
if (mandatoryCategories.length === 0)
|
|
522
|
-
return null;
|
|
523
|
-
const mustRules = this.conventionStandards.filter(s => s.severity === 'must' &&
|
|
524
|
-
(!s.phases || s.phases.length === 0 || s.phases.includes(phase)));
|
|
525
|
-
const mandatoryNote = `## 本阶段(${phase})必须通过的检查维度\n${mandatoryCategories.join(', ')}`;
|
|
526
|
-
const taskTypeNote = this.currentTaskType === 'documentation'
|
|
527
|
-
? `\n## 任务类型:文档类任务\n- 重点检查文档完整性、结构清晰度、是否覆盖需求\n- 不要求代码实现、测试覆盖、安全检查\n- 如果文档已生成且内容合理,应判定为 pass`
|
|
528
|
-
: '';
|
|
529
|
-
const conventionNote = mustRules.length > 0
|
|
530
|
-
? `\n## 项目规范强制要求(must 级别,违反即 fail)\n${mustRules.map(r => {
|
|
531
|
-
const source = r.conventionName ? ` [来源: ${r.conventionName}]` : '';
|
|
532
|
-
return `- [${r.category}] ${r.rule}${source}`;
|
|
533
|
-
}).join('\n')}`
|
|
534
|
-
: '';
|
|
535
|
-
const prompt = PromptRegistry.load('quality-phase-completion', {
|
|
536
|
-
requirement,
|
|
537
|
-
phase,
|
|
538
|
-
phaseContext,
|
|
539
|
-
mandatoryNote,
|
|
540
|
-
taskTypeNote,
|
|
541
|
-
conventionNote,
|
|
542
|
-
});
|
|
543
|
-
// 最多重试 2 次(首次 + 1 次重试)
|
|
544
|
-
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
545
|
-
try {
|
|
546
|
-
const response = await this.api.complete(prompt, 'quality-gate-phase-completion');
|
|
547
|
-
const result = this.parseResult(response, `[${phase}阶段]`);
|
|
548
|
-
logger.info(`[Forge:质量检查] ${PHASE_LABELS[phase]}阶段检查完成:${result.level} — ${result.summary}`);
|
|
549
|
-
// 问题台账:追踪 fail/warn 问题
|
|
550
|
-
if (this.currentPipelineId && result.level !== 'pass') {
|
|
551
|
-
for (const check of result.checks.filter(c => c.level !== 'pass')) {
|
|
552
|
-
const category = mapCheckToCategory(check.category, phase);
|
|
553
|
-
this.issueTracker.add(this.currentPipelineId, phase, category, check.level, check.message, check.suggestion);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
return result;
|
|
557
|
-
}
|
|
558
|
-
catch (err) {
|
|
559
|
-
if (attempt < 2) {
|
|
560
|
-
logger.warn(`[质量门禁] 阶段完成度检查失败(第 ${attempt} 次),重试中:${err}`);
|
|
561
|
-
await new Promise(r => setTimeout(r, TIME.THREE_SECONDS));
|
|
562
|
-
}
|
|
563
|
-
else {
|
|
564
|
-
// 两次均失败:返回 null 放行(fail-safe),避免 AI 故障导致 Pipeline 永久阻断
|
|
565
|
-
logger.warn(`[质量门禁] 阶段完成度检查连续失败,降级放行:${err}`);
|
|
566
|
-
return null;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
// TypeScript 要求:实际不可达,但需要返回值
|
|
571
|
-
return null;
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* 阶段完成时的质量门禁检查(每阶段触发一次,非每次 Write/Edit)
|
|
575
|
-
* 返回 null 表示不适用(工具类型不匹配、非代码文件等);失败时返回 warn 而非静默放行
|
|
576
|
-
*/
|
|
577
|
-
async reviewForPhase(event, phase) {
|
|
578
|
-
const toolName = event.tool_name || '';
|
|
579
|
-
if (toolName !== 'Write' && toolName !== 'Edit')
|
|
580
|
-
return null;
|
|
581
|
-
const input = event.tool_input || {};
|
|
582
|
-
const filePath = input.file_path || '';
|
|
583
|
-
let content = input.content ||
|
|
584
|
-
input.new_string || '';
|
|
585
|
-
// Edit 操作:从磁盘读取完整文件内容(PostToolUse 时文件已更新)
|
|
586
|
-
// 避免 AI 只看到 new_string 片段而误判"未找到实现代码"
|
|
587
|
-
if (toolName === 'Edit' && filePath) {
|
|
588
|
-
try {
|
|
589
|
-
const fullContent = fs.readFileSync(filePath, 'utf-8');
|
|
590
|
-
if (fullContent.length > 0)
|
|
591
|
-
content = fullContent;
|
|
592
|
-
}
|
|
593
|
-
catch { /* 读取失败时回退到 new_string */ }
|
|
594
|
-
}
|
|
595
|
-
if (isNonCodeFile(filePath))
|
|
596
|
-
return null;
|
|
597
|
-
if (content.length < 50)
|
|
598
|
-
return null;
|
|
599
|
-
const mandatoryCategories = this.getMandatoryCategoriesForPhase(phase);
|
|
600
|
-
// 启动日志:显示检查项目
|
|
601
|
-
const checkItems = mandatoryCategories.length > 0
|
|
602
|
-
? mandatoryCategories.join('、')
|
|
603
|
-
: '规范符合性、安全性、代码质量';
|
|
604
|
-
logger.info(`[Forge:质量检查] 正在检查 ${filePath}\n 检查项:${checkItems}`);
|
|
605
|
-
// Convention must-severity 规范:作为额外强制检查条目注入
|
|
606
|
-
const mustRules = this.conventionStandards.filter(s => s.severity === 'must' &&
|
|
607
|
-
(!s.phases || s.phases.length === 0 || s.phases.includes(phase)));
|
|
608
|
-
const suppressedCategories = Array.from(this.skipPatterns.keys());
|
|
609
|
-
const mandatoryNote = mandatoryCategories.length > 0
|
|
610
|
-
? `\n## 本阶段(${phase})必须通过的检查维度\n${mandatoryCategories.join(', ')}`
|
|
611
|
-
: '';
|
|
612
|
-
const conventionNote = mustRules.length > 0
|
|
613
|
-
? `\n## 项目规范强制要求(must 级别,违反即 fail)\n${mustRules.map(r => {
|
|
614
|
-
const source = r.conventionName ? ` [来源: ${r.conventionName}]` : '';
|
|
615
|
-
return `- [${r.category}] ${r.rule}${source}`;
|
|
616
|
-
}).join('\n')}`
|
|
617
|
-
: '';
|
|
618
|
-
const requirementSection = this.currentRequirement ? `## 需求规格\n${this.currentRequirement}` : '';
|
|
619
|
-
const suppressedSection = suppressedCategories.length > 0 ? `## 已抑制的检查类别\n${suppressedCategories.join(', ')}` : '';
|
|
620
|
-
// 任务类型注释:文档/UI 类任务豁免测试覆盖和安全检查
|
|
621
|
-
const taskTypeNote = (this.currentTaskType === 'documentation')
|
|
622
|
-
? `\n## 任务类型:文档类任务\n- 重点检查文档完整性、结构清晰度、是否覆盖需求\n- 不要求代码实现、测试覆盖、安全检查\n- 如果文档已生成且内容合理,应判定为 pass`
|
|
623
|
-
: '';
|
|
624
|
-
// Edit 操作:附加 diff 摘要,帮助 AI 理解本次变更的具体内容
|
|
625
|
-
let diffContext = '';
|
|
626
|
-
if (toolName === 'Edit') {
|
|
627
|
-
const oldStr = input.old_string || '';
|
|
628
|
-
const newStr = input.new_string || '';
|
|
629
|
-
if (oldStr && newStr) {
|
|
630
|
-
const oldPreview = oldStr.length > TRUNCATION.QUALITY_GATE_PREVIEW ? oldStr.substring(0, TRUNCATION.QUALITY_GATE_PREVIEW) + '…' : oldStr;
|
|
631
|
-
const newPreview = newStr.length > TRUNCATION.QUALITY_GATE_PREVIEW ? newStr.substring(0, TRUNCATION.QUALITY_GATE_PREVIEW) + '…' : newStr;
|
|
632
|
-
diffContext = `\n## 本次变更摘要(Edit 操作)\n旧内容:\n\`\`\`\n${oldPreview}\n\`\`\`\n新内容:\n\`\`\`\n${newPreview}\n\`\`\``;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
// 截断阈值,避免大文件被截断导致误判
|
|
636
|
-
const truncatedContent = content.length > TRUNCATION.QUALITY_GATE_CONTENT
|
|
637
|
-
? content.substring(0, TRUNCATION.QUALITY_GATE_CONTENT) + '\n... (内容已截断,请基于已见部分判断)'
|
|
638
|
-
: content;
|
|
639
|
-
const prompt = PromptRegistry.load('quality-phase-review', {
|
|
640
|
-
toolName,
|
|
641
|
-
filePath,
|
|
642
|
-
content: truncatedContent,
|
|
643
|
-
requirementSection,
|
|
644
|
-
mandatoryNote,
|
|
645
|
-
conventionNote,
|
|
646
|
-
suppressedSection,
|
|
647
|
-
taskTypeNote,
|
|
648
|
-
diffContext,
|
|
649
|
-
});
|
|
650
|
-
// 最多重试 2 次(首次 + 1 次重试)
|
|
651
|
-
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
652
|
-
try {
|
|
653
|
-
const response = await this.api.complete(prompt, 'quality-gate-phase');
|
|
654
|
-
const result = this.parseResult(response, filePath);
|
|
655
|
-
logger.info(`[Forge:质量检查] ${PHASE_LABELS[phase]}阶段代码检查完成:${result.level} — ${result.summary}`);
|
|
656
|
-
return result;
|
|
657
|
-
}
|
|
658
|
-
catch (err) {
|
|
659
|
-
if (attempt < 2) {
|
|
660
|
-
logger.warn(`[Forge:质量检查] ${PHASE_LABELS[phase]}阶段代码检查出错(第 ${attempt} 次),正在重试:${err}`);
|
|
661
|
-
await new Promise(r => setTimeout(r, TIME.THREE_SECONDS));
|
|
662
|
-
}
|
|
663
|
-
else {
|
|
664
|
-
// 两次均失败:返回 null 放行(fail-safe),避免 AI 故障导致 Pipeline 永久阻断
|
|
665
|
-
logger.warn(`[Forge:质量检查] ${PHASE_LABELS[phase]}阶段代码检查连续失败,跳过检查继续推进:${err}`);
|
|
666
|
-
return null;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
// TypeScript 要求:实际不可达,但需要返回值
|
|
671
|
-
return null;
|
|
672
|
-
}
|
|
673
|
-
getMandatoryCategoriesForPhase(phase) {
|
|
674
|
-
// documentation 类型:只检查 spec(文档完整性),不检查 test/security/performance
|
|
675
|
-
if (this.currentTaskType === 'documentation') {
|
|
676
|
-
switch (phase) {
|
|
677
|
-
case 'analyze': return ['spec'];
|
|
678
|
-
case 'design': return ['spec', 'quality'];
|
|
679
|
-
default: return [];
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
switch (phase) {
|
|
683
|
-
case 'analyze': return ['spec'];
|
|
684
|
-
case 'design': return ['spec', 'quality'];
|
|
685
|
-
case 'code': return ['security', 'quality'];
|
|
686
|
-
case 'test': return ['test'];
|
|
687
|
-
case 'review': return ['security', 'quality', 'spec', 'test'];
|
|
688
|
-
default: return [];
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
/**
|
|
692
|
-
* 主动修复循环:根据修复尝试次数决定响应策略
|
|
693
|
-
* - attempts 1-2:生成修复指令(注入 directive),让 Claude 自己修
|
|
694
|
-
* - attempts >= 3:生成 Forge 强制介入指令,标记 forgeFixApplied
|
|
695
|
-
* 返回附加的 directive 字符串(或 undefined)
|
|
696
|
-
*/
|
|
697
|
-
handleFailIssue(issueId, attempts, result, filePath) {
|
|
698
|
-
const failChecks = result.checks.filter(c => c.level === 'fail');
|
|
699
|
-
if (failChecks.length === 0)
|
|
700
|
-
return undefined;
|
|
701
|
-
if (attempts <= 2) {
|
|
702
|
-
// 第 1-2 次:提示优先级升级,让 Claude 专注修复
|
|
703
|
-
return `[Forge 质量追踪] 该问题已发现 ${attempts} 次,优先修复后再继续其他工作。`;
|
|
704
|
-
}
|
|
705
|
-
// 第 3 次及以上:Forge 强制介入提示
|
|
706
|
-
this.issueTracker.markForgeFixed(issueId);
|
|
707
|
-
const fileRef = filePath ? `文件:${filePath}\n` : '';
|
|
708
|
-
return `[Forge 强制介入] 问题已持续 ${attempts} 次未解决,立即停止当前操作,专注修复以下问题:\n${fileRef}${failChecks.map(c => `- ${c.message}${c.suggestion ? `\n 修复方式:${c.suggestion}` : ''}`).join('\n')}`;
|
|
709
|
-
}
|
|
710
|
-
parseResult(response, filePath) {
|
|
711
|
-
const cleaned = response.replace(/```json\s*/g, '').replace(/```\s*/g, '');
|
|
712
|
-
const jsonMatch = cleaned.match(/\{[\s\S]*\}/);
|
|
713
|
-
if (!jsonMatch) {
|
|
714
|
-
logger.warn(`[Forge:质量检查] AI 返回内容无法解析,跳过本次检查`);
|
|
715
|
-
logger.debug(`[Forge:质量检查] AI 原始返回:${response.slice(0, 300)}`);
|
|
716
|
-
throw new Error('AI response parse failed');
|
|
717
|
-
}
|
|
718
|
-
const parsed = JSON.parse(jsonMatch[0]);
|
|
719
|
-
const rawChecks = (parsed.checks || []).map((c) => ({
|
|
720
|
-
category: c.category || 'quality',
|
|
721
|
-
level: c.level || 'pass',
|
|
722
|
-
message: c.message || '',
|
|
723
|
-
suggestion: c.suggestion,
|
|
724
|
-
}));
|
|
725
|
-
// 抑制过滤:真正过滤掉已抑制类别的 warn 级别问题
|
|
726
|
-
// Convention must 规范来源的 fail 永不抑制(conventionName 字段标记)
|
|
727
|
-
const suppressedCategories = new Set(this.skipPatterns.keys());
|
|
728
|
-
const mustConventionCategories = new Set(this.conventionStandards.filter(s => s.severity === 'must').map(s => s.category));
|
|
729
|
-
const filteredChecks = suppressedCategories.size > 0
|
|
730
|
-
? rawChecks.filter(c => {
|
|
731
|
-
if (c.level === 'pass')
|
|
732
|
-
return true;
|
|
733
|
-
// Convention must 规范对应的类别永不抑制
|
|
734
|
-
if (mustConventionCategories.has(c.category))
|
|
735
|
-
return true;
|
|
736
|
-
// 已抑制类别的 warn 过滤掉;fail 保留(用户明确忽略 N 次后才抑制,说明确实不重要)
|
|
737
|
-
if (suppressedCategories.has(c.category) && c.level === 'warn')
|
|
738
|
-
return false;
|
|
739
|
-
return true;
|
|
740
|
-
})
|
|
741
|
-
: rawChecks;
|
|
742
|
-
// 重新计算整体 level(过滤后)
|
|
743
|
-
const effectiveLevel = filteredChecks.some(c => c.level === 'fail') ? 'fail'
|
|
744
|
-
: filteredChecks.some(c => c.level === 'warn') ? 'warn' : 'pass';
|
|
745
|
-
// 检查是否违反 must 规范(硬阻断条件)
|
|
746
|
-
// 匹配策略:以 category 为主键。AI 审查返回的 check.category 与 Convention
|
|
747
|
-
// quality_standards 的 category 共享同一枚举空间(spec/security/quality/test/performance),
|
|
748
|
-
// 只要 fail 级别的 check.category 命中任意 must 规范的 category,即视为违反。
|
|
749
|
-
const mustRules = this.conventionStandards.filter(s => s.severity === 'must');
|
|
750
|
-
const criticalIssues = [];
|
|
751
|
-
let hasBlockingIssue = false;
|
|
752
|
-
if (effectiveLevel === 'fail' && mustRules.length > 0) {
|
|
753
|
-
// 收集所有 fail 级别 check 命中的 must 规范(按 category 精确匹配,去重)
|
|
754
|
-
const seenCategories = new Set();
|
|
755
|
-
for (const check of filteredChecks.filter(c => c.level === 'fail')) {
|
|
756
|
-
const matchedRules = mustRules.filter(r => r.category === check.category);
|
|
757
|
-
for (const matchedRule of matchedRules) {
|
|
758
|
-
const dedupeKey = `${matchedRule.category}:${matchedRule.rule}`;
|
|
759
|
-
if (!seenCategories.has(dedupeKey)) {
|
|
760
|
-
seenCategories.add(dedupeKey);
|
|
761
|
-
hasBlockingIssue = true;
|
|
762
|
-
criticalIssues.push({
|
|
763
|
-
category: matchedRule.category,
|
|
764
|
-
rule: matchedRule.rule,
|
|
765
|
-
conventionName: matchedRule.conventionName,
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
const result = {
|
|
772
|
-
level: effectiveLevel,
|
|
773
|
-
checks: filteredChecks,
|
|
774
|
-
summary: parsed.summary || '审查完成',
|
|
775
|
-
blocking: hasBlockingIssue, // ✅ 设置硬阻断标记
|
|
776
|
-
criticalIssues: criticalIssues.length > 0 ? criticalIssues : undefined,
|
|
777
|
-
};
|
|
778
|
-
// 生成 directive
|
|
779
|
-
result.directive = this.generateDirective(result, filePath) || undefined;
|
|
780
|
-
// 如果本次审查通过,将同一文件的历史 fail 标记为已解决
|
|
781
|
-
if (result.level === 'pass') {
|
|
782
|
-
for (const h of this.reviewHistory) {
|
|
783
|
-
if (h.filePath === filePath && h.result.level === 'fail' && !h.resolved) {
|
|
784
|
-
h.resolved = true;
|
|
785
|
-
logger.debug(`[质量门禁] ${filePath} 审查通过,历史 fail 已标记为已解决`);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
// 同步更新 issueTracker:将该文件的 open 问题标记为 resolved
|
|
789
|
-
if (this.currentPipelineId) {
|
|
790
|
-
const openIssues = this.issueTracker.getAll(this.currentPipelineId)
|
|
791
|
-
.filter(i => i.filePath === filePath && (i.status === 'open' || i.status === 'in_progress'));
|
|
792
|
-
for (const issue of openIssues) {
|
|
793
|
-
this.issueTracker.resolve(issue.id, 'code');
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
// 记录历史(环形缓冲,防止内存无限增长)
|
|
798
|
-
// accepted: fail 时为 false,供 feedback() 统计误报率
|
|
799
|
-
this.reviewHistory.push({ result, accepted: result.level !== 'fail', filePath, resolved: false });
|
|
800
|
-
if (this.reviewHistory.length > QualityGateEngine.MAX_HISTORY_LENGTH) {
|
|
801
|
-
this.reviewHistory = this.reviewHistory.slice(-QualityGateEngine.MAX_HISTORY_LENGTH);
|
|
802
|
-
}
|
|
803
|
-
// 结构化日志:本次审查结果
|
|
804
|
-
const passCount = result.checks.filter(c => c.level === 'pass').length;
|
|
805
|
-
const warnCount = result.checks.filter(c => c.level === 'warn').length;
|
|
806
|
-
const failCount = result.checks.filter(c => c.level === 'fail').length;
|
|
807
|
-
logger.info(`[Forge:质量检查] ${filePath} | 通过=${passCount} 警告=${warnCount} 不通过=${failCount}`);
|
|
808
|
-
// 累计统计降级为 debug(避免与阶段进度混淆)
|
|
809
|
-
const totalPass = this.reviewHistory.filter(h => h.result.level === 'pass' || h.result.level === 'warn').length;
|
|
810
|
-
const passRate = this.reviewHistory.length > 0 ? Math.round((totalPass / this.reviewHistory.length) * 100) : 0;
|
|
811
|
-
logger.debug(`[质量门禁] 会话统计:累计通过率 ${passRate}% (${totalPass}/${this.reviewHistory.length})`);
|
|
812
|
-
return result;
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
//# sourceMappingURL=quality-gate.js.map
|