loki-mode 7.45.1 → 7.47.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 (112) hide show
  1. package/README.md +16 -12
  2. package/SKILL.md +5 -5
  3. package/VERSION +1 -1
  4. package/autonomy/CONSTITUTION.md +9 -2
  5. package/autonomy/completion-council.sh +113 -0
  6. package/autonomy/lib/sentrux-gate.sh +1 -1
  7. package/autonomy/loki +2 -2
  8. package/autonomy/run.sh +445 -96
  9. package/autonomy/spec-interrogation.sh +549 -0
  10. package/dashboard/__init__.py +1 -1
  11. package/dashboard/auth.py +117 -2
  12. package/dashboard/server.py +9 -10
  13. package/docs/ACKNOWLEDGEMENTS.md +1 -1
  14. package/docs/COMPARISON.md +10 -10
  15. package/docs/COMPETITIVE-ANALYSIS.md +2 -2
  16. package/docs/INSTALLATION.md +2 -2
  17. package/docs/OPEN-CORE-BOUNDARY.md +6 -5
  18. package/docs/P0-SWEEP-PLAN.md +163 -0
  19. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +192 -0
  20. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +2 -2
  21. package/docs/architecture/STATE-MACHINES.md +18 -19
  22. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +1 -1
  23. package/docs/auto-claude-comparison.md +16 -13
  24. package/docs/certification/01-core-concepts/lesson.md +12 -11
  25. package/docs/certification/01-core-concepts/quiz.md +6 -6
  26. package/docs/certification/05-troubleshooting/lesson.md +23 -13
  27. package/docs/certification/05-troubleshooting/quiz.md +3 -3
  28. package/docs/certification/README.md +1 -1
  29. package/docs/certification/answer-key.md +2 -2
  30. package/docs/certification/certification-exam.md +9 -9
  31. package/docs/competitive/bolt-new-analysis.md +2 -2
  32. package/docs/competitive/emergence-others-analysis.md +14 -14
  33. package/docs/competitive/replit-lovable-analysis.md +7 -7
  34. package/docs/cursor-comparison.md +15 -12
  35. package/docs/dashboard-guide.md +9 -7
  36. package/docs/enterprise/security.md +43 -3
  37. package/docs/prd-purple-lab-platform-v2.md +1 -1
  38. package/docs/prd-purple-lab-platform.md +3 -3
  39. package/docs/show-hn-post.md +3 -3
  40. package/loki-ts/dist/loki.js +2 -2
  41. package/mcp/__init__.py +1 -1
  42. package/package.json +2 -2
  43. package/plugins/loki-mode/.claude-plugin/plugin.json +2 -2
  44. package/plugins/loki-mode/README.md +1 -1
  45. package/references/magic-rarv-integration.md +1 -1
  46. package/references/quality-control.md +5 -5
  47. package/references/sdlc-phases.md +1 -2
  48. package/skills/00-index.md +1 -1
  49. package/skills/artifacts.md +1 -1
  50. package/skills/healing.md +1 -1
  51. package/skills/magic-modules.md +3 -3
  52. package/skills/quality-gates.md +52 -39
  53. package/skills/testing.md +1 -1
  54. package/web-app/dist/assets/{AdminPage-CKUOsWZW.js → AdminPage-CcCJ0Sjt.js} +1 -1
  55. package/web-app/dist/assets/{Avatar-CL9Id9Hi.js → Avatar-DK8kmayw.js} +1 -1
  56. package/web-app/dist/assets/{Badge-B12zwlD7.js → Badge-4uAWnemi.js} +1 -1
  57. package/web-app/dist/assets/{Button-CFLVoduT.js → Button-BBMk33tk.js} +1 -1
  58. package/web-app/dist/assets/ComparePage-bt9rwvST.js +1 -0
  59. package/web-app/dist/assets/{GitHubIssuesPanel-CSitxtAX.js → GitHubIssuesPanel-WDbH47UM.js} +1 -1
  60. package/web-app/dist/assets/{GitHubPRsPanel-BIT06FRo.js → GitHubPRsPanel-C2CiYtTx.js} +1 -1
  61. package/web-app/dist/assets/{HomePage-pU_0fGny.js → HomePage-BQk-MUjn.js} +4 -4
  62. package/web-app/dist/assets/{LoginPage-DTZtt2Yb.js → LoginPage-DMOZVGGL.js} +1 -1
  63. package/web-app/dist/assets/{MagicPage-10zfra8o.js → MagicPage-Bzp2Nt1z.js} +1 -1
  64. package/web-app/dist/assets/{MetricsPage-C-wiKUkv.js → MetricsPage-C39JVdsw.js} +1 -1
  65. package/web-app/dist/assets/{NotFoundPage-BDkcmhYe.js → NotFoundPage-6vT_U9UL.js} +1 -1
  66. package/web-app/dist/assets/{ProjectPage-CiCavQ8n.js → ProjectPage-BfFcZp-E.js} +3 -3
  67. package/web-app/dist/assets/{ProjectsPage-BLCXQwwC.js → ProjectsPage-CPMBf8Wt.js} +1 -1
  68. package/web-app/dist/assets/{SettingsPage-PkxtaMyg.js → SettingsPage-BnNN6ETl.js} +1 -1
  69. package/web-app/dist/assets/{ShowcasePage-iECp8Tha.js → ShowcasePage-WDrMf-cx.js} +1 -1
  70. package/web-app/dist/assets/{SystemSettingsPage-DS6Anno1.js → SystemSettingsPage-DX4jb2e8.js} +1 -1
  71. package/web-app/dist/assets/{TeamsPage-ls6h6bNL.js → TeamsPage-BCfqcXzu.js} +1 -1
  72. package/web-app/dist/assets/{TemplatesPage-Bk0QzlPt.js → TemplatesPage-CZvmimDj.js} +1 -1
  73. package/web-app/dist/assets/{TerminalOutput-4-1hWCtZ.js → TerminalOutput-BlRqFwWV.js} +1 -1
  74. package/web-app/dist/assets/{activity-DH3ih2nS.js → activity-CacZsUyr.js} +1 -1
  75. package/web-app/dist/assets/{bell-Gn17S6uv.js → bell-DK2qtHnk.js} +1 -1
  76. package/web-app/dist/assets/{bot-Cbycc3VE.js → bot-CkcUtHad.js} +1 -1
  77. package/web-app/dist/assets/{check-nIAqa-kf.js → check-CbCPjX3M.js} +1 -1
  78. package/web-app/dist/assets/{chevron-left-D2jcWDll.js → chevron-left-5NUKWw3i.js} +1 -1
  79. package/web-app/dist/assets/{circle-alert-CpL4Bhvt.js → circle-alert-S7uFoxC2.js} +1 -1
  80. package/web-app/dist/assets/{clock-IW4Wq86N.js → clock-CaQRrIrs.js} +1 -1
  81. package/web-app/dist/assets/{cloud-Cn8nNuH2.js → cloud-DBAX6c0r.js} +1 -1
  82. package/web-app/dist/assets/{code-xml-BiJBteXf.js → code-xml-De5-EXv3.js} +1 -1
  83. package/web-app/dist/assets/{copy-CnqkyNsi.js → copy-CUkT6k1v.js} +1 -1
  84. package/web-app/dist/assets/{database-CKSReqa5.js → database-BAWf1Gwt.js} +1 -1
  85. package/web-app/dist/assets/{dollar-sign-CDzDY64R.js → dollar-sign-Ji8zk86R.js} +1 -1
  86. package/web-app/dist/assets/{file-code-corner-Box4IwG1.js → file-code-corner-ChtXoBwS.js} +1 -1
  87. package/web-app/dist/assets/{file-plus-DpGqlXF8.js → file-plus-bFa37P76.js} +1 -1
  88. package/web-app/dist/assets/{folder-open-B57dAoBv.js → folder-open-DhXpXscO.js} +1 -1
  89. package/web-app/dist/assets/{git-commit-horizontal-BVbucmO5.js → git-commit-horizontal-DVPeDQ3j.js} +1 -1
  90. package/web-app/dist/assets/{globe-BkOnKl4x.js → globe-BPZgPeeu.js} +1 -1
  91. package/web-app/dist/assets/{hammer-DRbIQ4QU.js → hammer-jLCaujYH.js} +1 -1
  92. package/web-app/dist/assets/{index-CM_b_EhP.js → index-B-0iHBPO.js} +2 -2
  93. package/web-app/dist/assets/{layers-B78BiFiU.js → layers-B1vsrsFW.js} +1 -1
  94. package/web-app/dist/assets/{lightbulb-B-Itbm9g.js → lightbulb-C-uLoq9Y.js} +1 -1
  95. package/web-app/dist/assets/{loader-circle-Oq6NQhW2.js → loader-circle-JTfD-ZuM.js} +1 -1
  96. package/web-app/dist/assets/{lock-DbJ9zxbw.js → lock-G9rxD4gZ.js} +1 -1
  97. package/web-app/dist/assets/{mail-CzMRod6m.js → mail-BJ0PTN_V.js} +1 -1
  98. package/web-app/dist/assets/{package-WZ5osvej.js → package-CXClfLOO.js} +1 -1
  99. package/web-app/dist/assets/{plus-j08lFR-K.js → plus-EoL5OCB7.js} +1 -1
  100. package/web-app/dist/assets/{refresh-cw-CIr7E-g2.js → refresh-cw-BjREUnVq.js} +1 -1
  101. package/web-app/dist/assets/{rotate-ccw-gwoXxDeE.js → rotate-ccw-DahWX07H.js} +1 -1
  102. package/web-app/dist/assets/{save-B8fV_ZpE.js → save-Dek3gCn1.js} +1 -1
  103. package/web-app/dist/assets/{server-D5dO1paz.js → server-D6V1BAia.js} +1 -1
  104. package/web-app/dist/assets/{shield-alert-Du08zhdg.js → shield-alert-BtTK5Sxb.js} +1 -1
  105. package/web-app/dist/assets/{trash-2-DEKSVae5.js → trash-2-BT5o_g0r.js} +1 -1
  106. package/web-app/dist/assets/{trending-down-DBiXUtxJ.js → trending-down-D4Jk7KF3.js} +1 -1
  107. package/web-app/dist/assets/{trending-up-BgmK_tHq.js → trending-up-EQFTzhEo.js} +1 -1
  108. package/web-app/dist/assets/{upload-IaViyeVD.js → upload-JfI5lCSE.js} +1 -1
  109. package/web-app/dist/assets/{usePolling-PiRLqNu6.js → usePolling-BnhPUuGd.js} +1 -1
  110. package/web-app/dist/assets/{user-BB5J8wAF.js → user-DSUiUYtj.js} +1 -1
  111. package/web-app/dist/index.html +1 -1
  112. package/web-app/dist/assets/ComparePage-Dg0UdZAk.js +0 -1
package/README.md CHANGED
@@ -19,14 +19,14 @@ _The free, source-available autonomous coding agent by [Autonomi](https://www.au
19
19
 
20
20
  ---
21
21
 
22
- > **How it works:** Drop a spec -- a PRD, GitHub issue, OpenAPI/JSON/YAML, or one-line brief. Loki Mode classifies complexity (`run.sh:detect_complexity()`), assembles an agent team from 41 specialized agent roles across 8 domains - prompt-defined specifications the orchestrator adopts per phase, with parallel review (blind council) and optional worktree streams on Claude Code, sequential on other providers - and runs autonomous RARV cycles (Reason - Act - Reflect - Verify, see `run.sh:run_autonomous()`) with 11 quality gates (see `skills/quality-gates.md`). Code is not "done" until it passes automated verification. Output is a Git repo with source, tests, configs, and audit logs.
22
+ > **How it works:** Drop a spec -- a PRD, GitHub issue, OpenAPI/JSON/YAML, or one-line brief. Loki Mode classifies complexity (`run.sh:detect_complexity()`), assembles an agent team from 41 specialized agent roles across 8 domains - prompt-defined specifications the orchestrator adopts per phase, with parallel review (blind council) and optional worktree streams on Claude Code, sequential on other providers - and runs autonomous RARV cycles (Reason - Act - Reflect - Verify, see `run.sh:run_autonomous()`) with 8 quality gates (see `skills/quality-gates.md`). Code is not "done" until it passes automated verification. Output is a Git repo with source, tests, configs, and audit logs.
23
23
 
24
24
  ---
25
25
 
26
26
  ## Why Loki Mode?
27
27
 
28
28
  - **Spec-driven, autonomous, with a built-in trust layer** -- Hand Loki a spec, walk away, come back to working code with tests. The full RARV-C closure loop (Reason - Act - Reflect - Verify - Close) runs until the work is actually done, not just attempted. The verified-completion evidence gate (`skills/quality-gates.md`) refuses any "done" claim on an empty git diff against the run-start commit, and blocks completion when tests run red, so "complete" means proven, not promised.
29
- - **Production quality built in** -- 11 quality gates (`skills/quality-gates.md`), blind 3-reviewer code review (`run.sh:run_code_review()`), anti-sycophancy checks
29
+ - **Production quality built in** -- 8 quality gates (`skills/quality-gates.md`), blind 3-reviewer code review (`run.sh:run_code_review()`), anti-sycophancy checks
30
30
  - **Standalone verification: `loki verify`** -- Run Loki's deterministic gates (build, tests, static analysis, secret scan, dependency audit) against any branch or PR diff, including code written by other agents or humans. CI-ready exit codes (0 VERIFIED, 1 CONCERNS, 2 BLOCKED), machine-readable evidence at `.loki/verify/evidence.json`. Inconclusive evidence is never reported as VERIFIED (v7.27.0).
31
31
  - **Living spec and pre-build interrogation** -- `loki spec` locks a spec and detects drift deterministically (`spec.lock`, `drift-report.json`, and a `SPEC_DRIFT` finding in `loki verify` with CI exit codes), so you can tell when the build diverges from what was agreed. `loki grill` runs a Devil's-Advocate interrogation of the spec before you build, surfacing gaps and contradictions early (v7.28.0).
32
32
  - **Mid-flight model switching** -- switch the model a live run uses from the dashboard (applies at the next iteration, current run only). A Fable tier lever exists in the CLI, dashboard, and override paths, but Claude Fable 5 is not yet available at the API, so selecting Fable currently collapses to Opus at every dispatch chokepoint and the `loki plan` quote reflects Opus accordingly. For every model lever (session pin, mid-flight override, architect pass) and every `LOKI_MAX_TIER` path, the `loki plan` quote, the dashboard's reported model, and the actual dispatched model agree, with the ceiling enforced (v7.31.0; Fable-to-Opus collapse v7.39.1).
@@ -41,7 +41,7 @@ _The free, source-available autonomous coding agent by [Autonomi](https://www.au
41
41
  - **MCP server** -- 34 tools (including ChromaDB code search) plus 3 resources and 2 prompts (`mcp/server.py`, with magic tools registered from `mcp/magic_tools.py` and the managed-memory tool from `mcp/managed_tools.py`). Of the 34, 33 are always available; `loki_memory_redact` is registered but only succeeds when `LOKI_MANAGED_AGENTS=true` and `LOKI_MANAGED_MEMORY=true`. Launch with `loki mcp` (bootstraps the Python MCP SDK on first run).
42
42
  - **Full-stack output** -- Source code, tests, Docker Compose stacks (multi-service with healthchecks), CI/CD pipelines, audit logs
43
43
  - **Provider-agnostic** -- runs on Claude, Codex, Cline, or Aider with automatic failover (`loki-ts/src/runner/providers.ts`); no vendor lock-in. Gemini CLI deprecated v7.5.18; Antigravity CLI coming soon.
44
- - **Open source** -- Free for personal, internal, and academic use.
44
+ - **Source-available (BUSL-1.1)** -- Free for personal, internal, and academic use.
45
45
 
46
46
  ---
47
47
 
@@ -193,7 +193,7 @@ A "spec" is whatever you hand `loki start`. Loki auto-detects the format and nor
193
193
  | OpenSpec change directory | `loki start --openspec ./openspec/change-001` | Reads OpenSpec change manifest + delta files. |
194
194
  | Auto-detect (no input) | `loki start` | Picks up `./prd.md`, `./spec.{json,yaml,yml}`, or `./SPEC.md` from cwd. |
195
195
 
196
- All formats land in the same RARV pipeline and pass the same 11 quality gates (`skills/quality-gates.md`).
196
+ All formats land in the same RARV pipeline and pass the same 8 quality gates (`skills/quality-gates.md`).
197
197
 
198
198
  </details>
199
199
 
@@ -252,8 +252,8 @@ Every iteration: **Reason** (read state) - **Act** (execute, commit) - **Reflect
252
252
  </td>
253
253
  <td width="33%" valign="top">
254
254
 
255
- ### 11 Quality Gates
256
- Blind review, anti-sycophancy, severity blocking, mock/mutation detection, backward compatibility (gate 10, v6.67.0), documentation coverage (gate 11, v7.5.0). Code does not ship until all gates pass.
255
+ ### 8 Quality Gates
256
+ Static analysis, test suite (pass/fail), blind 3-reviewer code review with severity blocking, anti-sycophancy Devil's Advocate, mock-integrity detection, test-mutation detection, documentation coverage, and Magic Modules debate. Backward-compatibility is a conditional healing-mode auditor (not one of the 8). Code does not ship until all gates pass.
257
257
 
258
258
  [Quality Gates](skills/quality-gates.md)
259
259
 
@@ -303,15 +303,15 @@ The historical feature set (platform pages, Monaco IDE workspace, AI chat panel)
303
303
  |---------|:---------:|:--------:|:------:|:-------:|
304
304
  | Self-hosted / your keys | Yes | No | No | No |
305
305
  | 5 AI provider failover | Yes | No | No | No |
306
- | 11 quality gates | Yes | No | No | No |
306
+ | 8 quality gates | Yes | No | No | No |
307
307
  | Blind code review | Yes | No | No | No |
308
308
  | Enterprise auth (SSO/RBAC) | Yes | No | Yes | No |
309
309
  | Air-gapped deployment | Yes | No | No | No |
310
310
  | Docker + CI/CD generation | Yes | No | Yes | No |
311
- | Open source | Yes | No | No | No |
312
- | Free tier | Open source | Yes | Yes | Yes |
311
+ | Source-available (BUSL-1.1) | Yes | No | No | No |
312
+ | Free tier | Source-available | Yes | Yes | Yes |
313
313
 
314
- Loki Mode is the only platform that is fully self-hosted, open source, and includes automated quality verification. Your code, your keys, your infrastructure.
314
+ Loki Mode is the only platform that is fully self-hosted, source-available (BUSL-1.1), and includes automated quality verification. Your code, your keys, your infrastructure.
315
315
 
316
316
  ---
317
317
 
@@ -432,7 +432,7 @@ See [benchmarks/](benchmarks/) for methodology.
432
432
 
433
433
  ![Loki Mode Presentation](docs/loki-mode-presentation.gif)
434
434
 
435
- *11 slides: Problem, Solution, 41 Agents, RARV Cycle, 9 Quality Gates (HumanEval 98.78%), Multi-Provider, Enterprise Hardening (Live App Preview), Full Lifecycle*
435
+ *11 slides: Problem, Solution, 41 Agents, RARV Cycle, 8 Quality Gates (HumanEval 98.78%), Multi-Provider, Enterprise Hardening (Live App Preview), Full Lifecycle*
436
436
 
437
437
  **[Download PPTX](docs/loki-mode-presentation.pptx)**
438
438
 
@@ -446,7 +446,7 @@ See [benchmarks/](benchmarks/) for methodology.
446
446
  |------|-----------|---------------------|
447
447
  | **Code Gen** | Full-stack apps from PRDs | Complex domain logic may need human review |
448
448
  | **Deploy** | Generates configs, Dockerfiles, CI/CD | Does not deploy -- human runs deploy commands |
449
- | **Testing** | 11 automated quality gates | Test quality depends on AI assertions |
449
+ | **Testing** | 8 automated quality gates | Test quality depends on AI assertions |
450
450
  | **Providers** | 5 providers with auto-failover | Non-Claude providers lack parallel agents |
451
451
  | **Dashboard** | Real-time single-machine monitoring | No multi-node clustering |
452
452
 
@@ -499,3 +499,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
499
499
  **[Autonomi](https://www.autonomi.dev/)** | **[Documentation](wiki/Home.md)** | **[Changelog](CHANGELOG.md)** | **[Comparisons](references/competitive-analysis.md)**
500
500
 
501
501
  </div>
502
+
503
+ ## Star History
504
+
505
+ [![Star History Chart](https://api.star-history.com/chart?repos=asklokesh/loki-mode&type=timeline&legend=bottom-right)](https://www.star-history.com/?repos=asklokesh%2Floki-mode&type=timeline&legend=bottom-right)
package/SKILL.md CHANGED
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: loki-mode
3
- description: Autonomous spec-driven build system with a built-in trust layer. It does not call work done until it is verified (RARV-C closure loop, 11 quality gates, completion council, verified-completion evidence gate). Triggers on "Loki Mode". Takes a spec (PRD, GitHub issue, OpenAPI doc, etc.) to deployed product with minimal human intervention. Provider-agnostic. Requires --dangerously-skip-permissions flag.
3
+ description: Autonomous spec-driven build system with a built-in trust layer. It does not call work done until it is verified (RARV-C closure loop, 8 quality gates, completion council, verified-completion evidence gate). Triggers on "Loki Mode". Takes a spec (PRD, GitHub issue, OpenAPI doc, etc.) to deployed product with minimal human intervention. Provider-agnostic. Requires --dangerously-skip-permissions flag.
4
4
  ---
5
5
 
6
- # Loki Mode v7.45.1
6
+ # Loki Mode v7.47.0
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
10
- **Spec in, verified product out.** Spec-driven: a "spec" is whatever describes the work -- a Markdown PRD, a GitHub issue, an OpenAPI doc, a Jira ticket (a PRD is one form of spec). The differentiator is the trust layer: Loki does not call work done until it is verified. The RARV-C closure loop, 11 quality gates, the completion council, and the verified-completion evidence gate must all clear before completion is accepted.
10
+ **Spec in, verified product out.** Spec-driven: a "spec" is whatever describes the work -- a Markdown PRD, a GitHub issue, an OpenAPI doc, a Jira ticket (a PRD is one form of spec). The differentiator is the trust layer: Loki does not call work done until it is verified. The RARV-C closure loop, 8 quality gates, the completion council, and the verified-completion evidence gate must all clear before completion is accepted.
11
11
 
12
12
  **Provider-agnostic (stable since v5.0.0):** runs on Claude/Codex/Cline/Aider with abstract model tiers and degraded mode for non-Claude providers; no vendor lock-in. Gemini deprecated v7.5.18. See `skills/providers.md`. **Current track (v7.7.x):** LSP grounding as first-class agent tool (v7.7.0-v7.7.9; lsp_get_diagnostics actually-returns-diagnostics regression fix v7.7.14), provider_source cli (v7.7.11-v7.7.12 bash/bun parity), Docker/bash-3.2 robustness (v7.7.13), audit chain cross-file verification fix (v7.7.15), Phase 1 RARV-C closure (real provider judges, gate-failure flock, synthetic PRD e2e, status `--json`).
13
13
 
@@ -125,7 +125,7 @@ DEPLOYMENT ──[production live, monitoring active]──> GROWTH
125
125
  GROWTH ──[continuous improvement loop]──> GROWTH
126
126
  ```
127
127
 
128
- **Transition requires:** All phase quality gates passed. No Critical/High/Medium issues.
128
+ **Transition requires:** All phase quality gates passed. No Critical/High issues (Medium/Low advisory).
129
129
 
130
130
  ---
131
131
 
@@ -407,4 +407,4 @@ See `CHANGELOG.md` entries [7.5.7], [7.5.8], [7.5.13] for the per-fix list and r
407
407
 
408
408
  ---
409
409
 
410
- **v7.45.1 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
410
+ **v7.47.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 7.45.1
1
+ 7.47.0
@@ -155,7 +155,7 @@ SKILL.md (~190 lines) # Always loaded: RARV cycle, autonomy rules
155
155
  skills/
156
156
  00-index.md # Module routing table
157
157
  model-selection.md # Task tool, parallelization
158
- quality-gates.md # 9-gate system, anti-sycophancy
158
+ quality-gates.md # 8-gate system, anti-sycophancy
159
159
  testing.md # Playwright, E2E, property-based
160
160
  production.md # CI/CD, batch processing
161
161
  agents.md # 41 agent types, A2A patterns
@@ -196,7 +196,14 @@ Main Worktree (orchestrator)
196
196
 
197
197
  ---
198
198
 
199
- ## Quality Gates (9-Gate System)
199
+ ## Quality Gates
200
+
201
+ Note: the canonical, implemented quality-gate set is the 8-gate system defined in
202
+ `skills/quality-gates.md` (static analysis, test suite pass/fail, blind 3-reviewer
203
+ code review with severity blocking, anti-sycophancy Devil's Advocate, mock
204
+ integrity, test mutation, documentation coverage, Magic Modules debate). The
205
+ list below is an aspirational SDLC taxonomy and may name phases that are not
206
+ deterministic loop gates; treat `skills/quality-gates.md` as the source of truth.
200
207
 
201
208
  ### Gate 1: Static Analysis
202
209
  ```yaml
@@ -1721,6 +1721,111 @@ EVIDENCE_EOF
1721
1721
  return 1
1722
1722
  }
1723
1723
 
1724
+ #===============================================================================
1725
+ # P2-2 Assumption ledger gate (spec-robustness).
1726
+ #
1727
+ # Blocks completion while any high-severity assumption is unresolved, where
1728
+ # unresolved means: severity=high AND confirmed=false AND acknowledged=false.
1729
+ # This is the completion-side teeth for the spec-interrogation feature: when the
1730
+ # spec was ambiguous and Loki had to assume something high-impact, "done" cannot
1731
+ # be declared until that assumption has at least been acknowledged (auto-ack
1732
+ # lifecycle in run.sh, default-on) or human-confirmed
1733
+ # (LOKI_ASSUMPTIONS_REQUIRE_CONFIRM=1).
1734
+ #
1735
+ # By-design timing: in DEFAULT autonomous mode run.sh auto-acknowledges entries
1736
+ # every iteration right after injecting them into the build prompt, so by the
1737
+ # time the council reaches this gate (>= COUNCIL_MIN_ITERATIONS) they are already
1738
+ # acknowledged and the gate passes. That is intentional: a permanent block on
1739
+ # "unconfirmed" in a non-TTY run would just die at max-iterations and never reach
1740
+ # the proof-of-done. The PERSISTENT block lives in the
1741
+ # LOKI_ASSUMPTIONS_REQUIRE_CONFIRM=1 path (auto-ack disabled, only human
1742
+ # confirmed=true clears it). In BOTH modes the assumptions are unconditionally
1743
+ # SURFACED in proof-of-done (build_completion_summary reads counts ignoring
1744
+ # ack/confirm state), so "done" always means "done, plus here is what I assumed."
1745
+ #
1746
+ # The block COUNT comes from spec_ledger_high_unresolved_count() in
1747
+ # autonomy/spec-interrogation.sh. The gate sources that module if it is not
1748
+ # already loaded, so it works both inside run.sh (already sourced) and in
1749
+ # standalone tests (sources it here). When the module / ledger is absent the
1750
+ # count is 0 and the gate passes -- a project with no recorded assumptions is
1751
+ # never blocked (no spurious block on clean specs).
1752
+ #
1753
+ # Mirrors council_evidence_gate: opt-out knob first, defensive COUNCIL_STATE_DIR
1754
+ # default, writes .loki/council/assumption-block.json on block (removed on pass).
1755
+ #
1756
+ # Returns 0 (pass / OK to complete) or 1 (block / CONTINUE).
1757
+ #===============================================================================
1758
+ council_assumption_ledger_gate() {
1759
+ # Knob first: opt-out is exact-as-today, before any file read or write.
1760
+ [ "${LOKI_ASSUMPTION_GATE:-1}" = "0" ] && return 0
1761
+
1762
+ if [ -z "${COUNCIL_STATE_DIR:-}" ]; then
1763
+ COUNCIL_STATE_DIR="${TARGET_DIR:-.}/.loki/council"
1764
+ fi
1765
+
1766
+ # Source the spec-interrogation module if its counter is not already defined
1767
+ # (standalone tests / completion-promise route). Best-effort.
1768
+ if ! type spec_ledger_high_unresolved_count >/dev/null 2>&1; then
1769
+ local _si_helper
1770
+ _si_helper="$(dirname "${BASH_SOURCE[0]}")/spec-interrogation.sh"
1771
+ if [ -f "$_si_helper" ]; then
1772
+ # shellcheck disable=SC1090
1773
+ . "$_si_helper" 2>/dev/null || true
1774
+ fi
1775
+ fi
1776
+
1777
+ # No module => no ledger => nothing to block on (pass-through).
1778
+ if ! type spec_ledger_high_unresolved_count >/dev/null 2>&1; then
1779
+ if [ -f "$COUNCIL_STATE_DIR/assumption-block.json" ]; then
1780
+ rm -f "$COUNCIL_STATE_DIR/assumption-block.json"
1781
+ fi
1782
+ return 0
1783
+ fi
1784
+
1785
+ local unresolved
1786
+ unresolved="$(spec_ledger_high_unresolved_count 2>/dev/null || echo 0)"
1787
+ # Defensive: coerce to an integer.
1788
+ case "$unresolved" in
1789
+ ''|*[!0-9]*) unresolved=0 ;;
1790
+ esac
1791
+
1792
+ if [ "$unresolved" -eq 0 ]; then
1793
+ # Gate passes: remove any stale block report.
1794
+ if [ -f "$COUNCIL_STATE_DIR/assumption-block.json" ]; then
1795
+ rm -f "$COUNCIL_STATE_DIR/assumption-block.json"
1796
+ fi
1797
+ return 0
1798
+ fi
1799
+
1800
+ log_warn "[Council] Assumption ledger gate BLOCKED: ${unresolved} high-severity spec assumption(s) unresolved (the spec was ambiguous in ${unresolved} high-impact place(s))."
1801
+ log_warn "[Council] Resolve by confirming them in .loki/assumptions/ (set confirmed=true), or opt out with LOKI_ASSUMPTION_GATE=0."
1802
+
1803
+ mkdir -p "$COUNCIL_STATE_DIR" 2>/dev/null || true
1804
+ local ab_file="$COUNCIL_STATE_DIR/assumption-block.json"
1805
+ local ab_tmp="${ab_file}.tmp"
1806
+ local timestamp
1807
+ timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
1808
+ cat > "$ab_tmp" << ASSUMPTION_EOF
1809
+ {
1810
+ "status": "blocked",
1811
+ "blocked": true,
1812
+ "blocked_at": "$timestamp",
1813
+ "iteration": ${ITERATION_COUNT:-0},
1814
+ "reason": "high_severity_assumptions_unresolved",
1815
+ "high_unresolved": $unresolved
1816
+ }
1817
+ ASSUMPTION_EOF
1818
+ mv "$ab_tmp" "$ab_file" 2>/dev/null || rm -f "$ab_tmp" 2>/dev/null || true
1819
+
1820
+ if type record_trust_event_bash &>/dev/null; then
1821
+ record_trust_event_bash "assumption_block" \
1822
+ "high_unresolved=$unresolved" \
1823
+ >/dev/null 2>&1 || true
1824
+ fi
1825
+
1826
+ return 1
1827
+ }
1828
+
1724
1829
  #===============================================================================
1725
1830
  # Council Member Review - Individual member evaluation
1726
1831
  #===============================================================================
@@ -2512,6 +2617,14 @@ council_evaluate() {
2512
2617
  return 1 # CONTINUE - cannot complete without real evidence
2513
2618
  fi
2514
2619
 
2620
+ # P2-2: assumption ledger gate - block completion while high-severity spec
2621
+ # assumptions are unresolved (the spec was ambiguous in a high-impact place
2622
+ # and Loki had to assume something that has not been acknowledged/confirmed).
2623
+ if ! council_assumption_ledger_gate; then
2624
+ log_info "[Council] Completion blocked by assumption ledger gate"
2625
+ return 1 # CONTINUE - cannot complete with unresolved high-sev assumptions
2626
+ fi
2627
+
2515
2628
  # Compute threshold using the same ceiling(2/3) formula as council_vote and council_aggregate_votes
2516
2629
  local _eval_threshold=$(( (COUNCIL_SIZE * 2 + 2) / 3 ))
2517
2630
 
@@ -2,7 +2,7 @@
2
2
  # Loki Mode -- sentrux architectural-drift helper (v7.5.14).
3
3
  #
4
4
  # Why this exists:
5
- # Loki's existing 11 quality gates and 3-reviewer council catch correctness
5
+ # Loki's existing 8 quality gates and 3-reviewer council catch correctness
6
6
  # and behavioral regressions, but no current gate emits a deterministic,
7
7
  # per-iteration architecture-drift signal. sentrux (https://github.com/sentrux/sentrux)
8
8
  # is a Rust CLI that scores codebase structure (modularity, acyclicity,
package/autonomy/loki CHANGED
@@ -16135,7 +16135,7 @@ print()
16135
16135
  echo -e "${RED}Test coverage gate FAILED${NC}"
16136
16136
  return 1
16137
16137
  else
16138
- echo -e "${GREEN}Tests passed (min coverage: ${min_coverage}%)${NC}"
16138
+ echo -e "${GREEN}Tests passed (min coverage TARGET, not measured: ${min_coverage}%)${NC}"
16139
16139
  return 0
16140
16140
  fi
16141
16141
  ;;
@@ -27527,7 +27527,7 @@ if test_results:
27527
27527
  test_lines.append(f"Passed: {test_results.get('pass', 'unknown')}")
27528
27528
  test_lines.append(f"Timestamp: {test_results.get('timestamp', 'unknown')}")
27529
27529
  if test_results.get("min_coverage"):
27530
- test_lines.append(f"Min coverage target: {test_results['min_coverage']}%")
27530
+ test_lines.append(f"Min coverage TARGET (not measured): {test_results['min_coverage']}%")
27531
27531
  else:
27532
27532
  test_lines.append("No test result data recorded")
27533
27533
  sections.append(("Tests", test_lines))