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/dashboard/auth.py CHANGED
@@ -477,6 +477,111 @@ def _base64url_decode(data: str) -> bytes:
477
477
  return base64.urlsafe_b64decode(data)
478
478
 
479
479
 
480
+ # Role precedence (highest privilege first). When a token carries multiple
481
+ # recognized role claims, the highest-privilege match wins.
482
+ _ROLE_PRECEDENCE = ("admin", "operator", "auditor", "viewer")
483
+
484
+
485
+ def _normalize_claim_values(value) -> set[str]:
486
+ """Normalize an OIDC claim value into a lowercased set of strings.
487
+
488
+ Claim values may be a single string, a space-separated string, or a
489
+ list of strings (different providers use different shapes). All are
490
+ flattened into a set of lowercased tokens for matching against ROLES.
491
+ """
492
+ out: set[str] = set()
493
+ if value is None:
494
+ return out
495
+ if isinstance(value, str):
496
+ for part in value.split():
497
+ if part:
498
+ out.add(part.strip().lower())
499
+ elif isinstance(value, (list, tuple, set)):
500
+ for item in value:
501
+ if isinstance(item, str):
502
+ s = item.strip().lower()
503
+ if s:
504
+ out.add(s)
505
+ return out
506
+
507
+
508
+ def _collect_role_claims(claims: dict) -> set[str]:
509
+ """Collect candidate role/group values from standard OIDC claim shapes.
510
+
511
+ Recognized sources (case-insensitive values flattened into one set):
512
+ - A configurable claim named by LOKI_OIDC_ROLES_CLAIM (supports a dotted
513
+ path for nested claims, e.g. "realm_access.roles" for Keycloak).
514
+ - "roles" (generic)
515
+ - "groups" (generic)
516
+ - "realm_access.roles" (Keycloak)
517
+ - "cognito:groups" (AWS Cognito)
518
+
519
+ Note: "groups"/"cognito:groups" typically carry arbitrary group names,
520
+ not Loki role names. Only values that exactly match one of the four
521
+ built-in role names (admin/operator/viewer/auditor, case-insensitive)
522
+ grant a role. Everything else is ignored and the default role applies.
523
+ """
524
+ candidates: set[str] = set()
525
+
526
+ def _read_dotted(path: str):
527
+ node = claims
528
+ for key in path.split("."):
529
+ if isinstance(node, dict) and key in node:
530
+ node = node[key]
531
+ else:
532
+ return None
533
+ return node
534
+
535
+ configured = os.environ.get("LOKI_OIDC_ROLES_CLAIM", "").strip()
536
+ sources = []
537
+ if configured:
538
+ sources.append(configured)
539
+ sources.extend(["roles", "groups", "realm_access.roles", "cognito:groups"])
540
+
541
+ for src in sources:
542
+ if "." in src:
543
+ val = _read_dotted(src)
544
+ else:
545
+ val = claims.get(src)
546
+ candidates |= _normalize_claim_values(val)
547
+
548
+ return candidates
549
+
550
+
551
+ def _default_oidc_role() -> str:
552
+ """Return the configured default OIDC role, validated against ROLES.
553
+
554
+ Defaults to the least-privileged role ("viewer"). If LOKI_OIDC_DEFAULT_ROLE
555
+ is set to an unrecognized value, falls back to "viewer" (never admin).
556
+ """
557
+ configured = os.environ.get("LOKI_OIDC_DEFAULT_ROLE", "").strip().lower()
558
+ if configured in ROLES:
559
+ return configured
560
+ return "viewer"
561
+
562
+
563
+ def _scopes_from_claims(claims: dict) -> tuple[list[str], str]:
564
+ """Map OIDC token claims to Loki scopes via the existing ROLES mapping.
565
+
566
+ Returns a tuple of (scopes, role_name). If no recognized role claim is
567
+ present, the safe default role (viewer, or LOKI_OIDC_DEFAULT_ROLE) is
568
+ applied. This function NEVER returns ["*"]/admin by default: full access
569
+ is granted only when an explicit admin role claim is present.
570
+ """
571
+ candidate_values = _collect_role_claims(claims)
572
+
573
+ matched_role = None
574
+ for role in _ROLE_PRECEDENCE:
575
+ if role in candidate_values:
576
+ matched_role = role
577
+ break
578
+
579
+ if matched_role is None:
580
+ matched_role = _default_oidc_role()
581
+
582
+ return resolve_scopes(matched_role), matched_role
583
+
584
+
480
585
  def validate_oidc_token(token_str: str) -> Optional[dict]:
481
586
  """Validate an OIDC JWT token.
482
587
 
@@ -489,6 +594,12 @@ def validate_oidc_token(token_str: str) -> Optional[dict]:
489
594
  - Audience matches OIDC_AUDIENCE or OIDC_CLIENT_ID
490
595
  - Token is not expired
491
596
 
597
+ On success, role/group claims are mapped to Loki roles (admin/operator/
598
+ viewer/auditor) via _scopes_from_claims. When no recognized role claim is
599
+ present, the least-privileged default role (viewer, configurable via
600
+ LOKI_OIDC_DEFAULT_ROLE) is applied. OIDC users are never granted ["*"]
601
+ unless an explicit admin role claim is present.
602
+
492
603
  SECURITY CRITICAL: Without PyJWT, JWT signatures are NOT cryptographically
493
604
  verified. An attacker can forge tokens with arbitrary claims. For any
494
605
  production deployment, you MUST install PyJWT + cryptography so that
@@ -529,11 +640,13 @@ def validate_oidc_token(token_str: str) -> Optional[dict]:
529
640
  issuer=OIDC_ISSUER,
530
641
  )
531
642
 
643
+ scopes, role = _scopes_from_claims(decoded)
532
644
  return {
533
645
  "id": decoded.get("sub", ""),
534
646
  "name": decoded.get("name", decoded.get("email", decoded.get("sub", ""))),
535
647
  "email": decoded.get("email", ""),
536
- "scopes": ["*"], # OIDC users get full access
648
+ "scopes": scopes, # mapped from OIDC role/group claims
649
+ "role": role,
537
650
  "auth_method": "oidc",
538
651
  "issuer": decoded.get("iss"),
539
652
  }
@@ -602,11 +715,13 @@ def validate_oidc_token(token_str: str) -> Optional[dict]:
602
715
  return None
603
716
 
604
717
  # Return user info from claims
718
+ scopes, role = _scopes_from_claims(claims)
605
719
  return {
606
720
  "id": claims.get("sub", ""),
607
721
  "name": claims.get("name", claims.get("email", claims.get("sub", ""))),
608
722
  "email": claims.get("email", ""),
609
- "scopes": ["*"], # OIDC users get full access
723
+ "scopes": scopes, # mapped from OIDC role/group claims
724
+ "role": role,
610
725
  "auth_method": "oidc",
611
726
  "issuer": claims.get("iss"),
612
727
  }
@@ -885,7 +885,7 @@ async def agent_card() -> dict:
885
885
  "capabilities": {
886
886
  "agents": 41,
887
887
  "swarms": 8,
888
- "quality_gates": 9,
888
+ "quality_gates": 8,
889
889
  "providers": ["claude", "codex", "cline", "aider"],
890
890
  "streaming": True,
891
891
  "pushNotifications": False,
@@ -7177,15 +7177,14 @@ async def remove_checklist_waiver(item_id: str):
7177
7177
  # =============================================================================
7178
7178
 
7179
7179
  _DEFAULT_QUALITY_GATES = [
7180
- {"name": "Static Analysis", "description": "CodeQL, ESLint, type checking", "status": "pending"},
7181
- {"name": "Parallel Code Review", "description": "3-reviewer blind review system", "status": "pending"},
7182
- {"name": "Anti-Sycophancy Check", "description": "Devil's advocate on unanimous approval", "status": "pending"},
7183
- {"name": "Severity Assessment", "description": "Critical/High/Medium = BLOCK", "status": "pending"},
7184
- {"name": "Unit Test Coverage", "description": "Target >80% coverage, 100% pass", "status": "pending"},
7185
- {"name": "Integration Tests", "description": "End-to-end verification", "status": "pending"},
7186
- {"name": "Security Scan", "description": "Dependency audit, OWASP checks", "status": "pending"},
7187
- {"name": "Build Verification", "description": "Clean build with no warnings", "status": "pending"},
7188
- {"name": "Council Vote", "description": "Completion council consensus", "status": "pending"},
7180
+ {"name": "Static Analysis", "description": "CodeQL, ESLint/Pylint, type-checker findings on the diff", "status": "pending"},
7181
+ {"name": "Test Suite", "description": "Project test runner pass/fail (red blocks)", "status": "pending"},
7182
+ {"name": "Blind Code Review", "description": "3-reviewer blind review; Critical/High = BLOCK; Medium/Low advisory", "status": "pending"},
7183
+ {"name": "Anti-Sycophancy", "description": "Devil's Advocate re-review on unanimous PASS", "status": "pending"},
7184
+ {"name": "Mock Integrity", "description": "Tautological-assertion and mock-ratio detection", "status": "pending"},
7185
+ {"name": "Test Mutation", "description": "Assertion-churn (test-fitting) detection", "status": "pending"},
7186
+ {"name": "Documentation Coverage", "description": "README presence, docs freshness, API docs for exported symbols", "status": "pending"},
7187
+ {"name": "Magic Modules Debate", "description": "Spec-vs-implementation debate on generated modules", "status": "pending"},
7189
7188
  ]
7190
7189
 
7191
7190
 
@@ -336,7 +336,7 @@ Based on research synthesis, the following improvements are planned:
336
336
 
337
337
  This acknowledgements file documents the research and resources that influenced Loki Mode's design. All referenced works retain their original licenses and copyrights.
338
338
 
339
- Loki Mode itself is released under the MIT License.
339
+ Loki Mode itself is released under the Business Source License 1.1 (BUSL-1.1), a source-available license.
340
340
 
341
341
  ---
342
342
 
@@ -14,8 +14,8 @@
14
14
  | **Type** | Skill/Framework | Enterprise Platform | Standalone Agent | Cloud Agent | AI IDE | CLI Agent | AI IDE | AI IDE | Cloud Agent | AI IDE (OSS) |
15
15
  | **Autonomy Level** | High (minimal human) | High | Full | High | Medium-High | High | High | High | High | High |
16
16
  | **Max Runtime** | Unlimited | Async/Scheduled | Hours | Per-task | Session | Session | Days | Async | Per-task | Session |
17
- | **Pricing** | Free (OSS) | Enterprise | $20/mo | ChatGPT Plus | $20/mo | API costs | Free preview | Free preview | $19/mo | Free (OSS) |
18
- | **Open Source** | Yes | No | No | No | No | No | No | No | No | Yes |
17
+ | **Pricing** | Free (source-available) | Enterprise | $20/mo | ChatGPT Plus | $20/mo | API costs | Free preview | Free preview | $19/mo | Free (OSS) |
18
+ | **Source model** | Source-available (BUSL-1.1) | No | No | No | No | No | No | No | No | Yes |
19
19
  | **GitHub Stars** | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | 70.9k |
20
20
 
21
21
  ---
@@ -37,7 +37,7 @@
37
37
  |---------|--------------|-----------|-----------|------------|----------|-----------------|--------------|--------------|
38
38
  | **Code Review** | 3 blind reviewers + devil's advocate | Basic | Basic | BugBot PR | Property-based | Artifacts | Doc/Review | Basic |
39
39
  | **Anti-Sycophancy** | Yes (CONSENSAGENT) | No | No | No | No | No | No | No |
40
- | **Quality Gates** | 11 gates + PBT | Basic | Sandbox | Tests | Spec validation | Artifact checks | Tests | Permissions |
40
+ | **Quality Gates** | 8 gates + PBT | Basic | Sandbox | Tests | Spec validation | Artifact checks | Tests | Permissions |
41
41
  | **Constitutional AI** | Yes (principles) | No | Refusal training | No | No | No | No | No |
42
42
 
43
43
  ---
@@ -146,10 +146,10 @@
146
146
 
147
147
  | Feature | **Zencoder** | **Loki Mode** | **Assessment** |
148
148
  |---------|-------------|---------------|----------------|
149
- | **Four Pillars** | Structured Workflows, SDD, Multi-Agent Verification, Parallel Execution | SDLC + RARV + 9 Gates + Worktrees | TIE |
149
+ | **Four Pillars** | Structured Workflows, SDD, Multi-Agent Verification, Parallel Execution | SDLC + RARV + 8 Gates + Worktrees | TIE |
150
150
  | **Spec-Driven Dev** | Specs as first-class objects | OpenAPI-first | TIE |
151
151
  | **Multi-Agent Verification** | Model diversity (Claude vs OpenAI, 54% improvement) | 3 blind reviewers + devil's advocate | Different approach (N/A for Claude Code - only Claude models) |
152
- | **Quality Gates** | Built-in verification loops | 7 explicit gates + anti-sycophancy | **Loki Mode** |
152
+ | **Quality Gates** | Built-in verification loops | 8 explicit gates + anti-sycophancy | **Loki Mode** |
153
153
  | **Memory System** | Not documented | 3-tier episodic/semantic/procedural | **Loki Mode** |
154
154
  | **Agent Specialization** | Custom Zen Agents | 41 pre-defined specialized agent roles | **Loki Mode** |
155
155
  | **CI Failure Analysis** | Explicit pattern with auto-fix | DevOps agent only | **ADOPTED from Zencoder** |
@@ -178,7 +178,7 @@
178
178
 
179
179
  ### Where Loki Mode EXCEEDS Zencoder
180
180
 
181
- 1. **Quality Control**: 7 explicit gates + blind review + devil's advocate vs built-in loops
181
+ 1. **Quality Control**: 8 explicit gates + blind review + devil's advocate vs built-in loops
182
182
  2. **Memory System**: 3-tier (episodic/semantic/procedural) with cross-project learning
183
183
  3. **Agent Specialization**: 41 pre-defined specialized agent roles across 8 domains
184
184
  4. **Anti-Sycophancy**: CONSENSAGENT patterns prevent reviewer groupthink
@@ -207,7 +207,7 @@
207
207
  | **Skills** | Progressive disclosure | 6 slash commands | N/A | 129 skills | N/A | 35 skills | Memory focus |
208
208
  | **Multi-Provider** | Yes (Claude/Codex/Gemini) | 3 CLIs (separate) | No | No | No | No | No |
209
209
  | **Memory System** | 3-tier (episodic/semantic/procedural) | None | N/A | N/A | Hybrid | N/A | SQLite+FTS5 |
210
- | **Quality Gates** | 11 gates + Completion Council | User verify only | Two-Stage Review | N/A | Consensus | Tiered | N/A |
210
+ | **Quality Gates** | 8 gates + Completion Council | User verify only | Two-Stage Review | N/A | Consensus | Tiered | N/A |
211
211
  | **Context Mgmt** | Standard | Fresh per task (core innovation) | Fresh per task | N/A | N/A | N/A | Progressive |
212
212
  | **Autonomy** | High (minimal human) | Semi (checkpoints) | Human-guided | Human-guided | Orchestrated | Human-guided | N/A |
213
213
 
@@ -232,7 +232,7 @@ These are patterns from competing projects that are **practically and scientific
232
232
  |----------|---------|-------------------------|
233
233
  | **Multi-Provider Support** | Only skill supporting Claude, Codex, and Gemini with graceful degradation | All 8 competitors are Claude-only |
234
234
  | **RARV Cycle** | Reason-Act-Reflect-Verify is more rigorous than Plan-Execute | Most use simple Plan-Execute |
235
- | **11-Gate Quality System** | Static analysis + 3 reviewers + devil's advocate + anti-sycophancy + severity blocking + coverage + debate + backward-compat (healing) + Phase 1 closure | Superpowers has 2-stage, others have less |
235
+ | **8-Gate Quality System** | Static analysis + test suite (pass/fail) + 3 blind reviewers with severity blocking + devil's advocate + mock-integrity + test-mutation + documentation coverage + Magic Modules debate (backward-compat is a conditional healing auditor) + Phase 1 closure | Superpowers has 2-stage, others have less |
236
236
  | **Constitutional AI Integration** | Principles-based self-critique from Anthropic research | None have this |
237
237
  | **Anti-Sycophancy (CONSENSAGENT)** | Blind review + devil's advocate prevents groupthink | None have this |
238
238
  | **Provider Abstraction Layer** | Clean degradation from full-featured to sequential-only | Claude-only projects can't degrade |
@@ -359,12 +359,12 @@ Tiered agent architecture with explicit escalation:
359
359
  |-----------|-------------------|
360
360
  | **Autonomy** | Designed for high autonomy with minimal human intervention |
361
361
  | **Multi-Agent** | 41 prompt-defined agent roles in 8 domains adopted per phase (parallel review council + optional worktree streams on Claude, sequential elsewhere) vs 1-8 in competitors, with all output gated by blind review + council |
362
- | **Quality** | 11 gates + blind review + devil's advocate + property-based testing |
362
+ | **Quality** | 8 gates + blind review + devil's advocate + property-based testing |
363
363
  | **Research** | 10+ academic papers integrated vs proprietary/undisclosed |
364
364
  | **Anti-Sycophancy** | Only agent with CONSENSAGENT-based blind review |
365
365
  | **Memory** | 3-tier memory (episodic/semantic/procedural) + review learning + cross-project |
366
366
  | **Transformation** | Code migration workflows (language, database, framework) |
367
- | **Cost** | Free (open source) vs $20-500/month |
367
+ | **Cost** | Free (source-available, BUSL-1.1) vs $20-500/month |
368
368
  | **Customization** | Full source access vs black box |
369
369
 
370
370
  ---
@@ -20,7 +20,7 @@ GSD is the closest competitor -- a context engineering system that spawns fresh
20
20
  | Adoption | 594 stars, 6K/wk npm | 11,903 stars, 21K/wk npm | GSD (20x) |
21
21
  | Simplicity | Complex (5.4K-line run.sh, 12 Python modules) | Simple (markdown agents + slash commands) | GSD |
22
22
  | Full autonomy | Walk away, come back to deployed product | Human checkpoints at discuss/verify/milestone | Loki |
23
- | Quality gates | 9-gate + Completion Council + anti-sycophancy | User verification only | Loki |
23
+ | Quality gates | 8-gate + Completion Council + anti-sycophancy | User verification only | Loki |
24
24
  | Memory system | Episodic/semantic/procedural + vector search | None | Loki |
25
25
  | Context management | Standard | Fresh subagent contexts per task (core innovation) | GSD |
26
26
  | Time to value | Learn architecture, understand CLI flags | `npx get-shit-done-cc` and go | GSD |
@@ -45,7 +45,7 @@ GSD is the closest competitor -- a context engineering system that spawns fresh
45
45
  | **Enterprise Security** | `--dangerously-skip-permissions` | MCP sandboxed | Sandboxed | Audit logs, RBAC | Staged autonomy | Sandboxed |
46
46
  | **Cross-Project Learning** | No | AgentDB | No | No | No | Limited |
47
47
  | **Observability** | Dashboard + STATUS.txt | Real-time tracing | Logs | Full tracing | Built-in | Full |
48
- | **Pricing** | Free (OSS) | Free (OSS) | Free (OSS) | $25+/mo | $20-400/mo | $20-500/mo |
48
+ | **Pricing** | Free (source-available) | Free (OSS) | Free (OSS) | $25+/mo | $20-400/mo | $20-500/mo |
49
49
  | **Production Ready** | Experimental | Production | Production | Production | Production | Production |
50
50
  | **Resource Monitoring** | Yes (v2.18.5) | Unknown | No | No | No | No |
51
51
  | **State Recovery** | Yes (checkpoints) | Yes (AgentDB) | Limited | Yes | Git worktrees | Yes |
@@ -2,7 +2,7 @@
2
2
 
3
3
  The flagship product of [Autonomi](https://www.autonomi.dev/). Loki Mode is a spec-driven autonomous builder with a built-in trust layer that takes any spec to a deployed product and verifies completion with evidence (quality gates plus a completion council), not just a "done" claim. Complete installation instructions for all platforms and use cases.
4
4
 
5
- **Version:** v7.45.1
5
+ **Version:** v7.47.0
6
6
 
7
7
  ---
8
8
 
@@ -389,7 +389,7 @@ provider works inside the container. Provide auth with your Anthropic API key:
389
389
  # Run Loki Mode in Docker (Claude provider, API-key auth)
390
390
  docker run --rm -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
391
391
  -v $(pwd):/workspace -w /workspace \
392
- asklokesh/loki-mode:7.45.1 start ./my-spec.md
392
+ asklokesh/loki-mode:7.47.0 start ./my-spec.md
393
393
  ```
394
394
 
395
395
  ##### docker compose + .env (no host install)
@@ -1,15 +1,16 @@
1
1
  # Loki Mode open-core boundary
2
2
 
3
- Loki Mode is and stays open source. This document draws the line between what is
4
- free forever and what hosted/paid/enterprise plans would add on top. R9 ships
3
+ Loki Mode is and stays source-available (BUSL-1.1) and free to self-host. This
4
+ document draws the line between what is free forever and what
5
+ hosted/paid/enterprise plans would add on top. R9 ships
5
6
  the SEAMS for that line; it does not ship a hosted backend, a license server, or
6
7
  any paywall on existing functionality.
7
8
 
8
9
  ## Principle
9
10
 
10
- OSS is fully functional with zero hosted backend. Every capability Loki has
11
- today runs locally, free, with no account, no license key, and no network call
12
- to any Loki service. Hosted/paid features are ADDITIVE convenience and
11
+ The free self-hosted tier is fully functional with zero hosted backend. Every
12
+ capability Loki has today runs locally, free, with no account, no license key,
13
+ and no network call to any Loki service. Hosted/paid features are ADDITIVE convenience and
13
14
  team/enterprise layers, never a removal or gating of something that is free
14
15
  today.
15
16
 
@@ -0,0 +1,163 @@
1
+ # P0 Verification-Credibility Sweep -- Architecture Plan
2
+
3
+ Persisted from the Architect (opus). Every line number re-verified by grep.
4
+ Goal: make Loki's verification layer honest and real. A hollow wedge is
5
+ existential for a "proof of done" product. Fix or remove every false/hollow gate
6
+ claim, wire the unwired detectors, make anti-sycophancy act.
7
+
8
+ ## 0. Verified ground truth
9
+
10
+ - P0-1: enforce_test_coverage() at autonomy/run.sh:7031. `local coverage_pct=0`
11
+ at 7038 is never reassigned; no coverage tool invoked. 7257 emits min_coverage
12
+ (the threshold), not a measured value. Gate decides purely on test_passed.
13
+ - P0-2: skills/quality-gates.md:5-17 lists 11 gates; gates 1 (Input Guardrails)
14
+ and 5 (Output Guardrails) have NO gate function. wiki/Quality-Gates.md:14-28
15
+ duplicates. (21 'guardrail' refs in autonomy/ are CLI help/comments/flags.)
16
+ - P0-3: tests/detect-mock-problems.sh + tests/detect-test-mutations.sh invoked
17
+ 0 times in autonomy/run.sh. quality-gates.md:74-77 claims HIGH=FAIL.
18
+ - P0-4: anti-sycophancy block run.sh:8316-8323 only logs + writes
19
+ anti-sycophancy.txt. No Devil's-Advocate re-review. INERT. Bun mirror
20
+ loki-ts/src/runner/quality_gates.ts:804-808 equally inert.
21
+ - Gate inventory: phantom (Input/Output Guardrails); wired-but-unlisted
22
+ (run_magic_debate_gate at run.sh:14067); "Gate 10 Backward Compat" is the
23
+ legacy-healing-auditor SPECIALIST (run.sh:7875-7979), conditional, not a loop
24
+ gate; "Gate 6 Severity Blocking" is the block policy inside code review, not a
25
+ function.
26
+
27
+ ### Functions actually invoked in orchestration (run.sh:13938-14084)
28
+ enforce_static_analysis (13945); enforce_test_coverage (13967); run_code_review
29
+ (13987); run_doc_quality_gate (14058); run_magic_debate_gate (14070); plus
30
+ conditional legacy-healing-auditor reviewer.
31
+
32
+ ## 1. Canonical final gate list (THE CONTRACT -- docs transcribe, never recompute)
33
+
34
+ Honest count after this sweep: 8 gates.
35
+
36
+ | # | Gate | Function / mechanism | Blocking | Opt-out flag |
37
+ |---|------|---------------------|----------|--------------|
38
+ | 1 | Static Analysis | enforce_static_analysis (run.sh:6699) | Yes (ladder) | PHASE_STATIC_ANALYSIS=false |
39
+ | 2 | Test Suite (pass/fail) | enforce_test_coverage (run.sh:7031) | Yes (red blocks) | PHASE_UNIT_TESTS=false |
40
+ | 3 | Blind Code Review (3-reviewer council + severity blocking) | run_code_review (run.sh:7788) | Yes (Crit/High block) | PHASE_CODE_REVIEW=false |
41
+ | 4 | Anti-Sycophancy / Devil's Advocate (on unanimous PASS) | run_code_review sub-step (run.sh:8316+) | Yes (DA Crit/High block) | LOKI_GATE_DEVILS_ADVOCATE=false |
42
+ | 5 | Mock Integrity Detector | enforce_mock_integrity -> tests/detect-mock-problems.sh | Yes (HIGH blocks) | LOKI_GATE_MOCK=false |
43
+ | 6 | Test Mutation Detector | enforce_mutation_integrity -> tests/detect-test-mutations.sh | Yes (HIGH blocks) | LOKI_GATE_MUTATION=false |
44
+ | 7 | Documentation Coverage | run_doc_quality_gate (run.sh:7388) | Yes | LOKI_GATE_DOC_COVERAGE=false |
45
+ | 8 | Magic Modules Debate | run_magic_debate_gate (run.sh:7495) | Yes (BLOCK sev) | LOKI_GATE_MAGIC_DEBATE=false |
46
+
47
+ Conditional auditor (documented separately, NOT numbered): Backward-Compatibility
48
+ / legacy-healing-auditor (healing mode only). Removed: Input/Output Guardrails.
49
+
50
+ ### Doc files to update to "8 gates" (docs owner)
51
+ README.md (22,29,196,255); SKILL.md (3,10); CLAUDE.md (44);
52
+ plugins/loki-mode/README.md (4); wiki/Quality-Gates.md (14-48);
53
+ wiki/Environment-Variables.md (62); wiki/Home.md (3,13); wiki/CLI-Reference.md
54
+ (230); docs/cursor-comparison.md (14,177,195); docs/COMPARISON.md (40,210,362);
55
+ skills/quality-gates.md (5,13,14-17,19-66,69-82,650,655,668); skills/00-index.md
56
+ (51). CHANGELOG.md: NEW top entry ONLY; never rewrite historical entries
57
+ (5837/6181/6335/6340).
58
+
59
+ ## 2. P0-1 Coverage honesty (Fix B) -- Slice A (run.sh owner) + Slice B (docs)
60
+ - run.sh: remove dead `local coverage_pct=0` (7038). Relabel logs: 13966
61
+ "test suite (pass/fail)"; 7265/7270 "Test suite gate".
62
+ - KEEP the min_coverage JSON field at 7257 (consumed by autonomy/loki:27529-27530,
63
+ 16138 and asserted in tests/test-report-command.sh:116,
64
+ tests/test-completion-council-affirmative-evidence.sh:126,
65
+ tests/test-evidence-gate.sh:155). Only change misleading consumer strings in
66
+ autonomy/loki (27530, 16138) to "Min coverage TARGET (not measured)".
67
+ - docs (skills/quality-gates.md): :13 drop ">80% coverage" -> "coverage % not
68
+ measured in this release"; :650/:655 reword to pass/fail + target-only; :668
69
+ remove coverage.json artifact line. Note Fix A (real measurement) as follow-up.
70
+
71
+ ## 3. P0-2 Phantom guardrails -- Slice B (docs only)
72
+ Remove gates 1 & 5 entirely (do not "mark planned"). Renumber to the 8-gate
73
+ table. Edit skills/quality-gates.md:5-17, wiki/Quality-Gates.md:14-28, + all
74
+ list files in section 1.
75
+
76
+ ## 4. P0-3 Wire detectors -- Slice A (run.sh) + Slice D (scripts) + Slice C (Bun)
77
+ Exit-code asymmetry (load-bearing):
78
+ - detect-mock-problems.sh exits 1 on CRITICAL/HIGH (179-182), 0 otherwise.
79
+ Exit code already = block-on-HIGH.
80
+ - detect-test-mutations.sh exits 0 unless --strict; --strict blocks on ANY
81
+ finding (over-blocks MED/LOW). DO NOT use --strict. Wrapper greps stdout for
82
+ [HIGH] to decide block; route MED/LOW to findings injection.
83
+
84
+ New run.sh functions (place after run_magic_debate_gate ~7560):
85
+ enforce_mock_integrity() # HIGH -> return 1; MED/LOW -> findings file
86
+ enforce_mutation_integrity() # grep -c '\[HIGH\]' >0 -> return 1; MED/LOW -> findings
87
+ Both cd "${TARGET_DIR}", use LOKI_GATE_TIMEOUT wrapping, write findings into
88
+ ${TARGET_DIR}/.loki/quality/ for the Phase-1 findings injector.
89
+
90
+ Orchestration insert: after the pause-check at 13983, before code-review at
91
+ 13985. Mirror the existing pattern with track_gate_failure/clear_gate_failure +
92
+ gate_failures string. Toggles LOKI_GATE_MOCK / LOKI_GATE_MUTATION (matches
93
+ existing LOKI_GATE_DOC_COVERAGE / LOKI_GATE_MAGIC_DEBATE convention).
94
+
95
+ Detector-script (Slice D): optional --block-high mode on detect-test-mutations.sh
96
+ (exit 2 on HIGH) keeping --strict intact; OR rely on wrapper grep (no script
97
+ change). Verify detect-mock-problems.sh exit semantics. Do NOT touch run.sh.
98
+
99
+ ## 5. P0-4 Anti-sycophancy acts -- Slice A (run.sh) + Slice C (Bun)
100
+ Read run_code_review 7788-8316 first. At 8316-8323 unanimous block: dispatch ONE
101
+ Devil's-Advocate reviewer reusing the existing reviewer-invocation +
102
+ parse_verdict helpers; if DA returns Crit/High set has_blocking=true so the
103
+ EXISTING block at 8326-8330 fires (return 1). Keep anti-sycophancy.txt for audit.
104
+ Gate behind LOKI_GATE_DEVILS_ADVOCATE (default true).
105
+
106
+ ## 6. P0-5 Honest per-gate table -- Slice B (docs)
107
+ Replace skills/quality-gates.md:5-17 + prose 19-82 with the 8-gate table plus
108
+ columns: detects X / does NOT detect Y / opt-out flag / blocking. Honesty
109
+ entries: gate 2 "does NOT detect coverage %"; gate 5 "does NOT detect semantic
110
+ correctness of mocks"; gate 6 "does NOT detect logically-correct-but-weak
111
+ assertions".
112
+
113
+ ## 7. Bash <-> Bun parity matrix
114
+ | Change | Bun mirror | File |
115
+ |--------|-----------|------|
116
+ | P0-1 label/honesty | Yes (light) | quality_gates.ts runTestCoverage (402): no false % strings |
117
+ | P0-2 gate count | docs only | -- |
118
+ | P0-3 mock gate | Yes | quality_gates.ts: add mock_integrity to GateName (69-74) + runMockIntegrity + sequence (1474-1480) + toggle |
119
+ | P0-3 mutation gate | Yes | quality_gates.ts: add mutation_integrity + runMutationIntegrity + sequence + toggle |
120
+ | P0-4 devil's advocate | Yes | quality_gates.ts runCodeReview (709), inert at 804-808: add DA dispatch + block |
121
+ | P0-5 doc table | docs only | -- |
122
+ Bun escalation ladder is generic; new gates inherit once added to union+sequence.
123
+
124
+ ## 8. Slice boundaries (independent; no file collisions)
125
+ - Slice A -- run.sh runtime (ONE owner, serialized): P0-1 (run.sh + autonomy/loki
126
+ strings), P0-3 new funcs + orchestration insert, P0-4. Owns autonomy/run.sh +
127
+ autonomy/loki exclusively.
128
+ - Slice B -- Docs (ONE owner): P0-2 + P0-5 + all "11->8 gates" edits. Both edit
129
+ skills/quality-gates.md so MUST be one slice. New CHANGELOG entry only.
130
+ - Slice C -- Bun parity (ONE owner): loki-ts/src/runner/quality_gates.ts only.
131
+ - Slice D -- Detector scripts (ONE owner): tests/detect-test-mutations.sh
132
+ --block-high; verify detect-mock-problems.sh. No run.sh.
133
+ - Slice E -- SDET tests (ONE owner; after A/C/D): fixtures + assertions.
134
+ Order: D and B parallel anytime; A depends on D contract; C mirrors A; E last.
135
+
136
+ ## 9. Test plan (SDET, Slice E)
137
+ - P0-1: grep assert no ">80%"/"min_coverage: 80% # Never drop"/"coverage.json"
138
+ in any list doc. Behavior: passing tests pass, failing tests block.
139
+ - P0-2: grep assert zero live "11 gates"/"Input Guardrails"/"Output Guardrails"
140
+ (CHANGELOG excepted); "8" present in quality-gates.md + wiki.
141
+ - P0-3 mock: fixture with tautological assertion -> enforce_mock_integrity
142
+ returns 1, BLOCKS, track_gate_failure increments. Clean -> 0, clears. MED-only
143
+ -> 0 + findings file.
144
+ - P0-3 mutation: fixture commit changing assertion values + impl (HIGH) ->
145
+ returns 1, BLOCKS. MED-only -> 0 + findings (proves not over-blocking).
146
+ - P0-4: unanimous PASS + DA High -> run_code_review returns 1. Unanimous PASS +
147
+ DA clean -> 0 + anti-sycophancy.txt exists.
148
+ - Parity: Bun sequence includes mock_integrity + mutation_integrity; runCodeReview
149
+ blocks on DA High; existing loki-ts tests green.
150
+
151
+ ## 10. Risks + binding constraints
152
+ Risks: (1) min_coverage JSON field has live consumers + 3 test assertions -- keep
153
+ field, fix strings only. (2) mutation --strict over-blocks -- parse HIGH instead.
154
+ (3) detectors run against TARGET project test files -- cd TARGET_DIR + timeout
155
+ wrap. (4) stale cross-file comment line refs exist; do not chase, do not add new.
156
+
157
+ Binding constraints (every dev agent): NO version bumps (integrator once); NO
158
+ commits/push; NO emojis; NO em dashes; full gate applies (touches runtime/gates/
159
+ parity); stay inside your slice file ownership; run.sh is single-owner.
160
+
161
+ Canonical count decision: 8 (recommended). Keeping backward-compat numbered
162
+ would make it 9 but reintroduces the listed-but-not-a-loop-gate honesty gap this
163
+ sweep exists to close.