Commit graph

229 commits

Author SHA1 Message Date
20809cda1d Start Phase 4 typed daemon client 2026-05-27 03:02:42 +02:00
123kupola
0e35c1bc27 Add daemon-glasspane integration contract (Sam & Hermes)
532-line technical spec covering:
- Socket API wire protocol (7 HerdrCommand variants, JSON dialogs)
- Pane-to-session mapping (4 ID namespaces, creation sequence)
- State flow (daemon lifecycle → 5 AgentState transitions)
- Unified API vocabulary (supervise.*, daemon.*, provider.*)
- clawdie.glasspane.snapshot.v1 contract (producer/consumer)
- Boot sequence (daemon starts first, glasspane embedded)
2026-05-27 02:57:22 +02:00
771cfb65ed Wire daemon spawns into glasspane supervision 2026-05-27 02:41:59 +02:00
123kupola
9f6af19917 Add colibri-daemon: always-on Rust agent runtime scaffold (Sam & Hermes)
Scaffolds the daemon crate that replaces agent-runner.ts,
agent-session.ts, and session-compaction.ts from Clawdie-AI TS.

Crate: crates/colibri-daemon
- src/main.rs — tokio::main with graceful shutdown
- src/config.rs — DaemonConfig from env (DEEPSEEK_API_KEY, etc.)
- src/daemon.rs — main loop: heartbeat, session rotation, memory handoff
- src/session.rs — JSONL session lifecycle (write/read/prune)
- src/spawner.rs — agent subprocess management (pi spawn)
- src/socket.rs — Unix socket API for Herdr glasspane
- 4 tests passing, cargo check green
2026-05-27 02:32:17 +02:00
9ffdde0579 Add glasspane pane reader loop 2026-05-27 02:30:33 +02:00
97439234a6 Start glasspane Phase 3 pane supervision 2026-05-27 02:20:54 +02:00
7ab7b6d343 Sync glasspane Pi events and clippy hygiene 2026-05-27 02:15:09 +02:00
2f282f593d colibri-glasspane Phase 2: ingest real Pi --mode json JSONL (Sam & Claude)
agent_state_from_jsonl / pi_event_type / pane_from_jsonl fold a live Pi --mode json stream through the AgentState machine and capture session id+cwd from the flat header. Lenient: blank/malformed/type-less lines are skipped. 8 tests pass (5 state model + 3 JSONL ingestion, incl. a verbatim pi 0.75.5 session header). Phase 1 unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 02:03:09 +02:00
dbf82c0753 Add colibri-glasspane: design doc + Phase-1 state model scaffold (Sam & Claude)
FreeBSD-native agent supervision reimplementing Herdr's glasspane (sessions/panes/agent-state) behind Colibri's unified API; Herdr stays an optional Linux display client (AGPL + Linux-only). Key bet: agent state is derived deterministically from Pi --mode json events (colibri-pi-events taxonomy), not terminal screen-scraping.

docs/COLIBRI-GLASSPANE-DESIGN.md: capability graph, 5-state model + event→state map, unified API, clawdie.glasspane.snapshot.v1 contract, FreeBSD impl notes, 5 phases. crates/colibri-glasspane: Phase-1 pure state model (AgentState, apply_pi_event/fold_pi_events, Pane, GlasspaneSnapshot) + 5 tests. PTY/socket server + orchestrator are later phases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 01:22:52 +02:00
dc8371e6d5 Add caller inventory + retirement plan (gate #6 prerequisite) (Sam & Claude)
Read-only who-imports-what of the clawdie-ai TS drop candidates. Corrects the earlier drop list: agent-runner.ts (the Pi host runner, 4 callers) and jail-exec-runner.ts (jailPi load-bearing) are KEEP, not drops. Real safe drop set is narrow + contained in controlplane-heartbeat-executor.ts: the non-Pi backend branches (aider/codex, gated behind CONTROLPLANE_RUNNER) + tmux-screenshot-command (→ Herdr). Precondition: production CONTROLPLANE_RUNNER=pi. Plan only — execution is a separate gated PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 18:49:45 +02:00
961f8397f9 Close gate #3: debby inventory parity + golden test (Sam & Claude)
Adds debby's runtime inventory to colibri-contracts golden coverage (12 tests pass) and marks gate #3 done. Three-host parity: osa/domedog/debby all on Node 24; Pi at 0.75.5 on osa+domedog, absent on debby (non-blocking follow-up). All five proof gates (#1-#5) are now green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 18:26:20 +02:00
123kupola
8cd33522c9 Record debby runtime inventory (gate #3 parity) (Sam & Claude)
---
Build: pass | Tests: pass — 16 passed
2026-05-26 18:08:41 +02:00
d830db982e Add Herdr-vs-Colibri capability graph + drop map (Sam & Claude)
Graph-only comparison of Herdr (socket/PTY agent supervision) vs Colibri (DeepSeek-first Rust) vs clawdie-ai TS, across supervision/coordination/execution/provider+cache. Hybrid boundary: Herdr stays an optional Linux client (AGPL + Linux/macOS-only); FreeBSD core is native. Unified function-names committed for the provider+cache layer (proven); other layers proposed/roadmap. Gated drop candidates concentrated in tmux/glass-pane supervision glue, non-Pi runners, and bespoke provider-smoke paths; coordination control-plane kept+extended. Flexibility matrix (agents/surfaces/providers) preserved.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 17:48:50 +02:00
30b87e0d38 Add read-only watchdog host-status reader (Codex)
Implement the Colibri runtime HostStatus reader, add mock and live osa watchdog evidence, and mark gate #5 complete without changing production TypeScript paths.

---

Build: pass

Tests: pass — 11 golden + 5 runtime tests
2026-05-26 16:01:03 +02:00
f197eaddbf Add gate #5 migration graph (watchdog reader) (Sam & Claude)
Graph-only artifact (no code): Mermaid + JSON nodes/edges + gap list + risk list for porting the watchdog host-status reader to Rust. Grounds the port in the real coupling: watchdog.ts owns the socket; doctor.ts + colibri-host-status.ts are the confirmed readers; pi-profile is keep-compatible (not a confirmed direct reader). The Rust reader is additive + read-only (cmd:status only) and replaces a contract, not production logic. Implementation/validation left to operator + Codex.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 15:19:28 +02:00
f216b90842 Close FreeBSD DeepSeek cache gate (Codex)
Record osa FreeBSD build/test and live DeepSeek cache evidence, add the manifests to golden contract coverage, and mark gate #4 complete in the migration inventory.

---

Build: pass

Tests: pass — 8 passed (golden contracts)
2026-05-26 15:09:11 +02:00
0dc3e94209 Mark gate #2 done; hand FreeBSD build to Codex (Sam & Claude)
Gate #1 (contracts golden tests) and #2 (DeepSeek live cache manifest, 3584/3661 hit on domedog) marked done with evidence. Added a FreeBSD build-lane handoff for Codex on osa: cargo build/test --workspace, optional osa live-cache probe → osa cache manifest. Closes the FreeBSD half of gate #4.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 15:01:23 +02:00
aa2b851748 Probe: large stable prefix yields live DeepSeek cache hit (Sam & Claude)
Short prompts don't engage DeepSeek prefix caching. Inflated the immutable prefix past the cacheable threshold (~3.7k tokens, byte-stable, COLIBRI_PROBE_PREFIX_REPEAT) + a 2s commit delay (COLIBRI_PROBE_DELAY_MS). Live run on domedog: second call served 3584/3661 prompt tokens from cache (~98% hit), cache_hit_observed=true, model deepseek-v4-flash.

Records the key-free result as manifests/2026-05-26-domedog-deepseek-cache-result.json (proof gate #2 evidence) and adds it as a colibri-contracts golden test (6 pass). No key in repo; .env stays gitignored.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 14:51:27 +02:00
c14fe3ff79 Auto-load .env for the DeepSeek probe; gitignore .env (Sam & Claude)
colibri-probe now calls dotenvy::dotenv() at startup, so a DEEPSEEK_API_KEY pasted into a local .env is picked up automatically — no manual sourcing. .env is gitignored (a committed/pushed key is permanently compromised); .env.example is the committed template. No key value passes through the repo.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 14:27:41 +02:00
82c2304521 Add colibri-deepseek crate; move probe behind it (Sam & Claude)
First operator-approved slice. crates/colibri-deepseek owns the DeepSeek client + prefix-cache accounting, depends on colibri-contracts, and produces the pipeline: DeepSeek request -> byte-stable prefix -> provider-smoke.result.v1 -> run-manifest.v1 -> local JSONL event log (tmp/, gitignored). The colibri-probe binary is now a thin entrypoint over the crate; reqwest/chrono moved out of the root package.

Validated on Linux: cargo build --workspace --release PASS; colibri-contracts golden tests 5 passed; probe (skipped, no key) emits the smoke result and writes both schema lines to the JSONL log. No TS production paths touched. Live cache values await DEEPSEEK_API_KEY (proof gate #2).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 13:35:39 +02:00
cd21bde024 Record operator approval for DeepSeek slice
Mark the migration inventory as approved for the first colibri-deepseek extraction while keeping TS production service paths gated.

---

Build: not run — documentation-only approval

Tests: not run — documentation-only approval
2026-05-26 13:29:28 +02:00
1fd4ad680b Add migration inventory + colibri-contracts crate (Sam & Claude)
docs/MIGRATION-INVENTORY.md: TS surfaces to keep as contracts, files to retire later (gated), schemas to port, crate build order, and proof gates before replacing the TS service. Extract contracts, not logic.

crates/colibri-contracts: serde structs for clawdie.interagent.run-manifest.v1, clawdie.runtime-version-inventory.v1, clawdie.provider-smoke.result.v1. Root becomes a workspace; existing binaries unchanged. Golden tests round-trip the real committed osa+domedog manifests (5 passed) — a stable shared base before deeper refactor.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 13:23:45 +02:00
4760e6fcad Record domedog Node 24 + Linux lane run manifest (Sam & Claude)
Adds domedog's runtime inventory (node v24.16.0, pi 0.75.5, apt) and a linux-build-smoke run manifest, matching the manifests/ pattern Codex established for osa. Both hosts are now on record at pi 0.75.5 / Node 24 — drift closed. DeepSeek cache probe still pending the key.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:43:34 +02:00
504dadf4ef Record osa Pi 0.75.5 bump
Add the FreeBSD lane run manifest and runtime inventory after updating osa's Pi global install to match domedog.

---

Build: not run — manifest-only update

Tests: not run — manifest-only update
2026-05-26 11:36:33 +02:00
98190703f0 Restore clean runtime_inventory.rs — prior commit merged conflict markers (Sam & Claude)
My 094b98f accidentally committed unresolved conflict markers when a stash pop collided with Codex's 6269030 (which independently fixed Linux Pi detection by canonicalizing the pi bin and walking ancestors for the package.json — covers nvm). Restoring 6269030's clean version; my npm-root-based variant was redundant and is dropped.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:33:17 +02:00
094b98faf4 Fix Linux Pi detection: resolve via npm root -g (Sam & Claude)
pi --version has no stable stdout and the ~/.npm-global path does not match nvm layouts, so Pi went undetected on Linux. Now also resolve the active node's global modules via 'npm root -g' and read pi's package.json. Additive — the FreeBSD/.npm-global paths Codex hardened are unchanged.

Verified on domedog (login shell, node v24.16.0): inventory now reports pi 0.75.5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:32:07 +02:00
6269030424 Detect Pi from PATH inventory candidates
Prefer user and PATH candidates before system defaults, fall back to package.json discovery, and accept version output from stderr for shims.

---

Build: pass — cargo build --release

Tests: pass — cargo test (0 tests)
2026-05-26 11:26:39 +02:00
247ffc76a1 Add FreeBSD runtime inventory manifest
Expose COLIBRI_AGENT for lane attribution and add a runtime inventory binary matching the Clawdie runtime schema.

---

Build: pass — cargo build --release

Tests: pass — cargo test (0 tests)
2026-05-26 10:45:18 +02:00
cf7d25e83a Scaffold Colibri Phase 1: colibri-probe DeepSeek cache smoke (Sam & Claude)
Greenfield cross-platform (FreeBSD/Linux) Rust crate per clawdie-ai doc/COLIBRI-CONTROLPLANE-PLAN.md. colibri-probe sends a byte-stable DeepSeek prefix twice and reports prompt_cache_hit_tokens as a clawdie.provider-smoke.result.v1 manifest; build-only/skipped without DEEPSEEK_API_KEY.

Stack: tokio + reqwest(rustls-tls, no OpenSSL) + serde + chrono. Builds clean on Linux (cargo build --release, 1m16s); rust-toolchain pinned to 1.95.0. FreeBSD (osa) build is the next lane.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 10:08:23 +02:00