/** * Deterministic half of the refinement flow: edit validation, proposal * application with baseline conflict detection, and the entry↔edit field * mapping shared with rollback (see ./rollback.ts) and promote. * @module dsh-continual-harness */ import { BLAST_RADIUS_VALUES, KEBAB_CASE_PATTERN, REFINEMENT_KINDS } from './domain.ts'; import type { SkillBundleLimits } from './skills.ts'; import type { AppliedRefinementEdit, HarnessEntry, HarnessState, RefinementEdit, RefinementKind, RefinementResult, RefinementProposal } from './types.ts'; /** Kind names accepted by the harness layer. */ export { REFINEMENT_KINDS }; /** Actions accepted by the harness layer. */ export declare const REFINEMENT_ACTIONS: readonly ["create", "update", "delete"]; /** Identifier of the immutable base system prompt; never an editable id. */ export declare const BASE_SYSTEM_PROMPT_ID = "base_system_prompt"; /** Existing importers may continue importing this shared constant from refine.ts. */ export { KEBAB_CASE_PATTERN }; /** The same compatibility re-export this constant has always had from here. */ export { BLAST_RADIUS_VALUES }; /** Canonical serialization of an entry for baseline conflict detection. */ export declare function entryFingerprint(entry: HarnessEntry): string; /** Validate one edit; returns the failure reason or undefined when valid. */ export declare function validateEdit(edit: RefinementEdit, opts?: { skillBundleLimits?: SkillBundleLimits; scope?: 'local' | 'global'; replay?: boolean; }): string | undefined; /** * Apply a proposal to a state snapshot with per-edit before/after snapshots. * Entries that changed during planning (baseline mismatch) reject their edit. * Returns the result and the mutated state. */ export declare function applyRefinementProposal(state: HarnessState, proposal: RefinementProposal, options: { id: string; rollbackOf?: string; scope: 'local' | 'global'; baselineState: HarnessState; /** Entry growth fraction cap; 0 disables the check. */ maxEntryGrowth?: number; /** Kinds the automatic path may not edit at all (create/update/delete). */ protectedKinds?: readonly RefinementKind[]; /** Global entries for the local-during-global read-only rule. */ globalEntries?: HarnessState['entries']; /** True when the commit rides the automatic path (gate), enabling protected-layer checks. */ automatic?: boolean; /** Session provenance stamped on create/content-update edits. */ sourceSession?: string; /** * Repository the commit is applied in, stamped onto created/updated entries * so ranking can prefer this project's entries. Omitted by replay paths * (rollback, benchmark derivation) that must stay independent of the machine * they run on. */ project?: string; /** Bundle limits passed to validateEdit for skill files (spec §7.4). */ skillBundleLimits?: SkillBundleLimits; /** Per-edit veto hook (e.g. fs-backed create-conflict checks); returns the failure reason. */ editGate?: (edit: RefinementEdit) => string | undefined; }): { result: RefinementResult; state: HarnessState; }; /** * Conclusion-only projection of a committed refinement for the state file: * applied edits keep their metadata (action/kind/id/blastRadius/applied/ * error/reason) but drop the content snapshot bodies (before/after/ * beforeEntry/afterEntry). The full record stays in the refinements.jsonl * journal (rollback/audit), so `harness_state.json` only records conclusions * and stays small. The in-memory result is unaffected, so diagnostics, * materialization, and the tool result still see the full snapshots. */ export declare function stripRefinementSnapshots(result: RefinementResult): RefinementResult; /** Skill entries touched by applied edits; shared by materialization and post-apply diagnostics. */ export declare function touchedSkillIds(appliedEdits: Array>): string[]; /** Existing importers may continue importing the rollback surface from refine. */ export { entryToEditFields, rollbackProposal } from './rollback.ts'; /** A fresh empty entries map at the current schema version. */ export declare function freshState(): HarnessState; //# sourceMappingURL=refine.d.ts.map