Add full shell, replaceable Omics adapter and bilingual interaction
Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
This commit is contained in:
@@ -306,6 +306,31 @@ class PostgresSessionRepository:
|
||||
raise SessionError(f"Sessione non trovata: {manifest.id}")
|
||||
return self.get(manifest.id)
|
||||
|
||||
def ensure_interaction_language(
|
||||
self, session_id: str, workspace_language: str
|
||||
) -> SessionSnapshot:
|
||||
from tht.session.store import pin_interaction_language
|
||||
|
||||
self._require_uuid4(session_id)
|
||||
with self._transaction() as connection:
|
||||
self._lock_session(connection, session_id)
|
||||
row = connection.execute(
|
||||
text("SELECT manifest FROM thoth_sessions.sessions WHERE id = :id FOR UPDATE"),
|
||||
{"id": session_id},
|
||||
).mappings().first()
|
||||
if row is None:
|
||||
raise SessionError(f"Sessione non trovata: {session_id}")
|
||||
manifest = SessionManifest.model_validate(row["manifest"])
|
||||
if pin_interaction_language(manifest, workspace_language):
|
||||
connection.execute(
|
||||
text("UPDATE thoth_sessions.sessions "
|
||||
"SET manifest = CAST(:manifest AS jsonb), updated_at = pg_catalog.now() "
|
||||
"WHERE id = :id"),
|
||||
{"id": session_id,
|
||||
"manifest": json.dumps(manifest.model_dump(by_alias=True, mode="json"))},
|
||||
)
|
||||
return self.get(session_id)
|
||||
|
||||
def read_artifact(self, session_id: str, key: str) -> str | None:
|
||||
self._require_uuid4(session_id)
|
||||
self._require_artifact_key(key)
|
||||
|
||||
Reference in New Issue
Block a user