@winspan/claude-forge 8.54.4 → 9.12.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/DEVELOPMENT.md +723 -46
- package/README.md +166 -21
- package/dist/catalogs/agents.json +67 -0
- package/dist/catalogs/skills.json +306 -0
- package/dist/claudemd/claudemd-generator.d.ts +45 -45
- package/dist/claudemd/claudemd-generator.d.ts.map +1 -1
- package/dist/claudemd/claudemd-generator.js +128 -449
- package/dist/claudemd/claudemd-generator.js.map +1 -1
- package/dist/claudemd/index.d.ts +14 -4
- package/dist/claudemd/index.d.ts.map +1 -1
- package/dist/claudemd/index.js +15 -4
- package/dist/claudemd/index.js.map +1 -1
- package/dist/claudemd/resume-manager.d.ts.map +1 -1
- package/dist/claudemd/resume-manager.js +37 -9
- package/dist/claudemd/resume-manager.js.map +1 -1
- package/dist/claudemd/templates/swarm-protocol.md +35 -186
- package/dist/claudemd/violations-manager.d.ts +40 -0
- package/dist/claudemd/violations-manager.d.ts.map +1 -0
- package/dist/claudemd/violations-manager.js +106 -0
- package/dist/claudemd/violations-manager.js.map +1 -0
- package/dist/cli/commands/admin.d.ts +15 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +177 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +169 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +690 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +18 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +160 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/bypass.d.ts +18 -0
- package/dist/cli/commands/bypass.d.ts.map +1 -0
- package/dist/cli/commands/bypass.js +87 -0
- package/dist/cli/commands/bypass.js.map +1 -0
- package/dist/cli/commands/claudemd.d.ts +60 -0
- package/dist/cli/commands/claudemd.d.ts.map +1 -1
- package/dist/cli/commands/claudemd.js +174 -37
- package/dist/cli/commands/claudemd.js.map +1 -1
- package/dist/cli/commands/codegraph.d.ts +17 -0
- package/dist/cli/commands/codegraph.d.ts.map +1 -0
- package/dist/cli/commands/codegraph.js +263 -0
- package/dist/cli/commands/codegraph.js.map +1 -0
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +94 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/daemon.d.ts +39 -0
- package/dist/cli/commands/daemon.d.ts.map +1 -1
- package/dist/cli/commands/daemon.js +167 -20
- package/dist/cli/commands/daemon.js.map +1 -1
- package/dist/cli/commands/decisions.d.ts +129 -0
- package/dist/cli/commands/decisions.d.ts.map +1 -0
- package/dist/cli/commands/decisions.js +706 -0
- package/dist/cli/commands/decisions.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +29 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +124 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/entropy.d.ts +35 -0
- package/dist/cli/commands/entropy.d.ts.map +1 -0
- package/dist/cli/commands/entropy.js +121 -0
- package/dist/cli/commands/entropy.js.map +1 -0
- package/dist/cli/commands/executions.d.ts +1 -0
- package/dist/cli/commands/executions.d.ts.map +1 -1
- package/dist/cli/commands/executions.js +12 -2
- package/dist/cli/commands/executions.js.map +1 -1
- package/dist/cli/commands/fix.d.ts +31 -0
- package/dist/cli/commands/fix.d.ts.map +1 -0
- package/dist/cli/commands/fix.js +108 -0
- package/dist/cli/commands/fix.js.map +1 -0
- package/dist/cli/commands/governance.d.ts +21 -0
- package/dist/cli/commands/governance.d.ts.map +1 -0
- package/dist/cli/commands/governance.js +60 -0
- package/dist/cli/commands/governance.js.map +1 -0
- package/dist/cli/commands/init.d.ts +27 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +158 -146
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/insights-goal-check.d.ts +54 -0
- package/dist/cli/commands/insights-goal-check.d.ts.map +1 -0
- package/dist/cli/commands/insights-goal-check.js +318 -0
- package/dist/cli/commands/insights-goal-check.js.map +1 -0
- package/dist/cli/commands/insights.d.ts +15 -0
- package/dist/cli/commands/insights.d.ts.map +1 -0
- package/dist/cli/commands/insights.js +127 -0
- package/dist/cli/commands/insights.js.map +1 -0
- package/dist/cli/commands/knowledge.d.ts +117 -0
- package/dist/cli/commands/knowledge.d.ts.map +1 -0
- package/dist/cli/commands/knowledge.js +1070 -0
- package/dist/cli/commands/knowledge.js.map +1 -0
- package/dist/cli/commands/loop.d.ts +95 -0
- package/dist/cli/commands/loop.d.ts.map +1 -0
- package/dist/cli/commands/loop.js +408 -0
- package/dist/cli/commands/loop.js.map +1 -0
- package/dist/cli/commands/maintenance.d.ts +33 -0
- package/dist/cli/commands/maintenance.d.ts.map +1 -0
- package/dist/cli/commands/maintenance.js +75 -0
- package/dist/cli/commands/maintenance.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +22 -11
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +93 -5
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/menu.d.ts.map +1 -1
- package/dist/cli/commands/menu.js +10 -184
- package/dist/cli/commands/menu.js.map +1 -1
- package/dist/cli/commands/project.d.ts +98 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/project.js +382 -0
- package/dist/cli/commands/project.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +131 -0
- package/dist/cli/commands/skills.d.ts.map +1 -1
- package/dist/cli/commands/skills.js +404 -118
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/commands/spec.d.ts +40 -0
- package/dist/cli/commands/spec.d.ts.map +1 -0
- package/dist/cli/commands/spec.js +49 -0
- package/dist/cli/commands/spec.js.map +1 -0
- package/dist/cli/commands/stats.d.ts.map +1 -1
- package/dist/cli/commands/stats.js +11 -3
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +17 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/trace.d.ts.map +1 -1
- package/dist/cli/commands/trace.js +4 -9
- package/dist/cli/commands/trace.js.map +1 -1
- package/dist/cli/commands/violations.d.ts +14 -0
- package/dist/cli/commands/violations.d.ts.map +1 -0
- package/dist/cli/commands/violations.js +43 -0
- package/dist/cli/commands/violations.js.map +1 -0
- package/dist/cli/index.js +34 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/hook-manager.d.ts +1 -1
- package/dist/cli/init/hook-manager.d.ts.map +1 -1
- package/dist/cli/init/hook-manager.js +6 -0
- package/dist/cli/init/hook-manager.js.map +1 -1
- package/dist/cli/utils/resolve-session.d.ts +32 -0
- package/dist/cli/utils/resolve-session.d.ts.map +1 -0
- package/dist/cli/utils/resolve-session.js +39 -0
- package/dist/cli/utils/resolve-session.js.map +1 -0
- package/dist/core/config.d.ts +4 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +11 -23
- package/dist/core/config.js.map +1 -1
- package/dist/core/constants.d.ts +51 -13
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +63 -13
- package/dist/core/constants.js.map +1 -1
- package/dist/core/diagnostics/checks.d.ts +151 -0
- package/dist/core/diagnostics/checks.d.ts.map +1 -0
- package/dist/core/diagnostics/checks.js +766 -0
- package/dist/core/diagnostics/checks.js.map +1 -0
- package/dist/core/diagnostics/daemon-status.d.ts +77 -0
- package/dist/core/diagnostics/daemon-status.d.ts.map +1 -0
- package/dist/core/diagnostics/daemon-status.js +113 -0
- package/dist/core/diagnostics/daemon-status.js.map +1 -0
- package/dist/core/diagnostics/entropy-checks.d.ts +83 -0
- package/dist/core/diagnostics/entropy-checks.d.ts.map +1 -0
- package/dist/core/diagnostics/entropy-checks.js +400 -0
- package/dist/core/diagnostics/entropy-checks.js.map +1 -0
- package/dist/core/diagnostics/fix-runner.d.ts +54 -0
- package/dist/core/diagnostics/fix-runner.d.ts.map +1 -0
- package/dist/core/diagnostics/fix-runner.js +90 -0
- package/dist/core/diagnostics/fix-runner.js.map +1 -0
- package/dist/core/diagnostics/heartbeat-reader.d.ts +28 -0
- package/dist/core/diagnostics/heartbeat-reader.d.ts.map +1 -0
- package/dist/core/diagnostics/heartbeat-reader.js +50 -0
- package/dist/core/diagnostics/heartbeat-reader.js.map +1 -0
- package/dist/core/diagnostics/knip-runner.d.ts +49 -0
- package/dist/core/diagnostics/knip-runner.d.ts.map +1 -0
- package/dist/core/diagnostics/knip-runner.js +100 -0
- package/dist/core/diagnostics/knip-runner.js.map +1 -0
- package/dist/core/diagnostics/markers.d.ts +96 -0
- package/dist/core/diagnostics/markers.d.ts.map +1 -0
- package/dist/core/diagnostics/markers.js +153 -0
- package/dist/core/diagnostics/markers.js.map +1 -0
- package/dist/core/event-fields.d.ts +27 -0
- package/dist/core/event-fields.d.ts.map +1 -1
- package/dist/core/event-fields.js +43 -0
- package/dist/core/event-fields.js.map +1 -1
- package/dist/core/governance/global-inject.d.ts +90 -0
- package/dist/core/governance/global-inject.d.ts.map +1 -0
- package/dist/core/governance/global-inject.js +184 -0
- package/dist/core/governance/global-inject.js.map +1 -0
- package/dist/core/insights/agent-anchor-guard.d.ts +77 -0
- package/dist/core/insights/agent-anchor-guard.d.ts.map +1 -0
- package/dist/core/insights/agent-anchor-guard.js +119 -0
- package/dist/core/insights/agent-anchor-guard.js.map +1 -0
- package/dist/core/insights/agent-distill-context.d.ts +55 -0
- package/dist/core/insights/agent-distill-context.d.ts.map +1 -0
- package/dist/core/insights/agent-distill-context.js +146 -0
- package/dist/core/insights/agent-distill-context.js.map +1 -0
- package/dist/core/insights/agent-distill-spawn.d.ts +56 -0
- package/dist/core/insights/agent-distill-spawn.d.ts.map +1 -0
- package/dist/core/insights/agent-distill-spawn.js +179 -0
- package/dist/core/insights/agent-distill-spawn.js.map +1 -0
- package/dist/core/insights/agent-drift.d.ts +66 -0
- package/dist/core/insights/agent-drift.d.ts.map +1 -0
- package/dist/core/insights/agent-drift.js +109 -0
- package/dist/core/insights/agent-drift.js.map +1 -0
- package/dist/core/insights/agent-evolution-sources.d.ts +21 -0
- package/dist/core/insights/agent-evolution-sources.d.ts.map +1 -0
- package/dist/core/insights/agent-evolution-sources.js +36 -0
- package/dist/core/insights/agent-evolution-sources.js.map +1 -0
- package/dist/core/insights/agent-health.d.ts +142 -0
- package/dist/core/insights/agent-health.d.ts.map +1 -0
- package/dist/core/insights/agent-health.js +296 -0
- package/dist/core/insights/agent-health.js.map +1 -0
- package/dist/core/insights/agent-patch-apply.d.ts +45 -0
- package/dist/core/insights/agent-patch-apply.d.ts.map +1 -0
- package/dist/core/insights/agent-patch-apply.js +165 -0
- package/dist/core/insights/agent-patch-apply.js.map +1 -0
- package/dist/core/insights/agent-suggest.d.ts +128 -0
- package/dist/core/insights/agent-suggest.d.ts.map +1 -0
- package/dist/core/insights/agent-suggest.js +284 -0
- package/dist/core/insights/agent-suggest.js.map +1 -0
- package/dist/core/insights/coverage-tiers.d.ts +46 -0
- package/dist/core/insights/coverage-tiers.d.ts.map +1 -0
- package/dist/core/insights/coverage-tiers.js +95 -0
- package/dist/core/insights/coverage-tiers.js.map +1 -0
- package/dist/core/insights/experience-extractor.d.ts +60 -0
- package/dist/core/insights/experience-extractor.d.ts.map +1 -0
- package/dist/core/insights/experience-extractor.js +319 -0
- package/dist/core/insights/experience-extractor.js.map +1 -0
- package/dist/core/insights/violation-reporter.d.ts +149 -0
- package/dist/core/insights/violation-reporter.d.ts.map +1 -0
- package/dist/core/insights/violation-reporter.js +391 -0
- package/dist/core/insights/violation-reporter.js.map +1 -0
- package/dist/core/loop/loop-engine.d.ts +140 -0
- package/dist/core/loop/loop-engine.d.ts.map +1 -0
- package/dist/core/loop/loop-engine.js +266 -0
- package/dist/core/loop/loop-engine.js.map +1 -0
- package/dist/core/queue/index.d.ts +16 -3
- package/dist/core/queue/index.d.ts.map +1 -1
- package/dist/core/queue/index.js +16 -4
- package/dist/core/queue/index.js.map +1 -1
- package/dist/core/storage/base.d.ts +317 -0
- package/dist/core/storage/base.d.ts.map +1 -1
- package/dist/core/storage/base.js +1093 -0
- package/dist/core/storage/base.js.map +1 -1
- package/dist/core/storage/codec/tool-input-codec.d.ts +93 -0
- package/dist/core/storage/codec/tool-input-codec.d.ts.map +1 -0
- package/dist/core/storage/codec/tool-input-codec.js +159 -0
- package/dist/core/storage/codec/tool-input-codec.js.map +1 -0
- package/dist/core/storage/codegraph-types.d.ts +79 -0
- package/dist/core/storage/codegraph-types.d.ts.map +1 -0
- package/dist/core/storage/codegraph-types.js +14 -0
- package/dist/core/storage/codegraph-types.js.map +1 -0
- package/dist/core/storage/codegraph.d.ts +186 -0
- package/dist/core/storage/codegraph.d.ts.map +1 -0
- package/dist/core/storage/codegraph.js +452 -0
- package/dist/core/storage/codegraph.js.map +1 -0
- package/dist/core/storage/decisions.d.ts +387 -0
- package/dist/core/storage/decisions.d.ts.map +1 -0
- package/dist/core/storage/decisions.js +534 -0
- package/dist/core/storage/decisions.js.map +1 -0
- package/dist/core/storage/events.d.ts +239 -8
- package/dist/core/storage/events.d.ts.map +1 -1
- package/dist/core/storage/events.js +705 -39
- package/dist/core/storage/events.js.map +1 -1
- package/dist/core/storage/feedback.d.ts +111 -0
- package/dist/core/storage/feedback.d.ts.map +1 -0
- package/dist/core/storage/feedback.js +186 -0
- package/dist/core/storage/feedback.js.map +1 -0
- package/dist/core/storage/forge-config.d.ts +40 -0
- package/dist/core/storage/forge-config.d.ts.map +1 -0
- package/dist/core/storage/forge-config.js +65 -0
- package/dist/core/storage/forge-config.js.map +1 -0
- package/dist/core/storage/injections.d.ts +68 -0
- package/dist/core/storage/injections.d.ts.map +1 -1
- package/dist/core/storage/injections.js +131 -5
- package/dist/core/storage/injections.js.map +1 -1
- package/dist/core/storage/knowledge.d.ts +332 -0
- package/dist/core/storage/knowledge.d.ts.map +1 -0
- package/dist/core/storage/knowledge.js +589 -0
- package/dist/core/storage/knowledge.js.map +1 -0
- package/dist/core/storage/maintenance.d.ts +36 -9
- package/dist/core/storage/maintenance.d.ts.map +1 -1
- package/dist/core/storage/maintenance.js +56 -24
- package/dist/core/storage/maintenance.js.map +1 -1
- package/dist/core/storage/pipeline-rollup.d.ts +111 -0
- package/dist/core/storage/pipeline-rollup.d.ts.map +1 -0
- package/dist/core/storage/pipeline-rollup.js +432 -0
- package/dist/core/storage/pipeline-rollup.js.map +1 -0
- package/dist/core/storage/routing.d.ts +50 -3
- package/dist/core/storage/routing.d.ts.map +1 -1
- package/dist/core/storage/routing.js +131 -10
- package/dist/core/storage/routing.js.map +1 -1
- package/dist/core/storage/rows.d.ts +31 -8
- package/dist/core/storage/rows.d.ts.map +1 -1
- package/dist/core/storage/schema.sql +367 -23
- package/dist/core/storage/sessions.d.ts +136 -0
- package/dist/core/storage/sessions.d.ts.map +1 -1
- package/dist/core/storage/sessions.js +352 -15
- package/dist/core/storage/sessions.js.map +1 -1
- package/dist/core/storage/skills.d.ts +160 -0
- package/dist/core/storage/skills.d.ts.map +1 -1
- package/dist/core/storage/skills.js +368 -7
- package/dist/core/storage/skills.js.map +1 -1
- package/dist/core/storage/sqlite.d.ts +309 -20
- package/dist/core/storage/sqlite.d.ts.map +1 -1
- package/dist/core/storage/sqlite.js +523 -16
- package/dist/core/storage/sqlite.js.map +1 -1
- package/dist/core/storage/tasks.d.ts +744 -2
- package/dist/core/storage/tasks.d.ts.map +1 -1
- package/dist/core/storage/tasks.js +1691 -17
- package/dist/core/storage/tasks.js.map +1 -1
- package/dist/core/storage/tool-intercepts.d.ts +69 -0
- package/dist/core/storage/tool-intercepts.d.ts.map +1 -0
- package/dist/core/storage/tool-intercepts.js +116 -0
- package/dist/core/storage/tool-intercepts.js.map +1 -0
- package/dist/core/types.d.ts +136 -18
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/utils/backup.d.ts +81 -0
- package/dist/core/utils/backup.d.ts.map +1 -0
- package/dist/core/utils/backup.js +98 -0
- package/dist/core/utils/backup.js.map +1 -0
- package/dist/core/utils/binary-paths.d.ts +124 -0
- package/dist/core/utils/binary-paths.d.ts.map +1 -0
- package/dist/core/utils/binary-paths.js +218 -0
- package/dist/core/utils/binary-paths.js.map +1 -0
- package/dist/core/utils/bypass-token.d.ts +75 -0
- package/dist/core/utils/bypass-token.d.ts.map +1 -0
- package/dist/core/utils/bypass-token.js +133 -0
- package/dist/core/utils/bypass-token.js.map +1 -0
- package/dist/core/utils/cc-builtin-agents.d.ts +3 -0
- package/dist/core/utils/cc-builtin-agents.d.ts.map +1 -0
- package/dist/core/utils/cc-builtin-agents.js +29 -0
- package/dist/core/utils/cc-builtin-agents.js.map +1 -0
- package/dist/core/utils/claude-cli-resolver.d.ts +26 -0
- package/dist/core/utils/claude-cli-resolver.d.ts.map +1 -0
- package/dist/core/utils/claude-cli-resolver.js +115 -0
- package/dist/core/utils/claude-cli-resolver.js.map +1 -0
- package/dist/core/utils/claude-cli-spawn.d.ts +106 -0
- package/dist/core/utils/claude-cli-spawn.d.ts.map +1 -0
- package/dist/core/utils/claude-cli-spawn.js +219 -0
- package/dist/core/utils/claude-cli-spawn.js.map +1 -0
- package/dist/core/utils/forge-resume-block.d.ts.map +1 -1
- package/dist/core/utils/forge-resume-block.js +3 -2
- package/dist/core/utils/forge-resume-block.js.map +1 -1
- package/dist/core/utils/logger.d.ts +15 -3
- package/dist/core/utils/logger.d.ts.map +1 -1
- package/dist/core/utils/logger.js +20 -2
- package/dist/core/utils/logger.js.map +1 -1
- package/dist/core/utils/noise-prompt.d.ts +97 -0
- package/dist/core/utils/noise-prompt.d.ts.map +1 -0
- package/dist/core/utils/noise-prompt.js +127 -0
- package/dist/core/utils/noise-prompt.js.map +1 -0
- package/dist/core/utils/path.d.ts +0 -4
- package/dist/core/utils/path.d.ts.map +1 -1
- package/dist/core/utils/path.js +0 -7
- package/dist/core/utils/path.js.map +1 -1
- package/dist/core/utils/time.d.ts +67 -0
- package/dist/core/utils/time.d.ts.map +1 -1
- package/dist/core/utils/time.js +147 -0
- package/dist/core/utils/time.js.map +1 -1
- package/dist/daemon/agent-sync.d.ts +24 -0
- package/dist/daemon/agent-sync.d.ts.map +1 -0
- package/dist/daemon/agent-sync.js +114 -0
- package/dist/daemon/agent-sync.js.map +1 -0
- package/dist/daemon/config-store.d.ts +55 -0
- package/dist/daemon/config-store.d.ts.map +1 -0
- package/dist/daemon/config-store.js +146 -0
- package/dist/daemon/config-store.js.map +1 -0
- package/dist/daemon/event-parser.d.ts +22 -0
- package/dist/daemon/event-parser.d.ts.map +1 -1
- package/dist/daemon/event-parser.js +54 -3
- package/dist/daemon/event-parser.js.map +1 -1
- package/dist/daemon/handlers/history-exporter.d.ts.map +1 -1
- package/dist/daemon/handlers/history-exporter.js +9 -8
- package/dist/daemon/handlers/history-exporter.js.map +1 -1
- package/dist/daemon/handlers/post-tool-use.d.ts +66 -4
- package/dist/daemon/handlers/post-tool-use.d.ts.map +1 -1
- package/dist/daemon/handlers/post-tool-use.js +221 -8
- package/dist/daemon/handlers/post-tool-use.js.map +1 -1
- package/dist/daemon/handlers/pre-tool-use.d.ts +181 -0
- package/dist/daemon/handlers/pre-tool-use.d.ts.map +1 -0
- package/dist/daemon/handlers/pre-tool-use.js +618 -0
- package/dist/daemon/handlers/pre-tool-use.js.map +1 -0
- package/dist/daemon/handlers/stop.d.ts +55 -7
- package/dist/daemon/handlers/stop.d.ts.map +1 -1
- package/dist/daemon/handlers/stop.js +245 -8
- package/dist/daemon/handlers/stop.js.map +1 -1
- package/dist/daemon/handlers/user-prompt.d.ts +51 -14
- package/dist/daemon/handlers/user-prompt.d.ts.map +1 -1
- package/dist/daemon/handlers/user-prompt.js +223 -95
- package/dist/daemon/handlers/user-prompt.js.map +1 -1
- package/dist/daemon/handlers/violation-content-backfill.d.ts +76 -0
- package/dist/daemon/handlers/violation-content-backfill.d.ts.map +1 -0
- package/dist/daemon/handlers/violation-content-backfill.js +167 -0
- package/dist/daemon/handlers/violation-content-backfill.js.map +1 -0
- package/dist/daemon/hook-sync.d.ts.map +1 -1
- package/dist/daemon/hook-sync.js +2 -1
- package/dist/daemon/hook-sync.js.map +1 -1
- package/dist/daemon/index.d.ts +19 -0
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +439 -86
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/lifecycle.d.ts +48 -1
- package/dist/daemon/lifecycle.d.ts.map +1 -1
- package/dist/daemon/lifecycle.js +98 -2
- package/dist/daemon/lifecycle.js.map +1 -1
- package/dist/daemon/router.d.ts +4 -1
- package/dist/daemon/router.d.ts.map +1 -1
- package/dist/daemon/router.js +4 -2
- package/dist/daemon/router.js.map +1 -1
- package/dist/daemon/rules/defaults.d.ts +20 -0
- package/dist/daemon/rules/defaults.d.ts.map +1 -0
- package/dist/daemon/rules/defaults.js +779 -0
- package/dist/daemon/rules/defaults.js.map +1 -0
- package/dist/daemon/rules/registry.d.ts +47 -0
- package/dist/daemon/rules/registry.d.ts.map +1 -0
- package/dist/daemon/rules/registry.js +84 -0
- package/dist/daemon/rules/registry.js.map +1 -0
- package/dist/daemon/rules/types.d.ts +176 -0
- package/dist/daemon/rules/types.d.ts.map +1 -0
- package/dist/daemon/rules/types.js +15 -0
- package/dist/daemon/rules/types.js.map +1 -0
- package/dist/daemon/rules/whitelist.d.ts +101 -0
- package/dist/daemon/rules/whitelist.d.ts.map +1 -0
- package/dist/daemon/rules/whitelist.js +210 -0
- package/dist/daemon/rules/whitelist.js.map +1 -0
- package/dist/daemon/rules/workflow-defaults.d.ts +52 -0
- package/dist/daemon/rules/workflow-defaults.d.ts.map +1 -0
- package/dist/daemon/rules/workflow-defaults.js +521 -0
- package/dist/daemon/rules/workflow-defaults.js.map +1 -0
- package/dist/daemon/server.d.ts +11 -1
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +7 -1
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/services/codegraph-sync.d.ts +94 -0
- package/dist/daemon/services/codegraph-sync.d.ts.map +1 -0
- package/dist/daemon/services/codegraph-sync.js +159 -0
- package/dist/daemon/services/codegraph-sync.js.map +1 -0
- package/dist/daemon/services/context-injector.d.ts +34 -0
- package/dist/daemon/services/context-injector.d.ts.map +1 -0
- package/dist/daemon/services/context-injector.js +61 -0
- package/dist/daemon/services/context-injector.js.map +1 -0
- package/dist/daemon/services/decision-hint.d.ts +240 -0
- package/dist/daemon/services/decision-hint.d.ts.map +1 -0
- package/dist/daemon/services/decision-hint.js +562 -0
- package/dist/daemon/services/decision-hint.js.map +1 -0
- package/dist/daemon/services/event-ttl-sweep.d.ts +86 -0
- package/dist/daemon/services/event-ttl-sweep.d.ts.map +1 -0
- package/dist/daemon/services/event-ttl-sweep.js +124 -0
- package/dist/daemon/services/event-ttl-sweep.js.map +1 -0
- package/dist/daemon/services/feedback-aggregator.d.ts +167 -0
- package/dist/daemon/services/feedback-aggregator.d.ts.map +1 -0
- package/dist/daemon/services/feedback-aggregator.js +415 -0
- package/dist/daemon/services/feedback-aggregator.js.map +1 -0
- package/dist/daemon/services/heartbeat-writer.d.ts +46 -0
- package/dist/daemon/services/heartbeat-writer.d.ts.map +1 -0
- package/dist/daemon/services/heartbeat-writer.js +82 -0
- package/dist/daemon/services/heartbeat-writer.js.map +1 -0
- package/dist/daemon/services/idle-session-sweeper.d.ts +61 -0
- package/dist/daemon/services/idle-session-sweeper.d.ts.map +1 -0
- package/dist/daemon/services/idle-session-sweeper.js +94 -0
- package/dist/daemon/services/idle-session-sweeper.js.map +1 -0
- package/dist/daemon/services/idle-task-budget.d.ts +50 -0
- package/dist/daemon/services/idle-task-budget.d.ts.map +1 -0
- package/dist/daemon/services/idle-task-budget.js +72 -0
- package/dist/daemon/services/idle-task-budget.js.map +1 -0
- package/dist/daemon/services/intercept-revive.d.ts +60 -0
- package/dist/daemon/services/intercept-revive.d.ts.map +1 -0
- package/dist/daemon/services/intercept-revive.js +86 -0
- package/dist/daemon/services/intercept-revive.js.map +1 -0
- package/dist/daemon/services/intercept-rollback-guard.d.ts +105 -0
- package/dist/daemon/services/intercept-rollback-guard.d.ts.map +1 -0
- package/dist/daemon/services/intercept-rollback-guard.js +152 -0
- package/dist/daemon/services/intercept-rollback-guard.js.map +1 -0
- package/dist/daemon/services/intercept-timeout-sweeper.d.ts +58 -0
- package/dist/daemon/services/intercept-timeout-sweeper.d.ts.map +1 -0
- package/dist/daemon/services/intercept-timeout-sweeper.js +83 -0
- package/dist/daemon/services/intercept-timeout-sweeper.js.map +1 -0
- package/dist/daemon/services/kb-injector.d.ts +57 -0
- package/dist/daemon/services/kb-injector.d.ts.map +1 -0
- package/dist/daemon/services/kb-injector.js +148 -0
- package/dist/daemon/services/kb-injector.js.map +1 -0
- package/dist/daemon/services/kb-rebuild-scheduler.d.ts +95 -0
- package/dist/daemon/services/kb-rebuild-scheduler.d.ts.map +1 -0
- package/dist/daemon/services/kb-rebuild-scheduler.js +149 -0
- package/dist/daemon/services/kb-rebuild-scheduler.js.map +1 -0
- package/dist/daemon/services/loop-hint.d.ts +139 -0
- package/dist/daemon/services/loop-hint.d.ts.map +1 -0
- package/dist/daemon/services/loop-hint.js +272 -0
- package/dist/daemon/services/loop-hint.js.map +1 -0
- package/dist/daemon/services/outcome-classification-service.d.ts +49 -0
- package/dist/daemon/services/outcome-classification-service.d.ts.map +1 -0
- package/dist/daemon/services/outcome-classification-service.js +214 -0
- package/dist/daemon/services/outcome-classification-service.js.map +1 -0
- package/dist/daemon/services/outcome-classifier.d.ts +136 -0
- package/dist/daemon/services/outcome-classifier.d.ts.map +1 -0
- package/dist/daemon/services/outcome-classifier.js +178 -0
- package/dist/daemon/services/outcome-classifier.js.map +1 -0
- package/dist/daemon/services/outcome-nudge.d.ts +107 -0
- package/dist/daemon/services/outcome-nudge.d.ts.map +1 -0
- package/dist/daemon/services/outcome-nudge.js +242 -0
- package/dist/daemon/services/outcome-nudge.js.map +1 -0
- package/dist/daemon/services/spec-approval.d.ts +127 -0
- package/dist/daemon/services/spec-approval.d.ts.map +1 -0
- package/dist/daemon/services/spec-approval.js +216 -0
- package/dist/daemon/services/spec-approval.js.map +1 -0
- package/dist/daemon/services/spec-gate.d.ts +54 -0
- package/dist/daemon/services/spec-gate.d.ts.map +1 -0
- package/dist/daemon/services/spec-gate.js +113 -0
- package/dist/daemon/services/spec-gate.js.map +1 -0
- package/dist/daemon/services/task-boundary-classifier.d.ts +78 -0
- package/dist/daemon/services/task-boundary-classifier.d.ts.map +1 -0
- package/dist/daemon/services/task-boundary-classifier.js +202 -0
- package/dist/daemon/services/task-boundary-classifier.js.map +1 -0
- package/dist/daemon/services/task-segmenter.d.ts +230 -1
- package/dist/daemon/services/task-segmenter.d.ts.map +1 -1
- package/dist/daemon/services/task-segmenter.js +527 -17
- package/dist/daemon/services/task-segmenter.js.map +1 -1
- package/dist/daemon/skill-sync.d.ts +7 -2
- package/dist/daemon/skill-sync.d.ts.map +1 -1
- package/dist/daemon/skill-sync.js +114 -9
- package/dist/daemon/skill-sync.js.map +1 -1
- package/dist/daemon/startup/maintenance-schedulers.d.ts +68 -0
- package/dist/daemon/startup/maintenance-schedulers.d.ts.map +1 -0
- package/dist/daemon/startup/maintenance-schedulers.js +294 -0
- package/dist/daemon/startup/maintenance-schedulers.js.map +1 -0
- package/dist/daemon/templates/agents/agent-retro-distiller.md +106 -0
- package/dist/daemon/templates/agents/claudemd-writer.md +102 -0
- package/dist/daemon/templates/agents/coder.md +262 -0
- package/dist/daemon/templates/agents/decision-maker.md +546 -0
- package/dist/daemon/templates/agents/doc-reviewer.md +118 -0
- package/dist/daemon/templates/agents/harness-debug-full.md +196 -0
- package/dist/daemon/templates/agents/knowledge-builder.md +120 -0
- package/dist/daemon/templates/agents/patch-applier.md +145 -0
- package/dist/daemon/templates/agents/planner.md +217 -0
- package/dist/daemon/templates/agents/safety-net-implementer.md +278 -0
- package/dist/daemon/templates/agents/skill-distiller.md +114 -0
- package/dist/daemon/templates/agents/task-boundary-classifier.md +65 -0
- package/dist/daemon/templates/agents/verify-agent.md +259 -0
- package/dist/daemon/utils/inject-block.d.ts +39 -0
- package/dist/daemon/utils/inject-block.d.ts.map +1 -0
- package/dist/daemon/utils/inject-block.js +25 -0
- package/dist/daemon/utils/inject-block.js.map +1 -0
- package/dist/hooks/hook-lib.sh +8 -0
- package/dist/hooks/notification.sh +19 -8
- package/dist/hooks/post-tool-use.sh +41 -23
- package/dist/hooks/pre-tool-use.sh +54 -23
- package/dist/hooks/session-start.sh +68 -0
- package/dist/hooks/stop.sh +31 -11
- package/dist/hooks/user-prompt-submit.sh +37 -21
- package/dist/knowledge/adapters/go-adapter.d.ts +65 -0
- package/dist/knowledge/adapters/go-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/go-adapter.js +294 -0
- package/dist/knowledge/adapters/go-adapter.js.map +1 -0
- package/dist/knowledge/adapters/index.d.ts +41 -0
- package/dist/knowledge/adapters/index.d.ts.map +1 -0
- package/dist/knowledge/adapters/index.js +71 -0
- package/dist/knowledge/adapters/index.js.map +1 -0
- package/dist/knowledge/adapters/java-adapter.d.ts +66 -0
- package/dist/knowledge/adapters/java-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/java-adapter.js +260 -0
- package/dist/knowledge/adapters/java-adapter.js.map +1 -0
- package/dist/knowledge/adapters/js-vue-adapter.d.ts +56 -0
- package/dist/knowledge/adapters/js-vue-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/js-vue-adapter.js +203 -0
- package/dist/knowledge/adapters/js-vue-adapter.js.map +1 -0
- package/dist/knowledge/adapters/kotlin-adapter.d.ts +55 -0
- package/dist/knowledge/adapters/kotlin-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/kotlin-adapter.js +209 -0
- package/dist/knowledge/adapters/kotlin-adapter.js.map +1 -0
- package/dist/knowledge/adapters/monorepo-adapter.d.ts +77 -0
- package/dist/knowledge/adapters/monorepo-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/monorepo-adapter.js +170 -0
- package/dist/knowledge/adapters/monorepo-adapter.js.map +1 -0
- package/dist/knowledge/adapters/python-adapter.d.ts +89 -0
- package/dist/knowledge/adapters/python-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/python-adapter.js +358 -0
- package/dist/knowledge/adapters/python-adapter.js.map +1 -0
- package/dist/knowledge/adapters/rust-adapter.d.ts +73 -0
- package/dist/knowledge/adapters/rust-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/rust-adapter.js +329 -0
- package/dist/knowledge/adapters/rust-adapter.js.map +1 -0
- package/dist/knowledge/adapters/types.d.ts +99 -0
- package/dist/knowledge/adapters/types.d.ts.map +1 -0
- package/dist/knowledge/adapters/types.js +17 -0
- package/dist/knowledge/adapters/types.js.map +1 -0
- package/dist/knowledge/adapters/typescript-adapter.d.ts +57 -0
- package/dist/knowledge/adapters/typescript-adapter.d.ts.map +1 -0
- package/dist/knowledge/adapters/typescript-adapter.js +171 -0
- package/dist/knowledge/adapters/typescript-adapter.js.map +1 -0
- package/dist/knowledge/audit-applier.d.ts +70 -0
- package/dist/knowledge/audit-applier.d.ts.map +1 -0
- package/dist/knowledge/audit-applier.js +251 -0
- package/dist/knowledge/audit-applier.js.map +1 -0
- package/dist/knowledge/builder.d.ts +261 -0
- package/dist/knowledge/builder.d.ts.map +1 -0
- package/dist/knowledge/builder.js +966 -0
- package/dist/knowledge/builder.js.map +1 -0
- package/dist/knowledge/cli-provider.d.ts +151 -0
- package/dist/knowledge/cli-provider.d.ts.map +1 -0
- package/dist/knowledge/cli-provider.js +313 -0
- package/dist/knowledge/cli-provider.js.map +1 -0
- package/dist/knowledge/constants.d.ts +78 -0
- package/dist/knowledge/constants.d.ts.map +1 -0
- package/dist/knowledge/constants.js +98 -0
- package/dist/knowledge/constants.js.map +1 -0
- package/dist/knowledge/cross-module.d.ts +139 -0
- package/dist/knowledge/cross-module.d.ts.map +1 -0
- package/dist/knowledge/cross-module.js +370 -0
- package/dist/knowledge/cross-module.js.map +1 -0
- package/dist/knowledge/git-hooks.d.ts +67 -0
- package/dist/knowledge/git-hooks.d.ts.map +1 -0
- package/dist/knowledge/git-hooks.js +258 -0
- package/dist/knowledge/git-hooks.js.map +1 -0
- package/dist/knowledge/graph/edge-extractor.d.ts +45 -0
- package/dist/knowledge/graph/edge-extractor.d.ts.map +1 -0
- package/dist/knowledge/graph/edge-extractor.js +242 -0
- package/dist/knowledge/graph/edge-extractor.js.map +1 -0
- package/dist/knowledge/graph/impact.d.ts +73 -0
- package/dist/knowledge/graph/impact.d.ts.map +1 -0
- package/dist/knowledge/graph/impact.js +94 -0
- package/dist/knowledge/graph/impact.js.map +1 -0
- package/dist/knowledge/graph/types.d.ts +22 -0
- package/dist/knowledge/graph/types.d.ts.map +1 -0
- package/dist/knowledge/graph/types.js +13 -0
- package/dist/knowledge/graph/types.js.map +1 -0
- package/dist/knowledge/module-hash.d.ts +88 -0
- package/dist/knowledge/module-hash.d.ts.map +1 -0
- package/dist/knowledge/module-hash.js +162 -0
- package/dist/knowledge/module-hash.js.map +1 -0
- package/dist/knowledge/project-detector.d.ts +101 -0
- package/dist/knowledge/project-detector.d.ts.map +1 -0
- package/dist/knowledge/project-detector.js +223 -0
- package/dist/knowledge/project-detector.js.map +1 -0
- package/dist/knowledge/prompt.d.ts +237 -0
- package/dist/knowledge/prompt.d.ts.map +1 -0
- package/dist/knowledge/prompt.js +416 -0
- package/dist/knowledge/prompt.js.map +1 -0
- package/dist/knowledge/query.d.ts +118 -0
- package/dist/knowledge/query.d.ts.map +1 -0
- package/dist/knowledge/query.js +438 -0
- package/dist/knowledge/query.js.map +1 -0
- package/dist/knowledge/repo-map.d.ts +97 -0
- package/dist/knowledge/repo-map.d.ts.map +1 -0
- package/dist/knowledge/repo-map.js +447 -0
- package/dist/knowledge/repo-map.js.map +1 -0
- package/dist/knowledge/tools/index.d.ts +14 -0
- package/dist/knowledge/tools/index.d.ts.map +1 -0
- package/dist/knowledge/tools/index.js +11 -0
- package/dist/knowledge/tools/index.js.map +1 -0
- package/dist/knowledge/tools/knowledge-get-page.d.ts +46 -0
- package/dist/knowledge/tools/knowledge-get-page.d.ts.map +1 -0
- package/dist/knowledge/tools/knowledge-get-page.js +101 -0
- package/dist/knowledge/tools/knowledge-get-page.js.map +1 -0
- package/dist/knowledge/tools/knowledge-query.d.ts +77 -0
- package/dist/knowledge/tools/knowledge-query.d.ts.map +1 -0
- package/dist/knowledge/tools/knowledge-query.js +104 -0
- package/dist/knowledge/tools/knowledge-query.js.map +1 -0
- package/dist/knowledge/tools/repo-map-lookup.d.ts +45 -0
- package/dist/knowledge/tools/repo-map-lookup.d.ts.map +1 -0
- package/dist/knowledge/tools/repo-map-lookup.js +82 -0
- package/dist/knowledge/tools/repo-map-lookup.js.map +1 -0
- package/dist/knowledge/types.d.ts +269 -0
- package/dist/knowledge/types.d.ts.map +1 -0
- package/dist/knowledge/types.js +10 -0
- package/dist/knowledge/types.js.map +1 -0
- package/dist/knowledge/validator.d.ts +90 -0
- package/dist/knowledge/validator.d.ts.map +1 -0
- package/dist/knowledge/validator.js +355 -0
- package/dist/knowledge/validator.js.map +1 -0
- package/dist/mcp/server.d.ts +64 -8
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +448 -12
- package/dist/mcp/server.js.map +1 -1
- package/dist/skills/builtin-skills.d.ts +35 -0
- package/dist/skills/builtin-skills.d.ts.map +1 -0
- package/dist/skills/builtin-skills.js +68 -0
- package/dist/skills/builtin-skills.js.map +1 -0
- package/dist/skills/distill/attribution.d.ts +59 -0
- package/dist/skills/distill/attribution.d.ts.map +1 -0
- package/dist/skills/distill/attribution.js +101 -0
- package/dist/skills/distill/attribution.js.map +1 -0
- package/dist/skills/distill/distiller.d.ts +161 -0
- package/dist/skills/distill/distiller.d.ts.map +1 -0
- package/dist/skills/distill/distiller.js +461 -0
- package/dist/skills/distill/distiller.js.map +1 -0
- package/dist/skills/distill/index.d.ts +223 -0
- package/dist/skills/distill/index.d.ts.map +1 -0
- package/dist/skills/distill/index.js +466 -0
- package/dist/skills/distill/index.js.map +1 -0
- package/dist/skills/distill/project-anchor-guard.d.ts +116 -0
- package/dist/skills/distill/project-anchor-guard.d.ts.map +1 -0
- package/dist/skills/distill/project-anchor-guard.js +334 -0
- package/dist/skills/distill/project-anchor-guard.js.map +1 -0
- package/dist/skills/distill/topic-deduper.d.ts +77 -0
- package/dist/skills/distill/topic-deduper.d.ts.map +1 -0
- package/dist/skills/distill/topic-deduper.js +119 -0
- package/dist/skills/distill/topic-deduper.js.map +1 -0
- package/dist/skills/distill/upstream-fetcher.d.ts +71 -0
- package/dist/skills/distill/upstream-fetcher.d.ts.map +1 -0
- package/dist/skills/distill/upstream-fetcher.js +202 -0
- package/dist/skills/distill/upstream-fetcher.js.map +1 -0
- package/dist/skills/distilled/distilled-api-design.md +495 -0
- package/dist/skills/distilled/distilled-architecture-decision.md +173 -0
- package/dist/skills/distilled/distilled-brainstorming.md +79 -0
- package/dist/skills/distilled/distilled-brand-guidelines.md +86 -0
- package/dist/skills/distilled/distilled-canvas-design.md +128 -0
- package/dist/skills/distilled/distilled-claude-api.md +185 -0
- package/dist/skills/distilled/distilled-creator.md +181 -0
- package/dist/skills/distilled/distilled-db-schema-design.md +245 -0
- package/dist/skills/distilled/distilled-dispatching-parallel-agents.md +136 -0
- package/dist/skills/distilled/distilled-doc-coauthoring.md +144 -0
- package/dist/skills/distilled/distilled-docx.md +231 -0
- package/dist/skills/distilled/distilled-executing-plans.md +148 -0
- package/dist/skills/distilled/distilled-finishing-a-development-branch.md +213 -0
- package/dist/skills/distilled/distilled-frontend-design.md +118 -0
- package/dist/skills/distilled/distilled-harness-engineering.md +242 -0
- package/dist/skills/distilled/distilled-karpathy-guidelines.md +104 -0
- package/dist/skills/distilled/distilled-performance-optimization.md +175 -0
- package/dist/skills/distilled/distilled-receiving-code-review.md +185 -0
- package/dist/skills/distilled/distilled-spec-driven-design.md +193 -0
- package/dist/skills/distilled/distilled-subagent-driven-development.md +124 -0
- package/dist/skills/distilled/distilled-systematic-debugging.md +154 -0
- package/dist/skills/distilled/distilled-test-driven-development.md +432 -0
- package/dist/skills/distilled/distilled-using-superpowers.md +134 -0
- package/dist/skills/distilled/distilled-verification-before-completion.md +213 -0
- package/dist/skills/distilled/distilled-writing-skills.md +175 -0
- package/dist/skills/registry.d.ts +55 -51
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +82 -196
- package/dist/skills/registry.js.map +1 -1
- package/dist/skills/tools/pipeline-suggest.js +14 -14
- package/dist/skills/tools/pipeline-suggest.js.map +1 -1
- package/dist/skills/tools/skill-invoke.d.ts +3 -2
- package/dist/skills/tools/skill-invoke.d.ts.map +1 -1
- package/dist/skills/tools/skill-invoke.js +4 -2
- package/dist/skills/tools/skill-invoke.js.map +1 -1
- package/dist/web/analytics/anti-pattern-detector.d.ts.map +1 -1
- package/dist/web/analytics/anti-pattern-detector.js +6 -1
- package/dist/web/analytics/anti-pattern-detector.js.map +1 -1
- package/dist/web/analytics/drift-detector.d.ts +6 -0
- package/dist/web/analytics/drift-detector.d.ts.map +1 -1
- package/dist/web/analytics/drift-detector.js +15 -8
- package/dist/web/analytics/drift-detector.js.map +1 -1
- package/dist/web/analytics/weekly-report.d.ts +13 -0
- package/dist/web/analytics/weekly-report.d.ts.map +1 -1
- package/dist/web/analytics/weekly-report.js +17 -3
- package/dist/web/analytics/weekly-report.js.map +1 -1
- package/dist/web/routes/_helpers.d.ts +31 -0
- package/dist/web/routes/_helpers.d.ts.map +1 -1
- package/dist/web/routes/_helpers.js +33 -0
- package/dist/web/routes/_helpers.js.map +1 -1
- package/dist/web/routes/agent-content.d.ts +30 -0
- package/dist/web/routes/agent-content.d.ts.map +1 -0
- package/dist/web/routes/agent-content.js +139 -0
- package/dist/web/routes/agent-content.js.map +1 -0
- package/dist/web/routes/agent-distill.d.ts +49 -0
- package/dist/web/routes/agent-distill.d.ts.map +1 -0
- package/dist/web/routes/agent-distill.js +526 -0
- package/dist/web/routes/agent-distill.js.map +1 -0
- package/dist/web/routes/config.d.ts +56 -0
- package/dist/web/routes/config.d.ts.map +1 -0
- package/dist/web/routes/config.js +243 -0
- package/dist/web/routes/config.js.map +1 -0
- package/dist/web/routes/decisions.d.ts +15 -0
- package/dist/web/routes/decisions.d.ts.map +1 -0
- package/dist/web/routes/decisions.js +181 -0
- package/dist/web/routes/decisions.js.map +1 -0
- package/dist/web/routes/diagnostics.d.ts +61 -0
- package/dist/web/routes/diagnostics.d.ts.map +1 -0
- package/dist/web/routes/diagnostics.js +203 -0
- package/dist/web/routes/diagnostics.js.map +1 -0
- package/dist/web/routes/error-handler.d.ts +0 -4
- package/dist/web/routes/error-handler.d.ts.map +1 -1
- package/dist/web/routes/error-handler.js +0 -8
- package/dist/web/routes/error-handler.js.map +1 -1
- package/dist/web/routes/events.d.ts.map +1 -1
- package/dist/web/routes/events.js +26 -1
- package/dist/web/routes/events.js.map +1 -1
- package/dist/web/routes/health.d.ts +33 -0
- package/dist/web/routes/health.d.ts.map +1 -0
- package/dist/web/routes/health.js +37 -0
- package/dist/web/routes/health.js.map +1 -0
- package/dist/web/routes/insights.d.ts +0 -5
- package/dist/web/routes/insights.d.ts.map +1 -1
- package/dist/web/routes/insights.js +0 -0
- package/dist/web/routes/insights.js.map +1 -1
- package/dist/web/routes/knowledge.d.ts +57 -0
- package/dist/web/routes/knowledge.d.ts.map +1 -0
- package/dist/web/routes/knowledge.js +772 -0
- package/dist/web/routes/knowledge.js.map +1 -0
- package/dist/web/routes/patch.d.ts +60 -1
- package/dist/web/routes/patch.d.ts.map +1 -1
- package/dist/web/routes/patch.js +170 -64
- package/dist/web/routes/patch.js.map +1 -1
- package/dist/web/routes/pipeline.d.ts +28 -0
- package/dist/web/routes/pipeline.d.ts.map +1 -0
- package/dist/web/routes/pipeline.js +145 -0
- package/dist/web/routes/pipeline.js.map +1 -0
- package/dist/web/routes/rules.d.ts.map +1 -1
- package/dist/web/routes/rules.js +26 -7
- package/dist/web/routes/rules.js.map +1 -1
- package/dist/web/routes/sessions.d.ts.map +1 -1
- package/dist/web/routes/sessions.js +17 -8
- package/dist/web/routes/sessions.js.map +1 -1
- package/dist/web/routes/skill-content.d.ts +30 -0
- package/dist/web/routes/skill-content.d.ts.map +1 -0
- package/dist/web/routes/skill-content.js +117 -0
- package/dist/web/routes/skill-content.js.map +1 -0
- package/dist/web/routes/skill-stats.d.ts.map +1 -1
- package/dist/web/routes/skill-stats.js +153 -16
- package/dist/web/routes/skill-stats.js.map +1 -1
- package/dist/web/routes/skills-distill.d.ts +29 -0
- package/dist/web/routes/skills-distill.d.ts.map +1 -0
- package/dist/web/routes/skills-distill.js +552 -0
- package/dist/web/routes/skills-distill.js.map +1 -0
- package/dist/web/routes/skills.js +7 -7
- package/dist/web/routes/skills.js.map +1 -1
- package/dist/web/routes/stats.d.ts.map +1 -1
- package/dist/web/routes/stats.js +2 -1
- package/dist/web/routes/stats.js.map +1 -1
- package/dist/web/routes/task-timeline.d.ts +178 -0
- package/dist/web/routes/task-timeline.d.ts.map +1 -0
- package/dist/web/routes/task-timeline.js +530 -0
- package/dist/web/routes/task-timeline.js.map +1 -0
- package/dist/web/routes/tasks.d.ts.map +1 -1
- package/dist/web/routes/tasks.js +377 -8
- package/dist/web/routes/tasks.js.map +1 -1
- package/dist/web/routes/trace.d.ts.map +1 -1
- package/dist/web/routes/trace.js +3 -2
- package/dist/web/routes/trace.js.map +1 -1
- package/dist/web/routes/types.d.ts +0 -4
- package/dist/web/routes/types.d.ts.map +1 -1
- package/dist/web/routes/types.js +1 -1
- package/dist/web/routes/types.js.map +1 -1
- package/dist/web/routes/violations.d.ts +14 -0
- package/dist/web/routes/violations.d.ts.map +1 -0
- package/dist/web/routes/violations.js +112 -0
- package/dist/web/routes/violations.js.map +1 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +99 -19
- package/dist/web/server.js.map +1 -1
- package/dist/web/services/agent-distill-manager.d.ts +122 -0
- package/dist/web/services/agent-distill-manager.d.ts.map +1 -0
- package/dist/web/services/agent-distill-manager.js +397 -0
- package/dist/web/services/agent-distill-manager.js.map +1 -0
- package/dist/web/services/build-manager.d.ts +72 -0
- package/dist/web/services/build-manager.d.ts.map +1 -0
- package/dist/web/services/build-manager.js +189 -0
- package/dist/web/services/build-manager.js.map +1 -0
- package/dist/web/services/distill-manager.d.ts +172 -0
- package/dist/web/services/distill-manager.d.ts.map +1 -0
- package/dist/web/services/distill-manager.js +411 -0
- package/dist/web/services/distill-manager.js.map +1 -0
- package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js +2 -0
- package/dist/web/static/assets/AgentDetailPage-DlUeA1sX.js.map +1 -0
- package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js +3 -0
- package/dist/web/static/assets/AgentDistillRunPage-Cybo4bii.js.map +1 -0
- package/dist/web/static/assets/AgentsPage-Qd9FExLG.js +2 -0
- package/dist/web/static/assets/AgentsPage-Qd9FExLG.js.map +1 -0
- package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js +2 -0
- package/dist/web/static/assets/DaemonHealthPage-DTSVqtrI.js.map +1 -0
- package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js +2 -0
- package/dist/web/static/assets/DecisionDetailPage-b4BA8dhc.js.map +1 -0
- package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js +2 -0
- package/dist/web/static/assets/DecisionsPage-a3NRo_T7.js.map +1 -0
- package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js +2 -0
- package/dist/web/static/assets/DiagnosticsPage-DIVdiIQG.js.map +1 -0
- package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js +4 -0
- package/dist/web/static/assets/DistillDetailPage-U6a3l2iP.js.map +1 -0
- package/dist/web/static/assets/DistillPage-O7BHtRN8.js +2 -0
- package/dist/web/static/assets/DistillPage-O7BHtRN8.js.map +1 -0
- package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js +2 -0
- package/dist/web/static/assets/DistillRunPage-D1JuRWWr.js.map +1 -0
- package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js +2 -0
- package/dist/web/static/assets/GlobalScopeHint-Q3wTJx3F.js.map +1 -0
- package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js +2 -0
- package/dist/web/static/assets/IssueDetailPage-BDfrtk2C.js.map +1 -0
- package/dist/web/static/assets/IssuesPage-SKmhlCrw.js +2 -0
- package/dist/web/static/assets/IssuesPage-SKmhlCrw.js.map +1 -0
- package/dist/web/static/assets/KbDetailPage-Yna86Na8.js +2 -0
- package/dist/web/static/assets/KbDetailPage-Yna86Na8.js.map +1 -0
- package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js +2 -0
- package/dist/web/static/assets/KbHitsPage-Cljl7H9p.js.map +1 -0
- package/dist/web/static/assets/MarkdownRenderer-DlDQNihj.js +3 -0
- package/dist/web/static/assets/MarkdownRenderer-DlDQNihj.js.map +1 -0
- package/dist/web/static/assets/NotFound-LMzbP51V.js +2 -0
- package/dist/web/static/assets/NotFound-LMzbP51V.js.map +1 -0
- package/dist/web/static/assets/SettingsPage-DzoK4PKg.js +2 -0
- package/dist/web/static/assets/SettingsPage-DzoK4PKg.js.map +1 -0
- package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js +2 -0
- package/dist/web/static/assets/SkillDetailPage-BuBJJ_NX.js.map +1 -0
- package/dist/web/static/assets/SkillsPage-aojkJpBc.js +2 -0
- package/dist/web/static/assets/SkillsPage-aojkJpBc.js.map +1 -0
- package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js +4 -0
- package/dist/web/static/assets/TaskDetailPage-1ckxnGhw.js.map +1 -0
- package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js +6 -0
- package/dist/web/static/assets/TasksHubPage-C2PLh3eg.js.map +1 -0
- package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js +2 -0
- package/dist/web/static/assets/WorkplacePage-DHrp5VxS.js.map +1 -0
- package/dist/web/static/assets/arco-DFQA6dO_.css +1 -0
- package/dist/web/static/assets/arco-DV6xCLhr.js +14 -0
- package/dist/web/static/assets/arco-DV6xCLhr.js.map +1 -0
- package/dist/web/static/assets/charts-BSV4cyC4.js +37 -0
- package/dist/web/static/assets/charts-BSV4cyC4.js.map +1 -0
- package/dist/web/static/assets/date-fns-sbWH3_uq.js +2 -0
- package/dist/web/static/assets/date-fns-sbWH3_uq.js.map +1 -0
- package/dist/web/static/assets/index-B_v_MKlb.css +1 -0
- package/dist/web/static/assets/index-DileOOE4.js +4 -0
- package/dist/web/static/assets/index-DileOOE4.js.map +1 -0
- package/dist/web/static/assets/lucide-CnlPQoG8.js +72 -0
- package/dist/web/static/assets/lucide-CnlPQoG8.js.map +1 -0
- package/dist/web/static/assets/markdown-CA7ePUts.js +30 -0
- package/dist/web/static/assets/markdown-CA7ePUts.js.map +1 -0
- package/dist/web/static/assets/outcome-BKGy9azt.js +2 -0
- package/dist/web/static/assets/outcome-BKGy9azt.js.map +1 -0
- package/dist/web/static/assets/query-CgCOpYWf.js +2 -0
- package/dist/web/static/assets/{query-C99w429o.js.map → query-CgCOpYWf.js.map} +1 -1
- package/dist/web/static/assets/{react-router-r79dBVy4.js → react-router-Cxmg8RuL.js} +3 -3
- package/dist/web/static/assets/{react-router-r79dBVy4.js.map → react-router-Cxmg8RuL.js.map} +1 -1
- package/dist/web/static/assets/react-vendor-tkvCrao7.js +57 -0
- package/dist/web/static/assets/react-vendor-tkvCrao7.js.map +1 -0
- package/dist/web/static/assets/syntax-highlighter-BDYycNja.js +6 -0
- package/dist/web/static/assets/syntax-highlighter-BDYycNja.js.map +1 -0
- package/dist/web/static/assets/useAgentStats-B-uTgqBd.js +2 -0
- package/dist/web/static/assets/useAgentStats-B-uTgqBd.js.map +1 -0
- package/dist/web/static/assets/useDecisions-D-G2Ft5T.js +2 -0
- package/dist/web/static/assets/useDecisions-D-G2Ft5T.js.map +1 -0
- package/dist/web/static/assets/useDistill-21dZkXlT.js +3 -0
- package/dist/web/static/assets/useDistill-21dZkXlT.js.map +1 -0
- package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js +2 -0
- package/dist/web/static/assets/useEffectiveProject-DQiyX54y.js.map +1 -0
- package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js +2 -0
- package/dist/web/static/assets/useIssuesFeed-CFiyQkAL.js.map +1 -0
- package/dist/web/static/assets/useKbHits-xKXWgqh9.js +2 -0
- package/dist/web/static/assets/useKbHits-xKXWgqh9.js.map +1 -0
- package/dist/web/static/assets/useSkillStats-B5hbIwdf.js +2 -0
- package/dist/web/static/assets/useSkillStats-B5hbIwdf.js.map +1 -0
- package/dist/web/static/assets/vendor-DS-q4Eyc.js +36 -0
- package/dist/web/static/assets/vendor-DS-q4Eyc.js.map +1 -0
- package/dist/web/static/index.html +12 -8
- package/package.json +18 -5
- package/dist/core/ai/provider.d.ts +0 -63
- package/dist/core/ai/provider.d.ts.map +0 -1
- package/dist/core/ai/provider.js +0 -241
- package/dist/core/ai/provider.js.map +0 -1
- package/dist/core/ai/types.d.ts +0 -43
- package/dist/core/ai/types.d.ts.map +0 -1
- package/dist/core/ai/types.js +0 -5
- package/dist/core/ai/types.js.map +0 -1
- package/dist/core/storage/token-usage.d.ts +0 -36
- package/dist/core/storage/token-usage.d.ts.map +0 -1
- package/dist/core/storage/token-usage.js +0 -59
- package/dist/core/storage/token-usage.js.map +0 -1
- package/dist/core/utils/token-tracker.d.ts +0 -39
- package/dist/core/utils/token-tracker.d.ts.map +0 -1
- package/dist/core/utils/token-tracker.js +0 -69
- package/dist/core/utils/token-tracker.js.map +0 -1
- package/dist/skills/index.d.ts +0 -3
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -3
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/matcher.d.ts +0 -26
- package/dist/skills/matcher.d.ts.map +0 -1
- package/dist/skills/matcher.js +0 -113
- package/dist/skills/matcher.js.map +0 -1
- package/dist/skills/official/code-simplifier.md +0 -52
- package/dist/skills/official/find-skills.md +0 -142
- package/dist/skills/official/official-api-design.md +0 -30
- package/dist/skills/official/official-architecture-decision.md +0 -41
- package/dist/skills/official/official-bmad.md +0 -118
- package/dist/skills/official/official-db-schema-design.md +0 -34
- package/dist/skills/official/official-debug.md +0 -25
- package/dist/skills/official/official-doc-driven.md +0 -31
- package/dist/skills/official/official-harness-engineering.md +0 -108
- package/dist/skills/official/official-openspec.md +0 -89
- package/dist/skills/official/official-performance-optimization.md +0 -30
- package/dist/skills/official/official-pr-review.md +0 -35
- package/dist/skills/official/official-release-checklist.md +0 -30
- package/dist/skills/official/official-security-hardening.md +0 -32
- package/dist/skills/official/official-spec-driven-design.md +0 -31
- package/dist/skills/official/planning-with-files.md +0 -241
- package/dist/skills/official/ui-ux-pro-max.md +0 -105
- package/dist/skills/official/webapp-testing.md +0 -96
- package/dist/skills/official-skills.d.ts +0 -26
- package/dist/skills/official-skills.d.ts.map +0 -1
- package/dist/skills/official-skills.js +0 -74
- package/dist/skills/official-skills.js.map +0 -1
- package/dist/skills/semantic-matcher.d.ts +0 -60
- package/dist/skills/semantic-matcher.d.ts.map +0 -1
- package/dist/skills/semantic-matcher.js +0 -192
- package/dist/skills/semantic-matcher.js.map +0 -1
- package/dist/skills/upgrade-engine.d.ts +0 -93
- package/dist/skills/upgrade-engine.d.ts.map +0 -1
- package/dist/skills/upgrade-engine.js +0 -447
- package/dist/skills/upgrade-engine.js.map +0 -1
- package/dist/skills/upgrade-prompt.d.ts +0 -20
- package/dist/skills/upgrade-prompt.d.ts.map +0 -1
- package/dist/skills/upgrade-prompt.js +0 -75
- package/dist/skills/upgrade-prompt.js.map +0 -1
- package/dist/web/routes/ai.d.ts +0 -10
- package/dist/web/routes/ai.d.ts.map +0 -1
- package/dist/web/routes/ai.js +0 -186
- package/dist/web/routes/ai.js.map +0 -1
- package/dist/web/routes/token-usage.d.ts +0 -7
- package/dist/web/routes/token-usage.d.ts.map +0 -1
- package/dist/web/routes/token-usage.js +0 -18
- package/dist/web/routes/token-usage.js.map +0 -1
- package/dist/web/ssrf-guard.d.ts +0 -35
- package/dist/web/ssrf-guard.d.ts.map +0 -1
- package/dist/web/ssrf-guard.js +0 -93
- package/dist/web/ssrf-guard.js.map +0 -1
- package/dist/web/static/assets/AIConfig-CdDWzJyO.js +0 -2
- package/dist/web/static/assets/AIConfig-CdDWzJyO.js.map +0 -1
- package/dist/web/static/assets/Dashboard-CoEmmIDt.js +0 -2
- package/dist/web/static/assets/Dashboard-CoEmmIDt.js.map +0 -1
- package/dist/web/static/assets/Drawer-DdRTzlLB.js +0 -2
- package/dist/web/static/assets/Drawer-DdRTzlLB.js.map +0 -1
- package/dist/web/static/assets/Events-DrIq1SUS.js +0 -2
- package/dist/web/static/assets/Events-DrIq1SUS.js.map +0 -1
- package/dist/web/static/assets/Reports-DFBM3MDK.js +0 -2
- package/dist/web/static/assets/Reports-DFBM3MDK.js.map +0 -1
- package/dist/web/static/assets/SearchInput-qCj_jAcf.js +0 -2
- package/dist/web/static/assets/SearchInput-qCj_jAcf.js.map +0 -1
- package/dist/web/static/assets/SessionDetail-CCzwdoT7.js +0 -2
- package/dist/web/static/assets/SessionDetail-CCzwdoT7.js.map +0 -1
- package/dist/web/static/assets/Sessions-FfLYkAw9.js +0 -2
- package/dist/web/static/assets/Sessions-FfLYkAw9.js.map +0 -1
- package/dist/web/static/assets/Skills-C8Gvs3Qa.js +0 -2
- package/dist/web/static/assets/Skills-C8Gvs3Qa.js.map +0 -1
- package/dist/web/static/assets/TaskDetail-BS8pYhaR.js +0 -2
- package/dist/web/static/assets/TaskDetail-BS8pYhaR.js.map +0 -1
- package/dist/web/static/assets/Tasks-CyuhizG8.js +0 -2
- package/dist/web/static/assets/Tasks-CyuhizG8.js.map +0 -1
- package/dist/web/static/assets/charts-CLrM0_uM.js +0 -37
- package/dist/web/static/assets/charts-CLrM0_uM.js.map +0 -1
- package/dist/web/static/assets/date-fns-CZ_bHujz.js +0 -2
- package/dist/web/static/assets/date-fns-CZ_bHujz.js.map +0 -1
- package/dist/web/static/assets/export-L_VBD2p1.js +0 -4
- package/dist/web/static/assets/export-L_VBD2p1.js.map +0 -1
- package/dist/web/static/assets/index-CBX47X8l.js +0 -3
- package/dist/web/static/assets/index-CBX47X8l.js.map +0 -1
- package/dist/web/static/assets/index-DjIoMdoR.css +0 -1
- package/dist/web/static/assets/lucide-Bs_edTLa.js +0 -232
- package/dist/web/static/assets/lucide-Bs_edTLa.js.map +0 -1
- package/dist/web/static/assets/query-C99w429o.js +0 -2
- package/dist/web/static/assets/react-vendor-CSp-GLFF.js +0 -49
- package/dist/web/static/assets/react-vendor-CSp-GLFF.js.map +0 -1
- package/dist/web/static/assets/syntax-highlighter-44FakypI.js +0 -9
- package/dist/web/static/assets/syntax-highlighter-44FakypI.js.map +0 -1
- package/dist/web/static/assets/time-Bxuk0M-C.js +0 -2
- package/dist/web/static/assets/time-Bxuk0M-C.js.map +0 -1
- package/dist/web/static/assets/vendor-CMMjVdZs.js +0 -64
- package/dist/web/static/assets/vendor-CMMjVdZs.js.map +0 -1
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default tool_intercept rules (v9.x Phase 1, D1 strict mode).
|
|
3
|
+
*
|
|
4
|
+
* 5 deny + 1 warn — see master-roadmap D1 decision (2026-05-22) for the
|
|
5
|
+
* rationale on each. Hints follow the spec §4.2 design:
|
|
6
|
+
* 1. Specific fix command (spawn X with prompt Y)
|
|
7
|
+
* 2. CLAUDE.md anchor for the rule narrative
|
|
8
|
+
* 3. Bypass mechanism made explicit
|
|
9
|
+
*
|
|
10
|
+
* Adding a new rule: keep `match` purely on `ToolInputFields` + `RuleContext`;
|
|
11
|
+
* if a rule needs DB lookup, pre-compute the signal in PreToolUseHandler and
|
|
12
|
+
* expose it on `RuleContext` (so rules stay synchronous + cheap).
|
|
13
|
+
*/
|
|
14
|
+
import { isQuestionPrompt, hasDirectFixOverride, scoreKeywordBuckets, } from './workflow-defaults.js';
|
|
15
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
16
|
+
/** Token-aware command splitter that respects single/double quotes. */
|
|
17
|
+
function splitCommand(cmd) {
|
|
18
|
+
const tokens = [];
|
|
19
|
+
let buf = '';
|
|
20
|
+
let inSingle = false;
|
|
21
|
+
let inDouble = false;
|
|
22
|
+
for (const ch of cmd) {
|
|
23
|
+
if (ch === "'" && !inDouble) {
|
|
24
|
+
inSingle = !inSingle;
|
|
25
|
+
buf += ch;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (ch === '"' && !inSingle) {
|
|
29
|
+
inDouble = !inDouble;
|
|
30
|
+
buf += ch;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (/\s/.test(ch) && !inSingle && !inDouble) {
|
|
34
|
+
if (buf) {
|
|
35
|
+
tokens.push(buf);
|
|
36
|
+
buf = '';
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
buf += ch;
|
|
41
|
+
}
|
|
42
|
+
if (buf)
|
|
43
|
+
tokens.push(buf);
|
|
44
|
+
return tokens;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Does the command target multiple files / a directory rather than a single
|
|
48
|
+
* named file? Used by Bash grep / find rules so that the trivial single-file
|
|
49
|
+
* use-case (`grep foo bar.ts`) is NOT intercepted.
|
|
50
|
+
*
|
|
51
|
+
* Heuristics (intentionally conservative — false negatives are OK, false
|
|
52
|
+
* positives are not):
|
|
53
|
+
* • -r / -R / --recursive present → multi-file
|
|
54
|
+
* • final positional arg ends with '/' → directory
|
|
55
|
+
* • a positional arg is exactly 'src' / 'tests' → directory
|
|
56
|
+
* • glob characters ('*' / '?' / brace) in args → multi-file
|
|
57
|
+
* • file extension wildcards (`*.ts`, `*.js`) → multi-file
|
|
58
|
+
*/
|
|
59
|
+
function looksMultiFile(tokens) {
|
|
60
|
+
const args = tokens.slice(1); // drop the command name itself
|
|
61
|
+
for (const a of args) {
|
|
62
|
+
if (a === '-r' || a === '-R' || a === '--recursive')
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
// Positional args (skip flags). We only inspect non-flag args because a
|
|
66
|
+
// grep PATTERN like '-foo' would otherwise be misread as a flag.
|
|
67
|
+
const positionals = args.filter((a) => !a.startsWith('-'));
|
|
68
|
+
// Skip the very first positional (it's usually the search pattern).
|
|
69
|
+
const fileArgs = positionals.slice(1);
|
|
70
|
+
for (const a of fileArgs) {
|
|
71
|
+
if (a.endsWith('/'))
|
|
72
|
+
return true;
|
|
73
|
+
if (a === 'src' || a === 'tests' || a === 'lib' || a === 'app')
|
|
74
|
+
return true;
|
|
75
|
+
if (a.includes('*') || a.includes('?') || a.includes('{'))
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
// No file arg at all (e.g. `grep -r foo` with no positional dir) — treat as multi-file
|
|
79
|
+
// because grep defaults to cwd in recursive mode.
|
|
80
|
+
if (fileArgs.length === 0 && args.some((a) => a === '-r' || a === '-R'))
|
|
81
|
+
return true;
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Recognised search-tool head commands for `bash-grep-multi-file`.
|
|
86
|
+
*
|
|
87
|
+
* Live-data triage (2026-05-26) found the rule firing on `cp -r ... && grep`,
|
|
88
|
+
* `rm -rf ... | grep Health`, `chmod ... && bash` etc. where the user intent
|
|
89
|
+
* is clearly the leading mutation command and grep is just a post-verification
|
|
90
|
+
* filter. Narrowing to "first token must be a search tool" eliminates those
|
|
91
|
+
* false positives while preserving real exploratory grep/rg/ag/git-grep cases.
|
|
92
|
+
*
|
|
93
|
+
* NOTE: `find` is handled by the separate `bash-find-source` rule and is NOT
|
|
94
|
+
* included here.
|
|
95
|
+
*/
|
|
96
|
+
const GREP_HEAD_TOOLS = new Set([
|
|
97
|
+
'grep',
|
|
98
|
+
'rg',
|
|
99
|
+
'ripgrep',
|
|
100
|
+
'ack',
|
|
101
|
+
'ag',
|
|
102
|
+
]);
|
|
103
|
+
/**
|
|
104
|
+
* True if the FIRST shell command of the line is a recognised search tool.
|
|
105
|
+
*
|
|
106
|
+
* "First command" = before any of `&&`, `||`, `;`, `|`, `&` (the connectors
|
|
107
|
+
* that introduce a *new* command). Leading `time` / env-prefix etc. are NOT
|
|
108
|
+
* stripped (rare in practice; keeping the matcher simple).
|
|
109
|
+
*
|
|
110
|
+
* Special-case `git grep` — when first token is `git` and second is `grep`,
|
|
111
|
+
* still counts as a grep head.
|
|
112
|
+
*/
|
|
113
|
+
function isGrepHeadCommand(cmd) {
|
|
114
|
+
// Take everything up to the first shell connector.
|
|
115
|
+
// Order matters: && before & so we split on the longer token first.
|
|
116
|
+
let head = cmd;
|
|
117
|
+
for (const sep of ['&&', '||', ';', '|', '&']) {
|
|
118
|
+
const idx = head.indexOf(sep);
|
|
119
|
+
if (idx !== -1)
|
|
120
|
+
head = head.slice(0, idx);
|
|
121
|
+
}
|
|
122
|
+
head = head.trim();
|
|
123
|
+
if (!head)
|
|
124
|
+
return false;
|
|
125
|
+
const firstTokens = splitCommand(head);
|
|
126
|
+
if (firstTokens.length === 0)
|
|
127
|
+
return false;
|
|
128
|
+
const first = firstTokens[0];
|
|
129
|
+
if (GREP_HEAD_TOOLS.has(first))
|
|
130
|
+
return true;
|
|
131
|
+
// `git grep` form: first=git, second=grep.
|
|
132
|
+
if (first === 'git' && firstTokens.length >= 2 && firstTokens[1] === 'grep')
|
|
133
|
+
return true;
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
/** Detect a single-file `git log` / `git diff` use (i.e. `-- <file>` is present). */
|
|
137
|
+
function gitHasFileSelector(tokens) {
|
|
138
|
+
// Look for the `--` separator followed by at least one positional arg.
|
|
139
|
+
const dashDash = tokens.indexOf('--');
|
|
140
|
+
if (dashDash === -1)
|
|
141
|
+
return false;
|
|
142
|
+
const after = tokens.slice(dashDash + 1).filter((t) => t && !t.startsWith('-'));
|
|
143
|
+
return after.length >= 1;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* P0-3 fix (2026-05-27): whitelist for `git log` / `git diff` flag forms that
|
|
147
|
+
* are part of normal workflows (CLAUDE.md commit checklist requires
|
|
148
|
+
* `git log --oneline -N` to mimic commit message style; PR review needs
|
|
149
|
+
* `git diff --stat` / `--name-only`). Returns true when the command is one
|
|
150
|
+
* of these structured forms and the rule should bypass.
|
|
151
|
+
*
|
|
152
|
+
* Patterns covered (only fires when `\\bgit\\s+(log|diff)` is also present):
|
|
153
|
+
* • git log --oneline / --pretty / --graph (history summary)
|
|
154
|
+
* • git log -n N / -N (numeric line cap)
|
|
155
|
+
* • git log --format / --since / --author / --grep (filtered queries)
|
|
156
|
+
* • git diff --stat / --name-only / --shortstat (summary forms)
|
|
157
|
+
*/
|
|
158
|
+
function isGitLogDiffWorkflowForm(cmd) {
|
|
159
|
+
// git log --oneline / --pretty / --graph
|
|
160
|
+
if (/\bgit\s+log\s+(--oneline|--pretty|--graph)/.test(cmd))
|
|
161
|
+
return true;
|
|
162
|
+
// git log -n N / -N (e.g. `git log -30` / `git log -n 30`)
|
|
163
|
+
if (/\bgit\s+log\s+-(n\s+\d+|\d+)\b/.test(cmd))
|
|
164
|
+
return true;
|
|
165
|
+
// git log --format / --since / --author / --grep (filtered queries)
|
|
166
|
+
if (/\bgit\s+log\s+--(format|since|author|grep)/.test(cmd))
|
|
167
|
+
return true;
|
|
168
|
+
// git diff --stat / --name-only / --shortstat (review summary forms)
|
|
169
|
+
if (/\bgit\s+diff\s+(--stat|--name-only|--shortstat)/.test(cmd))
|
|
170
|
+
return true;
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* P0-2 fix (2026-05-27): "filter-then-mutate" pattern detection.
|
|
175
|
+
*
|
|
176
|
+
* When a command starts with a grep/rg/etc. AND chains through `&&` to a
|
|
177
|
+
* mutation verb (git add / cp / mv / rm / chmod / bash), the user intent is
|
|
178
|
+
* "filter some files then act on them" — not exploratory cross-file search.
|
|
179
|
+
* The bash-grep-multi-file rule should bypass these.
|
|
180
|
+
*
|
|
181
|
+
* VERIFY-B1 sample analysis (386 dry_run rows / 7d): most false-positives are
|
|
182
|
+
* already covered by `recent_agent_spawn` once F6 is fixed; this guard catches
|
|
183
|
+
* the residual cases where a main-thread filter+mutate pipeline survives.
|
|
184
|
+
*
|
|
185
|
+
* Conservative regex — only fires when ALL of: head is search tool, `&&`
|
|
186
|
+
* present, and the part after `&&` starts with one of the mutation verbs.
|
|
187
|
+
*/
|
|
188
|
+
const MUTATION_VERBS = ['git add', 'cp ', 'mv ', 'rm ', 'chmod ', 'bash '];
|
|
189
|
+
function looksFilterContext(cmd) {
|
|
190
|
+
// Need at least one `&&` for the filter→mutate pattern.
|
|
191
|
+
if (!cmd.includes('&&'))
|
|
192
|
+
return false;
|
|
193
|
+
const parts = cmd.split('&&').map((p) => p.trim()).filter(Boolean);
|
|
194
|
+
// Iterate parts AFTER the first; if any begins with a mutation verb, treat
|
|
195
|
+
// the whole line as filter context.
|
|
196
|
+
for (let i = 1; i < parts.length; i++) {
|
|
197
|
+
const p = parts[i].toLowerCase();
|
|
198
|
+
if (MUTATION_VERBS.some((v) => p.startsWith(v)))
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
/** True if the prompt explicitly declares hook-protocol repair intent. */
|
|
204
|
+
function isHookRepairIntent(prompt) {
|
|
205
|
+
if (!prompt)
|
|
206
|
+
return false;
|
|
207
|
+
const lower = prompt.toLowerCase();
|
|
208
|
+
return /(hook.{0,8}(protocol|协议|契约))/i.test(prompt)
|
|
209
|
+
|| /修复.*hook/.test(prompt)
|
|
210
|
+
|| lower.includes('fix hook')
|
|
211
|
+
|| lower.includes('repair hook');
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* f47c2c90 (2026-06-17): 元任务文件白名单 — these inline single-file changes are
|
|
215
|
+
* legitimate "main thread does it itself" operations, NOT the kind of
|
|
216
|
+
* substantive change that should spawn an agent. Matching any clause here makes
|
|
217
|
+
* the `inline-edit-no-spawn` / `inline-write-no-spawn` warn rules放行 (return
|
|
218
|
+
* false / no match). Judged purely on the `file_path` string (basename / path
|
|
219
|
+
* fragment), case-insensitive for basenames — never reads gzip event content.
|
|
220
|
+
*
|
|
221
|
+
* Whitelist clauses (match ANY → meta-task,放行):
|
|
222
|
+
* • basename ∈ { CLAUDE.md, README.md, CHANGELOG.md, package.json,
|
|
223
|
+
* package-lock.json, tsconfig.json, .gitignore, VERSION }
|
|
224
|
+
* • path contains `/docs/`, `/.forge-knowledge/`, or `/.claude/`
|
|
225
|
+
* (docs / KB live-docs / agent templates & config)
|
|
226
|
+
* • basename ends with `.md` AND path contains `/docs/` or `/.forge-knowledge/`
|
|
227
|
+
* • version files: basename === `version.ts` OR matches `version.<ext>`
|
|
228
|
+
*
|
|
229
|
+
* NOTE: `scripts/*.sh` is intentionally NOT whitelisted — hook scripts already
|
|
230
|
+
* have the dedicated `edit-hook-script-from-main` deny rule, and other script
|
|
231
|
+
* changes are usually substantive. Revisit if gray-rollout shows high FPs (Q2).
|
|
232
|
+
*/
|
|
233
|
+
const META_TASK_BASENAMES = new Set([
|
|
234
|
+
'claude.md',
|
|
235
|
+
'readme.md',
|
|
236
|
+
'changelog.md',
|
|
237
|
+
'package.json',
|
|
238
|
+
'package-lock.json',
|
|
239
|
+
'tsconfig.json',
|
|
240
|
+
'.gitignore',
|
|
241
|
+
'version',
|
|
242
|
+
'version.ts',
|
|
243
|
+
]);
|
|
244
|
+
function isMetaTaskFile(filePath) {
|
|
245
|
+
const fp = filePath.trim();
|
|
246
|
+
if (!fp)
|
|
247
|
+
return false;
|
|
248
|
+
// Normalise separators + extract basename (last path segment).
|
|
249
|
+
const norm = fp.replace(/\\/g, '/');
|
|
250
|
+
const basename = norm.slice(norm.lastIndexOf('/') + 1);
|
|
251
|
+
const lowerBase = basename.toLowerCase();
|
|
252
|
+
// (1) exact basename whitelist (case-insensitive).
|
|
253
|
+
if (META_TASK_BASENAMES.has(lowerBase))
|
|
254
|
+
return true;
|
|
255
|
+
// (2) version files: `version.*` (e.g. version.json / version.txt).
|
|
256
|
+
if (/^version\.[^/]+$/i.test(basename))
|
|
257
|
+
return true;
|
|
258
|
+
// (3) path-fragment whitelist: docs / KB live-docs / agent templates+config.
|
|
259
|
+
if (norm.includes('/docs/') || norm.includes('/.forge-knowledge/') || norm.includes('/.claude/')) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
// (4) markdown docs anywhere under docs / KB trees (redundant with (3) but
|
|
263
|
+
// kept explicit for泛文档 intent + future收窄 — see spec open question Q2).
|
|
264
|
+
if (lowerBase.endsWith('.md') && (norm.includes('/docs/') || norm.includes('/.forge-knowledge/'))) {
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
// ── Rule definitions ───────────────────────────────────────────────────────
|
|
270
|
+
const BYPASS_SUFFIX = '\n\n如确认需要继续,请在命令末尾追加 `# forge:bypass=<原因>`(或 Edit/Write 内容里加 `// forge:bypass=<原因>` 注释)。';
|
|
271
|
+
const RULE_BASH_GREP_MULTI_FILE = {
|
|
272
|
+
id: 'bash-grep-multi-file',
|
|
273
|
+
kind: 'tool_intercept',
|
|
274
|
+
description: 'Bash 跨多文件 grep / git grep 应 spawn Explore agent',
|
|
275
|
+
claudemdRef: 'CLAUDE.md:112 强制 spawn 的场景 → 查/找/看/列出',
|
|
276
|
+
tool: 'Bash',
|
|
277
|
+
decision: 'deny',
|
|
278
|
+
match: (input, ctx) => {
|
|
279
|
+
const cmd = (input.command ?? '').trim();
|
|
280
|
+
if (!cmd)
|
|
281
|
+
return false;
|
|
282
|
+
// C4 hotfix (2026-05-26): head-command gate. Only fire when the FIRST
|
|
283
|
+
// shell command is a recognised search tool (grep/rg/ripgrep/ack/ag/
|
|
284
|
+
// `git grep`). Eliminates false positives where mutation commands
|
|
285
|
+
// (`cp`, `rm`, `mkdir`, `chmod`, `cat`, `ls`) have a trailing grep used
|
|
286
|
+
// for post-verification. See triage in
|
|
287
|
+
// docs/implementation/2026-05-26/HHMM-c4-obey-ratio-fix-changelog.md.
|
|
288
|
+
if (!isGrepHeadCommand(cmd))
|
|
289
|
+
return false;
|
|
290
|
+
// Recent agent spawn relaxes the rule (we're likely inside an Explore agent).
|
|
291
|
+
if (ctx.recent_agent_spawn)
|
|
292
|
+
return false;
|
|
293
|
+
// P0-2 fix (2026-05-27): filter-then-mutate guard — `grep ... && git add ...`
|
|
294
|
+
// is a workflow pattern (filter files, then act on the result), not a
|
|
295
|
+
// cross-file exploratory grep. Skip these.
|
|
296
|
+
if (looksFilterContext(cmd))
|
|
297
|
+
return false;
|
|
298
|
+
const tokens = splitCommand(cmd);
|
|
299
|
+
return looksMultiFile(tokens);
|
|
300
|
+
},
|
|
301
|
+
hint: (input) => {
|
|
302
|
+
const cmd = (input.command ?? '').slice(0, 120);
|
|
303
|
+
return [
|
|
304
|
+
`跨文件 grep / git grep 属于探索任务(CLAUDE.md:104 「查/找/看/列出 → Explore agent」)。`,
|
|
305
|
+
`命令:${cmd}`,
|
|
306
|
+
``,
|
|
307
|
+
`请改用 Task tool spawn subagent_type='general-purpose' 并在 prompt 里写:`,
|
|
308
|
+
` 「find <pattern> in <path>,列出 file:line 与匹配上下文」`,
|
|
309
|
+
``,
|
|
310
|
+
`这样能让 sub-agent 处理大量文件 IO,主线程上下文保持干净。`,
|
|
311
|
+
].join('\n') + BYPASS_SUFFIX;
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
const RULE_BASH_FIND_SOURCE = {
|
|
315
|
+
id: 'bash-find-source',
|
|
316
|
+
kind: 'tool_intercept',
|
|
317
|
+
description: 'Bash find 源码文件应 spawn Explore agent',
|
|
318
|
+
claudemdRef: 'CLAUDE.md:112 强制 spawn 的场景 → 查/找/看/列出',
|
|
319
|
+
tool: 'Bash',
|
|
320
|
+
decision: 'deny',
|
|
321
|
+
match: (input, ctx) => {
|
|
322
|
+
const cmd = (input.command ?? '').trim();
|
|
323
|
+
if (!cmd)
|
|
324
|
+
return false;
|
|
325
|
+
if (!/\bfind\b/.test(cmd))
|
|
326
|
+
return false;
|
|
327
|
+
if (ctx.recent_agent_spawn)
|
|
328
|
+
return false;
|
|
329
|
+
// P1-4 fix (2026-05-27): whitelist build artifacts / 3rd-party deps /
|
|
330
|
+
// test fixtures / scratch dirs — scanning these is operational (rg dist
|
|
331
|
+
// for stale builds, find node_modules for orphan vendor files, etc.),
|
|
332
|
+
// not source-code exploration.
|
|
333
|
+
if (/\b(dist|node_modules|tests?|tmp|build|\.next|coverage|test-results)\b/.test(cmd)) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
// Look for -name "*.ext" with a code/text extension.
|
|
337
|
+
// Cover common source extensions; intentionally NOT exhaustive.
|
|
338
|
+
return /-name\s+["']?\*\.(ts|tsx|js|jsx|mjs|cjs|py|rs|go|java|kt|swift|c|cc|cpp|h|hpp|rb|php|sh|md|json|yaml|yml|toml)['"]?/.test(cmd);
|
|
339
|
+
},
|
|
340
|
+
hint: (input) => {
|
|
341
|
+
const cmd = (input.command ?? '').slice(0, 120);
|
|
342
|
+
return [
|
|
343
|
+
`find ... -name "*.ext" 跨源码搜索属于探索任务(CLAUDE.md:104)。`,
|
|
344
|
+
`命令:${cmd}`,
|
|
345
|
+
``,
|
|
346
|
+
`请改用 Task tool spawn subagent_type='general-purpose',在 prompt 里写:`,
|
|
347
|
+
` 「locate files matching <pattern> in <path>」`,
|
|
348
|
+
].join('\n') + BYPASS_SUFFIX;
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
const RULE_EDIT_MULTI_FILE_HARD = {
|
|
352
|
+
id: 'edit-multi-file-hard',
|
|
353
|
+
kind: 'tool_intercept',
|
|
354
|
+
description: '同 session ≥3 文件 Edit/Write 必须 spawn agent',
|
|
355
|
+
claudemdRef: 'CLAUDE.md:8 自检 #1 修改 ≥2 个文件应 spawn Agent;硬阈值 3',
|
|
356
|
+
tool: 'Edit',
|
|
357
|
+
decision: 'deny',
|
|
358
|
+
match: (input, ctx) => {
|
|
359
|
+
if (ctx.recent_agent_spawn)
|
|
360
|
+
return false;
|
|
361
|
+
// Audit #4 fix (2026-06-09): agent-depth exemption. Claude Code sub-agents
|
|
362
|
+
// SHARE the main thread's session_id, so a spawned `coder` editing 3+ files
|
|
363
|
+
// (its legitimate job) trips this session-level threshold even though the
|
|
364
|
+
// main thread never touched a file. When ≥1 sub-agent is in-flight
|
|
365
|
+
// (active_agent_depth ≥ 1), the multi-file work is the authorized agent's —
|
|
366
|
+
// exempt it. This is a RELAXATION of a known false positive (all 6 audited
|
|
367
|
+
// deny rows were this class), NOT a new hard constraint.
|
|
368
|
+
if ((ctx.active_agent_depth ?? 0) >= 1)
|
|
369
|
+
return false;
|
|
370
|
+
const currentFile = (input.file_path ?? '').trim();
|
|
371
|
+
// P0-1 fix (2026-05-27): drop files edited BEFORE the most recent agent
|
|
372
|
+
// spawn — those are sub-agent edits, not main-thread accumulation. Only
|
|
373
|
+
// count files the main thread has touched POST-spawn (plus the current
|
|
374
|
+
// file). When `last_spawn_ts` is null OR the timestamped data is missing,
|
|
375
|
+
// fall back to the legacy behaviour (count the whole `edited_files` set).
|
|
376
|
+
let postSpawnFiles;
|
|
377
|
+
if (ctx.last_spawn_ts && ctx.edited_files_with_ts && ctx.edited_files_with_ts.length > 0) {
|
|
378
|
+
postSpawnFiles = new Set();
|
|
379
|
+
for (const { path, ts } of ctx.edited_files_with_ts) {
|
|
380
|
+
if (ts > ctx.last_spawn_ts)
|
|
381
|
+
postSpawnFiles.add(path);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
postSpawnFiles = new Set(ctx.edited_files);
|
|
386
|
+
}
|
|
387
|
+
// The handler computes edited_files BEFORE evaluating rules; the current
|
|
388
|
+
// event has not yet been logged. We count distinct files INCLUDING the
|
|
389
|
+
// current one to trigger at "this would become the 3rd distinct file".
|
|
390
|
+
if (currentFile)
|
|
391
|
+
postSpawnFiles.add(currentFile);
|
|
392
|
+
return postSpawnFiles.size >= 3;
|
|
393
|
+
},
|
|
394
|
+
hint: (input, ctx) => {
|
|
395
|
+
const cnt = ctx.edited_files.size + ((input.file_path && !ctx.edited_files.has(input.file_path)) ? 1 : 0);
|
|
396
|
+
return [
|
|
397
|
+
`本 session 已经触及 ${cnt} 个文件(硬阈值 3)。CLAUDE.md:13 「自检 #1」要求 spawn agent。`,
|
|
398
|
+
``,
|
|
399
|
+
`请改用 Task tool spawn subagent_type='general-purpose' 或更专门的 coder / safety-net-implementer,把后续改动委托给 sub-agent;主线程只协调与汇总。`,
|
|
400
|
+
].join('\n') + BYPASS_SUFFIX;
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
// Edit 与 Write 共用阈值规则 — 用同一个 match/hint,仅 tool 字段不同。
|
|
404
|
+
const RULE_WRITE_MULTI_FILE_HARD = {
|
|
405
|
+
...RULE_EDIT_MULTI_FILE_HARD,
|
|
406
|
+
id: 'write-multi-file-hard',
|
|
407
|
+
tool: 'Write',
|
|
408
|
+
};
|
|
409
|
+
const RULE_BASH_GIT_LOG_DIFF_NO_FILE = {
|
|
410
|
+
id: 'bash-git-log-diff-no-file',
|
|
411
|
+
kind: 'tool_intercept',
|
|
412
|
+
description: 'git log / git diff 未限定文件多半为探索查询',
|
|
413
|
+
claudemdRef: 'CLAUDE.md:112 强制 spawn 的场景 (D1 策略升级 warn → deny)',
|
|
414
|
+
tool: 'Bash',
|
|
415
|
+
decision: 'deny',
|
|
416
|
+
match: (input, ctx) => {
|
|
417
|
+
const cmd = (input.command ?? '').trim();
|
|
418
|
+
if (!cmd)
|
|
419
|
+
return false;
|
|
420
|
+
// Only match git log / git diff (not git status / git show etc.).
|
|
421
|
+
if (!/\bgit\s+(log|diff)\b/.test(cmd))
|
|
422
|
+
return false;
|
|
423
|
+
if (ctx.recent_agent_spawn)
|
|
424
|
+
return false;
|
|
425
|
+
// P0-3 fix (2026-05-27): bypass structured workflow forms that
|
|
426
|
+
// CLAUDE.md itself requires (commit-mimic `git log --oneline -N`,
|
|
427
|
+
// PR-review `git diff --stat`, etc.). See `isGitLogDiffWorkflowForm`.
|
|
428
|
+
if (isGitLogDiffWorkflowForm(cmd))
|
|
429
|
+
return false;
|
|
430
|
+
const tokens = splitCommand(cmd);
|
|
431
|
+
return !gitHasFileSelector(tokens);
|
|
432
|
+
},
|
|
433
|
+
hint: (input) => {
|
|
434
|
+
const cmd = (input.command ?? '').slice(0, 120);
|
|
435
|
+
return [
|
|
436
|
+
`git log / git diff 未带 \`-- <file>\` 限定,多半是探索性查询(CLAUDE.md:104)。`,
|
|
437
|
+
`命令:${cmd}`,
|
|
438
|
+
``,
|
|
439
|
+
`请二选一:`,
|
|
440
|
+
` 1) spawn Explore agent: Task tool subagent_type='general-purpose' with prompt`,
|
|
441
|
+
` 「summarize recent commits / diffs in <path>」`,
|
|
442
|
+
` 2) 只是 commit 前 self-review → 加 \`-- <file>\` 限定到具体文件`,
|
|
443
|
+
].join('\n') + BYPASS_SUFFIX;
|
|
444
|
+
},
|
|
445
|
+
};
|
|
446
|
+
const RULE_EDIT_HOOK_SCRIPT = {
|
|
447
|
+
id: 'edit-hook-script-from-main',
|
|
448
|
+
kind: 'tool_intercept',
|
|
449
|
+
description: 'src/hooks/*.sh 是 daemon 通信契约,主线程禁止直接 Edit/Write',
|
|
450
|
+
claudemdRef: 'CLAUDE.md:170 项目模块覆盖现状 hooks/*.sh 0 测试 必走 Hybrid',
|
|
451
|
+
tool: 'Edit',
|
|
452
|
+
decision: 'deny',
|
|
453
|
+
match: (input, ctx) => {
|
|
454
|
+
const fp = (input.file_path ?? '').trim();
|
|
455
|
+
if (!fp)
|
|
456
|
+
return false;
|
|
457
|
+
if (ctx.recent_agent_spawn)
|
|
458
|
+
return false;
|
|
459
|
+
return /(^|\/)src\/hooks\/[^/]+\.sh$/.test(fp);
|
|
460
|
+
},
|
|
461
|
+
hint: (input, ctx) => {
|
|
462
|
+
const fp = input.file_path ?? '';
|
|
463
|
+
const intentNote = isHookRepairIntent(ctx.recent_prompt)
|
|
464
|
+
? '(已识别到 prompt 含 hook 协议修复意图 — 仍建议 spawn agent 以确保有 safety-net)'
|
|
465
|
+
: '';
|
|
466
|
+
return [
|
|
467
|
+
`${fp} 是 daemon ↔ Claude Code 的通信契约,主线程直接改极易引入协议错误。`,
|
|
468
|
+
``,
|
|
469
|
+
`请 spawn Task tool subagent_type='general-purpose'(或 safety-net-implementer mode=hybrid-feature),在 prompt 里写:`,
|
|
470
|
+
` 「修改 ${fp},需求:<...>;先跑 daemon roundtrip 验证再改」`,
|
|
471
|
+
intentNote,
|
|
472
|
+
].filter(Boolean).join('\n') + BYPASS_SUFFIX;
|
|
473
|
+
},
|
|
474
|
+
};
|
|
475
|
+
const RULE_WRITE_HOOK_SCRIPT = {
|
|
476
|
+
...RULE_EDIT_HOOK_SCRIPT,
|
|
477
|
+
id: 'write-hook-script-from-main',
|
|
478
|
+
tool: 'Write',
|
|
479
|
+
};
|
|
480
|
+
// ── Warn-level rule ────────────────────────────────────────────────────────
|
|
481
|
+
const RULE_EDIT_MULTI_FILE_NO_AGENT = {
|
|
482
|
+
id: 'edit-multi-file-no-agent',
|
|
483
|
+
kind: 'tool_intercept',
|
|
484
|
+
description: '同 session ≥2 文件 Edit/Write 且无 Agent spawn → 建议 spawn',
|
|
485
|
+
claudemdRef: 'CLAUDE.md:8 自检 #1 软提醒(硬阈值 3 由 edit-multi-file-hard 处理)',
|
|
486
|
+
tool: 'Edit',
|
|
487
|
+
decision: 'warn',
|
|
488
|
+
match: (input, ctx) => {
|
|
489
|
+
if (ctx.recent_agent_spawn)
|
|
490
|
+
return false;
|
|
491
|
+
const projected = new Set(ctx.edited_files);
|
|
492
|
+
const fp = (input.file_path ?? '').trim();
|
|
493
|
+
if (fp)
|
|
494
|
+
projected.add(fp);
|
|
495
|
+
// 2-file: warn; ≥3: handed off to the hard rule (which has higher precedence
|
|
496
|
+
// because we list it BEFORE this one in `defaultRules`).
|
|
497
|
+
return projected.size === 2;
|
|
498
|
+
},
|
|
499
|
+
hint: (_input, ctx) => {
|
|
500
|
+
return [
|
|
501
|
+
`本 session 已修改 ${Math.max(2, ctx.edited_files.size + 1)} 个文件。`,
|
|
502
|
+
`CLAUDE.md:13 「自检 #1」建议 ≥2 文件改动 spawn Agent 委托;继续手改将在第 3 个文件被硬拦截。`,
|
|
503
|
+
``,
|
|
504
|
+
`若继续手改是有意为之,可加 \`// forge:bypass=<原因>\` 注释。`,
|
|
505
|
+
].join('\n');
|
|
506
|
+
},
|
|
507
|
+
};
|
|
508
|
+
const RULE_WRITE_MULTI_FILE_NO_AGENT = {
|
|
509
|
+
...RULE_EDIT_MULTI_FILE_NO_AGENT,
|
|
510
|
+
id: 'write-multi-file-no-agent',
|
|
511
|
+
tool: 'Write',
|
|
512
|
+
};
|
|
513
|
+
// ── f47c2c90 (2026-06-17): inline single-file no-spawn warn ──────────────────
|
|
514
|
+
//
|
|
515
|
+
// Spec: docs/design/2026-06-17/1042-spec-inline-no-spawn-violation.md
|
|
516
|
+
//
|
|
517
|
+
// Covers the口径 blind spot: the main thread "should spawn but edits ONE file
|
|
518
|
+
// inline" — the most common, quietest violation form, which trips NEITHER the
|
|
519
|
+
// hard rule (≥3) NOR the no-agent rule (==2). This pair handles the ==1 segment
|
|
520
|
+
// ONLY, so the three rules (1 / 2 / ≥3) are mutually exclusive and don't overlap.
|
|
521
|
+
//
|
|
522
|
+
// Fires (warn) when ALL hold:
|
|
523
|
+
// (0) flag `inline_edit_no_spawn.enabled` is ON (default OFF — gray rollout)
|
|
524
|
+
// (1) NO recent agent spawn in the 5-min window (main thread未委托)
|
|
525
|
+
// (2) active_agent_depth < 1 (no sub-agent in flight — not the agent's work)
|
|
526
|
+
// (3) file_path is non-empty AND not a meta-task file (whitelist)
|
|
527
|
+
// (4) projected.size === 1 (the ==1 segment)
|
|
528
|
+
//
|
|
529
|
+
// warn-level ONLY — NEVER deny (CLAUDE.md mechanical-block layer removed,
|
|
530
|
+
// decision 7c924678; daemon only records, never hard-blocks the main thread).
|
|
531
|
+
// Behind a +24h observation_until so even when the flag is flipped ON the rows
|
|
532
|
+
// ride along as dry_run for the first 24h (dry_run is EXCLUDED by
|
|
533
|
+
// collectViolations Source 3 — pure observation, no list pollution).
|
|
534
|
+
const RULE_INLINE_EDIT_NO_SPAWN = {
|
|
535
|
+
id: 'inline-edit-no-spawn',
|
|
536
|
+
kind: 'tool_intercept',
|
|
537
|
+
description: '主线程单文件 inline Edit/Write 且无 agent spawn → 建议 spawn',
|
|
538
|
+
claudemdRef: 'CLAUDE.md DECISION HINT 协议契约 §3 实施 → spawn coder',
|
|
539
|
+
tool: 'Edit',
|
|
540
|
+
decision: 'warn',
|
|
541
|
+
// Gray-rollout observation window: deploy day +24h. Even with the flag ON,
|
|
542
|
+
// rows persist as dry_run until this instant (pure observation). Bumped by a
|
|
543
|
+
// future spec if needed.
|
|
544
|
+
observation_until: '2026-06-18T12:00:00Z',
|
|
545
|
+
match: (input, ctx) => {
|
|
546
|
+
// (0) flag gate — default OFF; when OFF, no row at all (mirrors
|
|
547
|
+
// question_default_bmad_enforce). 灰度关时连 dry_run 都不写。
|
|
548
|
+
if (!ctx.inline_edit_no_spawn_enabled)
|
|
549
|
+
return false;
|
|
550
|
+
// (1) recent agent spawn → main thread already delegated,放行.
|
|
551
|
+
if (ctx.recent_agent_spawn)
|
|
552
|
+
return false;
|
|
553
|
+
// (2) sub-agent in flight (depth≥1) → this is the agent's legitimate work.
|
|
554
|
+
if ((ctx.active_agent_depth ?? 0) >= 1)
|
|
555
|
+
return false;
|
|
556
|
+
// (3) meta-task whitelist /空 file_path →放行.
|
|
557
|
+
const fp = (input.file_path ?? '').trim();
|
|
558
|
+
if (!fp)
|
|
559
|
+
return false;
|
|
560
|
+
if (isMetaTaskFile(fp))
|
|
561
|
+
return false;
|
|
562
|
+
// (4) segment guard — this rule owns the ==1 case ONLY. 2 → no-agent (warn),
|
|
563
|
+
// ≥3 → hard (deny). Three rules分段互斥, no overlap.
|
|
564
|
+
const projected = new Set(ctx.edited_files);
|
|
565
|
+
projected.add(fp);
|
|
566
|
+
return projected.size === 1;
|
|
567
|
+
},
|
|
568
|
+
hint: (input, _ctx) => {
|
|
569
|
+
const fp = (input.file_path ?? '<file>').trim() || '<file>';
|
|
570
|
+
return [
|
|
571
|
+
`本 session 主线程正在 inline 改动 ${fp},且最近 5min 无 agent spawn。`,
|
|
572
|
+
`CLAUDE.md DECISION HINT §3:实质改动应 spawn coder / safety-net-implementer,`,
|
|
573
|
+
`主线程只编排。`,
|
|
574
|
+
``,
|
|
575
|
+
`若这是元任务(改 CLAUDE.md / changelog / 版本 / 文档)或确为有意 inline,`,
|
|
576
|
+
`可加 \`// forge:bypass=<原因>\` 注释忽略本提示。`,
|
|
577
|
+
].join('\n');
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
const RULE_INLINE_WRITE_NO_SPAWN = {
|
|
581
|
+
...RULE_INLINE_EDIT_NO_SPAWN,
|
|
582
|
+
id: 'inline-write-no-spawn',
|
|
583
|
+
tool: 'Write',
|
|
584
|
+
};
|
|
585
|
+
// ── Retired: RULE_TASK_WORKFLOW_MISMATCH (Phase 5 / D4) ──────────────────
|
|
586
|
+
// Removed 2026-06-10 (decision fe6f98cd). Producers of the
|
|
587
|
+
// `workflow_recommendations` table were deleted with spec 1200 (2026-05-28),
|
|
588
|
+
// so the pending-row lookup always returned null and the rule never fired.
|
|
589
|
+
// ── v9.x Phase 2 (2026-05-26): user-question default BMAD gate ────────────
|
|
590
|
+
//
|
|
591
|
+
// Spec: docs/design/2026-05-26/1707-user-question-default-bmad-spec.md
|
|
592
|
+
//
|
|
593
|
+
// Fires when:
|
|
594
|
+
// • tool = Task
|
|
595
|
+
// • subagent_type ∈ implementation agents (coder / harness-* / hybrid /
|
|
596
|
+
// safety-net-implementer) — NOT planner / Explore / doc-reviewer / verify
|
|
597
|
+
// • ctx.recent_prompt is question-style (see isQuestionPrompt)
|
|
598
|
+
// • prompt does NOT contain DIRECT_FIX_OVERRIDE escape hatch
|
|
599
|
+
// • feature flag `question_default_bmad.enforce` is true (default false
|
|
600
|
+
// during 7-day dry_run starting 2026-05-26 → reassess 2026-06-02)
|
|
601
|
+
// • we are not already inside a sub-agent spawn (recent_agent_spawn=false)
|
|
602
|
+
//
|
|
603
|
+
// Hint guides user to either re-spawn as `planner` or add `直接修` (natural
|
|
604
|
+
// language) or `forge:bypass=...` (token) to skip the gate. The deny row in
|
|
605
|
+
// `tool_intercepts` is tagged `rule_id='task-question-needs-bmad'` so the C4
|
|
606
|
+
// KPI can split obey ratio per-rule.
|
|
607
|
+
const IMPL_AGENT_TYPES = new Set([
|
|
608
|
+
'coder',
|
|
609
|
+
'safety-net-implementer',
|
|
610
|
+
'harness-debug-full',
|
|
611
|
+
// Legacy names retained read-only (R2 merge, decision 7c881393): the three
|
|
612
|
+
// agents below were merged into safety-net-implementer. Stale spawns using
|
|
613
|
+
// the old names should still trip this question-gate.
|
|
614
|
+
'harness-hotfix',
|
|
615
|
+
'hybrid-feature-with-safety',
|
|
616
|
+
'refactor-specialist',
|
|
617
|
+
]);
|
|
618
|
+
const RULE_TASK_QUESTION_NEEDS_BMAD = {
|
|
619
|
+
id: 'task-question-needs-bmad',
|
|
620
|
+
kind: 'tool_intercept',
|
|
621
|
+
description: '用户疑问句 spawn 实现 agent — 应先走 BMAD spec gate',
|
|
622
|
+
// External docs ref — Phase 9 lint skips non-CLAUDE.md refs, but the link
|
|
623
|
+
// is still discoverable in code search.
|
|
624
|
+
claudemdRef: 'docs/design/2026-05-26/1707-user-question-default-bmad-spec.md',
|
|
625
|
+
tool: 'Task',
|
|
626
|
+
decision: 'deny',
|
|
627
|
+
match: (input, ctx) => {
|
|
628
|
+
// Feature-flag gate — dry_run by default; only fires when explicitly
|
|
629
|
+
// opted in via `cf config set question_default_bmad.enforce true`.
|
|
630
|
+
if (!ctx.question_default_bmad_enforce)
|
|
631
|
+
return false;
|
|
632
|
+
// Sub-agent context relaxation — we're already inside a spawn flow.
|
|
633
|
+
if (ctx.recent_agent_spawn)
|
|
634
|
+
return false;
|
|
635
|
+
const sub = typeof input.subagent_type === 'string' ? input.subagent_type : '';
|
|
636
|
+
if (!IMPL_AGENT_TYPES.has(sub))
|
|
637
|
+
return false;
|
|
638
|
+
const prompt = ctx.recent_prompt ?? '';
|
|
639
|
+
if (!isQuestionPrompt(prompt))
|
|
640
|
+
return false;
|
|
641
|
+
// Escape hatch — natural-language override.
|
|
642
|
+
if (hasDirectFixOverride(prompt))
|
|
643
|
+
return false;
|
|
644
|
+
return true;
|
|
645
|
+
},
|
|
646
|
+
hint: (input, _ctx) => {
|
|
647
|
+
const sub = typeof input.subagent_type === 'string' ? input.subagent_type : '<missing>';
|
|
648
|
+
return [
|
|
649
|
+
`检测到最近一条 user prompt 是疑问句,但你 spawn 了 '${sub}'(实现/修复类 agent)。`,
|
|
650
|
+
`CLAUDE.md 自检 #0 + spec docs/design/2026-05-26/1707-user-question-default-bmad-spec.md`,
|
|
651
|
+
`要求:用户疑问句默认先走 BMAD — spawn 'planner' 出 spec → 等用户批准 → 才进入实现。`,
|
|
652
|
+
``,
|
|
653
|
+
`请三选一:`,
|
|
654
|
+
` 1) 重新 spawn Task subagent_type='planner',按 BMAD 走 spec → 用户审批 → 实现`,
|
|
655
|
+
` 2) 在用户 prompt 里加 "直接修" / "just fix" / "skip spec" — 自然语言逃逸 (R7 边界锚定)`,
|
|
656
|
+
` 3) 在 Task description / prompt 末尾追加 \`# forge:bypass=<原因>\` token`,
|
|
657
|
+
].join('\n') + BYPASS_SUFFIX;
|
|
658
|
+
},
|
|
659
|
+
};
|
|
660
|
+
// ── v9.x 8-in-1 Phase C (2026-05-27): general-purpose misuse gate ────────
|
|
661
|
+
//
|
|
662
|
+
// Spec: docs/design/2026-05-27/1006-intercept-enforcement-fix-spec.md §C step 11
|
|
663
|
+
//
|
|
664
|
+
// Fires when:
|
|
665
|
+
// • tool = Task
|
|
666
|
+
// • subagent_type === 'general-purpose'
|
|
667
|
+
// • last user prompt scores ≥2 hits against one of the IMPL workflow buckets
|
|
668
|
+
// (harness-hotfix / harness-debug / refactor / hybrid)
|
|
669
|
+
// • prompt does NOT contain the escape hatch ("general-purpose" mention /
|
|
670
|
+
// "用 general" / forge:bypass=)
|
|
671
|
+
// • we are not already inside a sub-agent spawn (recent_agent_spawn=false)
|
|
672
|
+
//
|
|
673
|
+
// Lives behind a 24h `observation_until` window — see SPEC § R-5 (24h dry_run
|
|
674
|
+
// before hard deny). Lets us measure misuse rate without breaking legitimate
|
|
675
|
+
// general-purpose calls (Explore-style 文件 IO).
|
|
676
|
+
const IMPL_BUCKET_TYPES = new Set([
|
|
677
|
+
'harness-hotfix',
|
|
678
|
+
'harness-debug',
|
|
679
|
+
'refactor',
|
|
680
|
+
'hybrid',
|
|
681
|
+
]);
|
|
682
|
+
const MISUSE_MIN_BUCKET_HITS = 2;
|
|
683
|
+
// Escape hatch — boundary-anchored mention of the literal "general-purpose"
|
|
684
|
+
// agent name, or natural-language "用 general" / "use general" phrasing.
|
|
685
|
+
const MISUSE_ESCAPE_PATTERN = /(\bgeneral[-_ ]purpose\b|用\s*general|use\s+general|forge:bypass=)/i;
|
|
686
|
+
// 24h observation window: today + 24h. Hard-coded ISO to keep the rule
|
|
687
|
+
// deterministic across daemon restarts; bumped by a future spec if needed.
|
|
688
|
+
const MISUSE_OBSERVATION_UNTIL = '2026-05-28T02:30:00Z';
|
|
689
|
+
/** Default agent recommendation per IMPL bucket — surfaced in the hint. */
|
|
690
|
+
const MISUSE_BUCKET_AGENT_HINT = Object.freeze({
|
|
691
|
+
// R2 merge (decision 7c881393): hotfix / refactor / hybrid buckets all
|
|
692
|
+
// route to safety-net-implementer; the bucket name doubles as the mode hint.
|
|
693
|
+
'harness-hotfix': 'safety-net-implementer',
|
|
694
|
+
'harness-debug': 'harness-debug-full',
|
|
695
|
+
'refactor': 'safety-net-implementer',
|
|
696
|
+
'hybrid': 'safety-net-implementer',
|
|
697
|
+
});
|
|
698
|
+
const RULE_TASK_SPAWN_GENERAL_PURPOSE_MISUSE = {
|
|
699
|
+
id: 'task-spawn-general-purpose-misuse',
|
|
700
|
+
kind: 'tool_intercept',
|
|
701
|
+
description: 'Task spawn general-purpose 但任务匹配专门 agent — 应改用 specialist',
|
|
702
|
+
claudemdRef: 'docs/architecture/governance.md §6 可用 subagent_type 清单 + 自查触发条件',
|
|
703
|
+
tool: 'Task',
|
|
704
|
+
decision: 'deny',
|
|
705
|
+
observation_until: MISUSE_OBSERVATION_UNTIL,
|
|
706
|
+
match: (input, ctx) => {
|
|
707
|
+
const sub = typeof input.subagent_type === 'string' ? input.subagent_type : '';
|
|
708
|
+
if (sub !== 'general-purpose')
|
|
709
|
+
return false;
|
|
710
|
+
if (ctx.recent_agent_spawn)
|
|
711
|
+
return false;
|
|
712
|
+
const prompt = ctx.recent_prompt ?? '';
|
|
713
|
+
if (!prompt)
|
|
714
|
+
return false;
|
|
715
|
+
// Escape hatch — user explicitly asked for general-purpose or used the
|
|
716
|
+
// bypass token.
|
|
717
|
+
if (MISUSE_ESCAPE_PATTERN.test(prompt))
|
|
718
|
+
return false;
|
|
719
|
+
const scored = scoreKeywordBuckets(prompt);
|
|
720
|
+
if (!scored)
|
|
721
|
+
return false;
|
|
722
|
+
if (!IMPL_BUCKET_TYPES.has(scored.workflow_type))
|
|
723
|
+
return false;
|
|
724
|
+
if (scored.matched.length < MISUSE_MIN_BUCKET_HITS)
|
|
725
|
+
return false;
|
|
726
|
+
return true;
|
|
727
|
+
},
|
|
728
|
+
hint: (_input, ctx) => {
|
|
729
|
+
const prompt = ctx.recent_prompt ?? '';
|
|
730
|
+
const scored = scoreKeywordBuckets(prompt);
|
|
731
|
+
const bucket = scored?.workflow_type ?? '(未识别)';
|
|
732
|
+
const recommended = MISUSE_BUCKET_AGENT_HINT[bucket] ?? '(对应 specialist)';
|
|
733
|
+
const matchedList = scored?.matched.join(', ') ?? '(无)';
|
|
734
|
+
return [
|
|
735
|
+
`检测到你 spawn 了 'general-purpose',但 prompt 匹配 '${bucket}' 工作流`,
|
|
736
|
+
`(命中关键词:${matchedList})。`,
|
|
737
|
+
``,
|
|
738
|
+
`CLAUDE.md L175-197「可用 subagent_type 清单」要求:`,
|
|
739
|
+
` ${bucket} 类任务 → spawn '${recommended}'(自带 safety-net / spec-gate / verify-gate)。`,
|
|
740
|
+
``,
|
|
741
|
+
`general-purpose 是兜底,专门 agent 的工作流约束在 general-purpose 下不生效。`,
|
|
742
|
+
``,
|
|
743
|
+
`请二选一:`,
|
|
744
|
+
` 1) 重新调 Task tool subagent_type='${recommended}'`,
|
|
745
|
+
` 2) 如确认要用 general-purpose(如批量文件 IO),在 prompt 里加 "用 general" 或追加 \`# forge:bypass=<原因>\``,
|
|
746
|
+
].join('\n') + BYPASS_SUFFIX;
|
|
747
|
+
},
|
|
748
|
+
};
|
|
749
|
+
// ── Registry export ────────────────────────────────────────────────────────
|
|
750
|
+
/**
|
|
751
|
+
* Order matters: PreToolUseHandler matches the FIRST rule that fires.
|
|
752
|
+
* Put `deny` rules before `warn` rules so a 3-file Edit is denied (not warned).
|
|
753
|
+
*/
|
|
754
|
+
export const defaultRules = [
|
|
755
|
+
// Bash deny rules
|
|
756
|
+
RULE_BASH_GREP_MULTI_FILE,
|
|
757
|
+
RULE_BASH_FIND_SOURCE,
|
|
758
|
+
RULE_BASH_GIT_LOG_DIFF_NO_FILE,
|
|
759
|
+
// Edit/Write hook protection (deny)
|
|
760
|
+
RULE_EDIT_HOOK_SCRIPT,
|
|
761
|
+
RULE_WRITE_HOOK_SCRIPT,
|
|
762
|
+
// Edit/Write hard threshold (deny)
|
|
763
|
+
RULE_EDIT_MULTI_FILE_HARD,
|
|
764
|
+
RULE_WRITE_MULTI_FILE_HARD,
|
|
765
|
+
// 8-in-1 Phase C (2026-05-27): general-purpose misuse gate (deny, 24h
|
|
766
|
+
// observation window) — the keyword-bucket fallback gate for Task spawns.
|
|
767
|
+
RULE_TASK_SPAWN_GENERAL_PURPOSE_MISUSE,
|
|
768
|
+
// v9.x Phase 2 (2026-05-26): user-question default BMAD gate (deny).
|
|
769
|
+
RULE_TASK_QUESTION_NEEDS_BMAD,
|
|
770
|
+
// Edit/Write soft threshold (warn) — must come AFTER the hard variant.
|
|
771
|
+
RULE_EDIT_MULTI_FILE_NO_AGENT,
|
|
772
|
+
RULE_WRITE_MULTI_FILE_NO_AGENT,
|
|
773
|
+
// f47c2c90 (2026-06-17): inline single-file no-spawn (warn) — LAST / weakest.
|
|
774
|
+
// Only fires on the ==1 segment, mutually exclusive with the ==2 no-agent and
|
|
775
|
+
// ≥3 hard rules above, so registry findFirstMatch ordering is safe.
|
|
776
|
+
RULE_INLINE_EDIT_NO_SPAWN,
|
|
777
|
+
RULE_INLINE_WRITE_NO_SPAWN,
|
|
778
|
+
];
|
|
779
|
+
//# sourceMappingURL=defaults.js.map
|