Phase 3 agent presence + bridge IP scrub & health-fn fix #204

Merged
clawdie merged 4 commits from fix/phase3-rebase-callers into main 2026-06-26 01:34:26 +02:00
Owner

Phase 3 store work (agent presence) plus the two bridge fixes flagged during the colibri-bridge review.

Commit What
ba5ee66 feat(store): Phase 3 — agent presence (host + last_seen + heartbeat)
017aae3 fix(store): rebase fixups — register_agent host parameter, callers, dead_code allow
c66f6df security(bridge): scrub hardcoded Tailscale IP from colibri_bridge.inTAILSCALE_IP_REQUIRED + prestart guard
29141bf fix(bridge): unscramble the colibri_bridge health/status functions (empty body + typo + braces)

Notes

  • The bridge fixes (c66f6df, 29141bf) close the FreeBSD-side items raised on #203: the real-IP leak is replaced with TAILSCALE_IP_REQUIRED (with a prestart error if unconfigured), and the scrambled health/status shell functions are fixed.
  • Markdown lint: this branch changes no .md files (only .rs/.in/.sh), so any markdown-drift failure is pre-existing on main, not introduced here.

🤖 Generated with Claude Code

Phase 3 store work (agent presence) plus the two bridge fixes flagged during the colibri-bridge review. | Commit | What | |---|---| | `ba5ee66` | feat(store): Phase 3 — agent presence (host + last_seen + heartbeat) | | `017aae3` | fix(store): rebase fixups — `register_agent` host parameter, callers, dead_code allow | | `c66f6df` | security(bridge): scrub hardcoded Tailscale IP from `colibri_bridge.in` → `TAILSCALE_IP_REQUIRED` + prestart guard | | `29141bf` | fix(bridge): unscramble the `colibri_bridge` health/status functions (empty body + typo + braces) | ### Notes - The bridge fixes (`c66f6df`, `29141bf`) close the FreeBSD-side items raised on #203: the real-IP leak is replaced with `TAILSCALE_IP_REQUIRED` (with a prestart error if unconfigured), and the scrambled `health`/`status` shell functions are fixed. - **Markdown lint:** this branch changes **no `.md` files** (only `.rs`/`.in`/`.sh`), so any markdown-drift failure is pre-existing on `main`, not introduced here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
clawdie added 4 commits 2026-06-26 01:30:29 +02:00
Adds host and last_seen columns to the agents table. Idempotent via
MIGRATIONS array in schema.rs — duplicate column errors swallowed on re-open.

- schema.rs: MIGRATIONS constant with ALTER TABLE ADD COLUMN
- lib.rs: Agent struct gains host: Option<String>, last_seen: Option<String>
- lib.rs: register_agent accepts optional host param, sets last_seen
- lib.rs: Store::heartbeat() updates last_seen (with optional host update)
- lib.rs: run_migrations() executes MIGRATIONS after schema SQL
- socket.rs: cmd_register_agent accepts host param (backward-compat via _host)

Phase 3 ready for heartbeat socket command (lib.rs enum already has Heartbeat
variant but dispatch is deferred to a follow-up PR for cleaner diff).
- Update register_agent callers added on main after Phase 3 diverged
  (live_socket_check + claim_task tests), pass None for host
- Prefix unused host param with underscore (WIP — wiring in next slice)
- Allow dead_code on MIGRATIONS constant (schema not yet wired)

Rebase conflict resolution only — no behavioral changes.
Replace the real default 100.72.229.63 with TAILSCALE_IP_REQUIRED.
The operator must now set the listen address explicitly in rc.conf
before the service will start. The prestart guard fails with a clear
error message if the placeholder is still present.

This ensures no real Tailscale IPs leak into the git history or
shipped config files. Per MULTI-AGENT-HOST-PLAN Phase 5 acceptance.
fix(bridge): unscramble colibri_bridge health/status functions
Some checks are pending
CI / rust (pull_request) Waiting to run
CI / markdown (pull_request) Waiting to run
CI / port (pull_request) Waiting to run
CI / agent-jail-pkgs (pull_request) Waiting to run
29141bfbc5
Three bugs in the FreeBSD rc.d script:
- colibri_bridge_health() had an empty body — health check did nothing
- tcolibri_bridge_health — stray 't' prefix, typo
- Stray closing/opening braces scrambled colibri_bridge_status()
  into two detached blocks, breaking the pgrep + nc check

health now delegates to status; status runs the full health check
(pgrep for socat + nc smoke to the socket).
clawdie merged commit 22df778f07 into main 2026-06-26 01:34:26 +02:00
clawdie deleted branch fix/phase3-rebase-callers 2026-06-26 01:34:29 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#204
No description provided.