Dashboard › cli › Distillation
9cbc3158-269b-4d0b-bdad-ee455a193951["lore_tm_v1_mdygot8bTADjwch9FLBGbrrNiBjmwZuni2SaZE_XOsI","lore_tm_v1_LoEZMgi2tCD4ZuHvY9VQQVu8eWf1RJDf9vPIlsMqkYw","lore_tm_v1_TeyAEN0RECHsCP0qxso7M17Js0NLRuNvLr6iVFwI6oQ","lore_tm_v1_ACYtDYtl0LNaHXuMJEHbPLJEbpxbWDLISCTVpkjk7mk","lore_tm_v1_uXqStRZMnrS_OFtLeF3_lbv0aMomWxIo4hGKbXILDTg","lore_tm_v1_KrUxGBLdG7aLlPPWbz7adk61iXq65YPWo8FcehZ_hnc","lore_tm_v1_eKFB2bSw6E4Em-yHjnct-TmBBj9vbt85l35ZFQME5kI","lore_tm_v1_mmrtJlHkDnWlqt4RXp5LAsEDeJt80BLn4mbhf4ngrec","lore_tm_v1_BcVsjlexRHEODCdcT6eZU00WJF0XUFCmnZkt9vQ6GTU","lore_tm_v1_px0LWykvjWisVmh_4cp6dYgHTIusTSN1kD7jRzl5Wco","lore_tm_v1_Ehd4aX6MMhvFyP3I5a-pZci9H6y9bJLsCRxR1-9TyXw","lore_tm_v1_J6HjeBhOT4Fvhbe8PR6zYbgCdOt1r4F9G4raDkXEBkE","lore_tm_v1_jWJ93FlIAbpx35UI5meiRzdBbQ0cnOGlQh3P4w8yJUk","lore_tm_v1_-bJXtkhxKH4PgmSUhDc4ml1nG1d6Wc0ZN9d98dlwbPM"]
Date: Sep 10, 2026
packages/cli/src/lib/region.ts:67-70 returns cached regions before checking claim-routed base URLs; packages/cli/src/lib/db/regions.ts:141-149 persists regions without host/identity scope, and packages/cli/src/lib/db/regions.ts:34-53 plus packages/cli/src/lib/token-host.ts:111-120 globally admit persisted regions as trusted origins.stored.example, a cached organization region at that host, SENTRY_FORCE_ENV_TOKEN=1, and an environment sntrys_ token claimed for claimed.example, debug-files upload calls getChunkUploadOptions() at packages/cli/src/commands/debug-files/upload.ts:697, which uses src/lib/api/chunk-upload.ts:135-143; global trusted-region checks permit the stale stored.example URL and prepareHeaders() at src/lib/sentry-client.ts:121-149 attaches the forced environment token. Assemble and chunk-upload paths have the same exposure.sntrys_ token, exercises the debug-files chunk-options/assemble path, and proves no old-host request receives the token.SENTRY_HOST, direct stored-versus-forced-environment token host selection, malformed-claim fail-closed behavior, and uncached-region fallback; targeted tests passed 35/35.packages/cli/src/lib/db/regions.ts currently uses process-local trustedRegionOrigins: Set<string> and lazy-seeds it once by selecting DISTINCT region_url from all org_regions rows; isTrustedRegionOrigin(origin) checks that global set. registerTrustedRegionUrls(), setOrgRegion(), and setOrgRegions() add region origins globally; clearTrustedHostState() clears the set and resets lazy seeding.getOrgRegion(orgSlug) in packages/cli/src/lib/db/regions.ts:141-149 selects region_url solely by org_slug, records a region cache hit, and returns the URL with no credential or host provenance check.pagination_cursors with the cursor-stack schema: cursor_stack is a JSON array and page_index supports bidirectional navigation; because cursors have a 5-minute TTL, the migration drops and recreates pagination_cursors.defaults table was never written by production code. Migration 12 β 13 reads any defaults.id = 1 organization and project values, writes them to metadata keys defaults.org and defaults.project, then drops defaults; new default keys are defaults.org, defaults.project, defaults.telemetry, and defaults.url.packages/cli/src/lib/db/schema.ts defines org_regions with org_slug as primary key; optional org_id added in schema v8, org_name in v9, org_role in v10; plus required region_url and updated_at. Current migration sequence includes migration 15 β 16 adding nullable auth.host for host-scoped tokens, lazily backfilled by getAuthConfig using the configured host after upgrade.listOrganizationsUncached() in packages/cli/src/lib/api/organizations.ts gets controlSiloUrl via getControlSiloUrl(), calls paginated GET /organizations/, creates regionEntries using each organizationβs links.regionUrl or controlSiloUrl fallback, then calls setOrgRegions(regionEntries); it currently does not pass discovery-host provenance.setOrgRegions(entries) in packages/cli/src/lib/db/regions.ts:204-232 upserts org_slug, region_url, updated_at, and optional org_id, org_name, and org_role keyed only by org_slug, then globally registers all entry region URLs as trusted.clearOrgRegions() deletes all org_regions rows and calls clearTrustedHostState(); getAllOrgRegions() returns a Map<string, string> of every cached org_slug to region_url without host scoping. src/commands/org/list.ts:144 uses getAllOrgRegions().setOrgRegion() or setOrgRegions(), including packages/cli/test/lib/api-client.test.ts, packages/cli/test/lib/api-client.multiregion.test.ts, command tests, API tests, and packages/cli/test/lib/security/sntrys-claim-mismatch.test.ts:278, where registerTrustedRegionUrls(["https://us.sentry.acme.com"]) is used; any provenance API/schema change will require compatibility consideration across these callers.