Public: anyone can read this; the crew can change it.
"Flags are set by a forge admin." lives in one place, read by the flag action, the web page and the terminal #5609
Check · Review · Land · Live done — Landed and live in production.
The sentence "Flags are set by a forge admin." is now written in one place. `src/core/flags.ts` exports it as `FLAGS_ADMIN_ONLY`, right after `mayManageFlags`. I added a new constant because no existing module held words like it.
shipped production is serving it deploy 38399ee
The sentence "Flags are set by a forge admin." is now written in one place. src/core/flags.ts exports it as FLAGS_ADMIN_ONLY, right after mayManageFlags. I added a new constant because no existing module held words like it.
src/actions/flag_winner.ts,src/web/pages/flags.tsandsrc/tui/screens/flags.tseach importFLAGS_ADMIN_ONLYin place of the typed-out sentence. Only the import and the line with the sentence changed in each file, and the wording is the same.grep -rn "Flags are set by a forge admin" src/now finds onlysrc/core/flags.ts.- The new
test/flags-words.test.tschecks that the sentence is not empty. It also reads each of the three files as text and checks that it namesFLAGS_ADMIN_ONLYand does not contain the sentence itself, so it fails if a copy is typed back.
Checks run: bun x tsc --noEmit is clean and bun scripts/design-lint.ts passes. bun test on test/flags.test.ts, test/flags-settings.test.ts, test/flags-timing.test.ts, test/flags-words.test.ts and test/tui-flags.test.ts passed: 24 tests across the 5 files. I did not run the full suite.
🤖 Generated with Claude Code
Behaviour-neutral: the sentence now lives in FLAGS_ADMIN_ONLY (src/core/flags.ts) and the action, the web page and the terminal import it. The wording is unchanged, so nothing a person sees changes: the denied page and the terminal hint read the same, and there is no markup, CSS or token change. The guard test fails if a copy is typed back. The preview boots; a guest on /settings/flags gets a 303 to sign in, and I did not see the admin-only text there as a guest. Security, both doors and the design system are untouched.
Two things I would do next: (1) the test reads source as text, which is brittle to a quote-style or wrapping change, so a unit test that calls makeWinnerDefault as a non-admin and asserts message === FLAGS_ADMIN_ONLY would guard behaviour rather than spelling; (2) this is a pure tidy while the direction puts arm stability first (#4496, #4486, #3319, #4482), so keep the next pulls on those.
The sentence "Flags are set by a forge admin." is now written in one place.
src/core/flags.tsexports it asFLAGS_ADMIN_ONLY, right aftermayManageFlags. I added a new constant because no existing module held words like it.src/actions/flag_winner.ts,src/web/pages/flags.tsandsrc/tui/screens/flags.tseach importFLAGS_ADMIN_ONLYin place of the typed-out sentence. Only the import and the line with the sentence changed in each file, and the wording is the same.grep -rn "Flags are set by a forge admin" src/now finds onlysrc/core/flags.ts.test/flags-words.test.tschecks that the sentence is not empty. It also reads each of the three files as text and checks that it namesFLAGS_ADMIN_ONLYand does not contain the sentence itself, so it fails if a copy is typed back.Checks run:
bun x tsc --noEmitis clean andbun scripts/design-lint.tspasses.bun testontest/flags.test.ts,test/flags-settings.test.ts,test/flags-timing.test.ts,test/flags-words.test.tsandtest/tui-flags.test.tspassed: 24 tests across the 5 files. I did not run the full suite.🤖 Generated with Claude Code
Closes #5593