Commit graph

115 commits

Author SHA1 Message Date
f04f35eb4e Clear setup token file after completion
---
Build: pass | Tests: pass — 2449 passed (182 files)
2026-05-12 16:18:08 +02:00
50513681b4 Add post-install setup bootstrap flow
---
Build: pass | Tests: pass — 2446 passed (182 files)
2026-05-12 11:37:55 +02:00
6c549e7ad0 Rename browser validation assets
---
Build: pass | Tests: pass — 2383 passed (175 files)
2026-05-11 17:32:22 +02:00
3ea26f231d Validate browser clone cookie injection
---
Build: pass | Tests: pass — 2383 passed (175 files)
2026-05-11 16:19:12 +02:00
f8938285a7 Document browser clone validation findings
---
Build: pass | Tests: pass — 2382 passed (175 files)
2026-05-11 13:49:39 +02:00
466ad73cee Document browser jail FreeBSD viability
---
Build: pass | Tests: pass — 2382 passed (175 files)
2026-05-11 10:44:42 +02:00
Operator & Claude Code
e55edbbf0c Promote browser-jail vision-grounding spike to scripts/
Move the spike workspace from the gitignored tmp/ scratch dir into
scripts/browser-jail-spike/ so Codex (or anyone) can re-run it on
FreeBSD with the keys already configured on the host. Self-contained:
fixtures, CDP renderer, OpenAI-compat harness, scorer, plus the
committed screenshots and ground-truth JSON so the experiment is
reproducible without re-rendering.

Claude Opus 4.7 baseline included in results/ (17/17 PASS at 30 px,
mean 1 px). Pending columns:

- GPT-4o via OPENAI_API_KEY
- GLM-4V via ZAI_API_KEY (pi's existing provider)
- UI-TARS-7B via vLLM if/when an endpoint exists

Path references in VISION-GROUNDING-FINDINGS.md and
BROWSER-JAIL-HANDOFF.md updated to match the new location.
2026-05-11 10:03:15 +02:00
17746bb98b Fix test status stamping
---
Build: pass | Tests: pass — 2380 passed (175 files)
2026-05-11 08:38:02 +02:00
8777f0f583 Remove Qodo repo surfaces and embeddings
---
Build: pass | Tests: pass — 2376 passed (712 files)
2026-05-11 00:58:54 +02:00
b67d04a0d4 Add llms.txt export for public docs
---
Build: pass | Tests: pass — 2382 passed (708 files)
2026-05-11 00:49:01 +02:00
Operator & Claude Code
898d2d495e Finish sudo elimination: scripts + startup-report
Route remaining sudo call sites through hostd-call.sh / hostd:
- scripts/destroy-jails.sh: bastille stop/destroy via hostd-call.sh
- scripts/docs-sync.cron.sh: nginx reload via service-restart op
- scripts/heartbeat.sh: bastille list via hostd-call.sh
- src/startup-report.ts: drop sudo bastille/pkg fallbacks; tighten
  buildStartupReport signature now that hostdData is always supplied

Relies on 537c613 (non-interactive bastille-destroy) so the
yes-pipe in destroy-jails.sh is no longer needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 18:19:09 +02:00
Operator & Claude Code
0340674432 Eliminate runtime sudo: hostd migration, module stripping, hostd shell client
- Remove sudo fallbacks from telegram-commands.ts and channels/telegram.ts
- Refactor startup-report.ts to accept pre-fetched hostd data (async path)
- Add bastille-destroy hostd op to privileged-commands.ts
- Strip TTS/STT/vision/chat-policy/model-catalog from index.ts
- Add scripts/hostd-call.sh for shell script -> hostd communication
- Remaining runtime sudo: startup-report sync fallback (lines 847-850)

---
Build: pass | Tests: n/a (Linux agent, 3 pre-existing controlplane-db errors)

---
Build: FAIL | Tests: FAIL — 16 failed
2026-05-10 14:57:28 +02:00
f31f406fec Update docs for DNS doctor and artifact refresh
---
Build: pass | Tests: pass — 2260 passed (671 files)
2026-05-09 16:48:36 +02:00
ec77d9e179 Automate skills artifact refresh
---
Build: pass | Tests: pass — 2247 passed (666 files)

---
Build: FAIL | Tests: pass — 2249 passed (666 files)
2026-05-09 13:29:45 +02:00
21818e4eb0 Refine glasspane tmux launcher
---
Build: pass | Tests: pass — 2147 passed (625 files)
2026-05-05 15:37:20 +02:00
0be5a169ac Fix tmux glasspane session handling
---
Build: pass | Tests: pass — 2147 passed (625 files)
2026-05-05 15:15:54 +02:00
3383afad9c Fix operator report automation and Telegram command scopes
---
Build: pass | Tests: FAIL — 31 failed (full-suite baseline from status writer; focused validation passed)

---
Build: pass | Tests: FAIL — 31 failed
2026-05-03 09:31:44 +02:00
c1560e108d Harden hostd auth and operator password hashing
---
Build: pass | Tests: FAIL — 4 failed (pre-existing controlplane-api tenant fixture cases)
2026-05-03 06:50:06 +02:00
Operator & Claude Code
75009dcb7f refactor(identity): remove PLATFORM_ID/SERVICE_NAME/RUNTIME_USER env vars
Step 5 of system-namespace cutover: complete the env-var removal that
step 4 set up. All consumers now import SERVICE_NAME from
src/platform-identity.ts directly; the deprecated PLATFORM_*
re-exports in src/config.ts are gone.

src/config.ts:
- PLATFORM_ID, PLATFORM_SERVICE_NAME, PLATFORM_RUNTIME_USER exports
  removed.
- PLATFORM_RUNTIME_HOME stays (derived from SERVICE_NAME, used by
  ~10 consumers for path construction).
- Env-var allowlist drops PLATFORM_ID / PLATFORM_SERVICE_NAME /
  PLATFORM_RUNTIME_USER / PLATFORM_RUNTIME_HOME entries.
- CONTROLPLANE_AIDER_TMUX_SESSION uses SERVICE_NAME directly.

setup/onboarding.ts:
- writeIdentity() simplified to write only ASSISTANT_NAME (display).
  PLATFORM_ID / PLATFORM_SERVICE_NAME / PLATFORM_RUNTIME_USER are no
  longer written to .env. Fresh installs have no PLATFORM_* keys.
- Status emission switched from PLATFORM_ID to SERVICE_NAME.

setup/env-audit.ts:
- Audit lists SERVICE_NAME instead of PLATFORM_ID; the env-file
  PLATFORM_ID read is gone.

24 source files (src/*.ts, setup/*.ts, scripts/dashboard.ts):
- Bare PLATFORM_ID / PLATFORM_SERVICE_NAME / PLATFORM_RUNTIME_USER
  references replaced with SERVICE_NAME.
- Imports rewired: SERVICE_NAME comes from
  ../{src/}platform-identity.js, not from config.js.
- Imports deduped where the sed sweep produced collisions.

Shell scripts (scripts/bhyve-evidence.sh, glass.sh, inspect-system.sh):
- Hardcoded SERVICE_NAME='clawdie' and SERVICE_USER='clawdie'.
  No more grep-the-.env fallbacks; the constants are the source.

Tests (middle path):
- Mechanical fixes (import path, renamed assertion text):
  src/hostd/privileged-commands.test.ts, src/startup-report.test.ts,
  setup/env-audit.test.ts, setup/install-mode.test.ts.
- Skipped with `// system-namespace:` markers (pinned removed
  env-driven override behavior; Codex rewrites once the bootstrap-
  config service-user override path lands):
    setup/verify.test.ts > 'uses the platform service name for PID candidates'
    setup/service.test.ts > 'resolves a platform runtime separately from the tenant'

Test files still containing PLATFORM_* strings in vi.mock contents,
ENV_KEYS arrays, or comments are left untouched — they are test
artifacts that don't affect runtime; mock contents resolve to
'clawdie' which still equals SERVICE_NAME.

tsc clean. 2095 tests pass, 4 skipped, 0 fail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  2095 passed | 4 skipped (2099)
2026-05-02 14:49:19 +02:00
Operator & Claude Code
00a908306d Honor configured ZFS pool everywhere
Codex caught zroot hardcodes in setup/sanoid.ts and setup/db.ts; same
pattern remained in three more shipping locations:

- scripts/backup.ts: jail and shared dataset paths
- src/tenant-registry.ts: default tenant dataset list
- setup/sanoid.ts: npm-global retention candidate

Add zfsPool() helper to maintenance-snapshots.ts (where the analogous
buildHostDbDatasets reads ZFS_POOL) and use it in all three. Operators
running on non-default pools no longer get silently-wrong dataset paths
in backup, tenant provisioning, or sanoid retention.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  2099 passed (2099)
2026-05-02 08:20:32 +02:00
8c4b8a88ef Remove hardcoded mevy runtime identity
Replace remaining executable-code mevy assumptions with config-derived values. This updates operator messaging, runtime prompts, agent-task role defaults, inspect-system fallbacks, and OpenRouter metadata headers to follow PLATFORM_SERVICE_NAME, PLATFORM_ID, TENANT_ID, and PROJECT_ROOT instead of the live example tenant.

---
Build: pass | Tests: FAIL — Tests  3 failed | 2089 passed (2092)
2026-05-02 07:16:30 +02:00
bef38d218a Add maintainer skills artifact builder
---
Build: pass | Tests: pass — Tests  2075 passed (2075)

---
Build: pass | Tests: pass — Tests  2075 passed (2075)
2026-04-29 13:12:30 +02:00
975f37f895 feat(install): add versioned setup and system contracts
---
Build: pass | Tests: pass — Tests  2000 passed (2000)
2026-04-27 10:06:44 +02:00
d5182ec480 docs+setup: clarify install mode names
---
Build: pass | Tests: pass — Tests  1992 passed (1992)
2026-04-27 09:07:18 +02:00
bcb27d4d56 feat(install): backfill setup from inspect output
---
Build: pass | Tests: FAIL — Tests  2 failed | 1989 passed (1991)
2026-04-27 08:55:21 +02:00
7b14e27783 feat(install): add shell-based inspect mode
---
Build: pass | Tests: pass — Tests  1991 passed (1991)
2026-04-27 08:47:56 +02:00
2ab3fa050a refactor(setup): unify operator auth entrypoints
---
Build: pass | Tests: pass — Tests  1991 passed (1991)
2026-04-27 08:13:36 +02:00
Operator & claude
a16838b772 docs(handoff): record adopt-mode decisions + flag operator-auth unification
Round 5 in the handoff doc captures the five agreed adopt-mode
decisions (INSTALL_MODE field, fill-blanks default, identity
mismatch blocks, Telegram identity changes require explicit flag,
fingerprint gate) so they survive into Codex's design doc.

Implementation doc gets an "Adopt Mode (V1.1)" section with the
proposed 4-task split + per-field freeze contract table, plus a
task-4 followup subsection naming the legacy `operators` table
sync gap and the unification plan with Codex's
setup/operator-auth.ts. scripts/set-operator.ts gets a TODO(unify)
header pointing at the same gap.

first-boot.md notes adopt mode is V1.1 and to back up before
reflashing until then.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---
Build: pass | Tests: FAIL — Tests  3 failed | 1972 passed (1975)
2026-04-27 07:12:55 +02:00
Operator & claude
b9e771316d feat(setup): add set-operator script for post-install dashboard credentials
Lands task 4 from the ISO first-boot implementation split as a
standalone scripts/set-operator.ts (matches existing scripts/
convention — no clawdie-admin umbrella). Reuses
ensureControlplaneBootstrapOperator() for the Better Auth signUp
path. Prompts password via stdin with echo suppressed; refuses
non-TTY runs; updates OPERATOR_PASSWORD in .env (mode 0600).
First-set only — rotation goes through the dashboard.

Both planning docs updated to drop "notional" references and point
at the real npm run set-operator -- <email> command.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---
Build: pass | Tests: FAIL — Tests  3 failed | 1972 passed (1975)
2026-04-27 06:41:53 +02:00
1389e17ec4 fix(runtime): align startup brief and test status paths
---
Build: pass | Tests: pass — Tests  1951 passed (1951)
2026-04-26 12:48:47 +02:00
1e87f34121 feat(dashboard): expand operator tenant and publish view
---
Build: FAIL | Tests: FAIL

---
Build: FAIL | Tests: FAIL
2026-04-26 08:49:24 +02:00
af2648be87 fix(reports): keep test status artifacts in repo tmp
---
Build: FAIL | Tests: FAIL
2026-04-26 07:48:43 +02:00
Operator & claude
1759a8bd85 feat(reports): add structured test/build report
Reads JSON status files written by scripts/write-test-build-status.sh
so /testreport reflects the last real build/test run instead of model
memory. Missing or stale status degrades to "unknown" with an action
note rather than fabricating success.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  1914 passed (1914)

---
Build: pass | Tests: pass — Tests  1917 passed (1917)

---
Build: pass | Tests: pass — Tests  1921 passed (1921)
2026-04-26 07:44:21 +02:00
0d9ad52922 fix(controlplane): stop git push token burn in jail
---
Build: FAIL | Tests: FAIL
2026-04-25 19:37:54 +02:00
d8cbd5ca70 chore(multitenant): harden agent workflow and README sync
Move the multitenant agent-workflow decision into repo docs, enforce effective author/committer identities in the pre-commit hook, and replace the shell-based README version rewrite with a reusable Node helper.

---
Build: pass | Tests: pass — node scripts/update-readme-version.mjs --check; sh -n hooks/pre-commit

---
Build: FAIL | Tests: FAIL — Tests  58 failed | 1109 passed (1167)

---
Build: FAIL | Tests: FAIL — Tests  58 failed | 1107 passed (1165)
2026-04-25 07:58:18 +02:00
9605c7ad81 refactor(multitenant): collapse planTenantApply allowedResources duplication
Drop the allowedResources field from TenantApplyPlan — it was derived
field-for-field from resourceChecklist already, which was exactly the
"triplicate representation" flagged in the handoff's consolidation list.
Update scripts/tenant-lifecycle.ts to compute the same lists from the
checklist when it prints, and drop the tautological equality assertions
from the test (resourceChecklist is now the single source).

---
Build: pass | Tests: pass — 33 passed (1 file)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 19:12:12 +02:00
d8f43fc4a0 Clean up controlplane naming consumers
Fix the remaining operator-surface drift after the naming cutover. This aligns controlplane defaults around ai.<base>, makes the dashboard use the shared display-date helper and approved controlplane host, reuses the derived code-service hostname in Forgejo config, and fixes local-host syncing so underscore-form tenant jails are no longer skipped.

---
Build: pass | Tests: pass — 67 passed (5 files)
2026-04-24 16:50:08 +02:00
9fea739140 Finish controlplane naming propagation sweep
---
Build: pass | Tests: pass — 122 passed (7 files)
2026-04-24 16:03:47 +02:00
0c690d2065 Surface tenant naming overrides in apply plan 2026-04-24 11:06:20 +02:00
3992503522 Clarify tenant apply normalization hints
Explain in tenant-apply output when an existing tenant still carries declared non-default state, so operators can distinguish current tenant-specific carryover from the smaller V2 default for new tenants.

---
Build: pass | Tests: pass — 31 passed (1 file)
2026-04-24 10:17:41 +02:00
ae7a109da4 Consolidate tenant apply contract shape
Reduce duplication in planTenantApply by treating the resource checklist as the canonical resource list, deriving blockers from preflight state, and trimming redundant action-policy payloads.

---
Build: pass | Tests: pass — 31 passed (1 file)
2026-04-24 10:10:44 +02:00
daf29fa332 Add tenant apply resource checklist
Refine tenant-apply dry runs with per-resource status entries so databases, worker jails, and datasets are reported as explicit future-create candidates instead of only appearing inside summary sections.

---
Build: pass | Tests: pass — 31 passed (1 file)
2026-04-24 09:40:04 +02:00
253cdcecb6 Classify tenant apply policy actions
Refine tenant-apply planning so future automatic candidates, manual-only steps, and permanent out-of-scope actions are reported explicitly instead of being implied by generic prose.

---
Build: pass | Tests: pass — 31 passed (1 file)
2026-04-24 09:36:31 +02:00
2d3f2253c9 Define tenant apply preflight policy
Turn tenant-apply into a structured preflight contract that marks what already passes in the declarative model, what remains manual, and what still blocks any future automatic host mutation.

---
Build: pass | Tests: pass — 31 passed (1 file)
2026-04-24 09:32:10 +02:00
36827ab478 Add dry-run tenant apply planning
Introduce a separate tenant-apply contract that describes what a future live apply would be allowed to touch, what prerequisites it would require, and what stays explicitly manual or out of scope.

---
Build: pass | Tests: pass — 28 passed (1 file)
2026-04-24 09:14:37 +02:00
59c4006938 refactor(multitenant): platform domain config, richer CLI, comment-safe registry
- platform record now accepts internal_domain and internal_base; tenant
  internal-domain derivation honors platform.internal_base instead of
  hard-coding home.arpa
- validateTenantRecord now rejects a tenant whose internal_domain
  collides with the platform internal_domain
- tenant-lifecycle CLI now accepts --internal-domain, --service, and
  repeatable --dataset flags; tenant-list now prints
  id\\tservice\\tinternal-domain\\tdisplay-name
- writeTenantRegistry preserves YAML comments and key order via the
  yaml Document API instead of parse/stringify round-tripping
- platformHostd{SocketPath,PidFile} now use normalizeResourceId
  directly so platform-side helpers stop calling normalizeTenantId

Build: pass | Tests: pass — 1783 passed (114 files); two failing
suites (vision.test.ts, controlplane-api.test.ts) are pre-existing
on origin/multitenant and unrelated to this change.
2026-04-24 09:13:20 +02:00
b48e073848 Define tenant provisioning contract
Turn tenant planning into an explicit declarative contract that states which logical resources belong to a tenant and which host-level concerns remain intentionally out of scope.

---
Build: pass | Tests: pass — 20 passed (1 file)
2026-04-24 08:48:48 +02:00
56fbddb616 Define tenant removal safety boundaries
Make tenant removal planning distinguish declarative registry changes from protected platform resources, and block removal when a tenant overlaps platform identity or shared services.

---
Build: pass | Tests: pass — 18 passed (1 file)
2026-04-24 08:41:25 +02:00
311f663523 Harden tenant lifecycle validation
Reject empty tenant input, normalize read-path lookups, and treat shared platform resource aliases as reserved so lifecycle validation catches underscore and hyphen collisions consistently.

---
Build: pass | Tests: pass — 25 passed (2 files)
2026-04-24 08:38:29 +02:00
e040f5cfcc Add tenant lifecycle removal planning
Keep tenants as logical platform identities, preserve human display names while normalizing system ids, and add a dry-run removal path plus stronger registry validation.

---
Build: pass | Tests: pass — 28 passed (3 files)
2026-04-24 08:32:45 +02:00