diff --git a/cloud/apps/relay/src/app.ts b/cloud/apps/relay/src/app.ts index 11fa3109162..d2a7aeff26f 100644 --- a/cloud/apps/relay/src/app.ts +++ b/cloud/apps/relay/src/app.ts @@ -38,7 +38,7 @@ import { type RelayAssignment, type RelayAssignmentStore, type ResolvedRelayAssignment -} from './assignment-store.js' +} from './assignment/assignment-store.js' import { ASSIGNMENT_LEASE_AUDIENCE, assignmentLeaseKeyId } from './assignment/assignment-lease.js' import { AssignmentRejectionLogWindow } from './assignment/assignment-rejection-log-window.js' import { CELL_ADMISSION_STATES } from './cell-admission-selector.js' diff --git a/cloud/apps/relay/src/assignment-placed-marker.test.ts b/cloud/apps/relay/src/assignment-placed-marker.test.ts index f50fcaa8682..d6c129ab616 100644 --- a/cloud/apps/relay/src/assignment-placed-marker.test.ts +++ b/cloud/apps/relay/src/assignment-placed-marker.test.ts @@ -1,6 +1,6 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' const CELL = { id: 'cell-a', url: 'https://relay-a.example.com', capacityRequests: 10 } diff --git a/cloud/apps/relay/src/assignment-reserve-mode-evacuation.test.ts b/cloud/apps/relay/src/assignment-reserve-mode-evacuation.test.ts index c13de69dcf0..f4e736a9331 100644 --- a/cloud/apps/relay/src/assignment-reserve-mode-evacuation.test.ts +++ b/cloud/apps/relay/src/assignment-reserve-mode-evacuation.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/assignment-reserve-mode.test.ts b/cloud/apps/relay/src/assignment-reserve-mode.test.ts index b296bba24fa..b5614aab0c3 100644 --- a/cloud/apps/relay/src/assignment-reserve-mode.test.ts +++ b/cloud/apps/relay/src/assignment-reserve-mode.test.ts @@ -1,6 +1,6 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore, RelayCellInReserveModeError } from './assignment-store.js' +import { RelayAssignmentStore, RelayCellInReserveModeError } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/assignment-reserve-spill.test.ts b/cloud/apps/relay/src/assignment-reserve-spill.test.ts index f1b8d7ed7c0..63085c3bde0 100644 --- a/cloud/apps/relay/src/assignment-reserve-spill.test.ts +++ b/cloud/apps/relay/src/assignment-reserve-spill.test.ts @@ -1,6 +1,10 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore, type AssignOptions, type RelayAssignment } from './assignment-store.js' +import { + RelayAssignmentStore, + type AssignOptions, + type RelayAssignment +} from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, diff --git a/cloud/apps/relay/src/assignment-roll-replaced-cell.test.ts b/cloud/apps/relay/src/assignment-roll-replaced-cell.test.ts index dfb06d4c748..c33bbea0792 100644 --- a/cloud/apps/relay/src/assignment-roll-replaced-cell.test.ts +++ b/cloud/apps/relay/src/assignment-roll-replaced-cell.test.ts @@ -1,6 +1,9 @@ import { createHash } from 'node:crypto' import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js' +import { + RelayAssignmentStore, + RelayHomeCellUnavailableError +} from './assignment/assignment-store.js' import { encodeMembership, type CellAdmissionMembership, diff --git a/cloud/apps/relay/src/assignment/assignment-connection-headroom-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-connection-headroom-postgres.test.ts index 2a1d9bb7fb5..450d6a958a8 100644 --- a/cloud/apps/relay/src/assignment/assignment-connection-headroom-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-connection-headroom-postgres.test.ts @@ -1,7 +1,7 @@ import pg from 'pg' import { afterAll, beforeAll, describe, expect, it } from 'vitest' import { ASSIGNMENT_CONNECTION_HEADROOM_QUERY } from './assignment-connection-headroom-query.js' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from './assignment-store.js' import { openRelayDatabase, type RelayDatabase diff --git a/cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts b/cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts index 52b2da1d6ae..76ced42bba3 100644 --- a/cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts @@ -1,6 +1,6 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants' import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from './assignment-store.js' import type { RelayCellConfig } from '../config.js' import { openInMemoryRelayDatabase, diff --git a/cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts index ac13bf5001f..32ddc40d562 100644 --- a/cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-control-supersession-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from './assignment-store.js' import { openRelayDatabase, type RelayDatabase } from '../database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL diff --git a/cloud/apps/relay/src/assignment-dead-reserve-cell-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-dead-reserve-cell-postgres.test.ts similarity index 98% rename from cloud/apps/relay/src/assignment-dead-reserve-cell-postgres.test.ts rename to cloud/apps/relay/src/assignment/assignment-dead-reserve-cell-postgres.test.ts index e64ccada30a..f40578ca4a5 100644 --- a/cloud/apps/relay/src/assignment-dead-reserve-cell-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-dead-reserve-cell-postgres.test.ts @@ -1,9 +1,9 @@ import { randomUUID } from 'node:crypto' import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest' import { RelayAssignmentStore } from './assignment-store.js' -import type { RelayCellConfig } from './config.js' -import { openRelayDatabase, type RelayDatabase } from './database.js' -import { ReserveLedgerWriter } from './reserve-ledger-writer.js' +import type { RelayCellConfig } from '../config.js' +import { openRelayDatabase, type RelayDatabase } from '../database.js' +import { ReserveLedgerWriter } from '../reserve-ledger-writer.js' // Only host-requested moves may leave a reserve cell proven dead by heartbeat and poll silence without a fence; live cells retain hosts. diff --git a/cloud/apps/relay/src/assignment-deployment-status-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-deployment-status-postgres.test.ts similarity index 98% rename from cloud/apps/relay/src/assignment-deployment-status-postgres.test.ts rename to cloud/apps/relay/src/assignment/assignment-deployment-status-postgres.test.ts index 8f045a0930d..2f280c9873d 100644 --- a/cloud/apps/relay/src/assignment-deployment-status-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-deployment-status-postgres.test.ts @@ -1,7 +1,7 @@ import pg from 'pg' import { afterAll, beforeAll, describe, expect, it } from 'vitest' import { RelayAssignmentStore } from './assignment-store.js' -import { openRelayDatabase, type RelayDatabase } from './database.js' +import { openRelayDatabase, type RelayDatabase } from '../database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL const describePostgres = databaseUrl ? describe : describe.skip diff --git a/cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts b/cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts index 737a101cc04..a6f6ea31ffc 100644 --- a/cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from './assignment-store.js' import { openInMemoryRelayDatabase, type RelayDatabase } from '../database.js' const NOW = 100_000 diff --git a/cloud/apps/relay/src/assignment-home-cell-unavailable.test.ts b/cloud/apps/relay/src/assignment/assignment-home-cell-unavailable.test.ts similarity index 98% rename from cloud/apps/relay/src/assignment-home-cell-unavailable.test.ts rename to cloud/apps/relay/src/assignment/assignment-home-cell-unavailable.test.ts index 5b2be7ff02f..e4990dd6dec 100644 --- a/cloud/apps/relay/src/assignment-home-cell-unavailable.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-home-cell-unavailable.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it } from 'vitest' import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js' -import type { RelayCellConfig } from './config.js' -import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' +import type { RelayCellConfig } from '../config.js' +import { openInMemoryRelayDatabase, type RelayDatabase } from '../database.js' const HEARTBEAT_TTL_MS = 45_000 const START_MS = 100 diff --git a/cloud/apps/relay/src/assignment-isolated-cell-replacement-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement-postgres.test.ts similarity index 99% rename from cloud/apps/relay/src/assignment-isolated-cell-replacement-postgres.test.ts rename to cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement-postgres.test.ts index e10b05fe9af..61bea6c30f3 100644 --- a/cloud/apps/relay/src/assignment-isolated-cell-replacement-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement-postgres.test.ts @@ -1,4 +1,4 @@ -import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' +import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants' import { createHash } from 'node:crypto' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' import { RelayAssignmentRowBusyError, RelayAssignmentStore } from './assignment-store.js' @@ -6,9 +6,9 @@ import { encodeMembership, type CellAdmissionMembership, type CellAdmissionState -} from './cell-admission-selector.js' -import type { RelayCellConfig } from './config.js' -import { openRelayDatabase, type RelayDatabase } from './database.js' +} from '../cell-admission-selector.js' +import type { RelayCellConfig } from '../config.js' +import { openRelayDatabase, type RelayDatabase } from '../database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL const describePostgres = databaseUrl ? describe : describe.skip diff --git a/cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts b/cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts similarity index 99% rename from cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts rename to cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts index 96df81c71b5..57f0fc36dfb 100644 --- a/cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts @@ -1,13 +1,13 @@ import { createHash } from 'node:crypto' import { afterEach, describe, expect, it, vi } from 'vitest' import { RelayAssignmentStore, RelayHomeCellUnavailableError } from './assignment-store.js' -import { ReservePaceError } from './reserve-assignment.js' +import { ReservePaceError } from '../reserve-assignment.js' import { encodeMembership, type CellAdmissionMembership, type CellAdmissionState -} from './cell-admission-selector.js' -import type { RelayCellConfig } from './config.js' +} from '../cell-admission-selector.js' +import type { RelayCellConfig } from '../config.js' import { consumeRelayCellInventoryHold, openInMemoryRelayDatabase, @@ -15,7 +15,7 @@ import { type RelayLockOptions, type RelayTransactionOptions, type SqlRow -} from './database.js' +} from '../database.js' // migration-only also holds evacuation targets, Asia rollback and failed-wave/new cells; only same-cap isolate writes rollIsolatedCells, and restore clears its stamp atomically (orca-relay-operations.md). const HEARTBEAT_TTL_MS = 45_000 diff --git a/cloud/apps/relay/src/assignment/assignment-lease.test.ts b/cloud/apps/relay/src/assignment/assignment-lease.test.ts index 5e38d64dbf6..4150a42a103 100644 --- a/cloud/apps/relay/src/assignment/assignment-lease.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-lease.test.ts @@ -11,7 +11,7 @@ import { classifyAssignmentLease } from './assignment-lease.js' import { ASSIGNMENT_LEASE_SHADOW_EVENT, AssignmentLeaseShadow } from './assignment-lease-shadow.js' -import type { RelayAssignmentStore } from '../assignment-store.js' +import type { RelayAssignmentStore } from './assignment-store.js' import type { RelayConfig } from '../config.js' import type { RelayCredentialStore } from '../credential-store.js' import { HostSessionRegistry } from '../host-session-registry.js' diff --git a/cloud/apps/relay/src/assignment/assignment-rejection-logging.test.ts b/cloud/apps/relay/src/assignment/assignment-rejection-logging.test.ts index c0181223314..9fe0e51b082 100644 --- a/cloud/apps/relay/src/assignment/assignment-rejection-logging.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-rejection-logging.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayHomeCellUnavailableError, type RelayAssignment } from '../assignment-store.js' +import { RelayHomeCellUnavailableError, type RelayAssignment } from './assignment-store.js' import type { RelayConfig } from '../config.js' const fakes = vi.hoisted(() => ({ diff --git a/cloud/apps/relay/src/assignment-reserve-mode-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-reserve-mode-postgres.test.ts similarity index 98% rename from cloud/apps/relay/src/assignment-reserve-mode-postgres.test.ts rename to cloud/apps/relay/src/assignment/assignment-reserve-mode-postgres.test.ts index 3c8e7142d20..cc9c026e167 100644 --- a/cloud/apps/relay/src/assignment-reserve-mode-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-reserve-mode-postgres.test.ts @@ -1,9 +1,9 @@ import { randomUUID } from 'node:crypto' -import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' +import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants' import { afterAll, beforeAll, describe, expect, it } from 'vitest' import { CELL_ADMIT_EFFECTIVE_FRESH_MS, RelayAssignmentStore } from './assignment-store.js' -import type { RelayCellConfig } from './config.js' -import { openRelayDatabase, type RelayDatabase } from './database.js' +import type { RelayCellConfig } from '../config.js' +import { openRelayDatabase, type RelayDatabase } from '../database.js' // Exercise admit-mode SQL, locked open-flow checks and live-reserve pins on PostgreSQL, not SQLite alone. diff --git a/cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts b/cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts index 41f8b26a557..9e570a9317e 100644 --- a/cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-row-lock-order-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from './assignment-store.js' import { openRelayDatabase, type RelayDatabase } from '../database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL diff --git a/cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts b/cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts index 787f8524546..b011a8172df 100644 --- a/cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from './assignment-store.js' import type { RelayDatabase, RelayLockOptions, SqlRow } from '../database.js' import { openInMemoryRelayDatabase } from '../database.js' diff --git a/cloud/apps/relay/src/assignment-store.test.ts b/cloud/apps/relay/src/assignment/assignment-store.test.ts similarity index 99% rename from cloud/apps/relay/src/assignment-store.test.ts rename to cloud/apps/relay/src/assignment/assignment-store.test.ts index 472c66667ad..99f8d406248 100644 --- a/cloud/apps/relay/src/assignment-store.test.ts +++ b/cloud/apps/relay/src/assignment/assignment-store.test.ts @@ -1,23 +1,20 @@ -import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' +import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract/assignment-invariants' import { createHash } from 'node:crypto' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { RelayCellConfig } from './config.js' +import type { RelayCellConfig } from '../config.js' import { RelayAssignmentRowBusyError, RelayAssignmentStore, STRANDED_MIGRATION_ABANDON_MS } from './assignment-store.js' -import { - encodeMembership, - type CellAdmissionMembership -} from './cell-admission-selector.js' +import { encodeMembership, type CellAdmissionMembership } from '../cell-admission-selector.js' import { openInMemoryRelayDatabase, type RelayDatabase, type RelayLockOptions, type RelayTransactionOptions, type SqlRow -} from './database.js' +} from '../database.js' const CELLS: RelayCellConfig[] = [ { id: 'cell-a', url: 'https://relay-a.example.com', capacityRequests: 2 }, diff --git a/cloud/apps/relay/src/assignment-store.ts b/cloud/apps/relay/src/assignment/assignment-store.ts similarity index 99% rename from cloud/apps/relay/src/assignment-store.ts rename to cloud/apps/relay/src/assignment/assignment-store.ts index 33ac8eaae70..d8ac933cc9d 100644 --- a/cloud/apps/relay/src/assignment-store.ts +++ b/cloud/apps/relay/src/assignment/assignment-store.ts @@ -1,43 +1,49 @@ -import { claimDeadManTripSlot } from './cell-dead-man-trip-slot.js' -import { createDrainMigrationRowLookup } from './drain-migration-row-lookup.js' -import { HeapWindowReaper } from './heap-window-reaper.js' -import { PlacementLoadBand } from './placement-load-band.js' -import type { SeatFeedCell } from './shadow-seat-directory.js' +import { claimDeadManTripSlot } from '../cell-dead-man-trip-slot.js' +import { createDrainMigrationRowLookup } from '../drain-migration-row-lookup.js' +import { HeapWindowReaper } from '../heap-window-reaper.js' +import type { PlacementLoadBand } from '../placement-load-band.js' +import type { SeatFeedCell } from '../shadow-seat-directory.js' import { selectIdleRegionalRehomes, type IdleRegionalRehomeCandidate, type IdleRehomeHostCursor -} from './idle-regional-rehome-selection.js' +} from '../idle-regional-rehome-selection.js' import { RegionalRehomePollTelemetry, type RegionalRehomePollGate -} from './regional-rehome-poll-telemetry.js' -import { readRegionCorrectionOutcomes } from './region-correction-outcomes.js' -import { ReservePaceError } from './reserve-assignment.js' +} from '../regional-rehome-poll-telemetry.js' +import { readRegionCorrectionOutcomes } from '../region-correction-outcomes.js' +import { ReservePaceError } from '../reserve-assignment.js' import { previewRegionalRehomeEligibility, type RegionCorrectionPreview -} from './region-correction-preview.js' +} from '../region-correction-preview.js' import { exchangeRegionCorrection, previewRegionCorrection, REGIONAL_REHOME_CONCURRENT_LIMIT -} from './region-correction-state.js' +} from '../region-correction-state.js' import { randomUUID } from 'node:crypto' import { performance } from 'node:perf_hooks' import { ASSIGNMENT_LIMITS, - mayNormallyReassign, - RELAY_ADMISSION_BUDGETS, + mayNormallyReassign +} from '@orca-cloud/relay-contract/assignment-invariants' +import { RELAY_ADMISSION_BUDGETS } from '@orca-cloud/relay-contract/admission-budgets' +import { RELAY_DEFAULT_REGION, RELAY_REGIONS, - RELAY_PROTOCOL_LIMITS, - type RelayRegion, - type RegionCorrectionRequest, - type RegionCorrectionResponse, - type IdleRegionalRehomeCommit, - type IdleRegionalRehomeRequest, -} from '@orca-cloud/relay-contract' + type RelayRegion +} from '@orca-cloud/relay-contract/relay-regions' +import { RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract/protocol-limits' +import type { + RegionCorrectionRequest, + RegionCorrectionResponse +} from '@orca-cloud/relay-contract/region-correction' +import type { + IdleRegionalRehomeCommit, + IdleRegionalRehomeRequest +} from '@orca-cloud/relay-contract/idle-regional-rehome' import { cellAdmissionState, cellAdmissionStates, @@ -51,14 +57,12 @@ import { type CellAdmissionMembership, type CellAdmissionSelectorInspection, type CellAdmissionState -} from './cell-admission-selector.js' +} from '../cell-admission-selector.js' import { RelayMigrationCellRegistrar, type MigrationCellRegistration -} from './cell-admission-migration-registration.js' -import { - ASSIGNMENT_CONNECTION_HEADROOM_QUERY -} from './assignment/assignment-connection-headroom-query.js' +} from '../cell-admission-migration-registration.js' +import { ASSIGNMENT_CONNECTION_HEADROOM_QUERY } from './assignment-connection-headroom-query.js' import { CONNECTION_CAP_COLUMNS_SQL, EFFECTIVE_HARD_CAP_SQL, @@ -68,8 +72,8 @@ import { reportedHardCapWithinLimit, writeCellConnectionLimit, type CellConnectionCap -} from './cell-connection-cap.js' -import { AssignmentIdentityQueue } from './assignment/assignment-identity-queue.js' +} from '../cell-connection-cap.js' +import { AssignmentIdentityQueue } from './assignment-identity-queue.js' import { CONTROL_RENEWAL_BATCH_SQL, CONTROL_RENEWAL_STATEMENT_OUTCOMES, @@ -78,23 +82,20 @@ import { readControlRenewalOutcomes, type ControlRenewalOutcome, type ControlRenewalRequest -} from './control-renewal-statement.js' -import { - commitWithFinalWrite, - REGIONAL_REHOME_DEFAULT_HOST_COOLDOWN_MS -} from './database.js' -import type { RelayCellConfig } from './config.js' -import type { CellLockHoldSite } from './cell-inventory-hold-samples.js' -import type { DeadCellVerdict } from './cell-poll-reachability.js' -import { isPostgresPoolConnectFailure } from './postgres-pool-pressure.js' -import { isPostgresReadTimeout } from './relay-database-rejection-fence.js' +} from '../control-renewal-statement.js' +import { commitWithFinalWrite, REGIONAL_REHOME_DEFAULT_HOST_COOLDOWN_MS } from '../database.js' +import type { RelayCellConfig } from '../config.js' +import type { CellLockHoldSite } from '../cell-inventory-hold-samples.js' +import type { DeadCellVerdict } from '../cell-poll-reachability.js' +import { isPostgresPoolConnectFailure } from '../postgres-pool-pressure.js' +import { isPostgresReadTimeout } from '../relay-database-rejection-fence.js' import type { RelayDatabase, RelayLockOptions, RelayTransactionOptions, SqlRow -} from './database.js' -import type { RegionalRehomeSafetySnapshot } from './relay-observability.js' +} from '../database.js' +import type { RegionalRehomeSafetySnapshot } from '../relay-observability.js' import { combineRegionalRehomeSafety, nextRegionalRehomeSqlFailuresBreach, @@ -104,16 +105,16 @@ import { regionalRehomeSafetyFailure, regionalRehomeSqlFailuresSustained, type RegionalRehomeSqlFailuresBreach -} from './regional-rehome-safety.js' +} from '../regional-rehome-safety.js' import { REGIONAL_REHOME_ARRIVAL_WINDOW_MS, type RegionalRehomeAbortReason -} from './regional-rehome-abort-reason.js' +} from '../regional-rehome-abort-reason.js' import { ABANDONED_REGISTERED_MIGRATION, DURABLY_FENCED_MIGRATION_SOURCE, REGISTERED_MIGRATION_ABANDON_MS -} from './registered-migration-abandonment.js' +} from '../registered-migration-abandonment.js' type AssignmentIdentity = { userId: string; relayHostId: string } type CellHeartbeat = { @@ -164,7 +165,6 @@ export type AssignOptions = { hostRequested?: boolean } -export type { ControlRenewalOutcome, ControlRenewalRequest } // `cellId` null: the reserve-mode set could not be read, so no cell is known to be in db mode. export class RelayCellInReserveModeError extends Error { diff --git a/cloud/apps/relay/src/cell-admission-selector.test.ts b/cloud/apps/relay/src/cell-admission-selector.test.ts index 41b84f91d79..ea394deb611 100644 --- a/cloud/apps/relay/src/cell-admission-selector.test.ts +++ b/cloud/apps/relay/src/cell-admission-selector.test.ts @@ -1,7 +1,7 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' import { createHash } from 'node:crypto' import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { encodeMembership } from './cell-admission-selector.js' import { openInMemoryRelayDatabase, diff --git a/cloud/apps/relay/src/cell-admission-startup-postgres.test.ts b/cloud/apps/relay/src/cell-admission-startup-postgres.test.ts index 6f93fecce6f..287ef354180 100644 --- a/cloud/apps/relay/src/cell-admission-startup-postgres.test.ts +++ b/cloud/apps/relay/src/cell-admission-startup-postgres.test.ts @@ -1,6 +1,6 @@ import pg from 'pg' import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { reconcileCellAdmissionAtStartup } from './cell-admission-startup.js' import type { RelayCellConfig } from './config.js' import { openRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/cell-admission-startup.ts b/cloud/apps/relay/src/cell-admission-startup.ts index 57c75a70f52..fa8a16b20aa 100644 --- a/cloud/apps/relay/src/cell-admission-startup.ts +++ b/cloud/apps/relay/src/cell-admission-startup.ts @@ -1,4 +1,4 @@ -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { retryTransientDatabaseStartup } from './database-startup-retry.js' diff --git a/cloud/apps/relay/src/cell-connection-cap-postgres.test.ts b/cloud/apps/relay/src/cell-connection-cap-postgres.test.ts index 61f610fc755..404b1f18112 100644 --- a/cloud/apps/relay/src/cell-connection-cap-postgres.test.ts +++ b/cloud/apps/relay/src/cell-connection-cap-postgres.test.ts @@ -1,6 +1,6 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' import { ASSIGNMENT_CONNECTION_HEADROOM_QUERY } from './assignment/assignment-connection-headroom-query.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/cell-connection-cap.test.ts b/cloud/apps/relay/src/cell-connection-cap.test.ts index 1ac448d6ccf..178d9f91256 100644 --- a/cloud/apps/relay/src/cell-connection-cap.test.ts +++ b/cloud/apps/relay/src/cell-connection-cap.test.ts @@ -1,6 +1,6 @@ import { createHash } from 'node:crypto' import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { encodeMembership, type CellAdmissionMembership } from './cell-admission-selector.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/cell-fence-legacy-adoption-postgres.test.ts b/cloud/apps/relay/src/cell-fence-legacy-adoption-postgres.test.ts index 9fc1b915481..7b30d0cefb8 100644 --- a/cloud/apps/relay/src/cell-fence-legacy-adoption-postgres.test.ts +++ b/cloud/apps/relay/src/cell-fence-legacy-adoption-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL diff --git a/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts b/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts index 5ac0b50797c..64838c3e991 100644 --- a/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts +++ b/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts @@ -32,7 +32,7 @@ vi.mock('pg', () => ({ })) const { CELL_INVENTORY_LOCK_TIMEOUT_MS, RelayAssignmentStore } = await import( - './assignment-store.js' + './assignment/assignment-store.js' ) const { consumeRelayCellInventoryHold, openInMemoryRelayDatabase, openRelayDatabase, POSTGRES_LOCK_TIMEOUT_MS } = await import('./database.js') diff --git a/cloud/apps/relay/src/cell-inventory-per-cell-locking-postgres.test.ts b/cloud/apps/relay/src/cell-inventory-per-cell-locking-postgres.test.ts index 43d3616ae95..03b51f0a426 100644 --- a/cloud/apps/relay/src/cell-inventory-per-cell-locking-postgres.test.ts +++ b/cloud/apps/relay/src/cell-inventory-per-cell-locking-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL diff --git a/cloud/apps/relay/src/cell-seat-feed.test.ts b/cloud/apps/relay/src/cell-seat-feed.test.ts index 0699a358989..e0035bc99c6 100644 --- a/cloud/apps/relay/src/cell-seat-feed.test.ts +++ b/cloud/apps/relay/src/cell-seat-feed.test.ts @@ -3,7 +3,7 @@ import { RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type WebSocket from 'ws' import { z } from 'zod' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import { CELL_FLAG_DEFAULTS, type CellFlags } from './cell-flags.js' import type { RelayConfig } from './config.js' import type { RelayCredentialStore } from './credential-store.js' diff --git a/cloud/apps/relay/src/cell-status-reserve-view.test.ts b/cloud/apps/relay/src/cell-status-reserve-view.test.ts index f51cd0e0d46..4329323e21f 100644 --- a/cloud/apps/relay/src/cell-status-reserve-view.test.ts +++ b/cloud/apps/relay/src/cell-status-reserve-view.test.ts @@ -16,7 +16,7 @@ vi.mock('./relay-token-verifier.js', () => ({ })) import { createRelayApp } from './app.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { CellReserveClient } from './cell-reserve-client.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' import { ReserveAssignment, type ReservePlacementMode } from './reserve-assignment.js' diff --git a/cloud/apps/relay/src/connection-reservation-debt-retention.test.ts b/cloud/apps/relay/src/connection-reservation-debt-retention.test.ts index fd50f9d6747..df206c53b6c 100644 --- a/cloud/apps/relay/src/connection-reservation-debt-retention.test.ts +++ b/cloud/apps/relay/src/connection-reservation-debt-retention.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/control-accept-cell-row-lock-postgres.test.ts b/cloud/apps/relay/src/control-accept-cell-row-lock-postgres.test.ts index 8cd01e48655..bea827515c6 100644 --- a/cloud/apps/relay/src/control-accept-cell-row-lock-postgres.test.ts +++ b/cloud/apps/relay/src/control-accept-cell-row-lock-postgres.test.ts @@ -1,6 +1,6 @@ import pg from 'pg' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { openRelayDatabase, type RelayDatabase } from './database.js' import { createRelayServer } from './relay-server.js' diff --git a/cloud/apps/relay/src/control-accept-cell-row-lock.test.ts b/cloud/apps/relay/src/control-accept-cell-row-lock.test.ts index bd7c166ff60..3a2ed0781c1 100644 --- a/cloud/apps/relay/src/control-accept-cell-row-lock.test.ts +++ b/cloud/apps/relay/src/control-accept-cell-row-lock.test.ts @@ -1,6 +1,6 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest' import type { RelayCellConfig } from './config.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase, type RelayDatabase, diff --git a/cloud/apps/relay/src/control-lease-recovery-postgres.test.ts b/cloud/apps/relay/src/control-lease-recovery-postgres.test.ts index fed7f56b31b..ce3b8638459 100644 --- a/cloud/apps/relay/src/control-lease-recovery-postgres.test.ts +++ b/cloud/apps/relay/src/control-lease-recovery-postgres.test.ts @@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events' import { ASSIGNMENT_LIMITS, RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract' import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' import type WebSocket from 'ws' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { CONTROL_RENEWAL_BATCH_INTERVAL_MS } from './control-renewal-batch.js' import type { RelayConfig } from './config.js' import type { RelayCredentialStore } from './credential-store.js' diff --git a/cloud/apps/relay/src/control-rebind-inventory-lock-postgres.test.ts b/cloud/apps/relay/src/control-rebind-inventory-lock-postgres.test.ts index b05b0f7ff25..6a76efcdac1 100644 --- a/cloud/apps/relay/src/control-rebind-inventory-lock-postgres.test.ts +++ b/cloud/apps/relay/src/control-rebind-inventory-lock-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL diff --git a/cloud/apps/relay/src/control-renewal-batch-store.test.ts b/cloud/apps/relay/src/control-renewal-batch-store.test.ts index 46a9d1c7d84..96f0205f238 100644 --- a/cloud/apps/relay/src/control-renewal-batch-store.test.ts +++ b/cloud/apps/relay/src/control-renewal-batch-store.test.ts @@ -1,6 +1,6 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' import { describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { ControlRenewalOutcome } from './control-renewal-statement.js' import { openInMemoryRelayDatabase, diff --git a/cloud/apps/relay/src/control-renewal-postgres.test.ts b/cloud/apps/relay/src/control-renewal-postgres.test.ts index 61cd45dea79..827c12c10da 100644 --- a/cloud/apps/relay/src/control-renewal-postgres.test.ts +++ b/cloud/apps/relay/src/control-renewal-postgres.test.ts @@ -1,7 +1,7 @@ import { performance } from 'node:perf_hooks' import { ASSIGNMENT_LIMITS, RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { CONTROL_RENEWAL_BATCH_SQL } from './control-renewal-statement.js' import { openRelayDatabase, diff --git a/cloud/apps/relay/src/control-reservation-reconnect-claim.test.ts b/cloud/apps/relay/src/control-reservation-reconnect-claim.test.ts index e6fb44e336c..6c56fa5c317 100644 --- a/cloud/apps/relay/src/control-reservation-reconnect-claim.test.ts +++ b/cloud/apps/relay/src/control-reservation-reconnect-claim.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, diff --git a/cloud/apps/relay/src/dead-cell-evacuation-precheck.test.ts b/cloud/apps/relay/src/dead-cell-evacuation-precheck.test.ts index 2fc142a4aaa..9f486c38145 100644 --- a/cloud/apps/relay/src/dead-cell-evacuation-precheck.test.ts +++ b/cloud/apps/relay/src/dead-cell-evacuation-precheck.test.ts @@ -1,6 +1,6 @@ import pg from 'pg' import { afterAll, afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, diff --git a/cloud/apps/relay/src/drain-migration-row-scaling.test.ts b/cloud/apps/relay/src/drain-migration-row-scaling.test.ts index cf8024b91ef..c0f4184b710 100644 --- a/cloud/apps/relay/src/drain-migration-row-scaling.test.ts +++ b/cloud/apps/relay/src/drain-migration-row-scaling.test.ts @@ -1,6 +1,6 @@ import { ASSIGNMENT_LIMITS } from '@orca-cloud/relay-contract' import { afterEach, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase, type RelayDatabase, type SqlRow } from './database.js' let database: RelayDatabase | undefined diff --git a/cloud/apps/relay/src/drain-release-cell-row-contention-postgres.test.ts b/cloud/apps/relay/src/drain-release-cell-row-contention-postgres.test.ts index 380d8667efd..3d5b77c4aa6 100644 --- a/cloud/apps/relay/src/drain-release-cell-row-contention-postgres.test.ts +++ b/cloud/apps/relay/src/drain-release-cell-row-contention-postgres.test.ts @@ -1,6 +1,6 @@ import { createHash } from 'node:crypto' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentRowBusyError, RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentRowBusyError, RelayAssignmentStore } from './assignment/assignment-store.js' import { encodeMembership, type CellAdmissionMembership, diff --git a/cloud/apps/relay/src/host-session-client-accept.test.ts b/cloud/apps/relay/src/host-session-client-accept.test.ts index 33a332949e1..0fc6c0d4d33 100644 --- a/cloud/apps/relay/src/host-session-client-accept.test.ts +++ b/cloud/apps/relay/src/host-session-client-accept.test.ts @@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events' import { RELAY_CLOSE_CODE, RELAY_PROTOCOL_LIMITS } from '@orca-cloud/relay-contract' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type WebSocket from 'ws' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import type { CredentialReservation, RelayCredentialStore } from './credential-store.js' import { diff --git a/cloud/apps/relay/src/host-session-preauth-latency.test.ts b/cloud/apps/relay/src/host-session-preauth-latency.test.ts index 8b3aa94afba..231f4268d75 100644 --- a/cloud/apps/relay/src/host-session-preauth-latency.test.ts +++ b/cloud/apps/relay/src/host-session-preauth-latency.test.ts @@ -8,7 +8,7 @@ import { import nacl from 'tweetnacl' import { afterEach, describe, expect, it, vi } from 'vitest' import type WebSocket from 'ws' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { CellReserveBook } from './cell-reserve-book.js' import type { RelayConfig } from './config.js' import type { RelayCredentialStore } from './credential-store.js' diff --git a/cloud/apps/relay/src/host-session-registry.test.ts b/cloud/apps/relay/src/host-session-registry.test.ts index 16b751650e3..f90bf9dfb85 100644 --- a/cloud/apps/relay/src/host-session-registry.test.ts +++ b/cloud/apps/relay/src/host-session-registry.test.ts @@ -9,7 +9,7 @@ import { } from '@orca-cloud/relay-contract' import { afterEach, beforeEach, describe, expect, it, vi, type MockInstance } from 'vitest' import type WebSocket from 'ws' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { RelayStoreError, type RelayCredentialStore } from './credential-store.js' import { CONTROL_RENEWAL_BATCH_INTERVAL_MS } from './control-renewal-batch.js' diff --git a/cloud/apps/relay/src/host-session-registry.ts b/cloud/apps/relay/src/host-session-registry.ts index 8c33507ef29..df6400cfc33 100644 --- a/cloud/apps/relay/src/host-session-registry.ts +++ b/cloud/apps/relay/src/host-session-registry.ts @@ -32,7 +32,7 @@ import type { RawData } from 'ws' import type { RelayConfig } from './config.js' import type { AssignmentLeaseClass } from './assignment/assignment-lease.js' import type { AssignmentLeaseShadow } from './assignment/assignment-lease-shadow.js' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { CellAdmitMode, CellReserveBook } from './cell-reserve-book.js' import type { DemoteRequest, ReserveOutcome, ReserveRequest } from './cell-reserve-contract.js' import { SeatDriftConfirmation, unbackedSeatReason, type UnbackedSeatReason } from './cell-seat-drift.js' diff --git a/cloud/apps/relay/src/host-signed-out-rejection.test.ts b/cloud/apps/relay/src/host-signed-out-rejection.test.ts index 0f8542c960f..47338ee30d5 100644 --- a/cloud/apps/relay/src/host-signed-out-rejection.test.ts +++ b/cloud/apps/relay/src/host-signed-out-rejection.test.ts @@ -6,7 +6,7 @@ import { } from '@orca-cloud/relay-contract' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type WebSocket from 'ws' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import type { RelayCredentialStore } from './credential-store.js' import { HostSessionRegistry } from './host-session-registry.js' diff --git a/cloud/apps/relay/src/host-whereabouts-app.test.ts b/cloud/apps/relay/src/host-whereabouts-app.test.ts index 87598028c1e..543d8314759 100644 --- a/cloud/apps/relay/src/host-whereabouts-app.test.ts +++ b/cloud/apps/relay/src/host-whereabouts-app.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' -import type { HostWhereaboutsRow } from './assignment-store.js' -import { RelayAssignmentStore } from './assignment-store.js' +import type { HostWhereaboutsRow } from './assignment/assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { openInMemoryRelayDatabase } from './database.js' import { ShadowSeatDirectory } from './shadow-seat-directory.js' diff --git a/cloud/apps/relay/src/idle-regional-rehome-reconciliation.test.ts b/cloud/apps/relay/src/idle-regional-rehome-reconciliation.test.ts index 8d24391aa72..dc5fefb3356 100644 --- a/cloud/apps/relay/src/idle-regional-rehome-reconciliation.test.ts +++ b/cloud/apps/relay/src/idle-regional-rehome-reconciliation.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayDatabase } from './database.js' import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js' diff --git a/cloud/apps/relay/src/idle-regional-rehome-store.test.ts b/cloud/apps/relay/src/idle-regional-rehome-store.test.ts index 6ce94738bbd..8d019cb1bfc 100644 --- a/cloud/apps/relay/src/idle-regional-rehome-store.test.ts +++ b/cloud/apps/relay/src/idle-regional-rehome-store.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayDatabase, RelayLockOptions } from './database.js' import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js' diff --git a/cloud/apps/relay/src/idle-regional-rehome-window.test.ts b/cloud/apps/relay/src/idle-regional-rehome-window.test.ts index deff686bd7c..cc9972faa3c 100644 --- a/cloud/apps/relay/src/idle-regional-rehome-window.test.ts +++ b/cloud/apps/relay/src/idle-regional-rehome-window.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayDatabase } from './database.js' import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js' diff --git a/cloud/apps/relay/src/idle-regional-rehome-worker.test.ts b/cloud/apps/relay/src/idle-regional-rehome-worker.test.ts index 86762899719..3653aec181b 100644 --- a/cloud/apps/relay/src/idle-regional-rehome-worker.test.ts +++ b/cloud/apps/relay/src/idle-regional-rehome-worker.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import type { RegionalRehomeSafetySnapshot } from './relay-observability.js' import { startRegionalRehomeWorker } from './regional-rehome-worker.js' diff --git a/cloud/apps/relay/src/index.ts b/cloud/apps/relay/src/index.ts index 726302bf1fa..5051588f7da 100644 --- a/cloud/apps/relay/src/index.ts +++ b/cloud/apps/relay/src/index.ts @@ -3,7 +3,7 @@ import { readAssignmentInventorySnapshot } from './assignment/assignment-inventory-snapshot.js' import { readRegionCorrectionOutcomes } from './region-correction-outcomes.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { loadRelayConfig } from './config.js' import { startCellHeartbeat } from './cell-heartbeat-client.js' import { diff --git a/cloud/apps/relay/src/migration-recovery-postgres.test.ts b/cloud/apps/relay/src/migration-recovery-postgres.test.ts index 056c9cc92ee..f21503f22d4 100644 --- a/cloud/apps/relay/src/migration-recovery-postgres.test.ts +++ b/cloud/apps/relay/src/migration-recovery-postgres.test.ts @@ -4,7 +4,7 @@ import { RelayAssignmentStore, STRANDED_MIGRATION_ABANDON_MS, type RelayAssignmentMigration -} from './assignment-store.js' +} from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' import { readRegisteredMigrationInventory } from './registered-migration-inventory.js' diff --git a/cloud/apps/relay/src/placement-load-band.test.ts b/cloud/apps/relay/src/placement-load-band.test.ts index b2edc26e0ed..396787e366c 100644 --- a/cloud/apps/relay/src/placement-load-band.test.ts +++ b/cloud/apps/relay/src/placement-load-band.test.ts @@ -5,7 +5,7 @@ import { PLACEMENT_INTAKE_WINDOW_MS, PlacementLoadBand } from './placement-load-band.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase } from './database.js' function seededRandom(seed: number): () => number { diff --git a/cloud/apps/relay/src/postgres-drain-send-locking.test.ts b/cloud/apps/relay/src/postgres-drain-send-locking.test.ts index 48edd46eed4..8e0ec89e282 100644 --- a/cloud/apps/relay/src/postgres-drain-send-locking.test.ts +++ b/cloud/apps/relay/src/postgres-drain-send-locking.test.ts @@ -1,5 +1,5 @@ import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' const databaseUrl = process.env.ORCA_RELAY_TEST_POSTGRES_URL diff --git a/cloud/apps/relay/src/postgres-lock-wait-sample-postgres.test.ts b/cloud/apps/relay/src/postgres-lock-wait-sample-postgres.test.ts index 7efdc774016..0a6202e7b3b 100644 --- a/cloud/apps/relay/src/postgres-lock-wait-sample-postgres.test.ts +++ b/cloud/apps/relay/src/postgres-lock-wait-sample-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' import { readPostgresLockWaitSample } from './postgres-lock-wait-sample.js' diff --git a/cloud/apps/relay/src/postgres-transaction-recovery.test.ts b/cloud/apps/relay/src/postgres-transaction-recovery.test.ts index fc7761a3c30..a95a8283f54 100644 --- a/cloud/apps/relay/src/postgres-transaction-recovery.test.ts +++ b/cloud/apps/relay/src/postgres-transaction-recovery.test.ts @@ -1,5 +1,5 @@ import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase, diff --git a/cloud/apps/relay/src/public-assignment-drain-return-lane.test.ts b/cloud/apps/relay/src/public-assignment-drain-return-lane.test.ts index 361dcad7575..da52fb55153 100644 --- a/cloud/apps/relay/src/public-assignment-drain-return-lane.test.ts +++ b/cloud/apps/relay/src/public-assignment-drain-return-lane.test.ts @@ -3,7 +3,7 @@ import { RelayAssignmentRowBusyError, type RelayAssignment, type ResolvedRelayAssignment -} from './assignment-store.js' +} from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' const fakes = vi.hoisted(() => ({ diff --git a/cloud/apps/relay/src/public-assignment-overload.test.ts b/cloud/apps/relay/src/public-assignment-overload.test.ts index 0e16a6bbfda..966d2d491a4 100644 --- a/cloud/apps/relay/src/public-assignment-overload.test.ts +++ b/cloud/apps/relay/src/public-assignment-overload.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import type { RelayAssignment } from './assignment-store.js' +import type { RelayAssignment } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' const fakes = vi.hoisted(() => ({ diff --git a/cloud/apps/relay/src/public-assignment-reconnect-lane.test.ts b/cloud/apps/relay/src/public-assignment-reconnect-lane.test.ts index 1b952e06412..f3d4b22469a 100644 --- a/cloud/apps/relay/src/public-assignment-reconnect-lane.test.ts +++ b/cloud/apps/relay/src/public-assignment-reconnect-lane.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentRowBusyError, type RelayAssignment } from './assignment-store.js' +import { RelayAssignmentRowBusyError, type RelayAssignment } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import type { StickySlotSample } from './sticky-slot-statements.js' import { diff --git a/cloud/apps/relay/src/region-correction-restart.test.ts b/cloud/apps/relay/src/region-correction-restart.test.ts index 02f315ab218..45f2667b4f5 100644 --- a/cloud/apps/relay/src/region-correction-restart.test.ts +++ b/cloud/apps/relay/src/region-correction-restart.test.ts @@ -2,7 +2,7 @@ import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' const identity = { userId: 'restart-test-user', relayHostId: 'abcdefghijklmnop' } diff --git a/cloud/apps/relay/src/region-correction-store.test.ts b/cloud/apps/relay/src/region-correction-store.test.ts index dc014926633..88513b200c3 100644 --- a/cloud/apps/relay/src/region-correction-store.test.ts +++ b/cloud/apps/relay/src/region-correction-store.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase, openRelayDatabase, type RelayDatabase } from './database.js' const identity = { userId: 'region-correction-test-user', relayHostId: 'abcdefghijklmnop' } diff --git a/cloud/apps/relay/src/regional-rehome-postgres.test.ts b/cloud/apps/relay/src/regional-rehome-postgres.test.ts index d6d680d5595..eabbf6d2353 100644 --- a/cloud/apps/relay/src/regional-rehome-postgres.test.ts +++ b/cloud/apps/relay/src/regional-rehome-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openRelayDatabase, type RelayDatabase } from './database.js' import { REGIONAL_REHOME_RECONNECTS_PER_CELL_LIMIT, diff --git a/cloud/apps/relay/src/regional-rehome-source-region-filter.test.ts b/cloud/apps/relay/src/regional-rehome-source-region-filter.test.ts index 0bc5c00e149..f57140aa68d 100644 --- a/cloud/apps/relay/src/regional-rehome-source-region-filter.test.ts +++ b/cloud/apps/relay/src/regional-rehome-source-region-filter.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { rehomeSourceRegionAllowed } from './idle-regional-rehome-selection.js' import { openIdleRehomeTestDatabase } from './idle-regional-rehome-test-database.js' import { REGIONAL_REHOME_POLL_SUMMARY_INTERVAL_MS } from './regional-rehome-poll-telemetry.js' diff --git a/cloud/apps/relay/src/regional-rehome-store.test.ts b/cloud/apps/relay/src/regional-rehome-store.test.ts index 2abcd721ff4..d8af1e6d09d 100644 --- a/cloud/apps/relay/src/regional-rehome-store.test.ts +++ b/cloud/apps/relay/src/regional-rehome-store.test.ts @@ -7,7 +7,7 @@ import { REGIONAL_REHOME_QUARANTINE_FAILURES, REGIONAL_REHOME_QUARANTINE_MS, REGIONAL_REHOME_REDRAIN_SEND_LIMIT -} from './assignment-store.js' +} from './assignment/assignment-store.js' import { openInMemoryRelayDatabase, type RelayDatabase, diff --git a/cloud/apps/relay/src/regional-rehome-target-row-lock-postgres.test.ts b/cloud/apps/relay/src/regional-rehome-target-row-lock-postgres.test.ts index d9a1829cd07..3edf0d2a919 100644 --- a/cloud/apps/relay/src/regional-rehome-target-row-lock-postgres.test.ts +++ b/cloud/apps/relay/src/regional-rehome-target-row-lock-postgres.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { consumeRelayCellInventoryHold, openRelayDatabase, diff --git a/cloud/apps/relay/src/regional-rehome-target-selection.test.ts b/cloud/apps/relay/src/regional-rehome-target-selection.test.ts index 89ae6f88544..0b3141aa635 100644 --- a/cloud/apps/relay/src/regional-rehome-target-selection.test.ts +++ b/cloud/apps/relay/src/regional-rehome-target-selection.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase } from './database.js' import { REGIONAL_REHOME_SQL_FAILURES_PER_CELL_LIMIT } from './regional-rehome-safety.js' diff --git a/cloud/apps/relay/src/regional-rehome-worker.test.ts b/cloud/apps/relay/src/regional-rehome-worker.test.ts index 38f0824b3fe..352e15b8427 100644 --- a/cloud/apps/relay/src/regional-rehome-worker.test.ts +++ b/cloud/apps/relay/src/regional-rehome-worker.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it, vi } from 'vitest' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { combineRegionalRehomeSafety, diff --git a/cloud/apps/relay/src/regional-rehome-worker.ts b/cloud/apps/relay/src/regional-rehome-worker.ts index 4e911ca046e..d6590f0f544 100644 --- a/cloud/apps/relay/src/regional-rehome-worker.ts +++ b/cloud/apps/relay/src/regional-rehome-worker.ts @@ -2,7 +2,7 @@ import { IdleRegionalRehomeResponseSchema, isGlobalIdleRegionalRehomeDeferral } from '@orca-cloud/relay-contract' -import type { RelayAssignmentStore } from './assignment-store.js' +import type { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { googleMetadataIdentityToken } from './google-metadata-identity-token.js' import type { RegionalRehomeSafetySnapshot } from './relay-observability.js' diff --git a/cloud/apps/relay/src/relay-observability.ts b/cloud/apps/relay/src/relay-observability.ts index 6888a5edcd2..d93298e7542 100644 --- a/cloud/apps/relay/src/relay-observability.ts +++ b/cloud/apps/relay/src/relay-observability.ts @@ -1,6 +1,6 @@ import { monitorEventLoopDelay, performance } from 'node:perf_hooks' import { RELAY_REGION_METRIC_SEGMENTS, type RelayRegion } from '@orca-cloud/relay-contract' -import type { ControlRenewalOutcome } from './assignment-store.js' +import type { ControlRenewalOutcome } from './control-renewal-statement.js' import type { ControlRenewalFlush } from './control-renewal-batch.js' import type { CellInventoryHoldCounts } from './cell-inventory-hold-samples.js' import type { PostgresPoolPressureCounts } from './postgres-pool-pressure.js' diff --git a/cloud/apps/relay/src/relay-region-placement.test.ts b/cloud/apps/relay/src/relay-region-placement.test.ts index de576b66a43..4055d11b835 100644 --- a/cloud/apps/relay/src/relay-region-placement.test.ts +++ b/cloud/apps/relay/src/relay-region-placement.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore, type RelayAssignment } from './assignment-store.js' +import { RelayAssignmentStore, type RelayAssignment } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' import { ReservePaceError } from './reserve-assignment.js' diff --git a/cloud/apps/relay/src/relay-server.ts b/cloud/apps/relay/src/relay-server.ts index bec223e1770..1bfef28a483 100644 --- a/cloud/apps/relay/src/relay-server.ts +++ b/cloud/apps/relay/src/relay-server.ts @@ -26,7 +26,7 @@ import { defaultIntakePerSec, type CellFlags } from './cell-flags.js' import { CellReserveBook } from './cell-reserve-book.js' import type { DemoteRequest, ReserveRequest } from './cell-reserve-contract.js' import { AssignmentLeaseShadow } from './assignment/assignment-lease-shadow.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { RelayCredentialStore } from './credential-store.js' import { diff --git a/cloud/apps/relay/src/relay.blackbox.test.ts b/cloud/apps/relay/src/relay.blackbox.test.ts index 234737ea3ca..d3f8d5bfa31 100644 --- a/cloud/apps/relay/src/relay.blackbox.test.ts +++ b/cloud/apps/relay/src/relay.blackbox.test.ts @@ -14,7 +14,7 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest' import WebSocket from 'ws' import type { RawData } from 'ws' import { assignmentLeaseKeyId } from './assignment/assignment-lease.js' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { encodeMembership, type CellAdmissionMembership diff --git a/cloud/apps/relay/src/released-reservation-prune.test.ts b/cloud/apps/relay/src/released-reservation-prune.test.ts index 2b10402ef00..456f262a510 100644 --- a/cloud/apps/relay/src/released-reservation-prune.test.ts +++ b/cloud/apps/relay/src/released-reservation-prune.test.ts @@ -3,7 +3,7 @@ import { afterAll, afterEach, describe, expect, it } from 'vitest' import { RelayAssignmentStore, RELEASED_CONTROL_RESERVATION_RETENTION_MS -} from './assignment-store.js' +} from './assignment/assignment-store.js' import { openInMemoryRelayDatabase, openRelayDatabase, diff --git a/cloud/apps/relay/src/reserve-assignment.ts b/cloud/apps/relay/src/reserve-assignment.ts index 51b156afcaf..ed729803975 100644 --- a/cloud/apps/relay/src/reserve-assignment.ts +++ b/cloud/apps/relay/src/reserve-assignment.ts @@ -5,7 +5,7 @@ import { RELAY_REGIONS, type RelayRegion } from '@orca-cloud/relay-contract' -import type { AssignOptions, RelayAssignment } from './assignment-store.js' +import type { AssignOptions, RelayAssignment } from './assignment/assignment-store.js' import { CELL_RESERVE_TTL_MS } from './cell-reserve-contract.js' import type { CellReserveClient } from './cell-reserve-client.js' import { relayHostLogDigest } from './relay-host-log-digest.js' diff --git a/cloud/apps/relay/src/reserve-rehome.test.ts b/cloud/apps/relay/src/reserve-rehome.test.ts index 7165d33e215..9caa9690075 100644 --- a/cloud/apps/relay/src/reserve-rehome.test.ts +++ b/cloud/apps/relay/src/reserve-rehome.test.ts @@ -1,6 +1,6 @@ import { RELAY_CLOSE_CODE } from '@orca-cloud/relay-contract' import { describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase } from './database.js' import { hostCohortBucket } from './host-cohort-bucket.js' import { diff --git a/cloud/apps/relay/src/reserve-spill-fleet.test.ts b/cloud/apps/relay/src/reserve-spill-fleet.test.ts index aece2551fea..a714303f4e1 100644 --- a/cloud/apps/relay/src/reserve-spill-fleet.test.ts +++ b/cloud/apps/relay/src/reserve-spill-fleet.test.ts @@ -1,6 +1,6 @@ import type { RelayRegion } from '@orca-cloud/relay-contract' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { CellReserveClient } from './cell-reserve-client.js' import type { RelayCellConfig, RelayConfig } from './config.js' import { openInMemoryRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/seat-feed-cells-postgres.test.ts b/cloud/apps/relay/src/seat-feed-cells-postgres.test.ts index 6e5e3e97369..a2f3d80f7b8 100644 --- a/cloud/apps/relay/src/seat-feed-cells-postgres.test.ts +++ b/cloud/apps/relay/src/seat-feed-cells-postgres.test.ts @@ -1,6 +1,6 @@ import { randomUUID } from 'node:crypto' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import type { RelayCellConfig } from './config.js' import { openRelayDatabase, type RelayDatabase } from './database.js' diff --git a/cloud/apps/relay/src/shadow-directory-compare.test.ts b/cloud/apps/relay/src/shadow-directory-compare.test.ts index aefda8206c6..42660b125a8 100644 --- a/cloud/apps/relay/src/shadow-directory-compare.test.ts +++ b/cloud/apps/relay/src/shadow-directory-compare.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import type { RelayAssignment } from './assignment-store.js' +import type { RelayAssignment } from './assignment/assignment-store.js' import type { RelayConfig } from './config.js' import { classifyShadowSeat, diff --git a/cloud/apps/relay/src/shadow-seat-directory.test.ts b/cloud/apps/relay/src/shadow-seat-directory.test.ts index aa85716b9b9..9b4ff1b6c95 100644 --- a/cloud/apps/relay/src/shadow-seat-directory.test.ts +++ b/cloud/apps/relay/src/shadow-seat-directory.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it, vi } from 'vitest' -import { RelayAssignmentStore } from './assignment-store.js' +import { RelayAssignmentStore } from './assignment/assignment-store.js' import { openInMemoryRelayDatabase } from './database.js' import { SHADOW_SEAT_OUTRANK_SKEW_MS, diff --git a/cloud/apps/relay/src/test-fixtures/host-control-proof.ts b/cloud/apps/relay/src/test-fixtures/host-control-proof.ts index fc21204d7f0..17fea12c498 100644 --- a/cloud/apps/relay/src/test-fixtures/host-control-proof.ts +++ b/cloud/apps/relay/src/test-fixtures/host-control-proof.ts @@ -8,7 +8,7 @@ import { import nacl from 'tweetnacl' import { expect, vi, type Mock, type MockInstance } from 'vitest' import type WebSocket from 'ws' -import { RelayAssignmentStore } from '../assignment-store.js' +import { RelayAssignmentStore } from '../assignment/assignment-store.js' import { loadRelayConfig } from '../config.js' import { RelayCredentialStore } from '../credential-store.js' import type { RelayDatabase } from '../database.js' diff --git a/cloud/packages/relay-contract/package.json b/cloud/packages/relay-contract/package.json index 183b68c7a56..376fd48a10c 100644 --- a/cloud/packages/relay-contract/package.json +++ b/cloud/packages/relay-contract/package.json @@ -29,6 +29,26 @@ "types": "./dist/assignment-invariants.d.ts", "default": "./dist/assignment-invariants.js" }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./admission-budgets": { + "types": "./dist/admission-budgets.d.ts", + "default": "./dist/admission-budgets.js" + }, + "./idle-regional-rehome": { + "types": "./dist/idle-regional-rehome.d.ts", + "default": "./dist/idle-regional-rehome.js" + }, + "./protocol-limits": { + "types": "./dist/protocol-limits.d.ts", + "default": "./dist/protocol-limits.js" + }, + "./region-correction": { + "types": "./dist/region-correction.d.ts", + "default": "./dist/region-correction.js" + }, + "./relay-regions": { + "types": "./dist/relay-regions.d.ts", + "default": "./dist/relay-regions.js" + } } } diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 336c05803fd..f789f9946ea 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -20593,15 +20593,15 @@ "invariant": "A single-cell capacity check reads only that cell while retaining snapshot freshness, incarnation, outstanding reservation and missing-limit policy; new placement retains the full fleet inventory.", "oracle": "With 32 capped cells, an existing active host stays on its pinned cell and reads one headroom row; new placement reads all 32. Missing, expired or prior-incarnation snapshots, capacity exhaustion and outstanding debt still refuse the active pinned host; an uncapped cell remains admissible.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false" + "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false" ], "testFiles": [ "cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts", "cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts", - "cloud/apps/relay/src/assignment-store.test.ts", + "cloud/apps/relay/src/assignment/assignment-store.test.ts", "cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts", "cloud/apps/relay/src/cell-inventory-lock-contention.test.ts", - "cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts", + "cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts", "cloud/apps/relay/src/regional-rehome-target-selection.test.ts" ], "assertionRefs": [ @@ -20622,6 +20622,7 @@ "runner": "local", "platform": "macos", "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false", + "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir cloud/apps/relay exec vitest run ../../../cloud/apps/relay/src/assignment/assignment-headroom-scope.test.ts ../../../cloud/apps/relay/src/assignment/assignment-connection-headroom.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store.test.ts ../../../cloud/apps/relay/src/assignment/assignment-store-lock-order.test.ts ../../../cloud/apps/relay/src/cell-inventory-lock-contention.test.ts ../../../cloud/apps/relay/src/assignment/assignment-isolated-cell-replacement.test.ts ../../../cloud/apps/relay/src/regional-rehome-target-selection.test.ts --silent=false", "result": "passed", "durationSeconds": 0.513, "summary": "189 tests across seven files passed; independent root rerun also passed189 tests. Relay typecheck passed separately."