Say where the auto-seed flag can actually arrive

The recovered comment claimed a dev server picks the flag up from the
environment it was built with. It does not: dev and start both serve from src/,
so build.ts's define only reaches the staging bundle the @e2e harness builds.
OFF, the default and the reason the gate exists, needs no plumbing; opting IN
is what is out of reach, and closing that gap means making the app bootstrap
async, which nothing here needs yet.
This commit is contained in:
Sylvain Duchesne
2026-09-21 14:12:03 +02:00
parent 35df3e9110
commit ff285455d2
+18 -10
View File
@@ -8,18 +8,26 @@
* when explicitly enabled via the env var `FESTIPOD_AUTO_SEED` (= "1").
*
* Same compile-time plumbing as the shared-wallet password (sharedWallet.ts):
* `build.ts` `define`s the global from the env var for a static bundle. Absent
* env → global undefined → seed OFF.
* `build.ts` `define`s the global from the env var. Absent env → global
* undefined → seed OFF, which is the whole point: OFF needs no plumbing at all.
*
* RECOVERED FROM THE ng-eventually BRANCH, with two differences that branch does
* not have:
* - there is no `/festipod-config.json` here, so the flag arrives at BUILD time
* only; a dev server picks it up from the environment it was built with;
* - `fixtureSeedEnabled()` below is NOT enforced in `bootstrapWallet` on this
* branch. On ng-eventually it switches every route off, which stands down the
* @data scenarios that seed; adopting that here is a product decision, not a
* side effect of recovering this file. Until it is taken, only the AUTOMATIC
* seed is gated — an explicit `loadTestData()` still writes.
* not have.
*
* TURNING IT ON ONLY REACHES A BUILT BUNDLE. `bun run dev` and `bun run start`
* both serve from `src/` (`src/index.ts` imports `index.html`), so the `define`
* in `build.ts` never reaches them — only `dist-staging/`, which the @e2e harness
* builds, is affected. ng-eventually closes that gap with a
* `/festipod-config.json` route read by `frontend.tsx` before the app loads;
* recovering it here means making the app bootstrap async, which is not needed
* for the gate's purpose (stopping the dev seed from bloating a persistent
* wallet) and is therefore left out until someone actually wants to opt in.
*
* `fixtureSeedEnabled()` BELOW IS NOT ENFORCED in `bootstrapWallet` here. On
* ng-eventually it switches every route off, which stands down the @data
* scenarios that seed; adopting that is a product decision, not a side effect of
* recovering this file. Until it is taken, only the AUTOMATIC seed is gated — an
* explicit `loadTestData()` still writes.
*/
/**