Skip to content

Commit 970cbff

Browse files
committed
docs: add autonomous os completion plan
1 parent 0184b46 commit 970cbff

4 files changed

Lines changed: 386 additions & 0 deletions

File tree

docs/autonomous-os-plan.md

Lines changed: 366 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,366 @@
1+
# ZERO Autonomous OS Completion Plan
2+
3+
This plan defines the path from the current open-source launch repository to a
4+
complete ZERO autonomous operating system for self-custodial onchain
5+
operations.
6+
7+
The current public repo is strong as an open-source product page, contributor
8+
surface, CLI, paper runtime, and safety-first launch artifact. It is not yet a
9+
complete autonomous real-capital operating system. The remaining work is mostly
10+
runtime truth, live exchange evidence, multi-operator isolation, public Network
11+
ingestion, and commercial Intelligence infrastructure.
12+
13+
## North Star
14+
15+
ZERO reaches 100/100 when a serious operator can:
16+
17+
- deploy ZERO locally, in Docker, or on Railway without private ZERO
18+
infrastructure;
19+
- run paper mode on live Hyperliquid market data;
20+
- run a continuous OODA loop with strategy runners, risk gates, execution
21+
policy, and immune controls;
22+
- inspect every accepted and rejected decision through the terminal;
23+
- switch to live Hyperliquid execution only after local custody, journal,
24+
risk, liveness, and emergency controls pass;
25+
- reconcile open orders, fills, positions, equity, funding, and exchange
26+
failures against Hyperliquid;
27+
- pause, kill, flatten, or reduce risk immediately from the CLI;
28+
- restart without losing runtime state, idempotency state, risk state, or
29+
position truth;
30+
- export an audit bundle that explains every cycle and every decision;
31+
- opt into public ZERO Network publishing without leaking secrets;
32+
- consume delayed public ZERO Intelligence snapshots for free;
33+
- pay for realtime ZERO Intelligence API access when speed, history, scale,
34+
webhooks, redistribution rights, or support matter.
35+
36+
## Product Boundary
37+
38+
Open:
39+
40+
- ZERO Runtime
41+
- ZERO Terminal
42+
- paper trading
43+
- venue adapters needed for self-custodial operation
44+
- local journals and audit exports
45+
- strategy and market-data extension contracts
46+
- ZERO Network proof contracts, profiles, leaderboards, and delayed public
47+
snapshots
48+
- Railway and Docker self-host deployment paths
49+
50+
Commercial:
51+
52+
- realtime ZERO Intelligence API
53+
- historical intelligence datasets
54+
- cohorts, benchmarks, webhooks, exports, redistribution rights, SLAs, and
55+
enterprise support
56+
- hosted ingestion and reliability commitments for the Intelligence product
57+
58+
ZERO should not sell basic execution, custody, or safety as proprietary
59+
features. ZERO should sell advantaged access to verified autonomous behavior at
60+
speed, scale, history, and reliability.
61+
62+
## Current Baseline
63+
64+
| Dimension | Current | 100/100 Gap |
65+
|---|---:|---|
66+
| Public repo hygiene | 99 | registry ownership, external release drill |
67+
| Product narrative | 98 | keep narrative aligned as runtime becomes real |
68+
| CLI readiness | 91 | live cockpit drills, operator automation examples |
69+
| Engine runtime | 72 | OODA loop, runners, durable bus, production state |
70+
| Safety and risk | 88 | exchange chaos drills, external review |
71+
| API contracts | 90 | hosted auth/rate contracts, live runtime contracts |
72+
| Deployment | 84 | live Railway proof, remote logs, doctor automation |
73+
| Observability and audit | 86 | signed bundles, metrics backend, log drains |
74+
| Security and custody | 90 | external review, key-handling drill evidence |
75+
| ZERO Network | 58 | hosted ingestion, anti-gaming, identity, public pages |
76+
| ZERO Intelligence | 56 | hosted API, billing, history, webhooks, terms |
77+
| Release and distribution | 90 | registries, Homebrew, release rollback rehearsal |
78+
| Operator docs | 94 | live drill evidence and real exchange runbooks |
79+
80+
## Execution Cycles
81+
82+
Each cycle should land as a small, reviewable merge to `main` with tests, docs,
83+
and a scorecard update. A cycle is done only when local `just ci` and remote
84+
CI/security workflows pass.
85+
86+
### Cycle 12: Autonomous Runtime Loop
87+
88+
Target score: 78.
89+
90+
Build the public OODA controller as the engine source of truth:
91+
92+
- `observe`: collect market, account, journal, operator, and liveness state.
93+
- `orient`: derive regime, exposure, stale data, and risk posture.
94+
- `decide`: run strategy runners and risk policy to produce intents or
95+
rejections.
96+
- `act`: dispatch to paper or live execution bus.
97+
- `learn`: append audit records and calibration signals.
98+
99+
Exit gate:
100+
101+
- `zero-engine run --mode paper --once` produces one complete cycle record.
102+
- `zero-engine run --mode paper --interval 5s` can run continuously.
103+
- Restart recovery preserves last cycle, idempotency keys, positions, and
104+
rejection counts.
105+
106+
### Cycle 13: Strategy Runner SDK
107+
108+
Target score: 80.
109+
110+
Turn examples into a real contributor SDK:
111+
112+
- define `StrategyRunner` and `MarketLens` protocols;
113+
- load declarative YAML strategies and Python plugins in paper mode;
114+
- require paper-only defaults for community plugins;
115+
- add conformance fixtures for runner outputs, risk labels, and failure modes.
116+
117+
Exit gate:
118+
119+
- a new strategy can be added with one file plus one fixture;
120+
- malformed runners fail closed;
121+
- strategy output cannot bypass risk evaluation.
122+
123+
### Cycle 14: Durable Runtime Bus
124+
125+
Target score: 83.
126+
127+
Replace process memory assumptions with a durable local bus:
128+
129+
- event log for cycles, decisions, fills, positions, health, and operator
130+
commands;
131+
- state snapshots for fast boot;
132+
- append-only journal integrity checks;
133+
- SQLite or JSONL-backed local store with a clean interface for future
134+
Postgres mirroring.
135+
136+
Exit gate:
137+
138+
- kill and restart during a paper loop recovers state without duplicated fills;
139+
- audit export can reconstruct the session from disk only.
140+
141+
### Cycle 15: Hyperliquid Account Reconciliation
142+
143+
Target score: 86.
144+
145+
Make Hyperliquid account truth explicit before expanding live trading:
146+
147+
- read open orders, fills, positions, margin, funding, and account equity;
148+
- reconcile local state against exchange state;
149+
- classify drift as stale data, local lag, exchange rejection, or critical
150+
mismatch;
151+
- fail live risk-increasing actions when reconciliation is stale or mismatched.
152+
153+
Exit gate:
154+
155+
- `/hl/account` and CLI readouts are available without exposing secrets;
156+
- reconciliation fixtures cover partial fills, canceled orders, stale mids,
157+
missing orders, and drift.
158+
159+
### Cycle 16: Live Execution Certification Harness
160+
161+
Target score: 89.
162+
163+
Promote live primitives into a certified operating path:
164+
165+
- exchange adapter conformance tests;
166+
- fake exchange chaos harness;
167+
- tiny-capital live canary runbook;
168+
- dead-man, cancel-all, kill, pause, flatten, and reduce-only drills;
169+
- evidence bundle template for live rehearsal.
170+
171+
Exit gate:
172+
173+
- no live start without passing preflight, reconciliation, durable journal, and
174+
dead-man checks;
175+
- a dry-run or tiny-live report can prove each emergency path worked.
176+
177+
### Cycle 17: Immune System And Circuit Breakers
178+
179+
Target score: 91.
180+
181+
Build the protective layer as first-class runtime code:
182+
183+
- stale data breaker;
184+
- max drawdown breaker;
185+
- daily loss and per-symbol exposure breaker;
186+
- order velocity breaker;
187+
- exchange error breaker;
188+
- operator inactivity breaker;
189+
- manual kill file and terminal kill command priority.
190+
191+
Exit gate:
192+
193+
- every breaker has fixtures, metrics, audit records, and CLI rendering;
194+
- risk-reducing commands continue to work while risk-increasing actions are
195+
blocked.
196+
197+
### Cycle 18: Operator Terminal Live Cockpit
198+
199+
Target score: 92.
200+
201+
Make the CLI/TUI the safety-preserving operator interface for the real runtime:
202+
203+
- cycle status, exchange status, reconciliation status, breaker state, and
204+
journal tail;
205+
- live heartbeat visibility;
206+
- preflight and refusal reasons surfaced plainly;
207+
- one-command `pause`, `kill`, `flatten`, and `resume` flows;
208+
- non-interactive `zero run` examples for supervised operations.
209+
210+
Exit gate:
211+
212+
- an operator can diagnose and reduce risk from the terminal without using raw
213+
HTTP calls.
214+
215+
### Cycle 19: Multi-Operator Foundation
216+
217+
Target score: 94.
218+
219+
Prepare ZERO as a substrate, not a single-operator script:
220+
221+
- `OperatorContext` for all runtime state, custody config, bus paths, and model
222+
config;
223+
- per-operator local filesystem partitions;
224+
- signed deployment identity and heartbeat protocol;
225+
- local-first deployment claim contract;
226+
- public schema that a hosted control plane can consume later without making
227+
paper mode depend on it.
228+
229+
Exit gate:
230+
231+
- two operators can run isolated local deployments from the same checkout;
232+
- state, journals, profiles, and credentials cannot cross partitions.
233+
234+
### Cycle 20: LLM Gateway
235+
236+
Target score: 95.
237+
238+
Add provider-agnostic intelligence plumbing without making trading depend on a
239+
single model vendor:
240+
241+
- `ModelClient` protocol;
242+
- Anthropic, OpenAI, Ollama, and OpenRouter adapters;
243+
- capability tiers for hard reasoning, fast reasoning, chat, and embeddings;
244+
- structured output validation and retry rules;
245+
- usage and cost event recording;
246+
- provider conformance suite.
247+
248+
Exit gate:
249+
250+
- the runtime can evaluate through mock/local providers in CI;
251+
- live providers are optional and configured per operator;
252+
- model failure degrades safely instead of inventing certainty.
253+
254+
### Cycle 21: ZERO Network Ingestion And Anti-Gaming
255+
256+
Target score: 96.
257+
258+
Make public proof a real open product surface:
259+
260+
- signed proof packets;
261+
- local publish queue;
262+
- anti-gaming rules for duplicate handles, replayed packets, fake volume, sybil
263+
profiles, and stale publication;
264+
- public-safe identity and verification badges;
265+
- hosted-compatible ingestion contract.
266+
267+
Exit gate:
268+
269+
- profile and leaderboard data can be accepted, rejected, replayed, and audited
270+
without private runtime data.
271+
272+
### Cycle 22: ZERO Intelligence API
273+
274+
Target score: 97.
275+
276+
Build the commercial data product around verified autonomous behavior:
277+
278+
- hosted API contract for snapshots, cohorts, benchmarks, webhooks, and
279+
exports;
280+
- bearer API keys, scopes, rate-limit headers, and usage events;
281+
- delayed public snapshots remain open;
282+
- realtime/history/scale/webhooks/export rights are commercial;
283+
- billing-ready plan boundaries.
284+
285+
Exit gate:
286+
287+
- public delayed data and commercial realtime data are separate, tested, and
288+
documented;
289+
- no exchange credentials or raw private journals are required.
290+
291+
### Cycle 23: Production Deployment And Remote Operations
292+
293+
Target score: 98.
294+
295+
Make Railway the first-class self-custodial deployment path:
296+
297+
- volume and secret checks;
298+
- remote log/doctor automation;
299+
- health, metrics, and recovery checks;
300+
- deployment smoke runbook;
301+
- rollback and incident drills.
302+
303+
Exit gate:
304+
305+
- a new operator can deploy paper mode to Railway, run live-data paper, inspect
306+
logs, export audit, and recover from restart.
307+
308+
### Cycle 24: Release, Registry, And Supply Chain
309+
310+
Target score: 99.
311+
312+
Finish distribution:
313+
314+
- publish package registry ownership plan;
315+
- Homebrew tap;
316+
- signed artifacts and checksums;
317+
- SBOM/provenance;
318+
- install rollback;
319+
- dependency update and security response policy.
320+
321+
Exit gate:
322+
323+
- release process is reproducible by a maintainer other than the founder.
324+
325+
### Cycle 25: External Review And Real-World Evidence
326+
327+
Target score: 100.
328+
329+
Earn the final points with evidence:
330+
331+
- external security review;
332+
- external operator usability review;
333+
- live exchange chaos rehearsal;
334+
- tiny-capital live canary report;
335+
- public incident-style postmortem template;
336+
- scorecard update with links to evidence artifacts.
337+
338+
Exit gate:
339+
340+
- every 100/100 claim links to tests, docs, CI, release artifacts, drill logs,
341+
or external review notes.
342+
343+
## Work Order
344+
345+
Do cycles 12 through 18 before hosted Network or Intelligence expansion. A
346+
commercial API built before runtime truth would sell a weak dataset. Runtime
347+
truth, reconciliation, and safety evidence create the verified behavior that
348+
ZERO Intelligence monetizes.
349+
350+
Then do cycles 19 through 22 to turn the single runtime into a multi-operator
351+
substrate and commercial data product.
352+
353+
Finish with cycles 23 through 25 to prove deployment, distribution, and
354+
external trust.
355+
356+
## Non-Negotiables
357+
358+
- Paper mode stays deterministic and free.
359+
- Live mode stays self-custodial.
360+
- Risk-reducing commands are always easier than risk-increasing commands.
361+
- Hosted systems never require custody.
362+
- Public surfaces never leak wallets, private keys, exchange order IDs, raw
363+
journals, strategy labels, private notes, or per-trade symbols unless a future
364+
explicit consent contract is designed and reviewed.
365+
- Every live-capable feature needs a refusal path, a test, a runbook entry, and
366+
CLI visibility.

docs/production-readiness.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ This is credible for the public open-source launch repository. It is still not
3232
a hosted custody product, and real capital operation remains self-custodial and
3333
operator-owned.
3434

35+
For the larger target, ZERO is not yet 100/100 as a complete autonomous
36+
operating system. The remaining work is tracked in the
37+
[ZERO Autonomous OS Completion Plan](autonomous-os-plan.md): autonomous runtime
38+
loop, strategy runners, durable runtime bus, Hyperliquid reconciliation, live
39+
execution certification, immune controls, terminal live cockpit,
40+
multi-operator isolation, LLM gateway, hosted Network ingestion, ZERO
41+
Intelligence API, deployment evidence, distribution, and external review.
42+
3543
## CLI Readiness Detail
3644

3745
| Area | Score | Notes |

0 commit comments

Comments
 (0)