You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Run every sealed run of the finalize job in a container, as the child does (#1191) - #1192
DRAFT. It lands by squash under Brett Heap's word, verbatim "land #1191 and #539 when green" (recorded as RULED against #1191), once every required check is green, Copilot is clean at the head, and 0 review threads are unresolved. This seat does not un-draft it.
On 2026-09-27 Brett Heap ruled, verbatim, "(b) for the finalize job too". That is the parent-side twin of opensoft/xFactory#526's ruling (b), landed at db26fdc0, which moved the child worker's sealed render and validator into a container. The finalize job's seal step ran the parent's sealed runs directly on the runner: the sealed validator's probe, the pre-dispatch render, and its --strict validation. That runner holds the App token and runs later steps with it. #1166 closed four Copilot threads (mXq1R, mXs7R, mXs7X, mX2ts) as this class, a sealed process that outlives the lane. This PR contains that class. It delivers each item of #1191's shape list.
What this changes
The lane (scripts/ideation_dashboard/dashboard_refresh_lane.py):
Every sealed run is one docker run the lane builds (SealedContainer), in the child worker's shape:
the image the build step made, by content id (SEALED_IMAGE), with --pull never;
the seal read-only at /seal, a validator run's judged file read-only at /judged, and the render's only writable place a tmpfs of its own at /out;
a read-only root with a noexec /tmp, --network none, --ipc none, --cap-drop ALL, no-new-privileges, and this runner's non-root uid;
--pids-limit 128, 1 GiB of memory and 1 CPU;
four environment literals and nothing of the runner's;
--init --rm in the foreground, and this run's label.
The docker CLI is called at /usr/bin/docker. Its environment is only PATH, HOME, a fresh DOCKER_CONFIG and LANG.
The host reads only what a run prints, bounded. The snapshot leaves by stdout alone, capped at 32 MiB, through the child's own wrapper, which refuses a link, a directory or a fifo at /out with exit 3. Logs and verdicts are capped at 1 MiB.
A container of this run's label still running after its run returned is removed and refuses the seal. So does a daemon that cannot list them.
Sealed output reaches the log only inside a fence. Strict findings print inside ::stop-commands:: with a 128-bit token drawn at each print. A refusal's reason prints as one line, escaped as workflow-command data (_one_line, _command_data, and RefreshOutcome's log line and annotation).
Refused before any sealed run, and before the corpus is archived:
an image id the build step did not record;
ACTIONS_ALLOW_UNSECURE_COMMANDS, or any of DOCKER_HOST, DOCKER_CONTEXT, DOCKER_TLS, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH, BUILDX_CONFIG, BUILDX_BUILDER, set at all;
a root uid or gid;
no docker CLI at its path.
The exit-3 contract for a seal result the lane could not write is unchanged.
The workflow (.github/workflows/doc-health-reusable.yml, finalize job):
The build step dfr-sealed-image runs before the seal. It:
first writes SEALED_IMAGE= to GITHUB_ENV, so a build that stops leaves no id behind;
refuses the same variables;
runs docker build under env -i with the same minimal environment, so no proxy, login or token of the job's reaches it;
labels the image with the run;
records the checked id at the end.
The seal step asks the pinned lane first. This workflow runs at openxFactory main while the lane comes from the aggregation's pin. A lane that does not name SEALED_IMAGE (one from before Contain the finalize job's sealed runs in a container with the seal read-only (ruling (b), parent side) #1191), or cannot be imported, seals nothing. The step records the refusal as the seal's result, writing it rm -f then O_EXCL|O_NOFOLLOW, and no sealed code runs.
Every step from the build on runs /bin/bash --noprofile --norc -p and calls each tool by its absolute path. HEAD had 51 bare command names after the seal; now there are 0.
removes the image by id, and every image with the label, listed with -a;
fails, continue-on-error, if a container, the recorded image or a labelled image is still there, or the daemon cannot say.
Every docker call in it runs under the same env -i.
Lockstep with the aggregation's pin
The image id crosses by the environment, never by a flag, so an old lane refuses no unknown flag. Between this landing and the aggregation's pin-sync, the pinned lane predates #1191. The seal step's gate refuses it: the nightly records "source not sealed", nothing is dispatched, and no sealed code runs on the runner. The image refresh resumes, contained, once the pin carries #1191.
The invocation, verbatim
The render, as the lane built it in the real-docker proof. The seal's mount source is the real path the lane resolves through its handle on the seal directory. The probe and the strict validation have the same shape, with --mount type=bind,source=<judged dir>,target=/judged,readonly --workdir /tmp and the harness in place of --tmpfs /out:… and the wrapper.
FROM python:3.12-slim@sha256:f77ac9e44ae96ef2c90b8053ea08c31f8be030f824196b0ae4db6d462c84e51f.
Nine wheels from requirements/hermes-runtime-contracts.lock, each at the lock's version and hash, installed --no-deps --only-binary=:all: --require-hashes: attrs 26.1.0, jsonschema 4.25.1, jsonschema-specifications 2025.9.1, pyyaml 6.0.3, referencing 0.37.0, rfc3339-validator 0.1.4, rpds-py 2026.6.3, six 1.17.0, typing-extensions 4.16.0.
This is the child worker's recipe, byte for byte. test_the_sealed_image_installs_exactly_what_the_lock_pins holds each pin to the lock.
A --no-cache build in the proof downloaded all nine and verified their hashes. pip list in the built image shows exactly those nine and pip.
Evidence
Failing first. Each round's tests failed on the code as it was, then passed:
Round 1: 34 failed and 1 passed on HEAD's lane and workflow. Quotes: "AssertionError: the probe ran on this runner, not in a sealed container"; "Failed: DID NOT RAISE SealRefused" for the image and variable refusals; assert 0 == 1 for the fence; "AssertionError: no finalize step matching {'id': 'dfr-sealed-image'}"; "ValueError: not enough values to unpack" for the argv shape; "AttributeError … SEALED_SNAPSHOT_LIMIT" for the stdout bound.
Scrub sweep:assert 1 == 5, one sweep where five were asserted, and assert 0 == 1 twice.
Round 2 (Copilot 5332316826): 8 failed. A second log line ::error::sealed %0A::stop-commands::guessed was printed; the stand-in saw DOCKER_HOST and the other routing variables; IndexError because no SEALED_IMAGE= was cleared; assert 4 == 1 log lines.
Round 3 (Copilot 5332433734, 5333273349): 7 failed. The stand-in docker saw the job's HTTP_PROXY, https_proxy and GH_TOKEN, and the scrub exited 0 with an image left.
Round 5 (Copilot 5333547364): the planted link's target was overwritten, and a directory raised IsADirectoryError.
Counts.
Seal and refresh modules at a37cc97e: 445 passed. tests/carve_manifest at de1ab0e1 and after: 250 passed.
CI pytest-suite at cb9e0d35, the head: selected=9256 passed=9250 skipped=6 failures=0. Main at 7af30fc5: 9201/9195/6. That is +55 tests, and skipped stays at 6.
The real-docker proof is not collected; it lives in tests/sealed-run-proof/, off the openDox carve surface.
A local full-suite run found the carve issue: three tests/carve_manifest tests refused the proof's first location under tests/ideation-dashboard/ as an undeclared carve movement, which is why it moved.
Mutation checks. 80 distinct mutants, each reverting one guard, run against the seal modules in 12 shards.
77 of 79 were killed at 98e64380, and the 2 survivors, W15 and R17, are killed by the tests 35d8c1fc adds.
a37cc97e adds R19 (a removal taken on trust), which is killed, and re-checks A26 at its new spelling, also killed. So all 80 are killed at the head's code.
Earlier rounds found and killed three more survivors: A23 (a fixed fence token), A40 (the validator bound) and W16 (the build config).
Real-docker proof.tests/sealed-run-proof/sealed_run_containment_proof.py ran on docker 29.8.1 client / 29.6.2 server, at cb9e0d35's content with --fresh-build. All 45 checks pass. Every "nothing left" check counts only a listing that succeeded: with /bin/false for docker, the check records a FAIL.
Planted PATH executables: every write aimed at the runner is refused EROFS, and the run's own /tmp and /out refuse exec. No planted gh, git, docker, python3, sh or cat ran. The run is uid 1000 with CapEff 0000000000000000, no network, no docker socket, and none of the canary tokens. The seal and the working directory are unchanged, byte for byte.
Workflow-command floods: a 3 MiB log flood was kept at 1,048,576 bytes and refused. A 40 MiB flood written past the wrapper through /proc/1/fd/1 was kept at 33,554,432 bytes and refused. A hostile validator's findings printed only inside the fence, guessed fence lines included.
Timeout, output kinds and bounds: a render ignoring every signal was refused after 5.5 s and removed. A link, a directory and a fifo at /out were each refused with exit 3. The run stopped at 125 processes, and a render past 1 GiB was killed (exit 137).
The real seal phase of this checkout (origin/main 7af30fc5): sealed, with 4133 files. The daemon's own events show three containers of the run's label (the probe, the render, the --strict validation), each with die:0 and destroy. The manifest's precheck is validated, with 400 documents.
Last step, verbatim: exit 0, with no image and no container of the run left.
About the proof itself:--daemon-path-map rewrites only mount sources, for a dev container that reaches the host's daemon through its socket. The argv above is the lane's.
Copilot. Reviews 5332316826, 5332433734, 5333273349, 5333436182, 5333547364 and 5333919317 opened 10 threads.
9 were fixed test-first, and each reply cites the fix commit.
1 (the wrapper's check-then-cat race) was answered: the race gains sealed code nothing it could not already copy into /out, and no runner path is inside the container.
All 10 are resolved. Reviews 5333582652 (at 98e64380), 5334022705 (at a37cc97e) and 5334072030 (at cb9e0d35, the head) found nothing. cb9e0d35 acts on 5334022705's overview note that the proof must fail on a daemon that cannot list.
Gates. Every required check is green at cb9e0d35, the head: former-id-arrival-gate, lane-line, openspec-cli-pin, openxdox-consumer-gate, pytest-suite, release-tag-gate, signed-execution-chain-gate, wallet-validation. SonarCloud is not required.
… does
Brett Heap ruled on 2026-09-27, verbatim, "(b) for the finalize job too":
the parent-side twin of the ruling opensoft/xFactory#526 landed at
db26fdc0. The seal step ran the sealed validator's probe, the pre-dispatch
render and its --strict validation as subprocesses on the runner, which
holds the App token and runs later steps with it.
Each now runs as one docker run the lane builds (SealedContainer), in the
child worker's shape: the image the new build step made, by its content
id, with --pull never; the seal mounted read-only at /seal, a validator's
judged file read-only at /judged, and the render's only writable place a
tmpfs of its own at /out; a read-only root with a noexec /tmp, no
network, no IPC, no capabilities, no new privileges, this runner's
non-root uid, and a bound on processes, memory and CPU; four literals of
environment and nothing else; --init and --rm in the foreground, with this
run's label. The docker CLI is called at /usr/bin/docker with a fresh
configuration and none of the job's environment. The host reads only what
a run prints, bounded; the render's snapshot leaves by stdout, capped at
32 MiB, through the child's own wrapper. A container still running after
its run returned is removed and refuses the seal. The strict findings
reach the log inside a ::stop-commands:: fence with a fresh 128-bit
token.
The image id crosses in SEALED_IMAGE, set by a new build step, because
the workflow runs at main while the lane comes from the aggregation's pin:
a lane that predates this ignores it, and this lane without it runs no
sealed code at all. The build step pins python:3.12-slim by digest and
installs the nine wheels requirements/hermes-runtime-contracts.lock pins,
by hash, binary-only. It and the lane refuse ACTIONS_ALLOW_UNSECURE_COMMANDS
and every DOCKER_*/BUILDX_* variable that would move the calls elsewhere.
Every step from the build on runs /bin/bash and calls each tool by its
absolute path. The job's last step removes the run's containers and image
by label. The exit-3 contract for an unwritten seal result is unchanged.
The seal tests run every sealed run through a stand-in docker CLI that
maps the container's paths onto the host, so they drive the lane's own
argv, bounds and leftover check. The host-read render-output checks retire
with the host-side render: nothing a render writes reaches the runner.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lize-sealed-runs
Takes main 7af30fc (one commit, four files, none of them this pull
request's).
Refs #1191
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PR hardens the finalize job by making every sealed execution run in a locally built, digest-identified Docker container with strict isolation, bounded host-visible I/O, fail-closed validation, and unconditional cleanup; workflow and extensive tests enforce the integration and security invariants.
Sequence diagram for containerized finalize sealing
sequenceDiagram
participant Workflow as Finalize workflow
participant Lane as dashboard_refresh_lane
participant Docker as Local Docker daemon
participant Container as SealedContainer
participant Seal as Read-only seal
participant Validator as Sealed validator
Workflow->>Docker: docker build --iidfile
Docker-->>Workflow: SEALED_IMAGE
Workflow->>Lane: seal_source()
Lane->>Lane: resolve_sealed_container()
Lane->>Docker: run validator probe
Docker->>Container: Start isolated container
Container->>Seal: Read sealed validator and product
Container-->>Lane: Bounded verdict and logs
Lane->>Docker: run render
Docker->>Container: Start isolated container
Container->>Seal: Read sealed corpus
Container-->>Lane: Bounded snapshot on stdout
Lane->>Docker: run strict validation
Docker->>Container: Start isolated container
Container->>Seal: Read validator and product
Container-->>Lane: Bounded strict verdict
Lane-->>Workflow: Seal result
Loading
Flow diagram for fail-closed finalize sealing
flowchart TD
Start[Finalize seal begins] --> Checks{Required runtime checks pass?}
Checks -->|No| Refuse[Refuse seal before archiving\nand run no sealed code]
Checks -->|Yes| Archive[Create and hold seal]
Archive --> Probe[Containerized validator probe]
Probe --> Render[Containerized sealed render]
Render --> Validate[Containerized strict validation]
Validate --> Result{Runs valid and bounded?}
Result -->|No| RefuseResult[Record refusal or strict failure]
Result -->|Yes| Sealed[Write sealed result]
Sealed --> Fence[Print strict findings inside\nstop-commands fence]
RefuseResult --> Cleanup[Always remove labeled containers\nand sealed image]
Sealed --> Cleanup
Refuse --> Cleanup
Loading
File-Level Changes
Change
Details
Files
Move all sealed validator, probe, render, and strict-validation execution into a dedicated Docker container with fail-closed runtime checks.
Add SealedContainer to construct constrained /usr/bin/docker run invocations using a digest-pinned image, read-only seal mounts, bounded writable tmpfs, non-root execution, no network/IPC/capabilities, resource limits, minimal environment, and cleanup checks.
Resolve and validate SEALED_IMAGE, Docker-related environment variables, runner identity, Docker availability, labels, mount paths, bounded output, timeouts, and leftover containers before allowing sealed work.
Stream render output through the container wrapper and mount validator inputs read-only, preserving existing verdict/refusal semantics while preventing host filesystem writes and untrusted log commands.
Build and lifecycle-manage the sealed execution image in the finalize workflow.
Build a digest-pinned Python image from an inline Dockerfile with the exact locked, hashed runtime wheels and publish its content ID through SEALED_IMAGE.
Refuse unsafe Docker-routing variables, use isolated Docker configuration, apply absolute tool paths and privileged-shell settings to post-build steps, and add unconditional container/image cleanup by run label and image ID.
.github/workflows/doc-health-reusable.yml
Expand tests to verify container isolation, workflow wiring, bounded I/O, cleanup, and fail-closed behavior.
Add a stand-in Docker CLI and assertions for container command shape, mounts, environment isolation, image identity, labels, timeouts, output bounds, fenced findings, and leftover-container handling.
Cover refusal when the image, Docker daemon, runner identity, or mount paths are invalid, and verify exact workflow image-build, absolute-command, shell, and cleanup requirements.
Trigger a new review: Comment @sourcery-ai review on the pull request.
Continue discussions: Reply directly to Sourcery's review comments.
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with @sourcery-ai issue to create an issue from it.
Generate a pull request title: Write @sourcery-ai anywhere in the pull
request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
Generate a pull request summary: Write @sourcery-ai summary anywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment @sourcery-ai summary on the pull request to
(re-)generate the summary at any time.
Generate reviewer's guide: Comment @sourcery-ai guide on the pull
request to (re-)generate the reviewer's guide at any time.
Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
…e containment on real docker
The job's last step now sweeps this run's containers until none is
left, for at most 30 seconds, before it removes the sealed image. A
container already going away by its own --rm refuses `docker rm` and
holds the image until it is gone, which opensoft/xFactory#526 found on
real docker. A container still there after the sweep, or a daemon that
cannot say, fails the step. The step is continue-on-error, so the
nightly is never failed by it, and the run shows it. Three behavioural
tests run the step under its own shell against a stand-in docker, and
failed first on the step as it was.
tests/ideation-dashboard/sealed_run_containment_proof.py is the
real-docker proof. It is not a test module, so pytest never collects
it and CI's counts are unchanged. It runs the workflow's own build
step and last step under their own shells, a hostile seal through the
lane's SealedContainer, and the real seal phase of the checkout. On
docker 29.8.1 / 29.6.2 all 45 checks pass. The hostile seal carries a
planted PATH executable and writes aimed at the runner, a detached nohup
child and a double-forked daemon, and a workflow-command flood past
each bound and through the fence. A control run of the same children
on the runner shows them outliving their render.
Four comments that still described sealed code running on the runner
now describe the container.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and print a reason as one line
From Copilot review 5332316826 on PR #1192:
- The build step writes SEALED_IMAGE= to GITHUB_ENV as its first
command. A build that stops therefore leaves no image id for a later
step, whatever the job held before. The built id is recorded only at
the end, once checked, and GITHUB_ENV takes the last value written.
- Before its first docker call, the last step unsets the variables the
build and the lane refuse: DOCKER_HOST, DOCKER_CONTEXT, DOCKER_TLS,
DOCKER_TLS_VERIFY, DOCKER_CERT_PATH, BUILDX_CONFIG and BUILDX_BUILDER.
It then removes what the local daemon holds.
- A refusal's reason reaches the log as one line. The seal phase's
STRICT FAILED and NOT SEALED warnings escape it as workflow-command
data. RefreshOutcome's log line and annotation make it one line, and
the annotation escapes % as well.
Three more tests cover guards that round 1's mutation checks found
untested: every fence opens with a token of its own, every sealed run
is read to its own bound, and the build step's docker configuration is
made fresh in the job's temporary directory.
Every new test failed first on the code as it was, except those three,
which each kill their mutant. The round-2 mutation checks killed 11 of
11 mutants: the three round-1 survivors and one for each new guard.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
If docker ps hangs, subprocess.run(..., timeout=60) raises TimeoutExpired here instead of the documented SealRefused. Direct callers of seal_source therefore get an uncaught exception, and the daemon-listing refusal is not handled consistently; convert timeout (and launch OSError) into the same fail-closed refusal before returning.
…hind, and move the proof off the carve surface
From Copilot reviews 5332433734 and 5333273349 on PR #1192:
- The build step's `docker build` now runs under `env -i` and sees only
PATH, HOME, DOCKER_CONFIG and LANG, the environment the lane's own
docker calls have. The CLI honors proxy variables from its environment,
not only from its configuration, so a fresh DOCKER_CONFIG alone was not
enough.
- Every docker call in the last step runs the same way. That supersedes
the unset of the refused variables: no proxy, routing variable or token
of the job's reaches any call.
- The last step also fails when the recorded image, or any image
carrying the run's label, is still there after the removals, or when
the daemon cannot say. A container left behind already failed it.
The real-docker proof moves from tests/ideation-dashboard/ to
tests/sealed-run-proof/. tests/ideation-dashboard/ is the openDox carve
surface (docs/opendox-carve-manifest.yaml): a file that appears there
needs a re-cut of the manifest, and three tests in tests/carve_manifest
refused the proof as an undeclared movement.
The tests failed first on the steps as they were. The stand-in docker
saw the job's proxies and token on every call, and the step exited 0
with an image left.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From Copilot review 5333436182 on PR #1192. This workflow runs at
openxFactory main, while the lane comes from the aggregation's pin. A
lane from before #1191 ignores SEALED_IMAGE and runs the probe, the
render and its --strict validation on the runner. Until the pin-sync,
the job would therefore have built the image and still run sealed code
on the host.
The seal step now asks the pinned lane first, and runs it only when it
names SEALED_IMAGE. A lane that does not, or that cannot be imported,
seals nothing. The refusal is written as the seal's result, so the
record step reports it, nothing is uploaded or dispatched, and no
sealed code runs. The image refresh pauses until the pin-sync carries
#1191. That is the fail-closed side of the ruling.
The tests run the seal step under its own shell, in a stand-in workspace
with each kind of pinned lane. On the step as it was, the lane from
before #1191 and the one that cannot be imported both failed first:
their nightly ran. A test comment also named the proof at a path it
never had; it now names tests/sealed-run-proof/.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From Copilot review 5333547364 on PR #1192. The seal step writes the
refusal for a pinned lane that predates #1191 itself, because that lane
cannot be trusted to. It wrote with open(..., "w"), which follows a link
planted at dfr-seal-result.json, so it could overwrite the link's
target outside the checkout.
It now writes as the lane writes its own result. Whatever sits at the
path is removed without being followed, and the result is created
O_EXCL|O_NOFOLLOW. A path that cannot be cleared, such as a directory,
gets no result, and still nothing is sealed.
The test plants a link to a file outside the workspace, and then a
directory. Both failed first on the step as it was. The link's target
was overwritten with the refusal, and the directory raised
IsADirectoryError and failed the step.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The final mutation run at 98e6438 killed 77 of 79 mutants. The two
survivors are killed by the tests added here, and no code changes:
- W15 made the scrub's removal list images without -a. Docker's
containerd image store lists an untagged image only with --all, which
opensoft/xFactory#526 found on real docker. The stand-in docker now
lists an untagged image of the run only to -a, and
test_the_scrub_removes_an_untagged_image_of_this_run asserts the image
is removed and the step ends clean.
- R17 wrote the seal step's refusal with open(..., "w"). The rm before
it removed the planted link, so no test reached the O_NOFOLLOW. The new
case plants a link the step cannot remove (a read-only workspace), and
the link's target stays untouched.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Guard recorded-image cleanup when the build step is skipped
.github/workflows/doc-health-reusable.yml:4348
This cleanup is always(), while dfr-sealed-image is conditional (3766), so when that build step is skipped it never clears SEALED_IMAGE. A digest supplied by the job/workflow environment can therefore reach this image rm and delete an unrelated image even though no image was recorded by this run. Gate the recorded-image removal/inspection on steps.dfr-sealed-image.outcome == 'success' (while retaining the label sweep for images actually built by this run), or clear the variable in an unconditional step first.
From Copilot review 5333919317 on PR #1192. When a container of the
run's label was still running after its run returned, the lane removed
it and refused the seal, saying it was removed. It said so even when the
daemon had rejected the removal.
After the removal the lane now lists the run's running containers again.
If one is still there, the refusal names it and says the daemon could
not remove it, and that the job's last step removes what the run left.
The seal is refused either way. _remove now returns whether the daemon
removed what it was asked to.
Both tests failed first on the lane as it was. The stand-in docker now
removes what `rm -f` names unless it is told to reject the removal. The
test for a container left running asserts the listing that follows the
removal, and hit IndexError where no second listing existed. The new test
for a rejected removal got the "it is removed" message. The mutation
checks kill R19 (the removal taken on trust) and A26 at its new spelling.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the overview of Copilot review 5334022705 on PR #1192. The proof
read an empty `docker ps` listing as "no container left" even when the
listing itself failed. Its last check read "image gone" from an
`image inspect` that fails for a daemon that cannot answer.
containers_of now returns None when the daemon cannot list, and
nothing_left fails on it. The final check fails unless both image
listings succeed and neither shows the run's image. With /usr/bin/docker
replaced by /bin/false, nothing_left now records a FAIL ("the daemon
could not list them"). At this head, with a fresh build, all 45 checks
still pass on docker 29.8.1 / 29.6.2.
Refs #1191
Refs #1161
Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
LANDED — lane openXfactory-5, session b254fdd5-0bdf-44e0-bb45-5a780234009f@Eagle, 2026-09-28T05:10:40Z, PR #1192 into opensoft/openxFactory main → merge b422b30; Run every sealed run of the finalize job in a container, as the child does (#1191)
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
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.
Lane: openxfactory-5 (openXfactory-5)
Held for
DRAFT. It lands by squash under Brett Heap's word, verbatim "land #1191 and #539 when green" (recorded as RULED against #1191), once every required check is green, Copilot is clean at the head, and 0 review threads are unresolved. This seat does not un-draft it.
Closes #1191. Refs #1161.
Ruling
On 2026-09-27 Brett Heap ruled, verbatim, "(b) for the finalize job too". That is the parent-side twin of opensoft/xFactory#526's ruling (b), landed at
db26fdc0, which moved the child worker's sealed render and validator into a container. The finalize job's seal step ran the parent's sealed runs directly on the runner: the sealed validator's probe, the pre-dispatch render, and its--strictvalidation. That runner holds the App token and runs later steps with it. #1166 closed four Copilot threads (mXq1R,mXs7R,mXs7X,mX2ts) as this class, a sealed process that outlives the lane. This PR contains that class. It delivers each item of #1191's shape list.What this changes
The lane (
scripts/ideation_dashboard/dashboard_refresh_lane.py):docker runthe lane builds (SealedContainer), in the child worker's shape:SEALED_IMAGE), with--pull never;/seal, a validator run's judged file read-only at/judged, and the render's only writable place a tmpfs of its own at/out;/tmp,--network none,--ipc none,--cap-drop ALL,no-new-privileges, and this runner's non-root uid;--pids-limit 128, 1 GiB of memory and 1 CPU;--init --rmin the foreground, and this run's label./usr/bin/docker. Its environment is onlyPATH,HOME, a freshDOCKER_CONFIGandLANG./outwith exit 3. Logs and verdicts are capped at 1 MiB.::stop-commands::with a 128-bit token drawn at each print. A refusal's reason prints as one line, escaped as workflow-command data (_one_line,_command_data, andRefreshOutcome's log line and annotation).ACTIONS_ALLOW_UNSECURE_COMMANDS, or any ofDOCKER_HOST,DOCKER_CONTEXT,DOCKER_TLS,DOCKER_TLS_VERIFY,DOCKER_CERT_PATH,BUILDX_CONFIG,BUILDX_BUILDER, set at all;The workflow (
.github/workflows/doc-health-reusable.yml, finalize job):The build step
dfr-sealed-imageruns before the seal. It:SEALED_IMAGE=toGITHUB_ENV, so a build that stops leaves no id behind;docker buildunderenv -iwith the same minimal environment, so no proxy, login or token of the job's reaches it;The seal step asks the pinned lane first. This workflow runs at openxFactory main while the lane comes from the aggregation's pin. A lane that does not name
SEALED_IMAGE(one from before Contain the finalize job's sealed runs in a container with the seal read-only (ruling (b), parent side) #1191), or cannot be imported, seals nothing. The step records the refusal as the seal's result, writing itrm -fthenO_EXCL|O_NOFOLLOW, and no sealed code runs.Every step from the build on runs
/bin/bash --noprofile --norc -pand calls each tool by its absolute path. HEAD had 51 bare command names after the seal; now there are 0.The job's last step, always:
--rmholds the image, as Realize add-binding-consumer-identity: cut contract-v2.4 (a credential binding declares who holds it and what it fetches with) #526 found on real docker);-a;Every docker call in it runs under the same
env -i.Lockstep with the aggregation's pin
The image id crosses by the environment, never by a flag, so an old lane refuses no unknown flag. Between this landing and the aggregation's pin-sync, the pinned lane predates #1191. The seal step's gate refuses it: the nightly records "source not sealed", nothing is dispatched, and no sealed code runs on the runner. The image refresh resumes, contained, once the pin carries #1191.
The invocation, verbatim
The render, as the lane built it in the real-docker proof. The seal's mount source is the real path the lane resolves through its handle on the seal directory. The probe and the strict validation have the same shape, with
--mount type=bind,source=<judged dir>,target=/judged,readonly --workdir /tmpand the harness in place of--tmpfs /out:…and the wrapper.Image provenance
FROM python:3.12-slim@sha256:f77ac9e44ae96ef2c90b8053ea08c31f8be030f824196b0ae4db6d462c84e51f.requirements/hermes-runtime-contracts.lock, each at the lock's version and hash, installed--no-deps --only-binary=:all: --require-hashes: attrs 26.1.0, jsonschema 4.25.1, jsonschema-specifications 2025.9.1, pyyaml 6.0.3, referencing 0.37.0, rfc3339-validator 0.1.4, rpds-py 2026.6.3, six 1.17.0, typing-extensions 4.16.0.test_the_sealed_image_installs_exactly_what_the_lock_pinsholds each pin to the lock.--no-cachebuild in the proof downloaded all nine and verified their hashes.pip listin the built image shows exactly those nine and pip.Evidence
Failing first. Each round's tests failed on the code as it was, then passed:
assert 0 == 1for the fence; "AssertionError: no finalize step matching {'id': 'dfr-sealed-image'}"; "ValueError: not enough values to unpack" for the argv shape; "AttributeError … SEALED_SNAPSHOT_LIMIT" for the stdout bound.assert 1 == 5, one sweep where five were asserted, andassert 0 == 1twice.::error::sealed %0A::stop-commands::guessedwas printed; the stand-in sawDOCKER_HOSTand the other routing variables;IndexErrorbecause noSEALED_IMAGE=was cleared;assert 4 == 1log lines.HTTP_PROXY,https_proxyandGH_TOKEN, and the scrub exited 0 with an image left.assert True is False, because a pre-Contain the finalize job's sealed runs in a container with the seal read-only (ruling (b), parent side) #1191 lane's nightly ran.IsADirectoryError.Counts.
a37cc97e: 445 passed.tests/carve_manifestatde1ab0e1and after: 250 passed.pytest-suiteatcb9e0d35, the head: selected=9256 passed=9250 skipped=6 failures=0. Main at7af30fc5: 9201/9195/6. That is +55 tests, and skipped stays at 6.tests/sealed-run-proof/, off the openDox carve surface.tests/carve_manifesttests refused the proof's first location undertests/ideation-dashboard/as an undeclared carve movement, which is why it moved.Mutation checks. 80 distinct mutants, each reverting one guard, run against the seal modules in 12 shards.
98e64380, and the 2 survivors, W15 and R17, are killed by the tests35d8c1fcadds.a37cc97eadds R19 (a removal taken on trust), which is killed, and re-checks A26 at its new spelling, also killed. So all 80 are killed at the head's code.The mutation table
test_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_every_sealed_run_is_one_docker_run_in_the_childs_shapetest_a_mount_source_that_could_add_a_field_is_refused[a-comma]test_the_docker_cli_runs_with_none_of_the_jobs_environmenttest_the_strict_findings_reach_the_log_inside_a_fencetest_each_fence_is_opened_with_a_token_of_its_owntest_the_snapshot_leaves_the_render_by_stdout_boundedtest_a_render_that_prints_past_the_log_bound_is_refusedtest_a_container_left_running_is_removed_and_refuses_the_sealtest_a_render_that_does_not_finish_is_refusedtest_a_daemon_that_cannot_list_the_runs_refuses_the_sealtest_a_variable_that_would_take_the_calls_elsewhere_refuses_every_sealed_run[ACTIONS_ALLOW_UNSECURE_COMMANDS]test_a_variable_that_would_take_the_calls_elsewhere_refuses_every_sealed_run[DOCKER_HOST]test_no_sealed_code_runs_without_the_image_the_build_step_records[a-short-id]test_no_sealed_code_runs_without_the_image_the_build_step_records[a-trailing-newline]test_a_root_uid_runs_no_sealed_codetest_the_real_lane_calls_docker_by_its_absolute_system_pathtest_no_docker_cli_at_its_absolute_path_runs_no_sealed_codetest_a_container_left_running_is_removed_and_refuses_the_sealtest_render_output_that_is_not_a_file_of_its_own_is_refused[a-link-out-of-its-directory]test_the_pre_dispatch_render_holds_no_credential_and_no_repositorytest_the_snapshot_leaves_the_render_by_stdout_boundedtest_each_sealed_run_is_read_to_its_own_boundtest_a_validator_run_that_reaches_no_verdict_is_refused[hangs]test_a_render_that_prints_past_the_log_bound_is_refusedtest_the_confined_locator_never_adopts_the_sealed_validatortest_a_validator_run_that_reaches_no_verdict_is_refused[prints-another-shape]test_no_sealed_code_runs_without_the_image_the_build_step_records[a-trailing-newline]test_a_render_that_does_not_finish_is_refusedtest_the_sealed_image_installs_exactly_what_the_lock_pinstest_the_sealed_image_installs_exactly_what_the_lock_pinstest_the_sealed_image_installs_exactly_what_the_lock_pinstest_the_sealed_image_installs_exactly_what_the_lock_pinstest_every_step_after_sealed_code_calls_its_tools_by_absolute_pathtest_the_seal_steps_failure_is_what_withholds_an_unwritten_resulttest_the_job_removes_its_sealed_containers_and_image_lasttest_the_build_step_refuses_what_would_take_the_calls_elsewheretest_the_build_step_refuses_what_would_take_the_calls_elsewheretest_the_scrub_sweeps_until_no_container_of_this_run_is_lefttest_the_scrub_sweeps_until_no_container_of_this_run_is_lefttest_the_finalize_job_builds_the_sealed_image_before_the_sealtest_the_build_step_records_no_image_id_but_its_own[a-build-that-ends]test_the_finalize_job_builds_the_sealed_image_before_the_sealtest_the_scrub_removes_an_untagged_image_of_this_run (added in 35d8c1fc)test_the_build_step_records_no_image_id_but_its_own[a-build-that-stops]test_the_build_step_records_no_image_id_but_its_own[a-build-that-stops]test_a_sealed_reason_reaches_the_log_as_one_warning_line[refused]test_an_outcome_reason_is_one_line_in_the_log_and_the_annotation[strict_failed]test_an_outcome_reason_is_one_line_in_the_log_and_the_annotation[strict_failed]test_a_sealed_reason_reaches_the_log_as_one_warning_line[refused]test_a_sealed_reason_reaches_the_log_as_one_warning_line[rejected]test_an_outcome_reason_is_one_line_in_the_log_and_the_annotation[strict_failed]test_the_build_step_records_no_image_id_but_its_own[a-build-that-stops]test_the_scrub_sweeps_until_no_container_of_this_run_is_lefttest_the_scrub_sweeps_until_no_container_of_this_run_is_lefttest_an_image_the_scrub_could_not_remove_fails_the_step[the-recorded-image]test_an_image_the_scrub_could_not_remove_fails_the_step[an-image-with-the-label]test_a_container_the_scrub_could_not_remove_fails_the_step[a-container-that-never-goes]test_the_seal_step_runs_no_lane_that_would_run_sealed_code_here[a-lane-from-before-1191]test_the_refusal_the_seal_step_records_follows_nothing_at_its_path[a-link-the-step-cannot-remove] (added in 35d8c1fc)test_the_refusal_the_seal_step_records_follows_nothing_at_its_path[a-link-out-of-the-checkout]test_the_seal_step_runs_no_lane_that_would_run_sealed_code_here[a-lane-from-before-1191]Real-docker proof.
tests/sealed-run-proof/sealed_run_containment_proof.pyran on docker 29.8.1 client / 29.6.2 server, atcb9e0d35's content with--fresh-build. All 45 checks pass. Every "nothing left" check counts only a listing that succeeded: with/bin/falsefor docker, the check records a FAIL.sha256:62765478….EROFS, and the run's own/tmpand/outrefuse exec. No plantedgh,git,docker,python3,shorcatran. The run is uid 1000 withCapEff 0000000000000000, no network, no docker socket, and none of the canary tokens. The seal and the working directory are unchanged, byte for byte./proc/1/fd/1was kept at 33,554,432 bytes and refused. A hostile validator's findings printed only inside the fence, guessed fence lines included./outwere each refused with exit 3. The run stopped at 125 processes, and a render past 1 GiB was killed (exit 137).7af30fc5): sealed, with 4133 files. The daemon's own events show three containers of the run's label (the probe, the render, the--strictvalidation), each withdie:0anddestroy. The manifest's precheck isvalidated, with 400 documents.--daemon-path-maprewrites only mount sources, for a dev container that reaches the host's daemon through its socket. The argv above is the lane's.Copilot. Reviews 5332316826, 5332433734, 5333273349, 5333436182, 5333547364 and 5333919317 opened 10 threads.
/out, and no runner path is inside the container.98e64380), 5334022705 (ata37cc97e) and 5334072030 (atcb9e0d35, the head) found nothing.cb9e0d35acts on 5334022705's overview note that the proof must fail on a daemon that cannot list.Gates. Every required check is green at
cb9e0d35, the head:former-id-arrival-gate,lane-line,openspec-cli-pin,openxdox-consumer-gate,pytest-suite,release-tag-gate,signed-execution-chain-gate,wallet-validation. SonarCloud is not required.🤖 Generated with Claude Code