ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/governance/handler.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/governance/handler.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision09015496d565a172bcaa15cfe9a8e4b072b13df0
Branchworkstream-b-screenmatch
Path or archive memberinternal/modules/governance/handler.go
Original SHA-256bcc4bbca0ebc74021a44f7a41e4098d3e6a450edb61146b4896305a2c3a39402
Git blob SHAab313f507d5e3827763ef5cebb49f6ad865f8aca
Reading-copy SHA-256bcc4bbca0ebc74021a44f7a41e4098d3e6a450edb61146b4896305a2c3a39402

Original source ↗

Every recorded occurrence

These 19 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-b-screenmatch09015496d565a172bcaa15cfe9a8e4b072b13df0Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-a-opportunity-intelligence1675031db74316e100782d063e9eda1a597fe3a1Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-d-command-center255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-d-missionmatch3be46ba89edb737182075a2b320509b42dc916f8Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-e-dataflow-deploy433815a042f9741411e60fa553fe72143e9b10dbOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-e-commercial-stubs4437da660539284a400ee380b9b427a300c369eeOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-c-slatematch5cd60c918301b46ecd6ed3e03e20c395da0062e2Open original
Janady13/missionmatch / internal/modules/governance/handler.goruthless-debug-sweepb7d742f8f032984be3817efffa3eb8b13b651c1fOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-b-sam-contract-awardsd5101cceb98e70000cebb31d3e7ac73d747d3a6dOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-a-shared-coree0de03ac3a1ec826bd15d0e048e3b02baa23eeffOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-c-slatematch5cd60c918301b46ecd6ed3e03e20c395da0062e2Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-d-command-center255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-e-dataflow-deploy433815a042f9741411e60fa553fe72143e9b10dbOpen original
Janady13/missionmatch / internal/modules/governance/handler.goruthless-debug-sweepb7d742f8f032984be3817efffa3eb8b13b651c1fOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-a-opportunity-intelligence1675031db74316e100782d063e9eda1a597fe3a1Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-b-screenmatch09015496d565a172bcaa15cfe9a8e4b072b13df0Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-e-commercial-stubs4437da660539284a400ee380b9b427a300c369eeOpen original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-d-missionmatch3be46ba89edb737182075a2b320509b42dc916f8Open original
Janady13/missionmatch / internal/modules/governance/handler.goworkstream-b-sam-contract-awardsd5101cceb98e70000cebb31d3e7ac73d747d3a6dOpen original

Recovered source transcript

package governance import ( "encoding/json" "errors" "net/http" "strconv" "github.com/go-chi/chi/v5" "github.com/google/uuid" "github.com/missionworkforce/missionmatch/internal/platform/security" "github.com/missionworkforce/missionmatch/internal/platform/tenant" ) // Handler serves the AEDT governance API under the tenant group. type Handler struct{ svc *Service } // NewHandler builds the handler. func NewHandler(svc *Service) *Handler { return &Handler{svc: svc} } // Routes mounts the governance endpoints with their capabilities. func (h *Handler) Routes(r chi.Router) { r.With(security.RequireCapability(security.CapComplianceRead)).Get("/aedt/model-versions", h.modelVersions) r.With(security.RequireCapability(security.CapComplianceRead)).Get("/aedt/inventory", h.listInventory) r.With(security.RequireCapability(security.CapComplianceRead)).Post("/aedt/inventory", h.upsertInventory) r.With(security.RequireCapability(security.CapComplianceRead)).Post("/compliance/retention/run", h.runRetention) r.With(security.RequireCapability(security.CapAuditRead)).Get("/audit", h.audit) r.With(security.RequireCapability(security.CapCandidateWrite)).Post("/candidates/{candidateID}/notice", h.recordNotice) } func (h *Handler) modelVersions(w http.ResponseWriter, r *http.Request) { out, err := h.svc.ListModelVersions(r.Context()) writeOrErr(w, out, err) } func (h *Handler) listInventory(w http.ResponseWriter, r *http.Request) { out, err := h.svc.ListInventory(r.Context()) writeOrErr(w, out, err) } func (h *Handler) upsertInventory(w http.ResponseWriter, r *http.Request) { var in InventoryInput if !decode(w, r, &in) { return } out, err := h.svc.UpsertInventory(r.Context(), in) writeOrErr(w, out, err) } func (h *Handler) runRetention(w http.ResponseWriter, r *http.Request) { n, err := h.svc.RunRetention(r.Context()) if err != nil { writeErr(w, err) return } writeJSON(w, http.StatusOK, map[string]int{"anonymized": n}) } func (h *Handler) audit(w http.ResponseWriter, r *http.Request) { limit, offset := int32(100), int32(0) if s := r.URL.Query().Get("limit"); s != "" { v, err := strconv.Atoi(s) if err != nil || v <= 0 || v > 500 { writeErr(w, ErrBadRequest) return } limit = int32(v) } if s := r.URL.Query().Get("offset"); s != "" { v, err := strconv.Atoi(s) if err != nil || v < 0 || v > 1_000_000_000 { writeErr(w, ErrBadRequest) return } offset = int32(v) } out, err := h.svc.ListAudit(r.Context(), limit, offset) writeOrErr(w, out, err) } func (h *Handler) recordNotice(w http.ResponseWriter, r *http.Request) { candidateID, err := uuid.Parse(chi.URLParam(r, "candidateID")) if err != nil { writeErr(w, ErrBadRequest) return } var in NoticeInput if !decode(w, r, &in) { return } out, err := h.svc.RecordNotice(r.Context(), candidateID, in) writeOrErr(w, out, err) } // ErrBadRequest maps to 400. var ErrBadRequest = errors.New("governance: bad request") func writeOrErr(w http.ResponseWriter, v any, err error) { if err != nil { writeErr(w, err) return } writeJSON(w, http.StatusOK, v) } func writeErr(w http.ResponseWriter, err error) { status, msg := http.StatusInternalServerError, "internal error" switch { case errors.Is(err, tenant.ErrNoTenant): status, msg = http.StatusForbidden, "no validated tenant" case errors.Is(err, ErrNoDatabase): status, msg = http.StatusServiceUnavailable, "database not configured" case errors.Is(err, ErrBadRequest): status, msg = http.StatusBadRequest, "bad request" } writeJSON(w, status, map[string]string{"error": msg}) } func decode(w http.ResponseWriter, r *http.Request, dst any) bool { dec := json.NewDecoder(http.MaxBytesReader(w, r.Body, 1<<20)) dec.DisallowUnknownFields() if err := dec.Decode(dst); err != nil { writeJSON(w, http.StatusBadRequest, map[string]string{"error": "invalid request body"}) return false } return true } func writeJSON(w http.ResponseWriter, status int, v any) { w.Header().Set("Content-Type", "application/json") w.WriteHeader(status) _ = json.NewEncoder(w).Encode(v) }

Search equations, builds, manuscript text, and recovered sources.