Dream Evaluator
Orchestrate an independent, paired evaluation of one named hypothesis revision in a session separate from the proposing episode. An explicit request is required and normally comes from the project operator. The owning project and hypothesis ID are required. The requester may also identify a distinct task, an existing evaluation to resume, or a triage referral for an existing hypothesis.
Follow Stages 1–7 in order for a new evaluation, then report in Stage 9. Stage 8 is only for review of counterevidence to published guidance. Resume and withdrawal paths enter at the stage indicated below. The hypothesis and state contracts and paired evaluation protocol govern the records and comparison; do not substitute this overview for those contracts.
Boundaries that apply throughout
- Project Dreaming owns proposals, origins, and revisions. Dream Evaluator owns evaluation attempts, decisions, and publication or withdrawal receipts on the hypothesis record. Project Memory owns canonical feature edits.
- Preserve other origins, revisions, and attempts. Before each mutation or state transition, recheck the revision and on-disk contents; reconcile concurrent changes by ID and use the contract's atomic update and move rules.
- Keep reserved checks and raw results outside both implementation sessions. Never publish an unevaluated or inconclusive revision. Use project-relative paths in records, evidence, handoffs, and reports; never persist machine-specific absolute paths.
- If a required input, independent session, matched starting snapshot, or applicable task is unavailable, report the missing item and the next action or trigger. Do not invent evidence or a decision.
Stage 1 — Resolve the hypothesis and choose the path
- Resolve the ID in the owning project's
docs/harness-history/learning/{active,archived}/ records, following aliases to the canonical record. Verify the project, feature owner, revision, current requirements, origin evidence, prediction, and refutation.
- Inspect the current state and decision history. Check for a pending withdrawal that still applies before taking the status-based path:
- Pending withdrawal: resume Stage 8 from the persisted handoff in
## Outcome, including when the canonical orientation has already been removed.
candidate: continue to Stage 2.
in_evaluation: resume the frozen attempt by ID at its next unfinished stage. Record an interrupted or incomparable attempt as such before starting another.
validated: retry publication at Stage 7, using the existing validated revision and handoff; do not rerun the comparison solely to retry publication.
- Terminal revision: report the recorded outcome unless the operator supplies a new revision or credible counterevidence. For counterevidence to a published revision, follow Stage 8.
- Resolve any interrupted or superseded transition under the state contract before proceeding. Do not overwrite a prior attempt or its frozen revision.
Exit: the canonical ID, revision, state, and next stage are identified, or the missing input and action are reported.
Stage 2 — Select an independent task and prepare the comparison
- Select an applicable task distinct from the origin, using an operator-supplied task only if it meets this condition. Identify a shared starting snapshot and the applicable requirements and acceptance criteria.
- Plan at least one in-scope case and one boundary case. Check shared instructions and examples for advice equivalent to the candidate; identify any risk of exposing the candidate or reserved checks to the wrong session.
- Choose the primary acceptance check and any process gain that may confirm the prediction when first-pass results tie. If measuring cost or time, choose a common unit and capture method before launch; measurements are otherwise optional.
- If a suitable task, independent sessions, or comparable snapshot cannot be obtained, leave the candidate pending and report the missing prerequisite and next trigger.
Exit: the applicable task set, controls, starting snapshot, and comparison criteria are selected without consulting evaluation results.
Stage 3 — Freeze and record the attempt
- Before opening results, assign an evaluation ID and record the frozen revision and immutable snapshot or digest, exact condition, action, exception, prediction, refutation, success criteria, and opaque task-set ID.
- Record the planned matched setup, including requirements or specification revision, mode, model, effort, and budget. Keep concrete task prompts, starting fixtures, and reserved checks protected as specified by the paired protocol.
- Recheck the hypothesis revision, persist the freeze in the evaluation attempt, and mark it
in_evaluation before launching either arm. Preserve the freeze when later adding results.
- Re-read the saved attempt and canonical state before dispatch. Confirm the frozen revision/digest, primary check, process-gain criterion (or its absence), original refutation and tie handling are mutually consistent and the state is
in_evaluation. Resolve contradictions before launch. If an arm has already started with an invalid setup, preserve the attempt as interrupted or incomparable and prepare a new attempt under the state contract.
Exit: the frozen attempt is recorded and the revision is in_evaluation.
Stage 4 — Set up and run the paired TDD sessions
- Create isolated project copies and fresh sessions for baseline and variant. Match code, starting snapshot, acceptance criteria, specifications, TDD mode, model, effort, and budget. Do not share working files or conversation history.
- Insert the candidate as the only added orientation in the variant's routed feature guidance. Leave the baseline's feature and normal TDD path unchanged. Keep the candidate out of the canonical feature. Exclude learning records and evaluator materials that would reveal the candidate to baseline or reserved checks to either arm.
- If a criterion depends on detecting a known failure in RED, run the reserved starting check in a separate copy before either arm starts. Verify setup reaches the target assertion and fails for the expected reason. Fix or replace an invalid case before launch; if the case is still useful for other criteria, mark its target-failure comparison unavailable.
Before dispatch, also check every reserved assertion against an acceptance criterion and exercise the harness against its supported runtime interfaces, including browser globals when using a simulated browser. Remove unsupported expectations and resolve setup errors before opening arm results. If a check requires repair after results are opened, preserve its original output and repair rationale, apply the same repair to both first artifacts, and identify which comparison criteria remain supported. A repaired replay alone cannot establish predeclared early detection.
- Delegate the same task to both TDD sessions. Explicitly identify each session as a paired evaluation arm without disclosing its assignment. Give both the same stop instruction: after final validation, return the first submission, observed RED evidence and validation result, then end before post-task Dreaming, Memory or evaluator delegation. When collecting costs, measure each arm from session start through first submission and record available preparation, reconciliation, and verification costs separately.
- Discard a pair if unrelated inputs differ, the baseline sees the candidate, or either arm sees reserved checks. Record the reason and follow the interrupted or incomparable attempt rules rather than treating the pair as evidence.
Exit: each usable case has two comparable first submissions and RED evidence, or the attempt records why a comparison is unavailable.
Stage 5 — Independently verify the submissions and controls
- Have a verifier independent of both implementations run the same checks against their first submitted artifacts before rework. Check actual test selection, RED commands and output, final behavior, and whether the candidate was applied within its scope.
- Verify the in-scope and boundary controls. Check for duplicate tests, lost coverage, and equivalent existing coverage. Compare interactive and autonomous RED paths when applicable, keeping the mode fixed within each pair.
- Credit detection of a known failure only when the reserved starting check reproduced that failure and the arm's recorded RED reached that specific assertion on the verified snapshot. Record post-delivery replays separately as test-sensitivity evidence.
- Record per-case baseline and variant outcomes, guidance decisions, test and execution locators, control results, verifier identities, comparison gaps, and available measurements. A historical TDD run alone cannot establish the paired comparison.
Exit: the first submissions, controls, and evidence gaps have independently verified results or are explicitly unknown.
Stage 6 — Decide and persist the outcome
- Compare verified results to the frozen prediction, refutation, and decision criteria. Aggregate first-pass approvals, early detections, and boundary misuse by arm; handle optional cost measurements as specified in the paired protocol.
- Apply the decision rules:
- Validated: at least one applicable task distinct from the origin demonstrates the predicted gain, controls pass, and evidence supports the proposed scope. A tied primary result requires a predeclared and observed process gain.
- Refuted: an in-scope counterexample or the frozen refutation condition is verified. Archive the revision with the counterexample and rationale.
- Inconclusive: required evidence is missing or incomparable. Record the gap and follow the state contract's retry or archive rule; identify a specific next trigger when another attempt can resolve it.
- Recheck the revision and persist the sanitized evidence summary and decision on the frozen attempt. Preserve prior attempts and their results. Proceed to Stage 7 only for a validated revision; otherwise report under Stage 9.
Exit: the decision, supporting locators, controls, gaps, and any next trigger are recorded.
Stage 7 — Publish validated guidance through Project Memory
- Recheck the decision history and revision. Discard superseded requests; when retrying a pending transition, use its original handoff and ID.
- Prepare and persist the scoped publication handoff, including checkable evaluation evidence accessible outside harness history. Record its locator and pending retry condition in
## Outcome before dispatch. On resume, load the recorded handoff and check canonical state before dispatch. Keep reserved raw materials with the evaluator.
- Invoke Project Memory in the owning project. It grounds the evidence, checks the expected revision, and owns the canonical feature edit.
- Check the receipt and resolve the feature through the graph. Load the original saved handoff and parse the actual canonical entry. Require exactly one matching ID and deep equality with the handoff's complete orientation object, including revision, condition, action, exception and ordered source objects. Verify source paths and locators resolve. For withdrawal verify the intended removal. Check the affected feature prose for contradictions introduced or exposed by the publication. Record the actual comparison and checks before archiving as
published; a mismatch follows the conflict path in step 5.
- On conflict, unresolved evidence, or interruption, preserve
validated and record the publication retry trigger. Do not claim publication from a receipt alone.
Exit: publication is verified and recorded, or the validated revision remains pending with a reason and retry trigger.
Stage 8 — Review counterevidence and withdraw published guidance
- For a new withdrawal, verify the changed requirement or contradiction against accessible sources and identify the published ID and revision affected. For a pending withdrawal, resolve the original handoff and check canonical state before dispatch.
- Persist a new withdrawal handoff and its locator and retry condition in
## Outcome before dispatch. Supply Project Memory with the expected published revision, reason, and directly inspectable counterevidence through the same handoff contract. Reuse the original payload on resume.
- Check the receipt and independently verify canonical removal through the feature route. Record the reason and verified receipt. If the operation conflicts or is interrupted, preserve the pending withdrawal and its retry trigger.
- A replacement requires a newly evaluated revision before publication.
Exit: withdrawal is verified and recorded, remains pending with a reason and trigger, or the counterevidence is insufficient to request it.
Stage 9 — Report
Report the owning project, canonical hypothesis ID and revision, evaluation ID when available, decision and supporting locators, publication or withdrawal outcome, and any pending action or trigger. Distinguish an unevaluated pending candidate from an inconclusive completed attempt, and a validated revision awaiting publication from verified published guidance. Use project-relative paths throughout.