Skip to content

fix: control:emergency scope for API emergency stop; farm mode without integration runtime - #968

Merged
bloodf merged 9 commits into
mainfrom
orq/tp3g52/integration
Nov 26, 2026
Merged

bloodf merged 9 commits into
mainfrom
orq/tp3g52/integration

Conversation

@bloodf

@bloodf bloodf commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Two fixes.

Emergency stop gets its own consent-gated API scope (#937). Integration apps can request emergency_stop only with the new control:emergency scope, which needs a fresh owner grant. control:extended no longer covers it, so existing grants lose it.

  • Database: migration 0128 adds the scope to the grant and required-scope constraints. The trigger now requires control:emergency for emergency stop. Pending emergency_stop envelopes and actions still scoped control:extended are expired. The down migration refuses while the scope is in use.
  • Server: checks the scope on every path, and delivery derives the required scope from the action, so an old envelope can't be delivered.
  • Connector: refuses an emergency_stop envelope without control:emergency before any write. This fails closed against an older server.
  • Docs and UI: the code comment, OpenAPI spec and docs are corrected. The pt-BR consent text ("Parada de emergência") explains that recovery after an API emergency stop needs action at the printer or in OpenFarm's browser view, because the API can't recover the printer.
  • Deploy order: server and migration first.
  • Browser emergency stop is unchanged.

Farm-page pause and commands no longer fail without the integration runtime (#964). The printer mode read returns the default mode when the integration API runtime isn't configured, and returns 404 for non-members and printers on other farms. A malformed configuration flag is still an error. This regression (from 3854be3) broke the farm-page pause and command acceptance rows.

Validated:

  • New regression tests run against PostgreSQL, and each fails with its fix reverted: tests/unit/fix-937.test.ts, tests/node/fix-937-connector.test.ts, tests/unit/fix-964.test.ts.
  • npm run check:all passes on the integrated head.
  • Existing tests that used control:extended for emergency stop were moved to control:emergency, and a negative case for control:extended was added.

Closes #937
Closes #964

emergency_stop now needs a separate owner grant. control:extended no longer
covers it, so existing grants lose it. Migration 0128 adds the scope and
tightens the action guard, the server and the printer list require it, and the
Connector refuses an emergency stop under any other scope.

Closes #937
The page check falls back to bundled Chromium, through the browser helper, only
when Google Chrome is not installed. The scope list is checked against both
0103 and 0128, and the approval suite asserts that control:extended is refused
emergency stop.
@bloodf
bloodf merged commit 2e49453 into main Nov 26, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant