Repository navigation
#2 Contain the extraction child - #33
Merged
Merged
Conversation
…mpable parent, processor user, /opt tree) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R1–R13, broker#22); feedback for the cohort skill Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t, via ctypes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s closed without containment, reports its build - _child: contain(mode) before reading the request; exit 70 when it cannot - run_in_child(containment=…) required; Deps.containment; CO_PROCESSOR_CHILD_CONTAINMENT (default required) - __main__._run: make_undumpable first; refuse to start under required where unavailable; starting logs build, child_containment, landlock_abi - build_id(): the release's REVISION, else dev - tests: every denial paired with an off control; the whole corpus (cases + real/) through the contained child; report header names the mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…under /srv/processor/live Follows the cohort release standard (broker#22; status#9 R1–R13): git archive of an origin/main commit, wheelhouse, uv sync --locked --no-editable on /usr/bin/python3.12, REVISION last, a-w,go+rX; atomic switch; unit installed from the release; verify by the new MainPID's starting (build, child_containment required) + consuming, then the smoke as the unit's user via systemd-run; switch back on failure (exit 1, or 4). Unit: User=processor, LoadCredential for the GCS key, ProtectSystem=strict, ProtectHome=yes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… processor user, releases and scripts/deploy.sh Spec §3's 'Known limitation' becomes 'Containment'. DEPLOYMENT: /etc/processor/ (root, LoadCredential, processor_cli), releases, deploy.sh, containment checks, Stage B install and rollback; the 2026-10-02 install kept as history. AGENTS: no longer 'not a sandbox'; shipping is scripts/deploy.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…jects, not sysconfig's LIBDIR CI (setup-python, Landlock ABI 7) ran the suite under required: LIBDIR named the toolcache, so libgcc_s.so.1 beside libc was refused and the extractors failed to import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gregoryfoster
marked this pull request as ready for review
October 6, 2026 04:02
…ed child before any command Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the loader included Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it restored Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h would escape both layers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om this boot since the restart Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…idth longs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s tools Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the service uid, denied to the contained child Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uv's Linux default hardlinks from ~/.cache/uv; on one filesystem every release file was the cache's and each dev venv's inode, so the release chmod reached them and an edit to any reached production. A real build with UV_LINK_MODE=copy: no file with more than one link; the live venv's modes untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t by a glob the operator's shell cannot expand Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pped ruff) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…han exiting silently under set -e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ser reaches a release under any umask Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2. Plan: docs/plans/2026-10-06-2-contain-the-child.md. Gate 2 approved 2026-10-06.
What
Layer 1: the child contains itself.
src/processor/_contain.pyuses stdlibctypesonly, so no new dependency.sys.pathentry, the stdlib, the directories of the shared libraries already loaded,ld.so.cache, and the mime-types files co-core reads at import;/,/etc,/home, a home directory, and any directory holding a.envare refused;socket,socketpairandio_uring_*fail with EPERM, and another arch's syscalls kill the child. Landlock on 6.12 lets a connect to a pathname unix socket through (tailscaled's socket is 0666), and a test pins that gap._childcontains itself before it reads its request, and exits 70 if it can't, which counts as a strike.Layer 2: the parent is undumpable.
processor runcallsPR_SET_DUMPABLE0 first. It refuses to start underCO_PROCESSOR_CHILD_CONTAINMENT=required(the default) wherever the child can't be contained.startingnow logsbuild,child_containmentandlandlock_abi.Layer 3: a dedicated user and releases. This follows the cohort standard, broker#22 as shipped in status#9 (R1–R13).
processorfrom/srv/processor/live→releases/<build>. It takes the GCS key throughLoadCredential=, and addsProtectSystem=strictandProtectHome=yes.scripts/deploy.sh:git archiveplus the wheelhouse, thenuv sync --locked --no-editableon/usr/bin/python3.12, withREVISIONwritten last and the release madea-w,go+rX;liveatomically and installs the unit from the release;starting(this build,required) and thenconsuming, followed by the smoke run asprocessorthroughsystemd-run;Evidence
.env). Header:child containment: required (Landlock ABI 6).required (Landlock ABI 7). The first run caught a real bug, fixed in 4f7a6ec: the library directories had come fromsysconfig'sLIBDIR, which on setup-python is not the system's, solibgcc_swas refused./etc/processor/.envand GCS key,/proc/<parent>/environ, and a home file;127.0.0.1:6379;/run/docker.sockandtailscaled.sock;exec /bin/sh.real/, 22 inputs) is identical through the contained child. It was also run from a real release built with the deploy's own steps.scripts/deploy.shhas 23 end-to-end tests with stubs, mutation-checked.Rollout (gate 3; the plan's § Rollout)
git pull && uv sync --frozen --no-dev && sudo systemctl restart processor). Layers 1 and 2 go live while the service still runs asexedev. Rollback:CO_PROCESSOR_CHILD_CONTAINMENT=off.scripts/deploy.sh. Rollback: DEPLOYMENT.md § Rollback.Follow-ups to file: processor's CI gate and drift check (status#11 and #12). The feedback for the cohort skill is in the plan's last section and is linked from Provisioner#23.
🤖 Generated with Claude Code