feat(playbook): version generated playbooks
All checks were successful
CD Pipeline / tests (push) Successful in 1m34s
Code Review / ai-code-review (push) Successful in 28s
Type Sync Check / check-type-sync (push) Successful in 1m10s
CD Pipeline / build-and-deploy (push) Successful in 10m19s
CD Pipeline / post-deploy-checks (push) Successful in 3m1s
All checks were successful
CD Pipeline / tests (push) Successful in 1m34s
Code Review / ai-code-review (push) Successful in 28s
Type Sync Check / check-type-sync (push) Successful in 1m10s
CD Pipeline / build-and-deploy (push) Successful in 10m19s
CD Pipeline / post-deploy-checks (push) Successful in 3m1s
This commit is contained in:
@@ -1005,6 +1005,10 @@ class PlaybookRecord(Base):
|
||||
|
||||
# Source tracing
|
||||
source_incident_ids: Mapped[list[str]] = mapped_column(JSON, default=list, nullable=False)
|
||||
version: Mapped[int] = mapped_column(Integer, default=1, nullable=False)
|
||||
parent_playbook_id: Mapped[str | None] = mapped_column(String(36), nullable=True, index=True)
|
||||
supersedes_playbook_id: Mapped[str | None] = mapped_column(String(36), nullable=True, index=True)
|
||||
version_reason: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
ai_confidence: Mapped[float] = mapped_column(default=0.0, nullable=False)
|
||||
|
||||
# Stats — MUST be in PG (AI learning artifacts, cannot expire)
|
||||
@@ -1048,6 +1052,7 @@ class PlaybookRecord(Base):
|
||||
Index("ix_playbook_status", "status"),
|
||||
Index("ix_playbook_trust_score", "trust_score"),
|
||||
Index("ix_playbook_created_at", "created_at"),
|
||||
Index("ix_playbook_lineage", "parent_playbook_id", "version"),
|
||||
# W2 PR-L1: 快速查詢需要人工 review 的 Playbook(預期數量少,partial index 最省空間)
|
||||
Index(
|
||||
"ix_playbook_review_required",
|
||||
|
||||
Reference in New Issue
Block a user