Flow Debugger: method-entry site scope gates routed site traffic only #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Register row 113 (deferred-work register).
A site-scoped Deployer who Live-runs a method belonging to another plant is refused at
RouteTarget.ResolveSiteAsync, but the method's central-side effects (Database.*,ExternalSystem, notifications) run regardless. ApiMethods have no site affinity, so there is nothing to scope against.Revisit trigger (from register): A decision to give
ApiMethoda site affinity, or a report of a scoped user reaching another plant's central-side effects.Current state: Accepted for now; F2's stated property holds as written.
Origin: Flow Debugger arch-review remediation code review 2026-09-06.
Source:
docs/plans/2026-07-08-deferred-work-register.mdrow 113Not fixed — needs a product decision (register row 113 marks it accepted until then). ApiMethods have no site link, so a Live method-entry run's central-side effects (Database.*, ExternalSystem, notifications) have nothing to scope against. Options: (a) give ApiMethod a site affinity (model change), (b) refuse method-entry Live runs for site-scoped users, (c) dry-run/suppress central-side effects in Live mode. Recommend (b) — smallest, fail-closed, and Replay stays available to them.
Owner decision 2026-11-09: (b) refuse method-entry Live runs for site-scoped users; Replay stays available to them.
Fixed in
63ec45e2(pushed tomain), per owner decision (b).FlowDebugRunner.RunMethodAsyncrefusesFlowDebugRunMethodCommandfor a site-scoped caller (the caller hasPermittedSiteIdsand is not an Administrator). The refusal happens before the method script runs. It writes a failedInboundRequestaudit row under the operator's name, then raisesSiteScopeViolationException, which surfaces asManagementUnauthorized. The message explains why the run was refused and that Replay and script-entry runs are still available. The CLIflow-debug run-methodsends the same/managementcommand, so it is refused the same way. Its help text anddocs/components/CLI.mdnow say so.?methodId=drill-in and a stored method choice are ignored.EnforceSiteScopeon the target instance's site). The F2 route-time scope stays as defence in depth.→ #55; per the backlog rule it was not edited further. Docs updated: the design doc, Component-ManagementService, Component-CentralUI and CLAUDE.md.Tests: scoped Deployer refused (Theory, routing both in and out of scope; the script never runs, the router is never called, one failed audit row with actor = operator); unscoped user and Administrator allowed (existing tests); scoped Deployer Replay allowed; scoped in-scope value-change Live run still runs. bUnit tests cover the disabled entry plus note, the drill-in being ignored, and the unscoped control. Mutation: with the gate and the UI flag reverted, 4 new tests fail. Suites: ManagementService 777, CentralUI 1540, CLI 581, all green. Full slnx: 10,900 passed. The only failures are the 185 Playwright tests, which cannot connect to a browser server at
ws://localhost:3000; this is environmental, not a regression.