loki-mode 7.129.4 → 8.0.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 +81 -5
- package/SKILL.md +66 -5
- package/VERSION +1 -1
- package/autonomy/app-runner.sh +37 -0
- package/autonomy/completion-council.sh +862 -28
- package/autonomy/council-v2.sh +39 -0
- package/autonomy/crash.sh +3 -2
- package/autonomy/grill.sh +42 -0
- package/autonomy/hooks/validate-bash.sh +301 -4
- package/autonomy/lib/cockpit-render.sh +8 -2
- package/autonomy/lib/cr-rematerialize.py +101 -4
- package/autonomy/lib/deadline.py +957 -0
- package/autonomy/lib/dependency-setup.sh +205 -0
- package/autonomy/lib/done-recognition.sh +45 -0
- package/autonomy/lib/efficiency_cost.py +13 -6
- package/autonomy/lib/no_mock_scan.py +793 -0
- package/autonomy/lib/prd-enrich.sh +42 -0
- package/autonomy/lib/proof-analytics-props.py +69 -0
- package/autonomy/lib/proof-generator.py +282 -95
- package/autonomy/lib/proof-template.html +15 -12
- package/autonomy/lib/proof-verify.py +151 -102
- package/autonomy/lib/requirements_contract.py +848 -0
- package/autonomy/lib/sdk-mode.sh +103 -0
- package/autonomy/lib/secret-scan.sh +139 -0
- package/autonomy/lib/spec-expand.sh +208 -0
- package/autonomy/lib/tree_digest.py +266 -0
- package/autonomy/lib/voter-agents.sh +58 -8
- package/autonomy/lib/workspace_diff.py +124 -0
- package/autonomy/loki +189 -17
- package/autonomy/playwright-verify.sh +501 -0
- package/autonomy/prd-checklist.sh +17 -8
- package/autonomy/provider-offer.sh +111 -0
- package/autonomy/run.sh +4424 -678
- package/autonomy/sandbox.sh +42 -0
- package/autonomy/spec-interrogation.sh +148 -5
- package/autonomy/spec.sh +118 -1
- package/autonomy/telemetry.sh +133 -7
- package/autonomy/verify.sh +107 -0
- package/bin/loki +110 -3
- package/completions/_loki +10 -0
- package/completions/loki.bash +1 -1
- package/dashboard/__init__.py +1 -1
- package/dashboard/audit.py +96 -7
- package/dashboard/build_supervisor.py +1619 -0
- package/dashboard/control.py +8 -0
- package/dashboard/prompt_optimizer.py +7 -0
- package/dashboard/server.py +577 -22
- package/dashboard/static/trust.html +1 -1
- package/docs/ARCHITECTURE-OVERVIEW.md +207 -0
- package/docs/AUTONOMI-ECOSYSTEM.md +107 -0
- package/docs/INSTALLATION.md +19 -2
- package/docs/MODEL-EQUIVALENCE-HARNESS-PLAN.md +70 -0
- package/docs/PLANS-INDEX.md +33 -0
- package/docs/PRIVACY.md +29 -1
- package/docs/SIGNED-RECEIPTS.md +102 -0
- package/docs/SONNET5-DEFAULT-PLAN.md +1 -1
- package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +114 -0
- package/docs/V8-AGENT-SDK-PLAN.md +692 -0
- package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +45 -0
- package/docs/V8-MAJOR-RELEASE-PLAN.md +137 -0
- package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +82 -0
- package/docs/V8-RUNTIME-TRUTH-2026-07-25.md +232 -0
- package/docs/V8-SDK-RESEARCH-RAW.md +129 -0
- package/docs/alternative-installations.md +4 -4
- package/loki-ts/dist/loki.js +674 -285
- package/loki-ts/package.json +2 -0
- package/mcp/__init__.py +1 -1
- package/package.json +7 -6
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/providers/claude.sh +75 -0
- package/providers/codex.sh +85 -13
- package/references/sdk-mode.md +106 -0
- package/skills/model-selection.md +1 -1
- package/skills/quality-gates.md +22 -0
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
CSS references them) and remapped to the SPA --loki-* palette, with a
|
|
41
41
|
prefers-color-scheme dark variant mirroring the SPA. */
|
|
42
42
|
:root {
|
|
43
|
-
--bg: #
|
|
43
|
+
--bg: #F1F2F6; --panel: rgba(255,255,255,0.72); --panel-2: #E8E5DE; --border: rgba(0,0,0,0.08);
|
|
44
44
|
--text: #1A1614; --muted: #4A4640; --faint: #8A857C; --accent: #553DE9;
|
|
45
45
|
--green: #1AAF95; --red: #C04848; --amber: #C4922E;
|
|
46
46
|
--mono: 'JetBrains Mono', ui-monospace, "SF Mono", "Menlo", monospace;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Loki Mode - Architecture Overview
|
|
2
|
+
|
|
3
|
+
Spec in, verified product out. This document gives a SIMPLE view for a first read
|
|
4
|
+
and a FULL view for the whole machine, plus one RARV-C iteration as a sequence.
|
|
5
|
+
|
|
6
|
+
Every claim is verified against source (`autonomy/loki`, `autonomy/run.sh`,
|
|
7
|
+
`autonomy/completion-council.sh`, `skills/quality-gates.md`, `SKILL.md`). Line
|
|
8
|
+
numbers drift; function names are stable. See `CLAUDE.md` for the file map.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## SIMPLE flowchart (the whole product in five boxes)
|
|
13
|
+
|
|
14
|
+
```mermaid
|
|
15
|
+
flowchart LR
|
|
16
|
+
SPEC[Spec: PRD / issue / OpenAPI / one-liner] --> LOOP[RARV-C loop]
|
|
17
|
+
LOOP --> VERIFY[Verify: gates + council + evidence gate]
|
|
18
|
+
VERIFY -- not done --> LOOP
|
|
19
|
+
VERIFY -- verified --> SHIP[Deployed product + proof-of-run]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Diagram type: flowchart. 4 nodes.
|
|
23
|
+
|
|
24
|
+
Reason, Act, Reflect, Verify, then Closure. The loop does not exit until the
|
|
25
|
+
verify stage clears; "done" is a verdict the machine has to earn, not a claim it
|
|
26
|
+
gets to make.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## USER view: how you run it and what you get
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# One-time: launch Claude Code with autonomous permissions
|
|
34
|
+
claude --dangerously-skip-permissions
|
|
35
|
+
|
|
36
|
+
# Then either say "Loki Mode", or run the CLI directly:
|
|
37
|
+
loki start ./prd.md # PRD-mode (a Markdown spec file)
|
|
38
|
+
loki start owner/repo#123 # issue-mode (a GitHub issue)
|
|
39
|
+
loki start # one-line brief, answer the prompt
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
What happens: `loki start` (`cmd_start` in `autonomy/loki`) execs the runner
|
|
43
|
+
(`autonomy/run.sh`). The `run_autonomous()` loop builds a prompt each iteration
|
|
44
|
+
(`build_prompt()`), invokes the provider, then runs checklist verification, an app
|
|
45
|
+
runner, smoke tests, and code review. It stops when the completion council votes
|
|
46
|
+
stop (`council_should_stop` in `autonomy/completion-council.sh`), a completion
|
|
47
|
+
promise is met, max iterations is hit, or (v8.0.0) a failure is positively
|
|
48
|
+
identified as non-retryable -- bad credentials, unknown model, exhausted quota --
|
|
49
|
+
where further retries would be guaranteed-identical failures
|
|
50
|
+
(`loki-ts/src/runner/retry_class.ts`, `LOKI_SMART_RETRY=0` to disable). An
|
|
51
|
+
unrecognized failure stays transient and retries as before, so the early exit
|
|
52
|
+
can never abandon a build that would have succeeded.
|
|
53
|
+
|
|
54
|
+
The council's own force-stop valves (stagnation, repeated done-claims) are
|
|
55
|
+
additionally delayed by one iteration when the agent's self-reported confidence
|
|
56
|
+
spikes, so a sudden claim of near-certainty is VERIFIED rather than trusted
|
|
57
|
+
(`loki-ts/src/runner/council.ts`, v8.0.0). That delay is strictly additive: it
|
|
58
|
+
can only add a verification pass, never skip one, and it never delays the
|
|
59
|
+
stagnation valve.
|
|
60
|
+
|
|
61
|
+
What you get:
|
|
62
|
+
- A runnable artifact (the built product in your working directory).
|
|
63
|
+
- A proof-of-run: `.loki/proofs/<id>/proof.json` plus an HTML report
|
|
64
|
+
(`autonomy/lib/proof-generator.py`, `autonomy/lib/proof-template.html`).
|
|
65
|
+
- An honest verdict. The evidence gate blocks completion on an empty diff, red
|
|
66
|
+
tests, an unhealthy serveable app (runtime-boot axis), or a leaked credential in
|
|
67
|
+
the changed files (secret-leak axis) - v8.0.0, `SKILL.md`.
|
|
68
|
+
|
|
69
|
+
Provider-agnostic (stable since v5.0.0): Claude (Tier 1, full), Cline (Tier 2),
|
|
70
|
+
Codex and Aider (Tier 3, degraded, sequential). Gemini deprecated v7.5.18. See
|
|
71
|
+
`skills/providers.md`.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## FOUNDER view: the moat
|
|
76
|
+
|
|
77
|
+
The moat is not "an agent that writes code". It is the trust layer wrapped around
|
|
78
|
+
the loop.
|
|
79
|
+
|
|
80
|
+
- RARV-C rigor. Every iteration is Reason, Act, Reflect, Verify, then Closure
|
|
81
|
+
(findings injection, override council, learnings, handoff). The closure knobs
|
|
82
|
+
are default-on in the Bun runner: `LOKI_INJECT_FINDINGS`, `LOKI_OVERRIDE_COUNCIL`,
|
|
83
|
+
`LOKI_AUTO_LEARNINGS`, `LOKI_HANDOFF_MD` (`CLAUDE.md`, `skills/quality-gates.md`).
|
|
84
|
+
- Verify, not vibes. 8 quality gates (`skills/quality-gates.md`), a blind
|
|
85
|
+
3-reviewer council with severity blocking, an anti-sycophancy Devil's Advocate on
|
|
86
|
+
unanimous PASS, and a verified-completion evidence gate that blocks on positive
|
|
87
|
+
fabrication evidence. The system does not call work done until it is verified
|
|
88
|
+
(`SKILL.md`).
|
|
89
|
+
- Tier routing. Opus for planning/architecture, Sonnet for development, Haiku for
|
|
90
|
+
unit tests and simple parallel work (`CLAUDE.md` Model Selection;
|
|
91
|
+
`get_rarv_tier()` in `autonomy/run.sh`, session-pinned via `LOKI_SESSION_MODEL`,
|
|
92
|
+
default sonnet). Cost tracks the tier, not a flat premium.
|
|
93
|
+
- Model-equivalence thesis (founder framing). The rigor lives in the HARNESS (the
|
|
94
|
+
loop, the gates, the council, the evidence gate), not in any one model. Because
|
|
95
|
+
the harness is provider-agnostic with abstract model tiers and a degraded mode
|
|
96
|
+
for non-Claude providers, the trust guarantee is not tied to a single vendor
|
|
97
|
+
(`SKILL.md` provider-agnostic section; `providers/*.sh`). An optional Anthropic
|
|
98
|
+
Agent SDK route exists behind `LOKI_SDK_MODE` (off by default, v8.0.0); unset is
|
|
99
|
+
byte-identical to the claude-CLI route (`references/sdk-mode.md`).
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## FULL flowchart (CLI dispatch to shipped proof)
|
|
104
|
+
|
|
105
|
+
```mermaid
|
|
106
|
+
flowchart TD
|
|
107
|
+
subgraph CLI[autonomy/loki - CLI]
|
|
108
|
+
START[loki start spec] --> DISPATCH[main dispatch]
|
|
109
|
+
DISPATCH --> EXEC[exec run.sh]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
subgraph RUNNER[autonomy/run.sh - orchestration]
|
|
113
|
+
EXEC --> RA[run_autonomous loop]
|
|
114
|
+
RA --> CPX[detect_complexity]
|
|
115
|
+
CPX --> TIER[get_rarv_tier / LOKI_SESSION_MODEL]
|
|
116
|
+
TIER --> BP[build_prompt: RARV + SDLC + memory + queue + checklist]
|
|
117
|
+
BP --> INV[invoke provider]
|
|
118
|
+
INV --> ACT[Act: agent edits code]
|
|
119
|
+
ACT --> CHK[checklist verification]
|
|
120
|
+
CHK --> APP[app runner + playwright smoke]
|
|
121
|
+
APP --> CR[run_code_review: 3 blind reviewers]
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
subgraph GATES[Quality gates - skills/quality-gates.md]
|
|
125
|
+
CR --> G1[1 static analysis]
|
|
126
|
+
G1 --> G2[2 test suite red blocks]
|
|
127
|
+
G2 --> G3[3 blind council Crit/High block]
|
|
128
|
+
G3 --> G4[4 devils advocate on unanimous PASS]
|
|
129
|
+
G4 --> G5[5 mock integrity HIGH blocks]
|
|
130
|
+
G5 --> G6[6 test mutation HIGH blocks]
|
|
131
|
+
G6 --> G7[7 doc coverage]
|
|
132
|
+
G7 --> G8[8 magic modules debate BLOCK]
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
subgraph CLOSURE[RARV-C closure + memory]
|
|
136
|
+
G8 --> FIND[inject findings]
|
|
137
|
+
FIND --> OC[override council on BLOCK]
|
|
138
|
+
OC --> LEARN[auto learnings]
|
|
139
|
+
LEARN --> HAND[handoff md]
|
|
140
|
+
HAND --> MEM[store_episode_trace: episodic/semantic]
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
subgraph VERDICT[Completion decision]
|
|
144
|
+
MEM --> EG[evidence gate: empty-diff / red-tests / boot / secret-leak]
|
|
145
|
+
EG --> CC[council_should_stop vote]
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
CC -- keep going --> RA
|
|
149
|
+
CC -- stop / verified --> PROOF[proof-generator.py -> .loki/proofs/ID/proof.json + HTML]
|
|
150
|
+
PROOF --> SHIP[deployed product + proof-of-run]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Diagram type: flowchart. 28 nodes across 6 subgraphs.
|
|
154
|
+
|
|
155
|
+
Verified anchors: `main` dispatch and `cmd_start` in `autonomy/loki`;
|
|
156
|
+
`run_autonomous()`, `build_prompt()`, `run_code_review()`, `detect_complexity()`,
|
|
157
|
+
`get_rarv_tier()` in `autonomy/run.sh`; the 8-gate table in
|
|
158
|
+
`skills/quality-gates.md`; closure env vars in `CLAUDE.md`; `council_should_stop()`
|
|
159
|
+
in `autonomy/completion-council.sh`; proof generation in
|
|
160
|
+
`autonomy/lib/proof-generator.py`. The evidence-gate axes are quoted from
|
|
161
|
+
`SKILL.md` (v8.0.0).
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## One RARV-C iteration (sequenceDiagram)
|
|
166
|
+
|
|
167
|
+
```mermaid
|
|
168
|
+
sequenceDiagram
|
|
169
|
+
participant Runner as run_autonomous (run.sh)
|
|
170
|
+
participant Prompt as build_prompt
|
|
171
|
+
participant Provider as Provider (Claude/Codex/Cline/Aider)
|
|
172
|
+
participant Verify as Gates + council
|
|
173
|
+
participant Evidence as Evidence gate
|
|
174
|
+
participant Council as completion council
|
|
175
|
+
participant Memory as Episodic/semantic store
|
|
176
|
+
|
|
177
|
+
Runner->>Prompt: Reason - assemble prompt (RARV, SDLC, memory, queue, checklist)
|
|
178
|
+
Prompt-->>Runner: iteration prompt
|
|
179
|
+
Runner->>Provider: Act - invoke provider
|
|
180
|
+
Provider-->>Runner: code edits + output
|
|
181
|
+
Runner->>Runner: Reflect - checklist, app runner, smoke tests
|
|
182
|
+
Runner->>Verify: Verify - 8 gates + 3 blind reviewers
|
|
183
|
+
Verify-->>Runner: gate verdicts (Crit/High block)
|
|
184
|
+
Runner->>Runner: Closure - inject findings, override council, learnings, handoff
|
|
185
|
+
Runner->>Memory: store episode trace
|
|
186
|
+
Runner->>Evidence: verified-completion evidence gate
|
|
187
|
+
Evidence-->>Runner: pass / block (empty-diff, red-tests, boot, secret-leak)
|
|
188
|
+
Runner->>Council: council_should_stop vote
|
|
189
|
+
Council-->>Runner: continue OR stop (verified)
|
|
190
|
+
Note over Runner,Council: on continue, next iteration re-enters Reason with injected findings
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Diagram type: sequenceDiagram. 7 participants, 14 messages.
|
|
194
|
+
|
|
195
|
+
Verified: the RARV cycle (Reason/Act/Reflect/Verify) is `SKILL.md` PRIORITY 2; the
|
|
196
|
+
Closure stage maps to the four default-on closure env vars in `CLAUDE.md`; the
|
|
197
|
+
evidence-gate axes and "does not call work done until verified" are `SKILL.md`
|
|
198
|
+
v8.0.0; the council vote is `council_should_stop` in `autonomy/completion-council.sh`.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Where this connects
|
|
203
|
+
|
|
204
|
+
Loki Mode is the ENGINE. Its `proof.json` is the evidence that the neutral
|
|
205
|
+
Autonomi Verify signer stamps, and the Autonomi SaaS product is the hosted layer
|
|
206
|
+
that drives the engine for non-technical users. See `docs/AUTONOMI-ECOSYSTEM.md`
|
|
207
|
+
for the three-repo boundary map.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# The Autonomi Ecosystem
|
|
2
|
+
|
|
3
|
+
Three repos, three jobs, three clean boundaries. This is the map that ties them
|
|
4
|
+
together.
|
|
5
|
+
|
|
6
|
+
- loki-mode (this repo) - the ENGINE. Spec to verified product via the RARV-C
|
|
7
|
+
loop, 8 quality gates, the completion council, and the evidence gate.
|
|
8
|
+
- autonomi-verify - the TRUST layer. A neutral signer that stamps observed evidence
|
|
9
|
+
with a host-held key so a receipt is non-forgeable and independently checkable.
|
|
10
|
+
- autonomi-saas - the hosted PRODUCT. Plain-English builds for non-technical users,
|
|
11
|
+
driving the engine and stamping every result with Verify.
|
|
12
|
+
|
|
13
|
+
Deep dives: `docs/ARCHITECTURE-OVERVIEW.md` (engine),
|
|
14
|
+
`../autonomi-verify/docs/INTEGRATION-DIAGRAMS.md` (trust layer),
|
|
15
|
+
`../autonomi-saas/docs/PRODUCT-ARCHITECTURE.md` (product).
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## The ecosystem in one graph
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
graph TD
|
|
23
|
+
subgraph PRODUCT[autonomi-saas - hosted product, proprietary]
|
|
24
|
+
WEB[web SPA: prompt-left / output-right]
|
|
25
|
+
BFF[BFF: only tier with engine token]
|
|
26
|
+
WORKER[worker: build loop, D-gen, preview, attestor]
|
|
27
|
+
WEB --> BFF --> WORKER
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
subgraph ENGINE[loki-mode - engine, source-available]
|
|
31
|
+
CLI[loki CLI + FastAPI]
|
|
32
|
+
LOOP[RARV-C loop + 8 gates + council + evidence gate]
|
|
33
|
+
PROOF[proof.json + proof-of-run HTML]
|
|
34
|
+
CLI --> LOOP --> PROOF
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
subgraph TRUST[autonomi-verify - neutral signer]
|
|
38
|
+
VAPI[POST /verify: decide then sign]
|
|
39
|
+
KEY[host Ed25519 key, host only]
|
|
40
|
+
VAL[POST /validate: check signature, no code run]
|
|
41
|
+
VAPI --> KEY
|
|
42
|
+
KEY --> VAL
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
WORKER -->|api-client HTTP| CLI
|
|
46
|
+
PROOF -->|observed evidence| WORKER
|
|
47
|
+
WORKER -->|POST evidence| VAPI
|
|
48
|
+
KEY -->|signed Evidence Receipt| WORKER
|
|
49
|
+
|
|
50
|
+
CLIUSER[CLI / CI user] -->|loki start| CLI
|
|
51
|
+
CLIUSER2[third-party pipeline] -->|loki verify stamp| VAPI
|
|
52
|
+
ANYONE[anyone with a receipt] -->|validate| VAL
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Diagram type: graph. 14 nodes across 3 subgraphs plus 3 external actors.
|
|
56
|
+
|
|
57
|
+
Verified anchors: the BFF is the only tier holding the engine token
|
|
58
|
+
(`autonomi-saas/apps/bff/src/engine.ts`); the worker attestor POSTs evidence to the
|
|
59
|
+
signer and gets a signed receipt (`autonomi-saas/worker/src/adapters/attestor.ts`);
|
|
60
|
+
the signer decides then signs with a host-only Ed25519 key
|
|
61
|
+
(`autonomi-verify/src/api/index.ts`, `autonomi-verify/src/persistence/index.ts`);
|
|
62
|
+
`/validate` checks a signature without running code
|
|
63
|
+
(`autonomi-verify/src/api/validatePage.ts`); the engine produces `proof.json`
|
|
64
|
+
(`loki-mode/autonomy/lib/proof-generator.py`, `loki-ts/src/runner/proof.ts`).
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Where each boundary is
|
|
69
|
+
|
|
70
|
+
| Concern | loki-mode (engine) | autonomi-verify (trust) | autonomi-saas (product) |
|
|
71
|
+
|---|---|---|---|
|
|
72
|
+
| Runs the build | Yes | No | No (delegates to engine) |
|
|
73
|
+
| Decides the verdict | Yes (gates, council, evidence gate) | Yes (neutral re-decide on presented evidence) | No |
|
|
74
|
+
| Holds the signing key | No | Yes (host only) | No |
|
|
75
|
+
| Runs untrusted code | Yes (sandboxed) | No (never runs code) | Via engine + worker sandbox |
|
|
76
|
+
| Multi-tenant auth / billing | No | Per-tenant API key on /verify | Yes (product concern) |
|
|
77
|
+
| Hosted preview + UI | No | No | Yes |
|
|
78
|
+
| Design generation (D-gen) | Prompt-level, engine-agnostic | No | Yes (default-on directive) |
|
|
79
|
+
| Source posture | Source-available | Source-available | Proprietary hosted |
|
|
80
|
+
|
|
81
|
+
The three-way trust property: the engine can decide, but the PRODUCT that built the
|
|
82
|
+
app does not hold the key that signs the receipt. Only the neutral TRUST layer does.
|
|
83
|
+
That separation is what lets a skeptic believe a receipt without trusting the
|
|
84
|
+
builder. A competitor who self-signs their own success badge cannot offer that.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## The flow, end to end
|
|
89
|
+
|
|
90
|
+
1. A user describes an app in the SaaS, or a developer runs `loki start`, or a
|
|
91
|
+
third-party pipeline runs `loki verify stamp`.
|
|
92
|
+
2. The engine runs the RARV-C loop until the gates, council, and evidence gate
|
|
93
|
+
clear, producing `proof.json`.
|
|
94
|
+
3. The observed evidence (diff + test signal) is POSTed to the neutral signer,
|
|
95
|
+
which applies one honest verdict rule and signs with the host-only key.
|
|
96
|
+
4. The signed Evidence Receipt comes back. Anyone can validate its signature at
|
|
97
|
+
`/validate` without running code or trusting the builder.
|
|
98
|
+
|
|
99
|
+
Honesty invariants that hold across all three:
|
|
100
|
+
- `verified` means "no fabrication evidence", not "tests are green"
|
|
101
|
+
(`autonomi-verify/src/verifier/verify.ts`).
|
|
102
|
+
- Block only on positive fabrication evidence; inconclusive is pass-through
|
|
103
|
+
(`autonomi-verify/src/verifier/evidenceGate.ts`).
|
|
104
|
+
- The design/beauty layer never alters the VERIFIED verdict
|
|
105
|
+
(`autonomi-saas/docs/AUTONOMI-BUILD-PLAN.md`).
|
|
106
|
+
- Signing happens after the verdict is decided, so signing cannot change it
|
|
107
|
+
(`autonomi-verify/src/api/index.ts`).
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -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:**
|
|
5
|
+
**Version:** v8.0.0
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -215,6 +215,23 @@ loki doctor # Check skill symlinks, providers, and system prerequisites
|
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
218
|
+
## Configuration file
|
|
219
|
+
|
|
220
|
+
Instead of exporting many `LOKI_*` env vars, point `loki start` at a config file with `--config <path>` (aliases: `--env-file`, `--vars`), or set `LOKI_CONFIG_FILE`. The format is detected from the extension or content: `.yaml`/`.yml`, `.json`, or `.env` (flat `LOKI_*=value` lines). Values resolve by precedence: a CLI flag beats an ambient env var, which beats the `--config` file, which beats built-in defaults. Never inline a secret; reference an env var with `${VAR}` and the loader expands it at load time (an unset reference is skipped with a warning, and a raw-looking secret literal is flagged and rejected by `loki config validate`). Run `loki config example` to generate an annotated starter.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# config.yaml
|
|
224
|
+
dashboard:
|
|
225
|
+
port: 9000
|
|
226
|
+
github:
|
|
227
|
+
token: ${GITHUB_TOKEN} # expanded from the environment, never stored inline
|
|
228
|
+
|
|
229
|
+
loki start --config config.yaml ./prd.md
|
|
230
|
+
loki config validate config.yaml # check refs and reject raw secrets before a run
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
218
235
|
## Other Methods
|
|
219
236
|
|
|
220
237
|
Git clone and Docker installation methods are also available. See
|
|
@@ -396,7 +413,7 @@ provider works inside the container. Provide auth with your Anthropic API key:
|
|
|
396
413
|
# Run Loki Mode in Docker (Claude provider, API-key auth)
|
|
397
414
|
docker run --rm -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
|
|
398
415
|
-v $(pwd):/workspace -w /workspace \
|
|
399
|
-
asklokesh/loki-mode:
|
|
416
|
+
asklokesh/loki-mode:8.0.0 start ./my-spec.md
|
|
400
417
|
```
|
|
401
418
|
|
|
402
419
|
##### docker compose + .env (no host install)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Model-Equivalence Harness Plan (provable "haiku + harness = opus" moat)
|
|
2
|
+
|
|
3
|
+
Thesis under test: outcome quality is a property of the ORCHESTRATION, not the raw model. A great harness makes Haiku reach the same end-outcome quality as Opus.
|
|
4
|
+
|
|
5
|
+
Formal claim (per axis, held-out corpus): outcome_quality(haiku + full-harness) >= outcome_quality(opus + baseline-harness) - epsilon, accepted only when the bootstrap CI of the gap overlaps zero (or sits above -epsilon). Else report the true residual. This is a measurement instrument, not a marketing generator.
|
|
6
|
+
|
|
7
|
+
Design stance: the bench harness, grader, schema, cost module, tier machinery all exist and are correct. Steering levers are env-var-controlled; _base.run_cli merges os.environ into the loki start subprocess (_base.py:113). So the model x config matrix needs ZERO adapter/grader changes - only an orchestration script that sets env vars and calls the existing runner, plus a new aggregation report.
|
|
8
|
+
|
|
9
|
+
## Ground truth (build on, don't rebuild)
|
|
10
|
+
- Model pin: LOKI_SESSION_MODEL in {haiku,sonnet,opus,fable}, honored at adapters/loki.py:135-138 and run.sh:17336-17357.
|
|
11
|
+
- Env passthrough: _base.run_cli merges dict(os.environ) (_base.py:113).
|
|
12
|
+
- Grader: held-out overlay + acceptance exit code; adapter forbidden from emitting success/quality/score/verdict (bench_schema.py:219-231).
|
|
13
|
+
- Corpus: 5 discriminator tasks with held-out overlays. HARD tasks (hard-1-order-api, multifail-1-two-modules, tokenheavy-1-crm) are where levers fire; simple tasks one-shot (iterations:1) so levers are noise there.
|
|
14
|
+
- Steering flags (all env-dialable): LOKI_MAX_ITERATIONS, LOKI_COUNCIL_ENABLED, LOKI_PHASE_CODE_REVIEW, LOKI_SELF_HEAL, LOKI_ALLOW_HAIKU, LOKI_COMPLETION_PROMISE, LOKI_COUNCIL_CHECK_INTERVAL/THRESHOLD/MIN_ITERATIONS.
|
|
15
|
+
- Cost: prices.json (opus 15/75, sonnet 3/15, haiku 1/5 per Mtok) + native cost_usd.
|
|
16
|
+
|
|
17
|
+
## 1. Experiment design
|
|
18
|
+
Matrix 6 cells: {haiku,sonnet,opus} x {baseline-steering, full-harness-steering}. Hero cell = H.F (haiku+full harness) vs O.B (opus+raw). baseline = MAX_ITERATIONS=1, council off, review off, self-heal off (the Replit/Cursor "throw the model at it" mode). full = all levers on.
|
|
19
|
+
|
|
20
|
+
Three axes, never blended: (1) CORRECTNESS = held-out acceptance exit 0 (deterministic, works today, primary). (2) DESIGN QUALITY = D-val screenshot+rubric 0-100 (web tasks only; NOT yet built; report not_captured until the judge is validated). (3) HONESTY = real proof.json/verify verdict present + true (guards against weak model "declaring done" falsely).
|
|
21
|
+
|
|
22
|
+
Statistical rigor: correctness is Bernoulli -> Wilson score interval (not normal approx). gap = success_rate(H.F) - success_rate(O.B); bootstrap CI (>=2000 resamples over (task,trial) pairs). Decision: accept equivalence iff gap CI lower-bound >= -epsilon (default 0.10). CI entirely below -epsilon -> real residual. CI straddles -> underpowered, need more N. HONEST small-N: N=3 x 5 tasks detects only >~20-pt gaps; credible equivalence within epsilon=0.10 needs N>=8-10/task (~40-50 obs/cell). Min credible claim = N=10 x 5 tasks x 6 cells = 300 runs.
|
|
23
|
+
|
|
24
|
+
## 2. Steering levers + ablation (the mechanism)
|
|
25
|
+
Each lever = an env var wired into run.sh. Ablate: hold model=haiku, toggle one lever, measure delta in success_rate (leave-one-out from full-on; cheaper + more decision-relevant). Do it only on the 3 HARD tasks.
|
|
26
|
+
- More RARV-C iterations (LOKI_MAX_ITERATIONS 1->8): weak models converge by trial-and-error against the acceptance harness.
|
|
27
|
+
- Council gate (LOKI_COUNCIL_ENABLED): 3 reviewers catch weak-model "looks done but isn't".
|
|
28
|
+
- Code review (LOKI_PHASE_CODE_REVIEW): catches weak-model correctness bugs.
|
|
29
|
+
- Self-heal (LOKI_SELF_HEAL=1): feeds prior error back as a hint; weak models fix faster.
|
|
30
|
+
- Verify/proof gate: forces real evidence (honesty axis).
|
|
31
|
+
- Structured decomposition (grill): breaks hard tasks into weak-model-sized pieces.
|
|
32
|
+
- Design gate (D-val): forces design quality regardless of model (web only).
|
|
33
|
+
- Prompt scaffolding: constrains weak-model output toward the spec.
|
|
34
|
+
Output: ablation table (lever -> haiku success_rate OFF vs ON, marginal lift + CI + DEV/LOCKED overfit flag).
|
|
35
|
+
|
|
36
|
+
## 3. Adaptive harness (the product)
|
|
37
|
+
Encode the ablation result as a tier-aware harness policy (model -> lever settings), so the same outcome ships on any tier. Home: loki_apply_tier_harness_policy() helper + policy table in autonomy/run.sh near the tier case block (17340-17347); exports lever env vars UNLESS the operator set them (override wins). ~15 lines. haiku/fast: MAX_ITERATIONS=8, council on, self-heal on, stricter gate. sonnet: MAX_ITERATIONS=5, council on, self-heal on. opus: MAX_ITERATIONS=3, council on, self-heal off. Ties to Task#6 tier routing (same variable) and SaaS pricing (model-policy.ts allowedModels: free=haiku/$15=sonnet/$99=opus) - they meet at the one env var. This is what makes free-tier haiku yield near-top outcomes = the business case.
|
|
38
|
+
|
|
39
|
+
## 4. Improvement loop (not one-shot)
|
|
40
|
+
Run 6-cell matrix on HARD held-out tasks (correctness first, it's free) -> measure per-axis gap + bootstrap CI -> if gap CI lower-bound >= -epsilon on all axes, DONE (claim proven with N+spread) -> else leave-one-out ablation on haiku, find the lever closing the largest residual, dial it, re-run only changed cells -> repeat UNTIL equivalence within noise OR marginal lift < CI width (diminishing returns -> report honest residual). Never chase a benchmark number.
|
|
41
|
+
|
|
42
|
+
Anti-overfit: DEV/LOCKED corpus split (levers tuned on DEV, LOCKED touched only for the final claim). Grow corpus to >=12-15 tasks before any equivalence claim, ~60/40 split. Rotate locked tasks. Any lever lifting DEV but not LOCKED = benchmark-overfit, excluded from shipped policy.
|
|
43
|
+
|
|
44
|
+
## 5. Rigor/honesty guards
|
|
45
|
+
Grader stays deterministic held-out exit code (no change to runner.grade / validate_adapter_output). The D-val LLM-judge MUST be validated before grading: inter-rater reproducibility (same screenshot >=3x, 2 judge models opus+sonnet, report variance), anchor with known-good/known-bad; if judge variance > the gap being measured, design axis is not_captured (don't fabricate). Correctness + honesty axes don't depend on any LLM judge. No fabricated numbers (report N + spread; null != 0). Never tune corpus/grader across a before/after pair (task_hash binds fixture+spec; refuse to compare mismatched task_hash). Disclose overfit levers (DEV vs LOCKED delta per lever).
|
|
46
|
+
|
|
47
|
+
## 6. Cost + cheap-first schedule
|
|
48
|
+
Per-build (hard task, full harness): haiku ~$0.30-1, sonnet ~$1-3, opus ~$5-15 (council+review+self-heal add reviewer calls; full-harness cells cost multiples of baseline).
|
|
49
|
+
- Stage 0 smoke: H.B + O.B on fizzbuzz, N=1 = 2 runs, ~$1. Prove the matrix machinery + haiku pin (needs LOKI_ALLOW_HAIKU=true).
|
|
50
|
+
- Stage 1 pilot: H.F vs O.B on 3 HARD tasks, N=2-3, ~15 runs, ~$30-80. First credible directional signal on the gap. (Underpowered: only detects >20-pt gaps.)
|
|
51
|
+
- Stage 2 ablation: leave-one-out on haiku, hard tasks, N=3, ~50 runs, ~$60-120. Which lever closes the gap.
|
|
52
|
+
- Stage 3 credible claim: full 6-cell, >=12-task corpus, DEV/LOCKED, N=10, ~700 runs, ~$500-2000. Publishable proof with CIs.
|
|
53
|
+
Min for first signal: Stage 0 + Stage 1 ~$30-80 = H.F vs O.B on 3 hard tasks at N=3.
|
|
54
|
+
|
|
55
|
+
## 7. Deliverables (thin extensions)
|
|
56
|
+
1. benchmarks/bench/matrix.sh (~80 lines): loops 6 cells, exports model+lever env per cell, calls existing run.sh run <task>, writes tagged result JSONs. No runner/adapter change.
|
|
57
|
+
2. benchmarks/bench/equivalence_report.py: reads tagged results, computes per-axis per-model gap + Wilson/bootstrap CI, renders grid + ablation table + explicit decision (equivalent within epsilon / real residual / underpowered). Reuses report.py helpers. Refuses mismatched task_hash.
|
|
58
|
+
3. Adaptive harness policy helper + table in autonomy/run.sh (populated from Stage-2 data; stub first).
|
|
59
|
+
4. Corpus growth: 7-10 new tasks + overlays following the existing 5, DEV/LOCKED split. Web tasks tagged for D-val.
|
|
60
|
+
5. Design-axis integration (deferred until D-val judge validated): non-gating grader signal like quality.lint_ok.
|
|
61
|
+
|
|
62
|
+
## Ranked (cheapest credible signal first)
|
|
63
|
+
1. Stage 0 smoke (~$1): confirm haiku pin + env passthrough.
|
|
64
|
+
2. Stage 1 pilot (~$30-80): first directional signal; ship equivalence_report.py here, honestly labelled underpowered.
|
|
65
|
+
3. Stage 2 ablation (~$60-120): attribute gap-closing to levers -> harness policy table.
|
|
66
|
+
4. Corpus growth + DEV/LOCKED (dev time): precondition for a published claim.
|
|
67
|
+
5. Stage 3 credible claim (~$500-2000): publishable proof.
|
|
68
|
+
Everything before Stage 3 is under ~$200 and answers "does steering close the haiku-vs-opus gap?" with real data.
|
|
69
|
+
|
|
70
|
+
CORRECTION: the design axis (D-val) is planned in autonomi-saas, NOT built; its LLM judge must pass reproducibility validation before grading. The first provable claim rests on CORRECTNESS (free, deterministic, works today) + HONESTY (verify verdict). Do not gate the moat claim on the unbuilt design axis.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Plans Index
|
|
2
|
+
|
|
3
|
+
This index maps each historical plan doc to its status. Plan docs are kept as design history; a 'shipped' plan's feature is live in the code.
|
|
4
|
+
|
|
5
|
+
| Plan | Status | Notes |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| BRANCH-LIFECYCLE-PLAN.md | shipped | Feature-branch-by-default + CI/CD-aware deploy; `feature_branch` logic in `autonomy/run.sh`. |
|
|
8
|
+
| BUILD-HUD-PLAN.md | shipped | Live in-terminal build HUD; `LOKI_HUD` / `[HUD]` in `autonomy/run.sh`, CHANGELOG "Live in-terminal build HUD". |
|
|
9
|
+
| CONFIG-FILE-PLAN.md | shipped | Unified config file; `--config` / `--vars` / `--env-file` flags in `autonomy/loki`. |
|
|
10
|
+
| CRASH-REPORTING-PLAN.md | shipped | Crash-reporting + auto-fix; `cmd_crash()` in `autonomy/loki` (`loki crash`). |
|
|
11
|
+
| DEPLOY-PLAN.md | shipped | `loki deploy` advisory print-only; CHANGELOG "`loki deploy`: advisory, print-only deploy guidance". |
|
|
12
|
+
| FAILURE-MEMORY-PLAN.md | shipped | Failure-memory loop; `FailureMode` schema in `memory/schemas.py`. |
|
|
13
|
+
| FEAT-PRDREUSE-DOCKER-PLAN.md | shipped | PRD-reuse + Docker batch; Docker dashboard/port + PRD-reuse present in `autonomy/loki`. |
|
|
14
|
+
| MERGE3-PLAN.md | shipped | Purple-Lab-into-Dashboard integration; `/lab/` mount in `dashboard/server.py`. |
|
|
15
|
+
| P0-SWEEP-PLAN.md | shipped | Verification-credibility sweep; wired detectors are part of the 8-gate system. |
|
|
16
|
+
| P2-SPEC-ROBUSTNESS-PLAN.md | shipped | Spec interrogation gate + assumption ledger; part of quality-gates spec robustness. |
|
|
17
|
+
| PRD-REUSE-DONE-RECOGNITION-PLAN.md | shipped | PRD-reuse done-recognition gate; reuse-then-verify behavior in the engine. |
|
|
18
|
+
| PREVIEW-LINK-PLAN.md | shipped | `loki preview --public`; `_preview_public` in `autonomy/loki`, CHANGELOG "`loki preview --public`". |
|
|
19
|
+
| R10-MARKETPLACE-PLAN.md | shipped | Agent/template marketplace (install-from-source); `loki template` marketplace in `autonomy/loki`. |
|
|
20
|
+
| R6-ROLLBACK-CHECKPOINT-PLAN.md | shipped | 1-click rollback + checkpoint UX; `cmd_rollback()` / `rollback)` dispatch in `autonomy/loki`. |
|
|
21
|
+
| R7-ZERO-CONFIG-FIRST-RUN-PLAN.md | shipped | Zero-config first run; welcome/first-run path in `autonomy/loki`. |
|
|
22
|
+
| R8-SHAREABLE-TEAM-ASSETS-PLAN.md | shipped | Exportable/importable team assets; `cmd_export()` / `cmd_import()` in `autonomy/loki`. |
|
|
23
|
+
| R9-OPEN-CORE-HOOKS-PLAN.md | shipped | Open-core seams (BUSL-1.1); open-core seam references in `autonomy/loki`. Seams only; no hosted backend (by design). |
|
|
24
|
+
| RARV-C-100X-PLAN.md | active | v8.0.0 native-primitives arc; v8 lives on the `feature/v8-agent-sdk` branch, not yet merged to main. |
|
|
25
|
+
| RARV-C-LOOP-EFFICIENCY-PLAN.md | superseded | Self-marked SUPERSEDED by RARV-C-100X-PLAN.md (v8.0.0 arc); anchors drifted, kept as history. |
|
|
26
|
+
| SHAREABLE-PROOF-PLAN.md | shipped | Opt-in shareable proof-of-run (v7.19.3) preserving zero-egress posture. |
|
|
27
|
+
| SONNET5-DEFAULT-PLAN.md | shipped | Sonnet 5 default execution model; `v7.104.0: Sonnet 5 is the default` in `providers/claude.sh`. |
|
|
28
|
+
| TASKLIST-ACCURACY-PLAN.md | shipped | Dashboard task-list accuracy fix; task-list handling in `dashboard/server.py`, CHANGELOG v7.104.x task-list fixes. |
|
|
29
|
+
| UNCERTAINTY-ESCALATION-PLAN.md | shipped | Uncertainty-gated escalation (v7.19.2); uncertainty escalation logic in `autonomy/run.sh`. |
|
|
30
|
+
| VERIFIED-COMPLETION-PLAN.md | shipped | Verified completion (v7.19.1); verified-completion gate in `autonomy/run.sh` + `autonomy/completion-council.sh`. |
|
|
31
|
+
| WELCOME-OPENER-PLAN.md | shipped | Welcome opener ("magic opener"); `welcome` path in `autonomy/loki`. |
|
|
32
|
+
| V8-AGENT-SDK-PLAN.md | shipped | The v8 Anthropic SDK runtime migration; shipped on `feature/v8-agent-sdk` as v8.0.0 + v8.1 (`loki-ts/src/runner/sdk_invoker.ts`, `sdk_mode.ts`, CHANGELOG v8.0.0/v8.1). Feature-branch-only, not yet merged to main. |
|
|
33
|
+
| V8-SDK-RESEARCH-RAW.md | shipped | Research notes underpinning V8-AGENT-SDK-PLAN; design history for the v8 SDK arc. |
|
package/docs/PRIVACY.md
CHANGED
|
@@ -88,8 +88,36 @@ the tools you use, plus the same anonymous `distinct_id`. It still never sends
|
|
|
88
88
|
your name, email, or IP. In headless / Docker / CI environments there is no
|
|
89
89
|
browser, so this path never runs.
|
|
90
90
|
|
|
91
|
+
### 4. Build-outcome analytics (anonymous, STRICT opt-in, default OFF)
|
|
92
|
+
|
|
93
|
+
A `build_verified` event that reports how a build turned out. Unlike crash
|
|
94
|
+
reporting and usage telemetry (which default ON for individuals), this path is
|
|
95
|
+
OFF by default even for users who have telemetry enabled -- it requires a
|
|
96
|
+
SECOND, explicit opt-in:
|
|
97
|
+
|
|
98
|
+
- Set `LOKI_ANALYTICS=on` (or `LOKI_POSTHOG=on`), or
|
|
99
|
+
- Add `ANALYTICS_ENABLED=true` to `~/.loki/config`.
|
|
100
|
+
|
|
101
|
+
It fires once when a build finishes, reading a FIXED allowlist of already-
|
|
102
|
+
computed scalars from the run's Evidence Receipt (`proof.json`). The allowlist
|
|
103
|
+
(`autonomy/lib/proof-analytics-props.py`) is the single source of truth; any
|
|
104
|
+
field not named there is never read, so a schema change cannot silently start
|
|
105
|
+
sending something new. Fields sent:
|
|
106
|
+
|
|
107
|
+
- headline (a bounded enum: VERIFIED / VERIFIED WITH GAPS / NOT VERIFIED)
|
|
108
|
+
- evidence_gate_verdict, final_verdict (bounded verdict strings)
|
|
109
|
+
- iterations, files_changed_count (a COUNT -- never the file paths)
|
|
110
|
+
- wall_clock_sec, gates_passed, gates_total, gate_pass_rate
|
|
111
|
+
|
|
112
|
+
It NEVER sends your spec/PRD text, file paths or names, code, or diffs. Because
|
|
113
|
+
it sits below the base telemetry gate, every telemetry opt-out (`loki telemetry
|
|
114
|
+
off` / `LOKI_TELEMETRY=off` / `DO_NOT_TRACK=1`) also disables it -- opt-out
|
|
115
|
+
always wins.
|
|
116
|
+
|
|
91
117
|
This document and the first-run notice describe ALL paths. The model is unified:
|
|
92
|
-
|
|
118
|
+
opt-out always wins and disables everything; crash reporting and usage telemetry
|
|
119
|
+
opt in together (default ON for individuals); build-outcome analytics needs its
|
|
120
|
+
own explicit second opt-in on top (default OFF).
|
|
93
121
|
|
|
94
122
|
## What is collected (the whitelist)
|
|
95
123
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Signed Evidence Receipts (operator guide)
|
|
2
|
+
|
|
3
|
+
Status: the signing and verification pipeline is **implemented and working
|
|
4
|
+
today**, gated behind one environment variable. This guide is the missing
|
|
5
|
+
operational half: how to turn it on, what it buys you, and what it does not.
|
|
6
|
+
|
|
7
|
+
## Why this matters
|
|
8
|
+
|
|
9
|
+
Loki's Evidence Receipt is checkable by default: `loki proof verify <id>`
|
|
10
|
+
re-hashes the receipt (tamper) and re-derives the diff from the recorded base
|
|
11
|
+
SHA (drift). But on the **unsigned** path the generator is TRUSTED. A forger who
|
|
12
|
+
rewrites both the facts and the headline into a mutually consistent lie and
|
|
13
|
+
recomputes the integrity hash still passes verification, and the verifier
|
|
14
|
+
honestly reports `generator_trusted: true`.
|
|
15
|
+
|
|
16
|
+
That limitation is deliberately locked into the test suite
|
|
17
|
+
(`tests/test-proof-forgery-defense.sh`, case c) rather than papered over, and in
|
|
18
|
+
v7.111.0 the project removed its own earlier "non-forgeable" claim once it was
|
|
19
|
+
found to be false on that path.
|
|
20
|
+
|
|
21
|
+
**Signing is what closes that gap.** With a detached GPG signature over the
|
|
22
|
+
same canonical bytes that were hashed, a third party who trusts your key can
|
|
23
|
+
confirm the receipt came from your generator and has not been altered since.
|
|
24
|
+
That is the difference between "defense-in-depth" and neutral non-forgeability,
|
|
25
|
+
and it is the property an auditor or a customer's security team actually needs.
|
|
26
|
+
|
|
27
|
+
## Turning it on
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
export LOKI_PROOF_GPG_KEY="<key-id-or-fingerprint>"
|
|
31
|
+
loki start ./spec.md
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That is the whole switch. Every receipt generated while the variable is set
|
|
35
|
+
carries a `verification.gpg_signature` field (ASCII-armored, detached).
|
|
36
|
+
|
|
37
|
+
Properties worth knowing before you rely on it:
|
|
38
|
+
|
|
39
|
+
- **Default OFF.** With `LOKI_PROOF_GPG_KEY` unset, no signature field is
|
|
40
|
+
emitted and the receipt bytes are byte-identical to before.
|
|
41
|
+
- **Local only.** It shells out to the `gpg` on your PATH
|
|
42
|
+
(`gpg --batch --yes --armor --detach-sign --local-user <key> --output -`).
|
|
43
|
+
No network call, no external service, no key ever leaves the machine.
|
|
44
|
+
- **Best effort, never blocking.** If `gpg` is missing, the key is not found, or
|
|
45
|
+
signing times out (30s), the proof is still emitted, unsigned. Signing must
|
|
46
|
+
never be able to fail a build.
|
|
47
|
+
- **Signed over the canonical pre-verification bytes**, the same form the
|
|
48
|
+
verifier reconstructs, so the signature and the integrity hash always cover
|
|
49
|
+
identical content.
|
|
50
|
+
|
|
51
|
+
## Verifying a signed receipt
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
loki proof verify <id>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The JSON result carries a `gpg_ok` field with three states, and the tri-state is
|
|
58
|
+
the point:
|
|
59
|
+
|
|
60
|
+
| `gpg_ok` | Meaning |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `true` | good signature from a key the verifier trusts |
|
|
63
|
+
| `false` | signature present but verification FAILED (treat as tampered) |
|
|
64
|
+
| `"n/a"` | no signature present, or `gpg` unavailable on the verifying machine |
|
|
65
|
+
|
|
66
|
+
`generator_trusted` is `true` whenever `gpg_ok` is not `true`. Read that field:
|
|
67
|
+
it is the receipt telling you honestly how much it is worth.
|
|
68
|
+
|
|
69
|
+
A verifying party needs your public key in their keyring. Distribute it however
|
|
70
|
+
you already distribute release-signing keys (a keyserver, your website, your
|
|
71
|
+
release artifacts). Loki deliberately does not invent a key-distribution
|
|
72
|
+
mechanism.
|
|
73
|
+
|
|
74
|
+
## For enterprises
|
|
75
|
+
|
|
76
|
+
The combination that matters for an audit trail:
|
|
77
|
+
|
|
78
|
+
1. Sign receipts with an organization key held in your CI secret store.
|
|
79
|
+
2. Archive `.loki/proofs/<run_id>/` alongside the merged commit.
|
|
80
|
+
3. Any reviewer, auditor, or downstream consumer can then verify offline, with
|
|
81
|
+
no access to Loki, your CI, or the original machine.
|
|
82
|
+
|
|
83
|
+
Because verification is fully offline and the receipt separates deterministic
|
|
84
|
+
FACTS from AI ASSESSMENTS, the artifact answers "what was actually checked, on
|
|
85
|
+
which exact code" without asking anyone to trust the agent that produced it.
|
|
86
|
+
|
|
87
|
+
## Honest limits
|
|
88
|
+
|
|
89
|
+
- A signature proves **provenance and integrity**, not correctness. It says this
|
|
90
|
+
receipt came from your generator unaltered. It does not say the code is
|
|
91
|
+
bug-free. The receipt's own headline (VERIFIED / VERIFIED WITH GAPS / NOT
|
|
92
|
+
VERIFIED) is computed from facts and remains the correctness statement.
|
|
93
|
+
- Signing does not retroactively protect receipts generated unsigned.
|
|
94
|
+
- If the signing key is compromised, signed receipts from that key are worth
|
|
95
|
+
exactly what the key is worth. Normal key hygiene applies.
|
|
96
|
+
|
|
97
|
+
## Source
|
|
98
|
+
|
|
99
|
+
- Signing: `autonomy/lib/proof-generator.py` (`_gpg_detached_sign`, and the
|
|
100
|
+
`LOKI_PROOF_GPG_KEY` gate)
|
|
101
|
+
- Verification: `autonomy/lib/proof-verify.py` (`_verify_gpg`)
|
|
102
|
+
- Scope test: `tests/test-proof-forgery-defense.sh`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sonnet 5 Default - Implementation Plan
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: SHIPPED (v7.104.0; kept as design history). Worktree: `../loki-sonnet5-wt` (branch `feat/sonnet5-default`).
|
|
4
4
|
Board decision: `strategy/roadmap/13-BOARD-2026-06-30.md`. Verified facts: `reference-sonnet5-model-ids` memory.
|
|
5
5
|
Release class: MINOR (new default execution model for every user). Full local-ci + council 3/3 + release ladder.
|
|
6
6
|
|