fix: reserve projected load points and stage Claude credentials #974

Merged
coilysiren merged 4 commits from aos/claude/tu89 into main 2026-08-09 02:46:06 +00:00
Member

Two commits: the shadow-home half of the user-scope projection work, and the #968 auth gap.

17d0e095 // reserve the projected load points in the shadow home

The shadow home symlinked each child of .agents and .claude and linked every other host entry whole. That left ~/.claude/CLAUDE.md pointing at the host's all-roles COMPOSED document, so a role session read all eight role cards beside the one it was launched with.

It also made home-scope projection unsafe for the other harnesses: .codex and .config were single symlinks, so writing .codex/AGENTS.md under the session home resolved through to the host file.

.codex and .config (with its goose and opencode children) are now staged the same way .agents and .claude already were, and every projected load point is reserved so no host copy is linked over it. Projection refuses foreign files, so a leftover link there fails the launch rather than being replaced.

Behavior note: .config becomes a real directory of symlinks, so a new file written under ~/.config inside a session lands in the session rather than the host. Existing entries still resolve to the host.

ceaf441e // stage Claude credentials instead of starting logged out

Closes #968. --auth accepted --agent claude and staged nothing: discovery looked only for ~/.claude/.credentials.json and returned an empty projection when absent, so a launch composed the role, projected it, started Docker, and only then reported Not logged in.

On macOS that file is normally absent because Claude Code keeps the login in the Keychain, namespaced by a digest of CLAUDE_CONFIG_DIR. Discovery now reads that record the way the harness names it and mounts it through a private temporary file, mirroring the Codex Keychain path. ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and CLAUDE_CODE_OAUTH_TOKEN cross by name for unattended runs.

When none resolve, it fails before Docker starts and names the three ways forward, rather than surfacing after an image pull. That is the fail-closed option the issue called worth doing regardless of which credential path was chosen.

The container already copied claude.json to ~/.claude/.credentials.json, so only host discovery was missing. New docs/aos-claude-auth.md mirrors docs/aos-codex-auth.md.

Notes

The first commit pairs with agent-compose native-home/968-user-scope-projection. They should land together: home-scope projection without this write-through guard would overwrite host files.

Full aos-cli suite green.

Two commits: the shadow-home half of the user-scope projection work, and the #968 auth gap. ## `17d0e095` // reserve the projected load points in the shadow home The shadow home symlinked each child of `.agents` and `.claude` and linked every other host entry whole. That left `~/.claude/CLAUDE.md` pointing at the host's all-roles COMPOSED document, so a role session read all eight role cards beside the one it was launched with. It also made home-scope projection unsafe for the other harnesses: `.codex` and `.config` were single symlinks, so writing `.codex/AGENTS.md` under the session home resolved through to the host file. `.codex` and `.config` (with its goose and opencode children) are now staged the same way `.agents` and `.claude` already were, and every projected load point is reserved so no host copy is linked over it. Projection refuses foreign files, so a leftover link there fails the launch rather than being replaced. Behavior note: `.config` becomes a real directory of symlinks, so a new file written under `~/.config` inside a session lands in the session rather than the host. Existing entries still resolve to the host. ## `ceaf441e` // stage Claude credentials instead of starting logged out Closes #968. `--auth` accepted `--agent claude` and staged nothing: discovery looked only for `~/.claude/.credentials.json` and returned an empty projection when absent, so a launch composed the role, projected it, started Docker, and only then reported `Not logged in`. On macOS that file is normally absent because Claude Code keeps the login in the Keychain, namespaced by a digest of `CLAUDE_CONFIG_DIR`. Discovery now reads that record the way the harness names it and mounts it through a private temporary file, mirroring the Codex Keychain path. `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and `CLAUDE_CODE_OAUTH_TOKEN` cross by name for unattended runs. When none resolve, it fails before Docker starts and names the three ways forward, rather than surfacing after an image pull. That is the fail-closed option the issue called worth doing regardless of which credential path was chosen. The container already copied `claude.json` to `~/.claude/.credentials.json`, so only host discovery was missing. New `docs/aos-claude-auth.md` mirrors `docs/aos-codex-auth.md`. ## Notes The first commit pairs with agent-compose `native-home/968-user-scope-projection`. They should land together: home-scope projection without this write-through guard would overwrite host files. Full `aos-cli` suite green.
The shadow home symlinked each child of `.agents` and `.claude` and linked every
other host entry whole. That left `~/.claude/CLAUDE.md` pointing at the host's
all-roles COMPOSED document, so a role session read all eight role cards beside
the one it was launched with, and role scoping was never enforced where the
harness reads.

It also made home-scope projection unsafe for the other harnesses: `.codex` and
`.config` were single symlinks, so writing `.codex/AGENTS.md` under the session
home resolved through to the host file.

Stage `.codex` and `.config` (with its goose and opencode children) the same way
`.agents` and `.claude` were already staged, and reserve every projected load
point so no host copy is linked over it. Projection refuses foreign files, so a
leftover link there fails the launch rather than being replaced.

Pairs with agent-compose native-home/968-user-scope-projection.

Refs #968

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
fix(aos): stage Claude credentials instead of starting logged out
Some checks failed
ci / ward-doctor (pull_request) Successful in 14s
ci / aos-cli-tests (pull_request) Successful in 31s
ci / gate (pull_request) Failing after 59s
ceaf441ed7
`--auth` accepted `--agent claude` and staged nothing. Discovery looked only for
`~/.claude/.credentials.json` and returned an empty projection when it was
absent, so a launch composed the role, projected it, started Docker, and only
then reported `Not logged in`.

On macOS that file is normally absent because Claude Code keeps the login in the
Keychain, namespaced by a digest of `CLAUDE_CONFIG_DIR`. Read that record the
way the harness names it and mount it through a private temporary file, mirroring
the Codex Keychain path. Accept `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, and
`CLAUDE_CODE_OAUTH_TOKEN` by name for unattended runs, where OAuth is the wrong
shape.

When none of those resolve, fail before Docker starts and name the three ways
forward rather than surfacing the failure after an image pull.

The container side already copied `claude.json` to `~/.claude/.credentials.json`,
so only host discovery was missing.

Closes #968

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
docs(native): note where a session write lands under a staged directory
Some checks failed
ci / ward-doctor (pull_request) Successful in 14s
ci / aos-cli-tests (pull_request) Successful in 34s
ci / gate (pull_request) Failing after 58s
9bdbd76b7d
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Merge branch 'main' into aos/claude/tu89
All checks were successful
ci / ward-doctor (pull_request) Successful in 15s
ci / aos-cli-tests (pull_request) Successful in 35s
ci / gate (pull_request) Successful in 59s
7ffc46d9fe
coilysiren deleted branch aos/claude/tu89 2026-08-09 02:46:06 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/agentic-os!974
No description provided.