Add a dev memo-forwarding fixture and deduplicated intake notifications.
Pose, replay, and conflict stay on an injected transport with local retry evidence. Notification receipts keep only memo id, question, class, and submitter, and a resolve conflict stays readable. Assistant: grok Assistant-Session: 01a10329-31cb-78d3-b7a3-789e1fb83139
This commit is contained in:
parent
42ab047e87
commit
49eeddbfed
10 changed files with 1612 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ from api.models.contribution import Contribution, ContributionType, Contribution
|
|||
from api.models.sbom_snapshot import SBOMSnapshot
|
||||
from api.models.sbom_entry import SBOMEntry, Ecosystem
|
||||
from api.models.agent_message import AgentMessage, MessageReceipt
|
||||
from api.models.memo_notification import MemoNotificationReceipt
|
||||
from api.models.capability_catalog import CapabilityCatalog
|
||||
from api.models.capability_request import CapabilityRequest
|
||||
from api.models.tpsc import TPSCCatalog, TPSCSnapshot, TPSCEntry
|
||||
|
|
@ -77,6 +78,7 @@ __all__ = [
|
|||
"SBOMEntry", "Ecosystem",
|
||||
"AgentMessage",
|
||||
"MessageReceipt",
|
||||
"MemoNotificationReceipt",
|
||||
"CapabilityCatalog",
|
||||
"CapabilityRequest",
|
||||
"TPSCCatalog", "TPSCSnapshot", "TPSCEntry",
|
||||
|
|
|
|||
37
api/models/memo_notification.py
Normal file
37
api/models/memo_notification.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import DateTime, ForeignKey, String, func
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from api.models.base import Base
|
||||
|
||||
|
||||
class MemoNotificationReceipt(Base):
|
||||
"""Durable receipt for one informed-decision delivery id.
|
||||
|
||||
The delivery id is the sender's stable idempotency key. The body is only
|
||||
memo id, question, class, and submitter. Rows are retained, not expired.
|
||||
"""
|
||||
|
||||
__tablename__ = "memo_notification_receipts"
|
||||
|
||||
delivery_id: Mapped[str] = mapped_column(String(128), primary_key=True)
|
||||
body_digest: Mapped[str] = mapped_column(String(64), nullable=False)
|
||||
memo_id: Mapped[str] = mapped_column(String(63), nullable=False)
|
||||
question: Mapped[str] = mapped_column(String(400), nullable=False)
|
||||
memo_class: Mapped[str] = mapped_column(String(63), nullable=False)
|
||||
submitter: Mapped[str] = mapped_column(String(63), nullable=False)
|
||||
message_id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True),
|
||||
ForeignKey("agent_messages.id", ondelete="RESTRICT"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
authoritative_review: Mapped[str] = mapped_column(
|
||||
String(40), nullable=False, default="signed-in-overview"
|
||||
)
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now(), nullable=False
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue