package governance import ( "encoding/json" "time" ) // TestPublication is the safe projection of a test publication for the API and web console. // It deliberately omits knowledge_id, test_kb_id, source URL, SHA-256, spool path, // raw summaries and any credential material. type TestPublication struct { ID string `json:"id"` Title string `json:"title"` IngestState string `json:"ingest_state"` ProcessingState string `json:"processing_state"` RetrievalState string `json:"retrieval_state"` TargetScope string `json:"target_scope"` ChangeSetID string `json:"change_set_id"` ChangeType string `json:"change_type"` CanStart bool `json:"can_start"` RetryCount int `json:"retry_count"` LastError string `json:"last_error"` CanRetry bool `json:"can_retry"` UpdatedAt time.Time `json:"updated_at"` } type TestPublicationFilter struct { ProcessingState string // TargetScope filters the test queue by KB routing target (P4). TargetScope string // RemovalRequired 只取「被禁止导入、但仍在测试库里存活」的条目: // 解析监控「需下架」车道用它列出待移除的具体条目(此前只有按库计数)。 RemovalRequired bool Limit int Offset int } type TestPublicationPage struct { Items []TestPublication `json:"items"` Total int `json:"total"` } type StartTestPublicationsRequest struct { PublicationIDs []string OperatorRef string Reason string Now time.Time } type StartTestPublicationsResult struct { Selected int `json:"selected"` Started int `json:"started"` AlreadyStarted int `json:"already_started"` Unavailable int `json:"unavailable"` } // AcceptanceRecord is the safe projection of an acceptance result for the API. // EvidenceSummary is returned as an object but only carries counts and booleans, // never remote bodies, paths or credentials. type AcceptanceRecord struct { CheckType string `json:"check_type"` State string `json:"state"` PolicyVersion string `json:"policy_version"` EvidenceSummary json.RawMessage `json:"evidence_summary"` ObservedAt time.Time `json:"observed_at"` }