Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

feat(endpoints): single-source environments.json registry; release builds default to prod - #775

Merged
shiba4life merged 1 commit into
mainfrom
feat/env-url-registry
Apr 30, 2026
Merged

feat(endpoints): single-source environments.json registry; release builds default to prod#775
shiba4life merged 1 commit into
mainfrom
feat/env-url-registry

Conversation

@shiba4life

Copy link
Copy Markdown
Collaborator

Summary

  • New environments.json at repo root is the single source of truth for cross-env URLs (Schema service, Exemem API, Discovery). build.rs codegens Rust constants from it; shell scripts read it via the new scripts/get-env-url.sh helper.
  • New scripts/lint-no-hardcoded-urls.sh (wired into ci-tests.yml + hooks/pre-commit) fails the build if any of the registry's gateway hostnames appear hardcoded elsewhere.
  • Release builds (cargo build --release, used by Homebrew binaries + Tauri DMG) now default to prod when EXEMEM_ENV is unset, via cfg!(debug_assertions). Debug builds (cargo run, tauri dev) keep defaulting to dev. Override paths (EXEMEM_ENV=dev, FOLD_SCHEMA_SERVICE_URL, etc.) all still work.
  • Migrated existing hardcodes in daemon.rs (CLI + LaunchAgent plist), run.sh, run_prod.sh, org-test.sh, test-framework/run-scenario.sh, .github/workflows/e2e-cloud.yml.

Fixes the symptom where freshly-installed Tauri builds hit dev us-west-2 instead of prod us-east-1 because no build step set EXEMEM_ENV=prod. CLAUDE.md gains an "Endpoint registry" section documenting the contract.

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • cargo check --workspace --all-targets clean (1 pre-existing warning unrelated)
  • bash scripts/lint-no-hardcoded-urls.sh clean (zero offenders workspace-wide)
  • bash scripts/lint-rev-pin-format.sh still clean
  • All 4 migrated shell scripts pass bash -n
  • scripts/get-env-url.sh resolves all 8 (env, key) pairs correctly
  • Generated environments_generated.rs matches environments.json content
  • CI: ci-tests workflow (rust-tests + lints, including new no-hardcoded-urls lint)
  • CI: e2e-cloud workflow (verifies the env-resolution step works end-to-end against dev)

🤖 Generated with Claude Code

…ilds default to prod

Cross-environment URLs (Schema service, Exemem API, Discovery service)
now live in a single file, environments.json, at the repo root. build.rs
reads it at compile time and emits per-(env, key) constants in OUT_DIR;
endpoints.rs includes them via include!(). Shell scripts call the new
scripts/get-env-url.sh helper. CI lint scripts/lint-no-hardcoded-urls.sh
fails if any of the registry's gateway hostnames appear in any other
tracked file (allow-list with reasons in the script). Wired into
ci-tests.yml and the pre-commit hook.

Migrated callers: daemon.rs CLI flag + LaunchAgent plist (no more inline
URL); run.sh, run_prod.sh, org-test.sh, test-framework/run-scenario.sh
(jq via the helper); e2e-cloud.yml workflow (resolves URLs after
checkout instead of static env: values).

Release defaults: Environment::from_env() now returns Prod for release
builds when EXEMEM_ENV is unset (was always Dev). Debug builds keep the
existing Dev default. Concretely: shipped Tauri DMG + Homebrew binaries
(both use cargo build --release) hit prod by default; cargo run / tauri
dev stay on us-west-2. Override with EXEMEM_ENV=dev or any of the
per-URL env vars (FOLD_SCHEMA_SERVICE_URL, EXEMEM_API_URL,
DISCOVERY_SERVICE_URL).

CLAUDE.md "Endpoint registry" section documents the contract end-to-end
including the deliberately-frozen exceptions (historical dogfood
reports, CDK deploy outputs, schema-infra submodule lag).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shiba4life
shiba4life enabled auto-merge April 30, 2026 23:31
@shiba4life
shiba4life added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit 433b73d Apr 30, 2026
10 checks passed
@shiba4life
shiba4life deleted the feat/env-url-registry branch April 30, 2026 23:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant