Skip to content

Commit f512ac1

Browse files
Zawwarsami16claude
andcommitted
docs: CLAUDE.md updated for phases 0.7 → 1.0b
phase status table reflects current state — 0.2-0.6 retroactively marked done (shipped before this batch), 0.7/0.8/0.9/1.0a/1.0b shipped this batch. file-layout table expanded to cover signing, tunnel, persistence, federation, kotlin tree, new examples, new tests. footer points future sessions at the brainstorming spec + writing-plans plan that drove the autonomous run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dadd7a1 commit f512ac1

1 file changed

Lines changed: 31 additions & 18 deletions

File tree

CLAUDE.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,41 @@ Tests: `pytest -v`. The e2e tests spin up the hub in-process and run the full pu
5959
## 5. Phase status
6060

6161
- **Phase 0** ✅ — `zhub.publish()`, hub server, OpenAI-compat /v1/chat/completions proxy, manifest at /<name>/manifest.json, public /registry.
62-
- **Phase 1** ✅ — `zhub.connect()`, capability registration, bidirectional invoke from publisher to connection through the hub. Connection-event delivery to publisher.
63-
- **Phase 0.2 (next)** — Cloudflare Tunnel auto-config so publish works from a laptop without a public IP.
64-
- **Phase 0.3** — Kotlin client lib for Loki Android. JS client for browser/Node.
65-
- **Phase 0.4** — Streaming chat responses end-to-end (SSE through hub).
66-
- **Phase 0.5** — Persistent registry across hub restarts. Web UI for /registry.
67-
- **Phase 1.0** — Signed manifests, hub federation.
62+
- **Phase 1** ✅ — `zhub.connect()`, capability registration, bidirectional invoke from publisher to connection through the hub.
63+
- **Phase 0.2** ✅ — Cloudflare Tunnel auto-config (`--public-tunnel`). cloudflared install + usage at `docs/CLOUDFLARED.md`. Live-verified end-to-end on 2026-05-09.
64+
- **Phase 0.3** ✅ — Kotlin client lib (`kotlin/`). JVM/Android-compatible. ZhubConnection + connect() + LokiZhubBridge.
65+
- **Phase 0.4** ✅ — Streaming end-to-end. `chat-chunk` envelope. `conn.chat_stream()` async iterator on connect side.
66+
- **Phase 0.5** ✅ — SQLite persistence (`zhub.db`). Re-registration via `publish(api_key=...)`. Web UI at `/`.
67+
- **Phase 0.6** ✅ — `examples/zai_publish.py` proxy for ZAI. `kotlin/.../loki/LokiZhubBridge.kt` drop-in.
68+
- **Phase 0.7** ✅ — Kotlin gradle CI job. Schema-drift regression test.
69+
- **Phase 0.8** ✅ — cloudflared install + live tunnel verification doc.
70+
- **Phase 0.9** ✅ — Multi-AI council pattern test + `examples/council_demo.py`.
71+
- **Phase 1.0a** ✅ — ed25519 signed manifests + key pinning + backwards compat for unsigned.
72+
- **Phase 1.0b** ✅ — Read-only federation. `ZHUB_PEERS` env / `--peers` CLI. `/registry/global` aggregator with origin annotation.
73+
74+
**Phase 1.1+ (not started):** cross-hub call routing (route a chat to peer hub's publisher), signed peer relationships, named tunnels, real ZAI integration via `zai_publish.py` (ZAI gateway needs to be up).
6875

6976
## 6. File layout (what's where)
7077

7178
| Concern | Where |
7279
|---|---|
73-
| Public API surface | `zhub/__init__.py` — re-exports `publish`, `connect`, `Manifest`, `Capability`, errors. |
74-
| Manifest schema + builders | `zhub/manifest.py``Manifest`, `Capability`, `chat_only_manifest()`. |
75-
| Wire protocol envelopes | `zhub/protocol.py``Envelope` + helpers (`register_publisher`, `chat_request`, `invoke_request`, etc.). |
76-
| Hub server (FastAPI + WebSocket) | `zhub/server.py``create_app()`, `Hub` class, HTTP routes + `/ws/publish` + `/ws/connect`. |
77-
| Client library (publish + connect) | `zhub/client.py``publish()`, `connect()`, `ZhubPublication`, `ZhubConnection`. |
78-
| Custom exceptions | `zhub/errors.py``ZhubError`, `AuthError`, `ConnectionError`, `ManifestError`, `CapabilityError`, `HubError`. |
79-
| Examples | `examples/publish_demo.py`, `examples/connect_demo.py`, `examples/orchestrate_demo.py`. |
80-
| Tests | `tests/test_manifest.py`, `tests/test_protocol.py`, `tests/test_e2e.py`. |
81-
| CI | `.github/workflows/ci.yml`. |
82-
| Container | `Dockerfile`. |
83-
| Package config | `pyproject.toml`. |
80+
| Public API surface | `zhub/__init__.py` — re-exports `publish`, `connect`, `Manifest`, `Capability`, errors, signing API (when `[crypto]` installed). |
81+
| Manifest schema + builders | `zhub/manifest.py` |
82+
| Wire protocol envelopes | `zhub/protocol.py``Envelope` + helpers (`register_publisher`, `chat_request`, `chat_chunk`, `invoke_request`, etc.) |
83+
| Hub server (FastAPI + WebSocket) | `zhub/server.py``create_app()`, `Hub`, `/ws/publish`, `/ws/connect`, `/registry`, `/registry/global`, `/`. |
84+
| Client library | `zhub/client.py``publish()`, `connect()`, `chat_stream()`. |
85+
| Cloudflare Tunnel wrapper | `zhub/tunnel.py` |
86+
| SQLite persistence | `zhub/persistence.py` |
87+
| ed25519 signing | `zhub/signing.py` |
88+
| Federation | `zhub/federation.py` |
89+
| Custom exceptions | `zhub/errors.py` |
90+
| Kotlin client (Loki/JVM) | `kotlin/src/main/kotlin/com/zawwar/zhub/{Manifest,Protocol,Connection,loki/LokiZhubBridge}.kt` |
91+
| Examples | `examples/{publish,connect,orchestrate,council}_demo.py`, `examples/zai_publish.py` |
92+
| Tests | `tests/test_{manifest,protocol,e2e,streaming,persistence,invoke_shape,generator_nonstreaming,council,signing,federation}.py` |
93+
| CI | `.github/workflows/ci.yml` — Python matrix + Kotlin job |
94+
| Container | `Dockerfile` |
95+
| Package config | `pyproject.toml` — extras: `[server]`, `[crypto]`, `[dev]` |
96+
| Docs | `README.md`, `docs/CLOUDFLARED.md`, `docs/superpowers/specs/...`, `docs/superpowers/plans/...`, `examples/ZAI_PUBLISH.md`, `kotlin/LOKI_INTEGRATION.md` |
8497

8598
## 7. Architecture in 4 lines
8699

@@ -147,4 +160,4 @@ docker run -p 8080:8080 zhub
147160

148161
---
149162

150-
**Last updated:** 2026-05-08 (Phase 0+1 ship).
163+
**Last updated:** 2026-05-09 (Phases 0.7 → 1.0b shipped autonomously via superpowers brainstorming → writing-plans → TDD execution → verification. 32/32 pytest passing. Spec at `docs/superpowers/specs/2026-05-09-zhub-phase-0.7-to-1.0-design.md`. Plan at `docs/superpowers/plans/2026-05-09-zhub-phase-0.7-to-1.0.md`.)

0 commit comments

Comments
 (0)