Skip to content

[P1.6] Stop running the full schema-migration routine on every authenticated request #733

Description

@frankbria

Severity: high | Category: infra | Phase: P1.6

Problem

get_v2_workspaceget_workspace() unconditionally calls _ensure_schema_upgrades, running ~30 DDL/PRAGMA statements plus unconditional CREATE TABLE IF NOT EXISTS/CREATE INDEX + multiple commit() (each an fsync in WAL) on every v2 request, even when the schema is current.

Evidence

codeframe/core/workspace.py:833

Acceptance criteria

  • Migrations are gated behind a PRAGMA user_version check (or run once at startup / cached workspace load).
  • Steady-state requests issue zero DDL and zero write commits.

Dependencies

None


Filed from the SaaS launch-readiness audit. Atomic: one developer, one session. Work order: strictly P0.1 → P3.12 (no forward dependencies).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions