feat(voice): add authenticated Phase 2 live lifecycle
Add cookie authentication, owned conversations, durable Live reservations, tool completion/replay fencing, revocation, and startup reconciliation. Introduce forward lifecycle/owner-chain migrations and the temporary Gemini adapter while preserving the existing OpenAI Realtime adapter. Include the executable audio client, regression coverage, configuration, API/database documentation, and recorded acceptance evidence. Validation: focused review suite 82 passed; Python/TOML parsing, JavaScript syntax, and whitespace checks passed. Full PostgreSQL/provider-free results are recorded in the repair report; real-provider/browser acceptance is unrun. Follow-up work remains for configurable OpenAI/Gemini selection, transport admission, authority diagnostics, playback message bounds, and client replay identity after ambiguous creation responses.
This commit is contained in:
@@ -9,6 +9,8 @@ from sqlalchemy.orm import sessionmaker
|
||||
|
||||
from app.modules.documents.types import EmbeddingProfile
|
||||
|
||||
LIVE_REVISION = "0005_live_owner_chain"
|
||||
PREVIOUS_LIVE_REVISION = "0004_live_lifecycle"
|
||||
SCHEMA_REVISION = "0003_extraction_review"
|
||||
WORKER_REVISION = "0002_worker_artifact"
|
||||
FOUNDATION_REVISION = "0001_ingestion_foundation"
|
||||
@@ -63,17 +65,19 @@ def check_compatibility(connection: Connection, profile: EmbeddingProfile, *, re
|
||||
schema = connection.execute(text("SELECT current_schema()")).scalar_one()
|
||||
assert_foundation_scope(connection, schema)
|
||||
revision = connection.execute(text("SELECT version_num FROM alembic_version")).scalar_one()
|
||||
allowed = (SCHEMA_REVISION,) if require_worker else (FOUNDATION_REVISION, WORKER_REVISION, SCHEMA_REVISION)
|
||||
allowed = (SCHEMA_REVISION, PREVIOUS_LIVE_REVISION, LIVE_REVISION) if require_worker else (
|
||||
FOUNDATION_REVISION, WORKER_REVISION, SCHEMA_REVISION, PREVIOUS_LIVE_REVISION, LIVE_REVISION
|
||||
)
|
||||
if revision not in allowed:
|
||||
raise CompatibilityError("Unexpected ingestion schema revision")
|
||||
if revision in (WORKER_REVISION, SCHEMA_REVISION):
|
||||
if revision in (WORKER_REVISION, SCHEMA_REVISION, PREVIOUS_LIVE_REVISION, LIVE_REVISION):
|
||||
artifact_type = connection.execute(text("""
|
||||
SELECT format_type(atttypid,atttypmod) FROM pg_attribute
|
||||
WHERE attrelid=to_regclass('documents') AND attname='extraction_state' AND NOT attisdropped
|
||||
""")).scalar_one_or_none()
|
||||
if artifact_type != "jsonb":
|
||||
raise CompatibilityError("Missing worker artifact attachment column")
|
||||
if revision == SCHEMA_REVISION:
|
||||
if revision in (SCHEMA_REVISION, PREVIOUS_LIVE_REVISION, LIVE_REVISION):
|
||||
definitions = connection.execute(text("""
|
||||
SELECT pg_get_constraintdef(oid) FROM pg_constraint
|
||||
WHERE conrelid=to_regclass(\'audit_events\')
|
||||
|
||||
Reference in New Issue
Block a user