/** * dsh-continual-harness — a standalone DeepSeek Harness plugin implementing * continual harness self-evolution. One plugin mounts the * store, the model-facing `harness_refine` tool, the digest-tracked prompt * projection, and the automatic refinement gate. * * Mounting: add this package as a plugin of a dsh profile (e.g. through the * profile's cordis.patch.yml or the settings UI). It needs the `tools`, * `agents`, and `session` capability packages loaded before it. * @module dsh-continual-harness */ import type { Context } from '@deepseek-ai/cordis'; import z from '@deepseek-ai/schemastery'; import type { PlannerPrefixCacheMode } from './cache-detect.ts'; import type { InjectionAnchor } from './render.ts'; import type { RefinementKind } from './types.ts'; export declare const name = "continual-harness"; export declare const inject: string[]; /** Automatic refinement gate configuration. */ export interface AutoRefineConfig { /** Whether the gate runs at all. */ enabled: boolean; /** Assistant turns between automatic refinement passes. */ turnInterval: number; /** Cooldown between automatic refinement attempts. */ cooldownMs: number; /** Whether a compaction also triggers a gate pass. */ compact: boolean; } /** Explicit benchmark tool configuration (spec §5). */ export interface BenchmarkConfig { /** Whether the `harness_benchmark` tool is registered. */ enabled: boolean; /** Iterations per case per side when a run omits `runs`. */ defaultRuns: number; /** Upper bound for `runs`; a larger explicit value is refused. */ maxRuns: number; /** Report-only pass line in 0..100; never gates acceptance (§4.5). */ passThreshold: number; /** How far the candidate may fall below the reference before regressing. */ regressionTolerance: number; /** Maximum failed candidate cells a run may still accept. */ maxFailedCells: number; } /** Continual harness plugin configuration. */ export interface Config { /** Harness home; defaults under the dsh home directory. */ harnessRoot?: string; /** * Directory where skill entries materialize as dsh SKILL.md bundles. * Defaults to the dsh user skills root (`$DSH_HOME/skills`), which dsh's * filesystem skill provider scans live. */ skillsDir?: string; /** * Required deployment choice for the store the tool targets when a call * omits `global`: local keeps lessons session-scoped, global makes them * cross-session. */ defaultGlobal: boolean; /** Tail-biased trajectory window fed to the planner. */ maxTrajectoryChars: number; /** Output budget for the planning call. */ plannerMaxTokens: number; /** Planner prefix-cache routing: auto-detect, force session prefix, or off. */ plannerPrefixCache?: PlannerPrefixCacheMode; /** * Legacy compatibility key retained for schema compatibility only. Route A * no longer truncates or caps the session prefix — it reuses the host-loop * request snapshot verbatim (spec §2.2), so this value bounds nothing and is * not forwarded to the coordinator. Kept so existing configs keep validating. */ plannerPrefixMaxChars?: number; /** Route B: fraction of the trajectory budget reserved for the verbatim signal layer. */ trajectorySignalRatio?: number; /** Shared char→token estimate ratio for planner budget control (A and B). */ plannerTokenPerCharRatio?: number; /** Tokens reserved inside the context window for safety. */ plannerSafetyReserveTokens?: number; /** Minimum output tokens a planner route must be able to produce. */ minPlannerOutputTokens?: number; /** Automatic refinement gate settings. */ autoRefine?: AutoRefineConfig; /** Require explicit human approval before a global refinement commits. */ requireGlobalApproval: boolean; /** Per-kind cap for ranked injection into the model-visible overview. */ maxInjectedEntriesPerKind: number; /** What the injected block is ranked against: the live question or a session-stable anchor. */ injectionAnchor: InjectionAnchor; /** Register the harness_wrapup tool. */ wrapupEnabled: boolean; /** Audit automatic review verdicts into the session log. */ auditReviews: boolean; /** Explicit benchmark tool settings (spec §5). */ benchmark?: BenchmarkConfig; /** Persist harness logs to a file. */ logToFile: boolean; /** Cap on the harness log file size in bytes. */ logMaxBytes: number; /** Per-commit entry growth fraction cap; 0 disables the check. */ maxEntryGrowth: number; /** Kinds the automatic path may not modify. */ protectedKinds: RefinementKind[]; /** Skill bundle limits (spec §7.10): file count, per-file bytes, total bytes (UTF-8). */ maxSkillFiles: number; maxSkillFileBytes: number; maxSkillBundleBytes: number; /** Run post-apply diagnostics after each committed refinement. */ diagnosticsEnabled: boolean; /** Enable the local L3 security provider inside the diagnostics runner. */ securityEnabled: boolean; } /** Benchmark configuration (spec §5) with its MVP defaults. */ export interface BenchmarkConfig { /** Whether the benchmark tool is registered at all. */ enabled: boolean; /** Iterations when the tool call omits `runs`. */ defaultRuns: number; /** Hard cap on iterations per run. */ maxRuns: number; /** Validated and threaded through, but currently neither gates the verdict * nor appears in the run output (spec §4.5 intended it as a report line). */ passThreshold: number; /** Allowed downward drift of candidate vs reference before regression. */ regressionTolerance: number; /** * Accepted for backward compatibility only: under the paired comparison a * failed cell drops its own pair (`pairs` reports the real sample size), so * this no longer changes the verdict. */ maxFailedCells: number; } /** Benchmark config defaults (spec §5); shared by the schema and the apply fallback. */ export declare const DEFAULT_BENCHMARK_CONFIG: BenchmarkConfig; /** Schemastery configuration for the continual harness plugin. */ export declare const Config: z; /** * Mount the continual harness: store, tool, projection, and driver. All * contributions register through effect-based APIs and dispose with the * context. * @param ctx - Cordis context carrying the tools and agents services. * @param config - validated plugin configuration. */ export declare function apply(ctx: Context, config: Config): void; //# sourceMappingURL=index.d.ts.map