Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
- Added a SQLite-backed operation event bus with CLI/API timeline readers and
in-process plugin subscriber hooks for extensions.

- Updated the Zeus mutation compatibility target to v0.3.0 with an exact
vendored OpenAPI fixture, while retaining v0.1.4 as a transitional
legacy read-only contract.
- Required mutation targets to declare a supported Zeus `0.3.N`
`expected_version` at planning and execution while leaving legacy read-only
health, inventory, and history available.
- Updated the Zeus mutation compatibility target to exact `0.5.0.dev0` at
upstream contract commit `f4a7af8a0ce802b3f9daeed0ee44958ef92abf1a`,
while retaining v0.3.0 and v0.1.4 as legacy read-only contracts.
- Added authenticated Zeus `/ready` support, fail-closed `not_ready` mutation
preflights, schema-version validation, and an exact `0.5.0.dev0`
`expected_version` gate.
- Added contract coverage for creating `kimi-k3-coding-bot` using only bot and
template metadata. Provider credentials and harness configuration remain in
Zeus; no direct harness integration was added.
- Added exact-approval execution for normal `bot.create`; higher-risk
`bot.replace` and `bot.replace_stop` remain default-denied policy actions.
Durable idempotency evidence prevents automatic repeats after an
Expand Down
44 changes: 29 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ Zeus. Operators run Zeus from the upstream project on each node, keep the Zeus
API loopback-only, and register those nodes in Olymp for inventory, planning,
approved lifecycle execution, audit trails, and evidence export.

The current mutation compatibility target is Zeus v0.3.0, captured exactly
from the upstream tag in `docs/zeus-openapi-v0.3.0.json`. The retained
`docs/zeus-openapi-v0.1.4.json` fixture is transitional and legacy read-only.
The current mutation compatibility target is Zeus `0.5.0.dev0`, captured
exactly from upstream commit `f4a7af8a0ce802b3f9daeed0ee44958ef92abf1a`
in `docs/zeus-openapi-v0.5.0.dev0.json`. The retained v0.3.0 and v0.1.4
fixtures are legacy read-only contracts.

## Goals

- Manage multiple Zeus instances without exposing Zeus directly to the public
internet.
- Discover Zeus nodes, verify their `/health`, `/doctor`, template, bot, status,
log, inspect, and reconcile surfaces, and track compatibility against Zeus'
OpenAPI contract.
- Discover Zeus nodes, verify their `/health`, `/ready`, `/doctor`, template,
bot, status, log, inspect, and reconcile surfaces, and track compatibility
against Zeus' OpenAPI contract.
- Provide a professional CLI and API first, with a dashboard once the backend
contract is stable.
- Coordinate bot lifecycle operations across hosts with explicit approvals,
Expand All @@ -60,16 +61,18 @@ from the upstream tag in `docs/zeus-openapi-v0.3.0.json`. The retained
- Olymp will not store provider credentials by default. Bot/provider secrets
should stay in Zeus/Hermes host-specific configuration or an approved secret
store.
- Olymp will not integrate directly with Hermes or another agent harness in
this compatibility step; Zeus remains the only bot-creation boundary.

## Planned Shape

- Package: `olymp-orchestrator`
- CLI: `olymp`
- Local API: `127.0.0.1:4321` by default
- State: SQLite for the local control plane, with append-only JSONL audit logs
- Integration: typed Zeus client checked against the Zeus v0.3.0 mutation
compatibility fixture in `docs/zeus-openapi-v0.3.0.json`, with v0.1.4 kept
only as a transitional legacy read-only fixture
- Integration: typed Zeus client checked against the Zeus `0.5.0.dev0`
mutation compatibility fixture in `docs/zeus-openapi-v0.5.0.dev0.json`,
with v0.3.0 and v0.1.4 kept as legacy read-only fixtures
- Deployment: systemd service, optional Caddy HTTPS front door for the Olymp
UI/API, Zeus nodes kept loopback-only behind local agents or SSH/mTLS tunnels

Expand All @@ -84,7 +87,7 @@ The repository now includes the first CLI/API foundation:
- SQLite-backed operation event bus with in-process plugin subscribers,
- `olymp doctor`,
- `olymp node add/list/check/remove`,
- `olymp zeus health/doctor/templates/bots/inventory/history`,
- `olymp zeus health/ready/doctor/templates/bots/inventory/history`,
- dry-run plan commands for bot create/lifecycle/reconcile actions,
- approval-backed execution for bot create, lifecycle, and reconcile plans,
- configurable local policy loaded from `$OLYMP_POLICY_FILE` or
Expand Down Expand Up @@ -129,20 +132,22 @@ olymp node add local-zeus \
--name "Local Zeus" \
--base-url http://127.0.0.1:4311 \
--api-key-env ZEUS_API_KEY \
--expected-version 0.3.0
--expected-version 0.5.0.dev0

olymp node check local-zeus
olymp zeus ready local-zeus
olymp zeus inventory local-zeus
olymp zeus history local-zeus coder --limit 50 --before 100
```

Bot history is returned newest first. Pass the previous response's
`next_before` value to `--before` to fetch the next page.

Mutation plans require every target node to declare a supported `0.3.N`
`expected_version`, where `N` is a nonnegative integer. Health, inventory, and
history remain available for versionless or legacy nodes, but execution also
rechecks the current registration before any Zeus request.
Mutation plans require every target node to declare the exact reviewed
`0.5.0.dev0` `expected_version`. Health, inventory, and history remain
available for versionless or legacy nodes, but execution rechecks the current
registration and authenticated Zeus `/ready` response before any mutation.
Zeus `not_ready` responses fail closed without recording a mutation attempt.

Create and exactly approve a normal bot creation plan:

Expand All @@ -156,6 +161,11 @@ olymp plan create-bot local-zeus \
--template-id coding-bot \
--reason "prepare next bot"

olymp plan create-bot local-zeus \
--bot-id kimi-coder \
--template-id kimi-k3-coding-bot \
--reason "prepare Kimi K3 coding bot"

olymp plan execute <plan-id> --approve <plan-id>

olymp plan rollout-lifecycle coder --action restart \
Expand All @@ -165,6 +175,10 @@ olymp plan rollout-lifecycle coder --action restart \
--retry-limit 1
```

Configure `KIMI_API_KEY` and the optional `KIMI_BASE_URL` only on the Zeus
host. Olymp sends the bot ID and `kimi-k3-coding-bot` template ID; it does not
accept, persist, or forward provider credentials or harness configuration.

## Local Policy Defaults

Olymp applies conservative local policy before creating mutation plans:
Expand Down
43 changes: 29 additions & 14 deletions docs/OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ requires the spawned instance's nonce.
Olymp operates registered [brainx/zeus](https://github.com/brainx/zeus)
nodes. Install and run Zeus from that upstream project on each host, keep its
API bound to loopback, then register the local or tunneled endpoint in Olymp.
The current mutation compatibility target is Zeus v0.3.0. Zeus v0.1.4 remains
supported only as a transitional legacy read-only contract.
The current mutation compatibility target is Zeus `0.5.0.dev0` at contract
commit `f4a7af8a0ce802b3f9daeed0ee44958ef92abf1a`. Zeus v0.3.0 and
v0.1.4 remain available only as legacy read-only contracts.

Register a loopback Zeus node:

Expand All @@ -54,13 +55,13 @@ olymp node add local-zeus \
--name "Local Zeus" \
--base-url http://127.0.0.1:4311 \
--api-key-env ZEUS_API_KEY \
--expected-version 0.3.0
--expected-version 0.5.0.dev0
```

Every mutation plan target must declare `expected_version` in the supported
`0.3.N` patch line, with a nonnegative integer `N`. Planning and execution fail
closed for missing, malformed, older, or unreviewed newer versions. Read-only
health, inventory, and history remain available for legacy/versionless nodes.
exact `0.5.0.dev0` contract. Planning and execution fail closed for missing,
malformed, older, or unreviewed newer versions. Read-only health, inventory,
and history remain available for legacy/versionless nodes.

Node IDs must match `^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$`; they cannot contain
colons, slashes, whitespace, or commas because plan targets use
Expand All @@ -77,6 +78,7 @@ Read-only checks:

```bash
olymp node check local-zeus
olymp zeus ready local-zeus
olymp zeus inventory local-zeus
olymp zeus history local-zeus coder --limit 50 --before 100
```
Expand Down Expand Up @@ -174,6 +176,11 @@ olymp plan create-bot local-zeus \
--template-id coding-bot \
--reason "prepare next bot"

olymp plan create-bot local-zeus \
--bot-id kimi-coder \
--template-id kimi-k3-coding-bot \
--reason "prepare Kimi K3 coding bot"

# Higher risk and default-denied; --stop-existing requires --replace.
olymp plan create-bot local-zeus \
--bot-id coder-next \
Expand All @@ -190,6 +197,11 @@ olymp plan rollout-lifecycle coder --action restart \

Every plan command writes a redacted audit event with result `dry_run`.

The Kimi template is rendered and configured by Zeus. Keep `KIMI_API_KEY` and
the optional `KIMI_BASE_URL` in Zeus host configuration; Olymp's plan and
mutation payload contain only bot metadata and never provider credentials,
provider/model selection, or direct harness configuration.

## Approved Plan Execution

Bot creation, lifecycle, and reconcile plans can be executed only with an exact
Expand All @@ -205,10 +217,12 @@ olymp events list --limit 50
olymp events tail --run-id <run-id>
```

Execution preflights Zeus `/health`, executes the exact planned Zeus endpoint,
enforces the expected final state during the postcheck, records a run, and
writes a redacted audit event. If the registered node changes after the plan is
created, execution is rejected before any Zeus request is made.
Execution preflights authenticated Zeus `/ready`, requires the reviewed schema
version, executes the exact planned Zeus endpoint, enforces the expected final
state during the postcheck, records a run, and writes a redacted audit event.
A Zeus `not_ready` response fails closed before a mutation attempt is recorded.
If the registered node changes after the plan is created, execution is rejected
before any Zeus request is made.

Bot creation uses one durable idempotency attempt and one inventory postcheck.
An indeterminate create outcome is preserved with its Zeus request metadata and
Expand Down Expand Up @@ -323,8 +337,9 @@ audit directories, audit files, and audit lock files under the state directory.
## Compatibility

Olymp's mutation compatibility target is
[brainx/zeus](https://github.com/brainx/zeus) v0.3.0, captured as an exact,
immutable upstream copy in `docs/zeus-openapi-v0.3.0.json`. Repository and CI
[brainx/zeus](https://github.com/brainx/zeus) `0.5.0.dev0` at commit
`f4a7af8a0ce802b3f9daeed0ee44958ef92abf1a`, captured as an exact, immutable
upstream copy in `docs/zeus-openapi-v0.5.0.dev0.json`. Repository and CI
contract checks use this vendored fixture and do not require network access.
The retained `docs/zeus-openapi-v0.1.4.json` contract is transitional and
legacy read-only; it is not the mutation compatibility target.
The retained v0.3.0 and v0.1.4 contracts are legacy read-only fixtures; they
are not mutation compatibility targets.
30 changes: 17 additions & 13 deletions docs/PROJECT_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ node connectors rather than asking operators to expose Zeus directly.

Olymp should treat the upstream [brainx/zeus](https://github.com/brainx/zeus)
OpenAPI file as the integration contract and test against it on every release.
Zeus v0.3.0 is the current mutation compatibility target, vendored unchanged
as `docs/zeus-openapi-v0.3.0.json`. The v0.1.4 contract remains available only
as the transitional legacy read-only fixture
`docs/zeus-openapi-v0.1.4.json`.
Mutation planning and execution require each registered target to declare an
`expected_version` in the reviewed `0.3.N` patch line; read-only access remains
available for legacy or versionless nodes.
Zeus `0.5.0.dev0` at commit
`f4a7af8a0ce802b3f9daeed0ee44958ef92abf1a` is the current mutation
compatibility target, vendored unchanged as
`docs/zeus-openapi-v0.5.0.dev0.json`. The v0.3.0 and v0.1.4 contracts remain
available only as legacy read-only fixtures. Mutation planning and execution
require each registered target to declare the exact reviewed `0.5.0.dev0`
`expected_version`; read-only access remains available for legacy or
versionless nodes.

Required Zeus surfaces:

- `GET /health`
- `GET /ready`
- `GET /doctor`
- `GET /templates`
- `GET /bots`
Expand All @@ -46,6 +48,8 @@ Required Zeus security behavior:

- `GET /health` may be unauthenticated.
- All other endpoints must support `x-zeus-api-key`.
- `GET /ready` must report status `ready` at schema version `6`; `not_ready`
must block mutations without creating an attempt.
- Diagnostic logs and inspect endpoints must remain authenticated.
- Responses and logs must be treated as sensitive operational data.
- Zeus mutations must support `Idempotency-Key` and every documented response
Expand Down Expand Up @@ -142,16 +146,16 @@ Status: initial foundation implemented.

### 1. Zeus Client MVP

- Implement a typed client for the Zeus OpenAPI v0.3.0 mutation surface while
retaining v0.1.4 only for transitional legacy read-only compatibility.
- Implement a typed client for the Zeus OpenAPI `0.5.0.dev0` mutation surface
while retaining v0.3.0 and v0.1.4 as legacy read-only compatibility.
- Cover auth success/failure, missing key behavior, timeouts, malformed JSON,
response-size limits, and diagnostic endpoint redaction.
- Add contract tests using a fake Zeus server.

Status: initial client and fake-Zeus tests are implemented. The exact Zeus
v0.3.0 contract is the mutation compatibility target; the v0.1.4 fixture is
retained as transitional legacy read-only coverage. Timeout-specific tests are
implemented.
Status: the client and fake-Zeus tests are implemented. The exact Zeus
`0.5.0.dev0` contract is the mutation compatibility target; the v0.3.0 and
v0.1.4 fixtures are retained as legacy read-only coverage. Timeout-specific
tests are implemented.

### 2. Local CLI and Registry

Expand Down
14 changes: 8 additions & 6 deletions docs/STAGING_RUNBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ API:
ZEUS_API_KEY=change-me OLYMP_API_KEY=change-me sh scripts/verify_real_zeus.sh
```

The verifier is pinned to Zeus v0.3.0, registers the smoke node with
`expected_version` `0.3.0`, checks inventory, creates and executes an approved
lifecycle plan only when a disposable existing bot is explicitly configured,
exports evidence, and removes its temporary state by default.
The verifier is pinned to the Zeus `0.5.0.dev0` contract commit
`f4a7af8a0ce802b3f9daeed0ee44958ef92abf1a`, registers the smoke node with
`expected_version` `0.5.0.dev0`, checks authenticated `/ready` plus inventory,
creates and executes an approved lifecycle plan only when a disposable
existing bot is explicitly configured, exports evidence, and removes its
temporary state by default.
It does not create or replace bots. Set
`OLYMP_REAL_ZEUS_KEEP_STATE=1` to preserve the verifier database, audit log, and
evidence bundle for review.

Checkout-only mode fetches the supported Zeus tag without starting Zeus or
requiring a live Zeus API:
Checkout-only mode fetches the pinned Zeus contract commit without starting
Zeus or requiring a live Zeus API:

```bash
OLYMP_REAL_ZEUS_CHECKOUT=1 sh scripts/verify_real_zeus.sh
Expand Down
6 changes: 4 additions & 2 deletions docs/THREAT_MODEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ That makes Olymp security-sensitive even when the first release is local-only.
checks for Zeus calls.
- Require dry-run output, policy validation, and explicit approval before
mutating fleet actions.
- Require every mutation target to declare the reviewed Zeus `0.3.N`
`expected_version`, then recheck the current registration before Zeus I/O.
- Require every mutation target to declare the exact reviewed Zeus
`0.5.0.dev0` `expected_version`, then recheck the current registration and
authenticated `/ready` response before Zeus mutation I/O. Treat
`not_ready` as a fail-closed preflight result.
- Allow normal `bot.create`, keep `bot.replace` and `bot.replace_stop`
default-denied, and validate the exact stored action/path/body relationship.
- Persist the idempotency attempt before create, never automatically repeat an
Expand Down
Loading
Loading