Skip to content
cccskills
FreePublished on GitHub

diagnose-failed-run

Determine the TRUE cause of a failed retort run before attributing it. Ground-truth every failure (run its tests, read its agent logs, inspect its workspace) and classify it as an infrastructure false-fail, a genuine model miss, or an environment issue — never trust the gate verdict or a log signature alone. Use whenever a run is recorded failed (test_coverage=0 / gate fail), a pass rate looks low, or you're deciding whether a "failure" is real before reporting or proceeding.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md6.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Diagnose a Failed Retort Run

Overview

A run failing the mechanical gate (test_coverage=0 → all metrics zeroed → status=failed) says only that the tests didn't run/pass under the scorer — not that the model produced bad code. Historically most "failures" in this repo were harness/measurement artifacts, not model defects. This skill is the judgment layer on top of retort diagnose: it establishes the real cause with direct evidence before anyone attributes, reports, or gates on it.

It exists because we repeatedly drew wrong conclusions by inferring from a signature ("flaky", "concurrency", a wrong env var, a wrong tool-permission fix) that end-to-end checks later overturned. The cost of guessing here is hours and bad decisions.

Cardinal rules

  1. Ground-truth before concluding. Run the tests yourself, inspect the workspace, read the agent logs. Never attribute a cause from the gate verdict, a duration, or a single log line alone.
  2. Label every claim [DIRECT] (observed: command output, file state, a reproduced result) vs [HYPOTHESIS] (inferred, not yet tested). Don't ship a hypothesis as a cause. If a cause is unconfirmed, say so and name the experiment that would confirm it.
  3. Read the DB and the agent logs. The recorded scores/session show which tool or step failed; the agent stderr shows why (the permission type, the error). You usually need both — e.g. the session said "read rejected", but only --print-logs stderr revealed the real permission was external_directory.
  4. Verify any fix end-to-end (through the harness), not just CLI/unit. A fix that passes a CLI probe can still fail in the runner (a wrong env var passed both).

Inputs in each runs/<cell>/repN/

FileUse
TASK.mdWhat the agent was asked to build
stack.jsonlanguage / agent / model / tooling for this cell
scores.jsonrecorded metrics (all 0 ⇒ gate-failed)
generated sourcewhat the agent actually produced — check it exists and where (subdirs/packages count)
_agent_stdout.logthe agent's full --format json / --mode json event stream (tool calls + their status, errors, the final text)
_agent_stderr.logthe agent's internal logs (permission evaluations, hangs, provider errors) — for opencode, requires --print-logs

If _agent_*.log are absent, the run predates log capture; reconstruct from the agent's own session db (e.g. opencode's OPENCODE_DB sibling) and add capture before re-running.

Procedure

  1. Mechanical pass first: retort diagnose --experiment-dir <dir> labels each failed run TOOLING (recovers with retort rescore --only-failed) vs GENUINE. Start here; this skill handles the cases it can't auto-resolve.
  2. Ground-truth each failure (do NOT skip even for GENUINE):
    • Does code exist, and where? A "no code" verdict is often just a package subdir (app/, src/) the eye/glob missed.
    • Run the tests yourself in a clean copy with deps installed (pytest / cargo test / go test ./... / mvn test / …). Passing tests ⇒ it's a scorer false-fail, not a model miss.
    • Read _agent_stdout.log for the failing tool call + status; read _agent_stderr.log for the reason.
  3. Classify the cause (see taxonomy). State it [DIRECT] with the evidence.
  4. Isolate intermittent/ambiguous causes with a controlled A/B — change exactly one variable (e.g. shared vs isolated db; baseline vs with-fix batch) and compare. Log what you dropped; don't conclude from n=1.
  5. Reproduce-with-full-capture before declaring an intermittent cause — run it enough times to catch one with _agent_*.log captured, then read the events at the abort.
  6. Verify the fix end-to-end through the harness, then re-score / re-run.

Cause taxonomy

A. Infrastructure false-fail (code works; the harness mis-scored it → fix the harness, then rescore):

  • Scorer gap — language/runner the scorer doesn't handle (e.g. a Bun bun:test project the TS scorer can't measure).
  • Undeclared / transitive deps — model omits requirements.txt; tests fail at import (incl. transitive deps like httpx for fastapi/starlette TestClient).
  • Permission auto-deny — headless agent denies a tool (opencode's external_directory: ask→deny on the temp workspace) → aborts with no code.
  • Concurrency/env contention — shared state (opencode's single opencode.db) → fast-fail at startup under parallelism.
  • Mis-measurement — coverage parsed as 0 on passing tests, etc.

B. Genuine model miss (real, count it; not fixable in the harness):

  • Won't compile / tests genuinely fail / no tests written / no or partial deliverable / code in the wrong place the task didn't ask for.

C. Environment (transient/operational, not the model or harness logic):

  • Rate-limit / credit cutoff (check the provider key's usage/limit), stray processes, resource exhaustion, OS cleanup.

Tells (and their trap)

The classic tell — fails instantly for ~$0 ⇒ harness; burns model time ⇒ genuine — is a starting hint, not a verdict. It breaks when scoring is the failure point: a run can burn minutes producing working code and still be scored 0 (scorer false-fail). And a fast no-code abort can be a harness permission denial, not a model giving up. Always ground-truth.

Output

Per failure, report: cell · cause (one of the taxonomy) · [DIRECT]/[HYPOTHESIS] with the evidence · recommended action (retort rescore; fix scorer/harness then rescore; count as genuine; re-run with capture). Then the rolled-up verdict: how many failures are infra vs genuine, and whether the infrastructure is trustworthy enough to proceed.

Logging setup (prerequisite)

  • The runner persists _agent_stdout.log / _agent_stderr.log per run (_persist_agent_output).
  • For opencode, the harness passes --print-logs so stderr carries the diagnostic logs (permission evaluations, step loop). Raising opencode's level (--log-level DEBUG, OPENCODE_LOG_LEVEL=verbose) adds ~nothing — the --format json stdout stream is the signal.

See also

  • retort diagnose / retort rescore — automated TOOLING/GENUINE triage + recovery.
  • evaluate-run skill — the per-run spec/quality evaluation (this skill is for failures).

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

beads

Free

Use when working in a repository that uses bd or Beads for durable project task tracking, issue dependencies, blocker management, multi-session handoff, or shared work memory. Trigger when the user asks to find ready work, claim or close tasks, create follow-up work, inspect blockers, recover project context, or choose between local planning and persistent project tracking.

The English summary is being prepared. Showing the original description.

adrianco/retort210Updated Oct 19, 2026

Compare evaluated runs in a retort experiment along factor dimensions. Surfaces effects of each factor, aggregates across replicates, and highlights cells that diverge qualitatively — complementing (not replacing) retort's ANOVA analysis.

The English summary is being prepared. Showing the original description.

adrianco/retort210Updated Oct 18, 2026

Evaluate a single retort experiment run. Score the generated code against the task's TASK.md requirements, run its build and tests, compute metrics, and emit a structured evaluation report plus a machine-readable findings file.

The English summary is being prepared. Showing the original description.

adrianco/retort210Updated Oct 18, 2026

Aggregate a retort run's findings.jsonl into a machine-readable assessment.json summary with severity counts, penalty score, requirement coverage, and top findings.

The English summary is being prepared. Showing the original description.

adrianco/retort210Updated Oct 18, 2026

Summarize the architecture of code generated by a single retort run. Produces module-level structure, interfaces, and control flow in a form suitable for cross-run comparison — not a full codebase-summary.

The English summary is being prepared. Showing the original description.

adrianco/retort210Updated Oct 18, 2026

Refresh the data tables in optimal-blog.md from master.db. Checks the data for integrity problems FIRST, then runs the generator that picks per-language winners and splices every GEN-marked table, then reconciles the surrounding prose. Use after new experiment results land, or when the optimal-blog numbers are stale.

The English summary is being prepared. Showing the original description.

adrianco/retort210Updated Oct 18, 2026

See all skills by adrianco

Report a problem with this skill