The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
3.0 KiB
Where local dev environment variables come from
If an env var is set in your shell but you can't find it in any .env* file, it is almost certainly coming from flox, not dotenv.
This is the layering, highest precedence first.
The layers
- Your shell — anything you
exportyourself wins over everything below. - flox
[vars](.flox/env/manifest.toml) — injected on everyflox activate, whichdirenvruns automatically via.envrcwhenever youcdinto the repo. This is whereDEBUG=1,DATASTORE_DATABASE, and other always-on dev knobs live. These are not in any.envfile, which is why grepping.env*for them comes up empty. .env.local— your personal, gitignored overrides and secrets (op://refs auto-resolve via 1Password). Sourced bybin/start..env.development— committed dev-mode runtime knobs..env.services— committed service connection defaults, shared with containers.
bin/start sources .env.local > .env.development > .env.services and only sets a var if it is not already in the environment, so flox [vars] and your shell take precedence over the dotenv files.
python manage.py setup_background_agents additionally appends a few keys (DEBUG, SANDBOX_PROVIDER, …) to .env from .env.example.
Tracing a var
To find where FOO is actually coming from:
# The flox layer (the usual "invisible" source):
grep -n FOO .flox/env/manifest.toml
# The dotenv layers:
grep -n FOO .env .env.local .env.development .env.services .env.example
# What the activated env actually resolves to:
flox activate -- bash -c 'echo "$FOO"'
Developing cloud-only features locally
Cloud-gated code checks is_cloud(), which is true when CLOUD_DEPLOYMENT is one of US, EU, DEV, or E2E.
DEBUG is on by default in local dev (flox [vars]), and there is a hard guard (insights/settings/utils.py) that refuses to boot with DEBUG and CLOUD_DEPLOYMENT in US/EU/DEV — because DEBUG relaxes authentication, so it must never coincide with a real deployed-cloud identity.
The sanctioned way to run local dev "as cloud" is therefore:
# in .env.local
CLOUD_DEPLOYMENT=E2E
E2E is treated as cloud by is_cloud() and is the one cloud value allowed alongside DEBUG.
Do not set CLOUD_DEPLOYMENT=US and unset DEBUG to get around the guard — unsetting DEBUG then trips the sandbox-provider guards (docker / MODAL_DOCKER require DEBUG), and you end up playing whack-a-mole between the two.
Code that branches on the literal region (get_instance_region(), region == "US") will see "E2E"; for region-specific work, override it per-test with @override_settings(CLOUD_DEPLOYMENT="US") (tests are exempt from the guard).
COMPACT_IN_REGION controls which Cloud region registers the daily AI checkpoint compaction schedule. It defaults to US; set it explicitly only when moving the rollout to another region.
See also sandboxes-setup-guide.md for the Insights Desktop sandbox providers.