Skip to content

L2: packaged-flow disable/enable write path — operator gate + subflow guard (ADR-0126 §5, §7.3) #12157

Description

@os-support-ai

Part of #12150 (Epic: ADR-0126 implementation, v17 line — 17.x minor, maintainer-ruled).
Blocked-by: #12155
Dispatch: coordinated under the #12150 program — ⛔ not from the general queue; the program dispatches on unlock (maintainer anti-preemption instruction, 2026-08-25, PM session session_01KWRU3s15AJz7PGW7a7wdCh). Contract: ADR-0126 §5 + §7.3 (merged 28b47a93).

Deliverable

The flip action for packaged flows — writing/updating the sys_metadata_activation row (active bit), install-level (organization_id NULL):

  • Write authority (§5): in single posture, org admin suffices; in group/isolated postures the write requires the platform-operator capability — ⛔ a tenant org admin must never flip an install-wide switch (Decide whether POST /api/v1/automation/:name/toggle belongs in the manage_metadata write set — it mutates flow enablement with no authoring capability #10243 made durable in the correct direction).
  • Subflow guard (§7.3): disabling flow B is refused while any packaged flow references B as a subflow, and the refusal names the callers (definition scan at disable time — no reference index exists, ADR §9; ⛔ do not build one).
  • Loud-refusal shape throughout: the refusal message names the sanctioned path. Clause-② note: this leg adds refusal behavior on a public write surface — carry the contract-review declaration on its PR.

Acceptance

  • Posture-matrix tests: single-posture admin allowed; group/isolated tenant-admin refused, operator allowed.
  • Subflow-guard test: packaged caller present → disable refused, caller named in the message; caller absent → disable lands.
  • Enable path symmetric; absence-of-row = active untouched.

Refs: ADR-0126 §5, §7.3, §9 · #10243 · tenancy-posture.ts

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions