/**
 * AuditNarrativeGenerator -- P4-AIR-01 + P4-AIR-03
 *
 * Generates AI-authored narrative sections for auditor-facing compliance
 * reports. Pack-binding primacy is enforced at two levels:
 *
 *   1. AuditChainReader.getEventsInWindow() is called with the frameworks
 *      filter so the storage layer only returns bound events.
 *   2. A second-pass filter in this module drops any event whose packBinding
 *      does not intersect with req.frameworks, guarding against storage
 *      implementations that ignore the filter.
 *
 * Every AI-authored section is signed with an AiProvenance record and sealed
 * into the tamper-evident audit chain via sealProvenanceToChain() BEFORE the
 * NarrativeReport is returned. Callers cannot receive a report without
 * provenance being sealed (fail-closed).
 *
 * Spec: P4-AIR-01 AC 1-3, P4-AIR-03 AC 7-9
 *
 * @connexum/ai-governance
 */
import type { LlmProviderAdapter } from '../llm-adapters/index.js';
import type { CompliancePack } from '../packs/index.js';
import type { NarrativeReport, AiProvenance, AuditChainReader, AuditChainWriter, ISO8601 } from './narrative-types.js';
import type { AuditIntegrity } from './audit-integrity.js';
export interface NarrativeGeneratorConfig {
    llmAdapter: LlmProviderAdapter;
    auditChainReader: AuditChainReader;
    packs: CompliancePack[];
    /**
     * P1-TAMPER-C: when provided, generate() calls auditIntegrity.verify()
     * before building the narrative. If the chain is invalid, throws
     * ChainTamperDetectedError (fail-closed). Required in production; optional
     * to allow legacy callers to continue working during migration.
     */
    auditIntegrity?: AuditIntegrity;
    /**
     * P1-TAMPER-C: optional audit chain writer used to append the
     * chain.report.refused forensic event when a tamper is detected.
     */
    auditChainWriter?: AuditChainWriter;
}
export interface GenerateRequest {
    tenantId: string;
    contractId: string;
    windowStart: ISO8601;
    windowEnd: ISO8601;
    /** Pack IDs to scope by (pack-binding primacy) */
    frameworks: string[];
    audience: 'auditor' | 'regulator' | 'board' | 'operator';
}
export declare class AuditNarrativeGenerator {
    private readonly llmAdapter;
    private readonly auditChainReader;
    private readonly packs;
    private readonly auditIntegrity?;
    private readonly auditChainWriter?;
    constructor(config: NarrativeGeneratorConfig);
    generate(req: GenerateRequest): Promise<NarrativeReport>;
}
/**
 * Emit one report:ai-section-generated audit-chain event per NarrativeSection,
 * carrying the section's signature hash so auditors can detect tampering.
 *
 * This function is fail-closed: if the chain append fails for any section,
 * the error is thrown immediately and the report is NOT returned to the caller.
 *
 * After sealing, each SectionSignature.chainAnchorRef is populated with the
 * ID of the chain entry that sealed it.
 */
export declare function sealProvenanceToChain(report: NarrativeReport, provenance: AiProvenance, chainWriter: AuditChainWriter): Promise<void>;
/**
 * Render a NarrativeReport to markdown or HTML.
 *
 * Enforces:
 *   - Provenance must be present (MissingProvenanceError if absent)
 *   - AI-authored disclosure block at the top (EU AI Act Art. 50(1))
 *   - Per-section watermark at the end of each section (AC 9)
 *     Markdown: <!--[ai:sectionId]-->
 *     HTML:     <span class="ai-mark" aria-hidden="true">[ai:sectionId]</span>
 */
export declare function renderNarrativeReport(report: NarrativeReport, format: 'markdown' | 'html'): string;
/**
 * Verify that a sectionSignature stored in the audit chain matches the
 * actual prompt template hash. Catches forged chain entries where an
 * attacker swapped the promptTemplateHash to a different value.
 *
 * Returns true if valid, false if tampered.
 */
export declare function verifyProvenanceSignature(sectionId: string, claimedSignatureHash: string, claimedPromptTemplateHash: string, inputChunkHashes: string[]): boolean;
//# sourceMappingURL=narrative-generator.d.ts.map