feat(advisor): atom-grain controls in agent context
controls-augmentation now renders control_id + sub_topic + source_regulation (handles both atom-grain and master-grain API shapes). The compliance-advisor answers from atom_classification (precise, sub-topic-organized, framework- traceable) via the shared get_controls_for_use_case API. 100% local at runtime. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -19,14 +19,17 @@ export interface UseCaseLite {
|
||||
}
|
||||
|
||||
interface ControlLite {
|
||||
master_control_id: string
|
||||
control_id?: string
|
||||
master_control_id?: string
|
||||
title: string
|
||||
sub_topic?: string | null
|
||||
source_regulation?: string | null
|
||||
primary_regulation?: string | null
|
||||
is_primary?: boolean
|
||||
}
|
||||
|
||||
interface ControlsResponse {
|
||||
total?: number
|
||||
granularity?: string
|
||||
controls?: ControlLite[]
|
||||
}
|
||||
|
||||
@@ -105,8 +108,11 @@ export async function buildControlsContext(message: string): Promise<string> {
|
||||
const total = data?.total ?? controls.length
|
||||
|
||||
const lines = controls.map((c, i) => {
|
||||
const reg = c.primary_regulation ? ` — Quelle: ${c.primary_regulation}` : ''
|
||||
return `${i + 1}. [${c.master_control_id}] ${c.title}${reg}`
|
||||
const cid = c.control_id || c.master_control_id || '?'
|
||||
const sub = c.sub_topic ? ` · ${c.sub_topic}` : ''
|
||||
const src = c.source_regulation || c.primary_regulation
|
||||
const reg = src ? ` — Quelle: ${src}` : ''
|
||||
return `${i + 1}. [${cid}]${sub} ${c.title}${reg}`
|
||||
})
|
||||
|
||||
return `## Strukturierte Controls aus der Datenbank — Thema: ${uc.label}
|
||||
|
||||
Reference in New Issue
Block a user