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

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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 in src/core/app_env.ts. The web form, the PUT and DELETE API routes, the MCP app_env tool and the setAppEnvVar / deleteAppEnvVar actions 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.md and 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 deleteAppEnv still defaults to all, as test/app-env.test.ts asserts.

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 old all default 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.ts and bun scripts/design-lint.ts are clean.
  • The tests touching app env are green: app-env, mcp-app-env, the two tui app-env files, and apps-api after the edit.

Not done

  • Existing variables keep their scope; no migration.
  • Anything that relied on the unscoped API or MCP default of all now gets production. Callers that want previews must send scope: "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

1 earlier comment · 1 event
commented

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 in src/core/app_env.ts. The web form, the PUT and DELETE API routes, the MCP app_env tool and the setAppEnvVar / deleteAppEnvVar actions 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.md and 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 deleteAppEnv still defaults to all, as test/app-env.test.ts asserts.

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 old all default 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.ts and bun scripts/design-lint.ts are clean.
  • The tests touching app env are green: app-env, mcp-app-env, the two tui app-env files, and apps-api after the edit.

Not done

  • Existing variables keep their scope; no migration.
  • Anything that relied on the unscoped API or MCP default of all now gets production. Callers that want previews must send scope: "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

Changes requested — before the latest push

The default change is right and the core test is good. Three things to fix in one round:

  1. Terminal door not updated (first fix). src/tui/screens/appenv.ts still offers APP_ENV_SCOPES.map(...) with all first, so the cursor starts on 'everywhere'. That is the unsafe choice the pull removes from the page. Put production first (or preselect DEFAULT_ENV_SCOPE), and align the wording with the page ('Also in previews') in actions/app_env_words.ts and where(). Add a tui test that Enter on the default choice sets production.
  2. 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.
  3. Docs: the docs/APPS.md line is now an unwrapped long line, and the other scope mentions (the TUI paragraph above it, the preview rule 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.

commented

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 in src/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.

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs