Skip to content

Railway path: a stranger's walk fixed (source, order, health check, claim link, model door key) - #2911

Merged
AbirAbbas merged 8 commits into
org/mainfrom
org/railway-docs
Nov 25, 2026
Merged

AbirAbbas merged 8 commits into
org/mainfrom
org/railway-docs

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Draft into org/main. Do not merge into dev.

A fresh install of the self-hosted organization on Railway, followed only from docs/organizations.md and deploy/org/README.md: a new empty project in a Railway workspace, every service built from source on Railway. All seven services came up (agentfield, codeaf, runner, sessionhost, swe-af, pr-af, the keyless model stub), the sign-in page answered over HTTPS, the sessionhost probe said uid+fence with Landlock ABI 7, and AgentField refused a call without its key. This PR fixes what that walk found wrong, missing or misleading.

What changed

  • railway up from a checkout works. It used to stop while indexing, on a tracked symlink to nothing in internal/skills/testdata. The test now makes its links in a temp directory; deploy/org/gate/upload-check.sh fails CI if a tracked symlink to nothing comes back.
  • The model door's key. The README, compose.yaml and the manual said the door uses OPENROUTER_API_KEY (or "the key the server already holds"). It uses CODEAF_HOSTED_MODEL_KEY, else the organization key saved in Settings, Organizations; it never reads OPENROUTER_API_KEY. A real key put only there left hosted chats without one.
  • Railway README section: how the source gets onto Railway (connect the public repo, a fork, or railway up), the order that worked, a health check path for codeaf (/v1/about), GH_TOKEN, volume sizing (a volume cannot shrink), the operator link (a new deploy/org/railway/operator-link.sh; a restart of an unclaimed server retires the old link; anyone who can read the project's logs can read it), and the checks (railway ssh needs a retry sometimes; a Railway container has no /sys/kernel/security/lsm, so the probe is the check).
  • A service deployed before the service it names existed. swe-af got CODEAF_BASE_URL=http://:8890/api/v1 (empty host) while the variables page showed the right value, and the self-test's job section failed until it was redeployed; the README now says to create the stub with the other services and how to check what a service received (railway ssh -s swe-af -- printenv ...).
  • make-template.sh now carries the sessionhost, the hosted variables and the codeaf health check (dry run: 19 calls; still never run against Railway, because the images are not on Docker Hub yet). docs/organizations.md and the manual page say so.

Validation Contract

  • Following only the docs, every service of the stack deploys on Railway and the public name answers the sign-in page. (Observed.)
  • The operator claim link is obtainable the way the docs say, and railway/operator-link.sh prints exactly it. A restart of an unclaimed server retires the old link (verb: check says revoked) and makes a new one. (Observed; the organization was not claimed.)
  • On Railway the sessionhost reports ok, uid+fence, Landlock ABI 7, and a Landlock ruleset on that kernel refuses a file write and a TCP connect that the control run allowed. (Observed.)
  • make-template.sh's dry run includes the sessionhost from the codeaf image with a /chats volume, no public domain, the shared secret by reference, and a /v1/about health check on codeaf; it carries no literal secret. (deploy/org/railway/railway_scripts_test.sh, 18 rows, offline.)
  • operator-link.sh prints the last link, exits 1 with a plain sentence when there is none, and 2 when railway is missing or fails. (Same test file.)
  • A tracked symlink that points at nothing fails upload-check.sh, and the tree passes it. (Same test file.)
  • TestDiscoverFollowsLinkedSkillFolders still finds the linked skill folder by name, unshadowed and sized, and does not find the link to nothing.
  • With the stub, the runner's own self-test passes both sections on Railway (selftest RESULT PASS, control and job), after that redeploy. (Observed.)

🤖 Generated with Claude Code

AbirAbbas and others added 8 commits November 25, 2026 00:01
…nts at nothing)

`railway up` indexes the working tree and stops on the first I/O error. The tree carried one
tracked symlink to nothing, internal/skills/testdata/links/home/.claude/skills/dangling, so an
upload from a checkout of org/main died with "IO error ... dangling: No such file or directory"
before sending a byte. That is the only route to Railway for anyone who cannot connect the
GitHub repository.

TestDiscoverFollowsLinkedSkillFolders now makes its two links (one to a real skill folder, one
to nothing) in a temp directory at run time and asserts the same things; the two committed
links are gone. deploy/org/gate/upload-check.sh fails a tree that has a tracked symlink to
nothing again, and runs in the org-images gate self-test job beside the pin check.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… the operator link has a command

make-template.sh now adds the sessionhost (the codeaf image in its sessionhost role, a /chats
volume, no public domain, 1 vCPU and 1 GB, sharing the secret by reference), the hosted
variables on codeaf (the secret, the model door's address, the model door's key taken from the
template's one key input) and a health check on codeaf at /v1/about, the only route that
answers 200 without a sign-in. CODEAF_HOSTED_URL is set once the sessionhost exists, because a
reference to a service that does not exist yet fails. The dry run prints 19 calls. The header
says what was and was not run against Railway: the two config paths were read back from a live
project, and `railway environment edit --service-config` only takes its flags on a terminal.

deploy/org/railway/operator-link.sh is the Railway counterpart of operator-link.sh: it prints the
newest claim link from `railway logs --service codeaf`, and says why when there is none.
railway_scripts_test.sh checks both scripts and the upload guard offline (a fake railway on
PATH), 17 rows, and runs in the org-images gate self-test job.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…PENROUTER_API_KEY

The Railway table told a reader to put OPENROUTER_API_KEY on codeaf and said the model door
uses it. The door chooses the person's own key, then CODEAF_HOSTED_MODEL_KEY, then the
organization key an operator saved in Settings, Organizations (serve/model_route.go,
chooseHostedModelKey); the environment variable is read by the runner and the nodes only, so a
real key put only there leaves hosted chats without one. The README's real-model-door
paragraph, the compose.yaml comment and the manual's hosting page said "the key the server
already holds", which reads as that variable; they now say what it is.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… check, claim link, checks)

Followed from an empty Railway project with the keyless stub: all seven services came up from
the README's table, and the sign-in page, the sessionhost probe and AgentField's key check
passed. What a newcomer could not have known is now written down:

- how the source gets onto Railway: connect the public repository (this worked), a fork, or
  `railway up` from a fresh clone (the whole repository goes up and the service's Root
  Directory applies), and that connecting builds at once so settings come first;
- the order that worked, the health check path for codeaf (/v1/about, 200 without a sign-in),
  the model door's key (CODEAF_HOSTED_MODEL_KEY), GH_TOKEN for real work, and that a volume
  can grow but never shrink;
- the operator link: where it is, the command that prints it, that a restart of an unclaimed
  server retires it, and that anyone who can read the project's logs can read it;
- the checks: `railway ssh` needs a retry sometimes, a Railway container has no
  /sys/kernel/security/lsm so the sessionhost probe is the check, /v1/about names the commit;
- docs/organizations.md "The ten minutes" is Compose only: it now says where the Railway path
  is, and the manual's hosting page no longer says the template lacks the sessionhost.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
make changelog-check refused the previous title as too long; it now passes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… host

On this install swe-af received CODEAF_BASE_URL=http://:8890/api/v1 because it
deployed before modelstub existed, while the variables page showed the right
value; the self-test's job section failed until it was redeployed. The README now
says to create modelstub with the other services and how to check what a
service really received.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@AbirAbbas
AbirAbbas merged commit 68cf1c2 into org/main Nov 25, 2026
7 checks passed
@AbirAbbas
AbirAbbas deleted the org/railway-docs branch November 25, 2026 05:43
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant