raptor-aios 0.1.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/CHANGELOG.md +26 -0
- package/LICENSE +21 -0
- package/README.md +315 -0
- package/bin/raptor.js +5 -0
- package/dist/_core/dist/agents/adapters/antigravity.d.ts +9 -0
- package/dist/_core/dist/agents/adapters/antigravity.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/antigravity.js +72 -0
- package/dist/_core/dist/agents/adapters/antigravity.js.map +1 -0
- package/dist/_core/dist/agents/adapters/claude-code.d.ts +9 -0
- package/dist/_core/dist/agents/adapters/claude-code.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/claude-code.js +71 -0
- package/dist/_core/dist/agents/adapters/claude-code.js.map +1 -0
- package/dist/_core/dist/agents/adapters/codex.d.ts +12 -0
- package/dist/_core/dist/agents/adapters/codex.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/codex.js +69 -0
- package/dist/_core/dist/agents/adapters/codex.js.map +1 -0
- package/dist/_core/dist/agents/adapters/copilot.d.ts +12 -0
- package/dist/_core/dist/agents/adapters/copilot.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/copilot.js +71 -0
- package/dist/_core/dist/agents/adapters/copilot.js.map +1 -0
- package/dist/_core/dist/agents/adapters/cursor.d.ts +9 -0
- package/dist/_core/dist/agents/adapters/cursor.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/cursor.js +62 -0
- package/dist/_core/dist/agents/adapters/cursor.js.map +1 -0
- package/dist/_core/dist/agents/adapters/gemini.d.ts +11 -0
- package/dist/_core/dist/agents/adapters/gemini.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/gemini.js +68 -0
- package/dist/_core/dist/agents/adapters/gemini.js.map +1 -0
- package/dist/_core/dist/agents/adapters/human.d.ts +10 -0
- package/dist/_core/dist/agents/adapters/human.d.ts.map +1 -0
- package/dist/_core/dist/agents/adapters/human.js +48 -0
- package/dist/_core/dist/agents/adapters/human.js.map +1 -0
- package/dist/_core/dist/agents/artifact-watcher.d.ts +86 -0
- package/dist/_core/dist/agents/artifact-watcher.d.ts.map +1 -0
- package/dist/_core/dist/agents/artifact-watcher.js +214 -0
- package/dist/_core/dist/agents/artifact-watcher.js.map +1 -0
- package/dist/_core/dist/agents/backup.d.ts +69 -0
- package/dist/_core/dist/agents/backup.d.ts.map +1 -0
- package/dist/_core/dist/agents/backup.js +107 -0
- package/dist/_core/dist/agents/backup.js.map +1 -0
- package/dist/_core/dist/agents/config.d.ts +36 -0
- package/dist/_core/dist/agents/config.d.ts.map +1 -0
- package/dist/_core/dist/agents/config.js +270 -0
- package/dist/_core/dist/agents/config.js.map +1 -0
- package/dist/_core/dist/agents/context-file.d.ts +35 -0
- package/dist/_core/dist/agents/context-file.d.ts.map +1 -0
- package/dist/_core/dist/agents/context-file.js +106 -0
- package/dist/_core/dist/agents/context-file.js.map +1 -0
- package/dist/_core/dist/agents/handoff.d.ts +57 -0
- package/dist/_core/dist/agents/handoff.d.ts.map +1 -0
- package/dist/_core/dist/agents/handoff.js +71 -0
- package/dist/_core/dist/agents/handoff.js.map +1 -0
- package/dist/_core/dist/agents/index.d.ts +32 -0
- package/dist/_core/dist/agents/index.d.ts.map +1 -0
- package/dist/_core/dist/agents/index.js +37 -0
- package/dist/_core/dist/agents/index.js.map +1 -0
- package/dist/_core/dist/agents/keys.d.ts +50 -0
- package/dist/_core/dist/agents/keys.d.ts.map +1 -0
- package/dist/_core/dist/agents/keys.js +91 -0
- package/dist/_core/dist/agents/keys.js.map +1 -0
- package/dist/_core/dist/agents/materialize.d.ts +37 -0
- package/dist/_core/dist/agents/materialize.d.ts.map +1 -0
- package/dist/_core/dist/agents/materialize.js +157 -0
- package/dist/_core/dist/agents/materialize.js.map +1 -0
- package/dist/_core/dist/agents/prompt-builder.d.ts +35 -0
- package/dist/_core/dist/agents/prompt-builder.d.ts.map +1 -0
- package/dist/_core/dist/agents/prompt-builder.js +261 -0
- package/dist/_core/dist/agents/prompt-builder.js.map +1 -0
- package/dist/_core/dist/agents/prompt-markers.d.ts +69 -0
- package/dist/_core/dist/agents/prompt-markers.d.ts.map +1 -0
- package/dist/_core/dist/agents/prompt-markers.js +111 -0
- package/dist/_core/dist/agents/prompt-markers.js.map +1 -0
- package/dist/_core/dist/agents/registry.d.ts +35 -0
- package/dist/_core/dist/agents/registry.d.ts.map +1 -0
- package/dist/_core/dist/agents/registry.js +102 -0
- package/dist/_core/dist/agents/registry.js.map +1 -0
- package/dist/_core/dist/agents/selector.d.ts +33 -0
- package/dist/_core/dist/agents/selector.d.ts.map +1 -0
- package/dist/_core/dist/agents/selector.js +120 -0
- package/dist/_core/dist/agents/selector.js.map +1 -0
- package/dist/_core/dist/agents/slash-materializer.d.ts +63 -0
- package/dist/_core/dist/agents/slash-materializer.d.ts.map +1 -0
- package/dist/_core/dist/agents/slash-materializer.js +131 -0
- package/dist/_core/dist/agents/slash-materializer.js.map +1 -0
- package/dist/_core/dist/agents/types.d.ts +121 -0
- package/dist/_core/dist/agents/types.d.ts.map +1 -0
- package/dist/_core/dist/agents/types.js +10 -0
- package/dist/_core/dist/agents/types.js.map +1 -0
- package/dist/_core/dist/audit/hash.d.ts +4 -0
- package/dist/_core/dist/audit/hash.d.ts.map +1 -0
- package/dist/_core/dist/audit/hash.js +12 -0
- package/dist/_core/dist/audit/hash.js.map +1 -0
- package/dist/_core/dist/audit/index.d.ts +6 -0
- package/dist/_core/dist/audit/index.d.ts.map +1 -0
- package/dist/_core/dist/audit/index.js +6 -0
- package/dist/_core/dist/audit/index.js.map +1 -0
- package/dist/_core/dist/audit/logger.d.ts +77 -0
- package/dist/_core/dist/audit/logger.d.ts.map +1 -0
- package/dist/_core/dist/audit/logger.js +93 -0
- package/dist/_core/dist/audit/logger.js.map +1 -0
- package/dist/_core/dist/audit/query.d.ts +13 -0
- package/dist/_core/dist/audit/query.d.ts.map +1 -0
- package/dist/_core/dist/audit/query.js +57 -0
- package/dist/_core/dist/audit/query.js.map +1 -0
- package/dist/_core/dist/audit/schema.d.ts +455 -0
- package/dist/_core/dist/audit/schema.d.ts.map +1 -0
- package/dist/_core/dist/audit/schema.js +341 -0
- package/dist/_core/dist/audit/schema.js.map +1 -0
- package/dist/_core/dist/audit/validate.d.ts +21 -0
- package/dist/_core/dist/audit/validate.d.ts.map +1 -0
- package/dist/_core/dist/audit/validate.js +139 -0
- package/dist/_core/dist/audit/validate.js.map +1 -0
- package/dist/_core/dist/constitution/core.d.ts +22 -0
- package/dist/_core/dist/constitution/core.d.ts.map +1 -0
- package/dist/_core/dist/constitution/core.js +102 -0
- package/dist/_core/dist/constitution/core.js.map +1 -0
- package/dist/_core/dist/constitution/index.d.ts +2 -0
- package/dist/_core/dist/constitution/index.d.ts.map +1 -0
- package/dist/_core/dist/constitution/index.js +2 -0
- package/dist/_core/dist/constitution/index.js.map +1 -0
- package/dist/_core/dist/extensions/index.d.ts +12 -0
- package/dist/_core/dist/extensions/index.d.ts.map +1 -0
- package/dist/_core/dist/extensions/index.js +12 -0
- package/dist/_core/dist/extensions/index.js.map +1 -0
- package/dist/_core/dist/extensions/integrate.d.ts +69 -0
- package/dist/_core/dist/extensions/integrate.d.ts.map +1 -0
- package/dist/_core/dist/extensions/integrate.js +181 -0
- package/dist/_core/dist/extensions/integrate.js.map +1 -0
- package/dist/_core/dist/extensions/loader.d.ts +24 -0
- package/dist/_core/dist/extensions/loader.d.ts.map +1 -0
- package/dist/_core/dist/extensions/loader.js +73 -0
- package/dist/_core/dist/extensions/loader.js.map +1 -0
- package/dist/_core/dist/extensions/manifest.d.ts +23 -0
- package/dist/_core/dist/extensions/manifest.d.ts.map +1 -0
- package/dist/_core/dist/extensions/manifest.js +176 -0
- package/dist/_core/dist/extensions/manifest.js.map +1 -0
- package/dist/_core/dist/extensions/registry.d.ts +32 -0
- package/dist/_core/dist/extensions/registry.d.ts.map +1 -0
- package/dist/_core/dist/extensions/registry.js +57 -0
- package/dist/_core/dist/extensions/registry.js.map +1 -0
- package/dist/_core/dist/extensions/resolver.d.ts +55 -0
- package/dist/_core/dist/extensions/resolver.d.ts.map +1 -0
- package/dist/_core/dist/extensions/resolver.js +143 -0
- package/dist/_core/dist/extensions/resolver.js.map +1 -0
- package/dist/_core/dist/extensions/types.d.ts +173 -0
- package/dist/_core/dist/extensions/types.d.ts.map +1 -0
- package/dist/_core/dist/extensions/types.js +83 -0
- package/dist/_core/dist/extensions/types.js.map +1 -0
- package/dist/_core/dist/frontmatter/index.d.ts +10 -0
- package/dist/_core/dist/frontmatter/index.d.ts.map +1 -0
- package/dist/_core/dist/frontmatter/index.js +24 -0
- package/dist/_core/dist/frontmatter/index.js.map +1 -0
- package/dist/_core/dist/gates/agent-gates.d.ts +16 -0
- package/dist/_core/dist/gates/agent-gates.d.ts.map +1 -0
- package/dist/_core/dist/gates/agent-gates.js +205 -0
- package/dist/_core/dist/gates/agent-gates.js.map +1 -0
- package/dist/_core/dist/gates/builtin.d.ts +18 -0
- package/dist/_core/dist/gates/builtin.d.ts.map +1 -0
- package/dist/_core/dist/gates/builtin.js +860 -0
- package/dist/_core/dist/gates/builtin.js.map +1 -0
- package/dist/_core/dist/gates/index.d.ts +7 -0
- package/dist/_core/dist/gates/index.d.ts.map +1 -0
- package/dist/_core/dist/gates/index.js +7 -0
- package/dist/_core/dist/gates/index.js.map +1 -0
- package/dist/_core/dist/gates/m7-gates.d.ts +17 -0
- package/dist/_core/dist/gates/m7-gates.d.ts.map +1 -0
- package/dist/_core/dist/gates/m7-gates.js +309 -0
- package/dist/_core/dist/gates/m7-gates.js.map +1 -0
- package/dist/_core/dist/gates/phase-gates.d.ts +18 -0
- package/dist/_core/dist/gates/phase-gates.d.ts.map +1 -0
- package/dist/_core/dist/gates/phase-gates.js +275 -0
- package/dist/_core/dist/gates/phase-gates.js.map +1 -0
- package/dist/_core/dist/gates/runner.d.ts +4 -0
- package/dist/_core/dist/gates/runner.d.ts.map +1 -0
- package/dist/_core/dist/gates/runner.js +64 -0
- package/dist/_core/dist/gates/runner.js.map +1 -0
- package/dist/_core/dist/gates/types.d.ts +36 -0
- package/dist/_core/dist/gates/types.d.ts.map +1 -0
- package/dist/_core/dist/gates/types.js +2 -0
- package/dist/_core/dist/gates/types.js.map +1 -0
- package/dist/_core/dist/hooks/index.d.ts +4 -0
- package/dist/_core/dist/hooks/index.d.ts.map +1 -0
- package/dist/_core/dist/hooks/index.js +4 -0
- package/dist/_core/dist/hooks/index.js.map +1 -0
- package/dist/_core/dist/hooks/runner.d.ts +28 -0
- package/dist/_core/dist/hooks/runner.d.ts.map +1 -0
- package/dist/_core/dist/hooks/runner.js +294 -0
- package/dist/_core/dist/hooks/runner.js.map +1 -0
- package/dist/_core/dist/hooks/runtime.d.ts +65 -0
- package/dist/_core/dist/hooks/runtime.d.ts.map +1 -0
- package/dist/_core/dist/hooks/runtime.js +212 -0
- package/dist/_core/dist/hooks/runtime.js.map +1 -0
- package/dist/_core/dist/hooks/types.d.ts +36 -0
- package/dist/_core/dist/hooks/types.d.ts.map +1 -0
- package/dist/_core/dist/hooks/types.js +23 -0
- package/dist/_core/dist/hooks/types.js.map +1 -0
- package/dist/_core/dist/index.d.ts +21 -0
- package/dist/_core/dist/index.d.ts.map +1 -0
- package/dist/_core/dist/index.js +20 -0
- package/dist/_core/dist/index.js.map +1 -0
- package/dist/_core/dist/manifest/index.d.ts +119 -0
- package/dist/_core/dist/manifest/index.d.ts.map +1 -0
- package/dist/_core/dist/manifest/index.js +125 -0
- package/dist/_core/dist/manifest/index.js.map +1 -0
- package/dist/_core/dist/markers/index.d.ts +47 -0
- package/dist/_core/dist/markers/index.d.ts.map +1 -0
- package/dist/_core/dist/markers/index.js +97 -0
- package/dist/_core/dist/markers/index.js.map +1 -0
- package/dist/_core/dist/mcp/config.d.ts +19 -0
- package/dist/_core/dist/mcp/config.d.ts.map +1 -0
- package/dist/_core/dist/mcp/config.js +114 -0
- package/dist/_core/dist/mcp/config.js.map +1 -0
- package/dist/_core/dist/mcp/index.d.ts +9 -0
- package/dist/_core/dist/mcp/index.d.ts.map +1 -0
- package/dist/_core/dist/mcp/index.js +8 -0
- package/dist/_core/dist/mcp/index.js.map +1 -0
- package/dist/_core/dist/mcp/materializer.d.ts +40 -0
- package/dist/_core/dist/mcp/materializer.d.ts.map +1 -0
- package/dist/_core/dist/mcp/materializer.js +161 -0
- package/dist/_core/dist/mcp/materializer.js.map +1 -0
- package/dist/_core/dist/mcp/targets.d.ts +37 -0
- package/dist/_core/dist/mcp/targets.d.ts.map +1 -0
- package/dist/_core/dist/mcp/targets.js +56 -0
- package/dist/_core/dist/mcp/targets.js.map +1 -0
- package/dist/_core/dist/mcp/types.d.ts +34 -0
- package/dist/_core/dist/mcp/types.d.ts.map +1 -0
- package/dist/_core/dist/mcp/types.js +8 -0
- package/dist/_core/dist/mcp/types.js.map +1 -0
- package/dist/_core/dist/models/analyze.d.ts +131 -0
- package/dist/_core/dist/models/analyze.d.ts.map +1 -0
- package/dist/_core/dist/models/analyze.js +301 -0
- package/dist/_core/dist/models/analyze.js.map +1 -0
- package/dist/_core/dist/models/checklist.d.ts +113 -0
- package/dist/_core/dist/models/checklist.d.ts.map +1 -0
- package/dist/_core/dist/models/checklist.js +159 -0
- package/dist/_core/dist/models/checklist.js.map +1 -0
- package/dist/_core/dist/models/clarify.d.ts +116 -0
- package/dist/_core/dist/models/clarify.d.ts.map +1 -0
- package/dist/_core/dist/models/clarify.js +166 -0
- package/dist/_core/dist/models/clarify.js.map +1 -0
- package/dist/_core/dist/models/impl-log.d.ts +64 -0
- package/dist/_core/dist/models/impl-log.d.ts.map +1 -0
- package/dist/_core/dist/models/impl-log.js +137 -0
- package/dist/_core/dist/models/impl-log.js.map +1 -0
- package/dist/_core/dist/models/index.d.ts +8 -0
- package/dist/_core/dist/models/index.d.ts.map +1 -0
- package/dist/_core/dist/models/index.js +8 -0
- package/dist/_core/dist/models/index.js.map +1 -0
- package/dist/_core/dist/models/plan.d.ts +24 -0
- package/dist/_core/dist/models/plan.d.ts.map +1 -0
- package/dist/_core/dist/models/plan.js +15 -0
- package/dist/_core/dist/models/plan.js.map +1 -0
- package/dist/_core/dist/models/spec.d.ts +23 -0
- package/dist/_core/dist/models/spec.d.ts.map +1 -0
- package/dist/_core/dist/models/spec.js +22 -0
- package/dist/_core/dist/models/spec.js.map +1 -0
- package/dist/_core/dist/models/tasks.d.ts +33 -0
- package/dist/_core/dist/models/tasks.d.ts.map +1 -0
- package/dist/_core/dist/models/tasks.js +78 -0
- package/dist/_core/dist/models/tasks.js.map +1 -0
- package/dist/_core/dist/presets/gates.d.ts +9 -0
- package/dist/_core/dist/presets/gates.d.ts.map +1 -0
- package/dist/_core/dist/presets/gates.js +173 -0
- package/dist/_core/dist/presets/gates.js.map +1 -0
- package/dist/_core/dist/presets/index.d.ts +10 -0
- package/dist/_core/dist/presets/index.d.ts.map +1 -0
- package/dist/_core/dist/presets/index.js +7 -0
- package/dist/_core/dist/presets/index.js.map +1 -0
- package/dist/_core/dist/presets/loader.d.ts +56 -0
- package/dist/_core/dist/presets/loader.d.ts.map +1 -0
- package/dist/_core/dist/presets/loader.js +216 -0
- package/dist/_core/dist/presets/loader.js.map +1 -0
- package/dist/_core/dist/presets/mobile-opinionated.d.ts +3 -0
- package/dist/_core/dist/presets/mobile-opinionated.d.ts.map +1 -0
- package/dist/_core/dist/presets/mobile-opinionated.js +78 -0
- package/dist/_core/dist/presets/mobile-opinionated.js.map +1 -0
- package/dist/_core/dist/presets/registry.d.ts +5 -0
- package/dist/_core/dist/presets/registry.d.ts.map +1 -0
- package/dist/_core/dist/presets/registry.js +14 -0
- package/dist/_core/dist/presets/registry.js.map +1 -0
- package/dist/_core/dist/presets/renderer.d.ts +5 -0
- package/dist/_core/dist/presets/renderer.d.ts.map +1 -0
- package/dist/_core/dist/presets/renderer.js +37 -0
- package/dist/_core/dist/presets/renderer.js.map +1 -0
- package/dist/_core/dist/presets/stacking.d.ts +29 -0
- package/dist/_core/dist/presets/stacking.d.ts.map +1 -0
- package/dist/_core/dist/presets/stacking.js +91 -0
- package/dist/_core/dist/presets/stacking.js.map +1 -0
- package/dist/_core/dist/presets/types.d.ts +22 -0
- package/dist/_core/dist/presets/types.d.ts.map +1 -0
- package/dist/_core/dist/presets/types.js +2 -0
- package/dist/_core/dist/presets/types.js.map +1 -0
- package/dist/_core/dist/prompts/audit-log.d.ts +73 -0
- package/dist/_core/dist/prompts/audit-log.d.ts.map +1 -0
- package/dist/_core/dist/prompts/audit-log.js +73 -0
- package/dist/_core/dist/prompts/audit-log.js.map +1 -0
- package/dist/_core/dist/prompts/index.d.ts +9 -0
- package/dist/_core/dist/prompts/index.d.ts.map +1 -0
- package/dist/_core/dist/prompts/index.js +7 -0
- package/dist/_core/dist/prompts/index.js.map +1 -0
- package/dist/_core/dist/prompts/renderer.d.ts +73 -0
- package/dist/_core/dist/prompts/renderer.d.ts.map +1 -0
- package/dist/_core/dist/prompts/renderer.js +179 -0
- package/dist/_core/dist/prompts/renderer.js.map +1 -0
- package/dist/_core/dist/prompts/resumption.d.ts +59 -0
- package/dist/_core/dist/prompts/resumption.d.ts.map +1 -0
- package/dist/_core/dist/prompts/resumption.js +149 -0
- package/dist/_core/dist/prompts/resumption.js.map +1 -0
- package/dist/_core/dist/skills/config.d.ts +27 -0
- package/dist/_core/dist/skills/config.d.ts.map +1 -0
- package/dist/_core/dist/skills/config.js +102 -0
- package/dist/_core/dist/skills/config.js.map +1 -0
- package/dist/_core/dist/skills/index.d.ts +9 -0
- package/dist/_core/dist/skills/index.d.ts.map +1 -0
- package/dist/_core/dist/skills/index.js +8 -0
- package/dist/_core/dist/skills/index.js.map +1 -0
- package/dist/_core/dist/skills/materializer.d.ts +45 -0
- package/dist/_core/dist/skills/materializer.d.ts.map +1 -0
- package/dist/_core/dist/skills/materializer.js +97 -0
- package/dist/_core/dist/skills/materializer.js.map +1 -0
- package/dist/_core/dist/skills/registry.d.ts +18 -0
- package/dist/_core/dist/skills/registry.d.ts.map +1 -0
- package/dist/_core/dist/skills/registry.js +36 -0
- package/dist/_core/dist/skills/registry.js.map +1 -0
- package/dist/_core/dist/skills/types.d.ts +39 -0
- package/dist/_core/dist/skills/types.d.ts.map +1 -0
- package/dist/_core/dist/skills/types.js +13 -0
- package/dist/_core/dist/skills/types.js.map +1 -0
- package/dist/_core/dist/state/feature.d.ts +58 -0
- package/dist/_core/dist/state/feature.d.ts.map +1 -0
- package/dist/_core/dist/state/feature.js +81 -0
- package/dist/_core/dist/state/feature.js.map +1 -0
- package/dist/_core/dist/state/index.d.ts +8 -0
- package/dist/_core/dist/state/index.d.ts.map +1 -0
- package/dist/_core/dist/state/index.js +6 -0
- package/dist/_core/dist/state/index.js.map +1 -0
- package/dist/_core/dist/state/init-options.d.ts +60 -0
- package/dist/_core/dist/state/init-options.d.ts.map +1 -0
- package/dist/_core/dist/state/init-options.js +74 -0
- package/dist/_core/dist/state/init-options.js.map +1 -0
- package/dist/_core/dist/template/engine.d.ts +7 -0
- package/dist/_core/dist/template/engine.d.ts.map +1 -0
- package/dist/_core/dist/template/engine.js +86 -0
- package/dist/_core/dist/template/engine.js.map +1 -0
- package/dist/_core/dist/template/helpers.d.ts +5 -0
- package/dist/_core/dist/template/helpers.d.ts.map +1 -0
- package/dist/_core/dist/template/helpers.js +59 -0
- package/dist/_core/dist/template/helpers.js.map +1 -0
- package/dist/_core/dist/template/index.d.ts +6 -0
- package/dist/_core/dist/template/index.d.ts.map +1 -0
- package/dist/_core/dist/template/index.js +6 -0
- package/dist/_core/dist/template/index.js.map +1 -0
- package/dist/_core/dist/template/loader.d.ts +36 -0
- package/dist/_core/dist/template/loader.d.ts.map +1 -0
- package/dist/_core/dist/template/loader.js +62 -0
- package/dist/_core/dist/template/loader.js.map +1 -0
- package/dist/_core/dist/template/parser.d.ts +3 -0
- package/dist/_core/dist/template/parser.d.ts.map +1 -0
- package/dist/_core/dist/template/parser.js +234 -0
- package/dist/_core/dist/template/parser.js.map +1 -0
- package/dist/_core/dist/template/types.d.ts +40 -0
- package/dist/_core/dist/template/types.d.ts.map +1 -0
- package/dist/_core/dist/template/types.js +14 -0
- package/dist/_core/dist/template/types.js.map +1 -0
- package/dist/_core/dist/verify/a11y.d.ts +36 -0
- package/dist/_core/dist/verify/a11y.d.ts.map +1 -0
- package/dist/_core/dist/verify/a11y.js +153 -0
- package/dist/_core/dist/verify/a11y.js.map +1 -0
- package/dist/_core/dist/verify/architecture.d.ts +37 -0
- package/dist/_core/dist/verify/architecture.d.ts.map +1 -0
- package/dist/_core/dist/verify/architecture.js +113 -0
- package/dist/_core/dist/verify/architecture.js.map +1 -0
- package/dist/_core/dist/verify/index.d.ts +10 -0
- package/dist/_core/dist/verify/index.d.ts.map +1 -0
- package/dist/_core/dist/verify/index.js +10 -0
- package/dist/_core/dist/verify/index.js.map +1 -0
- package/dist/_core/dist/verify/os-matrix.d.ts +35 -0
- package/dist/_core/dist/verify/os-matrix.d.ts.map +1 -0
- package/dist/_core/dist/verify/os-matrix.js +104 -0
- package/dist/_core/dist/verify/os-matrix.js.map +1 -0
- package/dist/_core/dist/verify/perf.d.ts +43 -0
- package/dist/_core/dist/verify/perf.d.ts.map +1 -0
- package/dist/_core/dist/verify/perf.js +69 -0
- package/dist/_core/dist/verify/perf.js.map +1 -0
- package/dist/_core/dist/verify/stores.d.ts +38 -0
- package/dist/_core/dist/verify/stores.d.ts.map +1 -0
- package/dist/_core/dist/verify/stores.js +57 -0
- package/dist/_core/dist/verify/stores.js.map +1 -0
- package/dist/_core/dist/version.d.ts +8 -0
- package/dist/_core/dist/version.d.ts.map +1 -0
- package/dist/_core/dist/version.js +11 -0
- package/dist/_core/dist/version.js.map +1 -0
- package/dist/_core/dist/workflows/bundled.d.ts +32 -0
- package/dist/_core/dist/workflows/bundled.d.ts.map +1 -0
- package/dist/_core/dist/workflows/bundled.js +254 -0
- package/dist/_core/dist/workflows/bundled.js.map +1 -0
- package/dist/_core/dist/workflows/engine.d.ts +74 -0
- package/dist/_core/dist/workflows/engine.d.ts.map +1 -0
- package/dist/_core/dist/workflows/engine.js +574 -0
- package/dist/_core/dist/workflows/engine.js.map +1 -0
- package/dist/_core/dist/workflows/expressions.d.ts +48 -0
- package/dist/_core/dist/workflows/expressions.d.ts.map +1 -0
- package/dist/_core/dist/workflows/expressions.js +336 -0
- package/dist/_core/dist/workflows/expressions.js.map +1 -0
- package/dist/_core/dist/workflows/index.d.ts +16 -0
- package/dist/_core/dist/workflows/index.d.ts.map +1 -0
- package/dist/_core/dist/workflows/index.js +15 -0
- package/dist/_core/dist/workflows/index.js.map +1 -0
- package/dist/_core/dist/workflows/parser.d.ts +38 -0
- package/dist/_core/dist/workflows/parser.d.ts.map +1 -0
- package/dist/_core/dist/workflows/parser.js +386 -0
- package/dist/_core/dist/workflows/parser.js.map +1 -0
- package/dist/_core/dist/workflows/sdd-flow.d.ts +85 -0
- package/dist/_core/dist/workflows/sdd-flow.d.ts.map +1 -0
- package/dist/_core/dist/workflows/sdd-flow.js +269 -0
- package/dist/_core/dist/workflows/sdd-flow.js.map +1 -0
- package/dist/_core/dist/workflows/types.d.ts +285 -0
- package/dist/_core/dist/workflows/types.d.ts.map +1 -0
- package/dist/_core/dist/workflows/types.js +13 -0
- package/dist/_core/dist/workflows/types.js.map +1 -0
- package/dist/_core/package.json +6 -0
- package/dist/_core/templates/constitution.md.hbs +46 -0
- package/dist/_core/templates/ghaWorkflow.yml.hbs +58 -0
- package/dist/_core/templates/hotfix.md.hbs +39 -0
- package/dist/_core/templates/plan.md.hbs +212 -0
- package/dist/_core/templates/preCommitHook.sh.hbs +30 -0
- package/dist/_core/templates/prePushHook.sh.hbs +45 -0
- package/dist/_core/templates/raptor.yml.hbs +24 -0
- package/dist/_core/templates/spec.md.hbs +127 -0
- package/dist/_core/templates/tasks.md.hbs +71 -0
- package/dist/commands/add-agent.d.ts +22 -0
- package/dist/commands/add-agent.d.ts.map +1 -0
- package/dist/commands/add-agent.js +121 -0
- package/dist/commands/add-agent.js.map +1 -0
- package/dist/commands/add-extension.d.ts +18 -0
- package/dist/commands/add-extension.d.ts.map +1 -0
- package/dist/commands/add-extension.js +83 -0
- package/dist/commands/add-extension.js.map +1 -0
- package/dist/commands/analyze.d.ts +18 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +323 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/approve.d.ts +14 -0
- package/dist/commands/approve.d.ts.map +1 -0
- package/dist/commands/approve.js +116 -0
- package/dist/commands/approve.js.map +1 -0
- package/dist/commands/audit/query.d.ts +23 -0
- package/dist/commands/audit/query.d.ts.map +1 -0
- package/dist/commands/audit/query.js +118 -0
- package/dist/commands/audit/query.js.map +1 -0
- package/dist/commands/audit/show.d.ts +17 -0
- package/dist/commands/audit/show.d.ts.map +1 -0
- package/dist/commands/audit/show.js +53 -0
- package/dist/commands/audit/show.js.map +1 -0
- package/dist/commands/checklist.d.ts +17 -0
- package/dist/commands/checklist.d.ts.map +1 -0
- package/dist/commands/checklist.js +255 -0
- package/dist/commands/checklist.js.map +1 -0
- package/dist/commands/clarify.d.ts +17 -0
- package/dist/commands/clarify.d.ts.map +1 -0
- package/dist/commands/clarify.js +254 -0
- package/dist/commands/clarify.js.map +1 -0
- package/dist/commands/doctor.d.ts +8 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +435 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/extension/add.d.ts +15 -0
- package/dist/commands/extension/add.d.ts.map +1 -0
- package/dist/commands/extension/add.js +93 -0
- package/dist/commands/extension/add.js.map +1 -0
- package/dist/commands/extension/info.d.ts +13 -0
- package/dist/commands/extension/info.d.ts.map +1 -0
- package/dist/commands/extension/info.js +75 -0
- package/dist/commands/extension/info.js.map +1 -0
- package/dist/commands/extension/list.d.ts +10 -0
- package/dist/commands/extension/list.d.ts.map +1 -0
- package/dist/commands/extension/list.js +71 -0
- package/dist/commands/extension/list.js.map +1 -0
- package/dist/commands/extension/remove.d.ts +14 -0
- package/dist/commands/extension/remove.d.ts.map +1 -0
- package/dist/commands/extension/remove.js +49 -0
- package/dist/commands/extension/remove.js.map +1 -0
- package/dist/commands/gate/approve.d.ts +15 -0
- package/dist/commands/gate/approve.d.ts.map +1 -0
- package/dist/commands/gate/approve.js +106 -0
- package/dist/commands/gate/approve.js.map +1 -0
- package/dist/commands/gate/list.d.ts +6 -0
- package/dist/commands/gate/list.d.ts.map +1 -0
- package/dist/commands/gate/list.js +38 -0
- package/dist/commands/gate/list.js.map +1 -0
- package/dist/commands/gate/skip.d.ts +14 -0
- package/dist/commands/gate/skip.d.ts.map +1 -0
- package/dist/commands/gate/skip.js +95 -0
- package/dist/commands/gate/skip.js.map +1 -0
- package/dist/commands/hook/list.d.ts +11 -0
- package/dist/commands/hook/list.d.ts.map +1 -0
- package/dist/commands/hook/list.js +152 -0
- package/dist/commands/hook/list.js.map +1 -0
- package/dist/commands/hook/run.d.ts +16 -0
- package/dist/commands/hook/run.d.ts.map +1 -0
- package/dist/commands/hook/run.js +74 -0
- package/dist/commands/hook/run.js.map +1 -0
- package/dist/commands/hotfix.d.ts +21 -0
- package/dist/commands/hotfix.d.ts.map +1 -0
- package/dist/commands/hotfix.js +216 -0
- package/dist/commands/hotfix.js.map +1 -0
- package/dist/commands/implement.d.ts +19 -0
- package/dist/commands/implement.d.ts.map +1 -0
- package/dist/commands/implement.js +282 -0
- package/dist/commands/implement.js.map +1 -0
- package/dist/commands/init.d.ts +43 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +465 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list-agents.d.ts +12 -0
- package/dist/commands/list-agents.d.ts.map +1 -0
- package/dist/commands/list-agents.js +55 -0
- package/dist/commands/list-agents.js.map +1 -0
- package/dist/commands/mcp/add.d.ts +21 -0
- package/dist/commands/mcp/add.d.ts.map +1 -0
- package/dist/commands/mcp/add.js +119 -0
- package/dist/commands/mcp/add.js.map +1 -0
- package/dist/commands/mcp/list.d.ts +10 -0
- package/dist/commands/mcp/list.d.ts.map +1 -0
- package/dist/commands/mcp/list.js +54 -0
- package/dist/commands/mcp/list.js.map +1 -0
- package/dist/commands/mcp/remove.d.ts +10 -0
- package/dist/commands/mcp/remove.d.ts.map +1 -0
- package/dist/commands/mcp/remove.js +53 -0
- package/dist/commands/mcp/remove.js.map +1 -0
- package/dist/commands/mcp/sync.d.ts +7 -0
- package/dist/commands/mcp/sync.d.ts.map +1 -0
- package/dist/commands/mcp/sync.js +31 -0
- package/dist/commands/mcp/sync.js.map +1 -0
- package/dist/commands/new.d.ts +19 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +306 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/plan.d.ts +17 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +200 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/preset/add.d.ts +13 -0
- package/dist/commands/preset/add.d.ts.map +1 -0
- package/dist/commands/preset/add.js +66 -0
- package/dist/commands/preset/add.js.map +1 -0
- package/dist/commands/preset/info.d.ts +13 -0
- package/dist/commands/preset/info.d.ts.map +1 -0
- package/dist/commands/preset/info.js +80 -0
- package/dist/commands/preset/info.js.map +1 -0
- package/dist/commands/preset/list.d.ts +10 -0
- package/dist/commands/preset/list.d.ts.map +1 -0
- package/dist/commands/preset/list.js +63 -0
- package/dist/commands/preset/list.js.map +1 -0
- package/dist/commands/preset/remove.d.ts +14 -0
- package/dist/commands/preset/remove.d.ts.map +1 -0
- package/dist/commands/preset/remove.js +60 -0
- package/dist/commands/preset/remove.js.map +1 -0
- package/dist/commands/repair/constitution.d.ts +11 -0
- package/dist/commands/repair/constitution.d.ts.map +1 -0
- package/dist/commands/repair/constitution.js +117 -0
- package/dist/commands/repair/constitution.js.map +1 -0
- package/dist/commands/resync.d.ts +22 -0
- package/dist/commands/resync.d.ts.map +1 -0
- package/dist/commands/resync.js +103 -0
- package/dist/commands/resync.js.map +1 -0
- package/dist/commands/skill/add.d.ts +19 -0
- package/dist/commands/skill/add.d.ts.map +1 -0
- package/dist/commands/skill/add.js +107 -0
- package/dist/commands/skill/add.js.map +1 -0
- package/dist/commands/skill/list.d.ts +10 -0
- package/dist/commands/skill/list.d.ts.map +1 -0
- package/dist/commands/skill/list.js +56 -0
- package/dist/commands/skill/list.js.map +1 -0
- package/dist/commands/skill/remove.d.ts +10 -0
- package/dist/commands/skill/remove.d.ts.map +1 -0
- package/dist/commands/skill/remove.js +47 -0
- package/dist/commands/skill/remove.js.map +1 -0
- package/dist/commands/skill/sync.d.ts +7 -0
- package/dist/commands/skill/sync.d.ts.map +1 -0
- package/dist/commands/skill/sync.js +30 -0
- package/dist/commands/skill/sync.js.map +1 -0
- package/dist/commands/status.d.ts +17 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +265 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/tasks.d.ts +16 -0
- package/dist/commands/tasks.d.ts.map +1 -0
- package/dist/commands/tasks.js +176 -0
- package/dist/commands/tasks.js.map +1 -0
- package/dist/commands/trace.d.ts +16 -0
- package/dist/commands/trace.d.ts.map +1 -0
- package/dist/commands/trace.js +113 -0
- package/dist/commands/trace.js.map +1 -0
- package/dist/commands/upgrade.d.ts +20 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +178 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/verify/a11y.d.ts +15 -0
- package/dist/commands/verify/a11y.d.ts.map +1 -0
- package/dist/commands/verify/a11y.js +121 -0
- package/dist/commands/verify/a11y.js.map +1 -0
- package/dist/commands/verify/architecture.d.ts +11 -0
- package/dist/commands/verify/architecture.d.ts.map +1 -0
- package/dist/commands/verify/architecture.js +71 -0
- package/dist/commands/verify/architecture.js.map +1 -0
- package/dist/commands/verify/audit.d.ts +18 -0
- package/dist/commands/verify/audit.d.ts.map +1 -0
- package/dist/commands/verify/audit.js +108 -0
- package/dist/commands/verify/audit.js.map +1 -0
- package/dist/commands/verify/constitution.d.ts +10 -0
- package/dist/commands/verify/constitution.d.ts.map +1 -0
- package/dist/commands/verify/constitution.js +91 -0
- package/dist/commands/verify/constitution.js.map +1 -0
- package/dist/commands/verify/os-matrix.d.ts +14 -0
- package/dist/commands/verify/os-matrix.d.ts.map +1 -0
- package/dist/commands/verify/os-matrix.js +108 -0
- package/dist/commands/verify/os-matrix.js.map +1 -0
- package/dist/commands/verify/perf.d.ts +17 -0
- package/dist/commands/verify/perf.d.ts.map +1 -0
- package/dist/commands/verify/perf.js +106 -0
- package/dist/commands/verify/perf.js.map +1 -0
- package/dist/commands/verify/stores.d.ts +14 -0
- package/dist/commands/verify/stores.d.ts.map +1 -0
- package/dist/commands/verify/stores.js +98 -0
- package/dist/commands/verify/stores.js.map +1 -0
- package/dist/commands/verify.d.ts +14 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +97 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/workflow/catalog.d.ts +11 -0
- package/dist/commands/workflow/catalog.d.ts.map +1 -0
- package/dist/commands/workflow/catalog.js +164 -0
- package/dist/commands/workflow/catalog.js.map +1 -0
- package/dist/commands/workflow/list.d.ts +7 -0
- package/dist/commands/workflow/list.d.ts.map +1 -0
- package/dist/commands/workflow/list.js +50 -0
- package/dist/commands/workflow/list.js.map +1 -0
- package/dist/commands/workflow/resume.d.ts +13 -0
- package/dist/commands/workflow/resume.d.ts.map +1 -0
- package/dist/commands/workflow/resume.js +126 -0
- package/dist/commands/workflow/resume.js.map +1 -0
- package/dist/commands/workflow/run.d.ts +14 -0
- package/dist/commands/workflow/run.d.ts.map +1 -0
- package/dist/commands/workflow/run.js +139 -0
- package/dist/commands/workflow/run.js.map +1 -0
- package/dist/commands/workflow/status.d.ts +10 -0
- package/dist/commands/workflow/status.d.ts.map +1 -0
- package/dist/commands/workflow/status.js +86 -0
- package/dist/commands/workflow/status.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/shared/agents.d.ts +12 -0
- package/dist/shared/agents.d.ts.map +1 -0
- package/dist/shared/agents.js +31 -0
- package/dist/shared/agents.js.map +1 -0
- package/dist/shared/artifact-io.d.ts +54 -0
- package/dist/shared/artifact-io.d.ts.map +1 -0
- package/dist/shared/artifact-io.js +71 -0
- package/dist/shared/artifact-io.js.map +1 -0
- package/dist/shared/feature-prompt.d.ts +18 -0
- package/dist/shared/feature-prompt.d.ts.map +1 -0
- package/dist/shared/feature-prompt.js +21 -0
- package/dist/shared/feature-prompt.js.map +1 -0
- package/dist/shared/hooks.d.ts +7 -0
- package/dist/shared/hooks.d.ts.map +1 -0
- package/dist/shared/hooks.js +52 -0
- package/dist/shared/hooks.js.map +1 -0
- package/dist/shared/mcp.d.ts +9 -0
- package/dist/shared/mcp.d.ts.map +1 -0
- package/dist/shared/mcp.js +15 -0
- package/dist/shared/mcp.js.map +1 -0
- package/dist/shared/project.d.ts +42 -0
- package/dist/shared/project.d.ts.map +1 -0
- package/dist/shared/project.js +98 -0
- package/dist/shared/project.js.map +1 -0
- package/dist/shared/workflow-resolver.d.ts +19 -0
- package/dist/shared/workflow-resolver.d.ts.map +1 -0
- package/dist/shared/workflow-resolver.js +71 -0
- package/dist/shared/workflow-resolver.js.map +1 -0
- package/dist/workflow/args-builder.d.ts +31 -0
- package/dist/workflow/args-builder.d.ts.map +1 -0
- package/dist/workflow/args-builder.js +110 -0
- package/dist/workflow/args-builder.js.map +1 -0
- package/dist/workflow/executor.d.ts +18 -0
- package/dist/workflow/executor.d.ts.map +1 -0
- package/dist/workflow/executor.js +112 -0
- package/dist/workflow/executor.js.map +1 -0
- package/extensions/git/commands/rpt.git.feature.md +85 -0
- package/extensions/git/extension.yml +47 -0
- package/package.json +58 -0
- package/scripts/bash/check-prerequisites.sh +149 -0
- package/scripts/bash/common.sh +389 -0
- package/scripts/bash/create-new-feature.sh +164 -0
- package/scripts/bash/setup-plan.sh +113 -0
- package/scripts/check-naming.sh +138 -0
- package/scripts/check-prompts.sh +165 -0
- package/scripts/check-tasks.sh +166 -0
- package/scripts/powershell/check-prerequisites.ps1 +117 -0
- package/scripts/powershell/common.ps1 +328 -0
- package/scripts/powershell/create-new-feature.ps1 +138 -0
- package/scripts/powershell/setup-plan.ps1 +96 -0
- package/scripts/prepare-npm.mjs +157 -0
- package/templates/checklist-template.md +103 -0
- package/templates/commands/analyze.md +103 -0
- package/templates/commands/checklist.md +87 -0
- package/templates/commands/clarify.md +85 -0
- package/templates/commands/constitution.md +126 -0
- package/templates/commands/implement.md +117 -0
- package/templates/commands/plan.md +125 -0
- package/templates/commands/specify.md +127 -0
- package/templates/commands/tasks.md +98 -0
- package/templates/commands/taskstoissues.md +81 -0
- package/templates/constitution-template.md +48 -0
- package/templates/plan-template.md +150 -0
- package/templates/spec-template.md +116 -0
- package/templates/tasks-template.md +77 -0
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { validateAuditFile } from "../audit/validate.js";
|
|
4
|
+
import { parseFrontmatter } from "../frontmatter/index.js";
|
|
5
|
+
import { extractCoreBlock } from "../constitution/core.js";
|
|
6
|
+
import { parsePlan } from "../models/plan.js";
|
|
7
|
+
import { parseSpec } from "../models/spec.js";
|
|
8
|
+
import { parseTaskList, parseTasks } from "../models/tasks.js";
|
|
9
|
+
function extractIdsByPattern(source, re) {
|
|
10
|
+
const seen = new Set();
|
|
11
|
+
const iter = new RegExp(re.source, re.flags.includes("g") ? re.flags : re.flags + "g");
|
|
12
|
+
let m;
|
|
13
|
+
while ((m = iter.exec(source)) !== null) {
|
|
14
|
+
seen.add(m[1]);
|
|
15
|
+
}
|
|
16
|
+
return Array.from(seen).sort((a, b) => {
|
|
17
|
+
const na = Number(a.replace(/\D/g, ""));
|
|
18
|
+
const nb = Number(b.replace(/\D/g, ""));
|
|
19
|
+
return na - nb;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const US_RE = /\[(US\d+)\]/g;
|
|
23
|
+
const FR_RE = /\[(FR-\d+)\]/g;
|
|
24
|
+
const AC_RE = /\[(AC-\d+)\]/g;
|
|
25
|
+
const ALLOWED_AMENDMENT_EVENTS = new Set([
|
|
26
|
+
"constitution.initialized",
|
|
27
|
+
"constitution.upgraded",
|
|
28
|
+
"constitution.repaired",
|
|
29
|
+
"amendment",
|
|
30
|
+
]);
|
|
31
|
+
const requireFeatureDir = (ctx) => {
|
|
32
|
+
if (!ctx.featureDir) {
|
|
33
|
+
throw new Error("gate requires featureDir in context");
|
|
34
|
+
}
|
|
35
|
+
return ctx.featureDir;
|
|
36
|
+
};
|
|
37
|
+
export const gateSpecExists = {
|
|
38
|
+
id: "gate.spec.exists",
|
|
39
|
+
title: "Spec exists for this feature",
|
|
40
|
+
level: "critical",
|
|
41
|
+
article: "C1",
|
|
42
|
+
run(ctx) {
|
|
43
|
+
const dir = requireFeatureDir(ctx);
|
|
44
|
+
const path = join(dir, "spec.md");
|
|
45
|
+
if (!existsSync(path)) {
|
|
46
|
+
return {
|
|
47
|
+
id: this.id,
|
|
48
|
+
title: this.title,
|
|
49
|
+
level: this.level,
|
|
50
|
+
article: this.article,
|
|
51
|
+
status: "fail",
|
|
52
|
+
message: `spec.md missing at ${path}`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const spec = parseSpec(path);
|
|
56
|
+
return {
|
|
57
|
+
id: this.id,
|
|
58
|
+
title: this.title,
|
|
59
|
+
level: this.level,
|
|
60
|
+
article: this.article,
|
|
61
|
+
status: "pass",
|
|
62
|
+
details: { hash: spec.hash, status: spec.data.status },
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
export const gateAuditComplete = {
|
|
67
|
+
id: "gate.audit.complete",
|
|
68
|
+
title: "audit.jsonl present and parseable",
|
|
69
|
+
level: "critical",
|
|
70
|
+
article: "C2",
|
|
71
|
+
run(ctx) {
|
|
72
|
+
const dir = requireFeatureDir(ctx);
|
|
73
|
+
const path = join(dir, "audit.jsonl");
|
|
74
|
+
if (!existsSync(path)) {
|
|
75
|
+
return {
|
|
76
|
+
id: this.id,
|
|
77
|
+
title: this.title,
|
|
78
|
+
level: this.level,
|
|
79
|
+
article: this.article,
|
|
80
|
+
status: "fail",
|
|
81
|
+
message: `audit.jsonl missing at ${path}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const content = readFileSync(path, "utf8");
|
|
85
|
+
const lines = content.split("\n").filter((l) => l.length > 0);
|
|
86
|
+
const bad = [];
|
|
87
|
+
let withHash = 0;
|
|
88
|
+
lines.forEach((line, i) => {
|
|
89
|
+
try {
|
|
90
|
+
const obj = JSON.parse(line);
|
|
91
|
+
if (obj.prompt?.hash ||
|
|
92
|
+
obj.inputs?.some((r) => r.hash) ||
|
|
93
|
+
obj.outputs?.some((r) => r.hash)) {
|
|
94
|
+
withHash++;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
bad.push(i + 1);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
if (bad.length > 0) {
|
|
102
|
+
return {
|
|
103
|
+
id: this.id,
|
|
104
|
+
title: this.title,
|
|
105
|
+
level: this.level,
|
|
106
|
+
article: this.article,
|
|
107
|
+
status: "fail",
|
|
108
|
+
message: `malformed JSONL at line(s): ${bad.join(", ")}`,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
id: this.id,
|
|
113
|
+
title: this.title,
|
|
114
|
+
level: this.level,
|
|
115
|
+
article: this.article,
|
|
116
|
+
status: "pass",
|
|
117
|
+
details: { entries: lines.length, withHash },
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
export const gatePlanApproved = {
|
|
122
|
+
id: "gate.plan.approved",
|
|
123
|
+
title: "Plan is approved and Phase -1 passed",
|
|
124
|
+
level: "critical",
|
|
125
|
+
article: "C3",
|
|
126
|
+
run(ctx) {
|
|
127
|
+
const dir = requireFeatureDir(ctx);
|
|
128
|
+
const path = join(dir, "plan.md");
|
|
129
|
+
if (!existsSync(path)) {
|
|
130
|
+
return {
|
|
131
|
+
id: this.id,
|
|
132
|
+
title: this.title,
|
|
133
|
+
level: this.level,
|
|
134
|
+
article: this.article,
|
|
135
|
+
status: "fail",
|
|
136
|
+
message: `plan.md missing at ${path}`,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const plan = parsePlan(path);
|
|
140
|
+
const ok = plan.data.status === "approved" &&
|
|
141
|
+
(plan.data.phase_minus_one === "passed" ||
|
|
142
|
+
plan.data.phase_minus_one === "justified");
|
|
143
|
+
if (!ok) {
|
|
144
|
+
return {
|
|
145
|
+
id: this.id,
|
|
146
|
+
title: this.title,
|
|
147
|
+
level: this.level,
|
|
148
|
+
article: this.article,
|
|
149
|
+
status: "fail",
|
|
150
|
+
message: `plan status=${plan.data.status}, phase_minus_one=${plan.data.phase_minus_one}`,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
id: this.id,
|
|
155
|
+
title: this.title,
|
|
156
|
+
level: this.level,
|
|
157
|
+
article: this.article,
|
|
158
|
+
status: "pass",
|
|
159
|
+
details: {
|
|
160
|
+
approved_by: plan.data.approved_by,
|
|
161
|
+
approved_at: plan.data.approved_at,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
export const gateConstitutionIntegrity = {
|
|
167
|
+
id: "gate.constitution.integrity",
|
|
168
|
+
title: "RAPTOR-CORE block intact",
|
|
169
|
+
level: "critical",
|
|
170
|
+
article: "C4",
|
|
171
|
+
run(ctx) {
|
|
172
|
+
const path = join(ctx.projectRoot, ".raptor", "constitution.md");
|
|
173
|
+
if (!existsSync(path)) {
|
|
174
|
+
return {
|
|
175
|
+
id: this.id,
|
|
176
|
+
title: this.title,
|
|
177
|
+
level: this.level,
|
|
178
|
+
article: this.article,
|
|
179
|
+
status: "fail",
|
|
180
|
+
message: `constitution.md missing at ${path}`,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
const source = readFileSync(path, "utf8");
|
|
184
|
+
const extracted = extractCoreBlock(source);
|
|
185
|
+
if (!extracted) {
|
|
186
|
+
return {
|
|
187
|
+
id: this.id,
|
|
188
|
+
title: this.title,
|
|
189
|
+
level: this.level,
|
|
190
|
+
article: this.article,
|
|
191
|
+
status: "fail",
|
|
192
|
+
message: "RAPTOR-CORE markers not found in constitution.md",
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (!extracted.isIntact) {
|
|
196
|
+
return {
|
|
197
|
+
id: this.id,
|
|
198
|
+
title: this.title,
|
|
199
|
+
level: this.level,
|
|
200
|
+
article: this.article,
|
|
201
|
+
status: "fail",
|
|
202
|
+
message: `hash mismatch — declared ${extracted.declaredHash}, computed ${extracted.computedHash}`,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
id: this.id,
|
|
207
|
+
title: this.title,
|
|
208
|
+
level: this.level,
|
|
209
|
+
article: this.article,
|
|
210
|
+
status: "pass",
|
|
211
|
+
details: { version: extracted.version, hash: extracted.declaredHash },
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
export const gateAmendmentCore = {
|
|
216
|
+
id: "gate.amendment.core",
|
|
217
|
+
title: "amendments.log is schema-valid and restricted to constitutional events",
|
|
218
|
+
level: "critical",
|
|
219
|
+
article: "C4",
|
|
220
|
+
run(ctx) {
|
|
221
|
+
const path = join(ctx.projectRoot, ".raptor", "memory", "amendments.log");
|
|
222
|
+
if (!existsSync(path)) {
|
|
223
|
+
return {
|
|
224
|
+
id: this.id,
|
|
225
|
+
title: this.title,
|
|
226
|
+
level: this.level,
|
|
227
|
+
article: this.article,
|
|
228
|
+
status: "fail",
|
|
229
|
+
message: `amendments.log missing at ${path}`,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
const result = validateAuditFile(path, { strict: true });
|
|
233
|
+
if (!result.valid) {
|
|
234
|
+
const first = result.errors[0];
|
|
235
|
+
return {
|
|
236
|
+
id: this.id,
|
|
237
|
+
title: this.title,
|
|
238
|
+
level: this.level,
|
|
239
|
+
article: this.article,
|
|
240
|
+
status: "fail",
|
|
241
|
+
message: first
|
|
242
|
+
? `${first.path}: ${first.message} [${first.keyword}]` +
|
|
243
|
+
(first.line ? ` (line ${first.line})` : "")
|
|
244
|
+
: "amendments.log failed schema validation",
|
|
245
|
+
details: {
|
|
246
|
+
totalLines: result.totalLines,
|
|
247
|
+
validLines: result.validLines,
|
|
248
|
+
errorCount: result.errors.length,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const content = readFileSync(path, "utf8").trimEnd();
|
|
253
|
+
if (content.length === 0) {
|
|
254
|
+
return {
|
|
255
|
+
id: this.id,
|
|
256
|
+
title: this.title,
|
|
257
|
+
level: this.level,
|
|
258
|
+
article: this.article,
|
|
259
|
+
status: "pass",
|
|
260
|
+
details: { entries: 0 },
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const lines = content.split("\n");
|
|
264
|
+
const offenders = [];
|
|
265
|
+
for (let i = 0; i < lines.length; i++) {
|
|
266
|
+
const obj = JSON.parse(lines[i]);
|
|
267
|
+
if (!ALLOWED_AMENDMENT_EVENTS.has(obj.event)) {
|
|
268
|
+
offenders.push({ line: i + 1, event: obj.event });
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (offenders.length > 0) {
|
|
272
|
+
const first = offenders[0];
|
|
273
|
+
return {
|
|
274
|
+
id: this.id,
|
|
275
|
+
title: this.title,
|
|
276
|
+
level: this.level,
|
|
277
|
+
article: this.article,
|
|
278
|
+
status: "fail",
|
|
279
|
+
message: `disallowed event "${first.event}" at line ${first.line} — amendments.log must only contain ${Array.from(ALLOWED_AMENDMENT_EVENTS).join(", ")}`,
|
|
280
|
+
details: { offenders },
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const firstEntry = JSON.parse(lines[0]);
|
|
284
|
+
if (firstEntry.event !== "constitution.initialized") {
|
|
285
|
+
return {
|
|
286
|
+
id: this.id,
|
|
287
|
+
title: this.title,
|
|
288
|
+
level: this.level,
|
|
289
|
+
article: this.article,
|
|
290
|
+
status: "fail",
|
|
291
|
+
message: `first entry must be "constitution.initialized", got "${firstEntry.event}"`,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
id: this.id,
|
|
296
|
+
title: this.title,
|
|
297
|
+
level: this.level,
|
|
298
|
+
article: this.article,
|
|
299
|
+
status: "pass",
|
|
300
|
+
details: { entries: lines.length },
|
|
301
|
+
};
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
export const gateSpecClarifications = {
|
|
305
|
+
id: "gate.spec.clarifications",
|
|
306
|
+
title: "Spec has no unresolved [NEEDS CLARIFICATION]",
|
|
307
|
+
level: "required",
|
|
308
|
+
run(ctx) {
|
|
309
|
+
const dir = requireFeatureDir(ctx);
|
|
310
|
+
const path = join(dir, "spec.md");
|
|
311
|
+
if (!existsSync(path)) {
|
|
312
|
+
return {
|
|
313
|
+
id: this.id,
|
|
314
|
+
title: this.title,
|
|
315
|
+
level: this.level,
|
|
316
|
+
status: "fail",
|
|
317
|
+
message: "spec.md missing",
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
const spec = parseSpec(path);
|
|
321
|
+
if (spec.clarifications.length > 0) {
|
|
322
|
+
return {
|
|
323
|
+
id: this.id,
|
|
324
|
+
title: this.title,
|
|
325
|
+
level: this.level,
|
|
326
|
+
status: "fail",
|
|
327
|
+
message: `${spec.clarifications.length} unresolved [NEEDS CLARIFICATION] block(s)`,
|
|
328
|
+
details: { count: spec.clarifications.length },
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
return {
|
|
332
|
+
id: this.id,
|
|
333
|
+
title: this.title,
|
|
334
|
+
level: this.level,
|
|
335
|
+
status: "pass",
|
|
336
|
+
};
|
|
337
|
+
},
|
|
338
|
+
};
|
|
339
|
+
export const gateSpecApproved = {
|
|
340
|
+
id: "gate.spec.approved",
|
|
341
|
+
title: "Spec frontmatter status is approved",
|
|
342
|
+
level: "required",
|
|
343
|
+
run(ctx) {
|
|
344
|
+
const dir = requireFeatureDir(ctx);
|
|
345
|
+
const path = join(dir, "spec.md");
|
|
346
|
+
if (!existsSync(path)) {
|
|
347
|
+
return {
|
|
348
|
+
id: this.id,
|
|
349
|
+
title: this.title,
|
|
350
|
+
level: this.level,
|
|
351
|
+
status: "fail",
|
|
352
|
+
message: "spec.md missing",
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
const raw = readFileSync(path, "utf8");
|
|
356
|
+
const { data } = parseFrontmatter(raw);
|
|
357
|
+
if (data.status !== "approved") {
|
|
358
|
+
return {
|
|
359
|
+
id: this.id,
|
|
360
|
+
title: this.title,
|
|
361
|
+
level: this.level,
|
|
362
|
+
status: "fail",
|
|
363
|
+
message: `spec.status=${data.status ?? "unknown"}`,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
return {
|
|
367
|
+
id: this.id,
|
|
368
|
+
title: this.title,
|
|
369
|
+
level: this.level,
|
|
370
|
+
status: "pass",
|
|
371
|
+
};
|
|
372
|
+
},
|
|
373
|
+
};
|
|
374
|
+
export const gatePlanInputHash = {
|
|
375
|
+
id: "gate.plan.input_hash",
|
|
376
|
+
title: "plan.md spec_hash matches current spec.md (PI-3 staleness)",
|
|
377
|
+
level: "required",
|
|
378
|
+
article: "C2",
|
|
379
|
+
run(ctx) {
|
|
380
|
+
const dir = requireFeatureDir(ctx);
|
|
381
|
+
const planPath = join(dir, "plan.md");
|
|
382
|
+
if (!existsSync(planPath)) {
|
|
383
|
+
return {
|
|
384
|
+
id: this.id,
|
|
385
|
+
title: this.title,
|
|
386
|
+
level: this.level,
|
|
387
|
+
article: this.article,
|
|
388
|
+
status: "pass",
|
|
389
|
+
details: { reason: "plan.md not yet generated" },
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
const raw = readFileSync(planPath, "utf8");
|
|
393
|
+
const isStub = raw.trim().startsWith("# Plan:") && raw.length < 300;
|
|
394
|
+
if (isStub) {
|
|
395
|
+
return {
|
|
396
|
+
id: this.id,
|
|
397
|
+
title: this.title,
|
|
398
|
+
level: this.level,
|
|
399
|
+
article: this.article,
|
|
400
|
+
status: "pass",
|
|
401
|
+
details: { reason: "plan.md is stub (awaiting raptor plan)" },
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const specPath = join(dir, "spec.md");
|
|
405
|
+
if (!existsSync(specPath)) {
|
|
406
|
+
return {
|
|
407
|
+
id: this.id,
|
|
408
|
+
title: this.title,
|
|
409
|
+
level: this.level,
|
|
410
|
+
article: this.article,
|
|
411
|
+
status: "fail",
|
|
412
|
+
message: "spec.md missing but plan.md exists",
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const plan = parsePlan(planPath);
|
|
416
|
+
if (!plan.data.spec_hash) {
|
|
417
|
+
return {
|
|
418
|
+
id: this.id,
|
|
419
|
+
title: this.title,
|
|
420
|
+
level: this.level,
|
|
421
|
+
article: this.article,
|
|
422
|
+
status: "fail",
|
|
423
|
+
message: "plan.md frontmatter missing spec_hash",
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
const spec = parseSpec(specPath);
|
|
427
|
+
if (plan.data.spec_hash !== spec.hash) {
|
|
428
|
+
return {
|
|
429
|
+
id: this.id,
|
|
430
|
+
title: this.title,
|
|
431
|
+
level: this.level,
|
|
432
|
+
article: this.article,
|
|
433
|
+
status: "fail",
|
|
434
|
+
message: `stale: plan declares spec_hash=${plan.data.spec_hash.slice(0, 20)}…, current spec hash=${spec.hash.slice(0, 20)}…`,
|
|
435
|
+
details: {
|
|
436
|
+
declared: plan.data.spec_hash,
|
|
437
|
+
current: spec.hash,
|
|
438
|
+
},
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
return {
|
|
442
|
+
id: this.id,
|
|
443
|
+
title: this.title,
|
|
444
|
+
level: this.level,
|
|
445
|
+
article: this.article,
|
|
446
|
+
status: "pass",
|
|
447
|
+
details: { spec_hash: spec.hash },
|
|
448
|
+
};
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
export const gateTasksInputHash = {
|
|
452
|
+
id: "gate.tasks.input_hash",
|
|
453
|
+
title: "tasks.md plan_hash matches current plan.md (PI-3 staleness)",
|
|
454
|
+
level: "required",
|
|
455
|
+
article: "C2",
|
|
456
|
+
run(ctx) {
|
|
457
|
+
const dir = requireFeatureDir(ctx);
|
|
458
|
+
const tasksPath = join(dir, "tasks.md");
|
|
459
|
+
if (!existsSync(tasksPath)) {
|
|
460
|
+
return {
|
|
461
|
+
id: this.id,
|
|
462
|
+
title: this.title,
|
|
463
|
+
level: this.level,
|
|
464
|
+
article: this.article,
|
|
465
|
+
status: "pass",
|
|
466
|
+
details: { reason: "tasks.md not yet generated" },
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
const raw = readFileSync(tasksPath, "utf8");
|
|
470
|
+
const isStub = raw.trim().startsWith("# Tasks:") && raw.length < 300;
|
|
471
|
+
if (isStub) {
|
|
472
|
+
return {
|
|
473
|
+
id: this.id,
|
|
474
|
+
title: this.title,
|
|
475
|
+
level: this.level,
|
|
476
|
+
article: this.article,
|
|
477
|
+
status: "pass",
|
|
478
|
+
details: { reason: "tasks.md is stub (awaiting raptor tasks)" },
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
const planPath = join(dir, "plan.md");
|
|
482
|
+
if (!existsSync(planPath)) {
|
|
483
|
+
return {
|
|
484
|
+
id: this.id,
|
|
485
|
+
title: this.title,
|
|
486
|
+
level: this.level,
|
|
487
|
+
article: this.article,
|
|
488
|
+
status: "fail",
|
|
489
|
+
message: "plan.md missing but tasks.md exists",
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
const tasks = parseTasks(tasksPath);
|
|
493
|
+
if (!tasks.data.plan_hash) {
|
|
494
|
+
return {
|
|
495
|
+
id: this.id,
|
|
496
|
+
title: this.title,
|
|
497
|
+
level: this.level,
|
|
498
|
+
article: this.article,
|
|
499
|
+
status: "fail",
|
|
500
|
+
message: "tasks.md frontmatter missing plan_hash",
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
const plan = parsePlan(planPath);
|
|
504
|
+
if (tasks.data.plan_hash !== plan.hash) {
|
|
505
|
+
return {
|
|
506
|
+
id: this.id,
|
|
507
|
+
title: this.title,
|
|
508
|
+
level: this.level,
|
|
509
|
+
article: this.article,
|
|
510
|
+
status: "fail",
|
|
511
|
+
message: `stale: tasks declares plan_hash=${tasks.data.plan_hash.slice(0, 20)}…, current plan hash=${plan.hash.slice(0, 20)}…`,
|
|
512
|
+
details: {
|
|
513
|
+
declared: tasks.data.plan_hash,
|
|
514
|
+
current: plan.hash,
|
|
515
|
+
},
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
return {
|
|
519
|
+
id: this.id,
|
|
520
|
+
title: this.title,
|
|
521
|
+
level: this.level,
|
|
522
|
+
article: this.article,
|
|
523
|
+
status: "pass",
|
|
524
|
+
details: { plan_hash: plan.hash },
|
|
525
|
+
};
|
|
526
|
+
},
|
|
527
|
+
};
|
|
528
|
+
export const gatePlanCoverageComplete = {
|
|
529
|
+
id: "gate.plan.coverage_complete",
|
|
530
|
+
title: "plan.md mentions every [US#] and [FR-#] declared in spec.md (PI-2)",
|
|
531
|
+
level: "required",
|
|
532
|
+
article: "C2",
|
|
533
|
+
run(ctx) {
|
|
534
|
+
const dir = requireFeatureDir(ctx);
|
|
535
|
+
const planPath = join(dir, "plan.md");
|
|
536
|
+
if (!existsSync(planPath)) {
|
|
537
|
+
return {
|
|
538
|
+
id: this.id,
|
|
539
|
+
title: this.title,
|
|
540
|
+
level: this.level,
|
|
541
|
+
article: this.article,
|
|
542
|
+
status: "pass",
|
|
543
|
+
details: { reason: "plan.md not yet generated" },
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
const planRaw = readFileSync(planPath, "utf8");
|
|
547
|
+
const isStub = planRaw.trim().startsWith("# Plan:") && planRaw.length < 300;
|
|
548
|
+
if (isStub) {
|
|
549
|
+
return {
|
|
550
|
+
id: this.id,
|
|
551
|
+
title: this.title,
|
|
552
|
+
level: this.level,
|
|
553
|
+
article: this.article,
|
|
554
|
+
status: "pass",
|
|
555
|
+
details: { reason: "plan.md is stub (awaiting raptor plan)" },
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
const specPath = join(dir, "spec.md");
|
|
559
|
+
if (!existsSync(specPath)) {
|
|
560
|
+
return {
|
|
561
|
+
id: this.id,
|
|
562
|
+
title: this.title,
|
|
563
|
+
level: this.level,
|
|
564
|
+
article: this.article,
|
|
565
|
+
status: "fail",
|
|
566
|
+
message: "spec.md missing but plan.md exists",
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
const spec = parseSpec(specPath);
|
|
570
|
+
const plan = parsePlan(planPath);
|
|
571
|
+
const specUS = extractIdsByPattern(spec.body, US_RE);
|
|
572
|
+
const specFR = extractIdsByPattern(spec.body, FR_RE);
|
|
573
|
+
const planUS = new Set(extractIdsByPattern(plan.body, US_RE));
|
|
574
|
+
const planFR = new Set(extractIdsByPattern(plan.body, FR_RE));
|
|
575
|
+
const missingUS = specUS.filter((id) => !planUS.has(id));
|
|
576
|
+
const missingFR = specFR.filter((id) => !planFR.has(id));
|
|
577
|
+
if (missingUS.length > 0 || missingFR.length > 0) {
|
|
578
|
+
const parts = [];
|
|
579
|
+
if (missingUS.length > 0)
|
|
580
|
+
parts.push(`US: ${missingUS.join(", ")}`);
|
|
581
|
+
if (missingFR.length > 0)
|
|
582
|
+
parts.push(`FR: ${missingFR.join(", ")}`);
|
|
583
|
+
return {
|
|
584
|
+
id: this.id,
|
|
585
|
+
title: this.title,
|
|
586
|
+
level: this.level,
|
|
587
|
+
article: this.article,
|
|
588
|
+
status: "fail",
|
|
589
|
+
message: `plan.md does not cover ${parts.join("; ")}`,
|
|
590
|
+
details: {
|
|
591
|
+
missing_us: missingUS,
|
|
592
|
+
missing_fr: missingFR,
|
|
593
|
+
spec_us: specUS,
|
|
594
|
+
spec_fr: specFR,
|
|
595
|
+
},
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
id: this.id,
|
|
600
|
+
title: this.title,
|
|
601
|
+
level: this.level,
|
|
602
|
+
article: this.article,
|
|
603
|
+
status: "pass",
|
|
604
|
+
details: {
|
|
605
|
+
us_covered: specUS.length,
|
|
606
|
+
fr_covered: specFR.length,
|
|
607
|
+
},
|
|
608
|
+
};
|
|
609
|
+
},
|
|
610
|
+
};
|
|
611
|
+
export const gateTasksCoverageComplete = {
|
|
612
|
+
id: "gate.tasks.coverage_complete",
|
|
613
|
+
title: "tasks.md covers every [US#] with ≥1 task and mentions every [AC-#] (PI-2)",
|
|
614
|
+
level: "required",
|
|
615
|
+
article: "C2",
|
|
616
|
+
run(ctx) {
|
|
617
|
+
const dir = requireFeatureDir(ctx);
|
|
618
|
+
const tasksPath = join(dir, "tasks.md");
|
|
619
|
+
if (!existsSync(tasksPath)) {
|
|
620
|
+
return {
|
|
621
|
+
id: this.id,
|
|
622
|
+
title: this.title,
|
|
623
|
+
level: this.level,
|
|
624
|
+
article: this.article,
|
|
625
|
+
status: "pass",
|
|
626
|
+
details: { reason: "tasks.md not yet generated" },
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
const tasksRaw = readFileSync(tasksPath, "utf8");
|
|
630
|
+
const isStub = tasksRaw.trim().startsWith("# Tasks:") && tasksRaw.length < 300;
|
|
631
|
+
if (isStub) {
|
|
632
|
+
return {
|
|
633
|
+
id: this.id,
|
|
634
|
+
title: this.title,
|
|
635
|
+
level: this.level,
|
|
636
|
+
article: this.article,
|
|
637
|
+
status: "pass",
|
|
638
|
+
details: { reason: "tasks.md is stub (awaiting raptor tasks)" },
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
const specPath = join(dir, "spec.md");
|
|
642
|
+
if (!existsSync(specPath)) {
|
|
643
|
+
return {
|
|
644
|
+
id: this.id,
|
|
645
|
+
title: this.title,
|
|
646
|
+
level: this.level,
|
|
647
|
+
article: this.article,
|
|
648
|
+
status: "fail",
|
|
649
|
+
message: "spec.md missing but tasks.md exists",
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
const spec = parseSpec(specPath);
|
|
653
|
+
const tasks = parseTasks(tasksPath);
|
|
654
|
+
const specUS = extractIdsByPattern(spec.body, US_RE);
|
|
655
|
+
const specAC = extractIdsByPattern(spec.body, AC_RE);
|
|
656
|
+
const items = parseTaskList(tasks.body);
|
|
657
|
+
const storiesCovered = new Set();
|
|
658
|
+
for (const it of items) {
|
|
659
|
+
for (const s of it.stories)
|
|
660
|
+
storiesCovered.add(s);
|
|
661
|
+
}
|
|
662
|
+
const acMentioned = new Set(extractIdsByPattern(tasks.body, AC_RE));
|
|
663
|
+
const missingUS = specUS.filter((id) => !storiesCovered.has(id));
|
|
664
|
+
const missingAC = specAC.filter((id) => !acMentioned.has(id));
|
|
665
|
+
if (missingUS.length > 0 || missingAC.length > 0) {
|
|
666
|
+
const parts = [];
|
|
667
|
+
if (missingUS.length > 0) {
|
|
668
|
+
parts.push(`US without task: ${missingUS.join(", ")}`);
|
|
669
|
+
}
|
|
670
|
+
if (missingAC.length > 0) {
|
|
671
|
+
parts.push(`AC not mentioned: ${missingAC.join(", ")}`);
|
|
672
|
+
}
|
|
673
|
+
return {
|
|
674
|
+
id: this.id,
|
|
675
|
+
title: this.title,
|
|
676
|
+
level: this.level,
|
|
677
|
+
article: this.article,
|
|
678
|
+
status: "fail",
|
|
679
|
+
message: `tasks.md incomplete — ${parts.join("; ")}`,
|
|
680
|
+
details: {
|
|
681
|
+
missing_us: missingUS,
|
|
682
|
+
missing_ac: missingAC,
|
|
683
|
+
spec_us: specUS,
|
|
684
|
+
spec_ac: specAC,
|
|
685
|
+
task_count: items.length,
|
|
686
|
+
},
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
return {
|
|
690
|
+
id: this.id,
|
|
691
|
+
title: this.title,
|
|
692
|
+
level: this.level,
|
|
693
|
+
article: this.article,
|
|
694
|
+
status: "pass",
|
|
695
|
+
details: {
|
|
696
|
+
us_covered: specUS.length,
|
|
697
|
+
ac_covered: specAC.length,
|
|
698
|
+
task_count: items.length,
|
|
699
|
+
},
|
|
700
|
+
};
|
|
701
|
+
},
|
|
702
|
+
};
|
|
703
|
+
const META_TASK_RE = /\[meta\]/i;
|
|
704
|
+
export const gateTasksTraceComplete = {
|
|
705
|
+
id: "gate.tasks.trace_complete",
|
|
706
|
+
title: "every task in tasks.md traces to a [US#] or [meta] (PI-1)",
|
|
707
|
+
level: "required",
|
|
708
|
+
article: "C2",
|
|
709
|
+
run(ctx) {
|
|
710
|
+
const dir = requireFeatureDir(ctx);
|
|
711
|
+
const tasksPath = join(dir, "tasks.md");
|
|
712
|
+
if (!existsSync(tasksPath)) {
|
|
713
|
+
return {
|
|
714
|
+
id: this.id,
|
|
715
|
+
title: this.title,
|
|
716
|
+
level: this.level,
|
|
717
|
+
article: this.article,
|
|
718
|
+
status: "pass",
|
|
719
|
+
details: { reason: "tasks.md not yet generated" },
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
const tasksRaw = readFileSync(tasksPath, "utf8");
|
|
723
|
+
const isStub = tasksRaw.trim().startsWith("# Tasks:") && tasksRaw.length < 300;
|
|
724
|
+
if (isStub) {
|
|
725
|
+
return {
|
|
726
|
+
id: this.id,
|
|
727
|
+
title: this.title,
|
|
728
|
+
level: this.level,
|
|
729
|
+
article: this.article,
|
|
730
|
+
status: "pass",
|
|
731
|
+
details: { reason: "tasks.md is stub (awaiting raptor tasks)" },
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
const tasks = parseTasks(tasksPath);
|
|
735
|
+
const items = parseTaskList(tasks.body);
|
|
736
|
+
if (items.length === 0) {
|
|
737
|
+
return {
|
|
738
|
+
id: this.id,
|
|
739
|
+
title: this.title,
|
|
740
|
+
level: this.level,
|
|
741
|
+
article: this.article,
|
|
742
|
+
status: "fail",
|
|
743
|
+
message: "tasks.md has no parseable task items",
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
const orphans = [];
|
|
747
|
+
for (const it of items) {
|
|
748
|
+
if (it.stories.length > 0)
|
|
749
|
+
continue;
|
|
750
|
+
if (META_TASK_RE.test(it.raw))
|
|
751
|
+
continue;
|
|
752
|
+
orphans.push({ id: it.id, raw: it.raw.trim() });
|
|
753
|
+
}
|
|
754
|
+
if (orphans.length > 0) {
|
|
755
|
+
const ids = orphans.map((o) => o.id).join(", ");
|
|
756
|
+
return {
|
|
757
|
+
id: this.id,
|
|
758
|
+
title: this.title,
|
|
759
|
+
level: this.level,
|
|
760
|
+
article: this.article,
|
|
761
|
+
status: "fail",
|
|
762
|
+
message: `${orphans.length} orphan task(s) without [US#] or [meta]: ${ids}`,
|
|
763
|
+
details: { orphans, total_tasks: items.length },
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
return {
|
|
767
|
+
id: this.id,
|
|
768
|
+
title: this.title,
|
|
769
|
+
level: this.level,
|
|
770
|
+
article: this.article,
|
|
771
|
+
status: "pass",
|
|
772
|
+
details: { total_tasks: items.length },
|
|
773
|
+
};
|
|
774
|
+
},
|
|
775
|
+
};
|
|
776
|
+
export const gateHotfixUnreconciled = {
|
|
777
|
+
id: "gate.hotfix.unreconciled",
|
|
778
|
+
title: "No hotfix is still waiting reconciliation beyond its deadline",
|
|
779
|
+
level: "advisory",
|
|
780
|
+
run(ctx) {
|
|
781
|
+
const dir = join(ctx.projectRoot, ".raptor", "hotfixes");
|
|
782
|
+
if (!existsSync(dir)) {
|
|
783
|
+
return {
|
|
784
|
+
id: this.id,
|
|
785
|
+
title: this.title,
|
|
786
|
+
level: this.level,
|
|
787
|
+
status: "pass",
|
|
788
|
+
details: { entries: 0 },
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
const subdirs = readdirSync(dir).filter((d) => {
|
|
792
|
+
const p = join(dir, d);
|
|
793
|
+
return /^\d{3,}-/.test(d) && existsSync(p) && statSync(p).isDirectory();
|
|
794
|
+
});
|
|
795
|
+
const open = [];
|
|
796
|
+
const overdue = [];
|
|
797
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
798
|
+
for (const sub of subdirs) {
|
|
799
|
+
const mdPath = join(dir, sub, "hotfix.md");
|
|
800
|
+
if (!existsSync(mdPath))
|
|
801
|
+
continue;
|
|
802
|
+
const raw = readFileSync(mdPath, "utf8");
|
|
803
|
+
const { data } = parseFrontmatter(raw);
|
|
804
|
+
if (data.status !== "open")
|
|
805
|
+
continue;
|
|
806
|
+
open.push({
|
|
807
|
+
slug: data.slug ?? sub,
|
|
808
|
+
article: data.article,
|
|
809
|
+
reconcileBy: data.reconcile_by,
|
|
810
|
+
});
|
|
811
|
+
if (data.reconcile_by && data.reconcile_by < today) {
|
|
812
|
+
overdue.push({ slug: data.slug ?? sub, reconcileBy: data.reconcile_by });
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
if (overdue.length > 0) {
|
|
816
|
+
const first = overdue[0];
|
|
817
|
+
return {
|
|
818
|
+
id: this.id,
|
|
819
|
+
title: this.title,
|
|
820
|
+
level: this.level,
|
|
821
|
+
status: "fail",
|
|
822
|
+
message: `${overdue.length} hotfix${overdue.length > 1 ? "es" : ""} overdue for reconciliation (first: ${first.slug}, reconcile_by=${first.reconcileBy})`,
|
|
823
|
+
details: { open: open.length, overdue },
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
return {
|
|
827
|
+
id: this.id,
|
|
828
|
+
title: this.title,
|
|
829
|
+
level: this.level,
|
|
830
|
+
status: "pass",
|
|
831
|
+
details: { open: open.length, overdue: 0 },
|
|
832
|
+
};
|
|
833
|
+
},
|
|
834
|
+
};
|
|
835
|
+
import { M7_GATES } from "./m7-gates.js";
|
|
836
|
+
export const PROJECT_GATES = [
|
|
837
|
+
gateConstitutionIntegrity,
|
|
838
|
+
gateAmendmentCore,
|
|
839
|
+
gateHotfixUnreconciled,
|
|
840
|
+
];
|
|
841
|
+
export const BUILTIN_GATES = [
|
|
842
|
+
gateSpecExists,
|
|
843
|
+
gateAuditComplete,
|
|
844
|
+
gatePlanApproved,
|
|
845
|
+
gateConstitutionIntegrity,
|
|
846
|
+
gateAmendmentCore,
|
|
847
|
+
gateHotfixUnreconciled,
|
|
848
|
+
gateSpecClarifications,
|
|
849
|
+
gateSpecApproved,
|
|
850
|
+
gatePlanInputHash,
|
|
851
|
+
gateTasksInputHash,
|
|
852
|
+
gatePlanCoverageComplete,
|
|
853
|
+
gateTasksCoverageComplete,
|
|
854
|
+
gateTasksTraceComplete,
|
|
855
|
+
...M7_GATES,
|
|
856
|
+
];
|
|
857
|
+
export function gateById(id) {
|
|
858
|
+
return BUILTIN_GATES.find((g) => g.id === id);
|
|
859
|
+
}
|
|
860
|
+
//# sourceMappingURL=builtin.js.map
|