Repository navigation
Conversation
…WE-AF and PR-AF Each image runs a pinned artifact: codeaf from a published dev release checked against its sha256, the AgentField control plane from its published image (built with sqlite_fts5) pinned by digest, SWE-AF and PR-AF built from pinned commits of their public repositories. The containers start as root only long enough to give a platform volume to the service's user, then run as that user. The runner is the engine host that registers the factory on AgentField. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Railway's builder rejects a cache mount that has no id, and an id has to be spelled with the service it belongs to, which no portable Dockerfile can know. The two Go reasoners build in about a minute without the cache, so they build the same way under Compose and on Railway. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
One `docker compose up` runs the organization server, the AgentField control plane, the factory runner, SWE-AF and PR-AF, each with a volume for its state, a health check, and a published port only where a person has to reach it (on 127.0.0.1 unless the operator opens it). The scripted stub model is an optional profile for a keyless smoke test. setup.sh writes .env with fresh random secrets and never overwrites one; .env, the model keys and the organization token never enter an image. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The control plane's health check used a glibc busybox that the distroless base is too old to run, so it is now the static musl one. The reasoner images now name the user they run as, so a platform volume is handed to the right user and git finds its home (PR-AF was looking in SWE-AF's). The node entrypoint can make a throwaway repository for the keyless smoke test to plan against. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
smoke.sh starts the stack against the scripted stub model and checks, section by section, that the nodes are registered, the operator link claims the organization, a second person joins by invite, a factory job reaches SWE-AF through AgentField with strict run-owner proofs and its plan question is answered by the owner, and that a restart of every service keeps the people, the runs and the registrations. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ec into it Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…point and never uses a fixed password Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…away, then runs unprivileged The published image is distroless and runs as uid 65532, so a root-owned platform volume left it unable to write its database, and the only way round was to run it as root. It now gets the same hand-off as the other images, done with the one busybox binary it already carries for its health check. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…uns as Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nt the Railway services A link is only accepted with exactly the address the server names itself by, so rewriting the host in the printed link broke it. The README now says what that address is on a laptop, and lists the variables each Railway service takes. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ontainer stub, not a send path deploy/org/modelstub answers /chat/completions on purpose so the keyless smoke test spends nothing; like test/remote/stub it is built into its own image and the product never runs it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…f running open A fence that can apply nothing used to let the command run as it was. A Require fence returns ErrFenceRequired instead, in a sentence with none of the machine's words, so a hosted chat's commands are confined or not run, never run open. Without Require nothing changes, and the helper's spec is byte-identical. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…LE shortens the idle windows Both are read only by the engine door and only when set, so an engine started without them is what it was. A hosted engine builds its own fence, which ignores jail.allow: off, because a chat's own shell can write that file. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…folder per chat codeaf sessionhost serve|probe|health, plus the hidden helpers it re-executes as the chat's user. The supervisor keeps five capabilities, fails closed when it cannot switch users or confine commands, and answers its API only to the organization server's shared secret and a named person. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…door a chat reaches its model through /v1/hosted/sessions[/...] proxies to the sessionhost with the shared secret and the verified person only; the wire is a reverse proxy that parses no frames. /v1/model/ takes a bearer the server minted for one chat (twelve hours, ended on stop or delete) and adds the organization's key itself. With CODEAF_HOSTED_URL unset neither exists and every path answers as before. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The thin client: the same surface as --at over a WebSocket to the organization server, the bearer only in a header, a chat picked or made for the person, plain sentences for every refusal. It advertises no client tools and drops the automation banner raiser, so nothing an engine sends makes this computer write a file, run a program or open an address. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… people ask them Where the chat runs, what stays on a person's computer, who can see a hosted chat, what the operator of the machine can see, what happens when the person disconnects, the limits and the refusal sentences, and how an operator turns it on. Probes in chat_hosted_test.go keep the questions reaching the page. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A supervisor that chooses the folders other people's homes live in needs to know, before it makes one, whether an engine host can listen there. The helper returns the longest path a host socket can have under a codeaf home, and a test pins it to the length of the socket a real host listens on. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t (C5) The first live run showed a chat's turn dying with its client. The engine keeps working after a disconnect only as a host behind a unix socket in the chat's own home, and with the data folder at /sessions that socket's path was 104 bytes, one over the 103-byte ceiling, so the engine quietly ran inside the connection's process instead and nothing said so. The default folder is now /chats, and the supervisor refuses to start with a folder that leaves no room, naming how many characters there are. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ke test needs no key A user message starting "bash:" makes the stub ask for one bash tool call with the rest of the message, and the tool's answer comes back quoted as "STUB ran: <output>". Any other message is answered "STUB noted: <message>" as before, so the existing smoke test is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ke test that proves them A `hosted` Compose profile adds the sessionhost (five capabilities, a volume at /chats, a network shared only with the organization server, a healthcheck), the local-binary build argument for an image that has `codeaf sessionhost` before a release does, the shared secret in setup.sh, and README "Hosted chats". `SMOKE_HOSTED=1 ./smoke.sh` drives real `codeaf chat --org` clients against the scripted model stub and checks, by contract item: a chat runs on another machine in a folder of its own, other chats cannot read, write, list or signal it, no secret reaches a chat, a machine that cannot isolate refuses, a turn finishes after its client is killed, the host restarts without orphans or lost files, limits and cleanup, and that another person's chat cannot be told from one that never existed. The checks of what a chat's user can see are made as that user (the machine's root holds no right to look inside a chat), and what a chat's shell holds in its environment is read from the machine's side, because the engine rightly refuses a command that searches for secrets. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… the fit check The test asked SocketPath for the real path, and SocketPath refuses a state root that is too long for a socket, which a CI runner's temporary folder is. The test passed on a short /tmp and failed there. It now measures the same path through the unexported where and socketName. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…where the kernel cannot Abstract Unix sockets have no owner and no file mode, so every process in one network namespace can connect to every other's, and the hosted chats on one machine share that namespace. A live check showed one chat connecting to a socket another chat was listening on. A required fence (the hosted engine's) now asks Landlock to scope them, so a command cannot connect to an abstract socket made outside its own fence, and where the kernel is older than Landlock ABI 6 the command is refused instead of run with the gap. A fence nobody required keeps the ruleset it always had. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…pe local sockets starts none /tmp and /dev/shm are one folder for every chat on the machine, and a file made there with the usual umask 022 was readable by every other chat (checked live). Chat processes now start with 077. The probe also refuses fenced mode where Landlock is older than ABI 6, because abstract Unix sockets belong to no user and only the fence can keep chats from each other's; an operator who accepts that says so with CODEAF_SESSIONHOST_REQUIRE=uid. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…folders and local sockets Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ct sockets, the engine socket, process internals) Each is checked with a control that shows the check can pass: a chat's own abstract socket and its own engine socket work from inside the chat, and the chat's own user can read its own process's environment. The kernel answers for another chat's user are asked by a plain script running as that user, so the engine's own wording check is not what refuses. README says what the fence now needs (Linux 6.12 or newer) and that chats start with umask 077. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, own keys, git, limits) The hosted-sessions manual page says what a person can rely on (spend is measured by the organization and capped, their own keys are kept sealed, git works without the token ever reaching the chat, and which ports a chat's commands may reach) and what it cannot (a hostile service on an allowed port is still reachable). PROTOCOL.md lists the new routes and the host's bearer fingerprint. The change entry says what was believed before and what is true now. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… chat's first command seals its calls The first interactive hosted command printed "calls are not being sealed ... Permission denied". The furrow history helper fsyncs every ancestor folder after it first creates its group-commit file, and the 0711 folders above a chat made that open fail with EACCES for the chat's own uid. The ancestors are now 0755 (names only; the chat folders below stay owner-only), and an older 0711 ancestor is widened when it is found. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ommand's note names what the chat may reach avoiding() used to drop every grant below a folder it could not list; it now keeps granting what lies beside and below. A port-limited fence also writes its own sentence into the transcript, through Fence.WithNote, so a refused connection says which ports a chat may reach. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The git setup reads its variables through internal/env, the hosted model funnel has an owner row in the spend ledger, and the sealed-key provider names use modelsource.DefaultID rather than a literal. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… readable folders, shorter change title Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e reads the broker file's mode as the chat's own user Alpine keeps the smart-HTTP backend in git-daemon, so the stub answered every clone with a 500. The smoke's last row globbed chat folders as the machine's root, which cannot look inside them, and found nothing; it now stats each file as the chat's own user. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, never a retried 502 When the provider answered 401 or 403 to the organization's model key, the model door relayed a 502, the engine retried it quietly about once a minute and the organization's log said nothing. Now the chat's call gets a 401 with one plain sentence (not retried, no key or provider words in it) and the server's log gets ONE line naming the cause, repeated at most every 30 minutes and again as a new outage once the key has worked. A person's own stored key that is rejected gets the same treatment worded as theirs, and the organization's key is never used in its place. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tences The manual's cost section and deploy/org's README say the exact sentences a person reads when the provider refuses the organization's key or their own, the change entry records what was true before, and a probe keeps the sentence reachable. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…made the contract
TestP1_1 still expected the provider's own words ("invalid key") in what a person reads when
their own key is refused. Item 0 made that a plain sentence worded as theirs with none of
the provider's words, so the test now asserts that sentence and that the provider's words
and the key are absent; it still asserts the 401, that the key never appears in the body or
headers, and that the upstream saw exactly the keys it should. The code is right and the
test was stale: the contract said so before the code changed.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…y digest A tag can be re-pointed, a digest cannot. Tag and digest are kept together so the reader sees what was meant; gate/pins-check.sh (a later commit) fails a Dockerfile that drops one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eny every build context by default codeaf.Dockerfile gains a source mode (CODEAF_BINARY_FROM=source, repository root as the context) that runs make build with the commit stamped in, so the image carries the commit it is labelled with, sessionhost included; fetch (the default) and local are unchanged. A context-probe target lists what a build context holds. The build contexts are allowlists: only what a Dockerfile COPYs is named, and secret-looking names are refused last so they win inside the allowed folders. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…hat prove it image-gate.py scans a built image (trivy secret scan pinned by digest, key shapes in every layer's files, the configuration and build history, private hosts and addresses, the commit label) and never prints a value it finds. selftest.sh plants fake secrets in throwaway images and requires each to fail the right check; context-check.sh requires that a planted .env or key file cannot enter the codeaf build context; pins-check.sh requires every base image and the syntax frontend to carry a digest. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
org-images.yml builds the six images for amd64 and arm64 natively, runs the leak gate on each built image before any login, and pushes the very image it scanned as <commit>-<arch>; a manifest job joins the platforms into <commit>, dev and branch-<name> only after every gate passed. Without DOCKERHUB_USERNAME and DOCKERHUB_TOKEN it builds and scans and pushes nothing. Third-party actions are pinned by commit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ay template from them images.env points the existing *_ORG_IMAGE variables at the published names (ORG_REGISTRY and ORG_TAG choose whose and which). railway/make-template.sh builds a draft Railway template from image sources with per-deploy generated secrets and no smoke-only variable; it is a dry run unless given --apply and has no publish call. The README gains a Published images section. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…test require trivy to fire on key files Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
context-check.sh piped a tar into `docker build` on stdin, and BuildKit applies the Dockerfile-specific ignore file (codeaf.Dockerfile.dockerignore) only to a directory context, so the first CI run showed all 16 planted files entering the probe. It now extracts the repository files plus the planted ones into a directory and builds that, which is what CI's `docker build .` does, and it also plants the .git/config that a checkout leaves a token in. A Windows docker CLI (Docker Desktop from WSL) is detected and given Windows paths. The ignore files lose their entries for the retired spellings; both are deny-by-default and never let those folders in anyway. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…modified The first real image builds failed the gate on two files of the Debian base layer: libgnutls embeds test private keys (A2) and /etc/security/access.conf carries example addresses (C1). The gate now reads what dpkg (md5sums, and the Conffiles of its status database) and pip (each RECORD's sha256) recorded, hashes every file, and exempts only a file that still matches: an edited file, or one planted under a package's name, is scanned like any other. The exemption is by hash and not by place, the count of exempted files is printed, and trivy findings on them are dropped the same way. The self-test gains four cases (an unmodified library carrying a PEM block, an unmodified conffile with an address, a modified file that carries a key, an unmodified pip file) and the README says what is not scanned. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… --help `codeaf sessionhost --help` validates its environment first and exits 1 without CODEAF_SESSIONHOST_SECRET, which failed the codeaf legs after a good build (version named the commit). The step now requires the refusal that names that variable, which an unknown subcommand would not print, and still starts no server. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A bare `codeaf sessionhost` says "Choose serve, probe or health." before it reads its environment; `sessionhost serve` loads the configuration first and refuses without CODEAF_SESSIONHOST_SECRET, naming it, and never listens. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
AbirAbbas
force-pushed
the
w24/org-images
branch
from
November 24, 2026 17:44
a9aac09 to
c0345e2
Compare
railway-app
Bot
temporarily deployed
to
workaf-org-poc / production
November 24, 2026 17:47
Inactive
…_COMMIT variable A fresh Railway install of the source build set SOURCE_COMMIT to a reference to RAILWAY_GIT_COMMIT_SHA; the build received it empty and `codeaf version` said "no revision stamped". Read RAILWAY_GIT_COMMIT_SHA in the Dockerfile itself, then SOURCE_COMMIT (what CI passes), then "unknown". Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…sionhost included A clean install on Railway (new project, every service built from the repository, the keyless stub) needed things the README did not say: the codeaf, runner and sessionhost services must build from the repository root with CODEAF_BINARY_FROM=source and ORG_DIR=deploy/org (the old table built them from deploy/org, which fetches a release without the sessionhost); the sessionhost's own variables and the hosted wiring on codeaf; the public domain before codeaf's first deploy; volume sizes; pinning a commit; how to look inside a service and what to check. The Compose step that told people to build from a laptop-built binary now points at the published image or the source build. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…annot run on Railway They do (the sessionhost passes its probe there with the user switch plus Landlock); the script just does not add that service yet, and now says so. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Collaborator
Author
|
Consolidated into #2903, the |
AbirAbbas
added a commit
that referenced
this pull request
Nov 25, 2026
…ack (#2903) The hosted organisation line: a team-mode org server deciding every request through one access model (verbs, roles, grants and policy in SQLite), hosted chats run by the sessionhost under a per-chat uid inside a Landlock fence with minted model bearers, sealed keys and a git helper, shared chats acting through verbs, bots owned by their creator, the Hosting and chats policy settings, and a self-hosting stack (deploy/org Docker Compose, published images behind a leak gate, a Railway path). Consolidates #2894 #2895 #2896 #2898 #2899 #2900 and the follow-ups #2904 #2905 #2907 #2908 #2910 #2911 #2912 #2913 #2915 #2916 #2918 #2927 #2936 #2944. Proven by the full suite, a keyless Compose smoke, a hostile wire client, sandbox escape probes, a real-model run and a production-style install from the published images. Co-Authored-By: Santosh kumar <[email protected]> Co-Authored-By: ZeroPoint95 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Draft, stacked on #2898 (
w24/sessionhost-p1; the base here isdev, so the diff also shows #2898's commits until it merges). Nothing in this PR is merged or published anywhere.Why
A Railway template normally takes its services from a GitHub repository through Railway's GitHub App, which this organization does not have installed. A template also accepts public Docker images, so the self-hosted org stack (
deploy/org) is now published as images, with a leak gate in front of every push, and the template is made from images instead of a repository.What
.github/workflows/org-images.yml: on every push todevand to this branch (and by hand) buildscodeaf-org(the codeaf image, built from source at the pushed commit withmake build, so it carries the sessionhost),codeaf-org-agentfield(the digest-pinned published control plane plus its health check and volume hand-off),codeaf-org-swe-af,codeaf-org-pr-af,codeaf-org-modelstubandcodeaf-org-gitstub, forlinux/amd64andlinux/arm64(native runners).deploy/org/gate/image-gate.py): trivy's secret scanner (pinned by digest) over the image, key and token shapes in every layer's files (including layers a later layer deleted), the image config and build history (a secret-named build argument or variable with a value fails), private hostnames and addresses, and the commit label. It never prints a value it finds. A file that dpkg or pip installed and that still matches the md5 or sha256 they recorded is not content-scanned (by hash, not by place; the count is printed): the first real builds failed on libgnutls's embedded test keys and a PAM sample file, and an edited or planted file is still scanned. The image it scans is the image it pushes: nothing is rebuilt in between.gate/selftest.shbuilds throwaway images with fake keys, a secretENV/label/build argument, a key in a deleted layer and private hosts planted in them, and requires each to fail the check meant to catch it (and a clean image to pass);gate/context-check.shplants.envand key files across a copy of the repo and requires that none enters the codeaf build context;gate/pins-check.shfails any base image without a digest. All three run in CI before any image is built.codeaf.Dockerfile.dockerignore, and.dockerignorefor the rest), every base image and the Dockerfile syntax frontend is pinned by digest, and every image is labelled with the commit it was built from.DOCKERHUB_USERNAMEandDOCKERHUB_TOKENsecret every job builds and scans, never logs in, and is green. The namespace is the repository variableDOCKERHUB_NAMESPACE(defaultagentfield). Tags:<12-character commit id>, a movingdevondev, a movingbranch-<name>on a branch push.images.envpoints the existing*_ORG_IMAGEvariables at the published names (docker compose --env-file .env --env-file images.env pull && up -d --no-build);compose.yamlis untouched and a plaindocker compose up --buildbuilds locally as before.deploy/org/railway/make-template.sh: builds a DRAFT Railway template from image sources: no GitHub App, no deployment triggers, per-deploy${{secret(64, ...)}}for the AgentField key and the server key, no smoke-only variable, never published. It is a dry run unless given--apply, and it has not been run against Railway (the images are not on Docker Hub yet).Validation contract
devor this branch builds the six images;codeaf versionin the codeaf image names the pushed commit andcodeaf sessionhostexists in it..env, key file, profile folder or notes file never enters the codeaf build context; every base image is pinned by digest; every image carries the commit label.docker compose ... --env-file images.envresolves every service to a published image and the default (noimages.env) still builds locally;make-template.shrefuses a literal secret and a smoke-only switch.Proof
org imageson the latest commit:gate self-test(pins check, 19 planted-fake-secret cases, context check) and all 12 image legs (6 images x amd64/arm64, native runners) green; the codeaf image is built from source in about 4 minutes on either architecture andcodeaf versionnames the commit. Each leg prints its gate result in the job log (and writes it to the job summary).make test-quick(pass); local images removed by exact name.manifestjob,docker compose pull && upfrom the registry, andmake-template.sh --apply.PR gate: the redtouched resttest came from Hosted chats P1: a metered model door, sealed personal keys, git through the org server, a port limit #2898 and cleared when this branch was rebased onto its fix (e987b4d); the gate and theorg imagesrun were green on 50d2b13. Later commits change only the README, a change entry and a comment.uid+fence, and the smoke test's control, job and after-restart sections passed. The README's Railway section now follows what that install needed (the codeaf, runner and sessionhost services build from the repository root withCODEAF_BINARY_FROM=source), and the Dockerfile stamps Railway's commit.The owner needs to
DOCKERHUB_USERNAMEandDOCKERHUB_TOKEN(and, for a namespace other thanagentfield, the variableDOCKERHUB_NAMESPACE) for the first push; check the pushed repositories are public.ORG_TAG=<12-character commit id> deploy/org/railway/make-template.sh --applywithRAILWAY_WORKSPACEset, open the draft in the template editor and markOPENROUTER_API_KEYandGH_TOKENas inputs. It never publishes.🤖 Generated with Claude Code