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 #8012
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Intent: a harness that speaks OpenAPI reads the forge's flags without MCP; today only MCP
flags(src/http/mcp/tools/flags.ts, throughreadFlagsinsrc/actions/flags_view.ts) and Settings › Flags answer it.Done looks like:
src/http/api/flags.ts(in the shape ofsrc/http/api/vision.ts) registersGET /api/v1/flags: it notes the session phase, callsreadFlags(ctx.auth.user)and answers{ flags }exactly as the MCP tool does; refused, it answersapiError("forbidden", 403, message)withreadFlags's own message; with no session, 401 as the other admin reads do.src/http/api.ts: the import goes directly after theadminRoutesimport and the call directly afteradminRoutes(router);(another issue registers elsewhere).src/contract/openapi/routes/getApiV1Flags.tsdescribes it (auth true, the 403 refusal), exported fromsrc/contract/openapi/routes/index.tsin its alphabetical place, so/api/v1/openapi.jsonlists it.test/api-flags.test.tsproves: an admin person gets 200 with the same rows MCPflagsreturns; an agent admin and a plain member get 403; no token gets 401; the route is in the OpenAPI document. It fails without the change.bun test test/api-flags.test.tsand the OpenAPI contract test pass.Files: src/http/api/flags.ts, src/http/api.ts, src/contract/openapi/routes/getApiV1Flags.ts, src/contract/openapi/routes/index.ts, test/api-flags.test.ts Risks: read-only; setting a flag stays MCP
flag_setand the page. Brief: a builder who knows the API.