[webserver] Table-prefix-aware web server and query engine
## Problem The web server and query compiler must read from the correct table prefix. During migration, the web server reads from old-prefix tables; after migration completes and the web server is restarted with the new image, it reads from new-prefix tables. ## Proposal ### Startup On startup, read active schema version from `gkg_schema_version`. Derive table prefix from active version using `table_prefix()`. ### Query compiler changes Inject the prefix into the query compiler's table name resolution. The ontology already maps entity types to table names — extend this mapping with prefix awareness: - `gl_user` → `v1_gl_user` (when active version is 1) - `gl_edge` → `v1_gl_edge` - etc. This affects all generated SQL: `SELECT`, `FROM`, subqueries, CTEs, and any table reference in the compiler pipeline. ### Version detection The web server reads the active version once on startup. It does not hot-swap — switching to new tables requires a pod restart (triggered by ArgoCD rolling update when the web server image tag is bumped). This is intentional: the ArgoCD-controlled restart gives operators explicit control over when the web server starts serving new data. ## Acceptance criteria - [ ] Web server reads active schema version on startup - [ ] Query compiler generates SQL with correct table prefix - [ ] All graph queries work correctly with prefixed tables - [ ] Web server serves from old tables while migration is in progress (different image version) - [ ] After migration completes + pod restart, web server serves from new tables - [ ] Integration test: queries return correct results from prefixed tables ## Dependencies - Issue 2: Schema version tracking with table prefix support ## Blocks - Issue 5: Migration completion and cleanup - Issue 6: E2E staging validation
issue