Skip to content

spec: sheltering an app, the other choice runtime preflight offers (draft) - #77

Merged
TusanHomichi merged 6 commits into
mainfrom
claude/project-thread-pzmnbf
Oct 13, 2026
Merged

TusanHomichi merged 6 commits into
mainfrom
claude/project-thread-pzmnbf

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

Requested by Peter · project thread

What this adds

This is a design-only spec change: one new SPEC.md section, "Sheltering an app (draft: not built yet)". Nothing in it is built yet.

Before: Runtime preflight (#73) offers "shelter" when a route drops Python 2 before the hardware stops, but SPEC never says what a shelter is.

After: SPEC defines it:

  • The host goes to the target release. The owner's Python 2 programs keep their old userland, in a container of their own.
  • That userland is built from the starting release's own packages, at the versions the box has installed. Packages are fetched from the vendor's vault by digest, and the build refuses if the bytes are gone. It's never a snapshot of the live /usr.
  • Files no package owns are listed with their hashes.
  • A lock records everything, and the run records the lock.
  • The container runs under the landing release's own podman, by image digest. Every release where Python 2 drops ships podman 4.3 or newer, as read from the indexes.
  • Defaults: read-only root, --userns=auto, no capabilities, no new privileges, and a private network. Each TCP connection or listen is an opt-in, prefilled from what preflight saw the program do (Peter's call).
  • Code is mounted read-only. Data is mounted, not copied.

How it's delivered:

  • Five typed ops: build, prove, stop-native, move-cron, start.
  • The first version covers process and cron users. mod_wsgi comes second.
  • Order of work: a box with its own Python 2 app (el/centos7-pyapp) first, then CI by chroot, then the VM tier on remi for real podman.
  • The security section says plainly that the app's Python 2 and its libraries stay unpatched.

Until the archive (#19) exists, the vault is the only source. A dead vault means no shelter.

Claims issue: none

Model

None. Hand-written in the dep-lab project thread.

Evidence

  • python3 wend check: ok. SPEC.md is the only file changed.
  • The podman versions come from the landing releases' indexes, read 2026-10-13: alma9/alma10 5.8.2, bookworm 4.3.1, trixie 5.4.2, noble 4.9.3, resolute 5.7.0.

Self-review

  • Preconditions: n/a, no fixes
  • Fixes the real problem: n/a, design only
  • One problem: the shelter design only
  • No edits to SPEC.md: this is a maintainer spec change, so it edits SPEC.md on purpose
  • Commits are signed off

🤖 Generated with Claude Code

https://claude.ai/code/session_016XrCggTfrYZFPiDyPrhqLF


Generated by Claude Code

…raft)

Design only, nothing built. A sheltered app keeps the old userland it runs on
now, built from the starting release's own packages at the box's installed
versions (fetched from the vendor's vault by digest, refused if the bytes are
gone, never a snapshot of /usr), run under the landing release's podman by
image digest, read-only, userns, no caps, private network with opt-ins
prefilled from the connections preflight saw, code read-only and data mounted
rather than copied. Five typed ops, a box first, CI by chroot and the VM tier
on remi for the real podman. Says plainly that the app's Python 2 and its
libraries stay unpatched.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016XrCggTfrYZFPiDyPrhqLF
Signed-off-by: Claude <[email protected]>
@TusanHomichi TusanHomichi self-assigned this Oct 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:25:19.412335Z dcd353f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the needs-claude-review Waiting on the Claude review layer label Oct 13, 2026

Copy link
Copy Markdown
Member Author

Changes requested on bcdfd83

I read "Sheltering an app" alongside Runtime preflight, Hardware preflight, Sandbox requirements, Run (pinned sources), open question 12 and AGENTS.md. The overall shape holds up. It builds the userland from vendor packages, not a /usr snapshot. It names the carried layer. It calls itself a tourniquet. It refuses when the bytes are gone. The private /dev matches the sandbox rule. I found five problems that are contradictions or false claims.

Blockers

1. --userns=auto contradicts the read-write data mounts and the "same uid" promise.

--userns=auto, so the container's root is not the host's root; the program runs as the uid it runs as now

Data is never copied, so the host and the shelter see the same bytes

With --userns=auto, the app's uid inside the container (say 995) maps to a high host uid (100000+995). A plain bind mount of /var/lib/billing, owned by host uid 995, shows up inside as nobody, so the app can't write it. There are only three ways out, and the spec chooses none of them:

  • :U chowns the host's data, which breaks the host side and the "same bytes" claim.
  • :idmap needs podman 4.3 or later, a 5.12+ kernel and filesystem support, and its behaviour on podman 4.3 is uneven.
  • Dropping userns=auto gives up the security claim.

Rootful --userns=auto also fails unless /etc/subuid and /etc/subgid have a containers entry. Debian and EL don't create one, and no op writes it.

On EL, SELinux makes this worse. container_t can't read or write var_lib_t data, or connect to MariaDB's socket (mysqld_var_run_t), without relabeling. A :z relabel of /var/lib/mysql or of the owner's data changes host labels: that's an unrecorded host mutation, and it can break mysqld itself. The spec has to say how uids and labels reach the mounts, and which ops write subuid or labels.

2. The network section contradicts itself and claims a mechanism podman doesn't have.

Network: private by default (every connection is an explicit opt-in) ... a program already talking to MariaDB on 127.0.0.1:3306, or out to an API, gets exactly those routes proposed

An app that needs TCP to a host service or the internet is named by the plan. The owner then opts in to network = "host"

The first passage offers per-connection opt-ins. The second says any TCP to the host or the internet needs network=host. Podman has no per-destination egress allow-list:

  • --network=none blocks everything.
  • Rootful netavark's default bridge allows all outbound traffic, so it isn't "private".
  • From a bridge, 127.0.0.1:3306 is the container's own loopback, not the host's.

Making "every connection is an explicit opt-in" true would take firewall rules wend writes itself, which is new untyped host state. Choose one model: none plus unix sockets plus published ports, with host as the recorded exception. Then say what "private" means.

3. The bind-mounted unix socket goes stale.

Unix sockets it has connected to (MariaDB's mysql.sock ...) are bind-mounted.

Bind-mounting a socket file pins its inode. When MariaDB restarts (a package update, a reboot ordering race), it makes a new socket and the shelter keeps the dead one. You have to mount the directory instead. On EL that directory is /var/lib/mysql, the datadir, so mounting it hands the app the database files read-write. The spec needs a safe answer here, for example a dedicated socket directory set by an op.

The MySQLdb claim itself is correct: libmysqlclient treats host="localhost" as the unix socket. It connects to the shelter library's compiled-in default path, though (EL7 /var/lib/mysql/mysql.sock, Debian /run/mysqld/mysqld.sock), so the mount target has to be that path.

4. "Pinned" index digests: the claim is false as written.

through the same pinned metadata a run's hops[].sources already carry: the index's digest is pinned

Run says: "A hop records only its own release's repos". No hop records the starting release's repos, so no proven run pins the index the shelter is built from. As designed, the shelter's top hash is whatever the client fetched that day. That's trust on first use over TLS, and for EL the chain has gpgcheck=0. Say so. Alternatively, define where the starting release's index digests get pinned, such as a box build record.

A related gap: archive.debian.org and old-releases.ubuntu.com carry only each suite's final versions. "At the exact versions installed on the machine now" therefore refuses every Debian or Ubuntu machine that isn't fully patched. That is consistent with refusing, but the sentence "Shelter depends on no unbuilt infrastructure" should name this (it needs snapshot.debian.org or wend#19).

5. "Keeps the old userland it runs on now" contradicts where the ops sit in the hop sequence, and the chroot proof doesn't prove the confinement that ok depends on.

Only the owner's Python 2 programs keep the old userland they run on now

shelter.stop-native | pre phase of the hop that drops Python 2

On a multi-hop route the app keeps running natively through every hop before the drop. Take an EL5 start: Python 2.4, then 2.6, then 2.7, with MySQLdb and openssl changing along the way. Then it gets sheltered back onto a userland built from the starting release. That userland is not the one it ran on "now", and data written by the newer native stack may not read back. Either move stop-native/start to the first hop that changes the app's interpreter or the libraries it maps, or build from the last release before the drop and say so.

Separately:

The verdict is ok only when every own Python 2 user is in a shelter that shelter.prove passed.

shelter.prove and the CI tier both chroot into the shelter root. That proves the userland runs. It doesn't test the defaults that actually break apps: the uid mapping on the mounts, SELinux denials, --read-only, --cap-drop=all, no-new-privileges, and network none or a bridge. As written, a green prove and green CI can still end in a shelter that fails at its first real start on the box, after the hop that already stopped the app. Either emulate those restrictions in prove (unshare -U with the same mapping, a read-only root, the same network) or say that only the VM tier proves confinement. Then don't let ok claim more than prove shows.

Notes (not blocking)

  • The shelter.* ops are per machine. They belong to no fix or route, but the section calls them typed ops "in fixes". Say which of the four things carries them: a client plan, recorded in the run.
  • move-cron writes a timer in the pre phase, but podman only arrives in the post phase. Create the timer disabled and enable it in start. A cron line is shell text (cd X && ./job >> /var/log/x 2>&1). Running it "the same" in the shelter needs a shell, plus mounts for log files and any other binaries it calls, and cron's MAILTO is lost. Cron's day-of-month/day-of-week OR rule and @reboot don't map 1:1 to OnCalendar.
  • A loaded image has no RepoDigest. "Run by digest" means the image ID (the config digest). Alternatively, --rootfs avoids a second copy in /var/lib/containers. Either way, hardware.disk_mib doesn't count the shelter and the image store.
  • On XFS with ftype=0, overlay storage refuses to work. Preflight should check d_type before the first hop, not leave it to shelter.start after the reboot.
  • Package-owned files the app's pip upgraded (EL7's pip writes into /usr/lib/python2.7/site-packages) come back as the vault's old version. Diff against rpm -V or dpkg md5sums and carry what was modified.
  • An app user created with useradd isn't in the package-built root's /etc/passwd. --userns=auto defaults to a 1024-uid range, so an app uid above that needs size=. Ubuntu runs podman's AppArmor profile, not SELinux, so name both.
  • "Refused: carrying old packages onto the host" sits next to an old-package root under /var/lib/wend. Say "never installed into the host's package database".
  • Facts need new fields (TCP connections, mapped and opened files, cron -v imports), so this is a wend.hardware/3 schema bump. Say so.
  • I couldn't check the podman versions against the indexes from here. bookworm 4.3.1 (no quadlet before 4.4), trixie 5.4.2 and noble 4.9.3 match what I know.

Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcdfd8365f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SPEC.md Resolved
Comment thread SPEC.md Resolved
…k model, socket proxies, honest pinning, sequencing and proof tiers

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016XrCggTfrYZFPiDyPrhqLF
Signed-off-by: Claude <[email protected]>

Copy link
Copy Markdown
Member Author

Answering the changes-requested review on bcdfd83. The fixes are in f127467 (SPEC section rewritten):

  1. userns vs data mounts / SELinux. The shelter runs with --userns=auto:size=65536 from a dedicated subuid/subgid containers range. Data mounts use :idmap, so files on the host keep their real owners. :Z applies only to directories the app alone uses, and their labels are restored on removal. Debian and Ubuntu get AppArmor.
  2. Network contradiction. There is now one model. Each shelter gets its own podman network with a wend nftables inet wend_shelter egress allow-list. Private is the default and every connection is an opt-in, prefilled by preflight from the connections it observed. Reaching TCP on host 127.0.0.1 needs an explicit network="host" opt-in or a change to the app.
  3. Stale socket bind mount. Host sockets are no longer bind-mounted. A systemd-socket-proxyd for each socket lives in /run/wend/shelter/<app>/, so a restarted host service doesn't strand the shelter.
  4. False pinning claim / archives keep only final versions. The userland is the keeps_runtimes_on release at its final versions, not the box's installed builds. Packages are verified with the release's own signing keys, which are already on the box, and the lock records the index digests. If the vault is gone, wend refuses before touching the box and there's no --live. Until Make a vanished repo snapshot rare: archive + fallback chain #19 exists, the vault is the only source.
  5. Sequencing / untested confinement. The ops are client steps that run from the confirmed plan, not fixes. They run in order: build, prove, stop-native, start. shelter.start's checks run under real confinement, and a failure rolls back the hop. CI proves only the userland. Confinement is proved on the VM tier.

Notes also addressed:

  • Carried layer = files the box changed plus the app's passwd/group lines.
  • Image size counts toward disk_mib.
  • XFS with ftype=0 is refused.
  • Cron moves to an exact OnCalendar or is refused. MAILTO is lost, and the spec now says so.
  • The facts schema bump is called out.
  • The refused list is expanded.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Changes requested on f127467

I re-read "Sheltering an app" at f127467 against the review of bcdfd83, Runtime preflight (keeps_runtimes_on, the EL8 may_skip) and Run.

The five earlier blockers

  1. userns and data mounts: resolved. --userns=auto:size=65536 from a containers range that shelter.start writes, plus :idmap, and :Z only on directories the app alone uses, with a restorecon on removal. AppArmor is named.
  2. Network: resolved as a design. There's one model now: a per-app network, an nftables egress table, and host as a named exception. See new blocker 4.
  3. Stale socket: resolved. A per-connection systemd-socket-proxyd in /run/wend/shelter/<app>/ survives a MariaDB restart, and the datadir is never mounted. See new blocker 3.
  4. Pinning: mostly resolved. The text no longer claims a run pins the index, and it says the archives keep only final versions. One claim about EL is false (new blocker 2).
  5. Sequencing and confinement: resolved. The userland is now the release the app runs on when it drops, and shelter.start tests confinement on the box and rolls back if it fails. The CI and VM tiers now claim only what each one proves.

New blockers

  1. Build and prove run "before the first hop", but on a multi-release route they build a later release's userland from the starting release's facts. The spec's own example is etch to trixie with a bullseye shelter. On the etch box:

    • /proc/<pid>/maps, the imports and rpm -V/md5sums describe Python 2.4 and etch's package names. Many of those packages were renamed in bullseye, or bullseye dropped them (it removed most python-* modules).
    • The carried layer copies 2.4 site-packages into a 2.7 root.
    • "Signing keys the box already trusts" is false, because an etch box has no bullseye key.

    Either gather facts, build and prove at the pre phase of the drop hop, when the box is on keeps_runtimes_on, with the free-space and vault checks still made before the first hop. Or restrict v1 to routes whose starting release is keeps_runtimes_on (EL7, and the jammy and bullseye starts), and say so.

  2. The EL index isn't signed. CentOS 7's repomd.xml on vault.centos.org has no detached signature, so "checks the index's signature against the release's own signing keys" can't hold on EL. On EL the trust anchor has to be each package's RPM header signature (rpmkeys --checksig against RPM-GPG-KEY-CentOS-7). The index digests in the lock are then trust on first use. Say that, as the previous review asked for EL's gpgcheck=0 chain.

  3. The socket proxy's identity and label.

    • Run as a plain unit, systemd-socket-proxyd connects as root. MariaDB 10.4 and later, which every landing release ships, gives root@localhost unix_socket auth. Through the proxy, anything in the shelter that asks for user root gets database root with no password. That undoes the userns and cap-drop story.
    • An app that itself authenticates by unix_socket breaks, because the peer is now root.
    • The proxy must run as User= set to the app's host uid. Say so, and record it.
    • On EL the proxy directory needs a label container_t can connect through (:Z on that app-only directory, or a container_file_t sock_file). Otherwise SELinux denies the connection, and only shelter.start would find out.
  4. The egress table has to fail closed across reboots. "wend adds an nftables table" doesn't say how the table comes back after the hop's reboot. If it doesn't, the shelter starts on an open bridge, because netavark's default allows all egress, and "private" silently becomes false. Load the table from a wend unit that the shelter's unit Requires= and orders After=. The spec should also state that the table allows:

    • ct state established,related (published ports and the replies to them)
    • DNS to the network's gateway (aardvark-dns), when the network has DNS.

Notes (not blocking)

  • Rollback after a failed shelter.start should restore the :Z labels and remove the subuid line, nftables table and proxy units, not only stop the container.
  • Idmapped mounts need 5.12 or later for ext4 and XFS, 5.15 for btrfs, and don't work on NFS. Preflight should check the data directories' filesystem, as it does ftype.
  • Cron's day-of-month/day-of-week OR rule translates exactly only as two OnCalendar= lines. Say so, so "exact" stays true.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Answering the changes requested on f127467. The fixes are in ac7bda0:

  1. Build from the starting release's facts. The shelter is now built and proved while the box is on keeps_runtimes_on. On a route that starts there, that's before the first hop. Otherwise it's the pre phase of the drop hop.
    • Before the first hop, the plan checks the vault's index, the free space, and the app-level choices the owner confirms.
    • If the drop hop's facts need something the confirmed plan didn't list, shelter.build refuses. The box then stays on keeps_runtimes_on with the app running natively, which is the stop option.
    • Signing keys are now the ones the box trusts at that point.
  2. EL index isn't signed. Correct. On Debian and Ubuntu the anchor is the signed index (InRelease/Release.gpg). On EL it's each package's RPM header signature (rpmkeys --checksig), and unsigned packages are refused. On EL the lock's index digests are now called trust on first use.
  3. Socket proxy. It runs as User= the app's host user, recorded in the run, never as root. The spec gives the reason: MariaDB 10.4+ unix_socket root auth. On EL the proxy directory gets :Z. Whether container_t may connectto the proxy is left to the VM tier. A denial fails shelter.start's check, and the hop rolls back.
  4. Egress has to fail closed. The table is loaded by wend-shelter-net-<app>.service, which the shelter unit Requires= and starts After=. The table allows ct state established,related and DNS to the gateway. The spec now says why: netavark's own rules allow all egress.

Notes:

  • Rollback now removes everything shelter.start added and restores the :Z labels.
  • Preflight refuses data directories on a filesystem that can't be idmapped (NFS, older kernels).
  • A cron line with both day-of-month and day-of-week becomes two OnCalendar= lines.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Changes requested on ac7bda0

I re-read "Sheltering an app" at ac7bda0 (diff against f127467) and the answer in 6148782350.

Last round's blockers

  1. Build from the starting release's facts: resolved. "When" builds and proves on keeps_runtimes_on: before the first hop if the route starts there, otherwise in the drop hop's pre phase. The keys are the ones the box trusts at that point. If the plan changed, the build refuses and the box stays at the stop option.
  2. EL index unsigned: resolved. Debian and Ubuntu are anchored on InRelease/Release.gpg, and EL on each package's RPM header signature. Unsigned packages are refused, and the EL index digests are called trust on first use.
  3. Socket proxy identity and label: resolved. The proxy runs as User= the app's host user, never root, and the reason is given. The proxy directory gets :Z. Whether container_t may connectto the proxy is left honestly to the VM tier, with a rollback if it fails.
  4. Fail-closed egress on reboot: resolved for boot. The shelter's unit has Requires=/After= on wend-shelter-net-<app>.service, and the table allows established traffic and DNS to the gateway. One gap is left, and it's below.

The three notes (rollback cleanup, idmap filesystem check, two OnCalendar= lines) are all addressed.

Blocker

  1. The table still fails open while the system is running. The Requires= unit only stops the shelter from starting without the table. Nothing notices if the table goes away while the shelter is running, and the stock firewall services remove it routinely:

    • Debian's shipped /etc/nftables.conf starts with flush ruleset, so systemctl restart|reload nftables deletes inet wend_shelter.
    • EL's nftables.service runs nft flush ruleset on stop and reload.
    • The oneshot stays "active" through all of this, so the shelter keeps running on netavark's open bridge. That is exactly the "quietly public" case the spec says it prevents.

    The spec should do one of these:

    • Have wend-shelter-net-<app>.service declare After=nftables.service firewalld.service and PartOf=nftables.service, so a restart or reload of nftables reloads the table, and say that a manual nft flush ruleset still opens it.
    • Or narrow the claim to "fails closed at start".

    One sentence either way.

Notes (not blocking)

  • The proxy's listening socket is reached by the shelter's mapped uid through a :Z mount that has no :idmap. The .socket unit needs SocketMode=0666, or SocketUser= set to the mapped uid, or the connect is refused by permissions before SELinux is involved.
  • "Before the first hop the plan checks that the vault serves that release's index." On a longer route the box can't verify that index's signature yet, because it doesn't have those keys. Say the early check is reachability only.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Answering the changes requested on ac7bda0. The fixes are in 4b2ac20:

  1. The egress table could vanish while the shelter runs. The table unit now has After=nftables.service firewalld.service and PartOf=nftables.service, and the shelter unit uses BindsTo= on the table unit. A restart or reload of nftables.service now restarts the table, and the shelter restarts with it. The spec says plainly that a hand-typed nft flush ruleset still opens it.

Notes:

  • The proxy's socket is now owned by the shelter's mapped uid (SocketUser=, mode 0600), because that mount has no :idmap.
  • The spec now says the before-first-hop vault check confirms only that the index is reachable. Its signature can't be checked yet.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Changes requested on 4b2ac20

I read the diff from ac7bda0. The "reachable only" note is resolved. The other two changes each add a claim that systemd and podman don't back up.

Blockers

  1. PartOf= doesn't propagate reload.

    • The spec now says "restarting or reloading nftables.service ... restarts the table unit". PartOf= passes on only stop and restart.
    • systemctl reload nftables runs ExecReload on Debian (nft -f /etc/nftables.conf, whose first line is flush ruleset) and on EL (which flushes, then loads). That deletes inet wend_shelter, and the table unit stays active, so a running shelter goes public again.
    • The fix is to add ReloadPropagatedFrom=nftables.service and give the table unit an ExecReload that reloads its table, or to drop "or reloading" from the claim.
    • Restart is correct as written: PartOf= restarts the table unit, BindsTo= restarts the shelter with it, and After= keeps the order.
  2. SocketUser= set to "the mapped uid" has no fixed value under --userns=auto.

    • Podman allocates an auto range from the free part of the containers subuid range every time the container starts. Nothing guarantees the host uid behind the app's uid is the same across restarts, or after another container takes a range.
    • A .socket unit written once with SocketUser=<host uid> and mode 0600 will at some point refuse the shelter's connections.
    • Either pin the mapping (an explicit --uidmap/--gidmap from a range wend reserves and records in the run; :idmap data mounts work with any mapping), or make the socket reachable without depending on the uid. For example, a SocketGroup= the container's mapped gid range can't change, or mode 0666 on an app-only :Z directory. SELinux MCS and the directory being private to the app then do the isolation.

Everything else from the earlier rounds holds.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Answering the changes requested on 4b2ac20. The fixes are in dcd353f:

  1. Reload. The table unit now has ReloadPropagatedFrom=nftables.service, plus an ExecReload= that reloads the table, ordered after nftables. The spec now says there is a brief open window between nftables' flush and that reload, instead of claiming the shelter fails closed through it.
  2. SocketUser= under --userns=auto. I dropped --userns=auto. Each shelter now gets a 65536-id range that wend reserves in /etc/subuid and /etc/subgid under wend-<app> and records in the lock. It runs with explicit --uidmap and --gidmap over that range, so the app's mapped uid is the same at every start. The proxy socket (0600) and its directory (0700) are owned by that uid.

Generated by Claude Code

Copy link
Copy Markdown
Member Author

Sign-off: approve dcd353f

I read the diff from 4b2ac20 against the whole section. Both blockers are resolved, and I found no new false claims.

  1. Reload propagation: resolved. ReloadPropagatedFrom=nftables.service plus an ExecReload= that loads the table again is the right mechanism. Restart still goes through PartOf= and BindsTo=. The spec names the brief open window between nftables' flush and the re-add, and it names the hand-typed nft flush ruleset case. Both are now stated limits, not false claims.
  2. Stable mapped uid: resolved. Explicit --uidmap/--gidmap over a 65536-id range kept in /etc/subuid and /etc/subgid under wend-<app> gives the same host uid at every start. :idmap data mounts work with an explicit mapping. Rootful podman doesn't read /etc/subuid for an explicit map, so the line works only as a reservation. That's what the spec says, and useradd's automatic allocation respects it.

Notes (not blocking)

  • /run is a tmpfs, and a .socket unit creates the missing parent directories of ListenStream= as root:root 0755 (DirectoryMode=). If the proxy's directory has to be owned by the mapped uid with mode 0700 after every boot, something has to recreate it before the socket unit, such as a harness-owned tmpfiles.d line ordered before it. That line also belongs on the rollback list.
  • The reserved range is "recorded in the lock", but the lock describes the build's inputs, and shelter.start reserves the range later. Recording it in the run, as shelters already does, fits better, or say the lock is updated at start.
  • The SELinux connectto question stays with the VM tier, as the spec already says.

Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dcd353f5a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SPEC.md Resolved

Copy link
Copy Markdown
Member Author

Sign-off: approve 1ab8143

The only change since dcd353f is that the shelter unit now also has PartOf= on wend-shelter-net-<app>.service. I checked this against systemd's transaction code (src/core/transaction.c and unit-dependency-atom.c on main).

  • What the spec now claims is true. If the table unit is restarted, including when the restart comes through PartOf=nftables.service, the shelter is restarted too. After= makes the table come back up first, so "after the table is back" holds. BindsTo= still stops the shelter whenever the table unit stops or fails. Reload and the manual-flush caveat are unchanged.
  • The new PartOf= is harmless, but it was never needed. In systemd, both BoundBy (the reverse of BindsTo=) and ConsistsOf (the reverse of PartOf=) carry UNIT_ATOM_PROPAGATE_STOP. That one atom propagates both a stop and a restart: transaction_add_job_and_dependencies turns a JOB_RESTART into a JOB_TRY_RESTART on every unit holding it, and keeps propagating from there. So BindsTo= on its own already restarted the shelter whenever the table unit restarted, and the Codex finding doesn't match how systemd behaves. Keeping both directives does no harm.

Note (not blocking)

  • The parenthetical ("BindsTo= stops the shelter ...; PartOf= starts it again") credits only PartOf= with the restart. A shorter wording would be accurate: "BindsTo= stops the shelter when the table goes away and restarts it when the table unit restarts. PartOf= is there for clarity." You can leave it as it is, since the behaviour the spec describes is correct either way.

Generated by Claude Code

@TusanHomichi
TusanHomichi merged commit 2652778 into main Oct 13, 2026
6 checks passed
@TusanHomichi
TusanHomichi deleted the claude/project-thread-pzmnbf branch October 13, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-claude-review Waiting on the Claude review layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants