Railshot
Agent-First Deployment System
以代理為中心的部署系統,把在自己電腦上做好的應用程式送上 AWS、GCP 雲端或地端環境。
鐵路鋪過荒野的時代,總是粗獷、進取,也有些危險。
Railshot vocabulary
- AWS · GCP
- OpenStack
CI Agents: CI Agents prepare deployment files and use failure evidence to edit allowed files. The same checks must pass before release. Dockerfile · package.policy · package.spec · source.quality · image.build · image.runtime · image.scan · GATE_ORDER · verdict.json · release_eligible · GATE VERDICT · SECRET SCAN · --cap-drop=ALL · FIXABLE · give_up · PROMPT INJECTION · FAILURE SIGNATURE · REPAIR_SCOPE · MAX_REPAIR_ATTEMPTS · claude-agent-sdk · openai-codex · fixer · lessons.md · source_change_allowed · snapshot.json · source_sha256 · verify_images · SDK_OUTCOME_UNKNOWNAutomatic Deployment Packaging: Rules prepare the Dockerfile and deployment specification, with AI assistance when needed. Packaging changes are checked against allowed files and policy. Dockerfile · package.policy · package.spec · GATE VERDICT · REPAIR_SCOPE · claude-agent-sdk · openai-codex · snapshot.jsonScoped Failure Repair: Observed failures and relevant logs inform a proposed repair. The host checks its scope and stops on disallowed changes or exhausted attempts. FIXABLE · give_up · PROMPT INJECTION · FAILURE SIGNATURE · REPAIR_SCOPE · MAX_REPAIR_ATTEMPTS · claude-agent-sdk · openai-codex · fixer · lessons.md · source_change_allowed · SDK_OUTCOME_UNKNOWNDeterministic Release Gates: Check change boundaries, deployment specifications, image builds and container execution. Repairs repeat the same required checks; quality and vulnerability scans are optional additions. package.policy · package.spec · source.quality · image.build · image.runtime · image.scan · GATE_ORDER · verdict.json · release_eligible · GATE VERDICT · SECRET SCAN · --cap-drop=ALL · verify_imagesCSP · AWS / GCP: Apps deploy to registered AWS and GCP environments. New environments are prepared with a saved Terraform plan and Ansible runtime checks. SHARED ALB · aws_lb_listener_rule · aws_lb_target_group · aws_route53_record · GCP_ROUTE_APPLY_TIMEOUT · GCP_CERTIFICATE_DNS_FAILED · SAVED PLAN · plan_sha256 · node_descriptor · guest.check · runtime.install · runtime_ready · K3S · CILIUM · AWS · GCP · TERRAFORM · ANSIBLEOn-prem · OpenStack: Connected OpenStack on-premises environments serve as app deployment targets. Customer-side CLI queries and cluster checks determine deployment readiness. WireGuard · node_descriptor · runtime_ready · K3S · CILIUM · OPENSTACK · ANSIBLE · OPENSTACK CLI · server list · server show · runtime_preparation · cluster_verified · deployableMCP: Request deployment of a repository or local project and query its status from your own AI agent. MCP acceptance and deployment completion are separate states. repository_url · archiveFromPath · inspectArchive · sourceArchive · deploy_repository · deploy_local_project · OAUTH MCP · Idempotency-Key · IDEMPOTENCY_CONFLICT · 202 ACCEPTED · EXECUTOR_BUSY · CAPACITY_EXCEEDED · maxConcurrentDeployments · workflow_dispatch · TARGET ALLOWLIST · reconciliation_required · CI_DISPATCH_UNCONFIRMEDGitOps: The tested image is published to GHCR and its deployment declaration is committed to Config Git. Argo CD application and public-response checks establish the deployment result. release_eligible · GHCR · images.json · EXACT TESTED BUNDLE · GITHUB-HOSTED RELEASE · published · publication_unverified · MANIFEST INSPECT · REGISTRY_VISIBILITY · publish-journal · railshot-release · bridge.py · workload.json · CONFIG GIT · pushing · REMOTE READBACK · ARGO CD · Synced · Healthy · targetRevision · sync_requested · NO PRUNE, NO FORCE · NetworkPolicy · routing · NodePort · LISTENER OWNERSHIP · public_probe · site_probe · railshot-health/1 · NO PROXY, NO REDIRECT · expected_json · HTTPS 200 · verified_at · public_http · health_path · readinessProbe · observed_images · containerd-snapshotter · images.tar · handoff.json · NEVER BLINDLY RETRY · probe_successEnvironment Provisioning: A saved Terraform plan prepares resources. Their descriptors feed Ansible guest and runtime work before the environment is registered as a deployment target. SAVED PLAN · plan_sha256 · node_descriptor · guest.check · runtime.install · runtime_ready · TERRAFORM · ANSIBLERuntime Readiness: Resource creation, guest checks and runtime installation have distinct states. K3s, Cilium and cluster readiness are checked before an app can deploy. node_descriptor · guest.check · runtime.install · runtime_ready · K3S · CILIUM · ANSIBLE · runtime_preparation · cluster_verified · deployableSource Snapshot: Distinguish the submitted commit from files tested after agent edits. A snapshot preserves file entries and hashes to identify the tested source. source_commit · source_parent · source_digest · snapshot.json · source_sha256 · GITHUB_SHA · harness_sha256 · SUBMITTED SOURCE CHANGED · verify_imagesArtifact Binding: Submitted source, the post-edit snapshot and the image digest are bound to the same run. CD compares run, target and configuration identities. application_id · Idempotency-Key · workflow_dispatch · GHCR · images.json · published · MANIFEST INSPECT · targetRevision · Railshot-Request · Railshot-Target · source_commit · source_parent · force: false · source_digest · snapshot.json · source_sha256 · GITHUB_SHA · PLATFORM_REF · harness_sha256 · SUBMITTED SOURCE CHANGED · IMMUTABLE GHCR DIGEST · images_sha256 · observed_images · PULL BY DIGEST · imagePullSecrets · containerd-snapshotter · RESUME_PUBLICATION_CHANGED · verify_images · images.tar · handoff.json · producer_attempt · bundle_artifact_id · run_id · state.bindings · CI_BINDING_MISMATCH · DEPLOYMENT BINDING CONFLICT · config_sha256 · TARGET ALLOWLIST · registered_application · source_preparedReconciliation: An operation without a confirmed result remains unknown. Saved run records and remote state locate the existing operation before it resumes. publication_unverified · publish-journal · pushing · REMOTE READBACK · source_parent · RESUME_PUBLICATION_CHANGED · outcome_unknown · CD_RECONCILE_REQUIRED · reconciliation_required · CD_OUTCOME_UNKNOWN · SDK_OUTCOME_UNKNOWN · unknown_timeout · CI_DISPATCH_UNCONFIRMED · NEVER BLINDLY RETRY · after_reconcile · reconcile_remote · --resume · state.sqlite3 · resumePrepared · findDeployment · recoverDispatch · source_prepared · CI_DISPATCH_NOT_IDENTIFIED · resume_count · SAME WORKFLOW RUN · INTERRUPTED · READ-ONLY OBSERVEResume the Existing Run: Locate the saved run and remote operation before resuming deployment. Source, run and image identities are checked instead of blindly starting another build or deployment. RESUME_PUBLICATION_CHANGED · after_reconcile · --resume · state.sqlite3 · resumePrepared · findDeployment · recoverDispatch · source_prepared · CI_DISPATCH_NOT_IDENTIFIED · resume_count · SAME WORKFLOW RUN · INTERRUPTEDUpdate Preview: Compare changed files before starting an update from the reviewed source. If deployed source is unavailable, the preview labels its submitted-source baseline. A changed baseline blocks the start. application_id · base_deployment_id · base_revision · baseline_kind · expires_at · source_comparison_only · changes · preview · startUpdate · UPDATE_BASE_CHANGED · source_digestDeployment Queue: Accepted deployments enter a durable queue; eligible requests start in order. Per-app writers and total concurrency are bounded. An uncertain operation blocks new work for the same app. application_id · queued · queue.sequence · enqueued_at · pump · maxConcurrentDeploymentsObservability: Read app status, logs, request trends and environment metrics. Missing or stale measurements are not filled with healthy values, and observation does not advance deployment. observationRetry · next_retry_at · consecutive_failures · no_data · stale · collection_failed · NOT A SUCCESS GATE · probe_success · PROMETHEUS · BLACKBOX EXPORTER · READ-ONLY OBSERVEApp Lifecycle: Update, stop, start or delete an app while preserving its identity and environment. Plans distinguish affected and retained resources; results record residual resources. application_id · planLifecycle · applyLifecycle · plan_hash · retained · residuals · stop · start · delete
在把團隊的成果整合到同一個分支時,我讓負責實作的工作階段與確認結果的工作階段分開。
我負責團隊儲存庫的整合與 CI,並在 Codex Desktop 工作階段中開發。
放大檢視摘要
1 / 501 負責
四句話來自一個團隊儲存庫的記錄,該儲存庫在三天內合併了 187 個 PR
開發與整合在 Codex Desktop 工作階段中進行。22 個最上層工作階段執行了 50 個子代理;其中 22 個以 audit 名稱執行,6 個以 review 名稱執行。
- 參與期間
- 2026.09.28–10.04
- 團隊儲存庫中已合併的 PR(10.02–10.04)
- 187
- Codex Desktop 工作階段檔案(10.01–10.04)
- 158
| 句子 | 記錄 |
|---|---|
| 隊友的成果留在負責人的 feature 分支上,整合修正則透過 codex/integrate 分支的 PR 進行 | 6 個 codex/integrate PR · 204 次合併中有 200 個是 merge commit |
| 合併進 integration 的依據,是 PR head commit 上 Railshot CI gate 的結果 | gate 通過後的合併 179 個中的 161 個 |
| 可觀測性交給另一個獨立的 Codex 工作階段,原工作階段再次檢查結果,直到公開 HTTPS 200 | L1 與 L2 失敗已診斷 → 公開 HTTPS 200 |
| 在 gate 結束前就合併的 PR 所遺漏的兩個測試,在下一個 PR 中恢復 | gate 之前合併後缺少的測試:2 → 0 |
參考資料Lauren Tan (poteto)pstackLydia HallieJarred Sumner
來源工作階段數取自本機 Codex 工作階段檔案的中繼資料
01 負責
2 / 502 判定
隊友的成果留在負責人的 feature 分支上,整合修正則透過 codex/integrate 分支的 PR 進行
2026.10.02,團隊同意以 integration/team-assembly-20261002 分支作為開發基準線。我寫下合併規則:每位負責人的實作留在其原本的 feature/* 分支上,衝突與接縫的修正則透過臨時 codex/integrate-* 分支的 PR 進行。
六個 codex/integrate-* PR 以 merge commit 合併了 feature 分支,其中五個原封不動地帶有隊友的 commit。已合併的 204 個 PR 中,200 個是有兩個父 commit 的 merge commit,因此隊友的 commit 歷史保留在 integration 分支上。
200有兩個父 commit 的 merge commit · 204 個已合併的 PR 中
| 브랜치 | 역할 ||---|---|| `main` | 검증된 릴리스 반영. 이번 feature 통합 대상이 아님 || `integration/team-assembly-20261002` | 팀 구현을 모으고 연결부를 검증하는 개발 기준 || `feature/*` | 담당 구현의 원본. 담당 범위의 변경을 유지 || `codex/integrate-*` | 충돌 해결·연결부 보완이 필요한 경우 사용하는 임시 PR 브랜치 |02 判定
3 / 503 複查
合併進 integration 的依據,是 PR head commit 上 Railshot CI gate 的結果
Railshot CI gate job 只有在為變更集選出的每項檢查都是 success、其他每項檢查都是 skipped 時才會成功。在我參與期間合併進 integration 分支的 179 個 PR 中,161 個是在其 head commit 的 gate 通過後才合併。
其餘 18 個沒有 gate 成功就合併:13 個在合併後 gate 才通過,2 個在合併後失敗,3 個早於 CI 出現。
2026.10.03,隊友的 PR #127 未通過 gate;我修正了 CI 變更範圍的計算與測試預期值,新增 API 容器的 smoke 檢查,並在 gate 通過後合併。
161gate 通過後合併 · integration 共 179 次合併中
for job in jobs: expected = 'success' if job in selected else 'skipped' if checks[job]['result'] != expected: raise ValueError(f'{job}: expected {expected}, got {checks[job]["result"]}')03 複查
4 / 504 校正
可觀測性交給另一個獨立的 Codex 工作階段,原工作階段再次檢查結果,直到公開 HTTPS 200
2026.10.03,原本的 Codex 工作階段把可觀測性工作的一個 worktree、已知缺陷與完成標準交給另一個獨立的 Codex 工作階段,並停止編輯該 worktree。實作工作階段的變更以 PR #131 合併。
合併後,在真實 AWS 路徑上兩次驗證應用程式的執行在 L1 與 L2 失敗,其原因(缺少 .env 排除規則與一個語法錯誤)留在診斷記錄中。修正語法的原始碼通過了 CI、映像發布、GitOps、Argo 與 Pod Ready。
原本的工作階段把這個結果與實作工作階段的成果分開比對,並在 22:11 確認公開 HTTPS 位址本身回應 200。
200公開 HTTPS 狀態碼 · 由原本的工作階段親自確認
來源交接記錄與獨立比對記錄(非公開工作記錄,2026.10.03)PR #131release 37123937461L2 失敗執行 37124971085修正原始碼的執行 37125069206
04 校正
在 gate 結束前就合併的 PR 所遺漏的兩個測試,在下一個 PR 中恢復
2026.10.04,關閉處理的 PR #185 於 13:32 合併,來源檢查點復原的 PR #186 於 13:38 合併。#186 在開立 55 秒後、gate 結束前合併,合併結果中不再有 #185 新增的兩個測試。
PR #189 同時帶入兩項變更,恢復了遺漏的兩個測試,並新增一個測試:在回應遺失後,只查詢既有的執行。#189 在 gate 通過後於 13:47 合併。
合併後 rollout 執行成功,23 個復原測試在已部署的 API 容器內通過。
2#186 合併後缺少的測試0#189 合併後缺少的測試
test('local source checkpoint errors are never reported as GitHub communication errors', () => { const error = new SubmissionError('source_checkpoint', new Error('private storage path')); assert.equal(error.code, 'SOURCE_CHECKPOINT_FAILED'); assert.equal(error.reason, 'local_checkpoint_failure'); assert.equal(error.outcomeUnknown, false); assert.equal(error.upstream_status, null); assert.doesNotMatch(error.message, /GitHub|private/);});來源部署驗證記錄(非公開工作記錄,2026.10.04)PR #185PR #186PR #189rollout 37178015393