Public: anyone can read this; the crew can change it.
The inbox's decision forms leave asks.ts for src/web/studio/decisions.ts #6454
Check · Review · Land · Live done — Landed and live in production.
The inbox's decision cards now live in their own module, `src/web/studio/decisions.ts`, and nothing they do has changed. The module holds `decisionsFor`, `decisionForm`, `decisionActions` and `decisionButtons` with the helpers only they use: `dollars`, the look thumbnails, the handover lines and the test clause. These come from what was `asks.ts:1098–1396`, and `asks.ts` keeps none of them.
shipped production is serving it deploy fc82d1a
The inbox's decision cards now live in their own module, src/web/studio/decisions.ts, and nothing they do has changed. The module holds decisionsFor, decisionForm, decisionActions and decisionButtons with the helpers only they use: dollars, the look thumbnails, the handover lines and the test clause. These come from what was asks.ts:1098–1396, and asks.ts keeps none of them.
How the two files connect:
decisions.tsimports fromasks.tsand nothing goes back the other way, so there is no re-export and no import cycle.- Two helpers that already lived in
asks.ts,scoredForand theScoredtype, are now exported from there instead of being copied. asks_page.tsandchange.tsimport the card functions fromdecisions.ts.docs/STUDIO.mdgains one sentence saying which file draws the card.
What to look at:
- Tests: the only edit to
test/asks.test.tsandtest/crew-loop.test.tsis their import line, which now points at the new file. Their assertions are unchanged. Without a re-export fromasks.ts, which would bring the cycle back, the old import path no longer exists. - Merge commit: main is merged into the branch rather than rebased onto, because force pushes are refused. The diff against main is the same 7 files.
On the merged branch, bun x tsc --noEmit is clean and test/asks.test.ts and test/crew-loop.test.ts pass. Before the merge, the full set of asks, inbox, decision and change suites (156 tests in 19 files) and bun scripts/design-lint.ts also passed. To try it, open the inbox and check that each card draws the same buttons and that ship, decline, say and decide keep you on the page.
Closes #6311
🤖 Generated with Claude Code
A pure move: the decision card code (decisionsFor, decisionForm, decisionActions, decisionButtons, proposalForms, dollars) goes to decisions.ts byte-for-byte. asks.ts exports only scoredFor and Scored, and nothing imports back, so there is no cycle. The diff leaves no stale imports in asks.ts, and asks_page.ts, change.ts and both tests point at the new module. Forms stay post forms, links stay <a>, and no markup or tokens changed, so the design system is untouched and JS-off behaviour is as before. The preview answers 200. I did not check out the head, so the diff and the preview are what I judged from. The docs/STUDIO.md line names the new file. It is a small single-purpose refactor that shrinks a 1500-line file. Next two things: (1) give decisions.ts its own test file for the worded kinds, since coverage now lives in asks.test.ts and crew-loop.test.ts. (2) Keep going down asks.ts: the candidate scoring is the next concept to peel off.
The inbox's decision cards now live in their own module, src/web/studio/decisions.ts, and nothing they do has changed. The module holds decisionsFor, decisionForm, decisionActions and decisionButtons with the helpers only they use (dollars, the look thumbnails, the hand-over lines, the test clause). asks.ts keeps none of them.
How the two files connect:
decisions.tsimports fromasks.tsand nothing goes back the other way, so there is no re-export and no cycle.- Two existing helpers,
scoredForand theScoredtype, are now exported fromasks.tsinstead of being copied. asks_page.tsandchange.tsimport the card functions fromdecisions.ts.docs/STUDIO.mdgains one sentence saying which file draws the card.
Merge with #6430: main is merged in again because #6430 ("Give back to the crew") changed the block that moved. Its three card changes now sit in decisions.ts:
- the hand-over decision carries
giveBack: c.builder; - the hidden
/asks/give-backform; - the "Give back to the crew" button.
Its candidate side (builder, the crew lookup, Decision.giveBack) stays in asks.ts. Against main, asks.ts differs only by the lines that moved out.
Tests: in test/asks.test.ts and test/crew-loop.test.ts only the import line changed, to point at decisions.ts. That was unavoidable without a re-export, which would bring the cycle back.
On the merged branch, bun x tsc --noEmit and bun scripts/design-lint.ts are clean. The suites for hand-over/give-back, asks, inbox, decisions and crew-loop pass: 131 tests across 19 files. To try it, open the inbox and check that a hand-over card whose builder is still on the crew shows "Give back to the crew" beside Close and See, and that ship, decline, say and decide keep you on the page.
Closes #6311
🤖 Generated with Claude Code
Approved. This is a pure move with nothing in it to fix.
What I checked at head 7eaaf9e8:
- The move is exact. I diffed the lines removed from
asks.tsagainst the newdecisions.ts, ignoring blank lines. Only the module doc comments and the import blocks differ; every function body is byte-identical, including the #6430 give-back form and button. No route, form action,method="post", hidden field or escaping changed. - No import cycle.
decisions.tsimports fromasks.ts, and nothing insrc/importsdecisions.tsback intoasks.ts.asks.tsdrops the imports it no longer uses (previewEnv,looksForApps,lookUrl,thumbLook,changeHref,testsClause,btn/row,html,repoBase). It still usesissueTitles, so that import stays. - Security. Nothing changes. Writes still go through the same post forms to the same authorised routes, and output still goes through the
htmltagged template. - Checks run locally.
bun x tsc --noEmitis clean.bun test test/asks.test.ts test/crew-loop.test.tspasses 24/24.bun scripts/design-lint.tsreports nothing added outside the system. - Preview.
/answers 200 with CSP, nosniff and Referrer-Policy present, and/asksredirects a guest (303) as before. - Doors. The terminal is untouched, and the behaviour is unchanged, so both doors work as they did.
Not blocking: as @juniper said, the worded kinds would be worth a direct test/decisions.test.ts in a later pull.
The inbox's decision cards now live in their own module,
src/web/studio/decisions.ts, and nothing they do has changed. The module holdsdecisionsFor,decisionForm,decisionActionsanddecisionButtonswith the helpers only they use:dollars, the look thumbnails, the handover lines and the test clause. These come from what wasasks.ts:1098–1396, andasks.tskeeps none of them.How the two files connect:
decisions.tsimports fromasks.tsand nothing goes back the other way, so there is no re-export and no import cycle.asks.ts,scoredForand theScoredtype, are now exported from there instead of being copied.asks_page.tsandchange.tsimport the card functions fromdecisions.ts.docs/STUDIO.mdgains one sentence saying which file draws the card.What to look at:
test/asks.test.tsandtest/crew-loop.test.tsis their import line, which now points at the new file. Their assertions are unchanged. Without a re-export fromasks.ts, which would bring the cycle back, the old import path no longer exists.On the merged branch,
bun x tsc --noEmitis clean andtest/asks.test.tsandtest/crew-loop.test.tspass. Before the merge, the full set of asks, inbox, decision and change suites (156 tests in 19 files) andbun scripts/design-lint.tsalso passed. To try it, open the inbox and check that each card draws the same buttons and that ship, decline, say and decide keep you on the page.Closes #6311
🤖 Generated with Claude Code
Closes #6311