Skip to content

fix: keep a stored enforce-all value buildable - #887

Open
ppat wants to merge 1 commit into
mainfrom
fix/watchdog-enforce-all-stored-value
Open

fix: keep a stored enforce-all value buildable#887
ppat wants to merge 1 commit into
mainfrom
fix/watchdog-enforce-all-stored-value

Conversation

@ppat

@ppat ppat commented Aug 22, 2026

Copy link
Copy Markdown
Owner

What this fixes

#884 retired the enforce-all watchdog mode and added a mapping in local.validated_watchdog_mode so that a workspace still carrying the stored value would be treated as enforce"because it had asked for more enforcement and must not silently get none."

Verified on the disposable test workspace: that mapping never runs. Coder validates a build's parameter values against the target template version's option list before Terraform is planned, so a workspace whose stored value is enforce-all cannot be built on the #884 template version at all:

parameter validation failed
can't validate build parameter "Memory Watchdog": parameter value must match one of options: [observe enforce]

coder update stops the workspace, prompts for a replacement value, and errors out non-interactively; autostart and every scripted coder start fail the same way.

The failure is loud, not silent — nothing degrades to observe. What breaks is the build, and the mapping #884 added is dead code.

The change

Restore enforce-all as an explicitly deprecated option so the value stays buildable and the existing mapping becomes reachable. The comment now records why the option has to stay. Remove it once no workspace stores the value.

Also

TESTING.md's drill record is replaced with the 2026-08-22 run, which is where this was found. It is the first drill to exercise, against real processes:

  • the 2048 MiB envelope and its seven shares, with no floored=/resting-floor artifacts
  • the oversize vs drift split — processes born above their share reported every dwell period and never signalled; processes seen fitting and then drifting out killed, with TERMKILL escalation and correct re-arming per pid:starttime across respawns
  • event=kill-rate ... enforcing=yes at both the per-role and the cross-role threshold, with enforcement continuing after each
  • the treeHelper role, its <extension>/<script> identity, and fix: govern the in-tree helpers the watchdog could not name #881's structural exclusion of an unrecognised direct child of the server root
  • every never-signal guard that a bare pod can reach (pid1, self, comm, argv0) and the session-boundary exclusion of a setsid-detached process

Action lines reached Loki; sweep rows, correctly, did not.

Testing

  • pre-commit run --all-files green at the base commit and after the change.
  • Base commit f8cc458.

🤖 Generated with Claude Code

https://claude.ai/code/session_0197hA8JPwGMX8wufiQiy6oz

PR #884 retired the "enforce-all" mode and mapped the stored value to "enforce" in
local.validated_watchdog_mode, so that a workspace which had asked for more enforcement
would not silently get none. Verified on a live disposable workspace, that mapping never
runs: Coder validates a build's parameter values against the target template version's
option list before Terraform is planned, so a workspace carrying "enforce-all" is refused
outright -

  parameter validation failed
  can't validate build parameter "Memory Watchdog": parameter value must match one of
  options: [observe enforce]

- and `coder update` stops the workspace, prompts for a replacement value, and errors out
non-interactively. Autostart and every scripted `coder start` fail the same way. The
failure is loud rather than silent, so nothing degrades to "observe"; what breaks is the
build, and the mapping the PR added is dead code.

Restore "enforce-all" as an explicitly deprecated option so the value stays buildable and
the mapping becomes reachable. Remove the option once no workspace stores the value.

Also record the 2026-08-22 live drill in TESTING.md, which is where this was found. That
drill is the first to exercise the envelope construction, the oversize/drift split, the
treeHelper role and the structural exclusion of an unrecognised direct child of the server
root against real processes; its action lines are in Loki and its sweep rows, correctly,
are not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0197hA8JPwGMX8wufiQiy6oz
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.

1 participant