Commit graph

371 commits

Author SHA1 Message Date
aff8c89fba feat: run clawdie-hw-probe on agent autospawn
Before spawning an agent (pi/zot), colibri-daemon now runs
/usr/local/bin/clawdie-hw-probe (if present) and passes the
JSON output as CLAWDIE_HW_PROFILE env var. Non-blocking:
probe failure or missing binary logs a warning and the agent
spawns normally without hw profile.

This gives agents immediate host awareness — USB names, GPU
capabilities, RAM, CPU, disks, ZFS pools — without running
probes themselves.
2026-06-23 08:49:26 +02:00
1a49485dbd Merge pull request 'fix(bootstrap): chown jail /home/clawdie so daemon can write staging files' (#150) from fix/jail-home-chown into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #150
2026-06-23 08:13:28 +02:00
60fc877545 Merge pull request 'chore: update Cargo.lock for the 0.11.0 version unification' (#149) from chore/cargo-lock-0.11.0 into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-22 08:12:46 +02:00
321cb4a9ff chore: update Cargo.lock for workspace 0.11.0 version unification (PR #148)
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
2026-06-22 07:35:01 +02:00
e89f9dbadd Merge pull request 'build: unify all crate versions at 0.11.0 (workspace inheritance)' (#148) from unify-crate-versions-0.11.0 into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #148
2026-06-22 06:39:56 +02:00
c54c15f3b1 build: unify all crate versions at 0.11.0 via workspace inheritance
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Every crate hardcoded version = "0.0.1" while the root colibri package was
already 0.11.0. Add a [workspace.package] version = "0.11.0" and switch all
crates (and the root package) to version.workspace = true, so the whole
workspace is 0.11.0 and the next bump is one line.

Internal deps are path-only (no version constraints), so nothing else changes.
Verified: cargo metadata resolves; all 13 packages report 0.11.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 06:39:01 +02:00
7042ebfe13 Merge pull request 'fix(glasspane): skip duplicate zot tool_call events (Sam & Pi)' (#147) from fix/zot-tool-call-double-fire into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #147
2026-06-22 06:03:28 +02:00
a2f6599335 fix(glasspane): skip duplicate zot tool_call events (Sam & Pi)
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Treat zot tool_use_start as the canonical tool_execution_start event and skip the later standalone tool_call so Glasspane does not double-fire tool starts. Update the real-key transcript notes to mark the double-fire issue resolved.\n\nValidation: ./scripts/check-format.sh; cargo fmt --check; cargo test -p colibri-glasspane; cargo test -p colibri-daemon glasspane -- --nocapture; cargo test -p colibri-daemon pi_spawn_path_produces_correct_glasspane_state -- --nocapture; cargo clippy -p colibri-glasspane -p colibri-daemon --all-targets -- -D warnings.
2026-06-22 06:01:48 +02:00
ab07ef980e Merge pull request 'docs: real-key zot rpc transcript — 14/15 event types validated' (#146) from docs/zot-rpc-transcript-real-key into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-21 23:07:10 +02:00
a778145925 docs(zot-rpc): prettier table realignment
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 23:06:27 +02:00
289a203016 docs(zot-rpc): correct the tool_call double-fire claim to match the transcript
The raw stdout shows only tool_use_* + tool_progress + tool_result for the tool
cycle — no standalone {"type":"tool_call"} line. Downgrade the double-fire
note from a 'verified fact' to an open question, and mark the tool_call table
row as mapped-but-not-observed. Keeps the doc's 'observed, not inferred'
section honest. 14/15 types remain validated against real output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 23:06:11 +02:00
07ff4d3b1f docs: real-key zot rpc transcript — all 15 event types confirmed
Step 1 of colibri#143 complete. Complete tool call cycle captured
with valid DEEPSEEK_API_KEY: 61 lines, 2 turns, 1 bash tool call.

All 15 event types observed and mapped — no glasspane gaps.
Notable: tool_call and tool_use_start both map to tool_execution_start
(double-fire on real runs). Verified facts replace 'name matches source.'

Full raw transcript at /tmp/zot_transcript_full.txt (OSA).
2026-06-21 23:00:51 +02:00
b338fb14dc Merge pull request 'docs: restore green format gate — prettier PLAN-MOTHER-MCP-VAULT-KEYS' (#145) from fix-plan-mother-doc-format into main
Some checks are pending
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
2026-06-21 22:47:54 +02:00
6b71025772 docs: prettier-format PLAN-MOTHER-MCP-VAULT-KEYS table alignment
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Pre-existing gate offender (PR #141 slipped check-format.sh). Table-alignment
whitespace only, no content change. Restores a green ./scripts/check-format.sh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:47:45 +02:00
99c8e33a44 Merge pull request 'docs: zot rpc transcript — wire format confirmed for glasspane' (#144) from docs/zot-rpc-transcript into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-21 22:46:37 +02:00
1242c52360 docs(zot-rpc): backtick event identifiers in the verdict
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
The bare underscored names (tool_call, tool_use_*, text_delta, assistant_*)
were read as markdown emphasis and mangled by prettier; wrap them in code
spans so they render literally and stay prettier-immune.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 22:46:07 +02:00
6b9222c746 docs: zot rpc transcript — wire format confirmed for glasspane
Step 1 of colibri#143. Captured with zot rpc --provider deepseek.
Wire format: bare event objects (no JSON-RPC envelope), matches
glasspane's zot_event_type parser. All 6 observed types mapped.
Remaining types (tool_call, text_delta, etc.) need a live API key
but type names match zot source.

Verdict: glasspane parser is correct. Steps 2-3 unblocked.
2026-06-21 22:41:34 +02:00
c15edcade4 Merge pull request 'fix(packaging): make agent-jail pkg drift check local-friendly (Sam & Pi)' (#142) from fix/post-pull-format-and-mother-sync-review into main
Some checks are pending
CI / agent-jail-pkgs (push) Waiting to run
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
Reviewed-on: #142
2026-06-21 20:41:00 +02:00
a125959991 fix(packaging): make agent-jail pkg drift check local-friendly (Sam & Pi)
Some checks failed
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
Honor an optional pkg-list-jails path/URL argument, allow comments inside the agent-jail section, and apply Prettier to docs/README.md. This preserves the cross-repo gate for the jq addition.\n\nValidation: ./scripts/check-format.sh; cargo fmt --check; ./packaging/freebsd/port/check-cargo-crates.sh; ./packaging/freebsd/check-agent-jail-pkgs.sh /home/clawdie/ai/clawdie-iso/packages/pkg-list-jails.txt; sh -n packaging/freebsd/agent-jail-bootstrap.sh packaging/freebsd/mother-sync-hive-keys.sh; cargo check -p colibri-daemon -p colibri-client -p colibri-mcp.
2026-06-21 20:38:39 +02:00
eec2a703cb Merge pull request 'docs: plan mother MCP link — Vaultwarden pubkey exchange' (#141) from docs/mother-mcp-vault-keys-plan into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #141
2026-06-21 20:36:17 +02:00
3c5040dbeb Merge pull request 'feat(mother): add mother-sync-hive-keys — rebuild authorized_keys from vault' (#140) from mother-sync-hive-keys into main
Some checks are pending
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
2026-06-21 20:31:11 +02:00
7f0782635d feat(mother): add mother-sync-hive-keys — rebuild authorized_keys from vault
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Mother side of the vault-mediated hive key exchange (direction B — agents call
mother). Pulls the hive-pubkey-* items agents publish to Vaultwarden and rebuilds
the colibri user's authorized_keys, each entry restricted to the MCP command
(command="colibri-mcp",restrict,no-pty,no-*-forwarding).

- Rebuild, not append: deleting an agent's vault item revokes it next run.
- Fail-safe: a vault/login failure leaves authorized_keys untouched.
- Atomic write (mktemp + mv); colibri-owned 0600.
- Tunable via PROVIDER_ENV / COLIBRI_HOME / COLIBRI_USER / MCP_COMMAND
  (mother = osa for now; a dedicated host is a config change).
- Cron-driven (sample line in the header). Uses the bitwarden-cli-vault skill's
  session + authorized_keys-rebuild patterns.

sh -n clean; parse/rebuild core tested (filters non-key items, strips key
comments, applies the restriction wrapper).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:19:25 +02:00
1d0ac22443 docs: plan mother MCP link — Vaultwarden pubkey exchange
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Direction B: agent calls mother via SSH, pubkeys exchanged through
Vaultwarden. Three components:
- clawdie-enable-mother.sh: keygen + vault publish + external-mcp.json
- clawdie-vault-fetch: new --publish-pubkey mode
- mother-sync-hive-keys.sh: cron-driven rebuild of authorized_keys.hive

Security: rebuild-not-append, restriction applied by mother,
dedicated key file, atomic write.
2026-06-21 19:52:19 +02:00
f232bbeb69 Merge pull request 'feat(bootstrap): install jq in agent jails for the MCP tool path' (#139) from jail-bootstrap-jq into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-21 19:26:33 +02:00
bfe27266e7 feat(bootstrap): install jq in agent jails for the MCP tool path
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
The MCP tooling parses colibri-mcp / external MCP JSON-RPC output with jq, so
agent jails need it on PATH. Add jq to the pinned PKGS list (host must have it
in the pkg cache, like the other pinned packages). Mirrors the matching entry
in clawdie-iso pkg-list-jails.txt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 19:25:37 +02:00
5a4a782f3b Merge pull request 'feat: rework multi-agent plan + complete CLI surface (19/19 commands)' (#138) from feat/multi-agent-plan-rework-cli-surface into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-21 18:46:59 +02:00
2ea97b3186 docs: prettier-format MULTI-AGENT-HOST-PLAN table padding
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Run the mandatory markdown format gate (check-format.sh / prettier@3) on the
doc — table column padding only, no content change. Makes the PR pass the gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 18:46:55 +02:00
Sam & Claude
79637bab81 feat(client): expose claim-task/transition-task/set-cost-mode in CLI
Some checks failed
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
Completes the CLI surface: all 19 socket commands now have CLI wrappers.
Remote agents can work entirely through the colibri binary instead of raw
Python socket calls.

CLI additions:
- claim-task --task-id UUID --agent-id UUID
- transition-task --task-id UUID --status STATUS
- set-cost-mode MODE

DaemonClient gains claim_task(), transition_task(), set_cost_mode().

Also adds 3 pick_agent unit tests (Phase 1a):
- tie-breaking: equal score → later-in-slice wins (deterministic)
- multi-required-capabilities: agent with both caps beats one
- active-status-eligible: 'active' status eligible same as 'idle'

Plus 6 CLI parse tests (positive + negative) for the new commands.

Gate: fmt clean, clippy clean, 245 tests pass (Sam & Claude)
2026-06-21 18:39:10 +02:00
Sam & Claude
4792ca84e4 docs: rework MULTI-AGENT-HOST-PLAN for 0.11.0 — narrowed gaps, Phase 2a done
Update context to released 0.11.0 (was 0.10.0 staged). Command inventory
now 19 (was 17), CLI surface 19/19 (was 10/17). Mark Phase 2a COMPLETE
(register-agent/list-agents merged). Add Closed-gaps section documenting
tenant/vault chain, issues #88/#91/#92. Apply positive language convention.
Narrow gap analysis to remaining open items.

(Sam & Claude)
2026-06-21 18:39:02 +02:00
2cc613ea70 Merge pull request 'feat(daemon): auto-spawn a Pi agent on startup (Operator Image OOTB)' (#137) from autospawn-pi-on-boot into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #137
2026-06-21 18:12:50 +02:00
76628eb847 feat(daemon): auto-spawn a Pi agent on startup (Operator Image OOTB)
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Workstream B of the next ISO rebuild: the live image should boot with at
least one Pi instance live on the Colibri board without operator action.

On startup, after the control-plane socket is up, the daemon spawns one
DeepSeek-backed Pi when configured. Host-spawn (no jail) — the live image is
single-agent; jails remain for deployed multi-tenant hosts. The Pi inherits
DEEPSEEK_API_KEY from the daemon environment (sourced from provider.env by
the rc.d service).

- Gated by COLIBRI_AUTOSPAWN_PI (YES/1/true/on); no-op otherwise.
- Requires a DEEPSEEK_API_KEY; logs and skips if absent (operator adds it via
  Join Hive, then the daemon restart spawns it).
- Idempotent: skips if a Pi subprocess is already running, so the post-creds
  restart does not stack duplicates.
- Pi binary and argv are env-tunable (COLIBRI_PI_BINARY default `pi`,
  COLIBRI_AUTOSPAWN_PI_ARGS default `--mode json`) so the exact invocation can
  be finalized on the FreeBSD image without a rebuild.

Reuses cmd_spawn_agent so glasspane attach, stdout streaming, and board
registration are identical to an operator-issued spawn. Tests for the pure
helpers (basename, env_truthy); full daemon suite green; clippy clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 18:12:04 +02:00
aa754ce11f fix(bootstrap): chown jail /home/clawdie so daemon can write staging files
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
#136 moved staging from /var/run/colibri-stage to
/home/clawdie/.cache/colibri/stage. Bastille creates the jail's
/home/clawdie as root:wheel, so the daemon (running as clawdie)
couldn't create staging directories there. chown after binary
copy ensures the daemon owns its home directory inside the jail.
2026-06-21 17:43:33 +02:00
3ba60b11dd Merge pull request 'fix(spawner): stage jail spawn files under daemon-owned home, not /var/run' (#136) from stage-under-daemon-home into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-21 17:38:02 +02:00
a7565c49ad fix(spawner): stage jail spawn files under daemon-owned home, not /var/run
Some checks failed
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
Closes #135. The daemon stages per-spawn launch.sh/env.sh under the jail root;
the previous location /var/run/colibri-stage is root-owned, so the daemon
(running as clawdie) could not create per-spawn subdirs there — the second
jail-spawn EACCES, worked around in #134 by pre-creating the dir in
agent-jail-bootstrap.sh.

Move the default staging root to the daemon user's home,
/home/clawdie/.cache/colibri/stage, which clawdie owns by construction of the
jail account. create_dir_all now succeeds with no privileged pre-creation step,
and /home is persistent (unlike a tmpfs /var/run). The path is overridable via
COLIBRI_JAIL_STAGE_DIR, matching the daemon's other env-configurable paths.

- spawner.rs: const → staged_jail_run_dir() resolver; updated unit test.
- agent-jail-bootstrap.sh: drop the now-unnecessary install -d staging block
  and DAEMON_USER var (the #134 workaround).
- docs: update jailed-spawn design + truss analysis to the new location.

clippy clean; spawner suite green (21 tests); sh -n clean; touched docs pass
the markdown gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 17:37:32 +02:00
35f1f3f7b0 Merge pull request 'fix(bootstrap): pre-create daemon staging dir in agent jails' (#133) from absolute-spawn-wrappers into main
Some checks are pending
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
Reviewed-on: #133
2026-06-21 17:30:44 +02:00
64c1198f4b Merge pull request 'fix(bootstrap): pre-create daemon staging dir in agent jails' (#134) from jail-staging-dir into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
2026-06-21 17:28:48 +02:00
4623f8c209 fix(bootstrap): pre-create daemon staging dir in agent jails
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Second root cause of the jail-spawn EACCES (found via truss, docs PR #132):
for staged spawns the daemon writes launch.sh/env.sh under
<jail_root>/var/run/colibri-stage/<stage_id>/, but nothing created
/var/run/colibri-stage. The daemon runs as clawdie and cannot mkdir under
root-owned /var/run, so staging failed with Permission denied.

agent-jail-bootstrap.sh now pre-creates the dir owned by the daemon user
(0700), replacing the runtime `chmod 777` workaround — durable across jail
rebuilds and not world-writable (staged files are sourced as shell, so a
world-writable staging dir would be a privilege footgun). DAEMON_USER is
overridable, defaulting to clawdie.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 17:28:20 +02:00
1233b8fbcd fix(bootstrap): pre-create daemon staging dir in agent jails
Some checks failed
CI / agent-jail-pkgs (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
Second root cause of the jail-spawn EACCES (found via truss, docs PR #132):
for staged spawns the daemon writes launch.sh/env.sh under
<jail_root>/var/run/colibri-stage/<stage_id>/, but nothing created
/var/run/colibri-stage. The daemon runs as clawdie and cannot mkdir under
root-owned /var/run, so staging failed with Permission denied.

agent-jail-bootstrap.sh now pre-creates the dir owned by the daemon user
(0700), replacing the runtime `chmod 777` workaround — durable across jail
rebuilds and not world-writable (staged files are sourced as shell, so a
world-writable staging dir would be a privilege footgun). DAEMON_USER is
overridable, defaulting to clawdie.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 17:27:31 +02:00
36718c151a Merge pull request 'docs: truss analysis of jail-spawn Permission Denied + debugging reference' (#132) from docs/truss-spawn-analysis into main
Some checks are pending
CI / markdown (push) Waiting to run
CI / rust (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #132
2026-06-21 17:23:43 +02:00
9814ce8afb docs: truss analysis of jail-spawn Permission Denied + debugging reference
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Two root causes found via truss:
1. Bare command names (sudo, jexec) unresolved under daemon(8) PATH
   → fixed by resolve_program() in PR #131
2. Jail staging directory owned by root, unwritable by clawdie
   → fixed by chmod 777 <jail_root>/var/run/colibri-stage

Trace saved at /tmp/daemon.truss (1964 lines, successful spawn).
2026-06-21 17:22:30 +02:00
a1e6d64a27 Merge pull request 'fix(spawner): resolve privileged wrappers to absolute paths + log spawn context' (#131) from absolute-spawn-wrappers into main
Some checks are pending
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
CI / rust (push) Waiting to run
Reviewed-on: #131
2026-06-21 17:12:01 +02:00
78be056b62 fix(spawner): resolve privileged wrappers to absolute paths + log spawn context
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
The jail spawn path launches its wrapper by bare name (sudo / jexec / mdo)
and relies on execvp + the daemon's inherited PATH. Under daemon(8)/rc the
PATH is often empty or reordered, so execvp either misses the binary (ENOENT)
or hits a non-executable same-named entry first and returns EACCES — the spawn
"Permission denied" seen on FreeBSD even though the identical command runs from
a shell.

- resolve_program() absolutizes a bare program name against a fixed search
  list (first regular executable wins), leaving slash-bearing paths untouched
  and falling back to the bare name so the OS still reports a real error.
- spawn_prepared_child now logs the resolved program, requested name, full
  argv, and PATH before spawning. The previous "attempting spawn" log carried
  no spawn-context detail, which is why the failure was opaque.

This removes the PATH-search EACCES as a variable so a truss/ktrace run can
attribute any remaining denial to an actual kernel/MAC policy instead.

Tests: resolve_program pass-through, absolutization, and missing-name fallback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 17:10:47 +02:00
e8b0d40461 Merge pull request 'fix(bootstrap): unify npm-global PATH snippet into one shared file' (#130) from fix/unify-npm-profile-snippet into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #130
2026-06-21 16:22:36 +02:00
1081016991 fix(bootstrap): unify npm-global PATH snippet into one shared file
Some checks failed
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
Closes #122. Creates packaging/freebsd/clawdie-npm-profile.sh as
the single source for npm PATH + npm config. The agent-jail
bootstrap installs it with NPM_PREFIX baked in, replacing the
inline heredoc. The clawdie-iso build.sh installs the same file.

Before: two divergent heredocs, different filenames, different
prefixes. Now: one file, both environments, parameterized prefix.
2026-06-21 16:21:08 +02:00
16c3b3db1b Merge pull request 'feat/sudo-priv-mode' (#129) from feat/sudo-priv-mode into main
Some checks are pending
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
Reviewed-on: #129
2026-06-21 16:06:50 +02:00
13f4ff7cc2 fix(spawner): avoid async closure in retry path (Sam & Pi)
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Move the backoff spawn operation into a named async helper so older tooling does not trip over || async syntax, and add a jail sudo wrapping unit test. Document sudo as an interim validated-host privilege mode.\n\nValidation: ./scripts/check-format.sh; cargo fmt --check; cargo check -p colibri-daemon; cargo test -p colibri-daemon jail_tests -- --nocapture.
2026-06-21 16:00:11 +02:00
e268767f79 feat(spawner): add PrivMode::Sudo for hosts with sudo configured
Uses 'sudo -n' to wrap jail commands. Set via
COLIBRI_JAIL_PRIV_MODE=sudo. Requires sudoers entry:
  clawdie ALL=(root) NOPASSWD: /usr/sbin/jexec *

The daemon's async spawn closure (edition 2015) may need a
follow-up to fully use this mode — the env var and wrapping
logic are correct, verified via manual jexec test.
2026-06-21 15:53:43 +02:00
6e5f227fa7 docs(handoff): mark C1 validated — apply --yes + idempotent re-run
OSA 2026-06-21: clawdie apply --pool testpool --yes completes all 7 steps
(ZFS datasets, _clawdie user, chown, rc.d, sysrc). Idempotent re-run skips
user creation via exit 65. C1 is done.
2026-06-21 15:23:28 +02:00
a7fc408bd2 Merge pull request 'fix(clawdie): rename service user to _clawdie + idempotent creation' (#128) from fix/clawdie-idempotent-user into main
Some checks are pending
CI / rust (push) Waiting to run
CI / markdown (push) Waiting to run
CI / port (push) Waiting to run
CI / agent-jail-pkgs (push) Waiting to run
Reviewed-on: #128
2026-06-21 15:19:49 +02:00
46dcf7d7e7 fix(clawdie): rename service user to _clawdie + idempotent creation
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
Two changes to the clawdie deploy binary:

1. Service user renamed from 'clawdie' to '_clawdie' — follows FreeBSD
   daemon convention (underscore prefix). Avoids collision with the
   operator's interactive 'clawdie' user on existing hosts like OSA.

2. User creation is now idempotent — exit code 65 (pw: user already
   exists) is treated as success via the new allowed_exit_codes field
   on Action::Run. Deploy can safely re-run without failing.

Full end-to-end test on OSA file-backed pool: all 7 steps (ZFS
datasets, user, chown, rc.d write, sysrc enable) complete.
2026-06-21 15:07:56 +02:00