Repository navigation
console: a change to enforced outside the review shows the evidence and asks for the acknowledgment - #255
Conversation
…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>
|
No ADR contradictions found (full-corpus audit — the diff touches What the change doesThe 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 ADR-0001 conformanceADR-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:
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 ( Checked against the full ADR corpus for drift the diff could have introduced: all Other documents touched
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. |
Where the gate lived
composeVerdictinui/src/routes/review/model.tsbuilds it from the review's reads (loadReviewinui/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 wheneververdict.safeis false.POST /api/v1/mode-changes(internal/api/writes.go,createModeChange) andinnerwall workload set-mode(cmd/innerwall/workload.go) both callfleet.(*Service).ChangeMode(internal/fleet/fleet.go), which checks the request's shape and its expected count and nothing about evidence.ModeChangeRequesthas 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).PromoteDialogandModeChangeDialogboth postcreateModeChange. So the fleet path is not a separate, ungated server function. It is a second console path that skipped the console's gate.WorkloadList.tsx) and the workload strip's change… (WorkloadDetail.tsx), which both openModeChangeDialog, plus the review's promotion. Nothing else inui/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:loadWorkloadEvidencereads, for each workload, the same four rollups and the same evidence gaps the review reads for a scope, filtered byworkloadinstead oflabel, over the review'sdefaultRange(24h). It then runs the samebuildRowsandcomposeVerdict, four workloads at a time. No second evidence rule.ui/src/routes/review/model.ts:enforceEvidencesorts the selection into four groups: safe, never simulated (the review'svisibilitycondition), 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.aria-disabledand stays focusable, as the promote dialog's is.docs/guides/promotion-and-enforcement.md(the warning callout),docs/reference/innerwall-cli.md(set-mode), and a design-package extension record indocs/design/PACKAGE.md(proposed for acceptance, with the copy it adds) are updated. CHANGELOG has an Unreleased entry.How it was tested
From
ui/:npm testpasses 349 tests in 20 files (341 before).npm run lintandnpm run buildare clean.The new and updated tests cover:
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