fa8ad030cb
The source-agnostic failure ontology shared by the FMEA library and the CE hazard side: Component → FailureMode → Mechanism → Effect → Hazard → Harm → Control, each row source+licence tagged. A licence ALLOWLIST (FailureKnowledgeLicenseAllowed) rejects copyrighted/proprietary/NC sources up front (© IITRI, DIN/ISO, AIAG, OREDA, CC-BY-NC) — the discipline learned from the FMD-91/NPRD-91 licence finding. Seeded with a curated NASA NTRS lessons-learned starter (5 real entries, public domain). GET /iace/failure-knowledge (+ ?domain=). Tests pin the governance invariant: every entry must carry a commercially-usable licence. Next: Playwright+OCR bulk loader (NTRS API → PDF/OCR → tuple extraction) to grow the corpus from NASA/OSHA/CPSC/MAUDE/NTSB. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
30 lines
900 B
Go
30 lines
900 B
Go
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),
|
|
})
|
|
}
|