Public: anyone can read this; the crew can change it.
GET /api/v1/flags answers every declared flag with why, default, owner issue and live value, as MCP `flags` does #8019
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/flags` now answers `{ flags }` with every declared flag's why, default, owner issue and live value. It uses the same `readFlags` call as MCP `flags`.
shipped production is serving it deploy 1f09d72
GET /api/v1/flags now answers { flags } with every declared flag's why, default, owner issue and live value. It uses the same readFlags call as MCP flags.
I ran test/api-flags.test.ts, test/mcp-size.test.ts and three OpenAPI tests (openapi.test.ts, openapi-coverage.test.ts, openapi-routes.test.ts). All 344 tests pass, and tsc --noEmit and scripts/gate.ts are clean. I did not run the full suite, and scripts/fast.ts was not used.
- Route: the handler is in
src/http/api/flags.ts, registered insrc/http/api.tsright afteradminRoutes(router);with its import directly after theadminRoutesone. - Refusals: a plain member or an agent admin gets 403,
forbidden, withreadFlags's own message ("Flags are set by a forge admin."). A request with no token gets 401. - 401 check:
readFlagsalone refuses a missing user with 403, so the handler returnsunauthorized()before calling it. Without that check the no-token test failed with 403. - OpenAPI:
getApiV1Flags.tsis described with auth true and the 403 refusal. It is exported fromroutes/index.tsaftergetApiV1FeedChips, so/api/v1/openapi.jsonlists it. - Test:
test/api-flags.test.tscovers an admin person getting 200 with the same body MCPflagsreturns, the 403 cases, the 401, and the route appearing in the OpenAPI document.
Not done: this is read-only. Setting a flag stays with MCP flag_set and Settings › Flags. No MCP tool was added, so the MCP size ceilings are unchanged.
To try it, call GET /api/v1/flags with a forge admin person's token.
🤖 Generated with Claude Code
Clean. The route reuses readFlags, so it has the same admin-person gate and refusal text as MCP flags. It returns 401 with no identity and 403 otherwise. The route is a read with no body, so there is no CSRF or body-cap concern. It is in OpenAPI. The tests cover 200 with parity to MCP, 403 for an agent admin and a member, 401, and the OpenAPI entry. Nothing is added beyond the issue. The preview answers 401 to my token, which is the expected unauthenticated path.
GET /api/v1/flagsnow answers{ flags }with every declared flag's why, default, owner issue and live value. It uses the samereadFlagscall as MCPflags.I ran
test/api-flags.test.ts,test/mcp-size.test.tsand three OpenAPI tests (openapi.test.ts,openapi-coverage.test.ts,openapi-routes.test.ts). All 344 tests pass, andtsc --noEmitandscripts/gate.tsare clean. I did not run the full suite, andscripts/fast.tswas not used.src/http/api/flags.ts, registered insrc/http/api.tsright afteradminRoutes(router);with its import directly after theadminRoutesone.forbidden, withreadFlags's own message ("Flags are set by a forge admin."). A request with no token gets 401.readFlagsalone refuses a missing user with 403, so the handler returnsunauthorized()before calling it. Without that check the no-token test failed with 403.getApiV1Flags.tsis described with auth true and the 403 refusal. It is exported fromroutes/index.tsaftergetApiV1FeedChips, so/api/v1/openapi.jsonlists it.test/api-flags.test.tscovers an admin person getting 200 with the same body MCPflagsreturns, the 403 cases, the 401, and the route appearing in the OpenAPI document.Not done: this is read-only. Setting a flag stays with MCP
flag_setand Settings › Flags. No MCP tool was added, so the MCP size ceilings are unchanged.To try it, call
GET /api/v1/flagswith a forge admin person's token.🤖 Generated with Claude Code
Closes #8012