@accelerationguy/accel 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/CLAUDE.md +19 -0
  2. package/LICENSE +33 -0
  3. package/README.md +275 -0
  4. package/bin/install.js +661 -0
  5. package/docs/getting-started.md +164 -0
  6. package/docs/module-guide.md +139 -0
  7. package/modules/drive/LICENSE +21 -0
  8. package/modules/drive/PAUL-VS-GSD.md +171 -0
  9. package/modules/drive/README.md +555 -0
  10. package/modules/drive/assets/terminal.svg +67 -0
  11. package/modules/drive/bin/install.js +210 -0
  12. package/modules/drive/integration.js +76 -0
  13. package/modules/drive/package.json +38 -0
  14. package/modules/drive/src/commands/add-phase.md +36 -0
  15. package/modules/drive/src/commands/apply.md +83 -0
  16. package/modules/drive/src/commands/assumptions.md +37 -0
  17. package/modules/drive/src/commands/audit.md +57 -0
  18. package/modules/drive/src/commands/complete-milestone.md +36 -0
  19. package/modules/drive/src/commands/config.md +175 -0
  20. package/modules/drive/src/commands/consider-issues.md +41 -0
  21. package/modules/drive/src/commands/discover.md +48 -0
  22. package/modules/drive/src/commands/discuss-milestone.md +33 -0
  23. package/modules/drive/src/commands/discuss.md +34 -0
  24. package/modules/drive/src/commands/flows.md +73 -0
  25. package/modules/drive/src/commands/handoff.md +201 -0
  26. package/modules/drive/src/commands/help.md +525 -0
  27. package/modules/drive/src/commands/init.md +54 -0
  28. package/modules/drive/src/commands/map-codebase.md +34 -0
  29. package/modules/drive/src/commands/milestone.md +34 -0
  30. package/modules/drive/src/commands/pause.md +44 -0
  31. package/modules/drive/src/commands/plan-fix.md +216 -0
  32. package/modules/drive/src/commands/plan.md +36 -0
  33. package/modules/drive/src/commands/progress.md +138 -0
  34. package/modules/drive/src/commands/register.md +29 -0
  35. package/modules/drive/src/commands/remove-phase.md +37 -0
  36. package/modules/drive/src/commands/research-phase.md +209 -0
  37. package/modules/drive/src/commands/research.md +47 -0
  38. package/modules/drive/src/commands/resume.md +49 -0
  39. package/modules/drive/src/commands/status.md +78 -0
  40. package/modules/drive/src/commands/unify.md +87 -0
  41. package/modules/drive/src/commands/verify.md +60 -0
  42. package/modules/drive/src/references/checkpoints.md +234 -0
  43. package/modules/drive/src/references/context-management.md +219 -0
  44. package/modules/drive/src/references/git-strategy.md +206 -0
  45. package/modules/drive/src/references/loop-phases.md +254 -0
  46. package/modules/drive/src/references/plan-format.md +263 -0
  47. package/modules/drive/src/references/quality-principles.md +152 -0
  48. package/modules/drive/src/references/research-quality-control.md +247 -0
  49. package/modules/drive/src/references/sonarqube-integration.md +244 -0
  50. package/modules/drive/src/references/specialized-workflow-integration.md +186 -0
  51. package/modules/drive/src/references/subagent-criteria.md +179 -0
  52. package/modules/drive/src/references/tdd.md +219 -0
  53. package/modules/drive/src/references/work-units.md +161 -0
  54. package/modules/drive/src/rules/commands.md +108 -0
  55. package/modules/drive/src/rules/references.md +107 -0
  56. package/modules/drive/src/rules/style.md +123 -0
  57. package/modules/drive/src/rules/templates.md +51 -0
  58. package/modules/drive/src/rules/workflows.md +133 -0
  59. package/modules/drive/src/templates/CONTEXT.md +88 -0
  60. package/modules/drive/src/templates/DEBUG.md +164 -0
  61. package/modules/drive/src/templates/DISCOVERY.md +148 -0
  62. package/modules/drive/src/templates/HANDOFF.md +77 -0
  63. package/modules/drive/src/templates/ISSUES.md +93 -0
  64. package/modules/drive/src/templates/MILESTONES.md +167 -0
  65. package/modules/drive/src/templates/PLAN.md +328 -0
  66. package/modules/drive/src/templates/PROJECT.md +219 -0
  67. package/modules/drive/src/templates/RESEARCH.md +130 -0
  68. package/modules/drive/src/templates/ROADMAP.md +328 -0
  69. package/modules/drive/src/templates/SPECIAL-FLOWS.md +70 -0
  70. package/modules/drive/src/templates/STATE.md +210 -0
  71. package/modules/drive/src/templates/SUMMARY.md +221 -0
  72. package/modules/drive/src/templates/UAT-ISSUES.md +139 -0
  73. package/modules/drive/src/templates/codebase/architecture.md +259 -0
  74. package/modules/drive/src/templates/codebase/concerns.md +329 -0
  75. package/modules/drive/src/templates/codebase/conventions.md +311 -0
  76. package/modules/drive/src/templates/codebase/integrations.md +284 -0
  77. package/modules/drive/src/templates/codebase/stack.md +190 -0
  78. package/modules/drive/src/templates/codebase/structure.md +287 -0
  79. package/modules/drive/src/templates/codebase/testing.md +484 -0
  80. package/modules/drive/src/templates/config.md +181 -0
  81. package/modules/drive/src/templates/milestone-archive.md +236 -0
  82. package/modules/drive/src/templates/milestone-context.md +190 -0
  83. package/modules/drive/src/templates/paul-json.md +147 -0
  84. package/modules/drive/src/vector-config/PAUL +26 -0
  85. package/modules/drive/src/vector-config/PAUL.manifest +11 -0
  86. package/modules/drive/src/workflows/apply-phase.md +393 -0
  87. package/modules/drive/src/workflows/audit-plan.md +344 -0
  88. package/modules/drive/src/workflows/complete-milestone.md +479 -0
  89. package/modules/drive/src/workflows/configure-special-flows.md +283 -0
  90. package/modules/drive/src/workflows/consider-issues.md +172 -0
  91. package/modules/drive/src/workflows/create-milestone.md +268 -0
  92. package/modules/drive/src/workflows/debug.md +292 -0
  93. package/modules/drive/src/workflows/discovery.md +187 -0
  94. package/modules/drive/src/workflows/discuss-milestone.md +245 -0
  95. package/modules/drive/src/workflows/discuss-phase.md +231 -0
  96. package/modules/drive/src/workflows/init-project.md +698 -0
  97. package/modules/drive/src/workflows/map-codebase.md +459 -0
  98. package/modules/drive/src/workflows/pause-work.md +259 -0
  99. package/modules/drive/src/workflows/phase-assumptions.md +181 -0
  100. package/modules/drive/src/workflows/plan-phase.md +385 -0
  101. package/modules/drive/src/workflows/quality-gate.md +263 -0
  102. package/modules/drive/src/workflows/register-manifest.md +107 -0
  103. package/modules/drive/src/workflows/research.md +241 -0
  104. package/modules/drive/src/workflows/resume-project.md +200 -0
  105. package/modules/drive/src/workflows/roadmap-management.md +334 -0
  106. package/modules/drive/src/workflows/transition-phase.md +368 -0
  107. package/modules/drive/src/workflows/unify-phase.md +290 -0
  108. package/modules/drive/src/workflows/verify-work.md +241 -0
  109. package/modules/forge/README.md +281 -0
  110. package/modules/forge/bin/install.js +200 -0
  111. package/modules/forge/package.json +32 -0
  112. package/modules/forge/skillsmith/rules/checklists-rules.md +42 -0
  113. package/modules/forge/skillsmith/rules/context-rules.md +43 -0
  114. package/modules/forge/skillsmith/rules/entry-point-rules.md +44 -0
  115. package/modules/forge/skillsmith/rules/frameworks-rules.md +43 -0
  116. package/modules/forge/skillsmith/rules/tasks-rules.md +52 -0
  117. package/modules/forge/skillsmith/rules/templates-rules.md +43 -0
  118. package/modules/forge/skillsmith/skillsmith.md +82 -0
  119. package/modules/forge/skillsmith/tasks/audit.md +277 -0
  120. package/modules/forge/skillsmith/tasks/discover.md +145 -0
  121. package/modules/forge/skillsmith/tasks/distill.md +276 -0
  122. package/modules/forge/skillsmith/tasks/scaffold.md +349 -0
  123. package/modules/forge/specs/checklists.md +193 -0
  124. package/modules/forge/specs/context.md +223 -0
  125. package/modules/forge/specs/entry-point.md +320 -0
  126. package/modules/forge/specs/frameworks.md +228 -0
  127. package/modules/forge/specs/rules.md +245 -0
  128. package/modules/forge/specs/tasks.md +344 -0
  129. package/modules/forge/specs/templates.md +335 -0
  130. package/modules/forge/terminal.svg +70 -0
  131. package/modules/ignition/README.md +245 -0
  132. package/modules/ignition/bin/install.js +184 -0
  133. package/modules/ignition/checklists/planning-quality.md +55 -0
  134. package/modules/ignition/data/application/config.md +21 -0
  135. package/modules/ignition/data/application/guide.md +51 -0
  136. package/modules/ignition/data/application/skill-loadout.md +11 -0
  137. package/modules/ignition/data/campaign/config.md +18 -0
  138. package/modules/ignition/data/campaign/guide.md +36 -0
  139. package/modules/ignition/data/campaign/skill-loadout.md +10 -0
  140. package/modules/ignition/data/client/config.md +18 -0
  141. package/modules/ignition/data/client/guide.md +36 -0
  142. package/modules/ignition/data/client/skill-loadout.md +11 -0
  143. package/modules/ignition/data/utility/config.md +18 -0
  144. package/modules/ignition/data/utility/guide.md +31 -0
  145. package/modules/ignition/data/utility/skill-loadout.md +8 -0
  146. package/modules/ignition/data/workflow/config.md +19 -0
  147. package/modules/ignition/data/workflow/guide.md +41 -0
  148. package/modules/ignition/data/workflow/skill-loadout.md +10 -0
  149. package/modules/ignition/integration.js +54 -0
  150. package/modules/ignition/package.json +35 -0
  151. package/modules/ignition/seed.md +81 -0
  152. package/modules/ignition/tasks/add-type.md +164 -0
  153. package/modules/ignition/tasks/graduate.md +182 -0
  154. package/modules/ignition/tasks/ideate.md +221 -0
  155. package/modules/ignition/tasks/launch.md +137 -0
  156. package/modules/ignition/tasks/status.md +71 -0
  157. package/modules/ignition/templates/planning-application.md +193 -0
  158. package/modules/ignition/templates/planning-campaign.md +138 -0
  159. package/modules/ignition/templates/planning-client.md +149 -0
  160. package/modules/ignition/templates/planning-utility.md +112 -0
  161. package/modules/ignition/templates/planning-workflow.md +125 -0
  162. package/modules/ignition/terminal.svg +74 -0
  163. package/modules/mission-control/CONTEXT-CONTINUITY-SPEC.md +293 -0
  164. package/modules/mission-control/CONTEXT-ENGINEERING-GUIDE.md +282 -0
  165. package/modules/mission-control/README.md +91 -0
  166. package/modules/mission-control/assets/terminal.svg +80 -0
  167. package/modules/mission-control/examples/entities.example.json +133 -0
  168. package/modules/mission-control/examples/projects.example.json +318 -0
  169. package/modules/mission-control/examples/state.example.json +183 -0
  170. package/modules/mission-control/examples/vector.example.json +245 -0
  171. package/modules/mission-control/mission-control/checklists/install-verification.md +46 -0
  172. package/modules/mission-control/mission-control/frameworks/framework-registry.md +83 -0
  173. package/modules/mission-control/mission-control/mission-control.md +83 -0
  174. package/modules/mission-control/mission-control/tasks/insights.md +73 -0
  175. package/modules/mission-control/mission-control/tasks/install.md +194 -0
  176. package/modules/mission-control/mission-control/tasks/status.md +125 -0
  177. package/modules/mission-control/schemas/entities.schema.json +89 -0
  178. package/modules/mission-control/schemas/projects.schema.json +221 -0
  179. package/modules/mission-control/schemas/state.schema.json +108 -0
  180. package/modules/mission-control/schemas/vector.schema.json +200 -0
  181. package/modules/momentum/README.md +678 -0
  182. package/modules/momentum/bin/install.js +563 -0
  183. package/modules/momentum/integration.js +131 -0
  184. package/modules/momentum/package.json +42 -0
  185. package/modules/momentum/schemas/entities.schema.json +89 -0
  186. package/modules/momentum/schemas/projects.schema.json +221 -0
  187. package/modules/momentum/schemas/state.schema.json +108 -0
  188. package/modules/momentum/src/commands/audit-claude-md.md +31 -0
  189. package/modules/momentum/src/commands/audit.md +33 -0
  190. package/modules/momentum/src/commands/groom.md +35 -0
  191. package/modules/momentum/src/commands/history.md +27 -0
  192. package/modules/momentum/src/commands/pulse.md +33 -0
  193. package/modules/momentum/src/commands/scaffold.md +33 -0
  194. package/modules/momentum/src/commands/status.md +28 -0
  195. package/modules/momentum/src/commands/surface-convert.md +35 -0
  196. package/modules/momentum/src/commands/surface-create.md +34 -0
  197. package/modules/momentum/src/commands/surface-list.md +27 -0
  198. package/modules/momentum/src/commands/vector-hygiene.md +33 -0
  199. package/modules/momentum/src/framework/context/momentum-principles.md +71 -0
  200. package/modules/momentum/src/framework/frameworks/audit-strategies.md +53 -0
  201. package/modules/momentum/src/framework/frameworks/satellite-registration.md +44 -0
  202. package/modules/momentum/src/framework/tasks/audit-claude-md.md +68 -0
  203. package/modules/momentum/src/framework/tasks/audit.md +64 -0
  204. package/modules/momentum/src/framework/tasks/groom.md +164 -0
  205. package/modules/momentum/src/framework/tasks/history.md +34 -0
  206. package/modules/momentum/src/framework/tasks/pulse.md +83 -0
  207. package/modules/momentum/src/framework/tasks/scaffold.md +202 -0
  208. package/modules/momentum/src/framework/tasks/status.md +35 -0
  209. package/modules/momentum/src/framework/tasks/surface-convert.md +143 -0
  210. package/modules/momentum/src/framework/tasks/surface-create.md +184 -0
  211. package/modules/momentum/src/framework/tasks/surface-list.md +42 -0
  212. package/modules/momentum/src/framework/tasks/vector-hygiene.md +160 -0
  213. package/modules/momentum/src/framework/templates/workspace-json.md +96 -0
  214. package/modules/momentum/src/hooks/_template.py +129 -0
  215. package/modules/momentum/src/hooks/active-hook.py +178 -0
  216. package/modules/momentum/src/hooks/backlog-hook.py +115 -0
  217. package/modules/momentum/src/hooks/mission-control-insights.py +169 -0
  218. package/modules/momentum/src/hooks/momentum-pulse-check.py +351 -0
  219. package/modules/momentum/src/hooks/operator.py +53 -0
  220. package/modules/momentum/src/hooks/psmm-injector.py +67 -0
  221. package/modules/momentum/src/hooks/satellite-detection.py +248 -0
  222. package/modules/momentum/src/packages/momentum-mcp/index.js +119 -0
  223. package/modules/momentum/src/packages/momentum-mcp/package.json +10 -0
  224. package/modules/momentum/src/packages/momentum-mcp/tools/entities.js +226 -0
  225. package/modules/momentum/src/packages/momentum-mcp/tools/operator.js +106 -0
  226. package/modules/momentum/src/packages/momentum-mcp/tools/projects.js +322 -0
  227. package/modules/momentum/src/packages/momentum-mcp/tools/psmm.js +206 -0
  228. package/modules/momentum/src/packages/momentum-mcp/tools/state.js +199 -0
  229. package/modules/momentum/src/packages/momentum-mcp/tools/surfaces.js +404 -0
  230. package/modules/momentum/src/skill/momentum.md +111 -0
  231. package/modules/momentum/src/tasks/groom.md +164 -0
  232. package/modules/momentum/src/templates/operator.json +66 -0
  233. package/modules/momentum/src/templates/workspace.json +111 -0
  234. package/modules/momentum/terminal.svg +77 -0
  235. package/modules/radar/README.md +1552 -0
  236. package/modules/radar/commands/audit.md +233 -0
  237. package/modules/radar/commands/guardrails.md +194 -0
  238. package/modules/radar/commands/init.md +207 -0
  239. package/modules/radar/commands/playbook.md +176 -0
  240. package/modules/radar/commands/remediate.md +156 -0
  241. package/modules/radar/commands/report.md +172 -0
  242. package/modules/radar/commands/resume.md +176 -0
  243. package/modules/radar/commands/status.md +148 -0
  244. package/modules/radar/commands/transform.md +205 -0
  245. package/modules/radar/commands/validate.md +177 -0
  246. package/modules/radar/docs/ARCHITECTURE.md +336 -0
  247. package/modules/radar/docs/GETTING-STARTED.md +287 -0
  248. package/modules/radar/docs/standards/agents.md +197 -0
  249. package/modules/radar/docs/standards/commands.md +250 -0
  250. package/modules/radar/docs/standards/domains.md +191 -0
  251. package/modules/radar/docs/standards/personas.md +211 -0
  252. package/modules/radar/docs/standards/rules.md +218 -0
  253. package/modules/radar/docs/standards/runtime.md +445 -0
  254. package/modules/radar/docs/standards/schemas.md +269 -0
  255. package/modules/radar/docs/standards/tools.md +273 -0
  256. package/modules/radar/docs/standards/workflows.md +254 -0
  257. package/modules/radar/docs/terminal.svg +72 -0
  258. package/modules/radar/docs/validation/convention-compliance-report.md +183 -0
  259. package/modules/radar/docs/validation/cross-reference-report.md +195 -0
  260. package/modules/radar/docs/validation/validation-summary.md +118 -0
  261. package/modules/radar/docs/validation/version-manifest.yaml +363 -0
  262. package/modules/radar/install.sh +711 -0
  263. package/modules/radar/integration.js +53 -0
  264. package/modules/radar/src/core/agents/architect.md +25 -0
  265. package/modules/radar/src/core/agents/compliance-officer.md +25 -0
  266. package/modules/radar/src/core/agents/data-engineer.md +25 -0
  267. package/modules/radar/src/core/agents/devils-advocate.md +22 -0
  268. package/modules/radar/src/core/agents/performance-engineer.md +25 -0
  269. package/modules/radar/src/core/agents/principal-engineer.md +23 -0
  270. package/modules/radar/src/core/agents/reality-gap-analyst.md +22 -0
  271. package/modules/radar/src/core/agents/security-engineer.md +25 -0
  272. package/modules/radar/src/core/agents/senior-app-engineer.md +25 -0
  273. package/modules/radar/src/core/agents/sre.md +25 -0
  274. package/modules/radar/src/core/agents/staff-engineer.md +23 -0
  275. package/modules/radar/src/core/agents/test-engineer.md +25 -0
  276. package/modules/radar/src/core/personas/architect.md +111 -0
  277. package/modules/radar/src/core/personas/compliance-officer.md +104 -0
  278. package/modules/radar/src/core/personas/data-engineer.md +113 -0
  279. package/modules/radar/src/core/personas/devils-advocate.md +105 -0
  280. package/modules/radar/src/core/personas/performance-engineer.md +119 -0
  281. package/modules/radar/src/core/personas/principal-engineer.md +119 -0
  282. package/modules/radar/src/core/personas/reality-gap-analyst.md +111 -0
  283. package/modules/radar/src/core/personas/security-engineer.md +108 -0
  284. package/modules/radar/src/core/personas/senior-app-engineer.md +111 -0
  285. package/modules/radar/src/core/personas/sre.md +117 -0
  286. package/modules/radar/src/core/personas/staff-engineer.md +109 -0
  287. package/modules/radar/src/core/personas/test-engineer.md +109 -0
  288. package/modules/radar/src/core/workflows/disagreement-resolution.md +183 -0
  289. package/modules/radar/src/core/workflows/phase-0-context.md +148 -0
  290. package/modules/radar/src/core/workflows/phase-1-reconnaissance.md +169 -0
  291. package/modules/radar/src/core/workflows/phase-2-domain-audits.md +190 -0
  292. package/modules/radar/src/core/workflows/phase-3-cross-domain.md +177 -0
  293. package/modules/radar/src/core/workflows/phase-4-adversarial-review.md +165 -0
  294. package/modules/radar/src/core/workflows/phase-5-report.md +189 -0
  295. package/modules/radar/src/core/workflows/phase-checkpoint.md +222 -0
  296. package/modules/radar/src/core/workflows/session-handoff.md +152 -0
  297. package/modules/radar/src/domains/00-context.md +201 -0
  298. package/modules/radar/src/domains/01-architecture.md +248 -0
  299. package/modules/radar/src/domains/02-data.md +224 -0
  300. package/modules/radar/src/domains/03-correctness.md +230 -0
  301. package/modules/radar/src/domains/04-security.md +274 -0
  302. package/modules/radar/src/domains/05-compliance.md +228 -0
  303. package/modules/radar/src/domains/06-testing.md +228 -0
  304. package/modules/radar/src/domains/07-reliability.md +246 -0
  305. package/modules/radar/src/domains/08-performance.md +247 -0
  306. package/modules/radar/src/domains/09-maintainability.md +271 -0
  307. package/modules/radar/src/domains/10-operability.md +250 -0
  308. package/modules/radar/src/domains/11-change-risk.md +246 -0
  309. package/modules/radar/src/domains/12-team-risk.md +221 -0
  310. package/modules/radar/src/domains/13-risk-synthesis.md +202 -0
  311. package/modules/radar/src/rules/agent-boundaries.md +78 -0
  312. package/modules/radar/src/rules/disagreement-protocol.md +76 -0
  313. package/modules/radar/src/rules/epistemic-hygiene.md +78 -0
  314. package/modules/radar/src/schemas/confidence.md +185 -0
  315. package/modules/radar/src/schemas/disagreement.md +238 -0
  316. package/modules/radar/src/schemas/finding.md +287 -0
  317. package/modules/radar/src/schemas/report-section.md +150 -0
  318. package/modules/radar/src/schemas/signal.md +108 -0
  319. package/modules/radar/src/tools/checkov.md +463 -0
  320. package/modules/radar/src/tools/git-history.md +581 -0
  321. package/modules/radar/src/tools/gitleaks.md +447 -0
  322. package/modules/radar/src/tools/grype.md +611 -0
  323. package/modules/radar/src/tools/semgrep.md +378 -0
  324. package/modules/radar/src/tools/sonarqube.md +550 -0
  325. package/modules/radar/src/tools/syft.md +539 -0
  326. package/modules/radar/src/tools/trivy.md +439 -0
  327. package/modules/radar/src/transform/agents/change-risk-modeler.md +24 -0
  328. package/modules/radar/src/transform/agents/execution-validator.md +24 -0
  329. package/modules/radar/src/transform/agents/guardrail-generator.md +24 -0
  330. package/modules/radar/src/transform/agents/pedagogy-agent.md +24 -0
  331. package/modules/radar/src/transform/agents/remediation-architect.md +24 -0
  332. package/modules/radar/src/transform/personas/change-risk-modeler.md +95 -0
  333. package/modules/radar/src/transform/personas/execution-validator.md +95 -0
  334. package/modules/radar/src/transform/personas/guardrail-generator.md +103 -0
  335. package/modules/radar/src/transform/personas/pedagogy-agent.md +105 -0
  336. package/modules/radar/src/transform/personas/remediation-architect.md +95 -0
  337. package/modules/radar/src/transform/rules/change-risk-rules.md +87 -0
  338. package/modules/radar/src/transform/rules/safety-governance.md +87 -0
  339. package/modules/radar/src/transform/schemas/change-risk.md +139 -0
  340. package/modules/radar/src/transform/schemas/intervention-level.md +207 -0
  341. package/modules/radar/src/transform/schemas/playbook.md +205 -0
  342. package/modules/radar/src/transform/schemas/verification-plan.md +134 -0
  343. package/modules/radar/src/transform/workflows/phase-6-remediation.md +148 -0
  344. package/modules/radar/src/transform/workflows/phase-7-risk-validation.md +161 -0
  345. package/modules/radar/src/transform/workflows/phase-8-execution-planning.md +159 -0
  346. package/modules/radar/src/transform/workflows/transform-safety.md +158 -0
  347. package/modules/vector/.vector-template/sessions/.gitkeep +0 -0
  348. package/modules/vector/.vector-template/vector.json +72 -0
  349. package/modules/vector/AUDIT-CLAUDEMD.md +154 -0
  350. package/modules/vector/INSTALL.md +185 -0
  351. package/modules/vector/LICENSE +21 -0
  352. package/modules/vector/README.md +409 -0
  353. package/modules/vector/VECTOR-BLOCK.md +57 -0
  354. package/modules/vector/assets/terminal.svg +68 -0
  355. package/modules/vector/bin/install.js +455 -0
  356. package/modules/vector/bin/migrate-v1-to-v2.sh +492 -0
  357. package/modules/vector/commands/help.md +46 -0
  358. package/modules/vector/hooks/vector-hook.py +775 -0
  359. package/modules/vector/mcp/index.js +118 -0
  360. package/modules/vector/mcp/package.json +10 -0
  361. package/modules/vector/mcp/tools/decisions.js +269 -0
  362. package/modules/vector/mcp/tools/domains.js +361 -0
  363. package/modules/vector/mcp/tools/staging.js +252 -0
  364. package/modules/vector/mcp/tools/vector-json.js +647 -0
  365. package/modules/vector/package.json +38 -0
  366. package/modules/vector/schemas/vector.schema.json +237 -0
  367. package/package.json +39 -0
  368. package/shared/branding/branding.js +70 -0
  369. package/shared/config/defaults.json +59 -0
  370. package/shared/events/README.md +175 -0
  371. package/shared/events/event-bus.js +134 -0
  372. package/shared/events/event_bus.py +255 -0
  373. package/shared/events/integrations.js +161 -0
  374. package/shared/events/schemas/audit-complete.schema.json +21 -0
  375. package/shared/events/schemas/phase-progress.schema.json +23 -0
  376. package/shared/events/schemas/plan-created.schema.json +21 -0
@@ -0,0 +1,205 @@
1
+ ---
2
+ id: playbook
3
+ name: Remediation Playbook
4
+ version: 1.0.0
5
+ used_by:
6
+ - remediation-architect
7
+ - pedagogy-agent
8
+ - guardrail-generator
9
+ ---
10
+
11
+ ## Purpose
12
+
13
+ A Playbook is the atomic unit of Transform output — a structured remediation plan for a single finding. Where a Finding (@schema:finding) describes what is wrong and why it matters, a Playbook describes how to fix it, why the fix is correct, what risks the fix introduces, and how to verify the fix works.
14
+
15
+ Playbooks bridge the gap between diagnosis and action through the 4-layer transformation model. Each layer refines the remediation from abstract principle ("externalize secrets") through framework-specific guidance ("use dotenv with validation") to project-specific implementation ("replace lines 12-14 of config/database.py with os.environ lookups"). This layered approach prevents the most common failure mode in AI-generated fixes: context-free suggestions that are technically correct but architecturally wrong for the target codebase.
16
+
17
+ Every Playbook is governed by an intervention level (@schema:intervention-level) that constrains what Transform is permitted to recommend. A Playbook at the Suggesting level is informational. A Playbook at the Authorizing level is a full change specification with risk assessment and verification plan. The intervention level is not a quality indicator — it is a governance gate that reflects the confidence and evidence behind the remediation.
18
+
19
+ Playbooks are Layer B (remediation knowledge) output. They are the primary input to the Layer C execution pipeline and, when at Authorizing or Executing level, to Drive for human-supervised change orchestration.
20
+
21
+ ## Template
22
+
23
+ ```markdown
24
+ ### {playbook_id}
25
+
26
+ **Finding:** {finding_ref}
27
+ **Intervention Level:** {intervention_level}
28
+
29
+ ---
30
+
31
+ #### Transformation Layers
32
+
33
+ ##### Layer 1 — Abstract Pattern
34
+
35
+ {abstract_pattern}
36
+
37
+ ##### Layer 2 — Framework Mapping
38
+
39
+ {framework_mapping}
40
+
41
+ ##### Layer 3 — Language Mapping
42
+
43
+ {language_mapping}
44
+
45
+ ##### Layer 4 — Project Context
46
+
47
+ {project_context}
48
+
49
+ ---
50
+
51
+ #### Before (Anti-Pattern)
52
+
53
+ ```{language}
54
+ {before_example}
55
+ ```
56
+
57
+ #### After (Correct Pattern)
58
+
59
+ ```{language}
60
+ {after_example}
61
+ ```
62
+
63
+ ---
64
+
65
+ #### Verification Steps
66
+
67
+ {verification_steps}
68
+
69
+ ---
70
+
71
+ #### Risk Metadata
72
+
73
+ | Dimension | Score | Evidence |
74
+ |-----------|-------|----------|
75
+ | Blast Radius | {blast_radius_score}/5 | {blast_radius_evidence} |
76
+ | Coupling Risk | {coupling_risk_score}/5 | {coupling_risk_evidence} |
77
+ | Regression Probability | {regression_probability_score}/5 | {regression_probability_evidence} |
78
+ | Architectural Tension | {architectural_tension_score}/5 | {architectural_tension_evidence} |
79
+
80
+ ---
81
+
82
+ #### Educational Context
83
+
84
+ {educational_context}
85
+ ```
86
+
87
+ ## Field Reference
88
+
89
+ | Field | Type | Required | Description | Valid Values |
90
+ |-------|------|----------|-------------|--------------|
91
+ | `playbook_id` | string | yes | Unique identifier. Format: `PB-{DD}-{NNN}` where DD is the domain number from the source finding and NNN is sequence. | Pattern: `PB-\d{2}-\d{3}` |
92
+ | `finding_ref` | string | yes | The finding this playbook remediates. Must match a valid finding ID from @schema:finding. | Pattern: `F-\d{2}-\d{3}` (e.g., `F-04-001`) |
93
+ | `intervention_level` | enum | yes | Governance tier for this remediation. Determines what Transform is permitted to recommend and what evidence is required. | `suggesting`, `planning`, `authorizing`, `executing` |
94
+ | `abstract_pattern` | string | yes | Layer 1 — The general remediation principle independent of any language, framework, or project. Describes the pattern to apply and why it is correct. | Free-form, 2-4 sentences. Must not reference project-specific files or frameworks. |
95
+ | `framework_mapping` | string | yes | Layer 2 — How the abstract pattern maps to the target project's framework. References framework conventions, idioms, and standard approaches. | Free-form, 2-4 sentences. Must reference the specific framework. |
96
+ | `language_mapping` | string | yes | Layer 3 — Language-specific implementation guidance. Covers syntax, standard library usage, language idioms, and common pitfalls. | Free-form, 2-4 sentences. Must reference the specific language. |
97
+ | `project_context` | string | yes | Layer 4 — Project-specific implementation. References actual files, existing patterns in the codebase, and integration points. This is the most concrete layer. | Free-form, 2-4 sentences. Must reference specific files in the target codebase. |
98
+ | `before_example` | string | yes | Code showing the anti-pattern as it exists in the target codebase. Must be actual code from the codebase, not a generic example. | Fenced code block with language tag. |
99
+ | `after_example` | string | yes | Code showing the correct pattern after remediation. Must be compilable/runnable and follow the project's existing code style. | Fenced code block with language tag. |
100
+ | `verification_steps` | list of strings | yes | Ordered steps to verify the fix works. Each step must be concrete and executable — a command to run, a condition to check, or a behavior to observe. | Minimum 2 steps. Each must be actionable (not "make sure it works"). |
101
+ | `blast_radius_score` | integer | yes | How widely the change ripples through the codebase. | 1 (single file, no dependents) to 5 (cross-system, multiple services affected) |
102
+ | `blast_radius_evidence` | string | yes | Justification for the blast radius score. Must reference specific files, modules, or dependency chains. | Free-form. Must cite concrete artifacts. |
103
+ | `coupling_risk_score` | integer | yes | Whether the change introduces or tightens coupling between components. | 1 (no new coupling) to 5 (creates hard dependency on external system) |
104
+ | `coupling_risk_evidence` | string | yes | Justification for the coupling risk score. Must reference specific interfaces, imports, or dependency relationships. | Free-form. Must cite concrete artifacts. |
105
+ | `regression_probability_score` | integer | yes | Likelihood the change breaks existing functionality. | 1 (change is additive, no existing behavior modified) to 5 (modifies core logic with no test coverage) |
106
+ | `regression_probability_evidence` | string | yes | Justification for the regression probability score. Must reference test coverage data or lack thereof. | Free-form. Must cite test files or coverage metrics. |
107
+ | `architectural_tension_score` | integer | yes | Whether the change conflicts with the codebase's architectural direction. | 1 (aligns with existing patterns) to 5 (contradicts established architecture, requires migration) |
108
+ | `architectural_tension_evidence` | string | yes | Justification for the architectural tension score. Must reference architectural patterns or design decisions in the codebase. | Free-form. Must cite concrete patterns. |
109
+ | `educational_context` | string | no | Pedagogical explanation for AI-assisted developers. Explains why the anti-pattern is harmful and why the remediation is preferred. Written for a developer learning the concept, not an expert. | Free-form, 3-6 sentences. If present, must explain the "why" not just the "what". |
110
+
111
+ ## Validation Rules
112
+
113
+ 1. `playbook_id` must be unique across the entire audit. No two playbooks may share an ID. Format must match `PB-{DD}-{NNN}`.
114
+ 2. `finding_ref` must reference an existing finding ID from the current audit. A playbook without a valid source finding is orphaned and invalid.
115
+ 3. `intervention_level` must be one of the four enumerated values. The level must be justified by the source finding's confidence — see @schema:intervention-level for minimum confidence thresholds per level.
116
+ 4. All four transformation layers must be populated. Layer 1 must not reference project-specific details. Layer 4 must reference project-specific files. If any layer simply repeats another layer's content, the playbook is invalid — each layer must add specificity.
117
+ 5. `before_example` and `after_example` must both be non-empty fenced code blocks with a language tag. The before example must show actual code from the target codebase (not a generic illustration). The after example must be syntactically valid in the target language.
118
+ 6. `verification_steps` must contain at least 2 concrete steps. Each step must be actionable — a command to run, a file to check, a behavior to observe. "Verify it works" is not a valid step.
119
+ 7. All four `risk_metadata` dimensions must have both a score (integer 1-5) and evidence (non-empty string). A score without evidence is an unsupported assertion. Evidence must reference concrete artifacts (files, tests, dependencies), not general claims.
120
+ 8. If `educational_context` is present, it must explain why the anti-pattern is harmful (not just what to do instead). A restatement of the after_example in prose is not educational context.
121
+ 9. A playbook at `intervention_level: authorizing` or `executing` must have a corresponding verification plan (@schema:verification-plan) and change risk assessment (@schema:change-risk). Playbooks at `suggesting` or `planning` levels do not require these.
122
+ 10. The `before_example` and `after_example` must address the same code location. A before example from `config/database.py` paired with an after example from `lib/secrets.py` without explaining the relocation is invalid.
123
+
124
+ ## Examples
125
+
126
+ ### Example: Planning-Level Playbook for Hardcoded Credentials
127
+
128
+ ```markdown
129
+ ### PB-04-001
130
+
131
+ **Finding:** F-04-001
132
+ **Intervention Level:** planning
133
+
134
+ ---
135
+
136
+ #### Transformation Layers
137
+
138
+ ##### Layer 1 — Abstract Pattern
139
+
140
+ Secrets must be externalized from source code into environment-injected configuration. This is the principle of separation of configuration from code — application behavior is defined in source, but deployment-specific values (credentials, endpoints, keys) are injected at runtime. Externalization ensures secrets are not version-controlled, are rotatable without code changes, and can differ per environment.
141
+
142
+ ##### Layer 2 — Framework Mapping
143
+
144
+ In Python web applications using Flask or Django, the standard approach is environment variables loaded via `os.environ` with a `.env` file for local development (using `python-dotenv`). The framework's configuration system should be the single point of secret access — individual modules should not read environment variables directly. Django uses `settings.py`; Flask uses `app.config`.
145
+
146
+ ##### Layer 3 — Language Mapping
147
+
148
+ Python's `os.environ` provides direct access to environment variables. For required secrets, use `os.environ["KEY"]` (raises `KeyError` if missing) rather than `os.environ.get("KEY")` (returns `None` silently). The `python-dotenv` package loads `.env` files into the environment for local development. Type coercion (e.g., `int(os.environ["PORT"])`) should happen at the configuration boundary, not at point of use.
149
+
150
+ ##### Layer 4 — Project Context
151
+
152
+ Replace the hardcoded values in `config/database.py` (lines 12-14) with `os.environ["DB_USER"]`, `os.environ["DB_PASS"]`, and `os.environ["DB_HOST"]`. Add `python-dotenv` to `requirements.txt`. Create `.env.example` with placeholder keys (no values) for developer onboarding. Add `.env` to `.gitignore`. The existing `config/__init__.py` already imports from `database.py`, so no import changes are needed.
153
+
154
+ ---
155
+
156
+ #### Before (Anti-Pattern)
157
+
158
+ ```python
159
+ # config/database.py
160
+ DB_USER = "admin"
161
+ DB_PASS = "pr0d_s3cret_2024"
162
+ DB_HOST = "prod-db.internal.company.com"
163
+ ```
164
+
165
+ #### After (Correct Pattern)
166
+
167
+ ```python
168
+ # config/database.py
169
+ import os
170
+ from dotenv import load_dotenv
171
+
172
+ load_dotenv()
173
+
174
+ DB_USER = os.environ["DB_USER"]
175
+ DB_PASS = os.environ["DB_PASS"]
176
+ DB_HOST = os.environ["DB_HOST"]
177
+ ```
178
+
179
+ ---
180
+
181
+ #### Verification Steps
182
+
183
+ 1. Run `grep -r "pr0d_s3cret\|admin\|prod-db.internal" config/` — must return no results (no hardcoded secrets remain)
184
+ 2. Run `python -c "from config.database import DB_USER; print(DB_USER)"` with `.env` file present — must print the configured value without error
185
+ 3. Run `python -c "from config.database import DB_USER"` without `.env` file or environment variables — must raise `KeyError` (fail-closed behavior)
186
+ 4. Verify `.env` is listed in `.gitignore`
187
+ 5. Verify `.env.example` exists with keys but no values
188
+
189
+ ---
190
+
191
+ #### Risk Metadata
192
+
193
+ | Dimension | Score | Evidence |
194
+ |-----------|-------|----------|
195
+ | Blast Radius | 2/5 | Change is confined to `config/database.py` and `requirements.txt`. One downstream consumer (`config/__init__.py`) imports these values but the interface (variable names) is unchanged. |
196
+ | Coupling Risk | 2/5 | Introduces dependency on `python-dotenv` package and on environment variable availability. Both are standard Python patterns with no lock-in. |
197
+ | Regression Probability | 2/5 | Existing tests in `tests/test_config.py` mock the database configuration. Tests will need `.env` file or environment variables set in test fixtures. Test coverage for config module is 78%. |
198
+ | Architectural Tension | 1/5 | Environment-based configuration aligns with the project's existing pattern in `config/api.py` (line 8) which already uses `os.environ` for the API key. This change makes the database config consistent with established practice. |
199
+
200
+ ---
201
+
202
+ #### Educational Context
203
+
204
+ Hardcoded credentials in source code are one of the most common and dangerous security anti-patterns. When secrets are committed to version control, they persist in git history even after removal, they are accessible to anyone with repository access, and they cannot be rotated without a code change and deployment. Environment variable injection separates the secret lifecycle from the code lifecycle — secrets can be rotated, scoped per environment, and managed through dedicated secrets infrastructure without touching application code. The principle extends beyond credentials to any deployment-specific value: API endpoints, feature flags, rate limits.
205
+ ```
@@ -0,0 +1,134 @@
1
+ ---
2
+ id: verification-plan
3
+ name: Verification Plan
4
+ version: 1.0.0
5
+ used_by:
6
+ - execution-validator
7
+ - guardrail-generator
8
+ ---
9
+
10
+ ## Purpose
11
+
12
+ A Verification Plan defines the checks that must be performed before, after, and in regression testing of a proposed change, along with the conditions that trigger rollback and the procedure to undo the change. Every change that reaches Authorizing or Executing intervention level (@schema:intervention-level) must have a corresponding Verification Plan. Changes at lower levels may optionally include one.
13
+
14
+ Verification Plans exist because remediation without verification is hope, not engineering. A fix that passes the developer's mental model but breaks an integration test, a deployment pipeline, or a downstream service is worse than no fix — it introduces a new defect while consuming the effort meant to resolve an existing one. Structured verification catches these failures before they propagate.
15
+
16
+ The three check categories serve different purposes. Pre-change checks establish a baseline — confirming that the system is in a known-good state before the change is applied. Post-change checks confirm the fix works as intended — the anti-pattern is resolved, the new behavior is correct, and the change integrates properly. Regression checks confirm that nothing else broke — the full test suite passes, dependent services respond correctly, and deployment smoke tests succeed.
17
+
18
+ Rollback criteria and procedures ensure every change is reversible. A change that cannot be rolled back carries inherently higher risk and should be reflected in the change-risk assessment (@schema:change-risk). The rollback procedure must be concrete — "revert the commit" is only valid when the change is a single commit with no database migrations or infrastructure changes.
19
+
20
+ ## Template
21
+
22
+ ```markdown
23
+ ### Verification Plan: {change_id}
24
+
25
+ ---
26
+
27
+ #### Pre-Change Checks
28
+
29
+ | # | Check | Command/Instruction | Expected Result |
30
+ |---|-------|---------------------|-----------------|
31
+ | 1 | {check_name} | {command_or_instruction} | {expected_result} |
32
+ | 2 | {check_name} | {command_or_instruction} | {expected_result} |
33
+
34
+ #### Post-Change Checks
35
+
36
+ | # | Check | Command/Instruction | Expected Result |
37
+ |---|-------|---------------------|-----------------|
38
+ | 1 | {check_name} | {command_or_instruction} | {expected_result} |
39
+ | 2 | {check_name} | {command_or_instruction} | {expected_result} |
40
+
41
+ #### Regression Checks
42
+
43
+ | # | Check | Command/Instruction | Expected Result |
44
+ |---|-------|---------------------|-----------------|
45
+ | 1 | {check_name} | {command_or_instruction} | {expected_result} |
46
+ | 2 | {check_name} | {command_or_instruction} | {expected_result} |
47
+
48
+ ---
49
+
50
+ #### Rollback Criteria
51
+
52
+ {rollback_criteria}
53
+
54
+ #### Rollback Procedure
55
+
56
+ {rollback_procedure}
57
+ ```
58
+
59
+ ## Field Reference
60
+
61
+ | Field | Type | Required | Description | Valid Values |
62
+ |-------|------|----------|-------------|--------------|
63
+ | `change_id` | string | yes | The change this verification plan covers. Must match a change-risk assessment's `change_id` from @schema:change-risk. | Pattern: `CR-\d{3}` |
64
+ | `pre_change_checks` | list of objects | yes | Checks to run before applying the change. Establish that the system is in a known-good state. Each object must contain `check_name`, `command_or_instruction`, and `expected_result`. | Minimum 1 check. At least one must be a test-suite execution. |
65
+ | `pre_change_checks[].check_name` | string | yes | Short descriptive name for the check. | Free-form, max 60 characters. Should describe what is being verified. |
66
+ | `pre_change_checks[].command_or_instruction` | string | yes | The exact command to run or instruction to follow. Must be copy-pasteable into a terminal or actionable without interpretation. | Executable command or concrete instruction. Not "run the tests" — specify which tests. |
67
+ | `pre_change_checks[].expected_result` | string | yes | What the check should produce when the system is in a correct state. Must be observable and unambiguous. | Specific output, exit code, or observable condition. Not "it works." |
68
+ | `post_change_checks` | list of objects | yes | Checks to run after applying the change. Confirm the fix works as intended. Same object structure as pre_change_checks. | Minimum 1 check. Must include at least one check specific to the remediation (not just general tests). |
69
+ | `regression_checks` | list of objects | yes | Checks to confirm no existing functionality is broken. Same object structure as pre_change_checks. | Minimum 1 check. Must include the full test suite or a representative subset. |
70
+ | `rollback_criteria` | list of strings | yes | Conditions under which rollback is required. Each criterion must be a specific, observable condition — not a judgment call. | Minimum 1 criterion. Each must be falsifiable (you can definitively say whether it occurred). |
71
+ | `rollback_procedure` | string | yes | Step-by-step procedure to undo the change and restore the previous state. Must be concrete — specific commands, specific files, specific actions. | Free-form. Must include at least 2 concrete steps. "Undo the change" is not a valid procedure. |
72
+
73
+ ## Validation Rules
74
+
75
+ 1. `change_id` must match a `change_id` from an existing change-risk assessment in the current audit. A verification plan without a corresponding risk assessment is orphaned — the risk profile is unknown.
76
+ 2. `pre_change_checks` must contain at least one entry, and at least one check must execute the project's test suite (or relevant subset). If the project has no test suite, this must be noted as a check: "Confirm no test suite exists" with expected result "No test runner configured" — the absence of tests is itself a verifiable condition.
77
+ 3. `post_change_checks` must contain at least one check that is specific to the remediation being verified. A generic "run all tests" is a regression check, not a post-change check. Post-change checks must verify that the specific anti-pattern is resolved and the correct pattern is in place.
78
+ 4. `regression_checks` must contain at least one check. For projects with a test suite, this must include a full test-suite run. For projects without tests, regression checks must describe manual verification of key functionality.
79
+ 5. Every check's `command_or_instruction` must be actionable without interpretation. "Run the relevant tests" is invalid — specify "Run `pytest tests/test_config.py -v`". "Check the deployment" is invalid — specify "Run `curl -s http://localhost:8000/health | jq .status` and confirm output is `ok`".
80
+ 6. Every check's `expected_result` must be observable and unambiguous. "It works correctly" is invalid. "Exit code 0, all tests pass, no new warnings" is valid. "Output contains `DB_USER` with non-empty value" is valid.
81
+ 7. `rollback_criteria` must contain at least one entry. Each criterion must be a specific, observable condition — not a judgment call. "If something goes wrong" is invalid. "If `pytest tests/` exits with non-zero code after applying the change" is valid. "If application fails to start within 30 seconds of configuration change" is valid.
82
+ 8. `rollback_procedure` must contain at least 2 concrete steps. "Revert the change" is valid only when accompanied by the specific revert mechanism (e.g., "Run `git revert HEAD`" or "Restore `config/database.py` from backup at `.radar/backups/CR-001/database.py`"). If the change involves database migrations, infrastructure changes, or external service configuration, the rollback procedure must address each.
83
+
84
+ ## Examples
85
+
86
+ ### Example: Verification Plan for Credential Externalization
87
+
88
+ ```markdown
89
+ ### Verification Plan: CR-001
90
+
91
+ ---
92
+
93
+ #### Pre-Change Checks
94
+
95
+ | # | Check | Command/Instruction | Expected Result |
96
+ |---|-------|---------------------|-----------------|
97
+ | 1 | Existing tests pass | `pytest tests/ -v` | Exit code 0, all tests pass |
98
+ | 2 | Current config loads | `python -c "from config.database import DB_USER; print(DB_USER)"` | Prints `admin` (current hardcoded value) |
99
+ | 3 | Git working tree clean | `git status --porcelain` | Empty output (no uncommitted changes) |
100
+
101
+ #### Post-Change Checks
102
+
103
+ | # | Check | Command/Instruction | Expected Result |
104
+ |---|-------|---------------------|-----------------|
105
+ | 1 | No hardcoded secrets remain | `grep -r "pr0d_s3cret\|admin\|prod-db.internal" config/` | No output (no matches found) |
106
+ | 2 | Config loads from environment | Set `DB_USER=test_user DB_PASS=test_pass DB_HOST=localhost` then run `python -c "from config.database import DB_USER; print(DB_USER)"` | Prints `test_user` |
107
+ | 3 | Missing env vars fail-closed | Run `unset DB_USER && python -c "from config.database import DB_USER"` | Raises `KeyError: 'DB_USER'` |
108
+ | 4 | .env.example exists | `cat .env.example` | Contains `DB_USER=`, `DB_PASS=`, `DB_HOST=` with no values |
109
+ | 5 | .env is gitignored | `git check-ignore .env` | Output: `.env` |
110
+
111
+ #### Regression Checks
112
+
113
+ | # | Check | Command/Instruction | Expected Result |
114
+ |---|-------|---------------------|-----------------|
115
+ | 1 | Full test suite | `pytest tests/ -v` with `.env` file present | Exit code 0, all tests pass (including test_config.py) |
116
+ | 2 | Application starts | `python app.py &` with `.env` file, then `curl http://localhost:8000/health` | Returns 200 with `{"status": "ok"}` |
117
+ | 3 | Config module interface unchanged | `python -c "from config import DB_USER, DB_PASS, DB_HOST; print('OK')"` | Prints `OK` (imports still work via config/__init__.py) |
118
+
119
+ ---
120
+
121
+ #### Rollback Criteria
122
+
123
+ - `pytest tests/` exits with non-zero code after applying the change and the failures are in config-related tests
124
+ - Application fails to start with error referencing `DB_USER`, `DB_PASS`, or `DB_HOST` environment variables
125
+ - Any downstream service reports connection failures to the database after deployment
126
+
127
+ #### Rollback Procedure
128
+
129
+ 1. Restore the original `config/database.py` from git: `git checkout HEAD~1 -- config/database.py`
130
+ 2. Remove `python-dotenv` from `requirements.txt`: `git checkout HEAD~1 -- requirements.txt`
131
+ 3. Remove `.env.example` if it was newly created: `rm .env.example`
132
+ 4. Run `pytest tests/ -v` to confirm tests pass with restored hardcoded values
133
+ 5. If already deployed: redeploy with the reverted code and confirm database connectivity
134
+ ```
@@ -0,0 +1,148 @@
1
+ <purpose>
2
+ Orchestrates remediation synthesis by invoking the Remediation Architect to group Core findings by root cause and produce layered playbooks, then the Pedagogy Agent to enrich those playbooks with educational context — producing the complete Layer B remediation knowledge base.
3
+ </purpose>
4
+
5
+ <phase_context>
6
+ Phase: 6 — Remediation Synthesis
7
+ Prior phase output: Complete Core audit record — Phase 5 report (.radar/report/), all findings (.radar/findings/), all disagreements (.radar/disagreements/), resolution records, confidence scores, audit scope (.radar/scope.md)
8
+ Agents invoked: remediation-architect (first), pedagogy-agent (second) — sequential, not parallel
9
+ Output: remediation/playbooks/ (layered remediation plans), remediation/patterns/ (cross-cutting analysis), remediation/REMEDIATION-SUMMARY.md
10
+ </phase_context>
11
+
12
+ <required_input>
13
+ @.radar/STATE.md
14
+ @.radar/MANIFEST.md
15
+ @.radar/scope.md
16
+ @.radar/report/Radar-REPORT.md
17
+ @.radar/findings/*.md (all agent finding sets)
18
+ @.radar/disagreements/*.md (all disagreement records)
19
+ @~/.claude/radar/transform/agents/remediation-architect.md
20
+ @~/.claude/radar/transform/agents/pedagogy-agent.md
21
+ @~/.claude/radar/transform/schemas/playbook.md
22
+ @~/.claude/radar/transform/schemas/intervention-level.md
23
+ @~/.claude/radar/transform/rules/safety-governance.md
24
+ @~/.claude/radar/transform/rules/change-risk-rules.md
25
+ @~/.claude/radar/transform/workflows/transform-safety.md
26
+ </required_input>
27
+
28
+ <process>
29
+
30
+ <step name="validate_prerequisites" priority="first">
31
+ 1. Verify .radar/STATE.md shows Phase 5 (Report Generation) complete:
32
+ a. Check phase_5_complete: true
33
+ b. Check .radar/report/Radar-REPORT.md exists
34
+ c. Verify all findings and disagreement records are present
35
+ 2. If Phase 5 is not complete:
36
+ a. Halt with error: "Phase 5 (Report Generation) not complete. Core audit must finish before Transform begins."
37
+ b. Do not proceed.
38
+ 3. Load audit scope to understand remediation boundaries.
39
+ 4. Update .radar/STATE.md:
40
+ a. current_phase: 6
41
+ b. phase_status: in_progress
42
+ </step>
43
+
44
+ <step name="load_layer_a_record" priority="blocking">
45
+ 1. Load the complete Layer A record:
46
+ a. All finding files from .radar/findings/ (per-agent finding sets)
47
+ b. All disagreement records from .radar/disagreements/
48
+ c. Resolution records and principal responses
49
+ d. Confidence scores attached to each finding
50
+ e. Phase 5 report for severity calibration context
51
+ 2. Build a unified finding index:
52
+ a. Total findings by domain, severity, and confidence level
53
+ b. Cross-references between findings that share code paths or root causes
54
+ c. Disagreements that affect remediation scope (unresolved high-severity disagreements block remediation for affected findings)
55
+ 3. Record Layer A summary metrics in .radar/STATE.md.
56
+ </step>
57
+
58
+ <step name="invoke_remediation_architect" priority="blocking">
59
+ 1. Load agent manifest from src/transform/agents/remediation-architect.md.
60
+ 2. Resolve all component references:
61
+ a. Persona: src/transform/personas/remediation-architect.md
62
+ b. Domains: all 14 domain modules (src/domains/00-*.md through src/domains/13-*.md)
63
+ c. Schemas: src/transform/schemas/playbook.md, src/transform/schemas/intervention-level.md
64
+ d. Rules: src/transform/rules/safety-governance.md, src/transform/rules/change-risk-rules.md
65
+ 3. Provide the complete Layer A record as input.
66
+ 4. Instruct agent to:
67
+ a. Group findings by root cause across domain boundaries
68
+ b. Produce playbooks at all 4 transformation layers (abstract → framework → language → project)
69
+ c. Classify each playbook by intervention level
70
+ d. Record unremediated findings with reasons (insufficient confidence, unclear root cause)
71
+ 5. Validate all playbook output against src/transform/schemas/playbook.md.
72
+ 6. Record remediation-architect session completion in .radar/STATE.md.
73
+ </step>
74
+
75
+ <step name="validate_intervention_levels" priority="blocking">
76
+ 1. Invoke transform-safety workflow (src/transform/workflows/transform-safety.md):
77
+ a. Pass all playbooks with their intervention level classifications
78
+ b. Pass finding confidence scores for each referenced finding
79
+ 2. Safety workflow validates:
80
+ a. Confidence gating: each playbook's intervention level matches its evidence base
81
+ b. Risk threshold check (preliminary — full risk scoring happens in Phase 7)
82
+ c. No-auto-execution boundary: playbooks contain plans only, no execution commands
83
+ 3. Apply any downgrades returned by the safety workflow:
84
+ a. Record original and downgraded intervention levels
85
+ b. Add downgrade rationale to affected playbooks
86
+ 4. Record safety validation results in .radar/STATE.md.
87
+ </step>
88
+
89
+ <step name="invoke_pedagogy_agent" priority="blocking">
90
+ 1. Load agent manifest from src/transform/agents/pedagogy-agent.md.
91
+ 2. Resolve component references:
92
+ a. Persona: src/transform/personas/pedagogy-agent.md
93
+ b. Schemas: src/transform/schemas/playbook.md
94
+ c. Rules: src/transform/rules/safety-governance.md
95
+ 3. Provide Remediation Architect's playbook output + original findings.
96
+ 4. Instruct agent to:
97
+ a. Enrich each playbook with educational context at all 4 transformation layers
98
+ b. Add before/after examples where applicable
99
+ c. Add "why this matters" explanations grounding fixes in principles
100
+ d. Add best-practice rationale for each remediation approach
101
+ e. Surface pattern-level teaching (not just instance-level fixes)
102
+ 5. Validate enriched playbooks still conform to playbook schema.
103
+ 6. Record pedagogy-agent session completion in .radar/STATE.md.
104
+ </step>
105
+
106
+ <step name="persist_and_finalize" priority="blocking">
107
+ 1. Write all playbook files to remediation/playbooks/:
108
+ a. One file per root cause group
109
+ b. Each includes all 4 transformation layers + educational enrichment
110
+ c. Each carries intervention level classification and confidence metadata
111
+ 2. Write cross-cutting pattern analysis to remediation/patterns/:
112
+ a. Patterns that span multiple root cause groups
113
+ b. Systemic issues identified across domains
114
+ 3. Generate remediation/REMEDIATION-SUMMARY.md:
115
+ a. Total playbooks generated
116
+ b. Playbooks by intervention level
117
+ c. Unremediated findings with reasons
118
+ d. Key patterns identified
119
+ 4. Update .radar/STATE.md:
120
+ a. current_phase: 6
121
+ b. phase_status: complete
122
+ c. phase_6_complete: true
123
+ d. playbook_count, unremediated_count, intervention_level_distribution
124
+ e. next_phase: 7
125
+ f. timestamp
126
+ </step>
127
+
128
+ </process>
129
+
130
+ <output>
131
+ Artifacts created:
132
+ - remediation/playbooks/{root-cause-group}.md — Layered remediation playbooks with educational enrichment (one per root cause group)
133
+ - remediation/patterns/{pattern-name}.md — Cross-cutting pattern analysis
134
+ - remediation/REMEDIATION-SUMMARY.md — Phase 6 summary with metrics and intervention level distribution
135
+ - .radar/STATE.md — Updated with Phase 6 completion and remediation metrics
136
+
137
+ All playbook files conform to src/transform/schemas/playbook.md.
138
+ All intervention levels validated by transform-safety workflow.
139
+ </output>
140
+
141
+ <error_handling>
142
+ - **Phase 5 not complete:** Halt immediately. Display: "Core audit (Phases 0-5) must complete before Transform begins. Run phase-5-report workflow first." Do not proceed.
143
+ - **Finding cannot be remediated:** Record as "unremediated" with specific reason (insufficient confidence, unclear root cause, conflicting remediation approaches). Include in REMEDIATION-SUMMARY.md. Do not force remediation where evidence is insufficient.
144
+ - **Intervention level downgrade by safety workflow:** Apply downgrade, record rationale. This is correct behavior, not an error. A playbook that claims Authorizing but has Medium confidence MUST be downgraded to Planning.
145
+ - **Pedagogy Agent cannot enrich a playbook:** Mark playbook as "unenriched" with reason. Proceed with remaining playbooks. An unenriched playbook is still a valid remediation plan — it just lacks educational context.
146
+ - **Schema validation failure on playbook output:** Return to producing agent with specific field-level errors. Allow up to 2 retry attempts. On third failure, log playbook as "unvalidated" and flag for manual review.
147
+ - **Unresolved high-severity disagreement blocks remediation:** Do not produce remediation for findings affected by unresolved high-severity disagreements. Record as blocked with reference to disagreement ID. This is safety-correct behavior.
148
+ </error_handling>
@@ -0,0 +1,161 @@
1
+ <purpose>
2
+ Orchestrates change risk validation by invoking the Change Risk Modeler to score every proposed change across 4 risk dimensions, then the Guardrail Generator to produce machine-enforceable constraints from audit patterns — completing the risk-aware remediation pipeline.
3
+ </purpose>
4
+
5
+ <phase_context>
6
+ Phase: 7 — Change Risk Validation
7
+ Prior phase output: Phase 6 remediation playbooks (remediation/playbooks/), cross-cutting patterns (remediation/patterns/), remediation summary (remediation/REMEDIATION-SUMMARY.md)
8
+ Agents invoked: change-risk-modeler (first), guardrail-generator (second) — sequential, not parallel
9
+ Output: execution/risk-scores.yaml (dimensional risk profiles), remediation/guardrails/ (machine-enforceable constraints), risk assessment report
10
+ </phase_context>
11
+
12
+ <required_input>
13
+ @.radar/STATE.md
14
+ @.radar/MANIFEST.md
15
+ @.radar/signals/git-history.md
16
+ @.radar/findings/*.md (for guardrail context)
17
+ @remediation/playbooks/*.md (Phase 6 output)
18
+ @remediation/patterns/*.md (cross-cutting patterns)
19
+ @~/.claude/radar/transform/agents/change-risk-modeler.md
20
+ @~/.claude/radar/transform/agents/guardrail-generator.md
21
+ @~/.claude/radar/transform/schemas/change-risk.md
22
+ @~/.claude/radar/transform/schemas/playbook.md
23
+ @~/.claude/radar/transform/schemas/intervention-level.md
24
+ @~/.claude/radar/transform/rules/safety-governance.md
25
+ @~/.claude/radar/transform/rules/change-risk-rules.md
26
+ @~/.claude/radar/transform/workflows/transform-safety.md
27
+ @~/.claude/radar/domains/11-*.md (change risk domain)
28
+ @~/.claude/radar/tools/git-history.md (tool adapter)
29
+ @~/.claude/radar/tools/semgrep.md (tool adapter for guardrail format)
30
+ </required_input>
31
+
32
+ <process>
33
+
34
+ <step name="validate_prerequisites" priority="first">
35
+ 1. Verify .radar/STATE.md shows Phase 6 (Remediation Synthesis) complete:
36
+ a. Check phase_6_complete: true
37
+ b. Check remediation/playbooks/ contains at least one playbook
38
+ c. Check remediation/REMEDIATION-SUMMARY.md exists
39
+ 2. If Phase 6 is not complete:
40
+ a. Halt with error: "Phase 6 (Remediation Synthesis) not complete. Run phase-6-remediation workflow first."
41
+ b. Do not proceed.
42
+ 3. Load Phase 6 output metrics from .radar/STATE.md.
43
+ 4. Update .radar/STATE.md:
44
+ a. current_phase: 7
45
+ b. phase_status: in_progress
46
+ </step>
47
+
48
+ <step name="load_risk_context" priority="blocking">
49
+ 1. Load all Phase 6 playbooks from remediation/playbooks/.
50
+ 2. Load git-history signals from .radar/signals/git-history.md:
51
+ a. Change frequency per file/module
52
+ b. Co-change coupling data
53
+ c. Contributor patterns
54
+ 3. Load codebase structure map (from Phase 0 context).
55
+ 4. Load test coverage signals if available.
56
+ 5. Build a change inventory:
57
+ a. Every proposed modification from every playbook
58
+ b. Affected files, modules, and interfaces per change
59
+ c. Dependencies between proposed changes
60
+ 6. Record change inventory metrics in .radar/STATE.md.
61
+ </step>
62
+
63
+ <step name="invoke_change_risk_modeler" priority="blocking">
64
+ 1. Load agent manifest from src/transform/agents/change-risk-modeler.md.
65
+ 2. Resolve all component references:
66
+ a. Persona: src/transform/personas/change-risk-modeler.md
67
+ b. Domains: src/domains/11-*.md (change risk domain)
68
+ c. Tools: src/tools/git-history.md
69
+ d. Schemas: src/transform/schemas/change-risk.md, src/transform/schemas/intervention-level.md
70
+ e. Rules: src/transform/rules/safety-governance.md, src/transform/rules/change-risk-rules.md
71
+ 3. Provide playbooks + git history + codebase structure as input.
72
+ 4. Instruct agent to:
73
+ a. Score every proposed change across 4 risk dimensions (blast radius, coupling, regression probability, architectural tension)
74
+ b. Present risk as dimensional profiles, never single aggregate scores
75
+ c. Flag changes where ANY dimension exceeds "high" threshold
76
+ d. Identify compound risk where multiple changes target the same module
77
+ 5. Validate all risk scores against src/transform/schemas/change-risk.md.
78
+ 6. Record change-risk-modeler session completion in .radar/STATE.md.
79
+ </step>
80
+
81
+ <step name="validate_risk_thresholds" priority="blocking">
82
+ 1. Invoke transform-safety workflow (src/transform/workflows/transform-safety.md):
83
+ a. Pass all risk-scored changes with their dimensional profiles
84
+ b. Pass current intervention level for each affected playbook
85
+ 2. Safety workflow validates:
86
+ a. Risk threshold check: any dimension exceeding "high" → force intervention level downgrade to Suggesting
87
+ b. Confidence gating re-check with risk context
88
+ c. Refusal conditions check (risk exceeds bounds, insufficient test coverage)
89
+ 3. Apply any downgrades or refusals:
90
+ a. Record original and adjusted intervention levels
91
+ b. Record any refused changes with refusal reasons
92
+ 4. Establish final risk-adjusted priority ordering:
93
+ a. Order changes by combined risk profile (lowest risk first for conservative sequencing)
94
+ b. Respect dependency ordering from Phase 6 playbooks
95
+ 5. Record safety validation results in .radar/STATE.md.
96
+ </step>
97
+
98
+ <step name="invoke_guardrail_generator" priority="blocking">
99
+ 1. Load agent manifest from src/transform/agents/guardrail-generator.md.
100
+ 2. Resolve component references:
101
+ a. Persona: src/transform/personas/guardrail-generator.md
102
+ b. Tools: src/tools/semgrep.md (rule format reference)
103
+ c. Schemas: src/transform/schemas/playbook.md
104
+ d. Rules: src/transform/rules/safety-governance.md, src/transform/rules/change-risk-rules.md
105
+ 3. Provide playbooks + risk scores + original findings as input.
106
+ 4. Instruct agent to:
107
+ a. Identify failure patterns that warrant structural prevention
108
+ b. Produce machine-enforceable constraints organized by mechanism:
109
+ - CLAUDE.md rules (AI coding assistant constraints)
110
+ - .cursorrules (IDE-level enforcement)
111
+ - Custom linter configurations
112
+ - Pre-commit hook specifications
113
+ - Custom Semgrep rules (using Semgrep rule format from tool adapter)
114
+ c. Include failure mode rationale and invalidation conditions per constraint
115
+ d. Evaluate each constraint against false guardrail test
116
+ 5. Validate guardrail output conforms to playbook schema (guardrails are a playbook subtype).
117
+ 6. Record guardrail-generator session completion in .radar/STATE.md.
118
+ </step>
119
+
120
+ <step name="persist_and_finalize" priority="blocking">
121
+ 1. Write risk scores to execution/risk-scores.yaml:
122
+ a. Dimensional risk profile per proposed change
123
+ b. Final intervention level (post-safety-validation)
124
+ c. Risk-adjusted priority ordering
125
+ d. Compound risk warnings
126
+ 2. Write guardrail files to remediation/guardrails/:
127
+ a. Organized by enforcement mechanism
128
+ b. Each includes failure mode rationale and invalidation conditions
129
+ 3. Generate risk assessment report.
130
+ 4. Update .radar/STATE.md:
131
+ a. current_phase: 7
132
+ b. phase_status: complete
133
+ c. phase_7_complete: true
134
+ d. changes_scored, high_risk_count, downgrades_applied, guardrails_generated
135
+ e. next_phase: 8
136
+ f. timestamp
137
+ </step>
138
+
139
+ </process>
140
+
141
+ <output>
142
+ Artifacts created:
143
+ - execution/risk-scores.yaml — Dimensional risk profiles per proposed change with final intervention levels
144
+ - remediation/guardrails/{mechanism-type}.md — Machine-enforceable constraints organized by enforcement mechanism
145
+ - Risk assessment report (in .radar/reports/ or execution/)
146
+ - .radar/STATE.md — Updated with Phase 7 completion and risk metrics
147
+
148
+ All risk scores conform to src/transform/schemas/change-risk.md.
149
+ All guardrails conform to src/transform/schemas/playbook.md (guardrail subtype).
150
+ All intervention levels validated by transform-safety workflow.
151
+ </output>
152
+
153
+ <error_handling>
154
+ - **Phase 6 not complete:** Halt immediately. Display: "Phase 6 (Remediation Synthesis) must complete before risk validation. Run phase-6-remediation workflow first." Do not proceed.
155
+ - **Risk scoring fails for a change:** Default to maximum risk across all 4 dimensions. Flag for human review. Do not assign low risk by default — unknown risk is treated as high risk.
156
+ - **Git history signals unavailable:** Proceed with reduced evidence for coupling and change frequency dimensions. Change Risk Modeler's confidence vectors should reflect limited signal diversity. Blast radius and architectural tension can still be assessed from static structure.
157
+ - **Risk threshold forces intervention level downgrade:** Apply downgrade. This is correct behavior. Record original level, downgraded level, and which dimension triggered the downgrade.
158
+ - **Guardrail generation fails for a pattern:** Record as "unguarded" with reason. Proceed with remaining patterns. A missing guardrail is noted in the output but does not block Phase 7 completion.
159
+ - **False guardrail detected during validation:** Remove the constraint. A constraint that does not actually prevent its target failure mode is worse than no constraint. Log removal with analysis.
160
+ - **Refusal condition met:** Safety workflow refuses to generate remediation for affected findings. Record refusal with specific condition. This is the correct safety behavior — not an error to recover from.
161
+ </error_handling>