6846ca6b28
The May-built OSHA distance library (minimum_distances.go, 29 CFR 1910, US public domain) was dead code — zero callers, no route, no test, while the mm values that actually appear in measures are independent hand-prose (some carrying ISO 13854/13857 values, not OSHA). This surfaces it without touching the measures response contract: - GET /iace/minimum-distances (+ ?measure_id=) returns the distances, the curated measure→distance link table and the licensing note. - AllMeasureDistanceLinks/MinimumDistancesForMeasure resolve only the defensible links (M600 value_source; M254/M065 public-domain crossref to ISO), with the relation made explicit so the join stays honest. - architecture.go lists the OSHA library so it shows in the audit explainer. - Tests: inch→mm conversion + license completeness, link integrity, and a consistency test pinning that a value_source measure's prose still matches the OSHA source (codifies the audit finding as a regression gate). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
31 lines
963 B
Go
31 lines
963 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/breakpilot/ai-compliance-sdk/internal/iace"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// ListMinimumDistances handles GET /minimum-distances.
|
|
// Read-only OSHA safety-distance reference (29 CFR 1910, US public domain)
|
|
// plus the curated measure→distance link table, so an auditor can see WHERE a
|
|
// measure's mm figure comes from. Optional ?measure_id= returns only the
|
|
// distances (and links) tied to that protective measure.
|
|
func (h *IACEHandler) ListMinimumDistances(c *gin.Context) {
|
|
if mid := c.Query("measure_id"); mid != "" {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"measure_id": mid,
|
|
"distances": iace.MinimumDistancesForMeasure(mid),
|
|
"links": iace.LinksForMeasure(mid),
|
|
"note": iace.MinimumDistanceNote,
|
|
})
|
|
return
|
|
}
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"distances": iace.GetOSHAMinimumDistances(),
|
|
"links": iace.AllMeasureDistanceLinks(),
|
|
"note": iace.MinimumDistanceNote,
|
|
})
|
|
}
|