token-sync.yml should write the host's factory-owned env file, not rehearsal-env.sh (dev-factory #37) #719

Closed
opened 2026-08-24 00:14:40 +00:00 by matou-build-agent · 3 comments

Filed from Matou/dev-factory (pull-only, ADR 0001 — no push from there), as a
consequence of dev-factory #37: matou-workstation's host env file has been
split into a factory-owned shared file and a per-repo product file.

What changed on the host (already live, 2026-08-24)

  • /home/dev/swarm/host-env.sh — the shared env every factory-managed cron
    line sources (PATH, FORGEJO_TOKEN, CLAUDE_CODE_OAUTH_TOKEN/_B, the
    MATTERMOST_* trio). This is what the host registry's env directive names.
  • /home/dev/swarm/idss-env.sh — this repo's own host env
    (DIGITALOCEAN_ACCESS_TOKEN, IDSS_BROKER_URL, IDSS_PAYLOAD_DIR,
    REHEARSAL_DRIVE_ISSUE, REHEARSAL_DRIVE_TARGET,
    ELECTRON_OVERRIDE_DIST_PATH), sourced after the shared one. The registry
    gained a repo-env <owner/repo> <file> directive for exactly this, so idss's
    session-runner tick sources both layers and no other repo's tick sees these
    variables. The rehearsal-executor cron line now reads
    . /home/dev/swarm/host-env.sh && . /home/dev/swarm/idss-env.sh && ….
  • /home/dev/swarm/rehearsal-env.sh is no longer a file: it is a symlink to
    host-env.sh, kept purely as a compatibility shim for this repo's
    token-sync.yml.

What this repo owns

  1. .forgejo/workflows/token-sync.yml hard-codes
    env_file: /home/dev/swarm/rehearsal-env.sh (and
    /home/swarm/swarm/rehearsal-env.sh for elitebook-03). It writes the org
    Claude + Mattermost secrets — all of them shared host state — so it should
    name the host's factory-owned env file directly. Verified before the cutover
    that its exact write path (open(f, "w").write(s)) writes through a
    symlink, preserving the link, the file's comments and mode 600, so token
    rotation keeps working unchanged until this lands. When it does, the symlink
    should be deleted (rm /home/dev/swarm/rehearsal-env.sh).
  2. elitebook-03 is untouched — no door from the machine this was done on.
    Its /home/swarm/swarm/rehearsal-env.sh is still the single product-flavoured
    file, and its enrolment (dev-factory #6) is still owed.
  3. Comments/docs naming the old path: scripts/rehearsal-executor.sh:16's
    example cron line, scripts/rehearsal-cycle.sh:47/87/159/180,
    docs/PROCESS.md, docs/GOTCHAS.md.

Nothing here is urgent: every live loop on matou-workstation was re-run under
a cron-like env -i /bin/sh after the cutover and carries exactly the variables
it did before.

Filed from `Matou/dev-factory` (pull-only, ADR 0001 — no push from there), as a consequence of dev-factory **#37**: `matou-workstation`'s host env file has been split into a factory-owned shared file and a per-repo product file. ## What changed on the host (already live, 2026-08-24) - `/home/dev/swarm/host-env.sh` — the **shared** env every factory-managed cron line sources (`PATH`, `FORGEJO_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN`/`_B`, the `MATTERMOST_*` trio). This is what the host registry's `env` directive names. - `/home/dev/swarm/idss-env.sh` — **this repo's own** host env (`DIGITALOCEAN_ACCESS_TOKEN`, `IDSS_BROKER_URL`, `IDSS_PAYLOAD_DIR`, `REHEARSAL_DRIVE_ISSUE`, `REHEARSAL_DRIVE_TARGET`, `ELECTRON_OVERRIDE_DIST_PATH`), sourced **after** the shared one. The registry gained a `repo-env <owner/repo> <file>` directive for exactly this, so idss's session-runner tick sources both layers and no other repo's tick sees these variables. The rehearsal-executor cron line now reads `. /home/dev/swarm/host-env.sh && . /home/dev/swarm/idss-env.sh && …`. - `/home/dev/swarm/rehearsal-env.sh` is **no longer a file**: it is a symlink to `host-env.sh`, kept purely as a compatibility shim for this repo's `token-sync.yml`. ## What this repo owns 1. **`.forgejo/workflows/token-sync.yml`** hard-codes `env_file: /home/dev/swarm/rehearsal-env.sh` (and `/home/swarm/swarm/rehearsal-env.sh` for `elitebook-03`). It writes the org Claude + Mattermost secrets — all of them shared host state — so it should name the host's factory-owned env file directly. Verified before the cutover that its exact write path (`open(f, "w").write(s)`) writes *through* a symlink, preserving the link, the file's comments and mode 600, so token rotation keeps working unchanged until this lands. When it does, the symlink should be deleted (`rm /home/dev/swarm/rehearsal-env.sh`). 2. **`elitebook-03` is untouched** — no door from the machine this was done on. Its `/home/swarm/swarm/rehearsal-env.sh` is still the single product-flavoured file, and its enrolment (dev-factory #6) is still owed. 3. Comments/docs naming the old path: `scripts/rehearsal-executor.sh:16`'s example cron line, `scripts/rehearsal-cycle.sh:47/87/159/180`, `docs/PROCESS.md`, `docs/GOTCHAS.md`. Nothing here is urgent: every live loop on `matou-workstation` was re-run under a cron-like `env -i /bin/sh` after the cutover and carries exactly the variables it did before.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Ruling: enhancement + ready-for-session (not ready-for-agent).

Why this is a two-way door: the repo-side edits (token-sync.yml's
env_file for the matou-workstation leg, plus the stale-path comments in
scripts/rehearsal-executor.sh, scripts/rehearsal-cycle.sh,
docs/PROCESS.md, docs/GOTCHAS.md) are ordinary revertible commits. But the
issue's own completion step — rm /home/dev/swarm/rehearsal-env.sh on the
live matou-workstation cron host, done only after confirming the new
workflow leg has written a correct host-env.sh — needs host standing a
sandboxed swarm worker doesn't have (no door to that machine). That's exactly
the "host credentials, live-infrastructure operations" class ready-for-session
exists for (docs/agents/triage-labels.md), not a ready-for-human one-way
door: there's no personal-credential, security-widening, trust-surface-accept,
data-destruction, or physical-hardware element here, and the filer already
did the hard part (verified the write-through-symlink behavior pre-cutover).

What proves it: the compat symlink means nothing is broken today (filer's
own "nothing here is urgent" note); a session can land the workflow-file
commit, dispatch token-sync once to confirm the new leg writes
host-env.sh with the right fingerprint, then remove the old symlink —
each step independently revertible (re-add the symlink, revert the commit) and
each verifiable by the workflow's own sha256-fingerprint output.

Agent Brief (for the session that picks this up)

Category: enhancement
Summary: Point token-sync.yml's matou-workstation leg at the
host's factory-owned shared env file instead of the compatibility symlink,
update stale-path references, then retire the symlink on the host.

Current behavior: token-sync.yml writes the org Claude/Mattermost
tokens into /home/dev/swarm/rehearsal-env.sh on matou-workstation, which
is now only a compatibility symlink to the factory-owned
/home/dev/swarm/host-env.sh (per Matou/dev-factory #37). The
elitebook-03 leg is unaffected — that host hasn't been migrated and its
rehearsal-env.sh is still the one real file.

Desired behavior: The matou-workstation matrix entry's env_file
names /home/dev/swarm/host-env.sh directly. Comments/docs referencing the
old symlink path as if it were the canonical file
(scripts/rehearsal-executor.sh's example cron line,
scripts/rehearsal-cycle.sh's comments, docs/PROCESS.md,
docs/GOTCHAS.md) are updated to name the real file. Once a live
token-sync dispatch confirms the new leg writes the right token
fingerprints into host-env.sh, the now-unused
/home/dev/swarm/rehearsal-env.sh symlink is deleted on the host.

Acceptance criteria:

  • token-sync.yml's matou-workstation leg writes to
    /home/dev/swarm/host-env.sh; the elitebook-03 leg is untouched
  • The four called-out doc/comment references to the old path are updated
    (or explicitly left, with a one-line reason, if still accurate)
  • A manual workflow_dispatch of token-sync on matou-workstation
    confirms (via its existing fingerprint-print step) the new file
    receives the current org token
  • /home/dev/swarm/rehearsal-env.sh is removed from matou-workstation
    only after that confirmation

Out of scope:

  • elitebook-03 (its own migration is dev-factory #6, tracked separately)
  • Any further host-env layering changes beyond what dev-factory #37 already
    shipped
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime** **Ruling:** `enhancement` + `ready-for-session` (not `ready-for-agent`). **Why this is a two-way door:** the repo-side edits (`token-sync.yml`'s `env_file` for the `matou-workstation` leg, plus the stale-path comments in `scripts/rehearsal-executor.sh`, `scripts/rehearsal-cycle.sh`, `docs/PROCESS.md`, `docs/GOTCHAS.md`) are ordinary revertible commits. But the issue's own completion step — `rm /home/dev/swarm/rehearsal-env.sh` on the live `matou-workstation` cron host, done only *after* confirming the new workflow leg has written a correct `host-env.sh` — needs host standing a sandboxed swarm worker doesn't have (no door to that machine). That's exactly the "host credentials, live-infrastructure operations" class `ready-for-session` exists for (`docs/agents/triage-labels.md`), not a `ready-for-human` one-way door: there's no personal-credential, security-widening, trust-surface-accept, data-destruction, or physical-hardware element here, and the filer already did the hard part (verified the write-through-symlink behavior pre-cutover). **What proves it:** the compat symlink means nothing is broken today (filer's own "nothing here is urgent" note); a session can land the workflow-file commit, dispatch `token-sync` once to confirm the new leg writes `host-env.sh` with the right fingerprint, *then* remove the old symlink — each step independently revertible (re-add the symlink, revert the commit) and each verifiable by the workflow's own sha256-fingerprint output. ## Agent Brief (for the session that picks this up) **Category:** enhancement **Summary:** Point `token-sync.yml`'s `matou-workstation` leg at the host's factory-owned shared env file instead of the compatibility symlink, update stale-path references, then retire the symlink on the host. **Current behavior:** `token-sync.yml` writes the org Claude/Mattermost tokens into `/home/dev/swarm/rehearsal-env.sh` on `matou-workstation`, which is now only a compatibility symlink to the factory-owned `/home/dev/swarm/host-env.sh` (per `Matou/dev-factory` #37). The `elitebook-03` leg is unaffected — that host hasn't been migrated and its `rehearsal-env.sh` is still the one real file. **Desired behavior:** The `matou-workstation` matrix entry's `env_file` names `/home/dev/swarm/host-env.sh` directly. Comments/docs referencing the old symlink path as if it were the canonical file (`scripts/rehearsal-executor.sh`'s example cron line, `scripts/rehearsal-cycle.sh`'s comments, `docs/PROCESS.md`, `docs/GOTCHAS.md`) are updated to name the real file. Once a live `token-sync` dispatch confirms the new leg writes the right token fingerprints into `host-env.sh`, the now-unused `/home/dev/swarm/rehearsal-env.sh` symlink is deleted on the host. **Acceptance criteria:** - [ ] `token-sync.yml`'s `matou-workstation` leg writes to `/home/dev/swarm/host-env.sh`; the `elitebook-03` leg is untouched - [ ] The four called-out doc/comment references to the old path are updated (or explicitly left, with a one-line reason, if still accurate) - [ ] A manual `workflow_dispatch` of `token-sync` on `matou-workstation` confirms (via its existing fingerprint-print step) the new file receives the current org token - [ ] `/home/dev/swarm/rehearsal-env.sh` is removed from `matou-workstation` only after that confirmation **Out of scope:** - `elitebook-03` (its own migration is dev-factory #6, tracked separately) - Any further host-env layering changes beyond what dev-factory #37 already shipped
Author
Member

Ruled by agent under ADR 0174 — veto anytime

Ruling 1 — the matou-workstation leg names the SHARED file, not the product one.
Everything token-sync writes (the org Claude primary/standby, the MATTERMOST_*
trio) is shared host state consumed by every factory-managed cron line on the
box — dev-factory's session-runner tick, the backstop, idss's own lines. So the
leg names /home/dev/swarm/host-env.sh (the registry's env directive), never
/home/dev/swarm/idss-env.sh (the repo-env Matou/idss product file). Writing
the tokens into the product file would have been the tidy-looking wrong answer:
idss's own crons would keep working and every other repo's line on the host would
silently lose its Claude token.

Why it is a two-way door: a one-line matrix value in a revertible commit, on
a host file that is backed up in place before the write, with the old value one
git revert away. No personal credential (the org secret is the source of truth
and is unchanged), no posture widening (the file keeps mode 600, same owner, same
key set), no member-facing trust accept, no spend, nothing destroyed.

What proves it: a new offline guard, scripts/tests/token-sync-env-file-test.sh,
red before / green after — it reds on the removed-symlink path and on the
product-file path, and also if anything under scripts/, .forgejo/ or the two
runbook docs re-introduces the literal /home/dev/swarm/rehearsal-env.sh. Plus
the live dispatch below.

Ruling 2 — elitebook-03 is left exactly as it was. Its leg still names
/home/swarm/swarm/rehearsal-env.sh. That host is not factory-enrolled yet
(dev-factory #6 still owed) and there is no door to it from matou-workstation,
so its single un-split file is still the one real file it has. The new guard pins
this deliberately, so a well-meaning sweep cannot "finish the job" and break the
second executor's only token source. Its leg went success on this dispatch, so
that host is unaffected and still syncing.

Ruling 3 — the factory-vendored .sandcastle/ copies are fixed UPSTREAM, not
here.
session-runner.sh's example crontab and rehearsal-report.sh's
auth-refusal alarm text both still name the old path, but both are vendored
byte-for-byte from Matou/dev-factory (.sandcastle/FACTORY_MANIFEST, enforced
by check-harness-drift.sh — editing them here reds the drift alarm). Filed as
Matou/dev-factory#44 with the exact lines and the live crontab line to replace
them with. The guard's scope excludes .sandcastle/ for exactly this reason, and
says so in a comment.

**Ruled by agent under ADR 0174 — veto anytime** **Ruling 1 — the `matou-workstation` leg names the SHARED file, not the product one.** Everything `token-sync` writes (the org Claude primary/standby, the `MATTERMOST_*` trio) is shared host state consumed by *every* factory-managed cron line on the box — dev-factory's session-runner tick, the backstop, idss's own lines. So the leg names `/home/dev/swarm/host-env.sh` (the registry's `env` directive), never `/home/dev/swarm/idss-env.sh` (the `repo-env Matou/idss` product file). Writing the tokens into the product file would have been the tidy-looking wrong answer: idss's own crons would keep working and every other repo's line on the host would silently lose its Claude token. **Why it is a two-way door:** a one-line matrix value in a revertible commit, on a host file that is backed up in place before the write, with the old value one `git revert` away. No personal credential (the org secret is the source of truth and is unchanged), no posture widening (the file keeps mode 600, same owner, same key set), no member-facing trust accept, no spend, nothing destroyed. **What proves it:** a new offline guard, `scripts/tests/token-sync-env-file-test.sh`, red before / green after — it reds on the removed-symlink path *and* on the product-file path, and also if anything under `scripts/`, `.forgejo/` or the two runbook docs re-introduces the literal `/home/dev/swarm/rehearsal-env.sh`. Plus the live dispatch below. **Ruling 2 — `elitebook-03` is left exactly as it was.** Its leg still names `/home/swarm/swarm/rehearsal-env.sh`. That host is not factory-enrolled yet (dev-factory #6 still owed) and there is no door to it from `matou-workstation`, so its single un-split file is still the one real file it has. The new guard pins this deliberately, so a well-meaning sweep cannot "finish the job" and break the second executor's only token source. Its leg went `success` on this dispatch, so that host is unaffected and still syncing. **Ruling 3 — the factory-vendored `.sandcastle/` copies are fixed UPSTREAM, not here.** `session-runner.sh`'s example crontab and `rehearsal-report.sh`'s auth-refusal alarm text both still name the old path, but both are vendored byte-for-byte from `Matou/dev-factory` (`.sandcastle/FACTORY_MANIFEST`, enforced by `check-harness-drift.sh` — editing them here reds the drift alarm). Filed as **Matou/dev-factory#44** with the exact lines and the live crontab line to replace them with. The guard's scope excludes `.sandcastle/` for exactly this reason, and says so in a comment.
Author
Member

Close report — #719

Landed: 020bd30e (repo side) + 28d0dff9 (live cutover + GOTCHAS #73).

Acceptance criteria

  • token-sync.yml's matou-workstation leg writes /home/dev/swarm/host-env.sh; the elitebook-03 leg is untouched. Its leg still names /home/swarm/swarm/rehearsal-env.sh and went success on both dispatches — that host is not factory-enrolled yet (dev-factory #6), so its single un-split file is still the one real file it has.
  • The called-out doc/comment references are updated. scripts/rehearsal-executor.sh (its example cron line now shows the split source, matching the live crontab), scripts/rehearsal-cycle.sh (all four sites), docs/PROCESS.md ("Adding an executor host" step 2 now describes both layers and the registry directives that name them; step 5 says name the SHARED file in the matrix), docs/GOTCHAS.md #53 (its cross-host verification command now reads both layouts — idss-env.sh and rehearsal-env.sh, grep -h skipping the absent one — and picks up REHEARSAL_DRIVE_QUEUE, which did not exist when it was written). Two more the filing did not list but which named the old path and would have gone stale: scripts/lib/gateway-image-rebuild-lib.sh and scripts/lib/rehearsal-queue-lib.sh.
  • A manual workflow_dispatch confirms the new file receives the current org token. Twice — see below.

The live cutover, in the ticket's own order

step result
backup host-env.sh env-backups/host-env.sh.bak-719-20260824T010840Z
dispatch 1 — run 19310, leg sync (/home/dev/swarm/host-env.sh, matou-workstation) success. The leg name carries the matrix value, so it names the path it wrote. File came back byte-identical to the backup: all six value fingerprints unchanged, mode 600, owner dev:dev, all 20 comment lines intact
rm /home/dev/swarm/rehearsal-env.sh gone
dispatch 2 — run 19318 success with the symlink already removed — same six fingerprints, and host-env.sh's new #719 comment survived the workflow's rewrite. This is the decisive one: the writer no longer needs the shim
elitebook-03 legs 19303 / 19319 success both times, untouched
cron-like env -i /bin/sh re-source of the real crontab lines idss's line: variable set identical to the pre-removal baseline (15 names, clean diff). dev-factory's line: shared tokens present, idss's product variables correctly absent

Fingerprints are sha256 | cut -c1-16 of each value, never the value; they were recorded before dispatch 1 and re-checked after each — the org secrets already matched what was on the box, which is why the first write was a no-op byte-wise.

Residue found and cleared (not in the filing)

Four host-local one-off helper scripts still sourced the symlink directly — confirm-phase2-verify.sh, confirm-phase3-widened.sh, phase2-prove-658.sh, phase2-reconfirm.sh. They were already half-broken by the #37 split before this ticket: the shim resolved to the shared layer alone, so a re-run would have got no DIGITALOCEAN_ACCESS_TOKEN and no REHEARSAL_DRIVE_*. All four now source both layers, each backed up in place. Nothing else on the host referenced the name — zero crontab hits, no systemd unit.

Guarded, so neither mistake is silent

New scripts/tests/token-sync-env-file-test.sh (red before green — the red was env_file is '/home/dev/swarm/rehearsal-env.sh', want '/home/dev/swarm/host-env.sh'). It reds on both ways to get this wrong: re-pointing the leg at the removed symlink (the leg then fails its own [ -w "$f" ] guard, no token lands, the host limit-parks on its first reporter call — #659's 4-day phase-3 stall), and "tidying" it into the repo's repo-env product file (every other factory-managed line on the host silently loses its Claude token). It also pins elitebook-03's path so a well-meaning sweep cannot break the second executor's only token source, and reds if anything under scripts/, .forgejo/ or the two runbook docs re-introduces the literal old path. GOTCHAS #73 records the hazard in prose for whoever edits a host registry next.

Left open, deliberately, and routed

.sandcastle/session-runner.sh (its example crontab) and .sandcastle/rehearsal-report.sh (the auth-refusal alarm text an operator reads during an incident to find the token source) both still name the old path. They are vendored byte-for-byte from Matou/dev-factory (FACTORY_MANIFEST, enforced by check-harness-drift.sh — editing them here reds the drift alarm), so the fix belongs upstream: filed as Matou/dev-factory#44 with the exact lines and the live crontab line to replace them with. The new guard's scope excludes .sandcastle/ for exactly this reason and says so in a comment. Unrelated but noted while there: FACTORY_REF is 32 commits behind dev-factory main (a NOTE, not a failure) — bumping it is the natural moment to pull #44's fix in.

Green at close: token-sync-env-file 4/4, all 14 scripts/tests/*, check-harness-drift OK, .sandcastle session-runner-test 10 groups and rehearsal-report-test 32 cases.

Ruled by agent under ADR 0174 — veto anytime. Two-way doors throughout: the host file was backed up before every write and the symlink is one ln -s host-env.sh rehearsal-env.sh from restored; the org secret is unchanged and still the source of truth; mode, owner and key set are unchanged, so nothing was widened; no personal credential, no member-facing trust accept, no spend, nothing destroyed.

## Close report — #719 **Landed:** `020bd30e` (repo side) + `28d0dff9` (live cutover + GOTCHAS #73). ### Acceptance criteria - [x] **`token-sync.yml`'s `matou-workstation` leg writes `/home/dev/swarm/host-env.sh`; the `elitebook-03` leg is untouched.** Its leg still names `/home/swarm/swarm/rehearsal-env.sh` and went `success` on both dispatches — that host is not factory-enrolled yet (dev-factory #6), so its single un-split file is still the one real file it has. - [x] **The called-out doc/comment references are updated.** `scripts/rehearsal-executor.sh` (its example cron line now shows the split source, matching the live crontab), `scripts/rehearsal-cycle.sh` (all four sites), `docs/PROCESS.md` ("Adding an executor host" step 2 now describes both layers and the registry directives that name them; step 5 says name the SHARED file in the matrix), `docs/GOTCHAS.md` #53 (its cross-host verification command now reads **both** layouts — `idss-env.sh` and `rehearsal-env.sh`, `grep -h` skipping the absent one — and picks up `REHEARSAL_DRIVE_QUEUE`, which did not exist when it was written). Two more the filing did not list but which named the old path and would have gone stale: `scripts/lib/gateway-image-rebuild-lib.sh` and `scripts/lib/rehearsal-queue-lib.sh`. - [x] **A manual `workflow_dispatch` confirms the new file receives the current org token.** Twice — see below. ### The live cutover, in the ticket's own order | step | result | |---|---| | backup `host-env.sh` | `env-backups/host-env.sh.bak-719-20260824T010840Z` | | dispatch 1 — run `19310`, leg `sync (/home/dev/swarm/host-env.sh, matou-workstation)` | `success`. The leg **name** carries the matrix value, so it names the path it wrote. File came back **byte-identical** to the backup: all six value fingerprints unchanged, mode `600`, owner `dev:dev`, all 20 comment lines intact | | `rm /home/dev/swarm/rehearsal-env.sh` | gone | | dispatch 2 — run `19318` | `success` **with the symlink already removed** — same six fingerprints, and `host-env.sh`'s new #719 comment survived the workflow's rewrite. This is the decisive one: the writer no longer needs the shim | | elitebook-03 legs `19303` / `19319` | `success` both times, untouched | | cron-like `env -i /bin/sh` re-source of the **real** crontab lines | idss's line: variable set **identical** to the pre-removal baseline (15 names, clean diff). dev-factory's line: shared tokens present, idss's product variables correctly absent | Fingerprints are `sha256 | cut -c1-16` of each value, never the value; they were recorded before dispatch 1 and re-checked after each — the org secrets already matched what was on the box, which is why the first write was a no-op byte-wise. ### Residue found and cleared (not in the filing) Four **host-local** one-off helper scripts still sourced the symlink directly — `confirm-phase2-verify.sh`, `confirm-phase3-widened.sh`, `phase2-prove-658.sh`, `phase2-reconfirm.sh`. They were **already half-broken** by the #37 split before this ticket: the shim resolved to the shared layer alone, so a re-run would have got no `DIGITALOCEAN_ACCESS_TOKEN` and no `REHEARSAL_DRIVE_*`. All four now source both layers, each backed up in place. Nothing else on the host referenced the name — zero crontab hits, no systemd unit. ### Guarded, so neither mistake is silent New `scripts/tests/token-sync-env-file-test.sh` (red before green — the red was `env_file is '/home/dev/swarm/rehearsal-env.sh', want '/home/dev/swarm/host-env.sh'`). It reds on **both** ways to get this wrong: re-pointing the leg at the removed symlink (the leg then fails its own `[ -w "$f" ]` guard, no token lands, the host limit-parks on its first reporter call — #659's 4-day phase-3 stall), and "tidying" it into the repo's `repo-env` product file (every *other* factory-managed line on the host silently loses its Claude token). It also pins elitebook-03's path so a well-meaning sweep cannot break the second executor's only token source, and reds if anything under `scripts/`, `.forgejo/` or the two runbook docs re-introduces the literal old path. **GOTCHAS #73** records the hazard in prose for whoever edits a host registry next. ### Left open, deliberately, and routed `.sandcastle/session-runner.sh` (its example crontab) and `.sandcastle/rehearsal-report.sh` (the auth-refusal alarm text an operator reads *during an incident* to find the token source) both still name the old path. They are vendored **byte-for-byte** from `Matou/dev-factory` (`FACTORY_MANIFEST`, enforced by `check-harness-drift.sh` — editing them here reds the drift alarm), so the fix belongs upstream: filed as **Matou/dev-factory#44** with the exact lines and the live crontab line to replace them with. The new guard's scope excludes `.sandcastle/` for exactly this reason and says so in a comment. Unrelated but noted while there: `FACTORY_REF` is 32 commits behind dev-factory `main` (a NOTE, not a failure) — bumping it is the natural moment to pull #44's fix in. Green at close: `token-sync-env-file` 4/4, all 14 `scripts/tests/*`, `check-harness-drift` OK, `.sandcastle` `session-runner-test` 10 groups and `rehearsal-report-test` 32 cases. Ruled by agent under ADR 0174 — veto anytime. Two-way doors throughout: the host file was backed up before every write and the symlink is one `ln -s host-env.sh rehearsal-env.sh` from restored; the org secret is unchanged and still the source of truth; mode, owner and key set are unchanged, so nothing was widened; no personal credential, no member-facing trust accept, no spend, nothing destroyed.
matou-build-agent 2026-08-24 01:21:29 +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/idss#719
No description provided.