Skip to content

fix(bootstrap): put the setup-request gate behind a setting that defaults off - #50

Merged
github-actions[bot] merged 3 commits into
mainfrom
fix/844-setup-request-gate-flag
Nov 6, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
fix/844-setup-request-gate-flag

Conversation

@znerol2

@znerol2 znerol2 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Since 89d9bb1, a fresh bootstrap pauses before configure and waits, with no timeout, for a setup request ID that the operator creates in the DMF Console. The console can only create that ID once dmf-infra deploys its setup-request support, which is still in the draft dmfdeploy/dmf-infra#118 and #119. A bootstrap from main therefore stalls.

This PR puts the gate behind a setting that defaults off:

  • The setting: the new DMF_SETUP_REQUEST_GATE environment variable maps to Settings.setup_request_gate and is off by default. It follows the same pattern as DMF_TLS_ENABLED.
  • Off (the default): neither the initial-passkey pause nor the setup-request pause runs, and no ID is required. The order is configure, then workstation, then passkey, as it was before 89d9bb1. The resume route returns 409 for both gate pauses, and retry from disk doesn't add them back.
  • On: behavior is unchanged, including the server-side checks and ID redaction from fd5aec1.
  • initial-passkey is gated too. It arrived with the same commit and exists only so the operator can sign in to the console and create the ID. The passkey pause after configure stays either way.

The README gets a short note saying the gate stays off until the dmf-infra setup-request support lands.

Follow-up

The change that lands dmfdeploy/dmf-infra#118 and #119 turns this default on. bin/dmf-init doesn't forward the variable yet; until then, pass it with docker -e.

Tests

  • New tests/test_setup_request_gate.py, 9 tests. It covers the setting, the step graph with the gate on and off, a fresh run, retry from disk, and the resume route. All 9 fail on main. When the default is set to on, the 3 default-off tests fail.
  • Existing gate tests now turn the gate on explicitly.
  • pytest: 146 passed, 2 skipped. ruff reports no issues.

Closes dmfdeploy/dmfdeploy#844

…ults off

A fresh bootstrap waited at the setup-request pause forever, because the
console can't issue a setup request ID until dmf-infra deploys its
setup-request support.

Add DMF_SETUP_REQUEST_GATE (Settings.setup_request_gate), default off. With
it off, configure runs before the workstation pause, with no first-passkey
pause, no setup-request pause and no ID requirement, and the resume route
rejects both gate pauses. With it on, the pauses, the ID requirement, the
server-side passkey check and the redaction behave as before. Fresh runs and
retries from disk read the same setting. Turn the default on when the
dmf-infra support lands.

Closes dmfdeploy/dmfdeploy#844

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@znerol2
znerol2 requested a review from a team as a code owner November 6, 2026 14:51
@github-actions
github-actions Bot enabled auto-merge (rebase) November 6, 2026 14:52
…te mode

A retry inserts steps ahead of its target. When one of them failed, the
journal recorded the step after it, so a restart with the setup-request
gate in the other mode could slice past configure and report success
without configuring.

Keep the original retry target when an inserted step fails, record the
steps that completed, and refuse a workstation cursor when configure is
not recorded as complete. Document that a run waiting at a gate pause
does not survive a container restart.

Refs dmfdeploy/dmfdeploy#844

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
…hanges

The step order depends on the gate setting, so slicing a graph at a cursor
written under the other setting can skip a step that never completed. The
resume journal now records the gate setting the run was built with. A retry
from disk, or from a run still in memory, is refused with 409 when the
recorded setting differs from the current one or is missing or not a JSON
boolean. Retries in the same setting behave as before.

This replaces the retry-target and completed-step bookkeeping, which let
completion evidence carry across runs.

Refs dmfdeploy/dmfdeploy#844

Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
@znerol2
znerol2 requested a review from lkirc November 6, 2026 15:22

@lkirc lkirc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review of 870cc15: the default-off gate is consistently threaded through fresh and retry graphs, and retry cursors safely reject changed or unknown gate modes. Required checks are green; no blocking findings.

@github-actions
github-actions Bot merged commit 0233cbe into main Nov 6, 2026
14 checks passed
@znerol2
znerol2 deleted the fix/844-setup-request-gate-flag branch November 8, 2026 17:44
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.

dmf-init: a fresh bootstrap stalls at the setup-request pause

2 participants