forged sandbox needs
Baseline: c0f108e7fcd854edbda3e64f260af58c47c86d30. This is a candidate,
not a deployment. The wrapper is existing-host shell infrastructure as explicitly
requested by L1058. The server remains seeded Omega. No dependency was downloaded.
Source inventory
| Access | Source | Purpose and policy |
|---|---|---|
| Executable | run.sh, infra/spark/forged-service.sh | The selected forged binary only, mounted read-only at /app/forged. No source worktree. |
| Static assets | server/pages.om, server/route.om | CSS and page text are embedded in the binary. No asset directory is needed. |
| Repository list | server/repos.om:5 | ~/handoffs/radicle/RIDS.md, first table. Read-only file inside the dedicated directory export. |
| Repository objects, refs, config, packed refs | server/util.om:101, server/repos.om, browse/, dl/, collab/ | Individual public bare repos under ~/.radicle/storage/<RID>. Read-only. Denied repos and unrelated working trees are absent. |
| Download caches | dl/dl.om | <data>/archives, temporary archive files, final archives, hashes, eviction and locks. Writable. |
| Collaboration caches | collab/co8cache.om, collab/co4pat.om | <data>/collab, cached COB views and generated diffs, temporary files and locks. Writable. |
| Social state | social/05decl.om, social/20crypt.om, social/30store.om, social/40auth.om | <data>/social.key, social.log, social.head, social.head.tmp, tmp/ signature verification inputs. Writable. The session key belongs to this service and is necessarily visible to it. |
| Reload | server/main.om | <data>/reload is read and unlinked. RIDS modification time is checked. |
| Published review metadata | collab/co2cob.om:68,1156 | Export copies of *.verdict.txt and *.receipt.txt files from ~/handoffs/hive/manager/reviews and ~/handoffs/hive/forge/receipts. Read-only. Other handoff contents are absent. Synthetic parent directories replace the real home and handoffs directories. |
| Node health snapshot | nodes/stat.om:8 | ~/.local/state/aien-factory/nodes.txt, read-only individual file if present. No node databases, keys, control sockets or other factory state. |
| Logging | server/main.om, service wrapper | The server writes its inherited stderr. The supervisor owns <data>/logs and <data>/forged-supervisor.pid. These are mounted read-only inside the child so it cannot plant symlinks or falsify the pid that the supervisor trusts. The reload writer uses an atomic replacement, not touch on a child-controlled path. |
| Programs | server/util.om:102,560, social/20crypt.om, dl/dl.om | /usr/bin/git, /usr/bin/ssh-keygen. The installed Git compresses tar.gz internally. Only these binaries and the dependencies reported by their local ldd are mounted read-only. No shell or gzip executable is mounted. The probe replaces the main executable with dash and reads its script on stdin; it gets the same filesystem profile. |
| System data | signature verifier, loader, Git archive | Synthetic one-user /etc/passwd; no host account database. Read-only /etc/localtime is required for byte-identical ZIP date fields. /dev/null, /dev/urandom. Private read-only /proc, not the host process view. |
Git may consult its repository's config and attributes. The sandbox hides the host Git configuration, SSH keys, SSH agent, vault, home dotfiles, other repositories and executables. Repository symlinks cannot lead back to a hidden host path.
nodes/snap.om is a separate producer, not a forged child. Its sqlite3, rad,
node databases and network access are not needed inside the web server.
Network and processes
Unsandboxed, server/main.om calls hlisten on IPv4 loopback, port 18480, then accepts
HTTP connections. The private build changes only the port to 19830 and home path
constants to its fixture. Runtime tracing is retained by the test runner.
The composed server has no outbound connect call or Unix socket dependency: the seed
library's hdial is compiled in but never called. Git and ssh-keygen are started with
explicit arguments and an empty environment, and only read local files.
Since r5 Part B the sandboxed server has no network (bwrap --unshare-net). Its private
namespace holds only lo, with no listener and no route out. The 127.0.0.1:18480 listener
is made outside the sandbox by infra/spark/forged-listen.om, a seeded-Omega helper that
binds, listens, puts the listener on descriptor 0 without close-on-exec, and execs the next
program with a fixed environment.
Since netns r2 the service supervisor owns the listener for its whole life. `forged-service.sh
_loop` takes the port once through forged-listen (exit 3, and no service, when the port is
taken), checks that descriptor 0 is the listener on its port, keeps it on a descriptor of its
own, and hands it on descriptor 0 to every forged it starts. The port is never unbound while
the supervisor runs: connections that arrive during a restart wait in the queue (backlog 64)
for the next forged, and no other local process can bind the port in between, provided the child
cannot give the listener away (the listener guard below). A restart for
a new repository set is a drain: the supervisor writes the flag file <data>/restart
(atomic replacement, like the reload flag), forged removes it and exits 0 after the connection
it is serving, and after 10 s without an exit the supervisor sends TERM. A direct wrapper start
with FORGED_LISTEN_PORT still makes its own listener through forged-listen.
With a listening socket on descriptor 0 the wrapper adds --inherited-listener in every mode
(network cut on or off, sandbox on or off). forged checks that descriptor 0 is the IPv4
listener on 127.0.0.1 and its compiled port, moves it to a close-on-exec descriptor, and puts
/dev/null on descriptor 0, so git and ssh-keygen never inherit it. Without
--inherited-listener, forged binds its own listener exactly as before.
The listener, and every connection forged accepts from it, belongs to the host network
namespace, so interface questions asked through them are answered about the host: SIOCGIFCONF,
SIOCGIFNAME, SIOCGIFADDR, SIOCGIFHWADDR, SIOCGIFNETMASK, and SO_BINDTOIFINDEX followed by
SO_BINDTODEVICE (the review found the first; r2 found the others). No namespace setting changes
that, because the namespace belongs to the socket. The socket filter closes it: a classic BPF
seccomp program written by the seeded-Omega generator infra/spark/forged-seccomp.om, built by
run.sh into forged-seccomp.bpf beside forged and installed by bwrap (--seccomp) just
before it executes forged. It allows ioctl only for FIOCLEX, FIONCLEX, FIONBIO, FIONREAD, TCGETS
and TIOCGWINSZ; socket and socketpair only for AF_UNIX (no netlink, inet or packet socket);
setsockopt only for TCP_NODELAY and SO_REUSEADDR, SO_SNDBUF, SO_RCVBUF, SO_KEEPALIVE; it refuses
connect, shutdown and io_uring; everything refused fails with EPERM. A system call from any
architecture other than AArch64 kills the process. The wrapper refuses a filter that is
missing, inside data or export, or not a whole number of 8-byte instructions.
FORGED_SECCOMP names another location (tests use it for host tools). bwrap installs the filter
in its last step, after it has brought up lo in the new namespace (one SIOCGIFINDEX and a netlink
socket of bwrap's own, outside the filter), so it covers forged from its first instruction and
every process forged starts. The gate makes three traces with process tracking: the server serving
the smoke and download routes (forged starts git many times there), and git and ssh-keygen each run
directly as the wrapper's program (bwrap starts that program as /app/forged). It requires no EPERM
(the filter must not change what forged does) and checks with infra/test/seccomp-order.py that
each of the three programs starts under the filter (by its arguments: --inherited-listener,
log, -Y), that forged's git runs under it, and that no process under the filter opens a
netlink or inet socket or gets an answer from an ioctl outside the allowlist. A filter that allows
everything must fail that check. The only refusal the work meets is glibc's name-cache lookup in
git and ssh-keygen (connect to /var/run/nscd/socket, ENOENT before the listener guard); glibc
then reads the files, as before; the gate allows exactly that refusal and counts it.
Listener guard (netns r2 review of 8f6b4a29, findings 1 and 2). The listener is shared: the
supervisor and the child hold the same socket. Three calls on the child's copy give the port
away: shutdown (SHUT_RD or SHUT_RDWR) and connect with an AF_UNSPEC address both disconnect a
listening socket, after which a local process with SO_REUSEADDR binds 127.0.0.1 on the port and
receives the connections (the supervisor's copy is the same disconnected socket); and SO_REUSEPORT
lets a local process with SO_REUSEPORT bind the same address and take a share of new connections
(6 of 8 in the review). The filter refuses connect, shutdown and SO_REUSEPORT. forged calls none
of them (it never connects; the listener is bound outside). Gate steps: seccomp-table
(infra/test/seccomp-table.py runs the filter bytes over a table of 45 calls, without trusting the
generator's notes), netns-poison (infra/test/listener-poison.py, under the real forged-listen:
the sandboxed leakprobe makes each call on the inherited listener, a rival with SO_REUSEADDR and
SO_REUSEPORT tries the port, the successor forged starts on the held listener, 8 connections show
who answers), and controls that must reproduce each case: seccomp-table-control and
netns-poison-control (the 8f6b4a29 filter), netns-poison-mutants (this filter with one rule
removed each). Measured on the host (not a gate step): listen() again on the same socket, shutdown
SHUT_WR, connect to an inet address and sendto with MSG_FASTOPEN do not free the port. A listener
made without SO_REUSEADDR would also keep a rival out after a disconnect, but then the next start
after a stop cannot bind while the port's TIME_WAIT sockets last (62.5 s measured after three
server-closed connections), so the supervisor keeps SO_REUSEADDR and the guard is the filter.
The only thing inside the sandbox that needs a socket is the listener. Signature checks
(ssh-keygen -Y) and git (log, show, cat-file, archive on local storage) need none, and the
gate traces both under the private namespace. Connections that remain outside the sandbox:
the counts collector (forged --counts-snapshot with rad node routing and getent) and
public-read run in the supervisor's account, as before. FORGED_NETNS=off returns to the
shared host network with no socket filter, with a loud warning on every start.
Abstract Unix sockets belong to the network namespace, so the private namespace also hides the host's abstract sockets. Filesystem Unix sockets were already hidden.
Descriptors: the wrapper closes every descriptor above 2 that its starter left open, first,
on every path (service, direct, FORGED_NETNS=off, FORGED_SANDBOX=off). Descriptor 0 stays
(the listener or /dev/null). The only descriptors opened afterwards are the passwd entry and the
socket filter, which bwrap reads and closes itself. The counts collector closes the same way.
Processes have no_new_privs, no capabilities, a private PID namespace, a private IPC namespace and a new session. Further user namespaces are disabled. With the network cut on, the socket filter above applies. Only FORGE_DATA is a writable host filesystem mount. Its supervisor log directory and pid file are protected read-only submounts. Direct launches must create these real paths first; the supervisor already does.
Dependencies and host prerequisite
The host's installed bubblewrap is 0.9.0. The unprivileged bwrap --ro-bind / / true
probe succeeded. The stronger user/PID/IPC/UTS namespace probe also succeeded.
/etc/apparmor.d/bwrap already grants userns to /usr/bin/bwrap with
flags=(unconfined). No root change is needed here. The wrapper fails closed on
setup errors. It never changes AppArmor or silently selects a weaker mechanism.
Exact installed package versions and binary hashes belong in the run evidence.
Host dependencies are Bash, bubblewrap, setpriv, coreutils (including env, which starts
bubblewrap with an empty environment), awk and ldd for setup, util-linux prlimit for the
resource limits (r5), and Git, OpenSSH ssh-keygen and their resolved libraries for service
execution. The listener helper and the socket filter generator are seeded Omega, built by
run.sh beside forged as server/forged-listen and server/forged-seccomp.bpf. The gate's
interface-leak probe infra/test/leakprobe.c is a test instrument built with the host gcc:
seeded Omega has no ioctl word and only six socket options. The long-term Omega replacement is a native namespace/mount launcher
and native repository/archive/signature operations. This candidate does not
claim to have replaced those host tools.
Public metadata refresh (r2)
The trusted supervisor owns FORGED_PUBLIC_DIR, default $FORGE_DATA/../forge-public.
It runs forged-public.sh before launch and each supervisor pass. The default interval
is two seconds (FORGED_MIRROR_INTERVAL, whole seconds from 1 to 99). No systemd unit
or timer is installed. This is the supervisor loop requested by the r2 brief.
public-read.om, compiled by the pinned compiler, opens each path component with
NOFOLLOW, enters directory descriptors, and accepts only regular files. It reads at
most the cap plus a detection byte and emits nothing unless the whole file fits.
The per-file cap is 1048576 bytes. No Python is in the runtime or build path.
The test and timing oracles use Python outside the service.
The export contains RIDS.md, nodes.txt, the selected *.verdict.txt files from
handoffs/hive/manager/reviews, and selected *.receipt.txt from
handoffs/hive/forge/receipts. Sources stay untouched. Changed bytes go through a
new temporary file inside the export and an atomic rename. Missing, unsafe or
over-cap sources revoke the old export. Equal bytes retain their inode and time.
The export is mounted read-only at each of the four expected metadata directories.
Only synthetic ancestors are visible, never the owner's containing directories.
The export must be disjoint from writable data and the source metadata trees.
Whole-file copying still reveals more than the public page needs:
- RIDS includes later tables, source working-directory paths, timestamps and notes. The application parses only the first allow-list table.
- The node snapshot includes every repository known to the producer, not only
public repositories.
nodes/snap.omexplicitly records this fact. - Verdicts include the whole review, although some consumers show only its verdict.
- Receipts include reviewer, author, clone and command/evidence information beyond the public result. The exact excess depends on the producer's file contents.
Repository binds remain individual and read-only. A digest covers sorted allowed RIDs, resolved directory paths and directory identities. A changed mount set sends TERM to the child, waits for its exit and starts a new child without crash backoff. TERM drops in-flight connections; this is not graceful request draining. One log line names the set change. Content pushed into the existing directory leaves its identity unchanged and needs no restart. RIDS content changes with the same mount set are handled by the application's normal metadata reload.
run.sh build now also builds public-read beside the selected forged output.
run.sh deploy stages and records it with the binary, but deployment is not part
of these private checks. The supervisor fails closed if its reader is missing.
The wrapper never launches a compiler or downloads a dependency.
The forward-fit check uses an isolated local clone at the specified integrated
head. Its newer counts reader needs two nginx logs and their rotations,
/usr/bin/getent, /usr/bin/env, the Radicle command, and node routing state.
These are outside the r2 metadata export. The acceptance test redirects them to
controlled fixtures, exercises positive inputs outside the sandbox, and compares
the sandbox's result. Missing data must not be silently called compatible.
Galaxy files and quiet state already live under service data. The visits program
is a separate owner-side reader of the supervisor log, not a forged child.
The pinned baseline has no infra/RUNBOOK.md. The coordinator's later copy at
../wt/infra/RUNBOOK.md was read as context only. It names infra/smoke.sh local
as the direct forged check. Its public smoke, nginx edge tests and backup drills
do not target a private forged instance. The latter drill is absent at this pin.
The candidate makes the existing smoke suite accept FORGE_TEST_PORT and runs
it unchanged otherwise. The existing download HTTP suite accepts fixture storage
and an evidence destination so it does not rewrite historical transcripts.
The JSON route at this pin is /status.json; newer repository JSON APIs are absent.
Reproduce
Run bash infra/test/sandbox.sh from this checkout. It acquires pool-12-14,
pins cores 12,13, creates fixtures under the worktree's parent, compiles with the
exact run.sh compiler pin, traces the unrestricted private baseline, compares
HTTP bodies with cmp, runs existing smoke/download tests and isolation probes,
and challenges the probe with a writable-repository mutation. It tests both a
valid and an invalid SSH signature using a throwaway private key outside the
sandbox. Every check writes its command, exit status, log and log SHA-256.
Evidence is under ../sandbox-evidence; latest names the run directory.
Rollback is explicit: FORGED_SANDBOX=off runs the selected binary directly and
prints OWNER ACCOUNT EXPOSED; SANDBOX DISABLED to the service log.
Historical r2 forward fit on the integrated head
The r2 integrated gate is BLOCKED by count parity. Its private run is
../sandbox-evidence/r2-on-one/run.XClz1X. All original isolation controls,
metadata replacement, source refusal controls, live push and five automatic
repository-set restarts passed. Quiet pages with a real fixture sign-in, filter
writes, .receipt, galaxy files and public JSON byte comparisons passed.
The existing JSON walker visited 164 pages, covered 22 schemas and reported no
failures. The visits suite passed. These facts do not make the full gate pass.
The positive count fixture has one git fetch, one upload-pack request and three
seed announcements outside the sandbox. All become null inside it. Even the
service-log count becomes null because its visitor filter needs the unavailable
address lookup. integrated-counts-comparison.json retains both responses.
The installed Radicle command, traced against an empty private home, exits 1
and says its profile is missing. No owner identity or node was borrowed.
Additional inputs in 3edf9201, relative to the original sandbox base:
| Path/program | Use | Present in this profile? |
|---|---|---|
/var/log/nginx/aienos-dl.log and .1 | Clone/fetch requests and rotation tail | No |
/var/log/nginx/aienos.access.log and .1 | Upload-pack requests and rotation tail | No |
/usr/bin/getent hosts www.aienos.com | Exclude the owner's address from visitor counts | No. Its resolver/configuration dependencies are not granted. |
/usr/bin/env and ~/.radicle/bin/rad node routing | Read routing announcements under an explicit HOME | No |
~/.radicle/node/node.db-wal | Trigger routing refresh when node state changes | No |
| Radicle profile and routing database | Prerequisites of the command above | No. Empty-home trace stops at the profile requirement. Later prerequisites are not qualified. |
<data>/counts.log | Counts and source positions | Writable application data |
<data>/growth/seeds.log | Growth history; other growth JSON caches share this directory | Writable application data |
<data>/quiet/events, quiet/subs, quiet/out/<subscriber> | Notification events, filters and digests | Writable application data |
<data>/galaxy/index.html, galaxy.css, tokens.css | Prebuilt galaxy page and styles | Application data. The outside producer is not a child. |
<data>/owner/visits.html, visits.tsv, styles | Separate owner analytics | Application data, if populated. Its renderer and private HTTP server are outside this profile. |
No additional socket was used by the successfully exercised forged routes. The galaxy producer's factory stream and the visits owner's private listener are separate processes, not required child sockets. The real routing command beyond its missing-profile refusal was not qualified. This is not a claim of complete network isolation or a working Radicle command inside the sandbox.
The r2 export contract named only RIDS, node snapshots, verdicts and receipts. Adding raw request logs, owner profile files or a node control socket would widen that contract and the privacy boundary. The r3 brief approved the following change: a public count snapshot written outside the sandbox, with the web reader consuming only that snapshot. Reusing node snapshot copy counts as routing announcements would change the meaning of the result and is not an equivalent fix.
Historical r1 result (superseded by the r2 report)
The final run is ../sandbox-evidence/run.fGiVwY. The full gate exits 4, BLOCKED,
because the FIFO-synchronized atomic RIDS replacement check exits 1 and reports
that the sandbox still reads the old inode. This is an observed failure, not a
prediction. Fixing it needs a public input publication layout outside the private
handoff directories, plus a mount refresh policy when the allowed repo set changes.
Those producers are outside this brief's permitted worktree. They were not changed.
HTTP body comparisons passed for the root, explore, CSS, project, blob, raw file, ZIP, tar.gz and populated status JSON. The JSON uses an explicitly future-dated fixture to keep its age field stable; it is not a measurement of the real node. The existing smoke and download HTTP suites passed. The private supervisor started the sandbox, accepted HUP and stopped. Its reload operation did not follow a planted symlink; a symlinked log directory was refused before writing.
The probe could write application data, but could not read the owner SSH keys, Radicle keys, vault, private handoffs or shadow file, or write outside the allowed application state. It could not change the supervisor log directory or pid file. NoNewPrivs was 1 and effective capabilities were zero. Sudo was unavailable inside the profile. Removing a repository's read-only mount made its write control fail, as required. The real SSH verifier accepted a valid signature and rejected a changed message. Explicit sandbox-off rollback printed the required warning.
The baseline trace records a loopback bind and Git execution. No outbound connect
was observed on those requests. Signature verification was exercised separately.
Git's read of /etc/localtime explained the earlier ZIP byte mismatch; the final
comparison passed with that file mounted read-only. Trace, commands, exit codes,
compiler/source/binary hashes and log hashes are in the evidence directory.
Installed versions recorded there: bubblewrap 0.9.0-1ubuntu0.3; util-linux 2.39.3-9ubuntu6.6; Bash 5.2.21-2ubuntu4; coreutils 9.4-3ubuntu6.3; mawk 1.3.4.20240123-1build1; libc6 2.39-0ubuntu8.9; Git 1:2.43.0-1ubuntu7.3; OpenSSH client 1:9.6p1-3ubuntu13.19. Dash and gzip are test-oracle tools only. No shared Omega guide was changed: no language, compiler pin or seed procedure changed. The service-specific reader build is documented here and in run.sh. This candidate was not pushed, merged, published or deployed.
Public aggregate counts (r3)
The existing forged executable has an owner-side --counts-snapshot JOURNAL mode.
It calls the existing allow-list loader, journal replay, log readers and Radicle
routing reader. It does not listen on a port or load social state in this mode.
The journal argument is mandatory and absolute. The supervisor places that
journal in FORGED_COUNTS_STATE, default $FORGE_DATA/../forge-counts-state.
That directory must be outside writable application data and the public export.
It is not mounted in the child. Preserve this journal across service restarts.
At a cutover from an unrestricted count-enabled version, stop the old writer and
copy its committed counts.log into the owner state directory before collection.
This preserves counts whose original log files have already rotated away.
forged-counts.sh starts collection outside the sandbox, pinned to the same cores.
It publishes counts.snapshot by writing a unique temporary file in the export
and renaming it after successful collection. A failed collector removes the old
snapshot. Collection runs alongside the supervisor so it does not block HTTP,
metadata refresh, restart or stop handling. The supervisor starts it at launch,
on an allowed repository set change and every FORGED_COUNTS_INTERVAL seconds
(default 900, permitted 1 through 1800). Runs never overlap within one supervisor.
A collection is stopped after 300 seconds. No scheduler or systemd unit is added.
The wrapper sets FORGED_COUNTS_SNAPSHOT=1 in its otherwise cleared environment.
Only this mode switches the count reader. Unrestricted behavior is unchanged.
The sandbox reads the file at the existing public-export mount under
handoffs/radicle/counts.snapshot before each project HTML or JSON count response.
It opens a regular file without following its final symlink (aarch64 open flags
O_CLOEXEC, O_NOFOLLOW 0100000 and O_NONBLOCK, value 559104). Directory mounts
make atomic replacements visible immediately, with no restart or cached inode.
Format is ASCII, version 1. Header: 1 COLLECTION_EPOCH followed by LF.
Each subsequent line is RID GIT UPLOAD ARCHIVES ASSETS SINCE0 SINCE1 SINCE2 SEEDS STATUS SEED_EPOCH
followed by LF. Fields have exactly one separating space. RID omits rad: and
contains only ASCII letters and digits. All other fields are unsigned decimal
integers. They have at most 20 digits and must fit in an unsigned 64-bit integer.
Leading zeroes are accepted. STATUS is 0, 1 or 2; 1 means seeding was measured.
SINCE values and SEED_EPOCH are Unix seconds. Zero means unavailable where the
existing renderer uses it. Archives plus assets must not overflow. The file
contains only public project identifiers, aggregate figures and collection times.
It contains no client address, user agent, raw request line or key material.
Limits: 65536 file bytes, 257 LF-terminated lines including the header, 256 bytes
per line excluding LF, 11 row fields, 64 bytes per field, 256 project rows (FAMAX,
server/util.om; 16384 bytes, 65 lines and 64 rows before 2026-11-14, when the
allow-list table grew for the native store).
Duplicate project identifiers, incomplete lines, wrong field counts, invalid
numbers, future collection time or source times after collection are rejected.
Files older than 3600 seconds are rejected. A missing, rejected or stale snapshot
clears all count availability. Existing HTML says not measured; JSON uses null.
A project absent from an otherwise valid snapshot is also unavailable. Reads
are capped with an extra detection byte. Every parsing loop is guarded before
its bound, including malformed input. No private source is opened in this mode.
Additional child permissions: only read access to counts.snapshot in the existing export. No nginx log, resolver, Radicle executable, database, owner profile, key or node socket is added. Additional owner-side utility: installed GNU timeout, used to bound the collection process. Its version is recorded in evidence. The future native Omega supervisor should provide the equivalent process deadline.
R3 private acceptance ran in ../sandbox-evidence/r3/gate/run.IAtnd2 and exited 0.
Positive HTML and JSON count parity passed for git fetches, upload-pack requests,
archives, release assets and routing announcements. Exact valid read limits and
limit-plus-one/far-beyond refusals passed. Every malformed case left the server
answering requests. Removing the freshness guard caused the stale assertion to
fail. Fixture addresses and user agents were present in the source log and absent
from the producer output. The supervisor changed a published count without a child
restart. R1/r2 isolation, mutations, metadata refresh, repository-set restarts,
existing-repository push visibility, integrated routes and visits also passed.
See the r3 READY report for pinned rebuild hashes and real-log collection cost.
The owner collection mode persists read positions even for batches with no counted events. This prevents repeated full-log scans across separate collections. The unrestricted in-process reader retains its existing journal behavior. A fixture asserts cursor advancement, unchanged counts and no write on unchanged recollection.
R4 review fixes. The r3 reader passed 657408, which on aarch64 is O_LARGEFILE, not O_NOFOLLOW, so it followed a symlink named counts.snapshot. Its symlink test pointed outside the export, so it passed only because the target was not mounted. The test now also links to a valid snapshot inside the export. Several refusal cases used all-zero rows, which render as unavailable even when accepted. Every refusal case now has an accepted twin with positive figures that is shown available first. New cases: header version, since or seed time after collection, non-alphanumeric RID, 400 lines under the file cap and a well-formed 16385-byte file.
Clean environment, resource limits, guards and umask (r5)
Clean environment. Bubblewrap stays process 1 inside the sandbox, and the child can read
/proc/1/environ. The wrapper therefore starts it as
exec env -i /usr/bin/setpriv --no-new-privs /usr/bin/bwrap ...; setpriv and bwrap read no
environment variables. The systemd unit infra/spark/interplane-forged.service and, without it,
forged-service.sh start (tmux) start the supervisor through `env -i HOME=... PATH=/usr/bin:/bin
FORGED_...=...`, so the service manager's or tmux server's own environment and the operator's
shell never reach the supervisor, its children or the sandbox. Gate steps
env-clean and service-env plant a canary in the starter; env-mutant (the r4 final line)
and service-env-old (the r4 service script) are the controls that must leak it.
Resource limits. /usr/bin/prlimit runs inside the sandbox, after bubblewrap has created
the user namespace, and execs forged. RLIMIT_NPROC counts every task of the real user id, and the
owner runs about 450 processes on the Spark; set before bubblewrap, --nproc=256 made bwrap fail
with "Creating new namespace failed: Resource temporarily unavailable". Inside, the namespace
starts with only bwrap's own tasks, so the limit bounds the sandbox.
| Limit | Value | Measured need | Margin (Wolfram) |
|---|---|---|---|
| nproc | 256 | forged is one thread; git pack-objects uses about 20 threads; with bwrap and children about 30 tasks | 256/30 = 8.5 |
| address space | 4 GiB | git pack-objects on the largest public repository (159 MB) fails at 1024 MiB ("unable to create thread") and passes at 1280 MiB; live forged VmPeak 56704 kB | 4 GiB / 1280 MiB = 3.2; 4 GiB / 56704 kB = 74 |
| file size | 1 GiB | dl caps one archive at 512 MiB (536870912 bytes); the largest live data file is a 96.5 MB tar.gz | 1 GiB / 96.5 MB = 11.1 |
| open files | 1024 | live forged holds 4 descriptors | 1024/4 = 256 |
| core | 0 | none |
Wolfram: {N[4*2^30/(1280*2^20)], N[4*2^30/(56704*1024)], N[2^30/(96.5*10^6)], N[256/30]}
-> {3.2, 73.97, 11.13, 8.53}.
The service log is not subject to the file-size limit: the supervisor gives the child a pipe and
an unsandboxed cat appends to forged.log. The live log is 258819608 bytes and grows about
94 MB a day; with the file itself as stderr, forged would die with SIGXFSZ after
2^30 / 94 MB = 11.4 days (Wolfram N[2^30/(94*10^6)] -> 11.42). Gate steps log-fsize (this
supervisor keeps serving with a 2 GiB log) and log-fsize-old (the r4 supervisor's forged dies
with exit 153) cover it.
Growth of FORGE_DATA. No quota exists. / is ext4 without quota options, with 425 GiB free.
The bounds that do exist: the archive cache is capped at 5 GiB by dl (dlrunf), one archive at
512 MiB, one file at 1 GiB by RLIMIT_FSIZE. The log has no cap: at 94 MB a day, 425 GiB lasts
about 4855 days (Wolfram N[425*2^30/(94*10^6)] -> 4854.7). The collab, search and visits stores
have no cap of their own; FORGE_DATA totals 537 MB today. A per-directory cap needs either a
dedicated filesystem (a loop-mounted image of fixed size, root needed) or project quotas; this
round adds neither.
Omega gap. The pinned omc has no setrlimit or prlimit64 host word, so util-linux prlimit
2.39.3 (sha256 26600e1c720c29d7b7a87eac6beb13f5bc497925349d6c36a5c03751df879fd1) stays a
recorded host binary. Proposed replacement: a host word rlimit resource soft hard (prlimit64 on
the calling process) used by a seeded-Omega launcher that sets the limits and then execprogs
forged.
Binary guards. The wrapper refuses a forged binary that resolves inside the data directory or
the export directory. The count collector (counts_bin_ok, at init and before every collection)
and the public reader (public_init) refuse the same, because both run as the owner, unsandboxed.
umask. The wrapper sets umask 0077, so every file and directory forged creates in
FORGE_DATA is owner-only. The mirror (public_sync, run by the owner) and the count producer
(run by the owner) read them as the same user.