/** * Evidence-gate-aware goal judge (Layer 4 of SG-COGNITIVE-SUBSTRATE). * * This is CLEO's core differentiator over Claude-Code (transcript judge) and * Hermes (post-turn loop, still transcript-judged for fuzzy intent). For a * `task-completion` goal, the judge NEVER reads the transcript: it resolves the * target task's REAL status and re-uses the shipped ADR-051 evidence * infrastructure ({@link validateEvidenceForGate} + * {@link GATE_EVIDENCE_REQUIREMENTS} via `tasks/evidence.ts`). A goal is * satisfied ONLY when the task is `status === 'done'` AND every required gate * ({@link CRITICAL_GATES}) is backed by evidence atoms of the kinds ADR-051 * mandates. Transcript text can never satisfy a task-completion goal. * * `fuzzy` goals — those with no machine-checkable artifact — delegate to an * INJECTABLE LLM judge ({@link GoalJudge}). The judge interface, not a concrete * model client, is the dependency, so vitest passes a deterministic mock and * stays fully offline/hermetic. The fuzzy path NEVER touches the evidence * infrastructure. * * @module @cleocode/core/goal/judge * * @epic T11290 EP-CLEO-GOAL-SYSTEM * @task T11378 * @saga T11283 SG-COGNITIVE-SUBSTRATE * @adr ADR-051 */ import type { GoalJudge, GoalJudgeVerdict, GoalRecord, VerificationGate } from '@cleocode/contracts'; /** * The gates a task-completion goal demands be evidence-backed before it is * judged satisfied. These are the ADR-051 critical gates that reject * override-only evidence (`implemented` + `testsPassed`) — the same two gates * `cleo complete` enforces hardest. A goal that says "complete T123" therefore * means exactly what CLEO means by complete: code landed (commit+files) AND * tests proven (test-run/tool/pr), with real, validated atoms. * * @task T11378 * @adr ADR-051 */ export declare const CRITICAL_GATES: readonly VerificationGate[]; /** * Judge a goal and return a uniform {@link GoalJudgeVerdict}. * * Routing: * - `task-completion` → {@link judgeTaskCompletion} (evidence path, no LLM). * - `fuzzy` → the injected {@link GoalJudge} (LLM fallback). * * The `llmJudge` is REQUIRED only for fuzzy goals; a task-completion goal never * calls it. Passing the judge by parameter (dependency injection) is what keeps * vitest hermetic. * * @param goal - The goal under evaluation. * @param llmJudge - The injectable LLM judge used for fuzzy goals. * @param cwd - Project root override for task lookup. * @returns The verdict (same shape for both paths). * @task T11378 */ export declare function judgeGoal(goal: GoalRecord, llmJudge: GoalJudge, cwd?: string): Promise; /** * Evidence-gate-aware judgement for a single task-completion goal. * * Decision table (first match wins): * 1. Task not found → `impossible` (the goal references a task that no longer * exists). * 2. Task `cancelled` / `archived` → `impossible` (terminal non-done state — * it can never become `done`). * 3. Task not `done` → `ok: false` (still in flight; reason carries the real * status so the continuation tells the agent what remains). * 4. Task `done` but a critical gate lacks the ADR-051-required evidence atoms * → `ok: false` (done-without-proof is NOT satisfied — the whole point). * 5. Task `done` AND every critical gate is evidence-backed → `ok: true`. * * @param targetTaskId - The task the goal wants completed. * @param cwd - Project root override. * @returns The verdict, with `evidence[]` listing the atom kinds inspected. * @task T11378 * @adr ADR-051 */ export declare function judgeTaskCompletion(targetTaskId: string, cwd?: string): Promise; /** * A deterministic, offline {@link GoalJudge} that always returns a fixed * verdict. Wired in tests (and as a safe default in non-LLM contexts) so the * fuzzy path is fully exercised without a live model call. * * Production wires a real LLM-backed implementation of {@link GoalJudge}; this * stub exists so the goal loop has a hermetic fallback and so the gate * `GATE_EVIDENCE_REQUIREMENTS` import stays referenced for downstream tooling. * * @task T11378 */ export declare class StaticGoalJudge implements GoalJudge { private readonly verdict; /** * @param verdict - The verdict every {@link judge} call returns. */ constructor(verdict: GoalJudgeVerdict); /** * Return the configured verdict, ignoring the goal entirely (deterministic). * * @param _goal - The goal under evaluation (unused — deterministic stub). * @returns The fixed verdict. */ judge(_goal: GoalRecord): Promise; } /** * The number of distinct critical gates the evidence judge inspects. Exposed so * callers/tests can assert the judge consulted the full {@link CRITICAL_GATES} * set without hard-coding the count, and to keep {@link GATE_EVIDENCE_REQUIREMENTS} * referenced as the SSoT the judge validates against. * * @task T11378 */ export declare const CRITICAL_GATE_COUNT: number; //# sourceMappingURL=judge.d.ts.map