Public: anyone can read this; the crew can change it.
Origin, app and report refusals live in one module, read by the API and MCP #5690
Check · Review · Land · Live done — Landed and live in production.
A new module, `src/actions/origin_app_words.ts`, now holds the three refusal sentences as `ORIGIN_UNREACHABLE`, `APP_ALREADY_YOURS` and `REPORT_ALREADY_DECIDED`. No module owned these sentences before, so it is a new file. `src/http/api.ts` and `src/http/mcp.ts` import them in place of their typed copies, and only the lines that held the sentences changed. In api.ts, the origin-mutation error "the…
shipped production is serving it deploy 40e21c3
A new module, src/actions/origin_app_words.ts, now holds the three refusal sentences as ORIGIN_UNREACHABLE, APP_ALREADY_YOURS and REPORT_ALREADY_DECIDED. No module owned these sentences before, so it is a new file. src/http/api.ts and src/http/mcp.ts import them in place of their typed copies, and only the lines that held the sentences changed. In api.ts, the origin-mutation error "the origin could not be reached; nothing was changed" becomes ` ${ORIGIN_UNREACHABLE}; nothing was changed `. It gives the same bytes. No wording changed anywhere.
test/origin-app-words.test.ts checks that the module says each sentence word for word. It also reads api.ts and mcp.ts as text and checks that each imports the module, uses each constant and no longer contains any of the literals, so it fails if a copy is typed back.
Not done: running grep -rn under src/ still finds the sentences outside the module, so that criterion is not fully met. They sit in files the issue does not name, and its risk note keeps the change to api.ts and mcp.ts:
src/origins/mirror.ts:300(an exact copy)src/actions/migrate.ts:666src/tui/screens/common.ts:883("…; nothing changed")src/contract/openapi.ts:48and:732(the contract's descriptions)
Moving them in is a natural follow-up issue.
Checks: bun x tsc --noEmit is clean. The new test passes, and so do the suites covering these refusals: make-it-yours, mcp-origin-apps, mcp-origins, mcp-reports, reports, origins, api-errors, mcp-docs, mcp-migrate and mcp (138 pass, 0 fail). Nothing under src/web changed, so design-lint was not needed.
To try it: run bun test test/origin-app-words.test.ts, then put one of the sentences back as a literal in api.ts and watch the test fail.
🤖 Generated with Claude Code
This is a pure move, and the bytes are the same. The three sentences now live in src/actions/origin_app_words.ts. api.ts and mcp.ts import them, and only the lines the sentences were on changed. The template ${ORIGIN_UNREACHABLE}; nothing was changed gives exactly the old string. The security surface is unchanged: no new input, route or write, and no auth path moves. On the preview, / answers 200, and an unauthenticated report dismissal or MCP call still gets 401. The new test pins the wording, and it fails if a literal is typed back into either door.
The issue's grep criterion is not fully met: mirror.ts:300, migrate.ts:666, openapi.ts:48/732 and the terminal's common.ts:883 still have copies. The pull says so plainly. The issue's Files and Risk lines kept the change to api.ts and mcp.ts, so this isn't a miss on this pull. I've opened a follow-up issue for those copies. It includes the terminal's "nothing changed" vs the API's "nothing was changed", which is a wording change to decide on purpose.
A new module,
src/actions/origin_app_words.ts, now holds the three refusal sentences asORIGIN_UNREACHABLE,APP_ALREADY_YOURSandREPORT_ALREADY_DECIDED. No module owned these sentences before, so it is a new file.src/http/api.tsandsrc/http/mcp.tsimport them in place of their typed copies, and only the lines that held the sentences changed. In api.ts, the origin-mutation error "the origin could not be reached; nothing was changed" becomes `${ORIGIN_UNREACHABLE}; nothing was changed`. It gives the same bytes. No wording changed anywhere.test/origin-app-words.test.tschecks that the module says each sentence word for word. It also reads api.ts and mcp.ts as text and checks that each imports the module, uses each constant and no longer contains any of the literals, so it fails if a copy is typed back.Not done: running
grep -rnundersrc/still finds the sentences outside the module, so that criterion is not fully met. They sit in files the issue does not name, and its risk note keeps the change to api.ts and mcp.ts:src/origins/mirror.ts:300(an exact copy)src/actions/migrate.ts:666src/tui/screens/common.ts:883("…; nothing changed")src/contract/openapi.ts:48and:732(the contract's descriptions)Moving them in is a natural follow-up issue.
Checks:
bun x tsc --noEmitis clean. The new test passes, and so do the suites covering these refusals:make-it-yours,mcp-origin-apps,mcp-origins,mcp-reports,reports,origins,api-errors,mcp-docs,mcp-migrateandmcp(138 pass, 0 fail). Nothing undersrc/webchanged, so design-lint was not needed.To try it: run
bun test test/origin-app-words.test.ts, then put one of the sentences back as a literal in api.ts and watch the test fail.🤖 Generated with Claude Code
Closes #5647