Give enabled / disabled features the config.go treatment: they all must go into 1 file, with a validator, and compile into a markdown doc #854

Closed
opened 2026-08-16 02:47:02 +00:00 by coilysiren · 1 comment
Owner
No description provided.
Member

Built and in review at #925. Angie (ENG, claude seat).

The title is the spec, so here is each clause against what landed.

  • One file - internal/community/featureflags.go. Each entry binds the environment name, the field, the default, and one sentence on what it turns on, one line each. They were three separate boolOrDefault(os.Getenv(...), default) calls in LoadConfig, spread over three lines apiece, and nothing could enumerate them.
  • A validator - TestEveryFeatureFlagLivesInTheTable refuses a boolOrDefault anywhere else in the package. Mutation checked rather than assumed: a stray one fails it by file and line.
  • Compiled into a doc - just flags renders agent/rendered/flags.txt, with just flags-check and a staleness test, plus a second test that fails when docs/sirens-echo-tuning.md stops linking it.

Two shape calls, both worth disagreeing with if you want it otherwise.

The reference is agent/rendered/flags.txt rather than markdown under docs/. You asked for a markdown doc. docs/ is at 40 files against the 40 cap after the band migration on #865, so a generated page there breaks the band the repo just landed on. knobs.txt sits in the same place for exactly that reason, with the prose page pointing at it. If you want markdown, the docs cap has to move first.

One difference from the knobs, now written down rather than merely true. A knob that does not parse keeps its default and is named in the startup log. A switch that does not parse is fatal, because a service running with a surface silently off is worse than one that refuses to start. Existing behaviour, previously undocumented.

Three switches today: DISCORD_ENABLED on, DISCORD_DM_ENABLED off, DISCORD_COMMANDS off.

Built and in review at https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/pulls/925. Angie (ENG, `claude` seat). The title is the spec, so here is each clause against what landed. * **One file** - `internal/community/featureflags.go`. Each entry binds the environment name, the field, the default, and one sentence on what it turns on, one line each. They were three separate `boolOrDefault(os.Getenv(...), default)` calls in `LoadConfig`, spread over three lines apiece, and nothing could enumerate them. * **A validator** - `TestEveryFeatureFlagLivesInTheTable` refuses a `boolOrDefault` anywhere else in the package. Mutation checked rather than assumed: a stray one fails it by file and line. * **Compiled into a doc** - `just flags` renders `agent/rendered/flags.txt`, with `just flags-check` and a staleness test, plus a second test that fails when `docs/sirens-echo-tuning.md` stops linking it. **Two shape calls, both worth disagreeing with if you want it otherwise.** **The reference is `agent/rendered/flags.txt` rather than markdown under `docs/`.** You asked for a markdown doc. `docs/` is at 40 files against the 40 cap after the band migration on #865, so a generated page there breaks the band the repo just landed on. `knobs.txt` sits in the same place for exactly that reason, with the prose page pointing at it. If you want markdown, the docs cap has to move first. **One difference from the knobs, now written down rather than merely true.** A knob that does not parse keeps its default and is named in the startup log. A switch that does not parse is fatal, because a service running with a surface silently off is worse than one that refuses to start. Existing behaviour, previously undocumented. Three switches today: `DISCORD_ENABLED` on, `DISCORD_DM_ENABLED` off, `DISCORD_COMMANDS` off.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
coilyco-gaming/sirens-echo#854
No description provided.