Skip to content

Bare-machine first use: isolated docker environment + setup ordering fix - #104

Merged
pacphi merged 4 commits into
mainfrom
feat/bare-machine-first-use
Aug 3, 2026
Merged

Bare-machine first use: isolated docker environment + setup ordering fix#104
pacphi merged 4 commits into
mainfrom
feat/bare-machine-first-use

Conversation

@pacphi

@pacphi pacphi commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What

Two deliverables that belong together — a repeatable bare-machine first-use environment, and the setup bug it immediately caught:

  1. docker/ — isolated cross-platform first-use environment. One docker compose up ak on macOS/Windows/Linux builds Ubuntu 26.04 + Node (NodeSource, build-arg matrix), installs @pacphi/agentic-kit@next at container start (the true first-install path — no image rebuild per release), runs ak setup --codex --opencode --yes as a non-root user, and serves the dashboard to the host browser. The dashboard binds container-loopback by design (ADR-0014), so a socat bridge re-publishes it and compose maps it back host-loopback-only — the printed #token URL works verbatim on the host. Isolation is absolute both ways: no host paths mounted except ./docker/artifacts; all persistent state in named volumes; a host agentic-kit install of any version cannot conflict. Persona-split docs live in the directory itself (USER-GUIDE.md / MAINTAINER-GUIDE.md).

  2. fix(setup): guidance blocks + user-scope MCP registration moved to a final pass. On a genuinely bare machine, both ran before setup's hosts branch had installed the claude/codex CLIs — first runs warned claude mcp add failed and reported immediate block drift. The reconcile loop is extracted to blocks.mjs reconcileGuidance() and shared with ak sync, so setup and sync converge guidance identically.

Proof (zero-credential container runs)

  • Before (published alpha.33): ⚠ claude mcp add failed, post-setup status warns mcp: ruflo MCP not registered + 3 drifted blocks.
  • After (this branch via AK_INSTALL_SPEC tarball install): zero warnings; final pass upserts all 9 registry blocks in one shot (including ~/.codex/AGENTS.md dual-mode, which previously needed a second sync); post-setup status: mcp: claude-flow registered (user scope), blocks: CLAUDE.md managed blocks in sync (9 in registry). Remaining warns are only the honest codex/opencode auth: none advisories.
  • Also empirically established: the entire install + setup surface (both MCP bridges, ruflo init/memory/swarm/daemon with a verified memory write, aqe init --with-codex) needs no AI login or API key; ak sync afterwards reports converged with no failing subsystems.

Test plan

  • pnpm run check green (typecheck, lint, markdown, build, full test suites).
  • Fresh zero-credential container run of the packed branch: assertions above.
  • Dashboard reached from host browser through the bridge with the printed token URL.

🤖 Generated with Claude Code

pacphi added 4 commits August 3, 2026 08:28
Ubuntu container that installs @pacphi/agentic-kit@next at start, runs full
setup (--codex --opencode), and serves the loopback-only dashboard to the
host via a socat bridge published on host-loopback only. No host paths
mounted except ./artifacts; persistent state in named volumes, so a host
agentic-kit install can never conflict. Verified end-to-end with zero
credentials: setup completes and ak sync converges with no failing
subsystems.
On a genuinely bare machine, machine setup registered the user-scope MCP
server and synced the CLAUDE.md guidance blocks before the hosts branch had
installed the claude/codex/opencode CLIs — so first runs warned ('claude mcp
add failed') and reported immediate block drift (command:codex and
flag:dualMode detectors flip only after the hosts step). Both steps now run
as a final pass in the setup orchestrator, after the hosts branch and the
project phase's codex bridge (which creates ~/.codex). The guidance
reconcile loop is extracted to blocks.mjs reconcileGuidance and shared with
ak sync, so the two commands converge guidance identically.
…laims

AK_INSTALL_SPEC lets maintainers install an unpublished npm-pack tarball
from ./artifacts — used to prove local fixes in the first-use container
before publishing. User guide now states the zero-credential convergence as
verified fact.
@pacphi
pacphi merged commit fa66c48 into main Aug 3, 2026
11 checks passed
@pacphi
pacphi deleted the feat/bare-machine-first-use branch August 3, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant