Compare commits

..

2 Commits

Author SHA1 Message Date
Benjamin Admin dd420ff85b fix(mc): defensive mapping queries + MinIO env overridable + iace migration 151
CI / detect-changes (pull_request) Failing after 6s
CI / branch-name (pull_request) Successful in 1s
CI / guardrail-integrity (pull_request) Failing after 4s
CI / secret-scan (pull_request) Failing after 6s
CI / dep-audit (pull_request) Failing after 12s
CI / sbom-scan (pull_request) Failing after 2s
CI / build-sha-integrity (pull_request) Failing after 4s
CI / validate-canonical-controls (pull_request) Failing after 9s
CI / loc-budget (pull_request) Has been skipped
CI / go-lint (pull_request) Has been skipped
CI / python-lint (pull_request) Has been skipped
CI / nodejs-lint (pull_request) Has been skipped
CI / nodejs-build (pull_request) Has been skipped
CI / test-go (pull_request) Has been skipped
CI / iace-gt-coverage (pull_request) Has been skipped
CI / test-python-backend (pull_request) Has been skipped
CI / test-python-document-crawler (pull_request) Has been skipped
CI / test-python-dsms-gateway (pull_request) Has been skipped
- master-controls route: guard all mapping queries with hasMappingTables() so
  an unseeded DB degrades to empty filters instead of a 500.
- docker-compose: MinIO endpoint/keys/secure overridable via env (prod defaults
  preserved) — enables per-environment local config.
- migration 151: reproducible iace_projects.parent_project_id (was ad-hoc).

[migration-approved]

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 13:06:22 +02:00
Benjamin Admin 3bd4e0aaaf chore(loc): except agent_doc_check_extras.py to unblock loc-budget CI
Pre-existing tech-debt file (~535 LOC in the CI tree) that grew past the
500-line hard cap and has blocked the repo-wide loc-budget check since #657.
Not related to the IACE work in flight. Documented with a Phase-2 split
rationale; the exceptions list stays the escape hatch the check itself points to.

[guardrail-change]

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-10 12:37:05 +02:00
5 changed files with 12 additions and 25 deletions
-10
View File
@@ -231,13 +231,3 @@ admin-compliance/app/sdk/ai-act/page.tsx
# Endpoint-/Helfer-Gruppen geplant; bis dahin Exception mit Rationale. # Endpoint-/Helfer-Gruppen geplant; bis dahin Exception mit Rationale.
# [guardrail-change] # [guardrail-change]
backend-compliance/compliance/api/agent_doc_check_extras.py backend-compliance/compliance/api/agent_doc_check_extras.py
# --- 2026-06-10 CI-Unblocker: IACE handler init helpers ---
# iace_handler_init_helpers.go (530 im CI-Stand): Init-/Wiring-Helfer der
# IACE-Handler, ueber den 500-Cap gewachsen. Die andere Session hat die Datei
# im Working-Tree bereits auf 455 Zeilen gesplittet (uncommittet) — sobald
# dieser Split committet ist, MUSS diese Exception wieder entfernt werden.
# Bis dahin Exception mit Rationale, damit der Deploy nicht an pre-existing
# IACE-Refactor-Zwischenstand scheitert.
# [guardrail-change]
ai-compliance-sdk/internal/api/handlers/iace_handler_init_helpers.go
+1 -1
View File
@@ -422,7 +422,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
run: | run: |
apk add --no-cache git python3 py3-yaml apk add --no-cache git python3
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git . git clone --depth 1 --branch ${GITHUB_REF_NAME} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git .
- name: Validate every Dockerfile + compose block declares BUILD_SHA - name: Validate every Dockerfile + compose block declares BUILD_SHA
run: | run: |
@@ -15,13 +15,10 @@ const pool = new Pool({ connectionString: dbUrl })
let metaCache: { at: number; data: unknown } | null = null let metaCache: { at: number; data: unknown } | null = null
const META_TTL_MS = 120_000 const META_TTL_MS = 120_000
// The use-case mapping tables (mc_use_case_mappings, mc_verification, // The use-case mapping tables (mc_use_case_mappings/mc_verification/mc_regulations)
// mc_regulations, mc_use_case_sync_state) are seeded together per-environment // are seeded per-environment and may not exist yet on a fresh/unseeded DB. Guard
// and may not exist yet on a fresh/unseeded DB. We probe mc_use_case_mappings as // every mapping query so the route degrades to empty filters instead of a 500.
// the existence sentinel and guard every mapping query so the route degrades to // Cached with a short TTL so it picks up the tables once that DB gets seeded.
// empty filters instead of a 500. Short TTL so it picks up the tables once seeded.
// NB: the sentinel assumes the siblings are seeded together — a half-seeded DB
// (mappings present but e.g. mc_regulations missing) would still 500 on those.
let mappingTablesCache: { at: number; present: boolean } | null = null let mappingTablesCache: { at: number; present: boolean } | null = null
async function hasMappingTables(): Promise<boolean> { async function hasMappingTables(): Promise<boolean> {
if (mappingTablesCache && Date.now() - mappingTablesCache.at < 300_000) { if (mappingTablesCache && Date.now() - mappingTablesCache.at < 300_000) {
+6 -6
View File
@@ -54,11 +54,11 @@ func cmdReachability(_ []string) {
"universe_tags": len(r.UniverseTags), "universe_tags": len(r.UniverseTags),
}) })
if len(r.UnreachablePatterns) > 0 { if len(r.UnreachablePatterns) > 0 {
fmt.Println("\n## Unreachable patterns (top 30 by priority):") fmt.Println("\n## Unreachable patterns (top 30 by priority):\n")
printPatternRows(r.UnreachablePatterns, 30) printPatternRows(r.UnreachablePatterns, 30)
} }
if len(r.WeakPatterns) > 0 { if len(r.WeakPatterns) > 0 {
fmt.Println("\n## Weakly reachable (top 20 by priority):") fmt.Println("\n## Weakly reachable (top 20 by priority):\n")
printPatternRows(r.WeakPatterns, 20) printPatternRows(r.WeakPatterns, 20)
} }
writeJSON("audit-reports/reachability.json", r) writeJSON("audit-reports/reachability.json", r)
@@ -72,7 +72,7 @@ func cmdConsistency(_ []string) {
"incomplete": r.Incomplete, "incomplete": r.Incomplete,
}) })
if len(r.IncompleteComponents) > 0 { if len(r.IncompleteComponents) > 0 {
fmt.Println("\n## Components missing tags for declared hazard categories:") fmt.Println("\n## Components missing tags for declared hazard categories:\n")
for _, c := range r.IncompleteComponents { for _, c := range r.IncompleteComponents {
fmt.Printf("- %s (%s)\n", c.ComponentID, c.NameDE) fmt.Printf("- %s (%s)\n", c.ComponentID, c.NameDE)
for _, miss := range c.MissingForCategories { for _, miss := range c.MissingForCategories {
@@ -99,7 +99,7 @@ func cmdVocabulary(args []string) {
"unknown_with_pattern_hit": len(r.SuggestedDictionaryEntries), "unknown_with_pattern_hit": len(r.SuggestedDictionaryEntries),
}) })
if len(r.SuggestedDictionaryEntries) > 0 { if len(r.SuggestedDictionaryEntries) > 0 {
fmt.Println("\n## Suggested dictionary additions (token appears in pattern scenarios but not in dict):") fmt.Println("\n## Suggested dictionary additions (token appears in pattern scenarios but not in dict):\n")
for _, s := range r.SuggestedDictionaryEntries { for _, s := range r.SuggestedDictionaryEntries {
fmt.Printf("- '%s' → seen in %d patterns. Examples: %s\n", s.Token, len(s.PatternIDs), joinFirst(s.PatternIDs, 5)) fmt.Printf("- '%s' → seen in %d patterns. Examples: %s\n", s.Token, len(s.PatternIDs), joinFirst(s.PatternIDs, 5))
} }
@@ -129,7 +129,7 @@ func cmdEcho(args []string) {
"orphaned": r.Orphaned, "orphaned": r.Orphaned,
}) })
if len(r.OrphanedPhrases) > 0 { if len(r.OrphanedPhrases) > 0 {
fmt.Println("\n## Orphaned phrases (no hazard echoes them):") fmt.Println("\n## Orphaned phrases (no hazard echoes them):\n")
for _, o := range r.OrphanedPhrases { for _, o := range r.OrphanedPhrases {
fmt.Printf("- [%s] %s\n", o.Field, truncate(o.Phrase, 120)) fmt.Printf("- [%s] %s\n", o.Field, truncate(o.Phrase, 120))
} }
@@ -163,7 +163,7 @@ func cmdHierarchy(args []string) {
"missing_info": r.MissingInfo, "missing_info": r.MissingInfo,
}) })
if len(r.IncompleteHazards) > 0 { if len(r.IncompleteHazards) > 0 {
fmt.Println("\n## Hazards with incomplete hierarchy:") fmt.Println("\n## Hazards with incomplete hierarchy:\n")
for _, h := range r.IncompleteHazards { for _, h := range r.IncompleteHazards {
fmt.Printf("- [%s] %s — missing: %s\n", h.Category, truncate(h.Name, 70), joinFirst(h.MissingLevels, 3)) fmt.Printf("- [%s] %s — missing: %s\n", h.Category, truncate(h.Name, 70), joinFirst(h.MissingLevels, 3))
} }
@@ -94,7 +94,7 @@ func extractCitedNorms(hz []Hazard, mt []Mitigation) []string {
seen := make(map[string]bool) seen := make(map[string]bool)
consider := func(s string) { consider := func(s string) {
fields := strings.FieldsFunc(s, func(r rune) bool { fields := strings.FieldsFunc(s, func(r rune) bool {
return r == ' ' || r == ',' || r == ';' || r == '\n' || r == '(' return r == ' ' || r == ',' || r == ';' || r == '\n' || r == ';' || r == '('
}) })
for i := 0; i < len(fields)-1; i++ { for i := 0; i < len(fields)-1; i++ {
head := strings.ToUpper(strings.TrimSpace(fields[i])) head := strings.ToUpper(strings.TrimSpace(fields[i]))