feat: auto-mapped CIS report embedding, section embed, ADB RAW(16) fix

- Auto-embed report: maps each CSV to its ADB table (summaryreportcsvvector, identityandaccess, networking, etc.)
- Section embed: new endpoint POST /api/embeddings/report/{rid}/section with per-section button in UI
- Table validation: checks registered ADB tables before embedding, reports missing tables
- Auto-detect embedding dimension: reads table dim and selects correct model (3072→large, 1536→small)
- ADB RAW(16) ID fix: all vector inserts use HEXTORAW() for UUID (fixes ORA-01465)
- Float32 vectors: all inserts use array.array('f') for FLOAT32 compatibility
- Embedding status: real-time progress polling (Embedding X/Y — table: Z)
- Loading per section: spinner only on the section being embedded, not all
- Removed individual file embed buttons (only section + full report)
- Summary CSV chunking: groups by CIS section with tenancy + extract_date metadata
- Findings CSV chunking: each row becomes a document with structured content
- README: documented all 11 required ADB vector tables with descriptions
This commit is contained in:
nogueiraguh
2026-03-21 00:10:50 -03:00
parent 2c5f0f2e1c
commit 73c60212f7
4 changed files with 494 additions and 118 deletions

View File

@@ -131,11 +131,20 @@ export const reportsApi = {
client.post(`/embeddings/report/${rid}`, {
adb_config_id: adbConfigId,
...(tableName ? { table_name: tableName } : {}),
}) as unknown as Promise<{ ok: boolean; message: string; sections: number; tenancy: string }>,
}) as unknown as Promise<{ ok: boolean; task_id: string; message: string; sections: number; tenancy: string }>,
embedFile: (rid: string, fid: string, adbConfigId: string, tableName?: string) =>
client.post(`/embeddings/report/${rid}/file/${fid}`, {
adb_config_id: adbConfigId,
...(tableName ? { table_name: tableName } : {}),
}) as unknown as Promise<{ ok: boolean; message: string; chunks: number }>,
}) as unknown as Promise<{ ok: boolean; task_id: string; message: string; chunks: number }>,
embedSection: (rid: string, fileNames: string[], adbConfigId?: string) =>
client.post(`/embeddings/report/${rid}/section`, {
file_names: fileNames,
...(adbConfigId ? { adb_config_id: adbConfigId } : {}),
}) as unknown as Promise<{ ok: boolean; task_id: string; tables: string[]; total: number; message: string }>,
embeddingStatus: (taskId: string) =>
client.get(`/embeddings/status/${taskId}`) as unknown as Promise<{ status: string; message: string; inserted?: number; total?: number }>,
};