Repository navigation
Conversation
…cripts Dev now uses the production env contract and the production swap steps (DBLM-556): - deploy/gcp/dev/env-overrides: dev values and the 22 Secret Manager references. The host names are only in DOMAIN and EIGENINFERENCE_CONSOLE_URL. - deploy/gcp/dev/seed-env.sh: writes /etc/d-inference/env once, checks it with the production refresh, and writes nothing when the check fails. - deploy/gcp/host-setup.sh: host setup that a human runs over IAP. - deploy/gcp/dev/swap.sh: steps 2 to 4, Verification and Rollback of docs/operations/coordinator-deploy.md, with automatic rollback. - deploy/gcp/dev/deploy.sh: step 1, ships swap.sh over IAP, enforces DEV_DEPLOY_PAUSED (fail closed, --override-pause with a reason). - deploy/gcp/dev/preflight.sh: read-only checks for the first deploy. - Remove the old dev path: vm-startup.sh, refresh-env.sh, cloudbuild.yaml, bootstrap.sh. - scripts/smoke-dev.sh reads active_providers and takes MODEL. - scripts/test-dev-deploy.py runs in Release Integrity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- deploy.sh: die() prints only the message, not the exit code. The pause variable no longer uses the name of the bash builtin "source". - deploy.sh: the wait for a swap result stops when the systemd unit ends without a result, and "rollback" stops at once when the VM has no verified swap. - swap.sh: Rollback checks EIGENINFERENCE_DRAIN_GRACE=45s in the running coordinator and fallback containers before it stops them, as the production runbook does. - preflight.sh: the build check filters by the dev-build trigger, as deploy.sh does. - host-setup.sh: one die() helper; cmp replaces a one-use helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project d-inference with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Coverage: 14/169 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 3 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. Bedrock: 1 request(s), 54642 input / 1267 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately. |
joshconverse
left a comment
There was a problem hiding this comment.
Reviewed the exact head and targeted offline tests. I confirmed the five routing-test failures and five Vercel permission failures also occur on the base SHA, so those are not the reason for this review.
The following introduced issues need correction before host setup or deployment:
- High: host-setup.sh:131 formats the data device with mkfs.ext4 -F after any blkid failure, including read/probe errors. Verify the expected block device is blank and unused; require explicit first-format intent and reject probe errors or existing signatures.
- High: swap.sh:160 discards seed-env.sh --check failure with
|| true. Enforce the check before persistent changes, pull, or migration; require root:root ownership as well as exact 0600 file/0700 directory modes. - Medium: swap.sh installs candidate refresh tooling before prechecks and changes the live env before recording rollback state. Several failure paths and first-deploy rollback leave changed env/tooling behind. Stage and validate first, record rollback inputs before mutation, and restore both on every later failure.
- Medium: deploy.sh checks pause and master only before a possible 20-minute build wait. Recheck the live pause variable and current master immediately before SSH/archive mutation, preserving the explicit audited human override.
- Medium: the documented CI-green prerequisite is absent from deploy.sh. Gate the exact candidate's required checks; any accepted pre-existing failure needs a narrow, auditable exception rather than a blanket bypass.
- Medium: swap.sh passes the database URL, including its password, as a psql positional argument. Use a credential-safe libpq environment or private passfile so the password does not appear in process arguments.
- Low: host setup leaves already-installed but inactive/disabled Docker or Caddy down when configuration is unchanged. Make --apply converge on enabled, running services.
- Low: override reasons accept blank or multiline text that can forge audit lines. Require a nonblank single-line reason or structured escaped audit output.
I am preparing bounded fixes and regression coverage. Production cloud access, host setup, deployment, and secret reads were not performed. David retains merge and first-deploy ownership.
|
Deployment failed for project eigen-homepages-darkbloom with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
|
Deployment failed for project darkbloom-status with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
|
Deployment failed for project d-inference-console-ui-dev with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
|
Deployment failed for project d-inference-landing with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
The sandbox did not stub docker-credential-gcloud. On a host without it, host-setup.sh entered its gcloud install branch, and its shell redirect wrote to the real /etc/apt/sources.list.d before the disk-format test was reached. Stub it with the other mutating commands. On macOS the temp root is under a symlink (/var -> /private/var), so the resolved deploy files looked outside the deploy root and swap.sh refused to run. Resolve the sandbox root. Three rollback tests need GNU ln -T, which swap.sh uses on the Ubuntu VM. They skip with a reason where only BSD ln exists, and still run on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stubbed command answers every call. With mktemp stubbed, the calls other than the failing one return an empty path, and a later step wrote the env file to ./env in the repository root. Run these tests from the sandbox root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@joshconverse Your fixes are merged into this branch. Head is now
Results on
CI still does not reach these tests. Release Integrity stops earlier, on the inherited Please re-review when ready. Your "changes requested" review still stands on the PR. |
deploy.sh judged every unfinished check run of the candidate as pending,
including the deploy job that runs it, and failed at once without a wait.
It also counted skipped and neutral conclusions as failures, so a
path-gated required job (for example the provider lanes on a
coordinator-only commit) blocked every automatic deploy.
verify_ci now waits, bounded by CI_WAIT_S from the start of step 1, for
the required check runs to report and complete and for every status
context to leave pending. Other unfinished check runs are reported, not
awaited. success, neutral and skipped pass, as in GitHub branch
protection; every other conclusion still fails.
The empty --allow-ci-failure array is expanded with the ${a[@]+...}
form, so macOS /bin/bash 3.2 names the failing check instead of
aborting on "unbound variable". The CI-waiver audit line names the
operator with the same account and user@host as the pause override.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
swap.sh removed the private database credential files after the deploy was complete but before it set COMMITTED, so a removal failure ran the EXIT trap rollback against a healthy deploy. The deploy is now committed first; a removal failure adds "; private database credential cleanup failed" to the OK line and a REPORT line, and never rolls back. prepare_psql accepted only a query of exactly sslmode=require. It now requires one sslmode of require, verify-ca or verify-full, accepts other parameters, gives sslrootcert to psql, and refuses query parameters that name another host, port, database, user, password or service. Each deploy left an attempt directory with a full copy of the secret env file, and old commit directories, forever. A committed deploy now removes every attempt except its own (the one rollback-state names) and every commit directory except the current and previous deploy files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
host-setup.sh --apply restarted Caddy on every run, which dropped every live TLS and provider websocket connection even when the Caddyfile was unchanged. It now keeps systemctl enable --now caddy and runs systemctl reload caddy only when it wrote a new Caddyfile and Caddy was already running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reflow two comment blocks, split the sslrootcert count check from the value check, state why a reported post-commit credential cleanup failure clears PG_TMP, and name the refused passfile parameter in the runbook. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@joshconverse Review of PR 1375, by someone other than its author. Fixes are on this branch at
Two behavior changes need your decision:
Finding 1 design: the deploy waits up to Validation on
Not verified:
PR 1374 also edits |
…cripts # Conflicts: # docs/reference/configuration.md
swap.sh keeps a refresh backup that does not match env.before (the only copy of an env change made during the deploy). A restore no longer removes the refresh backup, so a failed removal cannot stop the restore of the prior rollback state. The unreachable backup cleanup in rollback is gone. A committed deploy removes each env.bak.<UTC> copy whose bytes equal the live file or the retained env.before; the boot refresh unit makes one at each boot. The generated-history prune is one find -delete per directory. seed-env.sh reports a kept post-seed refresh backup and does not fail after the env file is in place. Both scripts read the refresh backup through one contract file, deploy/gcp/dev/refresh-backup.sh. deploy.sh replaces a same-commit directory whose tree differs when neither current nor rollback-state uses it, and removes hidden staging directories older than 60 minutes. The Dev Deploy Safety workflow uses one YAML-anchored path list that also covers coordinator/api/server.go and scripts/smoke-dev.sh. A test checks that the list covers every file the suite reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor pass (subagent): STAGE_GLOB names the find pattern; in_use() has no double negatives and states that an unreadable link or state file counts as a use; the env backup prune comment names every source of the copies; the refresh wrapper test helper has no sentinel argument; the runbook paragraph on publication is three paragraphs. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Any reason for this to be deleted?
There was a problem hiding this comment.
Yes. deploy/gcp/cloudbuild.yaml is the build for the old dev path, and nothing current uses it:
- It builds for the old VM
d-inference-devinus-central1-a, pushes to theus-central1Artifact Registry, health-checks the retiredapi.dev.darkbloom.xyz, and restarts the VM over SSH from inside the build. - Dev now builds the way production does. Trigger
dev-build(darkbloom-devnet-infraterraform/cloudbuild/main.tf:23) runsdeploy/gcp/cloudbuild-prod.yaml. The swap is a separate step (deploy/gcp/dev/swap.sh, throughdeploy.shanddeploy-dev.yml). - On
master, onlybootstrap.shanddev-environment.mdreference the file, and this PR deletes or rewrites both. - No Terraform in
Layr-Labs/infraordarkbloom-devnet-infracreates a trigger that uses it. The one trigger known to have used it,darkbloom-dev-coordinatorin the retiredsepolia-aiproject, was disabled by Josh on 2026-10-05 (DBLM-571).
Not verified: whether a hand-made trigger in darkbloom-dev still names the file. The old bootstrap.sh describes one. Runbook 07 lists the triggers before dev-build is created, so that check covers it.
About your PR 1096: it edits this file and the other three that this PR deletes. Do you want those edits kept somewhere, or can they go with the files?
There was a problem hiding this comment.
i think it is used for darkbloom-mainnet
There was a problem hiding this comment.
Thanks. I restored deploy/gcp/cloudbuild.yaml in 683795bd, so this PR no longer deletes or changes it; the file is identical to master.
The repo says production builds from cloudbuild-prod.yaml: coordinator-deploy.md:120 checks that the prod trigger's filename is deploy/gcp/cloudbuild-prod.yaml. Also, this file pushes to darkbloom-dev and restarts d-inference-dev. But a trigger can override those substitutions, and I cannot see the mainnet triggers. So keeping it is the safe choice.
To retire it later, someone with mainnet access can run:
gcloud builds triggers list --project=darkbloom-mainnet --format='table(name,filename,disabled)'
If no trigger names deploy/gcp/cloudbuild.yaml, it can go in a separate PR. Can you clear the changes-requested state if this resolves it?
swap.sh removes an env.bak.<UTC> copy only when its bytes equal the live env file; this attempt's env.before is removed by the next deploy, so it is not a lasting copy. seed-env.sh removes its refresh backup only when the backup is the file the seed wrote, else it keeps it with a REPORT line. Both use refresh_backup_is_copy_of in refresh-backup.sh, and both fail with the file name when that helper cannot be sourced. deploy.sh counts a rollback-state whose line 6 is empty, missing or not absolute as a use (none stays a first-deploy value), so it refuses to replace the directory. When the new tree cannot be renamed into place, it renames the old tree back and prints FAIL; when that also fails, the FAIL line names the commit path and the directory with the old files. The workflow path test, its comment and docs/developer/test.md now say which inputs the test names, not every file the suite reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor pass (subagent): one module-level tree_contents() test helper replaces two inner tree() copies; the runbook seed paragraph is rewrapped and uses ASD-STE100 wording. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Second review of head Needs a fix before host setup or the first automatic deploy
The open question on the deleted
|
…cripts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… into devnet/dev-deploy-scripts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
host-setup.sh reads disk signatures with wipefs -O TYPE; -o is --offset and util-linux refuses "-o TYPE". The test stubs pin the exact lsblk and wipefs flags and fail on any other call. deploy.sh no longer gates on Vercel status contexts (web preview deploys); it lists them in a REPORT line, and a commit with no status context passes. It ships the files of the candidate commit, not HEAD, and refuses --override-pause under GitHub Actions. swap.sh uses last-good-image as the previous image when no coordinator container runs, keeps the older fallbacks and images on such a run, and refuses a rollback that names no previous image after an earlier deploy. The --migrate-only output goes to a root-only file on the VM. A flock on the deploy state dir lets one swap or rollback run at a time. The runbook documents each change, and that dev takes EIGENINFERENCE_MDM_URL from the image, as production does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor pass (subagent): the Vercel status filter is one jq definition that single-quoted programs use; the lock and migrate-only comments state their intent; fcntl is a module import in the tests; the runbook paragraph on shipping and the lock is rewrapped. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed deploy that found no coordinator container restores that state, so its own automatic rollback starts no container, as before. Only MODE=rollback refuses a record with no previous image after an earlier deploy. test_automatic_cleanup_reports_rollback_command_failure covers the automatic case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
macOS /bin/bash 3.2 exits at once when "." names a missing file, so the "|| fail" after it never ran and the named FAIL line was lost. The CI macOS runner uses that bash; local runs used bash 5. Test that the helper is readable first, in seed-env.sh and swap.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@jonathan308 @joshconverse @Gajesh2007 Ready for re-review at Jonathan's must-fix items
Smaller items
Also in this head
@Gajesh2007: your CI at
|
Gajesh raised in review that a darkbloom-mainnet trigger may use this file. The repository says production builds from cloudbuild-prod.yaml (coordinator-deploy.md checks the prod trigger filename), but a trigger can override this file's substitutions, and mainnet triggers are not visible from dev. Keeping the file costs nothing; deleting it could break a production build. Retire it in a separate change after someone with mainnet access confirms that no trigger names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Moved to Layr-Labs/darkbloom-platform#10, because coordinator development now happens there (docs/developer/platform-bootstrap.md in that repo). This PR is closed; its branch is kept. |
Summary
Dev now uses the production env contract and the production swap steps of
docs/operations/coordinator-deploy.md. Scripts do the steps that a human does in production. With these scripts, David can do the first dev deploy (Linear DBLM-559) after the infrastructure apply in Layr-Labs/darkbloom-devnet-infra.Linear: DBLM-556 (this PR), DBLM-559 (first deploy). Infrastructure: Layr-Labs/darkbloom-devnet-infra, branch
initial-footprint(heada7ed811): VMd-inference-devinus-east4-a, Cloud SQLd-inference-dev-db(private IP), the 22 secrets that the VM account can read (coordinator_secret_ids), deploy accountd-inference-dev-deploy, triggerdev-build.Nothing in this PR ran against a real VM or GCP project.
What changes
deploy/gcp/dev/env-overridessecret-manager:<name>references for exactly the 22 secrets ofcoordinator_secret_ids. A literal can use${KEY}for an earlier key.deploy/gcp/dev/seed-env.sh--check(default, read only),--seed,--reseed. Builds/etc/d-inference/envfrom the overlay, Secret Manager (VM account) and theEIGENINFERENCE_*lines ofdeploy/environments/prod.env(first value wins). Checks the new file with the productionrefresh-env.sh --check, then moves it into place (atomic,0600,0700dir) and runs--apply. A failed check writes nothing; a failed--reseedkeeps the live file. Prints names only.deploy/gcp/host-setup.shvm-startup.sh. A human runs it once over IAP.--check(default, read only) or--apply. Packages, Docker credentials forus-east4-docker.pkg.dev, data disk, the production refresh unit and manifests (runbook step 3), Caddyfile forDOMAIN, Datadog Agent only whenDD_API_KEYis set. Writes no env value, starts no container.deploy/gcp/dev/swap.shsystemd-run. Pull by digest, label checks,--migrate-only(default on),last-good-image,coordinator_fallback_<ts>,docker stop -t 75,/health+build_commit+/readyz, automatic rollback on a hard-gate failure.OK/FAIL/REPORTlines. A failed container log goes to a root-only file on the VM, never to the output (the repository is public).deploy/gcp/dev/deploy.sh[deploy|rollback] [--dry-run] [--override-pause "<reason>"]. Pause gate, runbook step 1 (candidate =origin/master, trigger file, SUCCESSdev-build, digest), ships the commit's deploy files over IAP and runsswap.sh.SSH_KEY_FILE,MIGRATE_ONLY,ON_SUPERSEDED=skip,deployed=true|falseto stdout andGITHUB_OUTPUT: the interface ofexamples/d-inference/deploy-dev.yml.deploy/gcp/dev/preflight.shPASS/FAIL(with the fix)/WARNper line, exit 1 on aFAIL.scripts/smoke-dev.shactive_providers;MODEL(defaultQwen3.5-9B); default host fromDOMAINof the overlay.scripts/test-dev-deploy.pydeploy/gcp/refresh-env.sh,deploy/gcp/cloudbuild.yaml,deploy/gcp/bootstrap.sh,deploy/gcp/vm-startup.sh. Every reference is fixed except frozen reports.docs/operations/dev-environment.mdrewritten; one-line updates inconfiguration.md,build.md,enrollment.md,threat-model.yaml,coordinator-deploy.md(intro),test.md,AGENTS.md;CHANGELOG.md(topic "Unreleased — DevNet").Unchanged:
deploy/gcp/prod/*,deploy/gcp/cloudbuild-prod.yaml,coordinator/Dockerfile,coordinator/deploy/start.sh. The intro ofcoordinator-deploy.mdhas one new sentence.Host names
API
api.dev.darkbloom.dev(confirmed). Consoleconsole.dev.darkbloom.dev(pending confirmation). They are in one place:DOMAINandEIGENINFERENCE_CONSOLE_URLindeploy/gcp/dev/env-overrides.EIGENINFERENCE_BASE_URL,CORS_ORIGIN, the Caddy site, the preflight DNS check and thesmoke-dev.shdefault come from these two keys. A test fails if the host names appear in a script.Decisions to review
docker stop -t 690. The current production runbook (docs/operations/coordinator-deploy.md, since refactor(coordinator): reorganize domain ownership and storage backends #1324) uses--stop-timeout 75,docker stop -t 75and requiresEIGENINFERENCE_DRAIN_GRACE=45sin the env file and in the running container. Dev follows the runbook. The overlay setsEIGENINFERENCE_DRAIN_GRACE=45s.EIGENINFERENCE_DEPLOYMENT_ENVIRONMENT=developmentis in the overlay. Without it the coordinator starts as production and the App Attest cutover checks stop it.DD_AGENT_HOSTis dropped: the coordinator starts Datadog whenDD_API_KEYis set.EIGENINFERENCE_TRUST_GEO_HEADERS=0andEIGENINFERENCE_STATE_EXPORT_ENABLED=false: required keys; the values are the code defaults (coordinator/api/geo/resolver.go,coordinator/api/operations/state_export.go).EIGENINFERENCE_MIN_TRUST=self_signed, cache routingoff, Stripe Global Payoutsfalse,EIGENINFERENCE_WARM_POOL_MIN_WARM=Qwen3.5-9B=1, APNs placeholders, throwaway MDM push P12 from Secret Manager, models from the production R2 CDN read only (MODEL_REGISTRY_CDN_BASE_URLnot set, no sidecar override), releases on R2d-inf-app-devthrougheigeninference-r2-cdn-url, Caddy ACME TLS, no image cleanup policy beyond the local 7-day prune.host-setup.shis dev only.EIGENINFERENCE_IPAPI_KEYis out of dev on purpose. This reverses the dev part of feat(devnet): bind dev-installed providers to their coordinator and add seed data #1330:eigeninference-ipapi-keyis not one of the 22 secrets that the VM account can read. Geo lookups use the free tier.DEV_DEPLOY_PAUSEDis enforced (Josh).deploy.shreads the variable before any change: the env varDEV_DEPLOY_PAUSEDwhen set, elsegh variable get DEV_DEPLOY_PAUSED -R Layr-Labs/d-inference. Onlyfalsecontinues.true, an empty value or a failed read stops with exit 3 and changes nothing (rollback too). A human can pass--override-pause "<reason>"; aREPORTline records the account, user, host and reason.--dry-runreports the state and continues. The first manual deploy uses--override-pause "first deploy DBLM-559".ghtoken used bydeploy.shneeds read access to the Layr-Labs/d-inference repository variables.deploy-dev.yml(DBLM-569) must passDEV_DEPLOY_PAUSED: ${{ vars.DEV_DEPLOY_PAUSED }}and must not use--override-pause. The sample in darkbloom-devnet-infra skips push runs when paused but runsworkflow_dispatch; with this gate a dispatch while paused also stops.deploy.shusesgit ls-remote(notgit fetch) for runbook step 1, andgit archive HEADto ship the files, so it changes no local ref and ships exactly the commit.First-deploy sequence (DBLM-559)
From a clean detached worktree at
origin/master(details indocs/operations/dev-environment.md):deploy/gcp/dev/preflight.sh: fix everyFAILexcept the two host lines.host-setup.sh --applyover IAP.seed-env.sh --seed, thenhost-setup.sh --applyagain (Datadog Agent), then the preflight again: allPASSorWARN.deploy/gcp/dev/deploy.sh --dry-run, thendeploy/gcp/dev/deploy.sh --override-pause "first deploy DBLM-559": expectOK <commit> drain_s=0 ..../health(version,build_commit) and the VM state.last-good-image).deploy.sh rollback --override-pause "rollback test DBLM-559", then a reboot test.Before and after
flowchart LR classDef old fill:#fde2e2,stroke:#b42318,color:#000 classDef new fill:#dcfce7,stroke:#15803d,color:#000 classDef gate fill:#fef3c7,stroke:#b45309,color:#000 subgraph Before["Before: old dev path"] B1["gcloud builds submit<br/>cloudbuild.yaml"]:::old --> B2["VM metadata DINF_IMAGE_TAG"]:::old B2 --> B3["refresh-env.sh heredoc<br/>reads Secret Manager each deploy"]:::old B3 --> B4["systemctl restart<br/>d-inference-coordinator (30 s stop)"]:::old B4 --> B5["/health version dev"]:::old end subgraph After["After: production steps"] A0{"DEV_DEPLOY_PAUSED<br/>== false?"}:::gate -->|"no: exit 3, no change"| AX["stop<br/>(or --override-pause reason)"]:::gate A0 -->|yes| A1["step 1: origin/master,<br/>SUCCESS dev-build, digest"]:::new A1 --> A2["IAP SSH: git archive of commit<br/>systemd-run swap.sh"]:::new A2 --> A3["steps 2-4: locks, pull by digest,<br/>labels, --migrate-only, refresh, stop -t 75"]:::new A3 --> A4{"/health commit<br/>+ /readyz in 180 s?"}:::gate A4 -->|yes| A5["OK, last-good-image"]:::new A4 -->|no| A6["automatic rollback, FAIL"]:::gate endflowchart TB classDef file fill:#e0ecff,stroke:#1d4ed8,color:#000 classDef prod fill:#eeeeee,stroke:#666,color:#000 classDef del fill:#fde2e2,stroke:#b42318,color:#000 subgraph Code["Code: who calls what (after)"] D["dev/deploy.sh"]:::file --> S["dev/swap.sh (VM, root)"]:::file S --> R["prod/refresh-env.sh (unchanged)"]:::prod S --> K["dev/seed-env.sh --check"]:::file K --> R SE["dev/seed-env.sh --seed"]:::file --> O["dev/env-overrides"]:::file SE --> P["environments/prod.env"]:::prod SE --> R H["host-setup.sh"]:::file --> R H --> O PF["dev/preflight.sh"]:::file --> H PF --> K end subgraph Removed["Removed (before)"] X1["vm-startup.sh"]:::del X2["refresh-env.sh (dev)"]:::del X3["cloudbuild.yaml"]:::del X4["bootstrap.sh"]:::del endLegend: blue = new dev script or file, grey = production file (unchanged), red = removed or old path, amber = a gate.
Test plan
shellcheck -S warningandbash -non every new and changed script: clean.python3 scripts/test-dev-deploy.py: 22 tests pass on macOS and inubuntu:24.04as a non-root user (awk is mawk).python3 scripts/test_operations_scripts.py: 4 tests pass../scripts/test-prod-env-refresh.sh: pass.actionlint .github/workflows/ci.yml: clean.python3 scripts/test-ci-component-paths.py,python3 scripts/test-provider-ci-workflow.py: pass.python3 scripts/test-integration-ci-workflow.pyfails onorigin/mastertoo (not caused by this PR).make docs-check: 339 files OK.make docs-impact-check BASE=origin/master: coverage OK.host-setup --check,seed-env --checkanddeploy --dry-run, and a disabled pause gate, each made the matching test fail; the files were then restored and confirmed by checksum.Unit tests (
scripts/test-dev-deploy.py), all pass:test_every_required_key_has_a_dev_source,test_host_names_live_only_in_the_overlay,test_overlay_is_values_only_with_secret_referencestest_check_is_read_only,test_failed_reseed_keeps_the_live_file,test_missing_required_secret_writes_nothing,test_multiline_secret_is_refused,test_other_project_is_refused_before_any_change,test_reseed_replaces_the_file_and_keeps_the_old_one,test_seed_keeps_an_existing_file,test_seed_writes_a_file_that_passes_the_production_checktest_deploy_dry_run_makes_no_mutating_call,test_deploy_refuses_when_paused,test_deploy_refuses_when_the_pause_state_is_unknown,test_deploy_stops_when_master_moved,test_dry_run_reports_the_pause_and_continues,test_host_setup_check_makes_no_mutating_call,test_host_setup_refuses_other_project,test_override_with_a_reason_proceeds,test_preflight_makes_no_mutating_call,test_preflight_vm_part_makes_no_mutating_call,test_swap_refuses_other_projectThe zero-mutation tests replace every command that can change state (
gcloud,docker,systemctl,apt-get,mount,install,mv,rm,gh,git, …) with a stub that records its arguments, and fail on any call outside a read-only allowlist.Swap rehearsal (not in CI):
seed-env.shandswap.shran as root inubuntu:24.04, with stateful stubs fordocker,curl,psqlandgcloud:seed-env.sh --seedOK wrote,root:root 0600file in0700dirseed-env.sh --checkPASS, no changeOK <A> drain_s=0, no fallbackOK <B>, fallback with image A stopped,last-good-image= B, old file dir removedMODE=rollbackOK rolled back to <image A>/healthnever reports CFAIL candidate not ready within 180 s; rolled back to <image A>, log in a root-only fileThe refactor subagent pass (AGENTS.md) made small cleanups and found one bug:
dieprinted the exit code. Its other findings are fixed in the second commit: the result wait stops when the unit ends early;rollbackstops at once with no verified swap; manual Rollback checks the drain grace of the running containers as the runbook does; preflight filters builds by thedev-buildtrigger.Not verified
gcloudauth todarkbloom-devhad expired, so no live read was made.host-setup.sh --applydid not run anywhere (apt, Caddy, mkfs, the Datadog install script).gcloudof the Ubuntu GCE image (the script installs the apt package whendocker-credential-gcloudis missing).roles/cloudbuild.builds.viewerforgcloud builds triggers describeby the deploy account.Overlaps
deploy/gcp/bootstrap.sh,cloudbuild.yaml,refresh-env.sh,vm-startup.sh,docs/operations/dev-environment.mdandAGENTS.md. This PR deletes the first four. The merge that lands second must resolve this.EIGENINFERENCE_IPAPI_KEYline on purpose (decision 5).Follow-ups outside this PR
provider-swift/Sources/ProviderCore/Security/MDMEnrollment.swift:32-33: the MDM host list namesapi.dev.darkbloom.xyz, notapi.dev.darkbloom.dev. Enrollment on the new dev host needs this change (provider code; not in this PR).deploy/provider-fleet/update-fleet.sh:24: the devCOORD_URLdefault is the.xyzhost..xyzdev host:docs/architecture/overview.md:27,docs/glossary.md:18,docs/operations/model-migration.md:13,docs/operations/model-revisions.md:40,docs/operations/provider-release.md:487,docs/operations/routing-v2-rollout.md:31,docs/threat-model.yaml:155..xyzhost as a fixture (they still pass):coordinator/tests/api/releases/contracts/install_test.go,scripts/test-install-coordinator-binding.py,provider-swift/Tests/DarkbloomCLITests/InstallerCoordinatorBindingTests.swift,provider-swift/Tests/ProviderCoreTests/Coordinator/CoordinatorClientTests.swift,provider-swift/Tests/ProviderCoreTests/Diagnostics/MDMTrustDiagnosisTests.swift,provider-swift/Tests/ProviderCoreTests/Security/MDMEnrollmentTests.swift.deploy-dev.yml(see decision 6).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.