loki-mode 7.45.0 → 7.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -12
- package/SKILL.md +5 -5
- package/VERSION +1 -1
- package/autonomy/CONSTITUTION.md +9 -2
- package/autonomy/lib/sentrux-gate.sh +1 -1
- package/autonomy/loki +2 -2
- package/autonomy/run.sh +355 -92
- package/dashboard/__init__.py +1 -1
- package/dashboard/registry.py +156 -62
- package/dashboard/server.py +9 -10
- package/docs/COMPARISON.md +10 -10
- package/docs/COMPETITIVE-ANALYSIS.md +1 -1
- package/docs/INSTALLATION.md +2 -2
- package/docs/P0-SWEEP-PLAN.md +163 -0
- package/docs/architecture/STATE-MACHINES.md +18 -19
- package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +1 -1
- package/docs/auto-claude-comparison.md +14 -11
- package/docs/certification/01-core-concepts/lesson.md +12 -11
- package/docs/certification/01-core-concepts/quiz.md +6 -6
- package/docs/certification/05-troubleshooting/lesson.md +23 -13
- package/docs/certification/05-troubleshooting/quiz.md +3 -3
- package/docs/certification/answer-key.md +2 -2
- package/docs/certification/certification-exam.md +9 -9
- package/docs/competitive/bolt-new-analysis.md +1 -1
- package/docs/competitive/emergence-others-analysis.md +9 -9
- package/docs/competitive/replit-lovable-analysis.md +3 -3
- package/docs/cursor-comparison.md +15 -12
- package/docs/dashboard-guide.md +9 -7
- package/docs/prd-purple-lab-platform-v2.md +1 -1
- package/docs/prd-purple-lab-platform.md +3 -3
- package/docs/show-hn-post.md +2 -2
- package/loki-ts/dist/loki.js +2 -2
- package/mcp/__init__.py +1 -1
- package/package.json +2 -2
- package/plugins/loki-mode/.claude-plugin/plugin.json +2 -2
- package/plugins/loki-mode/README.md +1 -1
- package/references/magic-rarv-integration.md +1 -1
- package/references/quality-control.md +5 -5
- package/references/sdlc-phases.md +1 -2
- package/skills/00-index.md +1 -1
- package/skills/artifacts.md +1 -1
- package/skills/healing.md +1 -1
- package/skills/magic-modules.md +3 -3
- package/skills/quality-gates.md +52 -39
- package/skills/testing.md +1 -1
package/skills/artifacts.md
CHANGED
package/skills/healing.md
CHANGED
|
@@ -43,7 +43,7 @@ friction_detection:
|
|
|
43
43
|
rule: "Before 'fixing' any quirk, verify it is not an undocumented business rule"
|
|
44
44
|
action: "Document in .loki/healing/friction-map.json"
|
|
45
45
|
classification:
|
|
46
|
-
business_rule: "Keep and document.
|
|
46
|
+
business_rule: "Keep and document. The backward-compatibility / legacy-healing auditor (healing mode) blocks removal."
|
|
47
47
|
true_bug: "Fix with characterization test proving the fix."
|
|
48
48
|
unknown: "Keep until classified. NEVER remove unknown friction."
|
|
49
49
|
```
|
package/skills/magic-modules.md
CHANGED
|
@@ -84,8 +84,8 @@ The combination means: specs drive generation, debate drives quality, and the re
|
|
|
84
84
|
|
|
85
85
|
### With Quality Gates
|
|
86
86
|
|
|
87
|
-
- Gate
|
|
88
|
-
- Gate
|
|
87
|
+
- Gate 7 (documentation coverage) now includes component docs -- each spec becomes part of COMPONENTS.md
|
|
88
|
+
- Gate 2 (test suite) applies to generated tests in `.loki/magic/generated/tests/`
|
|
89
89
|
- A new healing-style hook blocks merging when a component's spec has been manually edited but the implementation was not regenerated
|
|
90
90
|
|
|
91
91
|
---
|
|
@@ -190,7 +190,7 @@ loki magic diff Button
|
|
|
190
190
|
|-------|-------------|
|
|
191
191
|
| `skills/healing.md` | Healing-style hooks protect spec edits; friction-map tracks manually edited generated files |
|
|
192
192
|
| `skills/documentation.md` | Component specs feed COMPONENTS.md; registry feeds ARCHITECTURE.md |
|
|
193
|
-
| `skills/quality-gates.md` | Gate
|
|
193
|
+
| `skills/quality-gates.md` | Gate 7 includes component doc coverage; Magic Modules debate (gate 8) block = gate failure |
|
|
194
194
|
| `skills/agents.md` | `component-designer`, `a11y-auditor` agent types map to personas |
|
|
195
195
|
| `skills/testing.md` | Generated Vitest and Playwright tests execute under the normal test gates |
|
|
196
196
|
| `skills/artifacts.md` | Generated components count as artifacts and flow through the artifact pipeline |
|
package/skills/quality-gates.md
CHANGED
|
@@ -2,25 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
**Never ship code without passing all quality gates.**
|
|
4
4
|
|
|
5
|
-
## The
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**
|
|
5
|
+
## The 8 Quality Gates
|
|
6
|
+
|
|
7
|
+
Every gate below is wired into the orchestration loop (`autonomy/run.sh`) and
|
|
8
|
+
blocks completion when it fails. The table lists exactly what each gate detects,
|
|
9
|
+
what it does NOT detect (so you never over-trust a green gate), its opt-out flag,
|
|
10
|
+
and its blocking behavior. Transcribe this list verbatim; do not recompute it.
|
|
11
|
+
|
|
12
|
+
| # | Gate | Detects | Does NOT detect | Blocking | Opt-out flag |
|
|
13
|
+
|---|------|---------|-----------------|----------|--------------|
|
|
14
|
+
| 1 | Static Analysis | CodeQL, ESLint/Pylint, type-checker findings on the diff | Logic bugs that pass the linters | Yes (severity ladder) | `PHASE_STATIC_ANALYSIS=false` |
|
|
15
|
+
| 2 | Test Suite (pass/fail) | Whether the project test runner passes or fails (red blocks) | Coverage % (not measured in this release) | Yes (red blocks) | `PHASE_UNIT_TESTS=false` |
|
|
16
|
+
| 3 | Blind Code Review (3-reviewer council + severity blocking) | Correctness/security/design issues via 3 blind reviewers; Critical/High block, Medium/Low advisory | Issues none of the 3 reviewers surface | Yes (Crit/High block) | `PHASE_CODE_REVIEW=false` |
|
|
17
|
+
| 4 | Anti-Sycophancy / Devil's Advocate (on unanimous PASS) | Sycophantic unanimous approvals: a Devil's Advocate re-review on a unanimous PASS; its Crit/High findings block | Problems the Devil's Advocate reviewer also misses | Yes (DA Crit/High block) | `LOKI_GATE_DEVILS_ADVOCATE=false` |
|
|
18
|
+
| 5 | Mock Integrity Detector | Tautological assertions, internal-mock ratio, tests that do not import source (`tests/detect-mock-problems.sh`); HIGH blocks | Semantic correctness of mocks (whether a mock faithfully models the real dependency) | Yes (HIGH blocks) | `LOKI_GATE_MOCK=false` |
|
|
19
|
+
| 6 | Test Mutation Detector | Assertion-value churn alongside implementation changes (test-fitting), low assertion density (`tests/detect-test-mutations.sh`); HIGH blocks | Logically-correct-but-weak assertions | Yes (HIGH blocks) | `LOKI_GATE_MUTATION=false` |
|
|
20
|
+
| 7 | Documentation Coverage | README presence, docs freshness within 10 commits, API docs for exported symbols in packages | Whether the docs are accurate or useful | Yes | `LOKI_GATE_DOC_COVERAGE=false` |
|
|
21
|
+
| 8 | Magic Modules Debate | Spec-vs-implementation debate findings on generated Magic Modules; BLOCK-severity findings block | Issues outside the Magic Modules debate scope | Yes (BLOCK severity) | `LOKI_GATE_MAGIC_DEBATE=false` |
|
|
22
|
+
|
|
23
|
+
**Severity-based blocking** ties the review gates together: any Critical or High
|
|
24
|
+
finding blocks completion. Medium, Low, and cosmetic findings are advisory and
|
|
25
|
+
become TODO comments rather than blockers. It is the block policy inside code
|
|
26
|
+
review (gate 3), not a separate gate function.
|
|
27
|
+
|
|
28
|
+
**Follow-up (later release):** real coverage measurement (Fix A). Today gate 2
|
|
29
|
+
decides purely on the test runner's pass/fail; the coverage percentage is not
|
|
30
|
+
measured.
|
|
31
|
+
|
|
32
|
+
### Conditional auditor (not numbered): Backward Compatibility (v6.67.0)
|
|
33
|
+
|
|
34
|
+
This is a healing-mode SPECIALIST reviewer, not one of the 8 loop gates. It fires
|
|
35
|
+
only when `LOKI_HEAL_MODE=true`, when `loki heal` is active, or when the diff
|
|
36
|
+
touches files flagged in `.loki/healing/friction-map.json`. Greenfield projects
|
|
37
|
+
skip it entirely. To suppress on a healing project, set `LOKI_HEAL_MODE=false`.
|
|
38
|
+
|
|
39
|
+
**Purpose:** Prevent accidental removal of institutional logic or behavioral
|
|
40
|
+
changes to legacy code without explicit documentation.
|
|
24
41
|
|
|
25
42
|
**Checks:**
|
|
26
43
|
1. **Friction Safety** - If modified code matches a friction-map entry, verify `safe_to_remove` is true or `classification` is `true_bug`
|
|
@@ -36,14 +53,9 @@
|
|
|
36
53
|
- Missing adapter for replaced component = **High** (BLOCK)
|
|
37
54
|
- Behavioral baseline mismatch without documentation = **Medium** (BLOCK)
|
|
38
55
|
|
|
39
|
-
**Disabling**: gate 10 only fires when `LOKI_HEAL_MODE=true` or
|
|
40
|
-
`.loki/healing/friction-map.json` exists in the project root (v7.4.20).
|
|
41
|
-
Greenfield projects skip the auditor entirely. To suppress on a healing
|
|
42
|
-
project, set `LOKI_HEAL_MODE=false`.
|
|
43
|
-
|
|
44
56
|
---
|
|
45
57
|
|
|
46
|
-
## Gate
|
|
58
|
+
## Gate 7: Documentation Coverage (v6.75.0)
|
|
47
59
|
|
|
48
60
|
**Triggers when:** Diff touches public APIs, new files added, library/package releases
|
|
49
61
|
|
|
@@ -61,25 +73,27 @@ project, set `LOKI_HEAL_MODE=false`.
|
|
|
61
73
|
|
|
62
74
|
**Disabling (not recommended for packages):**
|
|
63
75
|
```bash
|
|
64
|
-
LOKI_GATE_DOC_COVERAGE=false # Disable gate
|
|
76
|
+
LOKI_GATE_DOC_COVERAGE=false # Disable gate 7
|
|
65
77
|
```
|
|
66
78
|
|
|
67
79
|
---
|
|
68
80
|
|
|
69
|
-
##
|
|
81
|
+
## Gates 5 and 6: Automated Test Integrity
|
|
70
82
|
|
|
71
|
-
|
|
83
|
+
Gate 5 (Mock Integrity Detector) and gate 6 (Test Mutation Detector) run during
|
|
84
|
+
the VERIFY phase and are enabled by default (opt-out, never opt-in).
|
|
72
85
|
|
|
73
86
|
**How they run:**
|
|
74
|
-
- Gate
|
|
75
|
-
- Gate
|
|
87
|
+
- Gate 5 runs `tests/detect-mock-problems.sh` against all test files in the project
|
|
88
|
+
- Gate 6 runs `tests/detect-test-mutations.sh` against recent commits (default: last 5, or use `--commit HASH` for targeted checks)
|
|
76
89
|
- Both produce findings at HIGH/MEDIUM/LOW severity levels
|
|
77
|
-
- HIGH findings = automatic FAIL (same as other blocking gates)
|
|
90
|
+
- HIGH findings = automatic FAIL (same as other blocking gates); MED/LOW route to the findings-injection file for the next iteration rather than blocking
|
|
78
91
|
|
|
79
|
-
**Disabling
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
**Disabling:**
|
|
93
|
+
```bash
|
|
94
|
+
LOKI_GATE_MOCK=false # Disable gate 5 (Mock Integrity Detector)
|
|
95
|
+
LOKI_GATE_MUTATION=false # Disable gate 6 (Test Mutation Detector)
|
|
96
|
+
```
|
|
83
97
|
|
|
84
98
|
---
|
|
85
99
|
|
|
@@ -647,12 +661,12 @@ velocity_quality_balance:
|
|
|
647
661
|
before_commit:
|
|
648
662
|
- static_analysis: "Run ESLint/Pylint/CodeQL - warnings must not increase"
|
|
649
663
|
- complexity_check: "Cyclomatic complexity must not increase >10%"
|
|
650
|
-
-
|
|
664
|
+
- test_suite: "Tests must pass (coverage % not measured in this release)"
|
|
651
665
|
|
|
652
666
|
thresholds:
|
|
653
667
|
max_new_warnings: 0 # Zero tolerance for new warnings
|
|
654
668
|
max_complexity_increase: 10% # Per file, per commit
|
|
655
|
-
|
|
669
|
+
coverage_target: 80% # Target/threshold only; not measured this release (Fix A follow-up)
|
|
656
670
|
|
|
657
671
|
if_threshold_violated:
|
|
658
672
|
action: "BLOCK commit, fix before proceeding"
|
|
@@ -665,7 +679,6 @@ velocity_quality_balance:
|
|
|
665
679
|
.loki/metrics/quality/
|
|
666
680
|
+-- warnings.json # Static analysis warning count over time
|
|
667
681
|
+-- complexity.json # Cyclomatic complexity per file
|
|
668
|
-
+-- coverage.json # Test coverage percentage
|
|
669
682
|
+-- velocity.json # Lines added/commits per hour
|
|
670
683
|
+-- ratio.json # Quality/Velocity ratio (must stay positive)
|
|
671
684
|
```
|
|
@@ -872,7 +885,7 @@ Task(prompt="Stage 2: Check code quality ONLY...")
|
|
|
872
885
|
|----------|--------|
|
|
873
886
|
| Critical | BLOCK - fix immediately |
|
|
874
887
|
| High | BLOCK - fix before commit |
|
|
875
|
-
| Medium |
|
|
888
|
+
| Medium | Advisory - TODO comment, fix recommended |
|
|
876
889
|
| Low | TODO comment, fix later |
|
|
877
890
|
| Cosmetic | Note, optional fix |
|
|
878
891
|
|
package/skills/testing.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
6. If you believe a test expectation is incorrect, document WHY and flag for council review. Do not silently change it.
|
|
11
11
|
7. Every test file must have at least one assertion per tested function.
|
|
12
12
|
|
|
13
|
-
Gate
|
|
13
|
+
Gate 5 (mock integrity detector) and Gate 6 (mutation detector) enforce rules 3-5 automatically.
|
|
14
14
|
Violations result in automatic FAIL during VERIFY phase.
|
|
15
15
|
|
|
16
16
|
---
|