Feat/install host side writes#43
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves install file-writing from the daemon to the CLI so the public flow collapses to one line of
bun add -gplus onedocker runplusagentlock install— no env-var gates, noper-harness bind mounts. Also fixes a long-standing
codex_hooksplacement bug that brokecodexfor users whose~/.codex/config.tomlalready had[section]headers.What changed
claudeCodePlan,codexPlan, andcursorPlannow take anexisting_filesmap from the request, run the merge logic at plan time, andreturn ops with the final byte-for-byte content. The CLI executes the writes on the host.
AGENTLOCK_ALLOW_APPLYandAGENTLOCK_ALLOW_APPLY_REAL_HOME. The host-side safety check (checkSafeTarget) lives in the CLI now, where$HOMEis real, and is bypassedonly when
--config-dirorAGENTLOCK_DEV_HOMEis set.InstallCapabilitiesshrunk to{unattested_allowed, container}. The CLI's capabilities probe and "container? mount $HOME!" warning are gone.cli/src/util/install-fs.ts— atomic write via tmp+rename,backup_pathhonored, mid-batch rollback, pluscheckSafeTargetandreadExistingFiles.codexConfigTomlPlannow insertscodex_hooks = trueimmediately before the first[section]header, with a regression test. The previous append-at-end behavior landedthe line inside the last section (e.g.
[tui.model_availability_nux]) and brokecodexwithinvalid type: boolean true, expected u32.cli/README.md,control-plane/README.md, the rootREADME.md,docs/guide/getting-started.md,docs/guide/installation.md, anddocs/reference/detection.mdnow show the same three-line public flow and correctly list Cursor as shipped.
Test plan
bun test(cli),go test -race ./...(control-plane),cargo test(ledger) all passdocker run(no env vars, no host mounts) →bun add -gfrom local pack →agentlock install→ hooks land in~/.claude,~/.codex,~/.cursorand reference the global binary~/.claude/settings.json(model,enabledPlugins,extraKnownMarketplaces) survive installconfig.tomlthat has[section]headers but nocodex_hooksline — line appears before the first[andcodexstarts cleanlyagentlock install --tier totpstill produces a TOTP-banner ledger entry