#198 follow-up: update the protected .sandcastle/secrets/README.md for the Claude-token-as-file change #219

Closed
opened 2026-10-15 04:40:22 +00:00 by matou-build-agent · 1 comment

Follow-up filed from #198 (deliver CLAUDE_CODE_OAUTH_TOKEN as a mounted file via a claude shim, not a docker run -e).

Symptom

.sandcastle/secrets/README.md still documents the Claude OAuth token as the one exception that "stays in .env, because the claude CLI has no file-based flag for it". As of #198 that is no longer true: the token ships as a 0600 mounted file (/run/secrets/claude_oauth_token) read by the claude-fence shim, exactly like the other bearer tokens. The README's "The files" table also omits claude_oauth_token.

Why this needs a session, not a worker

.sandcastle/ is this repo's own vendored self-copy at FACTORY_REF and is a PROTECTED path — a swarm worker cannot edit it (the protected-paths tree-fingerprint rolls back any change and reds the run). secrets/README.md is a per-repo consumer-layer doc with no root source in the vendor manifest, so it is not fixed by a re-vendor either; it must be edited in place by an interactive session (or a human).

Proposed change

Update .sandcastle/secrets/README.md to match #198:

  • Drop the "CLAUDE_CODE_OAUTH_TOKEN is the one documented exception and stays in .env" sentence; say it now ships as a file like the others (the ANTHROPIC_API_KEY API-key alternative is the only secret-shaped key that still rides -e, and only if used).
  • Add a claude_oauth_token row to "The files" table: read in the sandbox at /run/secrets by the claude CLI via the claude-fence shim first on PATH; written by provision_write_claude_secret from the selected account (#510 failover rewrites it).

docs/SECRETS_CHECKLIST.md and onboarding/templates/SECRETS_CHECKLIST.md.tmpl were already updated in #198; this is only the protected consumer-layer README left.

Found while working

#198.

_Follow-up filed from #198 (deliver CLAUDE_CODE_OAUTH_TOKEN as a mounted file via a `claude` shim, not a `docker run -e`)._ ## Symptom `.sandcastle/secrets/README.md` still documents the Claude OAuth token as the one exception that "stays in `.env`, because the `claude` CLI has no file-based flag for it". As of #198 that is no longer true: the token ships as a 0600 mounted file (`/run/secrets/claude_oauth_token`) read by the `claude-fence` shim, exactly like the other bearer tokens. The README's "The files" table also omits `claude_oauth_token`. ## Why this needs a session, not a worker `.sandcastle/` is this repo's own vendored self-copy at `FACTORY_REF` and is a PROTECTED path — a swarm worker cannot edit it (the protected-paths tree-fingerprint rolls back any change and reds the run). `secrets/README.md` is a per-repo consumer-layer doc with no root source in the vendor manifest, so it is not fixed by a re-vendor either; it must be edited in place by an interactive session (or a human). ## Proposed change Update `.sandcastle/secrets/README.md` to match #198: - Drop the "`CLAUDE_CODE_OAUTH_TOKEN` is the one documented exception and stays in `.env`" sentence; say it now ships as a file like the others (the `ANTHROPIC_API_KEY` API-key alternative is the only secret-shaped key that still rides `-e`, and only if used). - Add a `claude_oauth_token` row to "The files" table: read in the sandbox at `/run/secrets` by the `claude` CLI via the `claude-fence` shim first on PATH; written by `provision_write_claude_secret` from the selected account (#510 failover rewrites it). `docs/SECRETS_CHECKLIST.md` and `onboarding/templates/SECRETS_CHECKLIST.md.tmpl` were already updated in #198; this is only the protected consumer-layer README left. ## Found while working #198.
Author
Member

Close-report — ruled by agent under ADR 0174 (veto anytime)

#198's Claude-token-as-file change is now reflected in the last stale doc, the protected consumer-layer .sandcastle/secrets/README.md (no root vendor source; a swarm worker cannot touch .sandcastle/, so this required an interactive session — as the ticket noted).

What landed (commit 06d4e03, pushed to main):

  • Dropped the false intro sentence — "CLAUDE_CODE_OAUTH_TOKEN is the one documented exception and stays in .env, because the claude CLI has no file-based flag for it". Replaced with: since #198 the Claude OAuth token ships as a file like the rest (claude_oauth_token, read by the claude-fence shim), so no bearer token rides .env; the only secret-shaped key still on -e is ANTHROPIC_API_KEY (the API-key alternative, no file delivery yet, only if used).
  • Added the missing claude_oauth_token row to "The files": read in the sandbox at /run/secrets by the claude CLI via the claude-fence shim installed first on PATH by the Dockerfile (#198); written by provision_write_claude_secret from the account selected for the run (the #510 failover rewrites it after an account flip).
  • STATUS.md header line + docs/journal/2026-10-15-219.md added in the same commit (project-state rule).

Proof

  • Accuracy verified against source: provision-lib.sh provision_write_claude_secret (#198/#510 comments), main.mts mounts .sandcastle/secrets → /run/secrets read-only, claude-fence reads /run/secrets/claude_oauth_token and execs the real CLI, Dockerfile.tmpl installs the shim first on PATH.
  • tests/docs-budget-test.sh green (STATUS.md stays under budget); onboarding/tests/onboard-lib-test.sh green (README still skipped by verify-creds). No test asserts the README prose, so none needed updating.
  • The three suite reds (claude-call-guards-test.sh, limit-lib-test.sh, session-runner-test.sh) reproduce byte-identically on the pre-change tree c62e251 — pre-existing limit/account-fp family reds, unrelated to this doc-only change.

Doc-only, revertible (two-way door). No one-way door touched. Closing.

**Close-report — ruled by agent under ADR 0174 (veto anytime)** #198's Claude-token-as-file change is now reflected in the last stale doc, the protected consumer-layer `.sandcastle/secrets/README.md` (no root vendor source; a swarm worker cannot touch `.sandcastle/`, so this required an interactive session — as the ticket noted). **What landed** (commit `06d4e03`, pushed to `main`): - Dropped the false intro sentence — "`CLAUDE_CODE_OAUTH_TOKEN` is the one documented exception and stays in `.env`, because the `claude` CLI has no file-based flag for it". Replaced with: since #198 the Claude OAuth token ships as a file like the rest (`claude_oauth_token`, read by the `claude-fence` shim), so no bearer token rides `.env`; the only secret-shaped key still on `-e` is `ANTHROPIC_API_KEY` (the API-key alternative, no file delivery yet, only if used). - Added the missing `claude_oauth_token` row to "The files": read in the sandbox at `/run/secrets` by the `claude` CLI via the `claude-fence` shim installed first on PATH by the `Dockerfile` (#198); written by `provision_write_claude_secret` from the account selected for the run (the #510 failover rewrites it after an account flip). - `STATUS.md` header line + `docs/journal/2026-10-15-219.md` added in the same commit (project-state rule). **Proof** - Accuracy verified against source: `provision-lib.sh` `provision_write_claude_secret` (#198/#510 comments), `main.mts` mounts `.sandcastle/secrets` → `/run/secrets` read-only, `claude-fence` reads `/run/secrets/claude_oauth_token` and execs the real CLI, `Dockerfile.tmpl` installs the shim first on PATH. - `tests/docs-budget-test.sh` green (STATUS.md stays under budget); `onboarding/tests/onboard-lib-test.sh` green (README still skipped by verify-creds). No test asserts the README prose, so none needed updating. - The three suite reds (`claude-call-guards-test.sh`, `limit-lib-test.sh`, `session-runner-test.sh`) reproduce byte-identically on the pre-change tree `c62e251` — pre-existing limit/account-fp family reds, unrelated to this doc-only change. Doc-only, revertible (two-way door). No one-way door touched. Closing.
matou-build-agent 2026-10-15 07:53:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
Matou/dev-factory#219
No description provided.