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.
- package/README.md +68 -650
- package/SKILL.md +5 -5
- package/VERSION +1 -1
- package/autonomy/completion-council.sh +2 -2
- package/autonomy/context-tracker.py +4 -4
- package/autonomy/council-v2.sh +1 -1
- package/autonomy/grill.sh +1 -1
- package/autonomy/lib/done-recognition.sh +1 -1
- package/autonomy/lib/efficiency_cost.py +8 -0
- package/autonomy/lib/engine10-push.sh +22 -8
- package/autonomy/lib/prd-enrich.sh +1 -1
- package/autonomy/lib/voter-agents.sh +1 -1
- package/autonomy/loki +161 -105
- package/autonomy/run.sh +30 -18
- package/autonomy/sandbox.sh +1 -1
- package/autonomy/tui.sh +6 -5
- package/autonomy/verify.sh +1 -1
- package/bin/loki +195 -59
- package/completions/_loki +8 -0
- package/completions/loki.bash +3 -3
- package/dashboard/__init__.py +1 -1
- package/dashboard/server.py +47 -45
- package/docs/AGENT-CHANGE-RECEIPT.md +2 -2
- package/docs/ARCHITECTURE.md +337 -0
- package/docs/BRANDING.md +124 -0
- package/docs/CLI-REFERENCE.md +11 -1
- package/docs/COMPONENTS.md +447 -0
- package/docs/DEPLOYMENT.md +9 -9
- package/docs/DOCKER.md +469 -0
- package/docs/INSTALLATION.md +67 -1045
- package/docs/KNOWN-ISSUES.md +11 -35
- package/docs/OTEL-COLLECTOR.md +24 -0
- package/docs/ROUTING-EVIDENCE.md +32 -0
- package/docs/TESTING.md +161 -0
- package/docs/air-gapped.md +1 -2
- package/docs/alternative-installations.md +14 -24
- package/docs/architecture/DECISIONS.md +333 -0
- package/docs/audit-logging.md +7 -7
- package/docs/authentication.md +3 -3
- package/docs/authorization.md +1 -1
- package/docs/certification/04-production-deployment/lab.md +6 -6
- package/docs/certification/04-production-deployment/lesson.md +4 -4
- package/docs/certification/README.md +1 -1
- package/docs/control-plane-container.md +2 -2
- package/docs/dev/real-run.md +34 -0
- package/docs/dev/release-checklist.md +2 -2
- package/docs/environment-variables.md +1 -0
- package/docs/exit-codes.md +3 -3
- package/docs/git-workflow.md +3 -3
- package/docs/metrics.md +37 -55
- package/docs/network-security.md +1 -1
- package/docs/siem-integration.md +5 -5
- package/docs/spec-first-intent.md +28 -0
- package/docs/v10/CLI-MODERN.md +7 -3
- package/docs/v10/DECISIONS.md +59 -0
- package/docs/v10/DEPS.md +22 -22
- package/docs/v10/ENGINE.md +1 -1
- package/docs/v10/FAILURE-CLASSES.md +212 -1
- package/docs/v10/FOUNDER-QUEUE.md +1 -0
- package/docs/v10/GUARDS.md +31 -0
- package/docs/v10/GUIDE.md +7 -5
- package/docs/v10/LEGACY-REMOVAL.md +4 -6
- package/docs/v10/METRICS.md +14 -2
- package/docs/v10/MODERNIZE.md +1 -1
- package/docs/v10/OPERATING-MODEL.md +4 -3
- package/docs/v10/PROGRESS.md +35 -0
- package/docs/v11/COST-HALF.md +352 -0
- package/docs/v11/INTOTO-AGENT-CHANGE-PREDICATE.md +77 -0
- package/docs/v11/MARKET-SLICES.md +315 -0
- package/docs/v11/MCP-2026-07-28.md +55 -0
- package/docs/v11/REGISTRIES.md +730 -0
- package/docs/v11/VERIFY-PR-SANDBOX.md +41 -0
- package/loki-ts/data/model-pricing.json +52 -24
- package/loki-ts/dist/loki.js +1185 -945
- package/mcp/__init__.py +1 -1
- package/mcp/v10_tools.py +29 -0
- package/package.json +9 -11
- package/packages/control-plane/dist/ask-tools-server.js +8 -2
- package/packages/control-plane/dist/server.js +15832 -12361
- package/packages/control-plane/drizzle/0006_token_sessions.sql +1 -0
- package/packages/control-plane/drizzle/meta/0006_snapshot.json +807 -0
- package/packages/control-plane/drizzle/meta/_journal.json +7 -0
- package/packages/control-plane/src/db/schema.ts +1 -0
- package/packages/control-plane/src/server/routes/cost.ts +4 -3
- package/packages/control-plane/src/server/runs.ts +3 -3
- package/packages/control-plane/ui/dist/assets/index-DbLzr87u.js +190 -0
- package/packages/control-plane/ui/dist/index.html +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/providers/opencode.sh +2 -3
- package/src/observability/genai-spans.js +104 -0
- package/src/observability/otel-bridge.js +49 -1
- package/src/observability/otel.js +2 -2
- package/src/protocols/mcp-client.js +6 -2
- package/src/protocols/mcp-server.js +191 -6
- package/src/protocols/transport/sse.js +23 -2
- package/tools/audit-docs.py +1 -1
- package/web-app/dist/assets/{AdminPage-D_e45uTw.js → AdminPage-DuRQZsF9.js} +1 -1
- package/web-app/dist/assets/{Avatar-T3nIpoaf.js → Avatar-7GtOQvsO.js} +1 -1
- package/web-app/dist/assets/{Badge-BKqb59pP.js → Badge-CYgTnIxj.js} +1 -1
- package/web-app/dist/assets/{Button-DjVlkh8_.js → Button-rYSyIu7X.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-DXJgLGmh.js → CockpitPage-9adANY4o.js} +1 -1
- package/web-app/dist/assets/{ComparePage-BRP_eVc_.js → ComparePage-DEG2oA-R.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-CLjpGLjC.js → ErrorBoundary-CwtvY4xs.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-DX-vb4Xy.js → EvidenceReceiptPanel-DTT73pPB.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-214HVHtX.js → GitHubIssuesPanel-CpWZLz2x.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-BEiZKc4t.js → GitHubPRsPanel-H293R7E2.js} +1 -1
- package/web-app/dist/assets/{HomePage-VvMHS5ga.js → HomePage-B11Imp9k.js} +2 -2
- package/web-app/dist/assets/{LoginPage-5WD-v7n3.js → LoginPage-BZBgx5Jr.js} +1 -1
- package/web-app/dist/assets/{MagicPage-DUQT_Jye.js → MagicPage-B27S4_X8.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-lga-z79v.js → MetricsPage-CfbJWNDG.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-CGhBX3G1.js → NotFoundPage-Tp_4zMSm.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-CdzF2GzZ.js → ProjectPage-CM4fgMsV.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-DRG64N8s.js → ProjectsPage-DP2Fvsrd.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-5fzW9Frb.js → SettingsPage-C4G9-EAy.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-DrTdxO4y.js → ShowcasePage-Dj-n4dwu.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-C9Mqs6Rd.js → SystemSettingsPage-BqMLpuGt.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-CUGPdSWo.js → TeamsPage-mIH8H96m.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-CNraDY0F.js → TemplatesPage-BagW-v4n.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-BIu_6Pea.js → TerminalOutput-CTQRHhnK.js} +1 -1
- package/web-app/dist/assets/{activity-Bk-kgqaf.js → activity-DNQiBDDL.js} +1 -1
- package/web-app/dist/assets/{bell-BXmUdmo8.js → bell-Coiwdad1.js} +1 -1
- package/web-app/dist/assets/{bot-CiuzXxUR.js → bot-Cou-rTgR.js} +1 -1
- package/web-app/dist/assets/{check-BEzjXppd.js → check-CsF-XtQp.js} +1 -1
- package/web-app/dist/assets/{chevron-left-AYWCXHf8.js → chevron-left-BJiy55Ht.js} +1 -1
- package/web-app/dist/assets/{circle-alert-BNg2uSRq.js → circle-alert-D6-pQQWq.js} +1 -1
- package/web-app/dist/assets/{clock-DTj0kkGT.js → clock-BOGqwgt9.js} +1 -1
- package/web-app/dist/assets/{cloud-x4nTDBLT.js → cloud-DsxhTtf5.js} +1 -1
- package/web-app/dist/assets/{code-xml-BVh_MLrk.js → code-xml-CxJDHUlE.js} +1 -1
- package/web-app/dist/assets/{database-DdfBaowG.js → database-BJePscl_.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-XuYFmAOY.js → dollar-sign-6qWGAkZo.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-D4cRnmeL.js → file-code-corner-DcOtYeDb.js} +1 -1
- package/web-app/dist/assets/{file-plus-CyoVlHc_.js → file-plus-WuRyLFo0.js} +1 -1
- package/web-app/dist/assets/{globe-Y6IK2RPW.js → globe-r-xCP4DE.js} +1 -1
- package/web-app/dist/assets/{hammer-BKzr9VZI.js → hammer-DTt0SsCB.js} +1 -1
- package/web-app/dist/assets/{index-B20cSx5G.js → index-BkbXyH8y.js} +3 -3
- package/web-app/dist/assets/{layers-DebNOhGS.js → layers-BvZhvSMY.js} +1 -1
- package/web-app/dist/assets/{loader-circle-DyGbrEgd.js → loader-circle-3gosTei9.js} +1 -1
- package/web-app/dist/assets/{lock-BKPpyt20.js → lock-CZZMxP0U.js} +1 -1
- package/web-app/dist/assets/{package-egF5Wi4y.js → package-C5A8CkJr.js} +1 -1
- package/web-app/dist/assets/{plus-OiEgKIc-.js → plus-Btv7tTIF.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-CzKvrONq.js → refresh-cw-DsWLXgs_.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-Bu2mII0p.js → rotate-ccw-DOVDjway.js} +1 -1
- package/web-app/dist/assets/{scroll-text-CSkiyax8.js → scroll-text-smySzlrX.js} +1 -1
- package/web-app/dist/assets/{server-DlPthJFw.js → server-b5PHsqAU.js} +1 -1
- package/web-app/dist/assets/{shield-alert-CbpHWQQX.js → shield-alert-BD7FDlh-.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-DgGpZe-Q.js → thumbs-up-CAsFzbyE.js} +1 -1
- package/web-app/dist/assets/{trash-2-BV3GlCB-.js → trash-2-BJ35qHgl.js} +1 -1
- package/web-app/dist/assets/{trending-down-Y4TJtXhD.js → trending-down-Ozrd26cZ.js} +1 -1
- package/web-app/dist/assets/{trending-up-DsDNoHZY.js → trending-up-BhnMcM32.js} +1 -1
- package/web-app/dist/assets/{upload-gkThrc_I.js → upload-JVHfdwoA.js} +1 -1
- package/web-app/dist/assets/{usePolling-jpNSeNAe.js → usePolling-CTzbDV-e.js} +1 -1
- package/web-app/dist/assets/{user-3Zez1WOK.js → user-Bks3-GYv.js} +1 -1
- package/web-app/dist/index.html +1 -1
- package/docs/ARCHITECTURE-OVERVIEW.md +0 -209
- package/docs/AUTONOMI-ECOSYSTEM.md +0 -107
- package/docs/COCKPIT-SPEC.md +0 -72
- package/docs/COCKPIT-UX-MANDATE.md +0 -53
- package/docs/COMPETITIVE-ANALYSIS.md +0 -303
- package/docs/COMPETITIVE-NEXT-10.md +0 -316
- package/docs/COMPETITIVE-RALPH-ZEROSHOT-2026-07-08.md +0 -81
- package/docs/DASHBOARD-9.12-EVIDENCE.md +0 -97
- package/docs/DASHBOARD-ARCHITECTURE.md +0 -425
- package/docs/DASHBOARD_V2_CHECKLIST.md +0 -243
- package/docs/DEMOS.md +0 -63
- package/docs/ENTERPRISE-IDENTITY-ROADMAP.md +0 -206
- package/docs/EVIDENCE-RECEIPT-BUILD-APPLICABILITY.md +0 -79
- package/docs/FEAT-PRDREUSE-DOCKER-PLAN.md +0 -144
- package/docs/GATE-FAILURE-TRIAGE.md +0 -254
- package/docs/HANDOFF-2026-08-03.md +0 -439
- package/docs/LOOP-CANDIDATE-PROPOSAL-v1.md +0 -167
- package/docs/LOOP-HARNESS-AUDIT.md +0 -684
- package/docs/MERGE-DEDUP-MAP.md +0 -420
- package/docs/MERGE-ROUTE-MAP.md +0 -139
- package/docs/MODEL-REGISTRY-PLAN.md +0 -155
- package/docs/OUTCOME-FRONTIER.md +0 -536
- package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +0 -192
- package/docs/PLANS-INDEX.md +0 -32
- package/docs/PRD-REUSE-DONE-RECOGNITION-PLAN.md +0 -536
- package/docs/PROMPT-ABLATION-RESULT.md +0 -97
- package/docs/R4-TRUST-TRAJECTORY-DESIGN.md +0 -127
- package/docs/R5-AUTO-WIKI-DESIGN.md +0 -137
- package/docs/R6-ROLLBACK-CHECKPOINT-PLAN.md +0 -107
- package/docs/R7-ZERO-CONFIG-FIRST-RUN-PLAN.md +0 -137
- package/docs/R8-SHAREABLE-TEAM-ASSETS-PLAN.md +0 -129
- package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +0 -113
- package/docs/RARV-C-100X-PLAN.md +0 -286
- package/docs/RARV-C-LOOP-EFFICIENCY-PLAN.md +0 -470
- package/docs/SHAREABLE-PROOF-PLAN.md +0 -194
- package/docs/SONNET5-DEFAULT-PLAN.md +0 -157
- package/docs/SPEED-AND-FIRST-PASS-PLAN.md +0 -281
- package/docs/STALE-STATE-AUDIT.md +0 -174
- package/docs/SYNERGY-TASKS.md +0 -143
- package/docs/TASKLIST-ACCURACY-PLAN.md +0 -355
- package/docs/TOP-100-BACKLOG.md +0 -159
- package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +0 -114
- package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +0 -45
- package/docs/V8-MAJOR-RELEASE-PLAN.md +0 -137
- package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +0 -82
- package/docs/V8-SDK-RESEARCH-RAW.md +0 -129
- package/docs/WELCOME-OPENER-PLAN.md +0 -106
- package/docs/adoption-baseline-2026-07-31.md +0 -84
- package/docs/architecture/bmad-integration-epic.md +0 -271
- package/docs/architecture/bmad-integration-review.md +0 -86
- package/docs/architecture/bmad-integration-validation.md +0 -249
- package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +0 -61
- package/docs/auto-claude-comparison.md +0 -250
- package/docs/bug-fixes/agent-01-cli-fixes.md +0 -101
- package/docs/bug-fixes/agent-02-purplelab-fixes.md +0 -88
- package/docs/bug-fixes/agent-03-dashboard-fixes.md +0 -119
- package/docs/bug-fixes/agent-04-memory-fixes.md +0 -105
- package/docs/bug-fixes/agent-05-provider-fixes.md +0 -86
- package/docs/bug-fixes/agent-06-integration-fixes.md +0 -101
- package/docs/bug-fixes/agent-07-dash-run-fixes.md +0 -101
- package/docs/bug-fixes/agent-08-docker-fixes.md +0 -164
- package/docs/bug-fixes/agent-09-e2e-build-fixes.md +0 -69
- package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +0 -102
- package/docs/bug-fixes/agent-11-e2e-session-fixes.md +0 -70
- package/docs/bug-fixes/agent-12-scenario-fixes.md +0 -120
- package/docs/bug-fixes/agent-13-enterprise-fixes.md +0 -143
- package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +0 -88
- package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +0 -132
- package/docs/bug-fixes/agent-19-code-review.md +0 -316
- package/docs/bug-fixes/agent-20-architecture-review.md +0 -331
- package/docs/competitive/bolt-new-analysis.md +0 -579
- package/docs/competitive/emergence-others-analysis.md +0 -605
- package/docs/competitive/replit-lovable-analysis.md +0 -622
- package/docs/dashboard-guide.md +0 -487
- package/docs/enterprise/migration.md +0 -265
- package/docs/history/one-run-audit.md +0 -304
- package/docs/plans/FORGE-AUTONOMOUS-QUEUE.md +0 -312
- package/docs/plans/ULTRAPLAN-FORGE-BAAS.md +0 -612
- package/docs/plans/UT2-6-LSP-DIAGNOSTIC-BROADCAST.md +0 -394
- package/docs/prd-purple-lab-ide.md +0 -152
- package/docs/prd-purple-lab-platform-v2.md +0 -223
- package/docs/prd-purple-lab-platform.md +0 -319
- package/docs/retrospectives/v7.5.15-fleet-postmortem.md +0 -325
- package/docs/retrospectives/v7.5.15-honesty-audit.md +0 -136
- package/docs/retrospectives/v7.5.15-llm-failure-modes.md +0 -49
- package/docs/show-hn-post.md +0 -46
- package/docs/test-scenarios/enterprise-scenarios.md +0 -732
- package/docs/thick2thin.md +0 -173
- package/packages/control-plane/ui/dist/assets/index-DcBJXjCJ.js +0 -190
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Architectural Decision Records
|
|
2
|
+
|
|
3
|
+
This document records the significant architectural decisions for **loki-mode**,
|
|
4
|
+
an autonomous spec-to-product system. Each record captures the context in which
|
|
5
|
+
a decision was made, the decision itself, and the consequences that follow.
|
|
6
|
+
|
|
7
|
+
Decisions are listed newest-first by ADR number. A decision marked **Superseded**
|
|
8
|
+
remains for historical reference; the record that replaces it is named inline.
|
|
9
|
+
|
|
10
|
+
For the detailed runtime-migration record, see
|
|
11
|
+
`docs/architecture/ADR-001-runtime-migration.md`. The summary below mirrors its
|
|
12
|
+
high-level conclusions.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ADR-001: Migrate the orchestrator runtime from bash to Bun/TypeScript
|
|
17
|
+
|
|
18
|
+
**Status:** Accepted (phased; bash sunset gated on a clean soak)
|
|
19
|
+
|
|
20
|
+
### Context
|
|
21
|
+
|
|
22
|
+
The original orchestrator was implemented as two very large bash programs:
|
|
23
|
+
`autonomy/run.sh` (the RARV-C iteration loop) and `autonomy/loki` (the CLI, with
|
|
24
|
+
100+ command handlers). At over 10,000 lines each they were untyped, fragile,
|
|
25
|
+
and hard to refactor or test. As the product grew, the cost of changing core
|
|
26
|
+
control flow in bash kept rising, and the lack of static typing meant defects
|
|
27
|
+
surfaced only at runtime in users' terminals.
|
|
28
|
+
|
|
29
|
+
### Decision
|
|
30
|
+
|
|
31
|
+
Port the orchestrator and CLI to TypeScript running on Bun (`loki-ts/`). Ship the
|
|
32
|
+
migration in phases (scaffold, read-only commands, build tooling, outer loop,
|
|
33
|
+
council and code review, then bash sunset) rather than as a single rewrite. A
|
|
34
|
+
`bin/loki` shim routes ported commands to the Bun CLI and falls through to the
|
|
35
|
+
bash implementation for the rest. `LOKI_LEGACY_BASH=1` forces the bash route as a
|
|
36
|
+
rollback escape hatch.
|
|
37
|
+
|
|
38
|
+
### Consequences
|
|
39
|
+
|
|
40
|
+
- Both runtimes coexist during the migration, so every behavior must be verified
|
|
41
|
+
for cross-route parity. A dedicated parity matrix in CI guards against drift.
|
|
42
|
+
- New work lands in typed TypeScript with `bun test` coverage; the bash code is
|
|
43
|
+
frozen and only patched for parity.
|
|
44
|
+
- The final phase (deleting `run.sh` and `autonomy/loki`, removing the legacy
|
|
45
|
+
flag) is deliberately gated behind a multi-week clean soak with zero parity
|
|
46
|
+
regressions, rather than shipped on a date.
|
|
47
|
+
- Carrying two implementations is real maintenance overhead until sunset, traded
|
|
48
|
+
for a safe, reversible rollout.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## ADR-002: Provider-agnostic execution with automatic failover
|
|
53
|
+
|
|
54
|
+
**Status:** Accepted
|
|
55
|
+
|
|
56
|
+
### Context
|
|
57
|
+
|
|
58
|
+
Tying the system to a single AI vendor would be a hard dependency and a single
|
|
59
|
+
point of failure. Users run different coding agents (Claude Code, OpenAI Codex
|
|
60
|
+
CLI, Cline, Aider) with different capabilities, and the product positioning
|
|
61
|
+
("no vendor lock-in") requires running on more than one.
|
|
62
|
+
|
|
63
|
+
### Decision
|
|
64
|
+
|
|
65
|
+
Abstract provider invocation behind shell-sourceable provider configs
|
|
66
|
+
(`providers/*.sh`) and a TypeScript provider layer
|
|
67
|
+
(`loki-ts/src/runner/providers.ts`), classified by capability tier:
|
|
68
|
+
|
|
69
|
+
- **Claude Code (Tier 1):** full features (subagents, parallelism, Task tool, MCP).
|
|
70
|
+
- **Cline (Tier 2):** reduced parallelism.
|
|
71
|
+
- **OpenAI Codex CLI and Aider (Tier 3):** degraded mode (sequential, no Task tool).
|
|
72
|
+
|
|
73
|
+
The orchestrator adapts its strategy to the active provider's tier and fails over
|
|
74
|
+
automatically. Google Gemini CLI was deprecated (v7.5.18) after upstream
|
|
75
|
+
deprecation; selecting it exits with a migration message.
|
|
76
|
+
|
|
77
|
+
### Consequences
|
|
78
|
+
|
|
79
|
+
- Features must degrade gracefully: anything Tier 1 specific cannot be assumed
|
|
80
|
+
available, so the loop checks capability before using it.
|
|
81
|
+
- Adding a provider means adding a config plus tier mapping, not rewriting the loop.
|
|
82
|
+
- The capability matrix is a permanent part of the design and must be kept honest;
|
|
83
|
+
a provider listed at a tier it cannot meet would break runs silently.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## ADR-003: Verified completion via the RARV-C closure loop and an Evidence Receipt
|
|
88
|
+
|
|
89
|
+
**Status:** Accepted
|
|
90
|
+
|
|
91
|
+
### Context
|
|
92
|
+
|
|
93
|
+
Most coding agents declare a task "done" by narrating it in a transcript, which
|
|
94
|
+
is unverifiable. The product's core differentiator is trust: "done" must mean
|
|
95
|
+
proven, not promised. An agent that lies about completion (empty diffs, failing
|
|
96
|
+
tests reported green) destroys user confidence and word-of-mouth.
|
|
97
|
+
|
|
98
|
+
### Decision
|
|
99
|
+
|
|
100
|
+
Every iteration runs the RARV-C cycle (Reason, Act, Reflect, Verify, Close).
|
|
101
|
+
Completion is decided by deterministic, re-derivable facts rather than the
|
|
102
|
+
agent's own claim:
|
|
103
|
+
|
|
104
|
+
- An empty git diff against the run-start commit cannot be reported as done.
|
|
105
|
+
- Red tests block completion.
|
|
106
|
+
- Each build produces an **Evidence Receipt** separating **Facts** (diff SHAs,
|
|
107
|
+
file counts, test command and exit code, build command and exit code, gate
|
|
108
|
+
verdicts) from **Assessments** (AI judgments such as the review council).
|
|
109
|
+
- The receipt headline (VERIFIED / VERIFIED WITH GAPS / NOT VERIFIED) is computed
|
|
110
|
+
only from the facts; gaps are always listed by name so silence never reads as a
|
|
111
|
+
pass.
|
|
112
|
+
|
|
113
|
+
### Consequences
|
|
114
|
+
|
|
115
|
+
- Completion logic must stay deterministic and independently re-checkable; LLM
|
|
116
|
+
judgment can inform but never make the headline green on its own.
|
|
117
|
+
- `loki verify` exposes the same gates as a standalone, CI-ready check with
|
|
118
|
+
machine-readable evidence and meaningful exit codes.
|
|
119
|
+
- The system will sometimes refuse to call work "done" that a user feels is done;
|
|
120
|
+
this friction is intentional and is the product's main promise.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## ADR-004: Quality enforced by 8 gates and a blind multi-reviewer council
|
|
125
|
+
|
|
126
|
+
**Status:** Accepted
|
|
127
|
+
|
|
128
|
+
### Context
|
|
129
|
+
|
|
130
|
+
Autonomous code generation without enforcement produces plausible-looking but
|
|
131
|
+
incorrect output. A single reviewer (human or model) is prone to sycophancy and
|
|
132
|
+
blind spots. Quality has to be enforced mechanically and from independent angles,
|
|
133
|
+
not trusted.
|
|
134
|
+
|
|
135
|
+
### Decision
|
|
136
|
+
|
|
137
|
+
Run 8 quality gates (static analysis, test pass/fail, blind 3-reviewer code
|
|
138
|
+
review with severity blocking, anti-sycophancy / devil's advocate, mock-integrity
|
|
139
|
+
detection, test-mutation detection, documentation coverage, magic-modules debate)
|
|
140
|
+
plus a conditional legacy-healing auditor. Code review uses three independent
|
|
141
|
+
reviewers whose verdicts must reconcile; Critical/High findings block, Medium/Low
|
|
142
|
+
are advisory. An override council can revisit a BLOCK only when backed by a
|
|
143
|
+
non-empty evidence artifact.
|
|
144
|
+
|
|
145
|
+
### Consequences
|
|
146
|
+
|
|
147
|
+
- A red gate stops the release; "2-of-3 is good enough" is explicitly not
|
|
148
|
+
acceptable for the council, which loops until unanimous.
|
|
149
|
+
- Gates add latency and token cost to every iteration, accepted as the price of
|
|
150
|
+
trustworthy output.
|
|
151
|
+
- Each gate's blocking semantics must be precise; an over-eager gate that fires on
|
|
152
|
+
unrelated changes (as the legacy-healing auditor once did) erodes signal and was
|
|
153
|
+
scoped to fire only on healing-mode work.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## ADR-005: File-based memory in `.loki/` as the system's source of truth
|
|
158
|
+
|
|
159
|
+
**Status:** Accepted
|
|
160
|
+
|
|
161
|
+
### Context
|
|
162
|
+
|
|
163
|
+
The orchestrator, dashboard, MCP server, and quality gates are separate processes
|
|
164
|
+
(and separate runtimes: bash, TypeScript, Python). They need shared, durable state
|
|
165
|
+
that survives crashes and resumes, without forcing an external database as a
|
|
166
|
+
prerequisite for a local-first tool.
|
|
167
|
+
|
|
168
|
+
### Decision
|
|
169
|
+
|
|
170
|
+
All components communicate through filesystem state under `.loki/` (memory,
|
|
171
|
+
session, queue, checkpoints, findings, healing artifacts). Memory is a layered
|
|
172
|
+
Python package (`memory/`) with episodic, semantic, and procedural stores,
|
|
173
|
+
progressive-disclosure loading, optional vector search, and cross-project recall.
|
|
174
|
+
A unified event bus (`events/`) provides Python, TypeScript, and bash emitters
|
|
175
|
+
over the same conventions.
|
|
176
|
+
|
|
177
|
+
### Consequences
|
|
178
|
+
|
|
179
|
+
- Any process can read or resume from disk; runs survive restarts and pod loss.
|
|
180
|
+
- Concurrent writers must coordinate via file locking; lost-update and inode races
|
|
181
|
+
here have been recurring, high-severity bug classes that demand careful locking
|
|
182
|
+
and tests.
|
|
183
|
+
- No database is required to run locally, preserving the self-hosted, private,
|
|
184
|
+
zero-egress posture; external stores (e.g. ChromaDB, object storage) are optional
|
|
185
|
+
add-ons, not dependencies.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## ADR-006: Polyglot stack (Bun/TypeScript, Python, bash) over a single language
|
|
190
|
+
|
|
191
|
+
**Status:** Accepted
|
|
192
|
+
|
|
193
|
+
### Context
|
|
194
|
+
|
|
195
|
+
The system spans distinct concerns: orchestration control flow, a web dashboard
|
|
196
|
+
API, a memory engine with embeddings, an MCP server, and provider shims. No single
|
|
197
|
+
language is the best fit for all of them, and parts predate the Bun migration.
|
|
198
|
+
|
|
199
|
+
### Decision
|
|
200
|
+
|
|
201
|
+
Use the right tool per concern: Bun/TypeScript for the orchestrator, CLI, and HTTP
|
|
202
|
+
API (`loki-ts/`, `api/`); Python for the memory engine, MCP server, and FastAPI
|
|
203
|
+
dashboard (`memory/`, `mcp/`, `dashboard/`); bash for provider configs, hooks, and
|
|
204
|
+
the legacy runtime during migration. Node.js 20+ is the minimum engine; the npm
|
|
205
|
+
package ships zero runtime dependencies in `package.json`.
|
|
206
|
+
|
|
207
|
+
### Consequences
|
|
208
|
+
|
|
209
|
+
- Contributors need familiarity with more than one ecosystem, and CI must run a
|
|
210
|
+
matrix across runtimes (bun typecheck/test, Python syntax, shellcheck, parity).
|
|
211
|
+
- Cross-language contracts (the `.loki/` state files, the event bus) must be kept
|
|
212
|
+
in sync across three emitter implementations.
|
|
213
|
+
- Boundaries stay clean because each component owns its language; the cost is more
|
|
214
|
+
build and test tooling, mitigated by the local CI gate.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## ADR-007: Distribute across npm, Docker, and Homebrew from a single release pipeline
|
|
219
|
+
|
|
220
|
+
**Status:** Accepted
|
|
221
|
+
|
|
222
|
+
### Context
|
|
223
|
+
|
|
224
|
+
Users install via different channels (npm global, Docker, Homebrew), and the
|
|
225
|
+
dashboard frontend and Python modules must be present and working in each. Past
|
|
226
|
+
releases shipped broken because local testing did not verify the published
|
|
227
|
+
tarball or a fresh global install.
|
|
228
|
+
|
|
229
|
+
### Decision
|
|
230
|
+
|
|
231
|
+
A single GitHub Actions release workflow creates the tag and GitHub Release, then
|
|
232
|
+
publishes to npm, builds and pushes a multi-arch (amd64 + arm64) Docker image, and
|
|
233
|
+
updates the Homebrew tap. Every release is preceded by a mandatory local CI gate
|
|
234
|
+
(`scripts/local-ci.sh`) that mirrors every CI workflow, plus pre-publish
|
|
235
|
+
validation that inspects the npm tarball contents and performs a fresh global
|
|
236
|
+
install smoke test. Versions are kept in sync across all manifests and Dockerfiles.
|
|
237
|
+
|
|
238
|
+
### Consequences
|
|
239
|
+
|
|
240
|
+
- The local Mac is the canonical pre-push gate; GitHub Actions is the verifier, not
|
|
241
|
+
the place defects are discovered.
|
|
242
|
+
- The dashboard frontend must be rebuilt and committed before release, and the
|
|
243
|
+
built artifacts must be tracked in git so every channel includes them.
|
|
244
|
+
- A single broken artifact can affect all channels at once, so the validation
|
|
245
|
+
checklist is non-negotiable per release.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## ADR-008: Source-available under BUSL-1.1 with a separate commercial brand
|
|
250
|
+
|
|
251
|
+
**Status:** Accepted
|
|
252
|
+
|
|
253
|
+
### Context
|
|
254
|
+
|
|
255
|
+
The project needs broad adoption and community trust (which favors open source)
|
|
256
|
+
while leaving room for a sustainable commercial business and protection against
|
|
257
|
+
hosted-competitor free-riding.
|
|
258
|
+
|
|
259
|
+
### Decision
|
|
260
|
+
|
|
261
|
+
License the source under the Business Source License 1.1: free for personal,
|
|
262
|
+
internal, and academic use, source-available, with commercial hosted/team
|
|
263
|
+
editions sold under the separate **Autonomi** brand (Autonomi Cloud, Autonomi
|
|
264
|
+
Enterprise). The same Loki CLI, SDK, and MCP are available to everyone.
|
|
265
|
+
|
|
266
|
+
### Consequences
|
|
267
|
+
|
|
268
|
+
- BUSL-1.1 is not OSI-approved "open source"; the project consistently uses the
|
|
269
|
+
term "source-available" to avoid misleading users.
|
|
270
|
+
- Contributions require a CLA (`CLA.md`), adding friction for contributors in
|
|
271
|
+
exchange for a clear commercial path.
|
|
272
|
+
- The open core and commercial editions must stay aligned on the core surface so
|
|
273
|
+
the free tier remains genuinely useful, not a crippled demo.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## ADR-009: Model selection tiered by task, with deterministic auto-selection
|
|
278
|
+
|
|
279
|
+
**Status:** Accepted
|
|
280
|
+
|
|
281
|
+
### Context
|
|
282
|
+
|
|
283
|
+
Using the most capable (and expensive) model for every task wastes budget; using
|
|
284
|
+
a weak model for architecture produces poor results. Forcing the user to choose a
|
|
285
|
+
model per task is friction and contradicts the autonomy goal.
|
|
286
|
+
|
|
287
|
+
### Decision
|
|
288
|
+
|
|
289
|
+
Map task type to model tier: Opus for planning and architecture, Sonnet for
|
|
290
|
+
development and functional testing, Haiku for unit tests, monitoring, and simple
|
|
291
|
+
parallelizable work. The tier is auto-selected from task signals
|
|
292
|
+
(`run.sh:get_rarv_tier()`, `detect_complexity()`) rather than asked of the user;
|
|
293
|
+
model levers (session pin, mid-flight override, ceiling) exist as opt-out escape
|
|
294
|
+
hatches, and the cost quote, dashboard, and dispatched model always agree.
|
|
295
|
+
|
|
296
|
+
### Consequences
|
|
297
|
+
|
|
298
|
+
- Cost scales with task difficulty automatically, and parallel cheap-model work is
|
|
299
|
+
encouraged for throughput.
|
|
300
|
+
- Selection must be deterministic and honest: the quoted plan cost and the actual
|
|
301
|
+
dispatch must never diverge, including ceiling-enforcement and tier-collapse
|
|
302
|
+
paths (e.g. an unavailable Fable tier collapsing to Opus).
|
|
303
|
+
- Adding or retiring a model means updating the registry and the auto-select
|
|
304
|
+
heuristic together, or quotes drift from reality.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## ADR-010: Progressive-disclosure skill architecture for the agent context
|
|
309
|
+
|
|
310
|
+
**Status:** Accepted
|
|
311
|
+
|
|
312
|
+
### Context
|
|
313
|
+
|
|
314
|
+
Loading the full body of operational guidance (quality gates, healing, testing,
|
|
315
|
+
agent types, provider docs, advanced patterns) into every agent invocation would
|
|
316
|
+
waste context budget and dilute the signal. But the guidance still needs to be
|
|
317
|
+
available on demand.
|
|
318
|
+
|
|
319
|
+
### Decision
|
|
320
|
+
|
|
321
|
+
Keep `SKILL.md` slim (a few hundred lines) and split detailed guidance into
|
|
322
|
+
on-demand modules under `skills/`, with an index (`skills/00-index.md`) that routes
|
|
323
|
+
to the right module, and deeper reference material under `references/`. Modules are
|
|
324
|
+
pulled in only when relevant to the current task.
|
|
325
|
+
|
|
326
|
+
### Consequences
|
|
327
|
+
|
|
328
|
+
- Context stays focused and cheaper per iteration; agents read only what the task
|
|
329
|
+
needs.
|
|
330
|
+
- The routing index and module boundaries must be maintained, or guidance becomes
|
|
331
|
+
hard to find and modules drift out of sync with the code they describe.
|
|
332
|
+
- `SKILL.md` has a hard size budget; detailed content belongs in modules, not
|
|
333
|
+
inlined, which is enforced as a contribution rule.
|
package/docs/audit-logging.md
CHANGED
|
@@ -6,7 +6,7 @@ Audit trails for Loki Mode operations.
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
Audit logging captures significant events for security monitoring, debugging, and usage analytics. Audit logging is **enabled by default
|
|
9
|
+
Audit logging captures significant events for security monitoring, debugging, and usage analytics. Audit logging is **enabled by default**.
|
|
10
10
|
|
|
11
11
|
## Configuration
|
|
12
12
|
|
|
@@ -31,7 +31,7 @@ enterprise:
|
|
|
31
31
|
retention_days: 90 # Days to keep logs
|
|
32
32
|
max_file_size: 100 # MB per file before rotation
|
|
33
33
|
compress: true # Compress rotated files
|
|
34
|
-
integrity_check: true # Enable SHA-256 chain hashing
|
|
34
|
+
integrity_check: true # Enable SHA-256 chain hashing
|
|
35
35
|
syslog_enabled: false # Forward to external syslog
|
|
36
36
|
exclude_events: # Events to exclude
|
|
37
37
|
- api.request
|
|
@@ -123,7 +123,7 @@ Audit logs use JSON Lines format (one JSON object per line):
|
|
|
123
123
|
"metadata": {
|
|
124
124
|
"hostname": "dev-machine",
|
|
125
125
|
"pid": 12345,
|
|
126
|
-
"version": "
|
|
126
|
+
"version": "X.Y.Z"
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
```
|
|
@@ -139,7 +139,7 @@ Audit logs use JSON Lines format (one JSON object per line):
|
|
|
139
139
|
| `resource` | string | Resource affected (optional) |
|
|
140
140
|
| `details` | object | Event-specific details |
|
|
141
141
|
| `metadata` | object | System metadata (hostname, PID, version) |
|
|
142
|
-
| `chain_hash` | string | SHA-256 chain hash for integrity
|
|
142
|
+
| `chain_hash` | string | SHA-256 chain hash for integrity |
|
|
143
143
|
|
|
144
144
|
## Log Location
|
|
145
145
|
|
|
@@ -278,7 +278,7 @@ Response:
|
|
|
278
278
|
}
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
## Log Integrity
|
|
281
|
+
## Log Integrity
|
|
282
282
|
|
|
283
283
|
Audit entries are chain-hashed with SHA-256 for tamper detection.
|
|
284
284
|
|
|
@@ -325,7 +325,7 @@ empty chain.
|
|
|
325
325
|
export LOKI_AUDIT_NO_INTEGRITY=true
|
|
326
326
|
```
|
|
327
327
|
|
|
328
|
-
## SIEM Integration
|
|
328
|
+
## SIEM Integration
|
|
329
329
|
|
|
330
330
|
### Syslog Forwarding
|
|
331
331
|
|
|
@@ -392,7 +392,7 @@ EOF
|
|
|
392
392
|
systemctl restart filebeat
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
## Agent Action Audit
|
|
395
|
+
## Agent Action Audit
|
|
396
396
|
|
|
397
397
|
In addition to dashboard audit logs, agent actions are tracked separately.
|
|
398
398
|
|
package/docs/authentication.md
CHANGED
|
@@ -9,7 +9,7 @@ Authentication and access control for Loki Mode dashboard and API.
|
|
|
9
9
|
Loki Mode supports two authentication methods:
|
|
10
10
|
|
|
11
11
|
1. **Token-based authentication** - API tokens with scopes and expiration
|
|
12
|
-
2. **OIDC/SSO integration**
|
|
12
|
+
2. **OIDC/SSO integration** - Google, Azure AD, Okta
|
|
13
13
|
|
|
14
14
|
Both methods can be enabled simultaneously and provide access to the dashboard API at `http://localhost:57374` (or `https://` with TLS enabled).
|
|
15
15
|
|
|
@@ -97,7 +97,7 @@ Scope hierarchy:
|
|
|
97
97
|
- `control` includes `write` and `read`
|
|
98
98
|
- `write` includes `read`
|
|
99
99
|
|
|
100
|
-
### Roles
|
|
100
|
+
### Roles
|
|
101
101
|
|
|
102
102
|
Predefined roles map to common access patterns:
|
|
103
103
|
|
|
@@ -120,7 +120,7 @@ Generate token with custom scopes:
|
|
|
120
120
|
loki enterprise token generate custom-bot --scopes "read,audit" --expires 30
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
## OIDC/SSO Authentication
|
|
123
|
+
## OIDC/SSO Authentication
|
|
124
124
|
|
|
125
125
|
Enterprise identity provider integration for centralized authentication.
|
|
126
126
|
|
package/docs/authorization.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Control Plane migration:** the classic dashboard UI and port 57374 are removed in Loki Mode 10.8; the UI is the Control Plane (`loki dashboard`, default port 47821). Examples below that use port 57374 or `/api/*` describe the legacy API server. See [control-plane-migration.md](control-plane-migration.md) for the `/v1/*` mapping and what is not yet available.
|
|
4
4
|
|
|
5
|
-
Role-based access control (RBAC) for Loki Mode
|
|
5
|
+
Role-based access control (RBAC) for Loki Mode.
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
@@ -14,10 +14,10 @@ Deploy Loki Mode using Docker Compose, verify the dashboard is accessible, and c
|
|
|
14
14
|
|
|
15
15
|
## Step 1: Review the Docker Compose Configuration
|
|
16
16
|
|
|
17
|
-
Examine
|
|
17
|
+
Examine `docker/docker-compose.yml`:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
cat docker-compose.yml
|
|
20
|
+
cat docker/docker-compose.yml
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Key elements to note:
|
|
@@ -32,7 +32,7 @@ Key elements to note:
|
|
|
32
32
|
docker-compose build
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
This builds from
|
|
35
|
+
This builds from `docker/Dockerfile`, which installs:
|
|
36
36
|
- Ubuntu 24.04 base
|
|
37
37
|
- Node.js 20 LTS
|
|
38
38
|
- Python 3 with venv support
|
|
@@ -68,7 +68,7 @@ Start the container (this will invoke the AI provider and may incur costs):
|
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
# Pass your API key through to the container
|
|
71
|
-
ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY docker-compose run \
|
|
71
|
+
ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY docker compose -f docker/docker-compose.yml run \
|
|
72
72
|
-e ANTHROPIC_API_KEY \
|
|
73
73
|
loki start ./prd.md
|
|
74
74
|
```
|
|
@@ -96,7 +96,7 @@ Test resource configuration by modifying environment variables:
|
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
98
|
# Run with budget limit and reduced parallel agents
|
|
99
|
-
docker-compose run \
|
|
99
|
+
docker compose -f docker/docker-compose.yml run \
|
|
100
100
|
-e ANTHROPIC_API_KEY \
|
|
101
101
|
-e LOKI_BUDGET_LIMIT=5.00 \
|
|
102
102
|
-e LOKI_MAX_PARALLEL_AGENTS=3 \
|
|
@@ -141,7 +141,7 @@ loki secrets status
|
|
|
141
141
|
## Verification Checklist
|
|
142
142
|
|
|
143
143
|
- [ ] `docker-compose build` completes without errors
|
|
144
|
-
- [ ] `docker-compose run loki version` outputs the correct version
|
|
144
|
+
- [ ] `docker compose -f docker/docker-compose.yml run loki version` outputs the correct version
|
|
145
145
|
- [ ] The dashboard is accessible at `http://localhost:57374`
|
|
146
146
|
- [ ] You can pass environment variables to configure resource limits
|
|
147
147
|
- [ ] `loki sandbox` commands work (build, start, status, stop)
|
|
@@ -28,11 +28,11 @@ docker pull asklokesh/loki-mode:5.52.0
|
|
|
28
28
|
docker run -it -v $(pwd):/workspace asklokesh/loki-mode:latest
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The Dockerfile is
|
|
31
|
+
The Dockerfile is `docker/Dockerfile`. A separate `docker/Dockerfile.sandbox` exists for sandboxed execution.
|
|
32
32
|
|
|
33
33
|
### Docker Compose
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
`docker/docker-compose.yml` provides a ready-to-use configuration:
|
|
36
36
|
|
|
37
37
|
```yaml
|
|
38
38
|
services:
|
|
@@ -59,7 +59,7 @@ services:
|
|
|
59
59
|
Start with:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
docker-compose run loki start ./prd.md
|
|
62
|
+
docker compose -f docker/docker-compose.yml run loki start ./prd.md
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
Key volume mounts:
|
|
@@ -86,7 +86,7 @@ Or pass `--sandbox` to the start command:
|
|
|
86
86
|
loki start --sandbox ./prd.md
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
The sandbox uses `Dockerfile.sandbox` which adds additional isolation constraints.
|
|
89
|
+
The sandbox uses `docker/Dockerfile.sandbox` which adds additional isolation constraints.
|
|
90
90
|
|
|
91
91
|
## Security Hardening
|
|
92
92
|
|
|
@@ -26,7 +26,7 @@ The Autonomi Certified Developer certification validates your knowledge of Loki
|
|
|
26
26
|
|
|
27
27
|
- Familiarity with command-line tools (bash, git, npm)
|
|
28
28
|
- Basic understanding of AI/LLM concepts (prompts, models, tokens)
|
|
29
|
-
- Node.js
|
|
29
|
+
- Node.js 20+ installed
|
|
30
30
|
- A supported AI provider CLI installed (Claude Code, Cline, Codex CLI, Aider, or opencode)
|
|
31
31
|
|
|
32
32
|
## How to Use This Program
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Run the Control Plane in a container
|
|
2
2
|
|
|
3
3
|
The Control Plane (run ingest API plus UI) ships as its own small image built
|
|
4
|
-
from `Dockerfile.control-plane`. It serves on port 47821, stores its SQLite
|
|
4
|
+
from `docker/Dockerfile.control-plane`. It serves on port 47821, stores its SQLite
|
|
5
5
|
database under `/data`, runs as a non-root user and contains no secrets.
|
|
6
6
|
|
|
7
7
|
The image binds 0.0.0.0, so `LOKI_CONTROL_TOKEN` is required at run time. Without
|
|
@@ -13,7 +13,7 @@ server prints a warning when you do.
|
|
|
13
13
|
## Docker
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
docker build -f Dockerfile.control-plane -t loki-control-plane .
|
|
16
|
+
docker build -f docker/Dockerfile.control-plane -t loki-control-plane .
|
|
17
17
|
docker run -d -p 47821:47821 -e LOKI_CONTROL_TOKEN="$(openssl rand -hex 32)" -v loki-control:/data loki-control-plane
|
|
18
18
|
LOKI_CONTROL_URL=http://localhost:47821 loki control status
|
|
19
19
|
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# real-run: real scenarios against the installed tarball
|
|
2
|
+
|
|
3
|
+
`scripts/real-run.sh <scenario>` exists because every real bug found in the D91 push came from a real run, not a fixture. It never touches the repo checkout: it runs `npm pack --ignore-scripts` (so the committed `loki-ts/dist` is what ships), installs the tarball into a temp prefix under a run-owned temp dir, and runs the scenario with `LOKI_NO_SKILL_LINK_HEAL=1 LOKI_NO_BROWSER=1` against that installed `loki`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bash scripts/real-run.sh --dry trivial-sum # pack + install + fixture, no model call (CI-safe)
|
|
9
|
+
bash scripts/real-run.sh --validate router-on # parse the scenario file only
|
|
10
|
+
bash scripts/real-run.sh --check-receipt R.json trivial-sum # apply receipt assertions to a file
|
|
11
|
+
bash scripts/real-run.sh --tsv-out results.tsv trivial-sum # BILLED: real model run
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Env: `REAL_RUN_TARBALL` reuses a tarball, `REAL_RUN_TIMEOUT` (default 1200s) bounds the loki call, `REAL_RUN_SCENARIO_DIR` overrides the scenario directory, `REAL_RUN_TSV` is the default for `--tsv-out`.
|
|
15
|
+
|
|
16
|
+
## Scenarios
|
|
17
|
+
|
|
18
|
+
Files `tests/real-run/scenarios/<name>.sh`, sourced by the script. Shipped: `trivial-sum` (about $0.10), `two-bug`, `attempts-2`, `router-on`, `issues-dry-run` (needs network, no model).
|
|
19
|
+
|
|
20
|
+
| Variable | Meaning |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `SC_DESC` | one line description |
|
|
23
|
+
| `SC_BILLED` | 1 if the scenario calls a model |
|
|
24
|
+
| `SC_FIXTURE` | generator name under `scripts/b9-fixtures/` (`trivial-sum`, `two-bug`) |
|
|
25
|
+
| `SC_ARGS` | array of loki arguments |
|
|
26
|
+
| `SC_ENV` | array of `NAME=value` entries |
|
|
27
|
+
| `SC_RECEIPT` | array of assertions on the newest `.loki/runs/*/receipt.json`: `path == v`, `!=`, `<=`, `>=`, or `path exists` (dotted path, for example `cost.usd`) |
|
|
28
|
+
| `SC_CONSOLE` | array of extended regexes that must match the console output |
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
One `PASS`/`FAIL` line per assertion; exit 1 on any FAIL, 2 on usage or scenario errors. A TSV line is printed (and appended with `--tsv-out`): `ts scenario verdict wall_s cost_usd input_tokens output_tokens result`. Fields the receipt does not carry are `NA`, never 0. B9 and the 10x metrics can reuse the TSV.
|
|
33
|
+
|
|
34
|
+
`tests/test-real-run.sh` covers scenario parsing, the `--dry` install from the packed tarball, and assertion failure on a doctored receipt.
|
|
@@ -45,7 +45,7 @@ VERSION # Single line: X.Y.Z
|
|
|
45
45
|
package.json # "version": "X.Y.Z"
|
|
46
46
|
SKILL.md # Header (line ~6) AND footer (last line)
|
|
47
47
|
Dockerfile # LABEL version= AND org.opencontainers.image.version (both, or it drifts)
|
|
48
|
-
Dockerfile.sandbox
|
|
48
|
+
docker/Dockerfile.sandbox # Same two labels
|
|
49
49
|
plugins/loki-mode/.claude-plugin/plugin.json # "version": "X.Y.Z" (marketplace.json carries no version)
|
|
50
50
|
server.json # "version" AND packages[loki-mode].version (MCP registry manifest; enforced by tests/test-server-json-current.sh)
|
|
51
51
|
vscode-extension/package.json # DEPRECATED v7.2.0, no longer published; bump only if vendoring
|
|
@@ -55,7 +55,7 @@ mcp/__init__.py # __version__ = "X.Y.Z"
|
|
|
55
55
|
CHANGELOG.md # Add new version entry at top
|
|
56
56
|
docs/INSTALLATION.md # Version header
|
|
57
57
|
wiki/Home.md, wiki/_Sidebar.md, wiki/API-Reference.md
|
|
58
|
-
README.md, docker-compose.yml # Docker image tags (MAJOR/MINOR bumps)
|
|
58
|
+
README.md, docker/docker-compose.yml # Docker image tags (MAJOR/MINOR bumps)
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
The CHANGELOG.md entry must be a full section, not a one-line placeholder
|
|
@@ -135,6 +135,7 @@ banners you might expect. These variables control the remaining `[INFO]` and
|
|
|
135
135
|
| `LOKI_DURABLE_STATE` | `0` | `1` enables durable state **and** the richer process-exit contract that lets Kubernetes distinguish a deterministic failure from a crash. See [exit codes](./exit-codes.md). |
|
|
136
136
|
| `LOKI_SDK_LOOP` | unset | Routes the run through the Bun/TypeScript runner instead of bash. Both implement the same exit contract. |
|
|
137
137
|
| `LOKI_ALLOW_AGENT_GITHUB_TOKEN` | unset | By default `GH_TOKEN`, `GITHUB_TOKEN`, `GH_ENTERPRISE_TOKEN`, and `GITHUB_ENTERPRISE_TOKEN` are withheld from agent sessions. The two routes differ: on the bash route (`autonomy/run.sh`) the withheld tokens are re-granted only for Loki's own trusted calls, namely the `gh()` CLI wrapper, the `_loki_net` helper used by the optional local-PR path in `on_run_complete()`, the session-end `create_session_pr` call, and `autonomy/lib/proof-check.sh`'s network probe. On the Bun route (`loki-ts/src/runner/github_token.ts`'s `withholdGithubTokens()`) the tokens are dropped from the process outright, with no re-grant and no push/PR step of its own. Exactly `1` lets the agent inherit the tokens as before, on either route; that is a Rule of Two exposure, and a one-line stderr warning is printed. |
|
|
138
|
+
| `LOKI_AI_MARKING` | unset (off) | `1` (exactly) adds machine-readable trailers to the Loki commit (`AI-Generated: true`, `AI-Provider`, `AI-Model`, `Loki-Receipt`, after `Loki-Run`) and one `AI-Generated: true (...)` marker line under the verdict in the PR body. Values are single-line and bounded. Off, the commit and PR body are byte-identical to before. |
|
|
138
139
|
|
|
139
140
|
`LOKI_DURABLE_STATE=1` is the one to set in a Job or task definition. Without
|
|
140
141
|
it every failure collapses to exit 1 and the platform cannot tell "re-running
|
package/docs/exit-codes.md
CHANGED
|
@@ -142,7 +142,7 @@ An early draft spec listed `1=BLOCKED, 2=CONCERNS`. That ordering was rejected:
|
|
|
142
142
|
it is not used anywhere, it has no consumers, and it inverts the
|
|
143
143
|
severity-rises-with-the-code rule that every other command follows.
|
|
144
144
|
|
|
145
|
-
### Known gaps
|
|
145
|
+
### Known gaps
|
|
146
146
|
|
|
147
147
|
The table above is the target. On the current release, three inputs do not
|
|
148
148
|
return what it implies. Measured on this checkout:
|
|
@@ -153,8 +153,8 @@ return what it implies. Measured on this checkout:
|
|
|
153
153
|
| Not a git directory | `loki verify` | 1 (CONCERNS) | 2 |
|
|
154
154
|
| Unknown flag | `loki verify --no-such-flag` | 3 | 64 |
|
|
155
155
|
|
|
156
|
-
The gap is tracked as the pending moat case P2.verify-exit-contract
|
|
157
|
-
|
|
156
|
+
The gap is tracked as the pending moat case P2.verify-exit-contract in
|
|
157
|
+
`tests/moat/pending.txt`.
|
|
158
158
|
|
|
159
159
|
### `loki verify --fast`
|
|
160
160
|
|
package/docs/git-workflow.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Git Workflow
|
|
2
2
|
|
|
3
|
-
Branch protection and Git best practices for Loki Mode
|
|
3
|
+
Branch protection and Git best practices for Loki Mode.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
Loki Mode includes branch protection features that prevent direct commits to main/master branches and enforce a clean PR-based workflow. This ensures code review, quality gates, and audit trails for all changes made by autonomous agents.
|
|
8
8
|
|
|
9
|
-
## Branch Protection
|
|
9
|
+
## Branch Protection
|
|
10
10
|
|
|
11
11
|
### Enable Branch Protection
|
|
12
12
|
|
|
@@ -388,4 +388,4 @@ git log --show-signature
|
|
|
388
388
|
- [Audit Logging](audit-logging.md) - Track Git operations
|
|
389
389
|
- [GitHub Integration](../skills/github-integration.md) - Issue import and PR creation
|
|
390
390
|
- [Enterprise Features](../wiki/Enterprise-Features.md) - Branch protection setup
|
|
391
|
-
- [Contributing](
|
|
391
|
+
- [Contributing](../.github/CONTRIBUTING.md) - Contribution guidelines
|