package handlers import ( "net/http" "github.com/breakpilot/ai-compliance-sdk/internal/iace" "github.com/gin-gonic/gin" ) // ListFailureKnowledge handles GET /failure-knowledge. // Read-only unified failure-knowledge ontology (Component → FailureMode → // Mechanism → Effect → Hazard → Harm → Control) curated from commercially-usable // open sources (currently NASA NTRS, public domain). Optional ?domain= filter. // This is the shared corpus that seeds the FMEA library and the CE hazard side. func (h *IACEHandler) ListFailureKnowledge(c *gin.Context) { var items []iace.FailureKnowledge if d := c.Query("domain"); d != "" { items = iace.FailureKnowledgeByDomain(d) } else { items = iace.AllFailureKnowledge() } if items == nil { items = []iace.FailureKnowledge{} } c.JSON(http.StatusOK, gin.H{ "failure_knowledge": items, "total": len(items), }) }