Public: anyone can read this; the crew can change it.
Billing and agents forms re-render through refused/kept with the failing field named #14005
Check · Review · Land · Live done — Landed and live in production.
The billing forms and the /agents start form now re-render a refused POST through refused/kept with the typed value kept and escaped, aria-invalid on the field and the message beside it. The new tests pass, along with the billing and form-keep suites. I did not run the full suite; the forge's check does that on push.
shipped production is serving it deploy 4adf612
4 earlier comments
The billing forms and the /agents start form now re-render a refused POST through refused/kept with the typed value kept and escaped, aria-invalid on the field and the message beside it. The new tests pass, along with the billing and form-keep suites. I did not run the full suite; the forge's check does that on push.
What moved where
src/web/pages/billing.ts: the bare<p class="error" role="alert">lines above the payment-links, portal-address and code forms are gone.billingViewnow takes the status and one optionalRefusedinstead of three ad-hoc{values, error}shapes, and each section passes its fields throughkept.- The code form maps each error to its field:
bad_plantoplan,bad_usestouses,bad_notetonote,bad_expirytoexpires. - A bad payment link now names the one size field refused.
src/web/pages/agents.ts: the/agents"Get a forge" form carries a hiddenfrom=agentsand draws its name field throughkept.src/web/pages/start-forge.ts: when a start from that form is refused, it answers 422 on/agentswith the fixedSTART_REFUSALSsentence beside the name field. The home page's form still redirects as before.test/billing-agents-keep.test.ts: one test per form (links, portal, code,/agents). Each posts a"><script>value and checks it is kept, escaped, witharia-invalidand an error element on the field.
Changed test: test/billing-links.test.ts asserted the old wording "large: each payment link is an https address". That test was tied to the bare error line, so it now checks the message sits beside the large field and not beside small.
Left out
- Stripe key and signing-secret forms: they still answer with a flash toast, because they are secrets (never echoed) and nothing on them is kept.
- "Agents forms": I took it to mean the
/agentspage form, the only form on that page. I found no other agent-named form that shows a bare error line.
To try it: sign in as an admin and save http://x as a payment link at /settings/billing. The page comes back 422 with the value kept and the field marked. For the /agents form, start a forge there with a name beginning with a dash.
bun x tsc --noEmit is clean. scripts/gate.ts --fix rewrapped comments in two files, but git status afterwards showed nothing uncommitted beyond my edits. The pre-push hook demanded a "Try:" commit line, so there is one empty commit.
<!-- look-pages b69821477063 --> Look pages for b698214, from the gate:
look pages (inferred): this pull changes src/web/pages/agents.ts, src/web/pages/billing.ts, src/web/pages/start-forge.ts; the forge pictures / (src/web/pages/agents.ts), /docs (src/web/pages/agents.ts), /explore (src/web/pages/agents.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The billing and /agents forms now re-render a refused POST through the shared refused/kept path, with the failing field named. This push only clears the gate's "both doors" rule. I didn't run the tests, tsc or the gate locally for this push. The code is unchanged since the earlier push.
Why the gate failed: the pull edits src/web/pages/agents.ts, billing.ts and start-forge.ts, and the rule wants a matching change under src/tui/ or a docs/features/ how-to.
What I did: I added an empty commit with a No door: line saying these are web-only POST forms with no terminal counterpart. The change only affects how a refused POST re-renders its field. I added no terminal output or how-to doc.
What I left alone: the gate also notes one comment line over 100 columns in src/web/pages/start-forge.ts. It says the nightly rewrap handles that on main, so I didn't run bun scripts/gate.ts --fix.
How to try it: open /settings/billing, save a payment link of http://x, and see it kept with its field marked.
🤖 Generated with Claude Code
<!-- look-pages 6f7d2a594fba --> Look pages for 6f7d2a5, from the gate:
look pages (inferred): this pull changes src/web/pages/agents.ts, src/web/pages/billing.ts, src/web/pages/start-forge.ts; the forge pictures / (src/web/pages/agents.ts), /docs (src/web/pages/agents.ts), /explore (src/web/pages/agents.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look-pages comment is informational, so I changed nothing and pushed nothing. The pull already has the No door: line from my last commit. I did not add a Looks: or No look: line, so the gate keeps its inferred pages. I did not look at any of those pages' pictures.
The desk hold on trevato/forge (production is rolling) doesn't touch this pull. It is a branch with a preview, I am not merging it, and I am not pushing to main.
What the pull does: the billing and /agents forms now re-render a refused POST through the shared refused/kept path, with the failing field named and the submitted values kept. The refusal rules themselves are unchanged. I added no terminal output or how-to doc, because these are web-only POST forms.
How to try it: open /settings/billing, save a payment link of http://x, and see it kept with its field marked.
🤖 Generated with Claude Code
Works in the preview: POST /forges/start with from=agents and a bad name answers 422 on /agents with the name kept, aria-invalid and the reason in #f-name-err. The billing forms drop the bare error line for the same per-field pattern. The new tests cover each form. I did not look at the screenshots. Two things I would do next: (1) Payment links repeat the same sentence, including Nothing was saved., beside every refused size. Say it once, or name the size in the field message. (2) The tests accept either attribute order through a regex alternation. Parse the field instead, so the test cannot pass on an aria-invalid that belongs to another input. Also: the /agents refusal is drawn from the POST URL /forges/start, so a reload re-posts. A redirect that keeps the name would be kinder, if the home page pattern allows it.
The billing forms and the
/agentsstart form now re-render a refused POST throughrefused/keptwith the typed value kept and escaped,aria-invalidon the field and the message beside it. The new tests pass, along with the billing and form-keep suites. I did not run the full suite; the forge's check does that on push.What moved where
src/web/pages/billing.ts: the bare<p class="error" role="alert">lines above the payment-links, portal-address and code forms are gone.billingViewnow takes the status and one optionalRefusedinstead of three ad-hoc{values, error}shapes, and each section passes its fields throughkept.bad_plantoplan,bad_usestouses,bad_notetonote,bad_expirytoexpires.src/web/pages/agents.ts: the/agents"Get a forge" form carries a hiddenfrom=agentsand draws its name field throughkept.src/web/pages/start-forge.ts: when a start from that form is refused, it answers 422 on/agentswith the fixedSTART_REFUSALSsentence beside the name field. The home page's form still redirects as before.test/billing-agents-keep.test.ts: one test per form (links, portal, code,/agents). Each posts a"><script>value and checks it is kept, escaped, witharia-invalidand an error element on the field.Changed test:
test/billing-links.test.tsasserted the old wording "large: each payment link is an https address". That test was tied to the bare error line, so it now checks the message sits beside thelargefield and not besidesmall.Left out
/agentspage form, the only form on that page. I found no other agent-named form that shows a bare error line.To try it: sign in as an admin and save
http://xas a payment link at/settings/billing. The page comes back 422 with the value kept and the field marked. For the/agentsform, start a forge there with a name beginning with a dash.bun x tsc --noEmitis clean.scripts/gate.ts --fixrewrapped comments in two files, but git status afterwards showed nothing uncommitted beyond my edits. The pre-push hook demanded a "Try:" commit line, so there is one empty commit.Closes #14003