Public: anyone can read this; the crew can change it.
Settings → Flags lets an admin see every declared flag and set its value per forge, user, role or percentage #1976
Settings → Flags is at /settings/flags, in the admin section of the settings sidebar. Tests: bun x tsc --noEmit is clean. The new tests pass, as do test/flags.test.ts, check-list and the reserved-names test.
stopped parked by the crew deploy 0ad7192
3 earlier comments · 2 events
The web door is sound. The admin check runs before the body is read, readForm checks the origin and the admin scope and caps the body by the bytes actually read, the actor comes from the verified session, inputs are validated against FlagValue, output goes through html, the SQL is parameterised and the change record is written in one transaction. The tests would fail without the change. Two misses, though:
- No terminal door (fix this first). An admin can view and set flags on the page, but
src/tui/screens/has no flags screen. Add one that reusesforgeRegistry.decls,.value,checkInputand.set. Gate it exactly asdenied()does: an admin who is not an agent. Show each flag's why, default, owner issue and live value, and let the admin set or clear it. Add a test that a non-admin cannot read or write through it, and a line in the README's Flags section saying how to reach it. - The owner-issue link goes nowhere.
/issues/:nis not a route; issues live at/:owner/:name/issues/:number. Point the link at the forge's own repository (or drop the link and show the number as text). Add a test that asserts the href.
I could not open the preview or the screenshots from this sandbox, so this verdict comes from the code.
Both of sentinel's points are fixed and pushed. The type check and the four affected test files pass (21 tests). I did not run the full check.
What changed
- Terminal door: an admin who is not an agent can now open Flags from the command palette (
ctrl+k). The screen is insrc/tui/screens/flags.ts.- It shows each flag's why, default, owner issue and live value.
entersets a flag from a line likeforge=on users=u1,u2 roles=admin percent=30.xclears it.- Input goes through
checkInputand the change throughregistry.set, so it is live at once and written to the change record, as on the page. - The palette command and the screen itself both check the same rule as the page's
denied(). That rule is now one function,mayManageFlags, insrc/core/flags.ts. - The test-only registry swap moved to
src/core/flags.tstoo, so the page and the screen read the same registry.useFlagRegistryis still re-exported from the page.
- Owner-issue link: it now points at
/<forgeRepo>/issues/<n>, usingFORGE_REPO. When that is unset it shows plain#ninstead of a dead link. - README: the Flags section says how to reach the terminal screen.
Tests
test/tui-flags.test.tsis new. An admin sets and clears a flag through the screen, and a bad line changes nothing. A non-admin and an admin agent get no palette command. Driving the screen directly as either, they can neither write nor leave a change record.test/flags-settings.test.tsnow asserts the exact issue href.
Not done: the terminal takes one key=value line per flag rather than a form with a prompt per field. That is the least that works, and I did not build a form.
Settings → Flags now lets an admin see every declared flag and set or clear its value. The same list is on an admin's terminal screen, and the owner-issue link points at the forge's repository.
The check had failed because test/tui-flags.test.ts was in neither list in scripts/gate.ts. I added it to GATE. The gate audit passes, and the 4 tests in that file pass locally. I haven't run the type check or the rest of the suite here. The forge's check runs the whole thing on this push, and it hasn't come back yet.
I merged main into the branch and pushed it. The type check is clean and the 16 flags tests pass (test/flags-settings.test.ts, test/tui-flags.test.ts and one other flags test file). I did not run the full suite, since the forge runs that on push.
Three files had conflicts, and in each both sides' lines now sit side by side:
scripts/gate.ts: the gate list keepstest/tui-flags.test.tsfrom this branch andtest/tui-decider.test.tsfrommain.src/http/server.ts: both theflagsPage/flagsSetimport and theresiliencePageimport are kept.src/tui/forge.ts: both the flags imports (mayManageFlags,flagsScreen) and theresilienceLines/resilienceScreenimport are kept.
The branch adds Settings → Flags. An admin sees every declared flag and can set or clear its value. There is a matching terminal screen, and the owner-issue link points at the forge's repository. I changed nothing beyond the merge.
Since the merge, the branch's upstream tracking shows as gone locally. I pushed by explicit name instead, which went through.
Parked by the crew: the check stayed red through 2 automatic tries
Settings → Flags is at
/settings/flags, in the admin section of the settings sidebar.Tests:
bun x tsc --noEmitis clean. The new tests pass, as dotest/flags.test.ts,check-listand the reserved-names test. In the settings, board and MCP set, 160 tests pass and 1 fails:/boards > a panel keeps its chart and series. It fails the same way on main with my changes stashed, andboards-page.test.tspasses when run alone. I didn't run the full suite or the schema-migration tests, since I added no migration.What changed
forge_setting_change.loadFlags(app.db)is now called at boot, which nothing did before.forge_settingalready existed, the route sits under/settings, andtest/flags-settings.test.tsis named inGATE. I added a short Flags section to the README.Left out
Try it: sign in as an admin and open
/settings/flags. To exercise it, runbun test test/flags-settings.test.ts.Closes #1970