- loc-budget CI job: remove if/else PR-only guard; now runs scripts/check-loc.sh
(no || true) on every push and PR, scanning the full repo
- sbom-scan: remove || true from grype command — high+ CVEs now block PRs
- scripts/check-loc.sh: add test_*.py / */test_*.py and *.html exclusions so
Python test files and Jinja/HTML templates are not counted against the budget
- .claude/rules/loc-exceptions.txt: grandfather 40 remaining oversized files
into the exceptions list (one-off scripts, docs copies, platform SDKs,
and Phase 1 backend-compliance refactor backlog)
- ai-compliance-sdk/.golangci.yml: add strict golangci-lint config (errcheck,
govet, staticcheck, gosec, gocyclo, gocritic, revive, goimports)
- delete stray routes.py.backup (2512 LOC)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split 7 files exceeding the 500 LOC hard cap into 16 files, all under 500 LOC.
No exported symbols renamed; zero behavior changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
roadmap_handlers.go (740 LOC) → roadmap_handlers.go, roadmap_item_handlers.go, roadmap_import_handlers.go
academy/store.go (683 LOC) → store_courses.go, store_enrollments.go
cmd/server/main.go (681 LOC) → internal/app/app.go (Run+buildRouter) + internal/app/routes.go (registerXxx helpers)
main.go reduced to 7 LOC thin entrypoint calling app.Run()
All files under 410 LOC. Zero behavior changes, same package declarations.
go vet passes on all directly-split packages.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All oversized iace files now comply with the 500-line hard cap:
- hazard_library_ai_sw.go split into ai_sw (false_classification..communication)
and ai_fw (unauthorized_access..update_failure)
- hazard_library_software_hmi.go split into software_hmi (software_fault+hmi)
and config_integration (configuration_error+logging+integration)
- hazard_library_machine_safety.go split to keep mechanical/electrical/thermal/emc,
safety_functions extracted into hazard_library_safety_functions.go
- store_hazards.go split: hazard library queries moved to store_hazard_library.go
- store_projects.go split: component and classification ops to store_components.go
- store_mitigations.go split: evidence/verification/ref-data to store_evidence.go
- hazard_library.go GetBuiltinHazardLibrary() updated to call all sub-functions
- All iace tests pass (go test ./internal/iace/...)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each of the four oversized files (training/store.go 1569 LOC, ucca/rules.go 1231 LOC,
ucca_handlers.go 1135 LOC, document_export.go 1101 LOC) is split by logical group
into same-package files, all under the 500-line hard cap. Zero behavior changes,
no renamed exported symbols. Also fixed pre-existing hazard_library split (missing
functions and duplicate UUID keys from a prior session).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract each page into colocated _components/ sections to bring
page.tsx files from 1008/891/769 LOC down to 57/23/21 LOC,
well within the 500-line hard cap.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All four files split into focused sibling modules so every file lands
comfortably under the 300-LOC soft target (hard cap 500):
hooks.ts (474→43) → hooks-core / hooks-dsgvo / hooks-compliance
hooks-rag-security / hooks-ui
dsr-portal.ts (464→129) → dsr-portal-translations / dsr-portal-render
provider.tsx (462→247) → provider-effects / provider-callbacks
sync.ts (435→299) → sync-storage / sync-conflict
Zero behaviour changes. All public APIs remain importable from the
original paths (hooks.ts re-exports every hook, provider.tsx keeps all
named exports, sync.ts preserves StateSyncManager + factory).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracted 630-LOC monolith into 6 domain files (all <200 LOC) plus a
29-line barrel re-exporting everything for zero breaking-change impact.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
obligations-document/html-builder.ts (620→304 LOC): extract sections 6-11
and footer into html-builder-sections-6-11.ts (339 LOC).
loeschfristen-document/html-builder.ts (603→353 LOC): extract sections 6-12
into html-builder-sections-6-12.ts (259 LOC). Both orchestrators re-export
from siblings; zero behavior change.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EditorSections.tsx (524 LOC) split into EditorSections.tsx (267 LOC) and
EditorSectionsB.tsx (279 LOC). DeletionLogicSection and StorageSection
moved to B; SetFn type canonical in B. EditorSections re-exports both
so all existing imports from EditorTab.tsx remain valid unchanged.
SDKPipelineSidebar (193), SourcesTab (311), ScopeDecisionTab (127),
ComplianceAdvisorWidget (265) were already under the 500-LOC hard cap.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All 4 page.tsx files reduced well below 500 LOC (235/181/158/262) by
extracting components and hooks into colocated _components/ and _hooks/
subdirectories. Zero behavior changes — logic relocated verbatim.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirror the pitch-deck pattern: each service builds its Docker image,
pushes to registry.meghsakha.com/breakpilot/compliance-*, then triggers
orca redeploy via HMAC-signed webhook.
Requires secrets: REGISTRY_USERNAME, REGISTRY_PASSWORD, ORCA_WEBHOOK_SECRET
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parse <en>word</en> markers in text, synthesise English segments with
en-US-GuyNeural and German segments with de-DE-ConradNeural, then
ffmpeg-concat into a single MP3. Fallback to plain synthesis if no tags.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract components and hooks into _components/ and _hooks/ subdirectories
to reduce each page.tsx to under 500 LOC (was 1545/1383/1316).
Final line counts: evidence=213, process-tasks=304, hazards=157.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reduce both page.tsx files below the 500-LOC hard cap by extracting
all inline tab components and API helpers into colocated _components/.
- loeschfristen/page.tsx: 2720 → 467 LOC
- vvt/page.tsx: 2297 → 256 LOC
New files: LoeschkonzeptTab, loeschfristen/api, TabDokument, TabProcessor
Updated: TabVerzeichnis (template picker + badge), vvt/api (template helpers)
Fixed: VVTLinkSection wrong field name (linkedVVTActivityIds), VendorLinkSection added
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each page.tsx was >1000 LOC; extract components to _components/ and hooks
to _hooks/ so page files stay under 500 LOC (164 / 255 / 243 respectively).
Zero behavior changes — logic relocated verbatim.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract components and hooks from oversized page files (563/561/520 LOC)
into colocated _components/ and _hooks/ subdirectories. All three
page.tsx files are now thin orchestrators under 300 LOC each
(dsfa: 216, audit-llm: 121, quality: 163). Zero behavior changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracted components and constants into _components/ subdirectories
to bring all three pages under the 300 LOC soft target (was 651/628/612,
now 255/232/278 LOC respectively). Zero behavior changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each page.tsx was >500 LOC (610/602/596). Extracted React components to
_components/ and custom hook to _hooks/ per-route, reducing all three
page.tsx orchestrators to 107/229/120 LOC respectively. Zero behavior changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract components and hooks to _components/ and _hooks/ subdirectories
to bring all three page.tsx files under the 500-LOC hard cap.
modules/page.tsx: 595 → 239 LOC
security-backlog/page.tsx: 586 → 174 LOC
consent/page.tsx: 569 → 305 LOC
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract components and hooks from oversized pages into colocated
_components/ and _hooks/ subdirectories to enforce the 500-LOC hard cap.
page.tsx files reduced to 205, 121, and 136 LOC respectively.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each page.tsx was 750-780 LOC. Extracted React components to _components/
and custom hooks to _hooks/ next to each page.tsx. All three pages are now
under 215 LOC (well within the 500 LOC hard cap). Zero behavior changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
controls/page.tsx 840→211 LOC — extracted StatsCards, FilterBar,
ControlCard, AddControlForm, RAGPanel, LoadingSkeleton to _components/;
useControlsData, useRAGSuggestions to _hooks/; shared types to _types.ts.
dsr/[requestId]/page.tsx 854→172 LOC — extracted detail panels and
timeline components to _components/.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract tabs nav, templates grid, editor split view, settings form,
logs table, and data-loading/actions hook into _components/ and
_hooks/. page.tsx reduced from 816 to 88 LOC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Break 838-line page.tsx into _types.ts, _data.ts (templates),
_components/{AddRequirementForm,RequirementCard,LoadingSkeleton}.tsx,
and _hooks/useRequirementsData.ts. page.tsx is now 246 LOC (wiring
only). No behavior changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract nav tabs, detail modal, table row, stats grid, search/filter,
records table, pagination, and data-loading hook into _components/ and
_hooks/. page.tsx reduced from 833 to 114 LOC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split the 854-line DSR detail page into colocated components under
_components/ and a data-loading hook under _hooks/. No behavior changes.
page.tsx is now 172 LOC, all extracted files under 300 LOC.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Break 839-line page.tsx into _types.ts, _components/SourcesTab.tsx,
JobsTab.tsx, DocumentsTab.tsx, ReportTab.tsx, and ComplianceRing.tsx.
page.tsx is now 56 LOC (wiring only). No behavior changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split 1130-LOC document-generator page into _components and _constants
modules. page.tsx now 243 LOC (wire-up only). Behavior preserved.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>