Skip to content

fix(node-runtime): make host-native daemon rendering deployable (OSS-376) - #535

Merged
athNdev merged 3 commits into
mainfrom
codex/node-native-daemon-fix
Nov 18, 2026
Merged

athNdev merged 3 commits into
mainfrom
codex/node-native-daemon-fix

Conversation

@athNdev

@athNdev athNdev commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Post-merge quality fix for PR527 (OSS-376 host-native Linux private daemon). New branch from current main (14a348b8); the merged PR branch is untouched. Addresses all three parent findings, with a real disposable dockerd boot.

Fixes

  1. One source of daemon options. Added exported DaemonOptions canonical renderer and DaemonSpec.BuildManifest() for the OSS-379 installer lane. ExecStart now passes only --config-file on both modes. CheckOptionParity fails on duplicate JSON keys, extra CLI flags, or a config key repeated on the command line. Also removes the merged config's invalid bridge: none + bip pair, which dockerd rejects (-b & --bip, mutually exclusive).
  2. Rootless is a per-user service. Renders dockerd-rootless.sh in a systemd --user unit (WantedBy=default.target, XDG_RUNTIME_DIR in the environment, no User=, no multi-user.target). Direct system dockerd rendering is refused.
  3. Rootful is explicit and compatible. Runs as root (no User=) with the capability set dockerd requires (CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_NET_RAW, CAP_SYS_RESOURCE, file-ownership caps), NoNewPrivileges=no, ProtectSystem=full, cgroup delegation. Empty capability set / non-root User= is refused.

The shared ADR 0019 enrollment contract, proto, DB columns, auth middleware and compatibility gates are unchanged.

Disposable boot evidence (no host install, no shared daemon change)

Pinned docker:29.3.0-dind container booted with the exact daemon.json rendered by the production renderer. Precisely: this is a PRIVILEGED nested ROOTFUL config boot with a json-file log-driver override (the disposable container has no journald):

  • dockerd started; private socket /run/carbon-node/docker.sock exists; private bridge 10.231.0.1/24.
  • Trivial container ran: NESTED_OK.
  • Game port reachable both as published 30123->8080/tcp and on the private bridge at 10.231.0.2:8080 (OPEN/OPEN).
  • Resource limits applied: MEM=67108864 PIDS=12.
  • Data survived a daemon restart: marker persist-marker and container definitions remained; socket and limits re-applied. Running processes did not survive the full container restart (honest limit; no live-restore claim).
  • Both rendered units pass systemd-analyze verify — syntax only, not a boot.

Exact output: external audit file security-runtime-plans/node-native-boot-evidence.md.

Qualification limits — do not overclaim deployability

The boot evidence does not prove the shipped units boot on a clean Linux systemd host:

  • The shipped rootless per-user unit (dockerd-rootless.sh under systemd --user) is NOT yet boot-verified.
  • The shipped rootful unit (dockerd --config-file=... with the capability set) is NOT yet boot-verified; the dind fixture booted the config directly, not via that unit.

Both remain future owned-clean-systemd-fixture work. No live host, release or deployment claim is made.

Verification

  • go build ./..., go vet, go test -count=1 on touched packages + internal/rpc + internal/db (pinned Go 1.26.11): all green.
  • golangci-lint v2.13.2 with pinned toolchain: 0 issues.
  • knowledge-lint -fix then plain lint: 69 concepts / 38 queries pass.

Maintenance update (rebased + review fixes)

  • Rebased onto current main 0b80e9b4 (includes e9b60513). One conflict in
    knowledge/architecture/host-native-runtime.md was resolved semantically:
    kept the shared-enrollment paragraph from main, kept this lane's daemon
    renderer paragraph, and added the qualification-limit statement.
  • Review fixes: replaced the stale DedicatedUIDAvailable rootful gate with
    RootfulServiceQualified (explicit root-managed service; runs as root, no
    User=, capability set required; fail-closed preserved). RenderUnit() no
    longer takes an ignored configPath parameter.
  • Final exact head: dbd9fcd072b3181e3bcf127d4e79f84c432a7e10 (PR head OID
    verified). All 12 CI checks green on this head; the first Backend Test Suite
    run failed only on an unrelated flaky internal/playerskin TestPositiveTTLExpiry
    (passes locally twice) and passed on rerun with no source change.

No merge, release, deployment, registry write, live host or global host config change.

…376)

Post-merge quality fix for PR527; new branch from current main, does not
rework the merged branch.

- One source of daemon options: exported DaemonOptions canonical renderer plus
  DaemonSpec.BuildManifest for the OSS-379 installer. Rendering refuses
  duplicate JSON keys, extra CLI flags and CLI/config conflicts. Removes the
  invalid bridge=none + bip combination that dockerd rejects.
- Rootless now renders a SUPPORTED per-user systemd unit with dockerd-rootless.sh
  and XDG_RUNTIME_DIR (no direct system dockerd, no User=, WantedBy=default.target).
- Rootful now renders an explicit compatible service: runs as root (no User=)
  with the capability set dockerd needs, NoNewPrivileges=no, ProtectSystem=full,
  cgroup delegation; refuses an empty CapabilityBoundingSet or non-root User=.
- LogDriver is a renderer input (journald default; json-file only for
  disposable fixtures without journald).
- Docs, mode gate matrix and knowledge concept updated. Shared ADR0019
  enrollment contract, proto, DB and compatibility gates untouched.

Verification: go build/vet/test (pinned Go 1.26.11), golangci-lint v2.13.2
0 new issues, knowledge-lint 69 concepts/38 queries. Disposable pinned
docker:29.3.0-dind boot validated the rendered config: dockerd starts, private
socket exists, trivial container runs, game ports reachable on private bridge,
memory/pids limits apply, data survives daemon restart; both units pass
systemd-analyze verify. Evidence in external node-native-boot-evidence.md.
…OSS-376)

Maintenance on PR535 after rebase onto current main 0b80e9b (includes
e9b6051). One conflict in the host-native knowledge concept was resolved
semantically: kept the shared-enrollment paragraph from main, kept this lane's
daemon-renderer paragraph, and added the qualification-limit statement.

- State precisely that the real dockerd evidence is a privileged disposable
  nested ROOTFUL config boot with json-file override plus systemd-analyze
  syntax checks.
- State explicitly that the shipped ROOTLESS per-user unit boot and the
  shipped ROOTFUL unit boot on a clean Linux systemd host are NOT verified;
  no deployability claim is made.
- No proto, ADR0019, enrollment, daemon renderer or compatibility gate change.
…model (OSS-376)

Review fixes on PR535 after rebase:

- Replace stale DedicatedUIDAvailable gate with RootfulServiceQualified: an
  explicit operator opt-in for a root-managed systemd service. Rootful runs as
  root with no User= override and the capability set dockerd needs; a dedicated
  non-login UID is neither required nor permitted (DAEMON_ROOTFUL_NO_USER).
  Refusal code/remedy and docs reconciled; fail-closed preserved.
- RenderUnit() no longer takes an ignored configPath parameter; the config
  path comes from DaemonSpec.ConfigPath (the single source).
- Docs state the honest qualification limit: the dind evidence is a privileged
  nested rootful config boot with json-file override, not proof the shipped
  rootless user unit or rootful unit boots on a clean systemd host.
@athNdev
athNdev force-pushed the codex/node-native-daemon-fix branch from 65f6b46 to dbd9fcd Compare November 18, 2026 09:54
@athNdev
athNdev merged commit 8d8c7b7 into main Nov 18, 2026
23 of 24 checks passed
@athNdev
athNdev deleted the codex/node-native-daemon-fix branch November 18, 2026 10:15
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