Commit graph

22 commits

Author SHA1 Message Date
8456fcc526 test: expand coverage + fix setup/ TypeScript errors
New test files (83 tests):
- src/agent-identity.test.ts — resolveAgentIdentity across locales/genders
- src/env.test.ts — readEnvFile parsing, quoting, edge cases
- src/jail-registry.test.ts — getJailIp with/without env override
- src/local-hosts.test.ts — block markers, entries, render, upsert
- src/mount-security.test.ts — validateMount allowlist enforcement
- src/transcription.test.ts — initTranscription + transcribeAudio with mocked OpenAI

setup/ TypeScript audit (tsconfig.setup.json):
- agent-jails: JAILS value serialised to JSON string for emitStatus
- environment.test: use import type for pg.Pool type cast
- onboarding: wrap showProfileMenu in normalizePiTuiProfile
- preflight.test: fix process.exit mock type + typed call array casts
- sanoid: execSync → spawnSync for multi-arg zfs invocation
- skills-memory: bracket access for legacy chunking_version field
- upstream: pass process.cwd() to isGitRepo()
- verify: import StripeKeyMode type, annotate stripeKeyMode variable

Full suite: 69 files, 1162 tests passing; tsc --noEmit clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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

---
Build: pass | Tests: pass — Tests  1162 passed (1162)
2026-04-14 09:40:28 +00:00
05fc2c30d7 docs: clean up Paperclip references and update Aider+Pi handoff (Sam & Claude)
Remove Paperclip name from descriptive comments in setup/agent-cli-check.ts
and setup/onboarding.ts. Fix stale SQLite reference in
doc/CONTROLPLANE-AIDER-PI.md. Answer open questions and check off
completed tasks in the Aider+Pi handoff doc.

---
Build: pass | Tests: not run (Linux)
2026-04-11 20:51:46 +02:00
fc0abfc517 feat(setup): require at least one agent CLI before onboarding
Mirrors Paperclip's per-adapter ensureCommandResolvable pattern as a single
fail-fast gate at the top of `setup onboard`. Probes {claude, codex, gemini,
pi} via commandExists; throws NoAgentCliError if none resolve. Also surfaces
all four in `setup verify` alongside the existing CODEX check.

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

---
Build: pass | Tests: FAIL — Tests  1 failed | 846 passed (847)
2026-04-08 09:14:56 +00:00
b0921f4fb4 Normalize domain defaults to home.arpa (Sam & Codex)
---

Build: pass | Tests: pass — 603 passed (44 files)

---
Build: pass | Tests: pass — Tests  603 passed (603)
2026-04-04 09:47:07 +00:00
2179e23ec9 feat: add local LLM runtime selection
---
Build: pass | Tests: pass — Tests  605 passed (605)
2026-04-02 15:18:22 +00:00
49edbc3275 fix: align onboarding IP defaults with Ansible scheme, tighten git gating
Onboarding was writing WARDEN_GIT_IP=.4 and WARDEN_OLLAMA_IP=.6 —
reversed from the canonical Ansible/live scheme (.6=git, .5=ollama).
Also fix git.ts feature gate to skip on either FEATURE_GIT=false OR
CODE_HOSTING_MODE=external (was requiring both).

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

---
Build: pass | Tests: pass — Tests  605 passed (605)
2026-04-02 08:00:26 +00:00
98c8f82fc6 fix: normalise locale to UTF-8 in applyHostLocale; add UTF-8 rule to AGENTS.md
applyHostLocale() was writing whatever charset was detected on the host
(including ISO8859-2) verbatim into ~/.login_conf, silently breaking
Slovenian character rendering on next login.

- Always strip the charset suffix from the detected locale tag and
  rewrite it as <base>.UTF-8 — sl_SI.ISO8859-2 → sl_SI.UTF-8
- charset field is always written as UTF-8
- Replace both 'tmux kill-server && tmux' suggestions with instruction
  to open a new tmux window or fresh SSH login
- Add UTF-8 compliance section to AGENTS.md documenting the rule,
  normalisation table, and the cap_mkdb requirement

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-28 09:34:48 +00:00
200b6b62a1 fix: remove gender inference — user always decides
Dropped inferGender() heuristic. The installer now shows the current
.env value (or 'n') as default and requires explicit user selection.
No guessing from name endings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-27 17:52:16 +00:00
cf6fc72d91 feat: gender as first-class agent identity — core differentiator
src/agent-identity.ts (new): AgentIdentity resolves name, gender, locale
into pronoun/possessive/title/selfIntro. FORMS map supports sl (full
gendered grammar: asistentka/asistent, ona/on) and en (neutral fallback).
resolveAgentIdentity() exported for onboarding preview before .env write.

src/config.ts: AgentGender type ('m'|'f'|'n'), AGENT_GENDER export.
Accepts 'ž' as alias for 'f' (Slovenian natural input).

src/agent-runner.ts: AGENT_IDENTITY.selfIntro prepended to every pi
system prompt — agent always knows who it is grammatically.

setup/onboarding.ts: gender question after assistant name in both
bsddialog (menu with live preview per gender) and TTY (prompt + preview
line) paths. inferGender() suggests female for names ending in 'a'.
Confirmation screen shows full identity preview. AGENT_GENDER written
to .env.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  431 passed (431)
2026-03-27 17:41:46 +00:00
eb21195472 feat: add timezone menu selection to onboarding
- Create freebsd-timezones.ts with IANA timezone list (Europe/Ljubljana first as Slovenian prototype default)
- Add TimezoneOption interface and helper functions (getTimezoneOptions, prioritizeTimezones, findTimezoneOption, isValidTimezone, formatTimezoneLabel)
- Add showTimezoneMenu function for bsddialog timezone menu selection
- Update onboarding to show timezone as interactive dropdown menu (like locale)
- Support locale + timezone selection in same step, both with defaults and menu options
- Slovenian language (sl-SI) is first in locale list, Europe/Ljubljana is first in timezone list

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

---
Build: pass | Tests: FAIL — Tests  2 failed | 487 passed | 10 skipped (499)
2026-03-24 16:52:51 +00:00
3a10576202 Set Slovenian as default language for prototype
Update onboarding wizard to prioritize sl-SI (Slovenian) locale
and Europe/Ljubljana timezone by default:

- Add 'sl-SI' as first priority in locale enumeration
- Default timezone to Europe/Ljubljana if not detected
- Makes installation flow more suitable for development/testing

This allows developers to run setup steps without specifying
locale flags while keeping FreeBSD-detected values as fallback.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

---
Build: pass | Tests: FAIL — Tests  2 failed | 487 passed | 10 skipped (499)
2026-03-24 16:48:11 +00:00
06bb4ce9a5 simplify(setup): drop required bsddialog dependency for onboarding
---
Build: FAIL | Tests: FAIL — not run in Linux sandbox; defer verification to FreeBSD
2026-03-15 10:10:41 +01:00
6cb600be25 fix(onboarding): capture bsddialog selection from stderr via spawnSync
bsddialog writes the selected item to stderr by default (not stdout).
The previous code used --stdout which, when stdout is piped (non-TTY),
causes bsddialog to dump all terminal escape codes + the tag to stdout,
making .trim() return escape-sequence garbage instead of the bare tag.

Switch to spawnSync with stdio: ['inherit', 'inherit', 'pipe'] so that
the TUI renders on the inherited TTY (stdin/stdout) while the selection
tag is captured cleanly from result.stderr.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---
Build: pass | Tests: pass — Tests  414 passed | 10 skipped (424)
2026-03-14 23:07:20 +00:00
78135b1663 feat(setup): add host preflight and protected screenshots 2026-03-14 22:52:09 +01:00
6bd00f34f3 Add profile menu to onboarding wizard and fix README gaps
- Add bsddialog --menu profile selector to onboarding.ts interactive flow
  (shows all 10 PI profiles after assistant name, before Stripe config)
- Add --pi-profile CLI arg for non-interactive use
- Write PI_TUI_PROFILE to .env and include in confirmation summary + status
- Add missing 'hosts' step to available step entrypoints list in README
- Add 'cnc' profile to PI Profiles section in README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 20:27:42 +00:00
0d8db0edf1 fix(network): harden local DNS placeholders and hosts sync 2026-03-14 19:45:15 +01:00
7fa732c5ca feat(setup): make local git a default jail 2026-03-14 17:41:41 +01:00
3ef6bda7e1 refactor(payments): simplify Stripe integration 2026-03-14 13:58:32 +01:00
5202bba77c feat(freebsd): manage jail hostnames and /etc/hosts for local resolution 2026-03-14 13:08:44 +01:00
a72f947afb fix(db): generate split-brain secrets and remove bootstrap deadlocks 2026-03-14 12:52:06 +01:00
53e7af5fab feat(setup): apply host locale to ~/.login_conf after onboarding wizard
After the bsddialog wizard confirms a locale selection, write it to
~/.login_conf and run cap_mkdb so it survives reboots and new logins.
Show a respawn reminder since setup runs inside tmux and the server
inherits env at startup.

Document the full pattern in freebsd-admin/references/locale-setup.md,
extend freebsd-admin and tmux-screenshot skills with scope and workflow
pointers, and add Locale & Identity as step 0 in the setup skill.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 08:26:25 +00:00
57cacae3a3 feat(setup): add FreeBSD onboarding and baseline sync 2026-03-14 02:51:10 +01:00