loki-mode 11.3.0 → 11.3.2

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 (242) hide show
  1. package/README.md +68 -650
  2. package/SKILL.md +5 -5
  3. package/VERSION +1 -1
  4. package/autonomy/completion-council.sh +2 -2
  5. package/autonomy/context-tracker.py +4 -4
  6. package/autonomy/council-v2.sh +1 -1
  7. package/autonomy/grill.sh +1 -1
  8. package/autonomy/lib/done-recognition.sh +1 -1
  9. package/autonomy/lib/efficiency_cost.py +8 -0
  10. package/autonomy/lib/engine10-push.sh +22 -8
  11. package/autonomy/lib/prd-enrich.sh +1 -1
  12. package/autonomy/lib/voter-agents.sh +1 -1
  13. package/autonomy/loki +161 -105
  14. package/autonomy/run.sh +30 -18
  15. package/autonomy/sandbox.sh +1 -1
  16. package/autonomy/tui.sh +6 -5
  17. package/autonomy/verify.sh +1 -1
  18. package/bin/loki +195 -59
  19. package/completions/_loki +8 -0
  20. package/completions/loki.bash +3 -3
  21. package/dashboard/__init__.py +1 -1
  22. package/dashboard/server.py +47 -45
  23. package/docs/AGENT-CHANGE-RECEIPT.md +2 -2
  24. package/docs/ARCHITECTURE.md +337 -0
  25. package/docs/BRANDING.md +124 -0
  26. package/docs/CLI-REFERENCE.md +11 -1
  27. package/docs/COMPONENTS.md +447 -0
  28. package/docs/DEPLOYMENT.md +9 -9
  29. package/docs/DOCKER.md +469 -0
  30. package/docs/INSTALLATION.md +67 -1045
  31. package/docs/KNOWN-ISSUES.md +11 -35
  32. package/docs/OTEL-COLLECTOR.md +24 -0
  33. package/docs/ROUTING-EVIDENCE.md +32 -0
  34. package/docs/TESTING.md +161 -0
  35. package/docs/air-gapped.md +1 -2
  36. package/docs/alternative-installations.md +14 -24
  37. package/docs/architecture/DECISIONS.md +333 -0
  38. package/docs/audit-logging.md +7 -7
  39. package/docs/authentication.md +3 -3
  40. package/docs/authorization.md +1 -1
  41. package/docs/certification/04-production-deployment/lab.md +6 -6
  42. package/docs/certification/04-production-deployment/lesson.md +4 -4
  43. package/docs/certification/README.md +1 -1
  44. package/docs/control-plane-container.md +2 -2
  45. package/docs/dev/real-run.md +34 -0
  46. package/docs/dev/release-checklist.md +2 -2
  47. package/docs/environment-variables.md +1 -0
  48. package/docs/exit-codes.md +3 -3
  49. package/docs/git-workflow.md +3 -3
  50. package/docs/metrics.md +37 -55
  51. package/docs/network-security.md +1 -1
  52. package/docs/siem-integration.md +5 -5
  53. package/docs/spec-first-intent.md +28 -0
  54. package/docs/v10/CLI-MODERN.md +7 -3
  55. package/docs/v10/DECISIONS.md +59 -0
  56. package/docs/v10/DEPS.md +22 -22
  57. package/docs/v10/ENGINE.md +1 -1
  58. package/docs/v10/FAILURE-CLASSES.md +212 -1
  59. package/docs/v10/FOUNDER-QUEUE.md +1 -0
  60. package/docs/v10/GUARDS.md +31 -0
  61. package/docs/v10/GUIDE.md +7 -5
  62. package/docs/v10/LEGACY-REMOVAL.md +4 -6
  63. package/docs/v10/METRICS.md +14 -2
  64. package/docs/v10/MODERNIZE.md +1 -1
  65. package/docs/v10/OPERATING-MODEL.md +4 -3
  66. package/docs/v10/PROGRESS.md +35 -0
  67. package/docs/v11/COST-HALF.md +352 -0
  68. package/docs/v11/INTOTO-AGENT-CHANGE-PREDICATE.md +77 -0
  69. package/docs/v11/MARKET-SLICES.md +315 -0
  70. package/docs/v11/MCP-2026-07-28.md +55 -0
  71. package/docs/v11/REGISTRIES.md +730 -0
  72. package/docs/v11/VERIFY-PR-SANDBOX.md +41 -0
  73. package/loki-ts/data/model-pricing.json +52 -24
  74. package/loki-ts/dist/loki.js +1185 -945
  75. package/mcp/__init__.py +1 -1
  76. package/mcp/v10_tools.py +29 -0
  77. package/package.json +9 -11
  78. package/packages/control-plane/dist/ask-tools-server.js +8 -2
  79. package/packages/control-plane/dist/server.js +15832 -12361
  80. package/packages/control-plane/drizzle/0006_token_sessions.sql +1 -0
  81. package/packages/control-plane/drizzle/meta/0006_snapshot.json +807 -0
  82. package/packages/control-plane/drizzle/meta/_journal.json +7 -0
  83. package/packages/control-plane/src/db/schema.ts +1 -0
  84. package/packages/control-plane/src/server/routes/cost.ts +4 -3
  85. package/packages/control-plane/src/server/runs.ts +3 -3
  86. package/packages/control-plane/ui/dist/assets/index-DbLzr87u.js +190 -0
  87. package/packages/control-plane/ui/dist/index.html +1 -1
  88. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  89. package/providers/opencode.sh +2 -3
  90. package/src/observability/genai-spans.js +104 -0
  91. package/src/observability/otel-bridge.js +49 -1
  92. package/src/observability/otel.js +2 -2
  93. package/src/protocols/mcp-client.js +6 -2
  94. package/src/protocols/mcp-server.js +191 -6
  95. package/src/protocols/transport/sse.js +23 -2
  96. package/tools/audit-docs.py +1 -1
  97. package/web-app/dist/assets/{AdminPage-D_e45uTw.js → AdminPage-DuRQZsF9.js} +1 -1
  98. package/web-app/dist/assets/{Avatar-T3nIpoaf.js → Avatar-7GtOQvsO.js} +1 -1
  99. package/web-app/dist/assets/{Badge-BKqb59pP.js → Badge-CYgTnIxj.js} +1 -1
  100. package/web-app/dist/assets/{Button-DjVlkh8_.js → Button-rYSyIu7X.js} +1 -1
  101. package/web-app/dist/assets/{CockpitPage-DXJgLGmh.js → CockpitPage-9adANY4o.js} +1 -1
  102. package/web-app/dist/assets/{ComparePage-BRP_eVc_.js → ComparePage-DEG2oA-R.js} +1 -1
  103. package/web-app/dist/assets/{ErrorBoundary-CLjpGLjC.js → ErrorBoundary-CwtvY4xs.js} +1 -1
  104. package/web-app/dist/assets/{EvidenceReceiptPanel-DX-vb4Xy.js → EvidenceReceiptPanel-DTT73pPB.js} +1 -1
  105. package/web-app/dist/assets/{GitHubIssuesPanel-214HVHtX.js → GitHubIssuesPanel-CpWZLz2x.js} +1 -1
  106. package/web-app/dist/assets/{GitHubPRsPanel-BEiZKc4t.js → GitHubPRsPanel-H293R7E2.js} +1 -1
  107. package/web-app/dist/assets/{HomePage-VvMHS5ga.js → HomePage-B11Imp9k.js} +2 -2
  108. package/web-app/dist/assets/{LoginPage-5WD-v7n3.js → LoginPage-BZBgx5Jr.js} +1 -1
  109. package/web-app/dist/assets/{MagicPage-DUQT_Jye.js → MagicPage-B27S4_X8.js} +1 -1
  110. package/web-app/dist/assets/{MetricsPage-lga-z79v.js → MetricsPage-CfbJWNDG.js} +1 -1
  111. package/web-app/dist/assets/{NotFoundPage-CGhBX3G1.js → NotFoundPage-Tp_4zMSm.js} +1 -1
  112. package/web-app/dist/assets/{ProjectPage-CdzF2GzZ.js → ProjectPage-CM4fgMsV.js} +3 -3
  113. package/web-app/dist/assets/{ProjectsPage-DRG64N8s.js → ProjectsPage-DP2Fvsrd.js} +1 -1
  114. package/web-app/dist/assets/{SettingsPage-5fzW9Frb.js → SettingsPage-C4G9-EAy.js} +1 -1
  115. package/web-app/dist/assets/{ShowcasePage-DrTdxO4y.js → ShowcasePage-Dj-n4dwu.js} +1 -1
  116. package/web-app/dist/assets/{SystemSettingsPage-C9Mqs6Rd.js → SystemSettingsPage-BqMLpuGt.js} +1 -1
  117. package/web-app/dist/assets/{TeamsPage-CUGPdSWo.js → TeamsPage-mIH8H96m.js} +1 -1
  118. package/web-app/dist/assets/{TemplatesPage-CNraDY0F.js → TemplatesPage-BagW-v4n.js} +1 -1
  119. package/web-app/dist/assets/{TerminalOutput-BIu_6Pea.js → TerminalOutput-CTQRHhnK.js} +1 -1
  120. package/web-app/dist/assets/{activity-Bk-kgqaf.js → activity-DNQiBDDL.js} +1 -1
  121. package/web-app/dist/assets/{bell-BXmUdmo8.js → bell-Coiwdad1.js} +1 -1
  122. package/web-app/dist/assets/{bot-CiuzXxUR.js → bot-Cou-rTgR.js} +1 -1
  123. package/web-app/dist/assets/{check-BEzjXppd.js → check-CsF-XtQp.js} +1 -1
  124. package/web-app/dist/assets/{chevron-left-AYWCXHf8.js → chevron-left-BJiy55Ht.js} +1 -1
  125. package/web-app/dist/assets/{circle-alert-BNg2uSRq.js → circle-alert-D6-pQQWq.js} +1 -1
  126. package/web-app/dist/assets/{clock-DTj0kkGT.js → clock-BOGqwgt9.js} +1 -1
  127. package/web-app/dist/assets/{cloud-x4nTDBLT.js → cloud-DsxhTtf5.js} +1 -1
  128. package/web-app/dist/assets/{code-xml-BVh_MLrk.js → code-xml-CxJDHUlE.js} +1 -1
  129. package/web-app/dist/assets/{database-DdfBaowG.js → database-BJePscl_.js} +1 -1
  130. package/web-app/dist/assets/{dollar-sign-XuYFmAOY.js → dollar-sign-6qWGAkZo.js} +1 -1
  131. package/web-app/dist/assets/{file-code-corner-D4cRnmeL.js → file-code-corner-DcOtYeDb.js} +1 -1
  132. package/web-app/dist/assets/{file-plus-CyoVlHc_.js → file-plus-WuRyLFo0.js} +1 -1
  133. package/web-app/dist/assets/{globe-Y6IK2RPW.js → globe-r-xCP4DE.js} +1 -1
  134. package/web-app/dist/assets/{hammer-BKzr9VZI.js → hammer-DTt0SsCB.js} +1 -1
  135. package/web-app/dist/assets/{index-B20cSx5G.js → index-BkbXyH8y.js} +3 -3
  136. package/web-app/dist/assets/{layers-DebNOhGS.js → layers-BvZhvSMY.js} +1 -1
  137. package/web-app/dist/assets/{loader-circle-DyGbrEgd.js → loader-circle-3gosTei9.js} +1 -1
  138. package/web-app/dist/assets/{lock-BKPpyt20.js → lock-CZZMxP0U.js} +1 -1
  139. package/web-app/dist/assets/{package-egF5Wi4y.js → package-C5A8CkJr.js} +1 -1
  140. package/web-app/dist/assets/{plus-OiEgKIc-.js → plus-Btv7tTIF.js} +1 -1
  141. package/web-app/dist/assets/{refresh-cw-CzKvrONq.js → refresh-cw-DsWLXgs_.js} +1 -1
  142. package/web-app/dist/assets/{rotate-ccw-Bu2mII0p.js → rotate-ccw-DOVDjway.js} +1 -1
  143. package/web-app/dist/assets/{scroll-text-CSkiyax8.js → scroll-text-smySzlrX.js} +1 -1
  144. package/web-app/dist/assets/{server-DlPthJFw.js → server-b5PHsqAU.js} +1 -1
  145. package/web-app/dist/assets/{shield-alert-CbpHWQQX.js → shield-alert-BD7FDlh-.js} +1 -1
  146. package/web-app/dist/assets/{thumbs-up-DgGpZe-Q.js → thumbs-up-CAsFzbyE.js} +1 -1
  147. package/web-app/dist/assets/{trash-2-BV3GlCB-.js → trash-2-BJ35qHgl.js} +1 -1
  148. package/web-app/dist/assets/{trending-down-Y4TJtXhD.js → trending-down-Ozrd26cZ.js} +1 -1
  149. package/web-app/dist/assets/{trending-up-DsDNoHZY.js → trending-up-BhnMcM32.js} +1 -1
  150. package/web-app/dist/assets/{upload-gkThrc_I.js → upload-JVHfdwoA.js} +1 -1
  151. package/web-app/dist/assets/{usePolling-jpNSeNAe.js → usePolling-CTzbDV-e.js} +1 -1
  152. package/web-app/dist/assets/{user-3Zez1WOK.js → user-Bks3-GYv.js} +1 -1
  153. package/web-app/dist/index.html +1 -1
  154. package/docs/ARCHITECTURE-OVERVIEW.md +0 -209
  155. package/docs/AUTONOMI-ECOSYSTEM.md +0 -107
  156. package/docs/COCKPIT-SPEC.md +0 -72
  157. package/docs/COCKPIT-UX-MANDATE.md +0 -53
  158. package/docs/COMPETITIVE-ANALYSIS.md +0 -303
  159. package/docs/COMPETITIVE-NEXT-10.md +0 -316
  160. package/docs/COMPETITIVE-RALPH-ZEROSHOT-2026-07-08.md +0 -81
  161. package/docs/DASHBOARD-9.12-EVIDENCE.md +0 -97
  162. package/docs/DASHBOARD-ARCHITECTURE.md +0 -425
  163. package/docs/DASHBOARD_V2_CHECKLIST.md +0 -243
  164. package/docs/DEMOS.md +0 -63
  165. package/docs/ENTERPRISE-IDENTITY-ROADMAP.md +0 -206
  166. package/docs/EVIDENCE-RECEIPT-BUILD-APPLICABILITY.md +0 -79
  167. package/docs/FEAT-PRDREUSE-DOCKER-PLAN.md +0 -144
  168. package/docs/GATE-FAILURE-TRIAGE.md +0 -254
  169. package/docs/HANDOFF-2026-08-03.md +0 -439
  170. package/docs/LOOP-CANDIDATE-PROPOSAL-v1.md +0 -167
  171. package/docs/LOOP-HARNESS-AUDIT.md +0 -684
  172. package/docs/MERGE-DEDUP-MAP.md +0 -420
  173. package/docs/MERGE-ROUTE-MAP.md +0 -139
  174. package/docs/MODEL-REGISTRY-PLAN.md +0 -155
  175. package/docs/OUTCOME-FRONTIER.md +0 -536
  176. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +0 -192
  177. package/docs/PLANS-INDEX.md +0 -32
  178. package/docs/PRD-REUSE-DONE-RECOGNITION-PLAN.md +0 -536
  179. package/docs/PROMPT-ABLATION-RESULT.md +0 -97
  180. package/docs/R4-TRUST-TRAJECTORY-DESIGN.md +0 -127
  181. package/docs/R5-AUTO-WIKI-DESIGN.md +0 -137
  182. package/docs/R6-ROLLBACK-CHECKPOINT-PLAN.md +0 -107
  183. package/docs/R7-ZERO-CONFIG-FIRST-RUN-PLAN.md +0 -137
  184. package/docs/R8-SHAREABLE-TEAM-ASSETS-PLAN.md +0 -129
  185. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +0 -113
  186. package/docs/RARV-C-100X-PLAN.md +0 -286
  187. package/docs/RARV-C-LOOP-EFFICIENCY-PLAN.md +0 -470
  188. package/docs/SHAREABLE-PROOF-PLAN.md +0 -194
  189. package/docs/SONNET5-DEFAULT-PLAN.md +0 -157
  190. package/docs/SPEED-AND-FIRST-PASS-PLAN.md +0 -281
  191. package/docs/STALE-STATE-AUDIT.md +0 -174
  192. package/docs/SYNERGY-TASKS.md +0 -143
  193. package/docs/TASKLIST-ACCURACY-PLAN.md +0 -355
  194. package/docs/TOP-100-BACKLOG.md +0 -159
  195. package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +0 -114
  196. package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +0 -45
  197. package/docs/V8-MAJOR-RELEASE-PLAN.md +0 -137
  198. package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +0 -82
  199. package/docs/V8-SDK-RESEARCH-RAW.md +0 -129
  200. package/docs/WELCOME-OPENER-PLAN.md +0 -106
  201. package/docs/adoption-baseline-2026-07-31.md +0 -84
  202. package/docs/architecture/bmad-integration-epic.md +0 -271
  203. package/docs/architecture/bmad-integration-review.md +0 -86
  204. package/docs/architecture/bmad-integration-validation.md +0 -249
  205. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +0 -61
  206. package/docs/auto-claude-comparison.md +0 -250
  207. package/docs/bug-fixes/agent-01-cli-fixes.md +0 -101
  208. package/docs/bug-fixes/agent-02-purplelab-fixes.md +0 -88
  209. package/docs/bug-fixes/agent-03-dashboard-fixes.md +0 -119
  210. package/docs/bug-fixes/agent-04-memory-fixes.md +0 -105
  211. package/docs/bug-fixes/agent-05-provider-fixes.md +0 -86
  212. package/docs/bug-fixes/agent-06-integration-fixes.md +0 -101
  213. package/docs/bug-fixes/agent-07-dash-run-fixes.md +0 -101
  214. package/docs/bug-fixes/agent-08-docker-fixes.md +0 -164
  215. package/docs/bug-fixes/agent-09-e2e-build-fixes.md +0 -69
  216. package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +0 -102
  217. package/docs/bug-fixes/agent-11-e2e-session-fixes.md +0 -70
  218. package/docs/bug-fixes/agent-12-scenario-fixes.md +0 -120
  219. package/docs/bug-fixes/agent-13-enterprise-fixes.md +0 -143
  220. package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +0 -88
  221. package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +0 -132
  222. package/docs/bug-fixes/agent-19-code-review.md +0 -316
  223. package/docs/bug-fixes/agent-20-architecture-review.md +0 -331
  224. package/docs/competitive/bolt-new-analysis.md +0 -579
  225. package/docs/competitive/emergence-others-analysis.md +0 -605
  226. package/docs/competitive/replit-lovable-analysis.md +0 -622
  227. package/docs/dashboard-guide.md +0 -487
  228. package/docs/enterprise/migration.md +0 -265
  229. package/docs/history/one-run-audit.md +0 -304
  230. package/docs/plans/FORGE-AUTONOMOUS-QUEUE.md +0 -312
  231. package/docs/plans/ULTRAPLAN-FORGE-BAAS.md +0 -612
  232. package/docs/plans/UT2-6-LSP-DIAGNOSTIC-BROADCAST.md +0 -394
  233. package/docs/prd-purple-lab-ide.md +0 -152
  234. package/docs/prd-purple-lab-platform-v2.md +0 -223
  235. package/docs/prd-purple-lab-platform.md +0 -319
  236. package/docs/retrospectives/v7.5.15-fleet-postmortem.md +0 -325
  237. package/docs/retrospectives/v7.5.15-honesty-audit.md +0 -136
  238. package/docs/retrospectives/v7.5.15-llm-failure-modes.md +0 -49
  239. package/docs/show-hn-post.md +0 -46
  240. package/docs/test-scenarios/enterprise-scenarios.md +0 -732
  241. package/docs/thick2thin.md +0 -173
  242. package/packages/control-plane/ui/dist/assets/index-DcBJXjCJ.js +0 -190
@@ -1,84 +0,0 @@
1
- # Adoption baseline, 2026-07-31
2
-
3
- The first numbers in this project taken from the registry rather than from
4
- intuition. Recorded so the next measurement has something to compare against.
5
-
6
- ## What we actually have
7
-
8
- **4,456 npm downloads in the last 7 days.** Daily:
9
-
10
- | Day | Downloads |
11
- |---|---|
12
- | 07-24 | 863 |
13
- | 07-25 | 1,160 |
14
- | 07-26 | 196 |
15
- | 07-27 | 94 |
16
- | 07-28 | 386 |
17
- | 07-29 | 494 |
18
- | 07-30 | 1,263 |
19
-
20
- Two things follow, and the second matters more than the first.
21
-
22
- **1. We have users.** Roughly 4.5k downloads a week is not a project nobody
23
- has heard of. Every strategy discussion in this repo has proceeded as though
24
- adoption were hypothetical. It is not.
25
-
26
- **2. The shape is release-driven, not organic.** The 13x swing between 07-27
27
- (94) and 07-30 (1,263) tracks publishing activity -- eight releases landed on
28
- 07-30 alone. A curve that rises when we publish and falls when we stop is
29
- mirrors and CI, not word of mouth. Organic growth would show a floor that
30
- rises over time; this shows a floor near 94.
31
-
32
- **Do not read 4,456 as 4,456 humans.** npm counts mirrors, CI, and Docker
33
- layer pulls. The honest statement is that the ceiling is real and the floor is
34
- what needs to move.
35
-
36
- ## Why the floor is the metric
37
-
38
- The founder's goal is word-of-mouth growth over two years. The number that
39
- measures it is the **trough**, not the peak: how many installs happen on a day
40
- we publish nothing. Today that is ~94.
41
-
42
- Peaks are bought with releases. Floors are earned by people telling other
43
- people. Every adoption item should be judged against whether it moves the
44
- floor.
45
-
46
- ## What we still cannot see, and what changed today
47
-
48
- Until v8.6.0 shipped this morning, we could see that a first run was ATTEMPTED
49
- and nothing about whether it succeeded. `first_run_blocked` (v8.6.0) now names
50
- the class of dependency that stops a first run -- enum-clamped, once per
51
- install, strict opt-in.
52
-
53
- That data does not exist yet: the release is hours old and the telemetry is
54
- off by default behind a second opt-in. It will accumulate slowly and from a
55
- minority of users, which is the correct trade for not exfiltrating anyone's
56
- environment.
57
-
58
- So the sequence is: floor today ~94/day -> ship things that plausibly move it
59
- -> watch the floor, not the peak.
60
-
61
- ## The three things measured this session that plausibly move it
62
-
63
- Ranked by how directly they affect someone's first ten minutes:
64
-
65
- 1. **43 of 112 commands were unreachable from `loki help`**, including
66
- `loki proof` -- the Evidence Receipt, the thing the product argues on. Fixed
67
- and gated. A user who cannot find the differentiator does not repeat it to
68
- anyone.
69
- 2. **A first-run dead end on hosts with no provider CLI.** One route named the
70
- blockers and pointed at `loki tour` (no provider, no key, no spend); the
71
- other said "some required prerequisites are missing" and stopped. That is
72
- the exact moment an evaluator decides whether to continue.
73
- 3. **`loki proof md`** puts the receipt in a form a person can paste into a PR
74
- or a Slack message. Competitors' verification output lives in their
75
- dashboard; a file is the only artifact that travels.
76
-
77
- None of these is proven to move the floor. They are the candidates with a
78
- plausible mechanism, and the floor is now being watched.
79
-
80
- ## Reproduce
81
-
82
- ```sh
83
- curl -s "https://api.npmjs.org/downloads/range/last-week/loki-mode"
84
- ```
@@ -1,271 +0,0 @@
1
- # BMAD Integration -- Epic and Story Breakdown
2
-
3
- **Date:** 2026-02-25
4
- **Scope:** Epic 1 only (P0 -- BMAD Artifact Pipeline)
5
- **Version Target:** v6.1.0
6
-
7
- Epics 2 (Engine Embedding) and 3 (Voice Agent Layer) are documented as future work
8
- but explicitly deferred pending P0 value validation.
9
-
10
- ---
11
-
12
- ## Epic 1: BMAD Artifact Pipeline (P0 -- Must Have)
13
-
14
- **Goal:** Enable Loki Mode to consume BMAD Method output artifacts as structured input,
15
- producing higher-quality analysis scores and richer execution context than freeform PRDs.
16
-
17
- **Success Metric:** `loki start --bmad-project <path>` discovers, parses, and loads BMAD
18
- artifacts with zero regression on existing non-BMAD workflows.
19
-
20
- ---
21
-
22
- ### Story 1.1: BMAD PRD Format Adapter
23
-
24
- **Size:** M
25
- **Dependencies:** None
26
- **Files to create:** `autonomy/bmad-adapter.py`
27
-
28
- **Description:**
29
- Create a standalone Python module (stdlib only) that discovers BMAD output artifacts,
30
- parses their YAML frontmatter, normalizes heading structure, extracts project classification
31
- metadata, and produces a normalized PRD document suitable for prd-analyzer.py.
32
-
33
- **Acceptance Criteria:**
34
-
35
- - **Given** a directory containing `_bmad-output/planning-artifacts/prd-*.md`
36
- **When** bmad-adapter.py is invoked with the project path
37
- **Then** it discovers the PRD file automatically
38
-
39
- - **Given** a BMAD PRD with YAML frontmatter (`stepsCompleted`, `inputDocuments`, `workflowType`)
40
- **When** the adapter parses it
41
- **Then** frontmatter is extracted as metadata and stripped from the document body
42
-
43
- - **Given** a BMAD PRD with sections like `## Executive Summary`, `## Project Classification`
44
- **When** the adapter normalizes headings
45
- **Then** sections are preserved as-is (no destructive remapping)
46
-
47
- - **Given** a BMAD project with `architecture.md` alongside the PRD
48
- **When** the adapter runs
49
- **Then** architecture content is appended as supplementary context
50
-
51
- - **Given** a BMAD project with `epics.md`
52
- **When** the adapter runs
53
- **Then** epic/story data is extracted into a structured task list (JSON)
54
-
55
- - **Given** a non-BMAD project directory (no `_bmad-output/`)
56
- **When** the adapter is invoked
57
- **Then** it exits with a clear error message and non-zero exit code
58
-
59
- - **Given** a BMAD project with incomplete workflow state (`stepsCompleted` missing entries)
60
- **When** the adapter runs
61
- **Then** it warns about incomplete artifacts but processes what exists
62
-
63
- ---
64
-
65
- ### Story 1.2: Enhanced PRD Analyzer for BMAD Documents
66
-
67
- **Size:** S
68
- **Dependencies:** Story 1.1 (adapter output format)
69
- **Files to modify:** `autonomy/prd-analyzer.py`
70
-
71
- **Description:**
72
- Add BMAD-specific heading patterns and content patterns to the existing dimension system.
73
- Add an optional `--architecture` flag to score an architecture document alongside the PRD.
74
- Maintain full backward compatibility with freeform PRDs.
75
-
76
- **Acceptance Criteria:**
77
-
78
- - **Given** a BMAD PRD with `## Executive Summary`
79
- **When** prd-analyzer.py scores it
80
- **Then** the section is recognized (new heading pattern in `feature_list` or new dimension)
81
-
82
- - **Given** a BMAD PRD with `## Functional Requirements` containing `FR1:` items
83
- **When** prd-analyzer.py scores it
84
- **Then** `feature_list` dimension scores HIGH
85
-
86
- - **Given** a BMAD PRD with `## Non-Functional Requirements` > `### Security`, `### Performance`
87
- **When** prd-analyzer.py scores it
88
- **Then** `security` and `deployment` dimensions score at least PARTIAL
89
-
90
- - **Given** the `--architecture path/to/architecture.md` flag
91
- **When** prd-analyzer.py runs
92
- **Then** tech_stack, data_model, and api_spec dimensions are also scored from architecture.md
93
-
94
- - **Given** a freeform PRD (no BMAD structure)
95
- **When** prd-analyzer.py scores it
96
- **Then** results are identical to the current version (zero regression)
97
-
98
- - **Given** a BMAD PRD and a freeform PRD of equivalent completeness
99
- **When** both are scored
100
- **Then** BMAD PRD scores equal or higher (structured methodology bonus not required but allowed)
101
-
102
- ---
103
-
104
- ### Story 1.3: `--bmad-project` CLI Flag
105
-
106
- **Size:** M
107
- **Dependencies:** Story 1.1 (adapter), Story 1.2 (enhanced analyzer)
108
- **Files to modify:** `autonomy/loki`, `autonomy/run.sh`
109
-
110
- **Description:**
111
- Add a `--bmad-project <path>` flag to `loki start`. When provided, the CLI runs
112
- bmad-adapter.py to discover and parse BMAD artifacts, then feeds the normalized output
113
- into the standard PRD analysis pipeline. BMAD context (architecture decisions, epic list)
114
- is injected into build_prompt() as a supplementary context block.
115
-
116
- **Acceptance Criteria:**
117
-
118
- - **Given** `loki start --bmad-project ./my-project`
119
- **When** `./my-project/_bmad-output/` exists with BMAD artifacts
120
- **Then** artifacts are discovered, parsed, and loaded into `.loki/` state
121
-
122
- - **Given** `loki start --bmad-project ./my-project`
123
- **When** `./my-project/_bmad-output/` does NOT exist
124
- **Then** CLI prints error and exits with non-zero code
125
-
126
- - **Given** BMAD artifacts are loaded
127
- **When** build_prompt() constructs the iteration prompt
128
- **Then** a `BMAD_CONTEXT` block is injected with architecture summary and active epic
129
-
130
- - **Given** BMAD epics are loaded
131
- **When** the task queue is populated
132
- **Then** each BMAD story becomes a `.loki/queue/` task with priority and acceptance criteria
133
-
134
- - **Given** `loki start ./prd.md` (no --bmad-project flag)
135
- **When** the CLI runs
136
- **Then** behavior is identical to current version (zero regression)
137
-
138
- - **Given** `loki start --bmad-project ./my-project --prd ./override.md`
139
- **When** both flags are provided
140
- **Then** the explicit PRD takes precedence; BMAD artifacts provide supplementary context only
141
-
142
- - **Given** the `--bmad-project` flag
143
- **When** `loki help start` is run
144
- **Then** the flag appears in help text with usage description
145
-
146
- ---
147
-
148
- ### Story 1.4: BMAD Artifact Chain Validator
149
-
150
- **Size:** S
151
- **Dependencies:** Story 1.1 (adapter)
152
- **Files to create:** Validation logic within `autonomy/bmad-adapter.py`
153
-
154
- **Description:**
155
- Validate that BMAD artifacts form a consistent chain: product-brief references are
156
- reflected in PRD, PRD requirements trace to architecture decisions, architecture maps
157
- to epics. Report consistency gaps as warnings (not blockers).
158
-
159
- **Acceptance Criteria:**
160
-
161
- - **Given** a BMAD project with product-brief, PRD, architecture, and epics
162
- **When** the validator runs
163
- **Then** it checks that PRD references product-brief themes
164
-
165
- - **Given** a BMAD PRD with 20 Functional Requirements and epics.md
166
- **When** the validator runs
167
- **Then** it reports how many FRs are covered by at least one epic story
168
-
169
- - **Given** a BMAD project missing architecture.md
170
- **When** the validator runs
171
- **Then** it warns about the missing artifact but does not block processing
172
-
173
- - **Given** an inconsistency (FR in PRD with no matching story in epics)
174
- **When** the validator runs
175
- **Then** the gap is reported as a warning in the adapter output
176
-
177
- ---
178
-
179
- ### Story 1.5: BMAD Integration Tests
180
-
181
- **Size:** M
182
- **Dependencies:** Stories 1.1-1.4
183
- **Files to create:** `tests/test-bmad-integration.sh`, `tests/fixtures/bmad/`
184
-
185
- **Description:**
186
- Comprehensive test suite covering BMAD adapter parsing, analyzer scoring, CLI flag
187
- behavior, artifact chain validation, and backward compatibility. Test fixtures created
188
- from BMAD's own templates populated with realistic data.
189
-
190
- **Acceptance Criteria:**
191
-
192
- - **Given** test fixtures in `tests/fixtures/bmad/` with realistic BMAD output
193
- **When** `bash tests/test-bmad-integration.sh` runs
194
- **Then** all tests pass with zero failures
195
-
196
- - **Given** a fixture with a well-formed BMAD PRD
197
- **When** the adapter and analyzer are run on it
198
- **Then** quality score is >= 7.0/10
199
-
200
- - **Given** a fixture with a freeform PRD (non-BMAD)
201
- **When** the analyzer scores it before and after the Story 1.2 changes
202
- **Then** scores are identical (backward compatibility)
203
-
204
- - **Given** a fixture with malformed BMAD artifacts (missing frontmatter, partial steps)
205
- **When** the adapter processes it
206
- **Then** it handles gracefully with warnings, no crashes
207
-
208
- - **Given** a fixture with incomplete artifact chain (PRD but no architecture)
209
- **When** the adapter and validator run
210
- **Then** processing succeeds with chain-gap warnings
211
-
212
- - **Given** the `--bmad-project` CLI flag
213
- **When** tested against fixtures
214
- **Then** discovery, loading, and prompt injection all work correctly
215
-
216
- - **Given** the test suite
217
- **When** run after any code change
218
- **Then** execution completes in under 30 seconds
219
-
220
- ---
221
-
222
- ## Epic 2: BMAD Engine Embedding (P1 -- Deferred)
223
-
224
- **Goal:** Programmatically execute BMAD step-file workflows within Loki Mode, enabling
225
- interactive requirements elicitation without requiring a separate BMAD-aware LLM session.
226
-
227
- **Status:** Deferred. Requires P0 success validation first.
228
-
229
- ### Planned Stories (not detailed)
230
-
231
- - Story 2.1: BMAD agent YAML parser
232
- - Story 2.2: Step-file processor (execute BMAD workflows programmatically)
233
- - Story 2.3: Session state manager (track step progress, partial artifacts)
234
- - Story 2.4: Dashboard "Elicitation" panel
235
- - Story 2.5: Party Mode adapter (multi-agent collaboration)
236
-
237
- ---
238
-
239
- ## Epic 3: Voice Agent Layer (P2 -- Deferred)
240
-
241
- **Goal:** Transform voice.sh from simple transcription to a structured dialogue system
242
- that can facilitate BMAD requirements elicitation conversations.
243
-
244
- **Status:** Deferred. Highest risk. Requires both P0 and P1 success validation.
245
-
246
- ### Planned Stories (not detailed)
247
-
248
- - Story 3.1: Structured dialogue manager
249
- - Story 3.2: BMAD step-to-voice mapper
250
- - Story 3.3: Technical term correction loop
251
- - Story 3.4: Voice session persistence
252
- - Story 3.5: Dual-mode interface (voice for elicitation, visual for review)
253
-
254
- ---
255
-
256
- ## Dependency Graph
257
-
258
- ```
259
- Story 1.1 (Adapter) -----> Story 1.2 (Analyzer Enhancement)
260
- | |
261
- | v
262
- +---> Story 1.4 (Validator) ---> Story 1.3 (CLI Flag)
263
- |
264
- v
265
- Story 1.5 (Tests)
266
- ```
267
-
268
- Stories 1.1 and 1.2 can be developed in parallel.
269
- Story 1.3 depends on both 1.1 and 1.2.
270
- Story 1.4 is part of 1.1 but can be developed in parallel.
271
- Story 1.5 depends on all other stories but fixture creation can start immediately.
@@ -1,86 +0,0 @@
1
- # BMAD Integration Adversarial Review
2
-
3
- **Date:** 2026-02-25
4
- **Methodology:** BMAD-style adversarial review (zero findings = failure, re-analyze)
5
- **Reviewers:** 3 blind Opus agents + Devil's Advocate pass
6
-
7
- ## Review Process
8
-
9
- Three independent reviewers analyzed the full BMAD integration diff across 5 files.
10
- Combined: 48 unique findings (2 CRITICAL, 12 HIGH, 21 MEDIUM, 13 LOW).
11
-
12
- After triage: 1 CRITICAL and 5 HIGH findings were fixed before this report.
13
-
14
- ## Findings Fixed (Pre-Merge)
15
-
16
- | # | Severity | File | Issue | Fix Applied |
17
- |---|----------|------|-------|-------------|
18
- | 1 | CRITICAL | bmad-adapter.py:136-140 | Path traversal via config.json outputDir | Added resolve() + project root boundary check |
19
- | 2 | HIGH | bmad-adapter.py:266,294,419 | Missing errors="replace" on read_text | Replaced all read_text with _safe_read() helper (size limit + encoding safety) |
20
- | 3 | HIGH | bmad-adapter.py:576-607 | Non-atomic file writes | Added _write_atomic() using tempfile + os.replace pattern |
21
- | 4 | HIGH | run.sh:7042-7050 | Unbounded BMAD content in prompt | Added head -c size limits (16K arch, 32K tasks, 8K validation) |
22
- | 5 | HIGH | run.sh:7066-7074 | BMAD context before human_directive in prompt | Moved bmad_context after human_directive and queue_tasks |
23
- | 6 | HIGH | test-bmad-integration.sh:37,126,163,248 | Trap quoting + inline Python injection | Fixed trap quoting, replaced open('$var') with sys.argv[1] |
24
-
25
- ## Findings Accepted (Known Limitations)
26
-
27
- | # | Severity | Issue | Rationale for Accepting |
28
- |---|----------|-------|------------------------|
29
- | 1 | MEDIUM | Regex YAML parser does not handle block-style lists | BMAD fixtures use flow-style. Block-style support is a future enhancement. Documented in code. |
30
- | 2 | MEDIUM | populate_bmad_queue() has no standalone test | Function tested indirectly through full integration. Standalone test is a future improvement. |
31
- | 3 | MEDIUM | prd-analyzer scope estimation includes architecture lines | Conservative choice -- slightly inflated feature count is better than missing features. |
32
- | 4 | MEDIUM | BMAD_PROJECT_PATH exported but unused by run.sh | Intentionally kept for future provider scripts. Added comment. |
33
- | 5 | LOW | Error messages show full filesystem paths | Acceptable for CLI tool aimed at developers. Not a production web service. |
34
- | 6 | LOW | mkdir uses default umask | Standard Python behavior, consistent with rest of codebase. |
35
-
36
- ## Adversarial Scenarios Tested
37
-
38
- ### What happens when BMAD output format changes in V7?
39
-
40
- The adapter uses loose pattern matching (regex on headings, not exact schema validation).
41
- Section headings like "## Functional Requirements" and "FR1:" patterns are generic enough
42
- to survive minor format changes. The frontmatter parser handles unknown keys gracefully.
43
- **Risk: LOW.** The adapter degrades gracefully -- fewer dimensions matched means lower
44
- score, not a crash.
45
-
46
- ### What happens with malformed BMAD artifacts?
47
-
48
- Tested with incomplete fixture (partial workflow state). Adapter:
49
- - Reports workflow completion percentage
50
- - Warns about missing artifacts
51
- - Processes what exists without crashing
52
- - Uses errors="replace" for encoding safety
53
- - Has 10MB file size limit
54
-
55
- **Risk: LOW.** Graceful degradation verified.
56
-
57
- ### What happens when _bmad-output/ contains partial workflow state?
58
-
59
- Tested with `stepsCompleted: [init, discovery, vision]` (30% complete).
60
- Adapter reports completion percentage and warns. Does not block processing.
61
- **Risk: LOW.** User gets informed about incomplete state.
62
-
63
- ### What happens if someone passes --bmad-project to a non-BMAD project?
64
-
65
- Clear error message and non-zero exit code:
66
- ```
67
- ERROR: BMAD output directory not found: _bmad-output/planning-artifacts
68
- This does not appear to be a BMAD project.
69
- ```
70
- **Risk: NONE.** Clean failure.
71
-
72
- ### What about backward compatibility for non-BMAD projects?
73
-
74
- All BMAD code paths are guarded:
75
- - CLI: only activated by explicit --bmad-project flag
76
- - run.sh: checks for .loki/bmad-metadata.json existence
77
- - prd-analyzer.py: new patterns only ADD to existing ones, never replace
78
-
79
- Freeform PRD test confirms identical scoring (5.0/10) before and after changes.
80
- **Risk: NONE.** Verified by test.
81
-
82
- ## Recommendation
83
-
84
- **PASS.** All CRITICAL and HIGH findings fixed. Remaining MEDIUM/LOW findings are
85
- acceptable known limitations with documented rationale. Backward compatibility verified.
86
- Integration is clean, additive, and well-guarded.
@@ -1,249 +0,0 @@
1
- # BMAD Integration Validation Report
2
-
3
- **Date:** 2026-02-25
4
- **Validator:** Automated analysis against Loki Mode v6.0.0 codebase
5
- **BMAD Version:** Latest main (cloned 2026-02-25)
6
-
7
- ## Decision: GO (Phase 0 / Epic 1 only)
8
-
9
- Phase 0 (BMAD Artifact Pipeline) is low-risk, additive, and achievable with the current
10
- codebase. Phases 1-2 are deferred pending P0 value validation.
11
-
12
- ---
13
-
14
- ## 1. Compatibility Matrix
15
-
16
- | Integration Point | Status | Notes |
17
- |---|---|---|
18
- | PRD format parsing | Compatible (minor gaps) | 7/9 analyzer dimensions match BMAD headings directly |
19
- | Artifact chain discovery | New capability needed | Adapter must find `_bmad-output/planning-artifacts/` |
20
- | Agent personas | Complementary | BMAD pre-dev agents + Loki execution agents = full coverage |
21
- | Voice capabilities | Insufficient for P2 | voice.sh only does 4-section dictation, not structured dialogue |
22
- | Context budget | Safe | ~8-15K tokens per iteration (step files load one-at-a-time) |
23
- | License | MIT -- fully compatible | No restrictions on integration or redistribution |
24
- | Event bus integration | Ready | `.loki/events/pending/` accepts BMAD artifact events |
25
- | Memory system | Ready | BMAD artifacts can be stored as episodic memory |
26
- | CLI integration | Straightforward | `--bmad-project` flag pattern matches existing CLI architecture |
27
- | Dashboard | Deferred (P1) | Would need new "Elicitation" panel |
28
-
29
- ## 2. PRD Format Gap Analysis
30
-
31
- ### BMAD PRD Section Headings vs Loki Analyzer Dimensions
32
-
33
- | BMAD PRD Section | Loki Dimension | Match Type |
34
- |---|---|---|
35
- | `## Executive Summary` | -- | NO MATCH (no heading pattern covers "executive summary") |
36
- | `## Project Classification` | -- | NO MATCH |
37
- | `## Success Criteria` | `acceptance_criteria` | PARTIAL (heading pattern matches "criteria" keyword) |
38
- | `## Product Scope` | `feature_list` | MATCH (heading pattern matches "scope") |
39
- | `## User Journeys` | `user_stories` | MATCH (heading pattern matches "user.*journey") |
40
- | `## Domain-Specific Requirements` | -- | NO MATCH |
41
- | `## Innovation & Novel Patterns` | -- | NO MATCH |
42
- | `## [ProjectType] Specific Requirements` | `feature_list` | PARTIAL (matches "requirement") |
43
- | `## Project Scoping & Phased Development` | `feature_list` | PARTIAL (matches "scope") |
44
- | `## Functional Requirements` | `feature_list` | MATCH (matches "functional" and "requirement") |
45
- | `## Non-Functional Requirements` | Multiple | MATCH (content patterns for security, deployment, error handling) |
46
-
47
- ### Content Pattern Matches
48
-
49
- | BMAD Content Pattern | Loki Content Pattern | Match? |
50
- |---|---|---|
51
- | `FR{N}: [Actor] can [capability]` | `user can/should/will` in `user_stories` | YES |
52
- | `Given/When/Then` (in epics) | `given.*when.*then` in `acceptance_criteria` | YES |
53
- | `As a {role}, I want {action}` (stories) | `as a \w+` in `user_stories` | YES |
54
- | Tech stack mentions in architecture.md | Tech keyword patterns in `tech_stack` | YES |
55
- | `### Performance`, `### Security` (NFRs) | Security/deployment heading patterns | YES |
56
-
57
- ### Gaps Requiring Adapter Work
58
-
59
- 1. **Executive Summary** -- BMAD's most prominent section has no matching Loki dimension.
60
- Adapter should map this to a "project_overview" meta-dimension.
61
-
62
- 2. **Project Classification** -- BMAD includes project type, domain, complexity.
63
- No Loki equivalent. Adapter should extract and pass as metadata.
64
-
65
- 3. **Domain-Specific Requirements** -- Healthcare, fintech, govtech compliance sections.
66
- No Loki dimension covers domain compliance. Consider adding as optional dimension.
67
-
68
- 4. **Innovation & Novel Patterns** -- BMAD-specific section.
69
- Not needed for scoring; pass through as supplementary context.
70
-
71
- 5. **Frontmatter parsing** -- BMAD documents have YAML frontmatter with `stepsCompleted`,
72
- `inputDocuments`, `workflowType`. Loki's prd-analyzer.py ignores frontmatter entirely.
73
- Adapter must strip frontmatter before passing to analyzer OR extend analyzer.
74
-
75
- ### Scoring Impact
76
-
77
- A well-formed BMAD PRD would score approximately **7.5-8.5/10** on the current analyzer
78
- without any changes:
79
- - `feature_list`: HIGH (## Functional Requirements + bullet lists)
80
- - `user_stories`: HIGH (## User Journeys + "As a..." stories in epics)
81
- - `acceptance_criteria`: HIGH (Given/When/Then in epics)
82
- - `tech_stack`: PARTIAL-HIGH (architecture.md has tech details, PRD may not)
83
- - `security`: PARTIAL (## Non-Functional Requirements > ### Security)
84
- - `deployment`: PARTIAL (may be in architecture.md, not PRD)
85
- - `data_model`: NONE-PARTIAL (usually in architecture.md, not PRD)
86
- - `api_spec`: NONE-PARTIAL (usually in architecture.md, not PRD)
87
- - `error_handling`: PARTIAL (## Non-Functional Requirements may cover this)
88
-
89
- With an adapter that also feeds architecture.md into the analyzer, score would be **9-10/10**.
90
-
91
- ## 3. Agent Overlap Analysis
92
-
93
- ### BMAD Agents vs Loki Agent Types
94
-
95
- | BMAD Agent | Role | Loki Equivalent(s) | Relationship |
96
- |---|---|---|---|
97
- | Mary (Analyst) | Business analysis, research | `prod-pm` (partial) | Complementary -- BMAD analyst is pre-development |
98
- | John (PM) | PRD creation, validation | `prod-pm`, `orch-planner` | Overlapping -- Loki PM focuses on execution planning |
99
- | Winston (Architect) | Architecture design | `eng-infra`, `orch-planner` | Complementary -- BMAD architect is pre-code |
100
- | Sally (UX Designer) | UX specification | `prod-design` | Complementary -- BMAD UX is spec, Loki is implementation |
101
- | Amelia (Developer) | Code implementation | `eng-*` | Superseded -- Loki has specialized dev agents |
102
- | Bob (Scrum Master) | Sprint planning | `orch-coordinator` | Overlapping -- different abstraction level |
103
- | Quinn (QA) | E2E test generation | `eng-qa` | Overlapping -- both generate tests |
104
- | Barry (Quick Flow) | Solo rapid dev | No equivalent | Unique to BMAD |
105
-
106
- ### Assessment
107
-
108
- - **Zero conflict.** BMAD agents operate in the pre-development space (requirements, planning,
109
- architecture). Loki agents operate in the execution space (coding, testing, deploying).
110
- - **Clear handoff point:** BMAD produces artifacts (PRD, architecture, epics). Loki consumes
111
- them. The adapter bridges the format gap.
112
- - **Party Mode** (multi-agent collaboration) is a BMAD concept that could enrich Loki's
113
- council-based review in future phases.
114
-
115
- ## 4. Voice Compatibility Assessment
116
-
117
- ### Current Capabilities (voice.sh)
118
-
119
- | Capability | Status |
120
- |---|---|
121
- | STT (Speech-to-Text) | Whisper API, local Whisper, macOS dictation |
122
- | TTS (Text-to-Speech) | macOS `say`, Linux espeak/festival |
123
- | Audio recording | sox, ffmpeg, arecord |
124
- | Guided dictation | 4-section template only (name, overview, requirements, tech stack) |
125
- | Structured dialogue | NOT SUPPORTED |
126
- | Agent handoff | NOT SUPPORTED |
127
- | Session persistence | NOT SUPPORTED |
128
- | Technical term correction | NOT SUPPORTED |
129
-
130
- ### What BMAD Voice Integration (P2) Would Require
131
-
132
- | Requirement | Effort | Description |
133
- |---|---|---|
134
- | Step-file-to-question mapper | Large | Convert BMAD step instructions to conversational prompts |
135
- | Multi-turn dialogue manager | Large | Track conversation state, handle clarifications, backtracking |
136
- | Agent persona injection | Medium | Voice TTS uses agent voice characteristics |
137
- | Technical term correction loop | Medium | Confirm jargon transcription ("Did you say React or Preact?") |
138
- | Session persistence | Medium | Resume BMAD workflows across voice sessions |
139
- | Dual-mode interface | Large | Voice for elicitation, visual for review |
140
-
141
- ### Assessment
142
-
143
- Voice integration (P2) is the highest-risk phase. The current voice.sh is a thin wrapper
144
- around STT/TTS tools. Transforming it into a structured dialogue system requires:
145
- - New conversation state machine (not just record-transcribe-write)
146
- - BMAD step-file interpreter (convert markdown instructions to conversational flow)
147
- - Feedback loop for transcription accuracy (critical for technical terms)
148
-
149
- **Recommendation:** Defer P2 entirely. P0 (artifact pipeline) delivers value without voice.
150
- Voice integration can be revisited after P0 proves the BMAD artifact format is stable and useful.
151
-
152
- ## 5. Context Budget Analysis
153
-
154
- ### Per-Iteration Context Cost (P0 Only)
155
-
156
- | Component | Tokens | Source |
157
- |---|---|---|
158
- | Loki SKILL.md | ~2,750 | Always loaded |
159
- | RARV instructions | ~1,500 | build_prompt() |
160
- | SDLC phases + rules | ~1,000 | build_prompt() |
161
- | Memory context | ~2,000-5,000 | Memory retrieval |
162
- | PRD content | ~5,000-12,000 | BMAD PRD document |
163
- | PRD observations | ~500-1,000 | prd-analyzer output |
164
- | **BMAD adapter metadata** | **~500-1,000** | **Project classification, artifact chain info** |
165
- | **BMAD architecture summary** | **~2,000-4,000** | **Condensed architecture decisions** |
166
- | **BMAD epic summary** | **~1,000-3,000** | **Active epic/story context** |
167
- | Checklist status | ~500-1,000 | verification-results.json |
168
- | Queue tasks | ~500-2,000 | .loki/queue/ |
169
- | **TOTAL** | **~17,250-32,250** | **Well under 150K ceiling** |
170
-
171
- ### Verdict
172
-
173
- At worst case (~32K tokens), BMAD integration uses ~21% of a 150K context window.
174
- This leaves ample room for code context, tool outputs, and conversation history.
175
- No context pressure risk.
176
-
177
- ## 6. Risk Register
178
-
179
- | Risk | Severity | Likelihood | Mitigation |
180
- |---|---|---|---|
181
- | BMAD output format changes in future versions | Medium | Medium | Adapter uses loose pattern matching, not exact schema; version-pin BMAD reference |
182
- | Malformed BMAD artifacts (partial workflow state) | Low | Medium | Adapter validates artifact completeness; falls back to freeform PRD path |
183
- | BMAD `_bmad-output/` not found | Low | Low | Clear error message; `--bmad-project` flag is explicit, not auto-detected |
184
- | prd-analyzer regression on freeform PRDs | High | Low | Test suite includes both BMAD and freeform PRD fixtures; backward compatibility gate |
185
- | Context budget exceeded with very large BMAD PRDs | Low | Low | PRD content is truncated at 12K tokens; architecture summary is condensed |
186
- | BMAD trademark concerns | Low | Low | MIT license permits code use; trademark applies to branding, not API integration |
187
- | Scope creep into P1/P2 during P0 implementation | Medium | Medium | Strict phase gates; P1/P2 deferred until P0 ships and proves value |
188
-
189
- ## 7. Integration Architecture (P0)
190
-
191
- ```
192
- User's BMAD project
193
- _bmad-output/
194
- planning-artifacts/
195
- product-brief-*.md
196
- prd-*.md <-- Primary input
197
- architecture.md <-- Secondary input
198
- epics.md <-- Story/task source
199
- implementation-artifacts/
200
- sprint-status.yaml
201
- *.story.md
202
-
203
- |
204
- v
205
-
206
- autonomy/bmad-adapter.py
207
- - Discover _bmad-output/ structure
208
- - Parse BMAD frontmatter (stepsCompleted, workflowType)
209
- - Strip frontmatter, normalize headings
210
- - Extract project classification metadata
211
- - Feed normalized PRD to prd-analyzer.py
212
- - Map epics to .loki/queue/ task format
213
-
214
- |
215
- v
216
-
217
- autonomy/prd-analyzer.py (enhanced)
218
- - New heading patterns for BMAD sections
219
- - Architecture.md scoring support
220
- - BMAD quality bonus (structured methodology)
221
- - Backward-compatible with freeform PRDs
222
-
223
- |
224
- v
225
-
226
- autonomy/loki --bmad-project <path>
227
- - Discovery: find _bmad-output/ in project
228
- - Load: run bmad-adapter.py, then prd-analyzer.py
229
- - Inject: BMAD metadata into build_prompt()
230
- - Queue: BMAD epics/stories into .loki/queue/
231
-
232
- |
233
- v
234
-
235
- autonomy/run.sh (build_prompt)
236
- - BMAD context block injected alongside PRD
237
- - Architecture decisions as supplementary context
238
- - Epic/story tracking in checklist system
239
- ```
240
-
241
- ## 8. Recommendations
242
-
243
- 1. **Proceed with P0 (Epic 1) only.** BMAD Artifact Pipeline.
244
- 2. **Do not embed BMAD engine.** Read BMAD outputs, do not execute BMAD workflows.
245
- 3. **Do not implement voice integration.** Defer to separate initiative.
246
- 4. **Create adapter as standalone Python module.** `autonomy/bmad-adapter.py` -- stdlib only.
247
- 5. **Enhance prd-analyzer.py conservatively.** Add patterns, do not restructure.
248
- 6. **Test with real BMAD output fixtures.** Create test fixtures from BMAD's own templates.
249
- 7. **Gate P1 on P0 success metrics:** At least 5 real projects use `--bmad-project` flag.