Commit graph

90 commits

Author SHA1 Message Date
39db0b661b docs: T1.4 cache-first prompt discipline plan
Inventory of current prompt/cache/session code across Colibri:
- cost.rs: CostMode (fast/smart/max), thresholds, escalation (present)
- session.rs: 3-region prompt assembly, compaction (present)
- colibri-deepseek: STABLE_SYSTEM_PREFIX, cache probe (present)
- config.rs: DaemonConfig with cost fields (present)

Plan adds 6 integration items across 3 PRs:
1. PromptAssembly + CacheMetrics structs
2. Cost-aware trimming + auto-escalation
3. Scheduler injection + cache warming

No changes to parked branches (colibri-skills, zot harness).

Build: N/A (docs-only) | Tests: N/A
2026-05-31 15:30:38 +02:00
99b92caf95 docs: fix stale Codeberg ref in Linux agent constraints (Sam & Hermes) 2026-05-29 11:58:23 +02:00
88e5abee93 docs: switch remote references to Forgejo (Sam & Hermes) 2026-05-29 09:32:45 +02:00
56ffa8e596 docs: cut over Colibri remotes to Forgejo (Sam & Claude)
Validation: docs-only; git diff --check.
2026-05-29 09:03:59 +02:00
123kupola
da31b5c9a0 docs: handoff — Codex to build Colibri release binaries for ISO (Sam & Hermes) 2026-05-27 23:53:47 +02:00
123kupola
e4bd1d92c3 docs: add mandatory post-build cleanup to AGENTS.md (Sam & Hermes)
All agents (Hermes, Claude, Codex) load AGENTS.md. Cleanup rule:
cargo clean + rm /tmp/colibri-* after every session. Platform notes
for FreeBSD tmpfs behavior.
2026-05-27 23:35:18 +02:00
123kupola
6f957d3d72 test: add Slovenian multibyte truncation test (Sam & Hermes)
"Cene že še češnje je" — š/č/ž are 2-byte UTF-8, same family as
German umlauts. Complements the existing CJK+umlaut test. Ensures
compact_tool_result never panics on Slavic diacritics in FreeBSD
locale output, pkg descriptions, and agent logs.
2026-05-27 23:22:10 +02:00
a69d0059b0 docs: consolidate ISO planning docs 2026-05-27 23:17:35 +02:00
4880502d18 docs: tighten Clawdie Studio Zed integration guardrails 2026-05-27 23:13:27 +02:00
aa15654ae2 docs: propose Clawdie Studio — integrated editor + control plane
Proposal for a unified Colibri + Zed experience where the operator
can edit docs/code while simultaneously running and observing agents,
tasks, and scheduler from one visual surface.

Three integration levels:

1. Near-term: Zed as visual shell over colibri-daemon socket
   (sidebar extension, one-app experience, not one binary)

2. Mid-term: colibri-mcp MCP bridge (highest leverage)
   - Zed already supports MCP natively
   - Reuses colibri-client crate directly
   - Editor-agnostic (works with any MCP-capable editor)
   - 7 Phase-1 tools defined (status, snapshot, tasks, intake, etc.)

3. Long-term: true single binary (not recommended now)
   - Colibri must run headless at boot even when editor is closed

Product shape:
  colibri-daemon (service) + colibri-mcp (bridge) + colibri-studio
  (launcher) + Zed extension. Two new thin binaries, no existing
  crates change.

Estimated: ~1 week of focused agent time for MCP Phase 1 + launcher.
2026-05-27 23:11:23 +02:00
0dd7cf70af fix: UTF-8-safe truncation in compact_tool_result
cost.rs:124 sliced at a raw byte boundary which panics on multibyte
UTF-8 characters (ä, ö, ü, CJK, etc). FreeBSD tool output and agent
logs regularly contain non-ASCII.

Fix: use str::floor_char_boundary() to round down to the nearest valid
char boundary before slicing. This never panics and produces valid
UTF-8 output at or below the requested byte limit.

Added test: multibyte truncation with CJK + umlaut input.
2026-05-27 23:09:34 +02:00
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