/** * Maintain-plan validation and normalization (011 §7). * * Contract checks (mechanical, no semantics): enum membership, required * fields, evidence closed over the facts block's signal set, needs_human * consistency with the confidence/reversibility/is_override/unknown rules, * and the quality_low=unknown global imposition. Never judges whether a * recommendation is right — only whether it is well-formed and traceable. */ import { type DriftReport } from '@lmzhen/dsh-evolution-core'; /** * V27 D-3: the clause ids the maintain template ITSELF enumerates — the `- A1 …` * bullets of its §5 rule catalogue. `rule` is checked against this set (parsed * from the shipped template at module load, so a template edit that adds or * renames a clause moves the set with it) instead of the former bare * non-empty-string check, which let a plan cite a clause number that does not * exist and still pass mechanical validation. `self-consistency.spec.ts` pins * the parsed set so a template rewording cannot silently empty it. */ export declare const MAINTAIN_RULE_IDS: ReadonlySet; export type MaintainVerdict = 'issues' | 'no_issues'; export type MaintainPlanItemKind = 'skill-level' | 'relationship-level' | 'library-level'; export type MaintainReversibility = 'archive' | 'restructure' | 'patch' | 'rename' | 'none'; export type MaintainImpact = 'better' | 'worse' | 'neutral'; export interface MaintainEvidence { signal: string; value: string; } export interface MaintainPlanItem { kind: MaintainPlanItemKind; names: string[]; rule: string; evidence: MaintainEvidence[]; finding: string; recommendation: string; semantic_reasoning: string; impact: MaintainImpact; impact_reason: string; reversibility: MaintainReversibility; undo_path: string; confidence: number; needs_human: boolean; is_override: boolean; override_reason?: string | undefined; } export interface MaintainPlan { verdict: MaintainVerdict; plan: MaintainPlanItem[]; notes: string[]; } export interface ValidationResult { ok: boolean; errors: string[]; /** Normalized plan (needs_human impositions applied). */ plan: MaintainPlan; /** Skill names whose items were force-marked needs_human by the quality_low gate. */ forcedHuman: string[]; } /** * Validate and normalize a maintain plan against the facts report. * @param raw - subagent output (already JSON-parsed by the subagent channel). * @param report - the DriftReport rendered into the facts block (quality_low gate source). * @param validSignals - ids present in the rendered facts block. */ export declare function validateAndNormalizeMaintainPlan(raw: unknown, report: DriftReport, validSignals: ReadonlySet): ValidationResult; //# sourceMappingURL=validate-plan.d.ts.map