Commit graph

229 commits

Author SHA1 Message Date
f3a221330b docs: add ISO acceptance tracker and staging helper 2026-05-27 22:52:59 +02:00
123kupola
0b24a7c7d1 feat: richer status + cost thresholds in session rotation (Sam & Hermes)
ISO-ready improvements:
- cmd_status now returns paths, cost mode/thresholds, task counts
  by status, pane count, scheduler interval
- session_rotation reads CostMode thresholds instead of static
  DaemonConfig fields — Fast/Smart/Max affect compaction now
- Debug log includes active cost_mode
2026-05-27 22:48:42 +02:00
2b01d8dad8 docs: add ISO integration plan 2026-05-27 22:43:51 +02:00
2883151b5f fix: keep cost mode changes clippy-clean 2026-05-27 22:31:31 +02:00
123kupola
ffee0c655a docs: note set-cost-mode is runtime-only for T1.4 (Sam & Hermes) 2026-05-27 22:29:09 +02:00
123kupola
c97b44ad3e feat: add cost discipline — Fast/Smart/Max modes + escalation (Sam & Hermes)
Phase 5: cache-first prompt discipline. New cost module with:
- CostMode enum: Fast (500K/5 turns/4KB tool cap), Smart (2M/20/16KB), Max (8M/100/none)
- escalate() — Fast→Smart→Max, each step logged visibly
- compact_tool_result() — truncate oversized tool outputs with byte annotation
- set-cost-mode socket command + COLIBRI_COST_MODE env var
- 9 unit tests (defaults, thresholds, escalation path, parsing, compaction)
2026-05-27 22:27:30 +02:00
4c92a387ba docs: record colibri task CLI smoke 2026-05-27 22:24:41 +02:00
eaa2f27680 feat: add colibri task commands 2026-05-27 22:24:16 +02:00
123kupola
12596d1a71 docs: mark T1.3b FreeBSD smoke done, next: Herdr attach or T1.4 (Sam & Hermes) 2026-05-27 22:20:11 +02:00
8d4bb3a916 refactor: rename colibri-ctl binary to colibri (Sam & Claude)
The operator CLI was already a subcommand dispatcher; drop the -ctl suffix so
it reads `colibri status` / `colibri snapshot` / `colibri spawn-local …` — one
`colibri` entrypoint (same single-binary-with-subcommands shape as just, but a
control plane). Renames the bin + its source file, updates usage strings, and
points the forward-looking docs at `colibri`. Dated session/handoff records
are left as historical. (Task-board subcommands intake/create/list are the
follow-up T1.3c slice.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:50:36 +02:00
d5744e8414 fix: rc.d colibri_daemon runs under daemon(8) (Sam & Claude)
colibri-daemon runs in the foreground and writes no pidfile, so the previous
`command=/usr/local/bin/colibri-daemon` would hang `service start` and leave
status/stop unable to track it. Run it under daemon(8): -P supervisor pidfile,
-r restart on crash, -u colibri privilege drop, -o logfile for the tracing
stdout. start_precmd recreates the colibri-owned /var/run/colibri (tmpfs),
/var/db/colibri, and the log dir each start. Still review-only / not installed;
needs an on-FreeBSD `service` test (osa-smoke rec #4).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:48:47 +02:00
4f81e49983 test: intake-task drains to SQLite via run_loop (Sam & Claude)
Regression guard for the scheduler store deadlock fixed upstream in d760536:
scheduler.tick held a non-reentrant std::sync::Mutex (state.store) across the
match scrutinee, so relocking inside the arm deadlocked the first time any
intake/scheduled task fired.

This test (independently authored on domedog) submits an intake-task over the
real Unix socket, runs run_loop with a fast scheduler tick, and asserts the
task is drained into SQLite. It hangs (>8min) against the pre-fix code and
passes in 0.09s against d760536 — so it cross-validates that fix and guards the
regression. Closes osa-smoke rec #2.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:48:47 +02:00
8199e23890 docs: record OSA intake scheduler re-smoke 2026-05-27 21:09:26 +02:00
d760536fe1 fix: avoid scheduler store deadlock on intake drain 2026-05-27 21:02:01 +02:00
af8c0110d7 fix: improve daemon loop wiring — log scheduler interval, join both tasks
Two improvements to Hermes' run_loop wiring (9717ce7):

1. Add scheduler_secs to the daemon loop startup log — the most
   important interval for the OSA re-smoke was missing from the
   heartbeat/rotation/handoff log line.

2. Replace tokio::select! with tokio::join! in main.rs — select!
   returned when the first task finished, leaving the other dangling.
   join! waits for both the socket server and the daemon loop to
   complete before proceeding to shutdown.

89 tests pass, clippy clean.
2026-05-27 20:21:41 +02:00
123kupola
9717ce70f6 fix: start daemon::run_loop from main.rs (Sam & Hermes)
The scheduler tick was wired into daemon::run_loop but main.rs only
started the socket server, never the background loop. intake-task
commands queued into the scheduler's in-memory queue were never
processed. Fix: spawn daemon::run_loop as a second tokio task
alongside the socket server.
2026-05-27 20:16:02 +02:00
61b008ac6a docs: record OSA FreeBSD daemon smoke finding 2026-05-27 20:13:46 +02:00
123kupola
53028a0022 docs: answer Codex handoff questions — colibri-ctl, scheduler, smoke-agent, WAL (Sam & Hermes) 2026-05-27 20:05:47 +02:00
b898c971f2 docs: handoff — OSA FreeBSD daemon + scheduler validation planning
Add comprehensive handoff entry for Codex (osa/FreeBSD):

Context:
- Commit db5737b landed: scheduler module (506 lines) + rc.d service
- SQLite coordination store (colibri-store crate) added
- FreeBSD test isolation fix documented at a48afa1
- Cutover plan updated with T1.3b next action

Three Validation Options:
1. Comprehensive scheduler + daemon smoke (RECOMMENDED)
2. Incremental validation (core first, then scheduler)
3. Minimal smoke (core only, defer scheduler)

Critical Questions:
1. colibri-ctl binary exists?
2. Scheduler socket commands implemented?
3. Fake agent for spawn exists?
4. SQLite WAL FreeBSD considerations?
5. Baseline confirmation (a48afa1)?

Recommended Path: Option 1 — single smoke validates both core daemon AND scheduler

Smoke Test Scope:
- Part A: Core daemon (socket, status, snapshot, spawn, TUI, cleanup)
- Part B: Scheduler (jobs, schedules, task intake, SQLite store)

Session Report: docs/internal/sessions/2026-05-27-osa-freebsd-daemon-scheduler-smoke.md

Attribution: Claude (domedog/Linux) → Codex (osa/FreeBSD)
2026-05-27 19:36:07 +02:00
123kupola
db5737bcdb feat: add prototype rc.d service + fix plan wording (Sam & Hermes)
packaging/freebsd/colibri_daemon.in: FreeBSD rc.d service file
for review only, not installed. Uses /var/db/colibri,
/var/run/colibri, COLIBRI_DB_PATH. /tmp smoke test comes first.
2026-05-27 19:30:51 +02:00
123kupola
7687976583 docs: simplify T1.3b — prototype smoke test, not cautious deployment (Sam & Hermes) 2026-05-27 19:27:28 +02:00
123kupola
d6a3c81237 docs: next slice — FreeBSD daemon bring-up, defer Herdr attach (Sam & Hermes) 2026-05-27 19:24:14 +02:00
99de050514 docs: record scheduler FreeBSD store isolation finding 2026-05-27 19:15:05 +02:00
a48afa1c0a fix: harden scheduler tests and FreeBSD store isolation 2026-05-27 19:13:20 +02:00
123kupola
ceaeaee658 feat: add scheduler — cron/interval/one-shot execution (Sam & Hermes)
T1.3 Phase 4: execution & scheduling. New scheduler module with:
- Schedule types: Once (ISO timestamp), Interval (every N secs), Cron (5-field)
- 12 scheduler unit tests (cron matching, interval firing, leader/delegate)
- Leader/delegate: capability-match agent selection (pick_agent)
- Intake-task socket command for Telegram/remote task submission
- 4th daemon loop tick (scheduler_tick, every 30s)
- Plan baseline updated: ebc1b99, 72 tests, 8 crates
2026-05-27 19:05:20 +02:00
123kupola
ebc1b99b7e feat: add colibri-store — embedded SQLite coordination database (Sam & Hermes)
Phase 3 coordination core: task board (queued→claimed→started→done/failed),
agent registry, skills catalog. WAL mode, VACUUM INTO backup, JSON export.
DaemonConfig gains db_path; DaemonState gains Mutex<Store>.
9 coordination socket commands: list-tasks, create-task, transition-task,
claim-task, list-agents, register-agent, list-skills, register-skill.
8 crates, 72 tests, clippy-clean. README updated to reflect 8-crate workspace.
2026-05-27 16:40:19 +02:00
743aac19dc docs: storage ownership surface + escalation/failure-mode + Lane 2 non-blocking (Sam & Claude)
Flesh out Decision #1 (SQLite-first) with the operational surface and make
Lane 2 explicitly non-blocking for core correctness:

- Storage surface (proposed defaults): DB file path (FreeBSD /var/db/colibri,
  Linux XDG, COLIBRI_DB_PATH override); WAL + synchronous=NORMAL, local FS only;
  backup via VACUUM INTO + JSON contract export; authoritative (task/agent/
  scheduling) vs mirrored (Pi events, watchdog host-status, inventory).
- Postgres-escalation criterion: one concrete rule — only if Lane 4 dual-run
  parity proves SQLite insufficient for required cross-host shared state.
- Failure mode: DB corrupt/unavailable => fail safe, no takeover; watchdog/hostd
  and local FreeBSD safety stay authoritative.
- Lane 2: gates IMG deployment only, never Colibri core correctness.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 16:19:28 +02:00
0924b76a38 docs: clarify colibri-skills phase zero 2026-05-27 16:17:25 +02:00
4cefb25738 docs: record SQLite-first storage decision + relay to Hermes (Sam & Claude)
- COLIBRI-CUTOVER-PLAN.md: resolve Open Decision #1 — Colibri owns its own
  store, embedded SQLite first, Postgres adapter only if parity/integration
  proves the need (do not default to reusing clawdie-ai system_ops). Reaffirm
  the Herdr boundary. Update Lane 1 T1.2 + Next actions accordingly.
- .agent-handoff.md: relay to Hermes — 0925939 is the shared verified plan,
  the .hermes draft is superseded where it conflicts, storage decided. FYI,
  not a debate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 16:15:01 +02:00
09259394b9 docs: add corrected shared cutover plan (Sam & Claude)
Verified, shared version of the cutover orchestration plan in docs/,
correcting the .hermes/plans draft against the actual repos:

- Kill the fabricated clawdie-ai crates/colibri-daemon (no crates/ dir
  exists there; the real daemon is Unix-socket in the colibri repo, not
  axum/HTTP).
- Fix baseline to 160dd11 (65 tests pass/0 fail, clippy -D warnings clean);
  eb37784 was not clippy-clean.
- Reaffirm the Herdr boundary: Linux/macOS display/remote plane, no Herdr
  on FreeBSD; colibri-glasspane is the native answer (Lane 2 reframed).
- Correct ownership: Claude=domedog=Linux, Codex=osa=FreeBSD, Hermes=debby=Linux.
- Surface the Postgres coupling as an explicit open decision, not a given.
- Downgrade the overclaimed debby<->domedog herdr smoke test to "not yet done."

Leaves the .hermes draft untouched; marked DRAFT/PROPOSED pending ratification.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 16:06:40 +02:00
123kupola
160dd1100e docs: add Colibri cutover orchestration plan (Sam & Hermes)
4-lane plan: Colibri core (Phase 3-6), Herdr compatibility verification,
ISO build chain integration, and gradual Clawdie→Colibri phase-out.
Depends on herdr-clawdie compat manifest before next IMG deployment.
2026-05-27 15:59:13 +02:00
7a2224456c Docs: add Herdr hub runbook (domedog hub → debby → Colibri) (Sam & Claude)
Operator runbook for standing up domedog as the Herdr testing hub, attaching
debby as a remote client over Tailscale SSH, then layering Colibri supervision.
Records verified state: hub running (Herdr 0.6.2), pi integration installed,
debby's key already authorized + ssh config present, remaining gap = herdr
client not yet installed on debby. Includes the key-safety note (public keys
safe; never transit private keys) and the IPv6/Codeberg retry tip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 15:16:53 +02:00
5d45a0f74b Fix clippy collapsible_match in colibri-tui session nav (Sam & Claude)
The Tab / BackTab key arms wrapped their whole body in
`if !app.sessions.is_empty()`. clippy (-D warnings) flagged both as
collapsible_match; lift the guard onto the match arm. Empty `sessions` now
falls through to the catch-all — same no-op as before, behavior unchanged.

Gates on c2655d1 + this: build ok, cargo test --workspace 65 passed/0 failed,
cargo clippy --workspace --all-targets -- -D warnings clean, cargo fmt --check clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 15:15:15 +02:00
c2655d1d41 Document planned colibri-skills split-brain lane (Sam & Codex) 2026-05-27 14:00:44 +02:00
dd55533b5d Fix colibri harness rustfmt drift 2026-05-27 13:56:31 +02:00
Sam & Hermes
eb37784f97 Upgrade colibri-glasspane-tui → colibri-harness (Sam & Hermes)
Herdr-like supervision TUI built on Colibri primitives:

Step 1-2: spawn/kill keybindings + pane detail popup
  - s: spawn agent (local smoke agent)
  - x: kill selected pane
  - Enter: detail popup (pane ID, state, session, CWD, stalled, last event)
  - Esc: close detail / quit

Step 3: Wire colibri-smoke-agent as local provider
  - TUI calls DaemonClient::spawn_agent('local', 'colibri-smoke-agent')
  - Status messages for spawn/kill results

Step 4: Multi-session grouping
  - tab/shift+tab: cycle session filter
  - Header shows active session and count
  - Panes filtered by pi_session_id
  - Rebuild session list on every snapshot refresh

Step 5: Harness double-spawn smoke test
  - Two agents, same session, verify both reach Done
  - Kill one, verify stopped
  - Full lifecycle: spawn→working→blocked→done→kill

65 tests, 0 warnings, 0 clippy errors.
2026-05-27 13:49:24 +02:00
0f27039367 Fix platform matrix rustfmt drift 2026-05-27 13:06:58 +02:00
Sam & Hermes
7264abd9b9 Sync AGENTS.md + handoff with post-Herdr state (Sam & Hermes)
AGENTS.md: 8 crates, 62 tests, multiagent tools, b325c38 baseline.
handoff: Hermes→Claude entry with Herdr remote smoke, TUI, herdr verdict.

Known: proof-gate-tracker gate-5 has JSON-navigation bug
(source field nested under 'status', not at root).
2026-05-27 13:03:59 +02:00
862204c205 Docs: park Herdr-FreeBSD, anchor status to commit (Sam & Claude)
Make the Herdr boundary explicit now that Herdr-Linux-remote and
Colibri-FreeBSD are validated as separate planes:

- Herdr FreeBSD port is parked, not a migration blocker. The exploratory
  FreeBSD build findings are kept for the record but framed as a parked
  experiment, not a pending task.
- Herdr stays a Linux/macOS display/remote plane behind the socket contract;
  colibri-glasspane is the native FreeBSD supervision answer.

Tighten stale status so it stops rotting:

- Replace the fixed "31 passed, 0 failed" count with "all gates green as of
  b325c38" plus the clippy clean note.
- Anchor the top-level status line to commit b325c38.

Doc-only; no code or test changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 12:54:26 +02:00
b325c38f31 Fix platform-matrix watchdog check: exact manifest suffix match (Sam & Claude)
read_manifest used a loose `filename.contains(manifest_type)` substring
match, so for host=osa type=watchdog-host-status it nondeterministically
grabbed either `…watchdog-host-status.json` (correct, has `.status`) or its
sibling `…watchdog-host-status-run-manifest.json` (no `.status`). When the
run-manifest won the read_dir race, source/mode read as "unknown" and the
FreeBSD watchdog-socket-read row failed (11/12).

Match the exact `<host>-<manifest_type>.json` suffix and pick the lexically
greatest (most-recent dated) filename, so selection is deterministic and the
run-manifest sibling is excluded. The underlying watchdog data was always
correct; this was a false failure from loose fixture matching.

cargo test --workspace: all green. cargo clippy --all-targets -D warnings: clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 12:44:52 +02:00
07d04efa8a Add Colibri operator smoke CLI helpers 2026-05-27 12:19:24 +02:00
504608bab1 feat: add multiagent workflow improvements
Add three improvements to streamline multiagent development:

1. Agent Handoff Protocol (.agent-handoff.md)
   - Standardized handoff template and checklist
   - Handoff history with timestamps
   - Proof gate status tracking
   - Platform matrix documentation

2. Proof Gate Tracker (tools/proof-gate-tracker.rs)
   - Automated validation of all 6 proof gates
   - Instant visibility into gate status
   - Exit codes for CI/CD integration
   - Prevents gate regressions

3. Platform Matrix Tests (tests/platform-matrix.rs)
   - Cross-platform smoke test suite
   - Validates FreeBSD and Linux parity
   - Cache economics consistency checks
   - Platform-specific test cases

Documentation: docs/MULTIAGENT-WORKFLOW-IMPROVEMENTS.md
Tools: tools/README.md

These improvements standardize handoffs, automate validation,
and ensure cross-platform consistency for the TypeScript → Rust
migration workflow.
2026-05-27 12:09:40 +02:00
668697e727 Tighten glasspane TUI defaults and tests 2026-05-27 10:09:38 +02:00
Sam & Claude
0bc858b9be Fix four rough corners in colibri-glasspane-tui (Sam & Claude)
1. Terminal cleanup on all exit paths: move disable_raw_mode +
   LeaveAlternateScreen to main() with a restore_terminal() helper,
   install a panic hook so raw mode is never left active on panic or
   io::Error early-return from run().

2. Safe observed_at slice: replace &snap.observed_at[..19] (panics on
   short strings) with .get(..19).unwrap_or(&snap.observed_at).

3. Stalled state unified in icon column: state_color() and state_icon()
   now accept a stalled bool — stalled panes show magenta ⚠ in the icon
   cell instead of a green/yellow primary state icon, so the eye lands on
   a single column. Separate Stalled column kept for redundancy.

4. Footer j/k navigation hint added alongside q and r.

---
Build: pass | Tests: pass — 50 passed
2026-05-27 09:53:49 +02:00
Sam & Hermes
cade45c4f8 Add colibri-glasspane-tui: live pane supervision dashboard (Sam & Hermes)
New crate: colibri-glasspane-tui
- Connects to colibri-daemon Unix socket via colibri-client
- Polls GlasspaneSnapshot every 2s (auto-refresh)
- Color-coded ratatui table: state icons, agent, session, CWD, stalled
- Keyboard: q=quit, r=manual refresh, j/k=navigate
- Zero build warnings, 50/50 workspace tests
2026-05-27 09:46:17 +02:00
047a90427d Record Colibri live daemon client smoke report 2026-05-27 09:14:44 +02:00
fbcb7e6ca4 Add live daemon client smoke with local fake agent 2026-05-27 09:12:02 +02:00
Sam & Claude
de77dbc069 Fix cargo fmt drift in glasspane integration test (Sam & Claude)
Collapse multi-line import and ingest_line_at call to single lines
as rustfmt requires. No logic change.

---
Build: pass | Tests: pass — 31 passed
2026-05-27 08:44:36 +02:00
Sam & Hermes
c109e3bd87 Add daemon-glasspane integration tests (Sam & Hermes)
7 tests proving end-to-end pipeline:
- Pi JSONL → PiJsonlIngestor → fold_pi_events → GlasspaneSnapshot
- lifecycle (idle→working→done), snapshot roundtrip + count,
  serialization for client, unknown event resilience,
  queue_update blocks, default idle
2026-05-27 03:43:37 +02:00
Sam & Hermes
f65fdc7ad1 Update migration inventory to reflect Phase 1-4 complete (Sam & Hermes)
7 crates, daemon scaffolded, Herdr validated (builds, 1450/1453 tests),
TS files retired (budget, aider, codex, tmux-screenshot), gate #6 closed.
2026-05-27 03:41:01 +02:00