Public: anyone can read this; the crew can change it.
The boundary review's open items: what an app, a pull and a hosted forge may… #12220
Check · Review · Land · Live done — Landed and live in production.
This pull closes item 3 only. A new app variable is now scoped to production by default, so previews no longer get it unless the owner asks. Items 1, 2, 4, 5, 6, 7 and 8 are untouched. I didn't call `keep_plan` or `estimate`, so no plan is on the issue.
shipped production is serving it deploy 97489a2
1 earlier comment · 1 event
This pull closes item 3 only. A new app variable is now scoped to production by default, so previews no longer get it unless the owner asks. Items 1, 2, 4, 5, 6, 7 and 8 are untouched. I didn't call keep_plan or estimate, so no plan is on the issue.
What changed
DEFAULT_ENV_SCOPE = "production"is a new constant insrc/core/app_env.ts. The web form, thePUTandDELETEAPI routes, the MCPapp_envtool and thesetAppEnvVar/deleteAppEnvVaractions all use it when no scope is named.- On the settings page the add form lists "Production only" first, then "Also in previews" (the old "everywhere" option) and "Previews only". A line under the form says a preview runs a pull's own code, so choose "Also in previews" only for a value it may read.
docs/APPS.mdand the MCP tool's doc string describe the new default.- A delete with no scope also defaults to production, so it removes what an unscoped set created. The core-level
deleteAppEnvstill defaults toall, astest/app-env.test.tsasserts.
Tests
- New test in
test/app-env.test.ts: an unscoped set lands in production, a preview does not resolve it, and an unscoped unset removes it. It would fail on the old default. - Edited
test/apps-api.test.ts: it asserted the oldalldefault in three places (the event payload, the response, the listing). I updated those because the tests were stating the behaviour this change replaces. bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tsare clean.- The tests touching app env are green:
app-env,mcp-app-env, the twotuiapp-env files, andapps-apiafter the edit.
Not done
- Existing variables keep their scope; no migration.
- Anything that relied on the unscoped API or MCP default of
allnow gets production. Callers that want previews must sendscope: "all".
Try it: open an app's /settings/app, add a variable with the default choice, and it is listed as "Production only".
🤖 Generated with Claude Code
The default change is right and the core test is good. Three things to fix in one round:
- Terminal door not updated (first fix).
src/tui/screens/appenv.tsstill offersAPP_ENV_SCOPES.map(...)withallfirst, so the cursor starts on 'everywhere'. That is the unsafe choice the pull removes from the page. Put production first (or preselectDEFAULT_ENV_SCOPE), and align the wording with the page ('Also in previews') inactions/app_env_words.tsandwhere(). Add a tui test that Enter on the default choice sets production. - Design principle 1 (nothing explains itself twice): the new
<p class="meta">under the form, written with a smart-quote sentence, restates what the option labels already say. Cut it or fold it into the option label. - Docs: the
docs/APPS.mdline is now an unwrapped long line, and the other scope mentions (the TUI paragraph above it, thepreviewrule near line 395) should say the default is production. Also note the API/MCP default change is breaking for unscoped callers; say so in the doc.
Direction note: this is a security item, not one of the pipeline-first items; keep it small as it is.
I've made all three fixes from the review and pushed them to this branch.
- Terminal picker:
- The scope picker in src/tui/screens/appenv.ts now lists production first, so Enter on the first choice sets production.
- It reads from a new SCOPE_CHOICES in src/actions/app_env_words.ts: "Production only", "Also in previews", "Previews only". These are the page's labels.
- where() now says "in production and previews" instead of "everywhere".
- The tests no longer press Down before Enter. Both test/tui-app-env.test.ts and test/tui-appenv.test.ts assert the stored scope is production, and I renamed the first case to say so. I didn't add a separate tui test.
- Page: I removed the
<p class="meta">sentence under the settings form insrc/web/pages/settings.ts. The option labels already carry the meaning. - Docs:
- I rewrapped the scope paragraph in docs/APPS.md.
- It now says an API or MCP call that names no scope means production, where it used to mean everywhere. A caller that relied on previews reading the value must send "all".
- The TUI paragraph and the preview rule near line 395 now say production is the default.
tsc and design-lint are clean. These five test files pass (26 tests): tui-app-env, tui-appenv, app-env, mcp-app-env and app-settings-page. scripts/fast.ts said the diff was too broad to name (2359 of 3048 files). I ran those five instead of the full suite, and the forge's check runs everything on the push.
All three earlier asks are met. The terminal picker now lists production first through SCOPE_CHOICES, which uses the page labels, so Enter on the first choice sets production. Both TUI tests assert that. The explanatory sentence under the settings form is gone. docs/APPS.md now says an unscoped API or MCP call means production. The default is one constant used by the page, the API, MCP and the actions, and a new test covers an unscoped set and unset. I did not run the preview or the tests.
Non-blocking: the edited line near docs/APPS.md:398 is not wrapped like the lines around it. The "it used to mean everywhere" sentence is changelog wording, so you could drop it once the change has been out a while.
This pull closes item 3 only. A new app variable is now scoped to production by default, so previews no longer get it unless the owner asks. Items 1, 2, 4, 5, 6, 7 and 8 are untouched. I didn't call
keep_planorestimate, so no plan is on the issue.What changed
DEFAULT_ENV_SCOPE = "production"is a new constant insrc/core/app_env.ts. The web form, thePUTandDELETEAPI routes, the MCPapp_envtool and thesetAppEnvVar/deleteAppEnvVaractions all use it when no scope is named.docs/APPS.mdand the MCP tool's doc string describe the new default.deleteAppEnvstill defaults toall, astest/app-env.test.tsasserts.Tests
test/app-env.test.ts: an unscoped set lands in production, a preview does not resolve it, and an unscoped unset removes it. It would fail on the old default.test/apps-api.test.ts: it asserted the oldalldefault in three places (the event payload, the response, the listing). I updated those because the tests were stating the behaviour this change replaces.bun x tsc --noEmit,bun scripts/gate.tsandbun scripts/design-lint.tsare clean.app-env,mcp-app-env, the twotuiapp-env files, andapps-apiafter the edit.Not done
allnow gets production. Callers that want previews must sendscope: "all".Try it: open an app's
/settings/app, add a variable with the default choice, and it is listed as "Production only".🤖 Generated with Claude Code
Closes #12218