consumer layer: this repo's .sandcastle/secrets/README.md is missing (dangling pointer from post-issue-ask.sh) #76

Closed
opened 2026-08-24 18:44:34 +00:00 by matou-build-agent · 2 comments

Discovered by the dry read-through that accepted #61 (the install session's step 5 authors this file by name).

What

This repo is the factory's own third consumer, but its .sandcastle/ has no secrets/ directory and so no secrets/README.md — while:

  • .sandcastle/.gitignore un-ignores exactly that path by name (secrets/* + !secrets/README.md), so the slot is reserved and empty;
  • post-issue-ask.sh:25 tells a reader to "see secrets/README.md" — a dangling pointer in vendored harness text;
  • onboarding/install-prompt.md step 5 now names it as one of the four files vendor deliberately does not deliver.

This is precisely the residue ADR 0006 describes: the self-onboarding of 2026-08-22 ran every subcommand and left behind a list of files somebody had to remember to write by hand.

Scope

Author .sandcastle/secrets/README.md for THIS repo — what each token file is and which script consumes it, sourced from docs/SECRETS_CHECKLIST.md. Per-repo identity layer, so it is editable directly under .sandcastle/ (CLAUDE.md's per-repo layer exception), no pin bump needed.

Note the factory's own workers read FORGEJO_TOKEN from /run/secrets/ (docker secrets) and $here/secrets/ (rehearsal-report.sh) — the readme should state which of those this consumer actually uses, rather than describing both generically.

Acceptance

  • .sandcastle/secrets/README.md exists and is committed (the ignore rule already permits it).
  • Every token file it names matches docs/SECRETS_CHECKLIST.md and a real consumer in the harness.
  • Full offline suite green.
Discovered by the dry read-through that accepted #61 (the install session's step 5 authors this file by name). ## What This repo is the factory's own third consumer, but its `.sandcastle/` has no `secrets/` directory and so no `secrets/README.md` — while: - `.sandcastle/.gitignore` un-ignores exactly that path by name (`secrets/*` + `!secrets/README.md`), so the slot is reserved and empty; - `post-issue-ask.sh:25` tells a reader to "see secrets/README.md" — a dangling pointer in vendored harness text; - `onboarding/install-prompt.md` step 5 now names it as one of the four files `vendor` deliberately does not deliver. This is precisely the residue ADR 0006 describes: the self-onboarding of 2026-08-22 ran every subcommand and left behind a list of files somebody had to remember to write by hand. ## Scope Author `.sandcastle/secrets/README.md` for THIS repo — what each token file is and which script consumes it, sourced from `docs/SECRETS_CHECKLIST.md`. Per-repo identity layer, so it is editable directly under `.sandcastle/` (CLAUDE.md's per-repo layer exception), no pin bump needed. Note the factory's own workers read `FORGEJO_TOKEN` from `/run/secrets/` (docker secrets) and `$here/secrets/` (rehearsal-report.sh) — the readme should state which of those this consumer actually uses, rather than describing both generically. ## Acceptance - `.sandcastle/secrets/README.md` exists and is committed (the ignore rule already permits it). - Every token file it names matches `docs/SECRETS_CHECKLIST.md` and a real consumer in the harness. - Full offline suite green.
Author
Member

This was generated by AI during triage.

Triage: ready-for-session + bug

Ruled by agent under ADR 0174 — veto anytime.

Ruling: ready-for-session, not ready-for-agent. The deliverable is a file under .sandcastle/, which is a protected path for this repo: policy_load defaults PROTECTED_PATHS=".sandcastle .forgejo" (no swarm-policy.sh exists here, so the defaults are live), and verify_protected_paths rolls back any worker edit inside them, reds the run, parks the commits on a rescue branch, and posts a :rotating_light:. A swarm worker cannot deliver this ticket — it would fail loudly on the very change the ticket asks for. docs/agents/triage-labels.md names this case directly: every edit to the vendored self-copy is session work.

Why this is a two-way door: it is a label change, and the deliverable is one new documentation file that adds no behaviour and is deletable in one commit. Proven by the protected-path machinery itself (tests/verify-lib-test.sh, tests/protected-paths-lib-test.sh) plus the full offline suite.

Verification — the claim holds, all three legs

Confirmed at 9e2aaf6:

  • .sandcastle/secrets/ exists and is empty (drwx------, no entries) — the slot is reserved and unfilled.
  • .sandcastle/.gitignore carries secrets/* followed by !secrets/README.md, so the file is pre-authorised to be committed; no ignore-rule change is needed.
  • post-issue-ask.sh's env header ends "…(or the bind-mounted .sandcastle/secrets files — see secrets/README.md)" — a dangling pointer in vendored harness text, so every consumer ships the same dead reference.
  • docs/SECRETS_CHECKLIST.md exists and is the authoritative source: it already documents the two delivery paths (.sandcastle/.env carrying CLAUDE_CODE_OAUTH_TOKEN only, because the claude CLI has no file-based flag for it; everything else as read-only files under secrets/, to keep bearer tokens out of docker inspect .Config.Env).

Session Brief

Category: bug (dangling pointer in vendored text; missing per-repo layer artifact)

Summary: Author this repo's own .sandcastle/secrets/README.md, so the pointer vendored into every consumer resolves in the factory's own self-copy.

Current behavior: The secrets slot is reserved by the ignore rule but empty. A reader following post-issue-ask.sh's "see secrets/README.md" in this repo lands on nothing. install-prompt.md step 5 names the file as one of the four vendor deliberately does not deliver, so its absence here is exactly the ADR 0006 residue: self-onboarding ran every subcommand and left a hand-write list.

Desired behavior: The file exists, is committed, and tells a reader — per token file — what it is, which script consumes it, and when it is needed.

Key interfaces:

  • The token-file vocabulary is docs/SECRETS_CHECKLIST.md's table; the README must not invent names or drift from it.
  • Be concrete about which delivery path this consumer actually uses, rather than describing both generically: the factory's own workers read FORGEJO_TOKEN from /run/secrets/ (docker secrets, as preflight-triage.sh and forgejo-lib.sh callers do), while host-side scripts such as rehearsal-report.sh and schedule-backstop.sh read $here/secrets/forgejo_token. Both are live here; say so, and say which script takes which.
  • onboard_verify_creds is the probe that proves these files are real (_vc_read_secret reads <dir>/secrets/<name>, and treats a 0-byte file as its own failure class) — worth naming so a reader knows how to check their work.

Acceptance criteria:

  • .sandcastle/secrets/README.md exists and is committed (the existing !secrets/README.md rule already permits it — do not change .gitignore).
  • Every token file it names appears in docs/SECRETS_CHECKLIST.md and has a real consumer in the harness; no file is documented that nothing reads.
  • For each named file the README states the consuming script(s) and the delivery path this repo actually uses, not a generic description of both.
  • No secret values, and no host-specific absolute paths (blast-radius rule).
  • Full offline suite green: for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done

Out of scope:

  • Changing .sandcastle/.gitignore, or any secrets-handling code.
  • Populating actual token files, or any credential work (one-way door — Ben's, out-of-band, never through a session).
  • Fixing the other three hand-written files install-prompt.md step 5 names; this ticket is scoped to the README.
  • A pin bump. Per CLAUDE.md this is the per-repo identity layer, editable directly under .sandcastle/ with no FACTORY_REF change.
> *This was generated by AI during triage.* ## Triage: `ready-for-session` + `bug` **Ruled by agent under ADR 0174 — veto anytime.** **Ruling:** `ready-for-session`, not `ready-for-agent`. The deliverable is a file **under `.sandcastle/`**, which is a protected path for this repo: `policy_load` defaults `PROTECTED_PATHS=".sandcastle .forgejo"` (no `swarm-policy.sh` exists here, so the defaults are live), and `verify_protected_paths` rolls back any worker edit inside them, reds the run, parks the commits on a rescue branch, and posts a `:rotating_light:`. A swarm worker cannot deliver this ticket — it would fail loudly on the very change the ticket asks for. `docs/agents/triage-labels.md` names this case directly: every edit to the vendored self-copy is session work. **Why this is a two-way door:** it is a label change, and the deliverable is one new documentation file that adds no behaviour and is deletable in one commit. Proven by the protected-path machinery itself (`tests/verify-lib-test.sh`, `tests/protected-paths-lib-test.sh`) plus the full offline suite. ### Verification — the claim holds, all three legs Confirmed at `9e2aaf6`: - `.sandcastle/secrets/` exists and is **empty** (`drwx------`, no entries) — the slot is reserved and unfilled. - `.sandcastle/.gitignore` carries `secrets/*` followed by `!secrets/README.md`, so the file is pre-authorised to be committed; no ignore-rule change is needed. - `post-issue-ask.sh`'s env header ends "…(or the bind-mounted `.sandcastle/secrets` files — see `secrets/README.md`)" — a dangling pointer in **vendored** harness text, so every consumer ships the same dead reference. - `docs/SECRETS_CHECKLIST.md` exists and is the authoritative source: it already documents the two delivery paths (`.sandcastle/.env` carrying `CLAUDE_CODE_OAUTH_TOKEN` only, because the `claude` CLI has no file-based flag for it; everything else as read-only files under `secrets/`, to keep bearer tokens out of `docker inspect .Config.Env`). ## Session Brief **Category:** bug (dangling pointer in vendored text; missing per-repo layer artifact) **Summary:** Author this repo's own `.sandcastle/secrets/README.md`, so the pointer vendored into every consumer resolves in the factory's own self-copy. **Current behavior:** The secrets slot is reserved by the ignore rule but empty. A reader following `post-issue-ask.sh`'s "see `secrets/README.md`" in this repo lands on nothing. `install-prompt.md` step 5 names the file as one of the four `vendor` deliberately does not deliver, so its absence here is exactly the ADR 0006 residue: self-onboarding ran every subcommand and left a hand-write list. **Desired behavior:** The file exists, is committed, and tells a reader — per token file — what it is, which script consumes it, and when it is needed. **Key interfaces:** - The token-file vocabulary is `docs/SECRETS_CHECKLIST.md`'s table; the README must not invent names or drift from it. - Be concrete about **which delivery path this consumer actually uses**, rather than describing both generically: the factory's own workers read `FORGEJO_TOKEN` from `/run/secrets/` (docker secrets, as `preflight-triage.sh` and `forgejo-lib.sh` callers do), while host-side scripts such as `rehearsal-report.sh` and `schedule-backstop.sh` read `$here/secrets/forgejo_token`. Both are live here; say so, and say which script takes which. - `onboard_verify_creds` is the probe that proves these files are real (`_vc_read_secret` reads `<dir>/secrets/<name>`, and treats a 0-byte file as its own failure class) — worth naming so a reader knows how to check their work. **Acceptance criteria:** - [ ] `.sandcastle/secrets/README.md` exists and is committed (the existing `!secrets/README.md` rule already permits it — do not change `.gitignore`). - [ ] Every token file it names appears in `docs/SECRETS_CHECKLIST.md` **and** has a real consumer in the harness; no file is documented that nothing reads. - [ ] For each named file the README states the consuming script(s) and the delivery path this repo actually uses, not a generic description of both. - [ ] No secret values, and no host-specific absolute paths (blast-radius rule). - [ ] Full offline suite green: `for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done` **Out of scope:** - Changing `.sandcastle/.gitignore`, or any secrets-handling code. - Populating actual token files, or any credential work (one-way door — Ben's, out-of-band, never through a session). - Fixing the other three hand-written files `install-prompt.md` step 5 names; this ticket is scoped to the README. - A pin bump. Per CLAUDE.md this is the per-repo identity layer, editable directly under `.sandcastle/` with no `FACTORY_REF` change.
Author
Member

Close report

Landed: 4161e43 on main — sandcastle: author this repo's secrets/README.md — and unblock the ignore rule that forbade it (#76).

What landed

.sandcastle/secrets/README.md (new, committed) — consumer-specific, not
generic, per the ticket's note. It states the two read paths this consumer
actually uses:

  • in the worker sandbox at /run/secrets/<name> — main.mts bind-mounts
    .sandcastle/secrets read-only there; readers: claim-next-task.sh,
    list-ready-tasks.sh, preflight-triage.sh, prompt-render-lib.sh,
    close-report.sh, post-issue-ask.sh, resume-parked-asks.sh,
    ask-human.sh, notify-mattermost.sh;
  • on the host, read in place — schedule-backstop.sh (host cron entry
    point), heal.sh, rehearsal-report.sh.

Three facts a generic readme would have hidden, all recorded:

  • rehearsal-report.sh's $here/secrets/ fallback is live harness code but
    inert here — .sandcastle/E2E_TIER is opt-out, so no drive ever calls
    the reporter in this repo;
  • session-runner.sh has no file fallback at all — it takes
    FORGEJO_TOKEN from its env (falling back to sourcing .sandcastle/.env)
    and dies on ${FORGEJO_TOKEN:?}; populating this directory will not start it;
  • digitalocean_access_token is written here and read by nothing —
    swarm.yml forwards the org secret and provision_write_secrets writes any
    token in the run's env (the file is present on matou-workstation right now),
    but this repo has no doctl-touching skill, so the checklist's condition for
    that row is false. The checklist's lab-DNS row has no analog here either.

Also: how the files arrive (CI — run-swarm.sh → provision_store_dirs +
provision_write_secrets, 0700/0600, re-materialized every run so rotations
are free; the triage/healer/resume-asks jobs don't sandbox their sessions
and use the job env directly), the stdin-only manual recipe, and the proof
command (onboard.sh verify-creds .sandcastle, which already skips
README.md by name).

The find — the ticket's premise was false

"the ignore rule already permits it"

It did not. The repo-root .gitignore line 2 is an unanchored secrets/,
which excludes .sandcastle/secrets/ as a directory — and git cannot
re-include a file whose parent directory is excluded, so
.sandcastle/.gitignore's committed !secrets/README.md never got a chance to
fire. Left alone, this ticket's deliverable would have been authored and then
silently untracked, and the acceptance ("exists and is committed") could not
have been met.

Red before green, on the authored file:

$ git check-ignore -v .sandcastle/secrets/README.md
.gitignore:2:secrets/	.sandcastle/secrets/README.md      # ignored — RED

Fixed by re-including the directory only (!.sandcastle/secrets/), leaving
the nested secrets/* as the closest — and therefore winning — rule for every
file inside it. Green, per real token name:

forgejo_token                .sandcastle/.gitignore:4:secrets/*
mattermost_bot_token         .sandcastle/.gitignore:4:secrets/*
digitalocean_access_token    .sandcastle/.gitignore:4:secrets/*
README.md                    .sandcastle/.gitignore:5:!secrets/README.md   (NOT ignored)
.sandcastle/.env             .sandcastle/.gitignore:1:.env
secrets/probe (root-level)   .gitignore:2:secrets/                          (still blanket-ignored)

git status after staging showed exactly one added path under secrets/ —
the README — and no token file. GOTCHAS 26 records the class for the next
consumer that hits "my committed secrets readme will not stage".

Acceptance

  • .sandcastle/secrets/README.md exists and is committed — 4161e43, and
    the ignore rule now genuinely permits it (proven above, not assumed).
  • Every token file it names matches docs/SECRETS_CHECKLIST.md and a real
    consumer in the harness — forgejo_token and mattermost_bot_token are
    named with their live readers; digitalocean_access_token is named in
    its own section as written-here-read-by-nothing (its real consumer is
    provision_write_secrets, the writer), which is the honest answer for
    this repo rather than the checklist's generic condition.
  • Full offline suite green — 69 test files, 0 failures.
  • STATUS.md updated in the same commit (header lead, Consumers row,
    milestone log).

Rulings

Ruled by agent under ADR 0174 — veto anytime. Fixing the repo-root
.gitignore was not in the ticket's stated scope, but the acceptance criterion
("exists and is committed") is unreachable without it, and the ticket's
own premise about the ignore rule is what turned out to be wrong. Two-way door:
a one-line ignore change in this repo's own (never-vendored) root file,
revertible by a commit, proven by git check-ignore -v on every affected path
including the negative cases. No harness file under .sandcastle/ outside the
per-repo layer was touched, so no pin bump is needed and no consumer is
affected.

Ruled by agent under ADR 0174 — veto anytime. Naming
digitalocean_access_token in a "read by nothing here" section rather than
omitting it: the file is physically present in this consumer's secrets/
directory on matou-workstation, so a reader who finds it and no mention of it
in the readme learns nothing. Documenting it as inert is more useful than
silence and does not contradict the acceptance. Two-way door: prose.

Follow-up filed

#88 — the offline suite leaves fleet-tui/__pycache__/ untracked in the
checkout (#58's litter class, one level in). Noticed while running the suite
for this ticket; out of scope here, filed rather than fixed.

Not done / residue

Nothing. No human residue: no credential was read, written or echoed, and no
one-way door was touched.

## Close report **Landed:** `4161e43` on `main` — `sandcastle: author this repo's secrets/README.md — and unblock the ignore rule that forbade it (#76)`. ### What landed **`.sandcastle/secrets/README.md`** (new, committed) — consumer-specific, not generic, per the ticket's note. It states the two read paths **this** consumer actually uses: - **in the worker sandbox at `/run/secrets/<name>`** — `main.mts` bind-mounts `.sandcastle/secrets` read-only there; readers: `claim-next-task.sh`, `list-ready-tasks.sh`, `preflight-triage.sh`, `prompt-render-lib.sh`, `close-report.sh`, `post-issue-ask.sh`, `resume-parked-asks.sh`, `ask-human.sh`, `notify-mattermost.sh`; - **on the host, read in place** — `schedule-backstop.sh` (host cron entry point), `heal.sh`, `rehearsal-report.sh`. Three facts a generic readme would have hidden, all recorded: - `rehearsal-report.sh`'s `$here/secrets/` fallback is live harness code but **inert here** — `.sandcastle/E2E_TIER` is `opt-out`, so no drive ever calls the reporter in this repo; - **`session-runner.sh` has no file fallback at all** — it takes `FORGEJO_TOKEN` from its env (falling back to sourcing `.sandcastle/.env`) and dies on `${FORGEJO_TOKEN:?}`; populating this directory will not start it; - **`digitalocean_access_token` is written here and read by nothing** — `swarm.yml` forwards the org secret and `provision_write_secrets` writes any token in the run's env (the file is present on matou-workstation right now), but this repo has no `doctl`-touching skill, so the checklist's condition for that row is false. The checklist's lab-DNS row has no analog here either. Also: how the files arrive (CI — `run-swarm.sh` → `provision_store_dirs` + `provision_write_secrets`, 0700/0600, re-materialized every run so rotations are free; the `triage`/`healer`/`resume-asks` jobs don't sandbox their sessions and use the job env directly), the stdin-only manual recipe, and the proof command (`onboard.sh verify-creds .sandcastle`, which already skips `README.md` by name). ### The find — the ticket's premise was false > "the ignore rule already permits it" It did not. The **repo-root** `.gitignore` line 2 is an unanchored `secrets/`, which excludes `.sandcastle/secrets/` as a **directory** — and git cannot re-include a file whose parent directory is excluded, so `.sandcastle/.gitignore`'s committed `!secrets/README.md` never got a chance to fire. Left alone, this ticket's deliverable would have been authored and then silently untracked, and the acceptance ("exists and is committed") could not have been met. Red before green, on the authored file: ``` $ git check-ignore -v .sandcastle/secrets/README.md .gitignore:2:secrets/ .sandcastle/secrets/README.md # ignored — RED ``` Fixed by re-including the **directory only** (`!.sandcastle/secrets/`), leaving the nested `secrets/*` as the closest — and therefore winning — rule for every file inside it. Green, per real token name: ``` forgejo_token .sandcastle/.gitignore:4:secrets/* mattermost_bot_token .sandcastle/.gitignore:4:secrets/* digitalocean_access_token .sandcastle/.gitignore:4:secrets/* README.md .sandcastle/.gitignore:5:!secrets/README.md (NOT ignored) .sandcastle/.env .sandcastle/.gitignore:1:.env secrets/probe (root-level) .gitignore:2:secrets/ (still blanket-ignored) ``` `git status` after staging showed exactly one added path under `secrets/` — the README — and no token file. **GOTCHAS 26** records the class for the next consumer that hits "my committed secrets readme will not stage". ### Acceptance - [x] `.sandcastle/secrets/README.md` exists and is committed — `4161e43`, and the ignore rule now genuinely permits it (proven above, not assumed). - [x] Every token file it names matches `docs/SECRETS_CHECKLIST.md` and a real consumer in the harness — `forgejo_token` and `mattermost_bot_token` are named with their live readers; `digitalocean_access_token` is named in its own section as written-here-read-by-nothing (its real consumer is `provision_write_secrets`, the writer), which is the honest answer for this repo rather than the checklist's generic condition. - [x] Full offline suite green — 69 test files, 0 failures. - [x] `STATUS.md` updated in the same commit (header lead, Consumers row, milestone log). ### Rulings **Ruled by agent under ADR 0174 — veto anytime.** Fixing the repo-root `.gitignore` was not in the ticket's stated scope, but the acceptance criterion ("exists and is **committed**") is unreachable without it, and the ticket's own premise about the ignore rule is what turned out to be wrong. Two-way door: a one-line ignore change in this repo's own (never-vendored) root file, revertible by a commit, proven by `git check-ignore -v` on every affected path including the negative cases. No harness file under `.sandcastle/` outside the per-repo layer was touched, so no pin bump is needed and no consumer is affected. **Ruled by agent under ADR 0174 — veto anytime.** Naming `digitalocean_access_token` in a "read by nothing here" section rather than omitting it: the file is physically present in this consumer's `secrets/` directory on matou-workstation, so a reader who finds it and no mention of it in the readme learns nothing. Documenting it as inert is more useful than silence and does not contradict the acceptance. Two-way door: prose. ### Follow-up filed **#88** — the offline suite leaves `fleet-tui/__pycache__/` untracked in the checkout (#58's litter class, one level in). Noticed while running the suite for this ticket; out of scope here, filed rather than fixed. ### Not done / residue Nothing. No human residue: no credential was read, written or echoed, and no one-way door was touched.
matou-build-agent 2026-08-25 21:59:49 +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#76
No description provided.