Public: anyone can read this; the crew can change it.
An app secret's value is never in a page's HTML: the secrets page shows its name, last change and a Replace action #13154
Merged 19d 14h ago, live in production
Each row of an app's Environment card (Settings › App) now has a Replace action: a write-only password field and a button that posts the new value to the existing POST /:owner/:name/settings/app/env, which only accepts same-origin requests.
-
Reviews
Changes requested — before the latest pushBehaviour is right: the Replace form posts to the existing same-origin route, value is absent from page, API and MCP, and the event holds actor and time without the value. The terminal already sets/replaces via src/tui/screens/appenv.ts, so both doors exist. One miss: docs/features/app-secrets.md (the how-to) does not say that a secret is replaced from its row on the page (and with the terminal screen), and that the value is never shown back. Add that. Also: Replace is offered on plain variables, whose value the row prints; either limit the form to secrets (the issue is about secrets) or say so in the doc. Drop the unrelated comment rewrap in autonomySettingsUpdate if the gate permits it.
ApprovedBoth earlier asks are met. Replace is now offered on secrets only, and docs/features/app-secrets.md gains a Replacing a secret section and the terminal note. The new test fails without the Replace form. The value is absent from the page, the API and MCP answers, and the event holds the actor and time but not the value. The same-origin check is covered. The change reuses .row-fields and adds no class. The terminal door already replaces through Variables, and the how-to is in docs/features, not the README. Nothing blocking.
-
Checks
shipped production is serving it deploy 3eab8eb
-
History
- Replace is offered on secrets only, and the how-to says a secret is replaced from its row and never shown back 43d26dd
- Merge main and rewrap a settings comment to 100 columns 34a1ea9
- Merge remote-tracking branch 'origin/main' into scout/13142-an-app-secret-s-value-is-never-in-a-page e94fbe2
- The terminal's data screen runs a query the way the page and the MCP do (#13117) bd28fbb
- /pricing signed out is under 10 KB and its plan rows are rows, not cards (#13039) 0bf35aa
- Comment width is formatting: one rewrapper fixes it, and the gate names the command (#13087) f76fca8
- A .vcf contacts file opens as rows: name, phone, email, organisation (#13091) 32f8f8b
- Name why this pull has no before/after look a154212
- A form's button says it is working after a tap and refuses a second tap until the answer returns (#13054) 4ec15b4
- The serving process stops keeping every request an app’s host answers and 64 graphs of the busiest repository; what it holds is named each minute (#13099) e9ac3d7
- A settings line that is changed shows who changed it and when, in one muted phrase (#13096) 4cdb9ee
- The weekly production probe fails when /changelog.atom has no entries and files the defect with the byte count it saw (#13104) 6b4948a
- GET /openapi.json answers the description itself, not a 308 the caller must follow (#13076) d889f9e
- A Final Cut `.fcpxml` project opens as a timeline table of clips, tracks and durations (#13088) ad90d85
- Try: open an app's Settings › App, find a secret under Environment, type a new value beside it and press Replace f1729f9
- An app secret is replaced from its row, and its value is in no page, API or MCP answer (#13142) 69c1f71
- Production /changelog.atom has no entries although /changelog lists releases (#13098) f4dda05
- v1.0.0 stays proven: the production probe runs weekly and files a defect when one fails (#12996) ddbe238
- The forge's documentation rides in the release image, again: with the test that reverted it brought along (#13103) 303fb0b
- The signed-out home renders in under 30 ms and under 30 KB of HTML, measured on production (#13014) 8c8369f
3 earlier comments
Each row of an app's Environment card (Settings › App) now has a Replace action: a write-only password field and a button that posts the new value to the existing POST /:owner/:name/settings/app/env, which only accepts same-origin requests. The app's own secrets live in app_env and are drawn by appEnvView() in src/web/pages/settings.ts, not in app_secrets.ts, so the change is there.
Before this, the value was already never rendered: the page, GET /api/v1/repos/:owner/:name/app/env and the MCP app_env list all return names, scope and updatedAt only. Each change was already recorded as an app.env_set event holding the actor and the time, with no value. So what's new is the Replace action plus a test that proves all of it.
test/app-secrets-value.test.ts:
- The page lists the secret's name, "set <time>", and a Replace form with a password input. This test fails without the change.
- After the secret is set, the value appears in none of the three answers: the settings page HTML, the API list and the MCP list.
- A cross-origin Replace is refused with 403 and records nothing.
- A same-origin Replace returns 303 and records
app.env_setwith the admin's id and a time. The new value is in no event payload and in none of the three answers.
The test first also expected a POST with no Origin header to be refused. That expectation was wrong: crossOrigin() in src/http/context.ts accepts a missing Origin on purpose, treating it as a non-browser client, so I removed it.
Not done:
- The row doesn't show who last changed a secret. The event records it, but showing it would need an event lookup per row.
- Replace is offered on plain variables too, keeping their kind. It's the same form, and it avoids a branch.
- No new MCP tool or action;
mcp-sizepasses. - I didn't keep a plan on the issue or record an estimate, because the
keep_planandestimatetools aren't available in this session.
docs/design/areas/settings.md now lists appEnvView() among the writers of .row-fields; no new class was added.
Checks run: scripts/gate.ts, tsc --noEmit and design-lint are clean. scripts/fast.ts picked 1922 test files, too many to run here, so I ran the 8 that cover this change: the new test, app-secrets-web, mcp-size, mcp-app-env, forge-box-unit, fresh-app, app-settings-page and web-apps. All 68 tests pass.
To try it: open an app's Settings › App, find a secret under Environment, type a new value beside it and press Replace. The row's "set" time updates, and the value appears nowhere on the page.
🤖 Generated with Claude Code
An app's secret value no longer appears in any page, API answer or MCP answer. Each secret's row under Settings › App › Environment now has its own Replace field: you type a new value there instead of seeing the old one.
The check failure: the forge's before/after-looks rule fails when a pull changes src/web/pages/settings.ts and no commit names a page from app.looks (the pages the forge photographs, in forge.json) or gives a reason with "No look:". None of those pages shows an app's Environment section, which needs a real app with secrets. So I added an empty commit with a No look: line saying that; no code changed. bun scripts/gate.ts now passes. I did not re-run the type check or tests, since that commit changes no files.
To try it: open an app's Settings › App, find a secret under Environment, type a new value beside it and press Replace. The secret's value should not show up in the page source or in the API's answer.
🤖 Generated with Claude Code
This pull lets you replace an app secret from its own row in Settings › App › Environment. A secret's value appears in no page, no API answer and no MCP answer: you can set a new value, but nothing ever shows it back to you.
The last push failed main's comment-width rule (100 columns) in src/web/pages/settings.ts. That rule came in on main through scripts/gate.ts after this branch was cut, so this push merges main in. Running bun scripts/gate.ts --fix then rewrapped one comment, in autonomySettingsUpdate. That comment came from main through the merge, not from this pull. No behaviour changed.
Before pushing, the gate, bun x tsc --noEmit and bun scripts/design-lint.ts passed. I didn't run the files scripts/fast.ts named: the merge with main touched 1,924 test files, about 163 minutes of tests. I ran the 8 settings and secrets test files instead (app-secrets-value, app-secrets-web, app-secrets, app-settings-page, mcp-secrets, settings-secret-delete, secrets-card, settings-app-domains), and all 36 tests passed. The forge runs the full check on this push.
To try it on the preview: open an app's Settings › App, find a secret under Environment, type a new value beside it and press Replace. The page confirms the change without ever showing the value.
🤖 Generated with Claude Code
An app secret is now replaced from its row under Settings › App › Environment, and its value is never in a page, an API answer or an MCP answer. The row shows the secret's name, scope and when it last changed, with a password field and Replace. Replace sends a same-origin POST to the existing settings/app/env route. The change is logged as an app.env_set event with who made it and when, never the value.
This push, after review:
- Replace is for secrets only. The form appears only when
kind === "secret"(src/web/pages/settings.ts,appEnvView). A plain variable's value is already printed in its row, so it is set again with the form under the list.- New test in
test/app-secrets-value.test.ts: a variable's row has no Replace form. It fails on the old code.
- New test in
- The how-to now covers replacing.
docs/features/app-secrets.mdhas a "Replacing a secret" section. It says:- a secret is replaced from its row;
- its value is never shown back;
- Replace is for secrets only.
- The terminal docs. The terminal section now says that setting an existing name again in Variables (
src/tui/screens/appenv.ts) replaces its value. It uses the samesetAppEnvVarupdate-or-insert. The section also says the list never shows a secret's value. - The comment rewrap in
autonomySettingsUpdatestays. The gate doesn't permit dropping it: with the comment back at 101 columns,bun scripts/gate.tsfails the 100-column rule. The overlong line came from main, but this pull changessettings.ts, so that rule covers the whole file.
Checks: the gate, bun x tsc --noEmit and bun scripts/design-lint.ts pass. The settings, secrets and app-env test files all pass: 14 files, 74 tests. I didn't run the files scripts/fast.ts names, because it names 1,924 of them since the earlier merge with main.
To try it on the preview:
- Open an app's Settings › App › Environment.
- On a secret's row, type a new value and press Replace. The page confirms the change without ever showing the value.
- A plain variable's row has no Replace field.
🤖 Generated with Claude Code
Each row of an app's Environment card (Settings › App) now has a Replace action: a write-only password field and a button that posts the new value to the existing
POST /:owner/:name/settings/app/env, which only accepts same-origin requests. The app's own secrets live inapp_envand are drawn byappEnvView()insrc/web/pages/settings.ts, not inapp_secrets.ts, so the change is there.Before this, the value was already never rendered: the page,
GET /api/v1/repos/:owner/:name/app/envand the MCPapp_envlistall return names, scope andupdatedAtonly. Each change was already recorded as anapp.env_setevent holding the actor and the time, with no value. So what's new is the Replace action plus a test that proves all of it.test/app-secrets-value.test.ts:app.env_setwith the admin's id and a time. The new value is in no event payload and in none of the three answers.The test first also expected a POST with no
Originheader to be refused. That expectation was wrong:crossOrigin()insrc/http/context.tsaccepts a missing Origin on purpose, treating it as a non-browser client, so I removed it.Not done:
mcp-sizepasses.keep_planandestimatetools aren't available in this session.docs/design/areas/settings.mdnow listsappEnvView()among the writers of.row-fields; no new class was added.Checks run:
scripts/gate.ts,tsc --noEmitanddesign-lintare clean.scripts/fast.tspicked 1922 test files, too many to run here, so I ran the 8 that cover this change: the new test,app-secrets-web,mcp-size,mcp-app-env,forge-box-unit,fresh-app,app-settings-pageandweb-apps. All 68 tests pass.To try it: open an app's Settings › App, find a secret under Environment, type a new value beside it and press Replace. The row's "set" time updates, and the value appears nowhere on the page.
🤖 Generated with Claude Code
Closes #13142