Skip to content

console: a change to enforced outside the review shows the evidence and asks for the acknowledgment - #255

Merged
avi-papineni merged 1 commit into
mainfrom
console/fleet-enforce-gate
Nov 25, 2026
Merged

avi-papineni merged 1 commit into
mainfrom
console/fleet-enforce-gate

Conversation

@avi-papineni

Copy link
Copy Markdown
Contributor

Where the gate lived

  • The verdict is composed in the console only. composeVerdict in ui/src/routes/review/model.ts builds it from the review's reads (loadReview in ui/src/routes/review/data.ts: four rollups, the evidence gaps, the workloads in scope). Not safe means any failing condition: would-block traffic, evidence gaps, a degraded, offline, or not-yet-applied workload, a workload still in visibility, or nothing simulating. PromoteDialog (ui/src/routes/review/PromoteDialog.tsx) holds its confirm until the acknowledgment checkbox is checked whenever verdict.safe is false.
  • The control plane does not enforce it. POST /api/v1/mode-changes (internal/api/writes.go, createModeChange) and innerwall workload set-mode (cmd/innerwall/workload.go) both call fleet.(*Service).ChangeMode (internal/fleet/fleet.go), which checks the request's shape and its expected count and nothing about evidence. ModeChangeRequest has no acknowledgment field. ADR-0001 as amended already records this: the gate is the console's, and a server-side evidence guard is backlog (ROADMAP.md).
  • The promotion and the fleet path call the same function. PromoteDialog and ModeChangeDialog both post createModeChange. So the fleet path is not a separate, ungated server function. It is a second console path that skipped the console's gate.
  • Mode controls found: the fleet's Change mode for selected… (WorkloadList.tsx) and the workload strip's change… (WorkloadDetail.tsx), which both open ModeChangeDialog, plus the review's promotion. Nothing else in ui/ writes a mode.

The decision

This takes option 2 of #94: the dialog stays, as a deliberate escape hatch that says what it is, and sits behind the same gate. Removing the path would cost the recovery case the issue describes, where a re-enrolled host's previous identity had already earned enforcement. Routing that through the review would not work, because the review's promotion never offers a workload in visibility.

What changed

  • ui/src/routes/review/data.ts: loadWorkloadEvidence reads, for each workload, the same four rollups and the same evidence gaps the review reads for a scope, filtered by workload instead of label, over the review's defaultRange (24h). It then runs the same buildRows and composeVerdict, four workloads at a time. No second evidence rule.
  • ui/src/routes/review/model.ts: enforceEvidence sorts the selection into four groups: safe, never simulated (the review's visibility condition), not safe (every other failing condition), and already enforced (not moved, so not judged or read).
  • ui/src/routes/fleet/ModeChangeDialog.tsx: when Enforced is picked, the dialog shows the promote dialog's verdict block.
    • When every workload that would move is safe, the block reads "Safe to enforce" / "No observed traffic would be dropped." and the change takes one step, as a promotion does.
    • Otherwise the block reads "Not safe to enforce yet" with "No simulation evidence for N of M selected; Not safe to enforce for N of M selected." Under it are rows on the canvas well: "Never simulated" with hostname links, each unsafe workload with its link and the review's first failing condition, then "Safe to enforce" and "Already enforced" counts.
    • One acknowledgment covers the batch: "I understand this workload is not safe to enforce yet" / "I understand N of these M workloads are not safe to enforce yet". The confirm reads "Enforce anyway on N workloads" and keeps the promote dialog's nudge.
    • While the evidence loads, or if it cannot be read, the confirm stays held and nothing is written. The confirm is held through aria-disabled and stays focusable, as the promote dialog's is.
    • Changes to visibility or simulation read nothing and stay one step.
  • Docs: ADR-0001 gets a dated amendment with its consequence corrected in place. ARCHITECTURE.md (workload inventory), docs/guides/promotion-and-enforcement.md (the warning callout), docs/reference/innerwall-cli.md (set-mode), and a design-package extension record in docs/design/PACKAGE.md (proposed for acceptance, with the copy it adds) are updated. CHANGELOG has an Unreleased entry.
  • No change to the API contract, the openapi document, the proto, or the command line.

How it was tested

From ui/: npm test passes 349 tests in 20 files (341 before). npm run lint and npm run build are clean.

The new and updated tests cover:

  • a never-simulated workload: the click writes nothing, shows the nudge, and moves focus to the acknowledgment; once it is checked, the write happens;
  • safe evidence: the four rollups and the gaps are read per workload over 24h, and the change takes one click;
  • a mixed selection of five: the counts, the rows, one checkbox, and no reads for the already-enforced workload;
  • an evidence read failure: nothing is written;
  • visibility and simulation targets: one click, no reads;
  • the workload page's dialog: safe, never simulated, and the simulation target.

With the dialog change reverted, the seven gate tests fail. The visibility and simulation tests pass both ways, by design, because they guard unchanged behavior.

Not verified

There was no browser or live control plane here, so the dialog has not been seen rendered and the per-workload reads have not run against a real store. No Go code changed.

Fixes #94.


Generated by Claude Code

…nd asks for the acknowledgment

The fleet's "Change mode for selected…" and the workload page's
"change…" enforced in one step with no verdict, even for a workload
with no flows and no time in simulation, while the review's promotion
asks for an explicit acknowledgment past any verdict that is not safe.
Both call the same endpoint and the same domain function, which accept
any mode change: the gate is the console's (ADR-0001 as amended).

ModeChangeDialog now reads, for each workload a change to enforced
would move, the verdict the review composes for that workload alone,
over the review's default range: the same four rollups and evidence
gaps loadReview reads, by workload, through the same buildRows and
composeVerdict (loadWorkloadEvidence in review/data.ts). enforceEvidence
divides the selection into safe, never simulated, not safe, and already
enforced. When all are safe the change is one step, as a promotion is;
otherwise the promote dialog's verdict block counts them ("No
simulation evidence for N of M selected", "Not safe to enforce for N of
M selected"), lists the workloads behind each count, and the confirm
waits on one acknowledgment for the selection, with the promote
dialog's nudge. Nothing is written while the evidence is read or if it
cannot be. Changes to visibility or simulation stay one step and read
nothing.

ADR-0001 takes a dated amendment; ARCHITECTURE.md, the promotion guide,
the command-line reference, and the design package's extension record
say where the gate now stands. The command line and the operator API
are unchanged.

Fixes #94.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

No ADR contradictions found (full-corpus audit — the diff touches docs/adr/0001-visibility-before-enforcement.md).

What the change does

The console's two mode-change paths that bypass the simulation review (the fleet's Change mode for selected… and the workload page's change…) now compose, for each workload a move to Enforced would touch, the same verdict the review composes for that workload alone over the review's default range (24h), using the same shared buildRows/composeVerdict from ui/src/routes/review/model.ts via the new loadWorkloadEvidence in ui/src/routes/review/data.ts. When any workload is not safe or never simulated, the dialog (ui/src/routes/fleet/ModeChangeDialog.tsx) counts and names them and withholds the write until an explicit acknowledgment is checked; a safe selection still writes in one step. No backend, proto, OpenAPI, or command-line code changed — the dialog still calls the existing POST /api/v1/mode-changes through createModeChange, reading only existing public REST endpoints (/api/v1/flows/rollup, /api/v1/flows/gaps, /api/v1/address-groups).

ADR-0001 conformance

ADR-0001's core Decision (visibility → simulation → enforcement; "the console gates it behind an explicit acknowledgment whenever the evidence does not support it") is untouched — only a Consequences bullet is corrected in place:

Every enforcement decision is offered with its evidence... The console refuses to enforce past an unsafe verdict or missing evidence without the operator's explicit acknowledgment, whether the change starts at the simulation review's promotion or at one of the console's mode changes.

This is a narrowing/correction of a subsidiary point (closing a gap where the gate previously covered only the review's promotion, not the fleet/workload mode-change dialogs), not a reversal of the core decision — the backlog item ("a server-side evidence guard... is recorded backlog") stands unchanged, and the implementation confirms the surface and command line still accept a mode change with no evidence or acknowledgment (internal/fleet/fleet.go's ChangeMode, cmd/innerwall/workload.go's set-mode — neither touched by this PR). This matches docs/adr/README.md's definition of an in-place amendment: it corrects body text, stands under a dated ## Amendments entry ("2026-11-25 (issue #94)"), references the issue, and does not restate the whole document or touch the Decision section. The Consequences bullet's inline marker is updated to *(Amended 2026-10-06 and 2026-11-25; see Amendments.)*, consistent with the other dated markers in the file. No Supersedes: header is added or needed, and none is claimed.

Checked against the full ADR corpus for drift the diff could have introduced: all Status:/Supersedes:/Superseded by lines across docs/adr/*.md remain mutually consistent (ADR-0005 → Superseded by ADR-0017, which carries Supersedes: ADR-0005; ADR-0004/ADR-0016's non-supersession relationship is unchanged); CLAUDE.md's hard rules don't cite ADR-0001 and are unaffected by this change. No dangling references: the ADR-0001 and #94 references added in code comments and docs resolve, and ROADMAP.md's existing "server-side evidence guard" backlog line (referenced from docs/guides/promotion-and-enforcement.md) still exists and matches.

Other documents touched

ARCHITECTURE.md (workload inventory bullet), docs/guides/promotion-and-enforcement.md, docs/reference/innerwall-cli.md, and docs/design/PACKAGE.md (new "proposed for the maintainer's acceptance" section, following the same framing as the existing ADR-0023 extension entry in the same file) are all updated consistently with the ADR-0001 amendment and the shipped behavior — no inconsistency found between these and the code or the ADR record.

No comparisons to competing products or origin-story references were introduced; no Makefile, migration, proto, or generated-file changes are in this diff; the UI changes read only the public REST façade and add no backchannel.

@avi-papineni
avi-papineni merged commit 3ec51b2 into main Nov 25, 2026
13 checks passed
@avi-papineni
avi-papineni deleted the console/fleet-enforce-gate branch November 25, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fleet "Change mode" can enforce a workload with zero simulation evidence — it bypasses the promote flow's verdict gate

2 participants