Each probe enforces a 5-second hard cap and emits a structured TierDetectionError carrying service, host, port, and an actionable remediation. The pgvector probe discriminates between two failure modes:
Library not installed (extension "vector" is not available) → remediation points to pgvector/pgvector:pg17 image
Adds postgres and ioredis as direct gateway dependencies (previously transitive only).
Process notes
Independent code review (sonnet) flagged 3 issues on the first delivery: missing Valkey connectTimeout, no error discrimination in pgvector catch, and federated tier silently skipping Valkey if queue.type !== 'bullmq'. All three fixed in this PR.
Independent verification (haiku) confirmed all fixes in place by line number, plus full test suite green.
## Summary
FED-M1-04 — Implements `apps/gateway/src/bootstrap/tier-detector.ts`, invoked from `main.ts` before NestJS bootstraps. For each storage tier:
- **`local`**: no-op (PGlite is in-process)
- **`standalone`**: probes Postgres + Valkey
- **`federated`**: probes Postgres + Valkey + pgvector extension; rejects config upfront if `queue.type !== 'bullmq'`
Each probe enforces a 5-second hard cap and emits a structured `TierDetectionError` carrying `service`, `host`, `port`, and an actionable `remediation`. The pgvector probe discriminates between two failure modes:
- **Library not installed** (`extension "vector" is not available`) → remediation points to `pgvector/pgvector:pg17` image
- **Permission/other** → remediation mentions `CREATE` permission / superuser
Adds `postgres` and `ioredis` as direct gateway dependencies (previously transitive only).
## Process notes
- Independent code review (sonnet) flagged 3 issues on the first delivery: missing Valkey `connectTimeout`, no error discrimination in pgvector catch, and federated tier silently skipping Valkey if `queue.type !== 'bullmq'`. All three fixed in this PR.
- Independent verification (haiku) confirmed all fixes in place by line number, plus full test suite green.
## Tests
12 unit tests in `tier-detector.spec.ts`:
- 8 baseline tests (local no-op, standalone happy/PG-fail/Valkey-fail, federated happy/pgvector-fail, error fields)
- 4 new tests covering the review-fix issues (Valkey timeout, pgvector library-missing remediation, pgvector permission remediation, federated rejects non-bullmq queue before any probe)
```
Test Files 1 passed (1)
Tests 12 passed (12)
```
## Test plan
- [ ] Manual smoke test on a federated stack once FED-M1-07 (integration test with real services) lands
- [ ] CI green
- [ ] No regression in existing standalone tier paths (covered by FED-M1-09)
Refs #460
Implements `apps/gateway/src/bootstrap/tier-detector.ts` invoked from
`main.ts` before NestJS bootstraps. For each tier:
- `local`: no-op (PGlite is in-process)
- `standalone`: probe Postgres + Valkey
- `federated`: probe Postgres + Valkey + pgvector extension; reject
config upfront if `queue.type !== 'bullmq'`
Each probe has a 5-second hard cap and emits a structured
`TierDetectionError` with service / host / port / remediation. The
remediation field discriminates pgvector failure modes ("library not
available" vs "permission denied") so operators get actionable hints
without leaking credentials.
Adds `postgres` and `ioredis` as direct gateway deps; previously only
transitive. 12 unit tests cover happy paths and each fail-fast branch.
Refs #460
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
FED-M1-04 — Implements
apps/gateway/src/bootstrap/tier-detector.ts, invoked frommain.tsbefore NestJS bootstraps. For each storage tier:local: no-op (PGlite is in-process)standalone: probes Postgres + Valkeyfederated: probes Postgres + Valkey + pgvector extension; rejects config upfront ifqueue.type !== 'bullmq'Each probe enforces a 5-second hard cap and emits a structured
TierDetectionErrorcarryingservice,host,port, and an actionableremediation. The pgvector probe discriminates between two failure modes:extension "vector" is not available) → remediation points topgvector/pgvector:pg17imageCREATEpermission / superuserAdds
postgresandioredisas direct gateway dependencies (previously transitive only).Process notes
connectTimeout, no error discrimination in pgvector catch, and federated tier silently skipping Valkey ifqueue.type !== 'bullmq'. All three fixed in this PR.Tests
12 unit tests in
tier-detector.spec.ts:Test plan
Refs #460
Implements `apps/gateway/src/bootstrap/tier-detector.ts` invoked from `main.ts` before NestJS bootstraps. For each tier: - `local`: no-op (PGlite is in-process) - `standalone`: probe Postgres + Valkey - `federated`: probe Postgres + Valkey + pgvector extension; reject config upfront if `queue.type !== 'bullmq'` Each probe has a 5-second hard cap and emits a structured `TierDetectionError` with service / host / port / remediation. The remediation field discriminates pgvector failure modes ("library not available" vs "permission denied") so operators get actionable hints without leaking credentials. Adds `postgres` and `ioredis` as direct gateway deps; previously only transitive. 12 unit tests cover happy paths and each fail-fast branch. Refs #460