semantics

This commit is contained in:
2026-05-26 09:30:41 +03:00
parent 1e7bcecaea
commit 9ffa8af1dc
623 changed files with 28045 additions and 26557 deletions

View File

@@ -1,10 +1,10 @@
# #region AssistantModels [C:3] [TYPE Module] [SEMANTICS sqlalchemy, assistant, model, schema, audit, assistant-audit-record]
# @BRIEF SQLAlchemy models for assistant audit trail and confirmation tokens.
# @LAYER: Domain
# @LAYER Domain
# @RELATION DEPENDS_ON -> MappingModels
# @INVARIANT: Assistant records preserve immutable ids and creation timestamps.
# @SIDE_EFFECT: Defines assistant audit/message/confirmation tables
# @DATA_CONTRACT: AssistantData -> AssistantRecord
# @INVARIANT Assistant records preserve immutable ids and creation timestamps.
# @SIDE_EFFECT Defines assistant audit/message/confirmation tables
# @DATA_CONTRACT AssistantData -> AssistantRecord
from datetime import datetime
@@ -16,8 +16,8 @@ from .mapping import Base
# #region AssistantAuditRecord [C:3] [TYPE Class]
# @BRIEF Store audit decisions and outcomes produced by assistant command handling.
# @RELATION INHERITS -> MappingModels
# @PRE: user_id must identify the actor for every record.
# @POST: Audit payload remains available for compliance and debugging.
# @PRE user_id must identify the actor for every record.
# @POST Audit payload remains available for compliance and debugging.
class AssistantAuditRecord(Base):
__tablename__ = "assistant_audit"
@@ -37,8 +37,8 @@ class AssistantAuditRecord(Base):
# #region AssistantMessageRecord [C:3] [TYPE Class]
# @BRIEF Persist chat history entries for assistant conversations.
# @RELATION INHERITS -> MappingModels
# @PRE: user_id, conversation_id, role and text must be present.
# @POST: Message row can be queried in chronological order.
# @PRE user_id, conversation_id, role and text must be present.
# @POST Message row can be queried in chronological order.
class AssistantMessageRecord(Base):
__tablename__ = "assistant_messages"
@@ -60,8 +60,8 @@ class AssistantMessageRecord(Base):
# #region AssistantConfirmationRecord [C:3] [TYPE Class]
# @BRIEF Persist risky operation confirmation tokens with lifecycle state.
# @RELATION INHERITS -> MappingModels
# @PRE: intent/dispatch and expiry timestamp must be provided.
# @POST: State transitions can be tracked and audited.
# @PRE intent/dispatch and expiry timestamp must be provided.
# @POST State transitions can be tracked and audited.
class AssistantConfirmationRecord(Base):
__tablename__ = "assistant_confirmations"