From b9b7626efebb5138a2e7bb317f0d16d55c694df3 Mon Sep 17 00:00:00 2001 From: Sam & Claude Date: Sat, 27 Jun 2026 21:17:41 +0200 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20polish=20proof=5Ftext=20=E2=80=94?= =?UTF-8?q?=20stale=20comments,=20duplicate=20column,=20schema=20docs,=20f?= =?UTF-8?q?mt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - schema: removed duplicate proof_text column, fixed stale tmux-screenshot comment - mcp-ssh: example now shows real proof_text JSON instead of UUID placeholder - daemon: trimmed stale COLIBRI_TASK_SCREENSHOT_UUID comment - wiki/cost-dashboard: updated architecture diagram + JSON example - fmt: trailing whitespace in colibri-mcp lib.rs --- crates/colibri-daemon/src/daemon.rs | 4 ++-- crates/colibri-mcp/src/lib.rs | 2 +- docs/wiki/cost-dashboard.md | 5 ++--- packaging/mother/colibri-mcp-ssh | 4 ++++ packaging/mother/mother_schema.sql | 4 ++++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/crates/colibri-daemon/src/daemon.rs b/crates/colibri-daemon/src/daemon.rs index 8b1de88..6688526 100644 --- a/crates/colibri-daemon/src/daemon.rs +++ b/crates/colibri-daemon/src/daemon.rs @@ -266,7 +266,8 @@ pub async fn heartbeat(state: &SharedState, _stall_timeout: Duration) { "tokens_out": p.accumulated_usage().output_tokens, "cache_read": p.accumulated_usage().cache_read_tokens, "cost_usd": p.accumulated_usage().cost(), - }).to_string() + }) + .to_string() }); (u, proof) }; @@ -348,7 +349,6 @@ fn push_cost_to_mother(task_id: &str, tc: &colibri_store::TaskCost, proof_text: let cost = tc.cost; let success = tc.success; // Text proof from glasspane at task exit — agent, state, tokens, cost. - // Replaces the old COLIBRI_TASK_SCREENSHOT_UUID env-var approach. let proof = proof_text.map(|s| s.to_string()); // Run SSH in a blocking thread — heartbeat is async, SSH is fast (<1s). diff --git a/crates/colibri-mcp/src/lib.rs b/crates/colibri-mcp/src/lib.rs index 9f0d638..2a3fbf3 100644 --- a/crates/colibri-mcp/src/lib.rs +++ b/crates/colibri-mcp/src/lib.rs @@ -211,7 +211,7 @@ pub fn tool_list() -> Vec { json_tool( "colibrie_deploy_run", "Run a shell command on the host or in a Bastille jail. Use deploy_targets to list available targets.", - Some(serde_json::json!({ + Some(serde_json::json!({ "type": "object", "properties": { "target": { "type": "string", "description": "Target: host or jail name from deploy_targets" }, diff --git a/docs/wiki/cost-dashboard.md b/docs/wiki/cost-dashboard.md index edb3fba..18c58ae 100644 --- a/docs/wiki/cost-dashboard.md +++ b/docs/wiki/cost-dashboard.md @@ -59,8 +59,7 @@ daemon heartbeat │ └─ INSERT INTO task_costs │ (node_hostname → node_id lookup) │ - └─ (optional) tmux-screenshot.py → ../screenshots/{uuid}.png - on COLIBRI_SCREENSHOT_ON_COMPLETION=1 + └─ proof_text (inline) → glasspane state snapshot (agent, state, tokens, cost JSON) cron (every 60s) └─ export-costs.sh @@ -109,7 +108,7 @@ MCP tool, but with screenshot UUIDs and node groupings: "provider": "deepseek", "cost": 0.0042, "success": true, - "screenshot_uuid": "a1b2c3d4e5f6", + "proof_text": "{\"agent\":\"zot\",\"state\":\"Done\",\"tokens_in\":150}", "tokens": {"in": 45000, "out": 2800, "cache_read": 12000} } ] diff --git a/packaging/mother/colibri-mcp-ssh b/packaging/mother/colibri-mcp-ssh index 754a130..a7f0c89 100755 --- a/packaging/mother/colibri-mcp-ssh +++ b/packaging/mother/colibri-mcp-ssh @@ -31,8 +31,12 @@ case "${SSH_ORIGINAL_COMMAND:-}" in # "model":"deepseek-chat","input_tokens":150,"output_tokens":80, # "cache_read_tokens":200,"cache_write_tokens":50, # "cost_usd":0.0042,"success":true, +<<<<<<< HEAD # "proof_text":"agent:hermes|cost:0.0042|tokens:150/80", # "screenshot_uuid":"a1b2c3d4e5f6", +======= + # "proof_text":"{\"agent\":\"zot\",\"state\":\"Done\",\"tokens_in\":150}", +>>>>>>> f46f3d2 (chore: polish proof_text — stale comments, duplicate column, schema docs, fmt) # "finished_at":"2026-06-27T12:00:00Z"} psql -d mother_hive -tA -v ON_ERROR_STOP=1 <<'PSQL' INSERT INTO task_costs (node_id, task_id, provider, model, diff --git a/packaging/mother/mother_schema.sql b/packaging/mother/mother_schema.sql index a4ec06d..1bffb3c 100644 --- a/packaging/mother/mother_schema.sql +++ b/packaging/mother/mother_schema.sql @@ -65,8 +65,12 @@ CREATE TABLE IF NOT EXISTS task_costs ( cache_write_tokens BIGINT NOT NULL DEFAULT 0, cost_usd DOUBLE PRECISION NOT NULL DEFAULT 0.0, success BOOLEAN NOT NULL DEFAULT false, +<<<<<<< HEAD proof_text TEXT, -- glasspane evidence at task exit (agent, state, tokens) screenshot_uuid TEXT, -- visual terminal proof (PNG capture UUID) +======= + proof_text TEXT, -- glasspane state snapshot (agent, state, tokens, cost as JSON) +>>>>>>> f46f3d2 (chore: polish proof_text — stale comments, duplicate column, schema docs, fmt) finished_at TIMESTAMPTZ NOT NULL DEFAULT now(), reported_at TIMESTAMPTZ NOT NULL DEFAULT now() ); -- 2.45.3 From d36407766e2a4c87ed81114be85f15a02b51070f Mon Sep 17 00:00:00 2001 From: 123kupola Date: Sat, 27 Jun 2026 21:22:47 +0200 Subject: [PATCH 2/2] docs: replace stale tmux-screenshot refs in cost-dashboard.md --- docs/wiki/cost-dashboard.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/wiki/cost-dashboard.md b/docs/wiki/cost-dashboard.md index 18c58ae..a84f20c 100644 --- a/docs/wiki/cost-dashboard.md +++ b/docs/wiki/cost-dashboard.md @@ -35,7 +35,7 @@ rendering — static HTML with a JSON data file refreshed every 60s by cron. Each cost card shows: - **Cache-hit bar:** green (cache) vs grey (fresh) — visual cache efficiency - **Provider:** deepseek / claude / gemini / ollama / local -- **Cost:** with `▸ proof` badge if a tmux-screenshot exists for this task +- **Cost:** with `▸ screenshot` badge if visual proof exists, `▸ text` for glasspane evidence - **Success:** ✓ (green) or ✗ (red) Click a card with `▸` → lightbox opens the terminal screenshot at task completion time. @@ -47,7 +47,7 @@ Click a card with `▸` → lightbox opens the terminal screenshot at task compl | `task_costs` (PostgreSQL) | Per-task cost rows pushed by daemon heartbeat | Real-time (SSH push on completion) | | `hive_nodes` (PostgreSQL) | Node metadata, capabilities, LLM tier | Node heartbeat | | `task_costs JSON file` | Denormalized JSON for the dashboard page | Every 60s (cron) | -| `../screenshots/{uuid}.png` (static) | tmux-screenshot captures linked from cost rows | On task completion (daemon) | +| `proof_text` (inline JSON) | glasspane state snapshot | On task completion (daemon heartbeat) | ## Architecture @@ -121,7 +121,7 @@ cache-hit on DeepSeek — route non-urgent tasks there." ## Screenshot proof -The `▸ proof` badge on cost cards links to tmux-screenshot captures. The +The `▸ screenshot` badge on cost cards opens a lightbox with the terminal PNG. The `▸ text` badge shows the glasspane state snapshot inline. screenshot UUID is stored alongside the cost row. Clicking opens the lightbox with: - The full terminal PNG at task completion time @@ -137,4 +137,4 @@ behind it. - [task-board](./task-board.md) — local task board (data source for cost capture) - [hive-pane](./hive-pane.md) — hive board (companion surface, node status) - [hive-routing](./hive-routing.md) — cost-aware routing engine (consumes this data) -- [tmux-screenshot skill](../../.agent/skills/tmux-screenshot/SKILL.md) — screenshot capture +- [screenshot module](../../crates/colibri-daemon/src/screenshot.rs) — auto-capture on task completion -- 2.45.3