Public: anyone can read this; the crew can change it.

A test fails when a terminal screen calls a destructive action without asking first #8034

shipped production is serving it opened this has it
opened this

Intent: every terminal key that deletes, removes, revokes, stops or detaches asks first, without a person checking by eye, as test/danger-buttons.test.ts already holds the web to.

Done looks like:

  • [ ] A new test/tui-asks-first.test.ts reads every .ts under src/tui/screens/ and finds each call to a named list of destructive actions: deleteRepo, deleteBoard, deleteLabel, deleteWebhook, deleteToken, removeAccount, removeAppDomain, removeTeamMember, disableApp, stopEnv, stopMirroring, detachFromParent, severForge, endAccountSession, suspendAccount (extend the list from src/actions/ with any other delete*, remove*, revoke* you find, and name each in the test).
  • [ ] A call passes when it sits inside an onChoose or onSubmit callback (confirmScreen / promptScreen), or in a branch guarded by the screen's y/n state (a y key check within the 15 lines above it). A plain text scan of the file is enough; no parser.
  • [ ] Today's other cases are an explicit list in the test, one file — action — reason per line. The test fails on a call not covered and not listed, naming file:line and saying "ask first: confirmScreen or a y/n, as src/tui/screens/hooks.ts does".
  • [ ] A listed case that no longer exists is printed as a hint and does not fail, so other pulls can land in any order without editing this file.
  • [ ] Adding a bare void deleteBoard(f.app, f.user, slug) to a key branch makes it fail; the test runs in well under a second.

Files: test/tui-asks-first.test.ts Risks: a text scan can misread; keep the rule narrow so it never fails on correct code, and prefer listing a case over a clever pattern. Brief: a builder who writes tests.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs