CI red on main: vendored rehearsal-report.sh drifted - bdb42ff6’s token-leak fix must land in dev-factory (which still leaks) and ride back on a FACTORY_REF bump #1683

Closed
opened 2026-09-21 04:37:05 +00:00 by matou-build-agent · 1 comment

What is red

ci.yml stage "Factory core: vendored .sandcastle files match FACTORY_REF (#571/#602)" fails on every push to main since bdb42ff6:

DRIFT: .sandcastle/rehearsal-report.sh was edited directly here
DRIFT: .sandcastle/tests/rehearsal-report-test.sh was edited directly here
check-harness-drift: FAILED - vendored factory copies drifted from
  https://git.matou.nz/Matou/dev-factory.git@414952838e0862c61ba3c1c983e95b73aa9e1a89

Run https://git.matou.nz/Matou/idss/actions/runs/28940 (healer sig 60539fe3c068). Reproduced here: bash .sandcastle/check-harness-drift.sh at bdb42ff6 names exactly those two files and nothing else.

Cause - not a bad fix, a fix landed on the wrong side

bdb42ff6 (jamin, 2026-09-20) is a correct and urgent secret-leak fix: claude_auth_announce's ${tok:+${tok:0:14}...}${tok:-EMPTY} expanded to the whole Claude OAuth token and posted it to the drive ticket, Mattermost and the executor log (GOTCHAS #303). It must not be reverted.

But both files it touches are Matou/dev-factory-OWNED and listed in .sandcastle/FACTORY_MANIFEST, so the drift gate reds by design - this repo pulls the factory core at a pinned ref (ADR 0180 / #571) and a local edit to a vendored file is exactly what the gate exists to catch. GOTCHAS #228 already records the same rule for this same file: a rehearsal-report.sh fix "must land upstream in the factory and be re-vendored (drift gate) ... NOT applied in this repo directly".

dev-factory's main still carries the leaking line (rehearsal-report.sh:200, verbatim ${tok:+${tok:0:14}...}${tok:-EMPTY}), so every other consumer repo still leaks its token on an auth-failure alert. That is the larger half of this ticket.

Ask

  1. Land bdb42ff6's two-file change upstream in Matou/dev-factory (rehearsal-report.sh + tests/rehearsal-report-test.sh), via the factory's normal issue/PR flow.
  2. Bump .sandcastle/FACTORY_REF here and re-vendor (onboard.sh vendor), which un-reds the seam.
  3. Sanity-check the other consumer repos pick the new pin up.

Why a session, not a swarm worker

  • Protected .sandcastle/ paths (#445), and the work needs push standing on a second repo (Matou/dev-factory) - any session host with that standing.
  • The pin 41495283 is 15 commits behind dev-factory main, so step 2 is not a two-file re-vendor: pin..main is 1641 files (the fleet-tui rework plus heal.sh, run-swarm.sh, verdict-lib.sh, landing-lib.sh, forgejo-lib.sh, close-report). Adopting that is a deliberate harness upgrade someone should watch land, not a headless one-shot. (The swarm healer is also forbidden from modifying heal.sh/heal-lib.sh, which a bump to main would rewrite.)

Rejected shortcut

Dropping the two paths from FACTORY_MANIFEST would green CI in one line, but the manifest is generated (DO NOT EDIT BY HAND), it permanently un-vendors two factory-owned files so future upstream fixes stop arriving, and it leaves the leak live in dev-factory and every sibling repo. Not done.

  • #1682 - the false auth detection that fired this alert (the other half of #1672 fire 1); its Ask already carries a "same change to dev-factory's copy of limit-lib.sh" clause, so the two upstream lands may want to ride together.
  • The leaked account-B token still needs rotating - noted in bdb42ff6's message and GOTCHAS #303, not owned by this ticket.
  • GOTCHAS #228 (the same rule, same file), #303 (the leak), #5785-era #1142 (prior "land upstream, bump FACTORY_REF" precedent).

Filed by the swarm healer (run heal-Matou-idss-1789965214-1541708, sig 60539fe3c068). No repair attempted - see "Why a session".

## What is red `ci.yml` stage **"Factory core: vendored .sandcastle files match FACTORY_REF (#571/#602)"** fails on every push to `main` since `bdb42ff6`: ``` DRIFT: .sandcastle/rehearsal-report.sh was edited directly here DRIFT: .sandcastle/tests/rehearsal-report-test.sh was edited directly here check-harness-drift: FAILED - vendored factory copies drifted from https://git.matou.nz/Matou/dev-factory.git@414952838e0862c61ba3c1c983e95b73aa9e1a89 ``` Run https://git.matou.nz/Matou/idss/actions/runs/28940 (healer sig `60539fe3c068`). Reproduced here: `bash .sandcastle/check-harness-drift.sh` at `bdb42ff6` names exactly those two files and nothing else. ## Cause - not a bad fix, a fix landed on the wrong side `bdb42ff6` (jamin, 2026-09-20) is a **correct and urgent secret-leak fix**: `claude_auth_announce`'s `${tok:+${tok:0:14}...}${tok:-EMPTY}` expanded to the whole Claude OAuth token and posted it to the drive ticket, Mattermost and the executor log (GOTCHAS #303). It must not be reverted. But both files it touches are `Matou/dev-factory`-OWNED and listed in `.sandcastle/FACTORY_MANIFEST`, so the drift gate reds by design - this repo *pulls* the factory core at a pinned ref (ADR 0180 / #571) and a local edit to a vendored file is exactly what the gate exists to catch. GOTCHAS #228 already records the same rule for this same file: a `rehearsal-report.sh` fix "must land upstream in the factory and be re-vendored (drift gate) ... NOT applied in this repo directly". **dev-factory's `main` still carries the leaking line** (`rehearsal-report.sh:200`, verbatim `${tok:+${tok:0:14}...}${tok:-EMPTY}`), so **every other consumer repo still leaks its token on an auth-failure alert.** That is the larger half of this ticket. ## Ask 1. Land `bdb42ff6`'s two-file change upstream in `Matou/dev-factory` (`rehearsal-report.sh` + `tests/rehearsal-report-test.sh`), via the factory's normal issue/PR flow. 2. Bump `.sandcastle/FACTORY_REF` here and re-vendor (`onboard.sh vendor`), which un-reds the seam. 3. Sanity-check the other consumer repos pick the new pin up. ## Why a session, not a swarm worker - Protected `.sandcastle/` paths (#445), and the work needs **push standing on a second repo** (`Matou/dev-factory`) - any session host with that standing. - The pin `41495283` is **15 commits behind** dev-factory `main`, so step 2 is not a two-file re-vendor: `pin..main` is 1641 files (the `fleet-tui` rework plus `heal.sh`, `run-swarm.sh`, `verdict-lib.sh`, `landing-lib.sh`, `forgejo-lib.sh`, `close-report`). Adopting that is a deliberate harness upgrade someone should watch land, not a headless one-shot. (The swarm healer is also forbidden from modifying `heal.sh`/`heal-lib.sh`, which a bump to `main` would rewrite.) ## Rejected shortcut Dropping the two paths from `FACTORY_MANIFEST` would green CI in one line, but the manifest is generated (`DO NOT EDIT BY HAND`), it permanently un-vendors two factory-owned files so future upstream fixes stop arriving, and it leaves the leak live in dev-factory and every sibling repo. Not done. ## Related - #1682 - the false auth detection that *fired* this alert (the other half of #1672 fire 1); its Ask already carries a "same change to dev-factory's copy of `limit-lib.sh`" clause, so the two upstream lands may want to ride together. - The leaked account-B token still needs **rotating** - noted in `bdb42ff6`'s message and GOTCHAS #303, not owned by this ticket. - GOTCHAS #228 (the same rule, same file), #303 (the leak), #5785-era #1142 (prior "land upstream, bump FACTORY_REF" precedent). --- Filed by the swarm healer (run `heal-Matou-idss-1789965214-1541708`, sig `60539fe3c068`). No repair attempted - see "Why a session".
Author
Member

Ruled by agent under ADR 0174 — veto anytime

Ruling: greened CI the two-way way, and split the one part that must be
watched.

The drift was correct-by-design: bdb42ff6's token-leak fix (a real, urgent
security fix — keep it) edited two dev-factory-owned vendored files, so the
fix had to land upstream and ride back on a FACTORY_REF bump (GOTCHAS #228).
Two ways to bump existed, and they are NOT equal:

  1. The whole-main bump the Ask sketched is ~16 commits / ~1.6k files —
    the fleet-tui rework plus heal.sh/heal-lib.sh, run-swarm.sh,
    verdict-lib.sh, landing-lib.sh, forgejo-lib.sh, close-report.
    Checked: no consumer repo is on main (pregnancy-navigator 9055eb55
    and matou-app a553c00f both lag ~15 too), so it is an unadopted-in-field
    harness-core upgrade that rewrites the swarm's own heal.sh/run-swarm.sh.
    A headless one-shot cannot watch that land or catch a wedged swarm — not a
    two-way door for this session
    (the Ask itself said "someone should watch
    land, not a headless one-shot"). → split to #1684 (ready-for-human),
    which also carries #1682's limit-lib.sh companion land.

  2. A minimal re-vendor IS a clean two-way door: I branched the leak fix off
    idss's own current pin base 41495283, where the two files are
    byte-identical to main, committed 142a3c10, and merged it into
    dev-factory main too
    (issue Matou/dev-factory#159, PR #160) so every
    consumer stops leaking on their next bump. FACTORY_REF → 142a3c10 is then
    a byte-identical two-file re-vendor with zero harness churn.

Why it's two-way: revertible (one-line FACTORY_REF + a dev-factory revert),
provable (check-harness-drift.sh green; the reporter test is red-before-green),
no posture change. The rejected manifest-drop shortcut was NOT used.

Close report

Landed here: c4f65280 — FACTORY_REF 41495283 → 142a3c10, STATUS.md.
bash .sandcastle/check-harness-drift.sh → OK (was FAILED on both files).
No onboard.sh vendor run: the vendored bytes already matched, so the pin bump
alone greens it — and that dodges the FACTORY_MANIFEST token-leak that
onboard.sh vendor has caused before.

Landed upstream (the larger half — dev-factory main still leaked):

  • Matou/dev-factory issue #159, PR #160 → main (89b6bad); fix commit 142a3c10.
  • Red-before-green: tests/rehearsal-report-test.sh FAILs with the leak line reintroduced, PASSes (50 cases) with the fix.

Split off: #1684 — the deliberate, watched FACTORY_REF→main harness
upgrade (unadopted by any consumer; rides #1682).

Not owned here: rotating the leaked account-B token (bdb42ff6 message,
GOTCHAS #303).

Closing — CI drift gate is green and the leak is out of the factory core.

## Ruled by agent under ADR 0174 — veto anytime **Ruling:** greened CI the two-way way, and split the one part that must be watched. The drift was correct-by-design: bdb42ff6's token-leak fix (a real, urgent security fix — keep it) edited two `dev-factory`-owned vendored files, so the fix had to land upstream and ride back on a `FACTORY_REF` bump (GOTCHAS #228). Two ways to bump existed, and they are NOT equal: 1. **The whole-`main` bump** the Ask sketched is ~16 commits / ~1.6k files — the `fleet-tui` rework plus `heal.sh`/`heal-lib.sh`, `run-swarm.sh`, `verdict-lib.sh`, `landing-lib.sh`, `forgejo-lib.sh`, `close-report`. Checked: **no consumer repo is on `main`** (pregnancy-navigator `9055eb55` and matou-app `a553c00f` both lag ~15 too), so it is an *unadopted-in-field* harness-core upgrade that rewrites the swarm's own `heal.sh`/`run-swarm.sh`. A headless one-shot cannot watch that land or catch a wedged swarm — **not a two-way door for this session** (the Ask itself said "someone should watch land, not a headless one-shot"). → split to **#1684** (`ready-for-human`), which also carries #1682's `limit-lib.sh` companion land. 2. **A minimal re-vendor** IS a clean two-way door: I branched the leak fix off idss's *own* current pin base `41495283`, where the two files are byte-identical to `main`, committed `142a3c10`, and **merged it into dev-factory `main` too** (issue Matou/dev-factory#159, PR #160) so every consumer stops leaking on their next bump. `FACTORY_REF` → `142a3c10` is then a byte-identical two-file re-vendor with **zero harness churn**. Why it's two-way: revertible (one-line `FACTORY_REF` + a dev-factory revert), provable (`check-harness-drift.sh` green; the reporter test is red-before-green), no posture change. The rejected manifest-drop shortcut was NOT used. ## Close report **Landed here:** `c4f65280` — `FACTORY_REF` `41495283` → `142a3c10`, STATUS.md. `bash .sandcastle/check-harness-drift.sh` → **OK** (was FAILED on both files). No `onboard.sh vendor` run: the vendored bytes already matched, so the pin bump alone greens it — and that dodges the FACTORY_MANIFEST token-leak that `onboard.sh vendor` has caused before. **Landed upstream (the larger half — dev-factory `main` still leaked):** - Matou/dev-factory issue #159, PR #160 → `main` (`89b6bad`); fix commit `142a3c10`. - Red-before-green: `tests/rehearsal-report-test.sh` FAILs with the leak line reintroduced, PASSes (50 cases) with the fix. **Split off:** #1684 — the deliberate, watched `FACTORY_REF`→`main` harness upgrade (unadopted by any consumer; rides #1682). **Not owned here:** rotating the leaked account-B token (bdb42ff6 message, GOTCHAS #303). Closing — CI drift gate is green and the leak is out of the factory core.
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#1683
No description provided.