Skip to content

Port the control receiver write path (/apply, /upgrade, spool) to Rust #713

Open

Description

@pithead-developer

What's the problem

The write half of util/control-server.py is the writable path (ADR 0001): POST /apply and /upgrade and the spool that root-side units consume. Any divergence is a privilege or availability bug.

What it impacts

Remote config apply and remote upgrade from Pithead or a LAN client; the spool consumed by control-apply and control-upgrade. Blocked by #699-#701 landing in Python first.

How I found it

Reading util/control-server.py and its tests (tests/test-control-hardening.sh, test-control-spool-cap.py, test-control-replay.sh, test-control-revocation.sh, control-revocation.py) at ea41133. Behavior to preserve: POST /apply with WRITABLE keys (pools, DONATION, autotune, watchdog, watchdog_interval_min, max_temp_c), refusal of unsafe thermal removal and Tor-unsafe donation changes, body 1..65536 bytes, 411/413/415/400, 202 with change_id, 503 when MAX_PENDING (20) is full, 202 with warning on DurabilityUncertain; POST /upgrade exactly {"version":"vX.Y.Z"}, 403 unless control_upgrade is enabled; atomic spool writes with fsync of file and directory.

How important is it

Medium for the port, high for care: it must not widen anything.

Acceptance criteria

  • With RIGFORGE_IMPL=rust, make test-suite passes unchanged, including every test-control-* script and control-revocation.py.
  • The shared table-driven harness from Port the control receiver read path (/status, auth, readiness) to Rust #712 covers every status code and body above against both servers with identical expected output.
  • The writable key list is the same set and the allowlist-subset guard in tests/run.sh passes.
  • A test kills the process between temp write and rename and asserts no claimable partial file exists; file and directory fsync are asserted via strace or an injected hook; MAX_BODY and MAX_PENDING limits hold.
  • PARITY.md updated; the Python server is kept until the flip. make check passes.

Possible solutions

Activity

  1. added this to the v1.20.0 milestone on Nov 17, 2026
  2. added
    enhancement
    refactor
    security
    blocked
    P3-hardening
    size:L
    on Nov 17, 2026
  3. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Blocked by #699, #700 and #701 (native links added).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-hardeningblockedenhancementrefactorsecuritysize:L

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions