Communitygithub.com

WdBlink/autoresearch-paper

Research-first Agent Skill that runs long-horizon paper pipelines with evaluator gates, heartbeat watchdogs, resume controls, and manifest cleanup.

¿Qué es autoresearch-paper?

autoresearch-paper is a Claude Code agent skill that research-first Agent Skill that runs long-horizon paper pipelines with evaluator gates, heartbeat watchdogs, resume controls, and manifest cleanup.

Compatible conClaude CodeCodex CLI~Cursor
npx skills add WdBlink/autoresearch-paper

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Autoresearch Paper

Run a research-first paper pipeline from a short brief. The skill creates an evidence-anchored plan, freezes the evaluator before method work, blocks writing until research evidence passes or is explicitly waived, and manages watchdog, resume, stop, and cleanup resources through file-backed state.

Safety Rules

  • Never spawn Mavis agents, cron jobs, hooks, or launchd jobs before the user confirms both tier and plan preview.
  • Never auto-abort. Watchdog and L0 findings are advisory until the user confirms a destructive action.
  • Never convert MiniMax M3 or Codex output directly into acceptance, waiver, cancellation, resume, or destructive cleanup. Persist advice for controller validation or authenticated human review.
  • Never start writing from a bare PASS string. Require a validated evaluator verdict or applied candidate/evaluator/tier-bound waiver receipt; every tier also requires APPLIED CP-04 prewriting_final_evidence.
  • Never promote a paper figure from appearance, an AI review score, or an unbound image file. Require the repository-owned non-empty figure inventory, manifest hash and path validation, and a human review receipt bound to every current output.
  • Never register or advance unattended conference/journal execution without a current controller-applied evaluator admission whose replay, regression, authority, inputs, search space, and complexity policy all revalidate.
  • Never create one permanent team member per retry, direction, section, or iteration. Stable roles are enough; temporary workers must be marked ephemeral=true in resource_manifest.json.
  • Never end stop/abort/complete without running cleanup-plan-resources.sh or reporting exact residual resources.

Execution Procedure

run_autoresearch_paper(user_request) -> delivered_or_running_plan

run scripts/setup.sh
brief = collect_brief(user_request)
tier = decide_tier(brief.target_venue, references/goal-keywords.md, references/tier-decision-tree.md)
show tier, task count, estimated agents, wall-clock -> require explicit confirmation
plan_dir = create_plan_dir_and_state(brief, tier)
task_graph = generate_plan_yaml(
    references/plan-template-<tier>.md,
    references/task-prompt-snippets.md,
    assets/task-prompt-snippets.md,
    references/research-state-contract.md,
    references/lifecycle-contract.md,
    references/scientific-figure-pipeline.md
)
show human-readable plan preview + watchdog config -> require explicit "go"
freeze Claude/MiniMax/Codex policy with references/scripts/harness-runtime.py init-policy
route routine bounded tasks through harness-runtime.py dispatch-worker
at CP-01/02/03/04, create -> send -> validate -> apply -> assert the dependent transition
write watchdog-system-prompt.md from references/watchdog-prompt-template.md
schedule and run deterministic file-backed patrol through harness-runtime.py
initialize the canonical durable task graph and register its external trigger
advance one canonical work unit and dispatch only from its fresh context capsule
for MiniMax: dispatch-worker --context-capsule -> promote-worker-artifacts -> commit-durable-worker-result
for Codex: create-durable-frontier-request -> send -> validate -> apply -> commit-durable-frontier-result
after KEEP/waiver and before writing: build figures -> validate every figure manifest
use legacy adapters only when the user explicitly selects --legacy-mavis
while plan is running:
    observe controller state + last_seen.jsonl + state/progress.json + l0/watchdog health
    honor status, pause, resume, stop, cleanup, rescue-status commands
    surface watchdog/L0 findings without destructive action
on finish or user stop:
    run cleanup-plan-resources.sh
    deliver paper paths, reviewer-readiness, watchdog summary, cleanup report

Target Runtime: Claude Code

Read references/claude-code-runtime.md before dispatch. The current target adapter provides:

  • frozen per-plan MiniMax M3 and Codex model/budget policy;
  • non-interactive, schema-bounded MiniMax M3 worker dispatch through Claude Code;
  • immutable, hash-bound requests for CP-01 through CP-04;
  • pre-dispatch frontier budget reservation;
  • authenticated, expiring, replay-protected human actions;
  • hash-bound evaluator verdict and final-writing gates;
  • executable evaluator admission and drift-triggered autonomy revocation for unattended conference/journal plans;
  • typed runtime/scientific failure counters and CP-03 eligibility;
  • controller-replayed scientific-acceptance receipts plus isolated goal-drift and evaluator-integrity detection/routes;
  • two-stage episode→audited-memory→proposal learning gates with replay, held-out/regression evidence, independent audits, and human-only evaluator proposal authorization;
  • seven-scenario fault evidence, real multi-session soak accounting, and measured-duration claim gates that reject unsupported 24h/7×24/full-cutover language;
  • complete worker inspect/wait/message/cancel, file-backed patrol, and owned cleanup;
  • launchd-backed external registration, generation-bound tick leases, canonical state/event/evidence revisions, rebuildable projections, and fresh task context capsules;
  • metadata-only Guardian observations and controller validation of pre-authorized lifecycle actions;
  • durable Codex transport, response validation, exact-once dependent transitions, timeout, and restart inspection.
  • capsule-bound production dispatch for both MiniMax and Codex, with exact task/manifest/revision correlation and controller-only durable commits.
  • the packaged references/canonical-conformance-workflow.json claude-research-conformance-v1 fixture, which rejects incomplete M1 conformance runs and verifies terminal artifacts. It is not the production topic-to-paper trigger; production state advancement is handled by the durable loop, while fault/soak cutover remains an M5 gate.

MAVIS bootstrap/watchdog scripts are compatibility fixtures. They never define target Harness semantics and run only through explicit legacy entry points.

When To Use

Use this skill when the user wants a long-running research-and-writing pipeline that can pause, resume, inspect, and clean up after itself. The pipeline assumes a measurable evaluator, simulator, public benchmark, or other evidence source. If the topic has no measurable evaluator, warn the user and downgrade to arxiv unless they provide an evaluator.

Do not use this skill for a short one-off draft, one-paper reading task, slide deck, blog post, or camera-ready submission service. The output is a structured draft and next-step list; the user owns scientific authorship, submission, and final claims.

Inputs

Ask for or parse these three fields:

topic: what to study
target_venue: arxiv | conference/venue | SCI Q1/journal
materials: paths, PDFs, notes, repos, datasets, or empty

If the user gives one paragraph, parse it internally. If the target venue is ambiguous, use the Channel B fallback in references/tier-decision-tree.md.

Tier Contract

TierUse ForShape
arxivpreprint, negative result, working papershorter graph, negative-result waiver allowed
conferenceIROS/ICRA/CVPR/NeurIPS/ACL-style targetsT0 evaluator, method, implementation, experiment, independent gate, writing
journal-q1SCI Q1, Nature sub-journal, T-PAMI/T-RO/IJRR-style targetsconference graph plus deeper experiments and ablations

Tier keywords live in references/goal-keywords.md. The fallback dialogue lives in references/tier-decision-tree.md.

Plan Generation Contract

Generated plans must initialize:

  • state/progress.json
  • state/directions_tried.json
  • state/candidate_registry.jsonl
  • state/scoreboard.tsv
  • state/research_acceptance.md
  • a closed metric_contract input for CP-02; do not pre-create state/evaluator_contract.json (the controller freezes it after CP-02)
  • state/failure_state.json
  • control/
  • resource_manifest.json
  • last_seen.jsonl
  • watchdog-log.md

For conference and journal-q1, the task graph must include:

  • T0 evaluator-freeze
  • literature review and gap analysis
  • method design
  • implementation
  • experiment
  • T6.1 evaluate-candidate
  • T6.2 research-decision
  • T6.3 pivot-or-retry
  • T6.4 figure-build after a validated KEEP decision
  • writing and package tasks only after the research gate

For arxiv, a clean negative-result paper may proceed only with an applied, hash-bound negative-result waiver receipt.

Read these modules when generating a plan:

  • references/plan-template-arxiv.md
  • references/plan-template-conference.md
  • references/plan-template-journal-q1.md
  • references/task-prompt-snippets.md
  • assets/task-prompt-snippets.md
  • references/research-state-contract.md
  • references/lifecycle-contract.md
  • references/scientific-figure-pipeline.md

Research Gate

state/evaluator_contract.json is frozen from a controller-executed calibration receipt and the exact CP-02-audited metric_contract containing metric, operator, and threshold. Candidate value and PASS/FAIL are also derived from controller-owned execution receipts. Bare research_acceptance.md values are never authority. Human waivers must be applied receipts bound to tier, candidate, evaluator contract, and scope; pending signed records are not authority. Negative-result waivers remain arxiv-only. Every writing tier requires CP-04 final-evidence approval and emits a writing-gate audit.

Unattended conference and journal-q1 execution additionally requires admit-evaluator followed by check-autonomy-eligibility. A finite metric alone is insufficient: admission binds independent authority, immutable inputs, validation identity, identical replay, passing regression, allowed search space, and complexity policy. Admission drift blocks trigger, advance, and result application.

Before T7 writing, run:

python3 references/scripts/harness-runtime.py \
  check-figure-gate --plan-dir <plan-dir> \
  --inventory <plan-dir>/out/figures/required-figures.json \
  --requirements <plan-dir>/state/figure-requirements.json

python3 references/scripts/research-state-guard.py \
  check-writing-gate --plan-dir <plan-dir> --tier <tier> \
  --verdict <state/evaluator_verdicts/candidate.json> \
  --figure-gate-receipt <state/figure_gates/decision.json>

When distinct controller-normalized scientific directions bound to canonical FAIL verdicts reach the frozen threshold, a retry must be structural. Runtime stalls never count. Validate:

python3 references/scripts/research-state-guard.py \
  validate-pivot --plan-dir <plan-dir> --proposal <pivot-brief.md>

Scientific Figure Gate

Read references/scientific-figure-pipeline.md before T6.4, T7, T10, or T11. The repository-owned figure contract is host neutral:

  • scientific-visualization is the curated default capability for truthful, accessible, publication-oriented local plots;
  • scientific-schematics is optional and proposal-only for method or architecture drafts;
  • an AI-generated image or AI quality score has no scientific-accuracy, artifact-promotion, evaluator, or writing authority;
  • every promoted figure binds its source inputs, transformations, render command, renderer identity, source revision, outputs, and hashes;
  • result figures are built only after a validated KEEP decision, or after the applicable authenticated arxiv waiver;
  • T7 is blocked until a non-empty required-figure inventory, every bound manifest, and every human output-bound review receipt pass the deterministic validator.

Validate the plan inventory from the installed skill directory:

python3 references/scripts/validate-figure-artifacts.py \
  --plan-dir <plan-dir> \
  --inventory <plan-dir>/out/figures/required-figures.json \
  --requirements <plan-dir>/state/figure-requirements.json

The validator proves the declared path, hash, provenance, and artifact-format contract. It does not certify scientific truth, accessibility, visual legibility, or venue compliance; those remain independent review duties.

Patrol And Lifecycle

Target commands:

python3 references/scripts/harness-runtime.py init-durable-plan --plan-dir PLAN --graph PLAN/durable-plan.json
python3 references/scripts/harness-runtime.py register-durable-trigger \
  --plan-dir PLAN --interval-seconds 300 --jitter-seconds 30 \
  --session-budget-seconds 1800 --human-escalation-after-seconds 900
python3 references/scripts/harness-runtime.py run-durable-tick --plan-dir PLAN
python3 references/scripts/harness-runtime.py run-patrol --plan-dir PLAN --stale-seconds 7200

The production wake-up is externally registered and survives the initiating Claude Code session. Tick state, leases, canonical revisions, and context capsules are file-backed; a file-only schedule is not treated as a trigger. Patrol records only typed runtime failures. bootstrap-watchdog.sh remains an explicit legacy fixture.

Heartbeat layers:

LayerMechanismPurpose
L0plan-l0-guard.py via launchd/manual patrolsession-independent stale detection, repair, cleanup requests
L1launchd-backed durable trigger and leasewakes and reconciles the deterministic controller
L2last_seen.jsonl hookper-task activity heartbeat

The UI remains useful for status and control, but it is not the L0 heartbeat. L0 must be session-independent so a stale session is not responsible for noticing its own stall.

User Commands

Expose these commands by resolving <plan-id> to <plan-dir> with references/scripts/resolve-plan-dir.py:

CommandAction
/autoresearch-paper statusinspect controller, workers, typed failures, gates, and patrol state
/autoresearch-paper pausecreate and apply a signed pause record
/autoresearch-paper resumecreate and apply a signed resume record
/autoresearch-paper stopcreate/apply signed stop, then pass its receipt to cleanup
/autoresearch-paper cleanupcreate/apply scoped cleanup_resource records and remove owned files
/autoresearch-paper rescue-statusshow state/l0_status.json, state/watchdog_health.json, and rescue history

Long-Running Compute

Any worker action expected to exceed the runtime's foreground session cap must use a background daemon pattern with checkpoint files. The producer session should launch work, write a partial deliverable, and exit quickly.

Required checkpoint files:

  • run.pid
  • run.log
  • exit.code
  • checkpoint.json
  • a lock file that prevents duplicate daemon launches

On Linux, workers may use nohup setsid ... &. On macOS, setsid is not available by default; use nohup ... & plus disown, or a Python launcher that calls os.setsid().

Verifier sessions must independently inspect artifacts. Producer self-claims do not count as evidence.

Anti-Patterns

IDForbidden behavior
❌-1Spawn the agent team before explicit user confirmation
❌-2Auto-abort a plan because watchdog recommends abort
❌-3Overwrite an existing agent, cron, hook, manifest, or state file silently
❌-4Let watchdog edit last_seen.jsonl, out/*, or research artifacts
❌-5Invent a tier outside arxiv, conference, journal-q1
❌-6Guess tier when Channel A misses instead of using Channel B
❌-7Show raw YAML instead of a readable plan preview for confirmation
❌-8Run destructive abort/cancel without the abort gate
❌-9Promise camera-ready PDF, venue submission, or human-authorship replacement
❌-10Run conference/journal mode without a measurable evaluator
❌-11Let T7 start from a bare PASS string or without the required CP-04 receipt
❌-12Create permanent team members for every retry, direction, or section
❌-13Stop a plan without cleanup-plan-resources.sh or a residual-resource report
❌-14Let model advice directly accept, waive, cancel, resume, or clean lifecycle resources
❌-15Call Codex outside CP-01 through CP-04 or before reserving the frozen frontier budget
❌-16Accept a figure from an AI score, an unbound file, or a manifest that escapes the plan root

Failure Modes

IDTriggerFirst-line fixFallback
FM-1claude missingrun scripts/setup.sh and install/activate Claude Codestop before any worker dispatch
FM-1Lmavis missing on a legacy compatibility pathmigrate that operation to the Claude adapter or install Mavis temporarilydo not make MAVIS canonical again
FM-3amalformed YAMLretry stricter YAML generation up to 3 total attemptsfill the tier template mechanically
FM-3bmodel refuses YAMLclassify refusal; do not retry blindlybypass model and fill template mechanically
FM-4agent/cron/hook already existstreat as idempotent; skip existing resourceask user for a new slug suffix
FM-7local rescue judge failsfall back to nudge and log judge_faileddisable local LLM after repeated failures
FM-10long foreground SSH/compute hits session caprelaunch via daemon + checkpoint filessalvage partial checkpoint on retry
FM-11rendered PDF has [?] or ??run pdflatex/bibtex/pdflatex/pdflatex and pdftotext checksrepair missing .bib/cross-refs manually
FM-12page-budget fold regresses readinesscompute dimension regression before deleting a sectionrequest waiver, short-paper track, or restructure
FM-13result files hide ERROR/TypeError recordsscan all raw files, not one sampletargeted rerun or patch helper
FM-14verifier reuses producer contextuse a fresh session or artifact-only codex execdefer to human if fresh verification is impossible
FM-17model reloads per cellpreload model once at daemon startupreload per batch if memory is limited
FM-18skip-if-exists breaks on pretty JSONuse full-file json.loaddiagnose slow reruns from progress files
FM-19wrapper paper overclaims B5 beats B0 when equalseparate "preserves SOTA" from stress-path gainsadd honest scope clarification
FM-20verdict/evidence/candidate hash driftsrerun evaluation against the frozen contractrequire authenticated waiver
FM-21scientific threshold repeats the same directiondeduplicate controller-normalized, FAIL-bound directions and force T6.3 structural pivotrequest CP-03 advice
FM-22stop/abort leaves runtime resources behindrun cleanup-plan-resources.sh <plan-id>report exact residual manual commands
FM-23team members grow unboundedkeep stable roles and mark temporary members ephemeral=truecleanup archives/deletes temporary members
FM-24scientific-visualization capability is unavailableinstall the pinned focused skill and retain the figure specificationblock only the affected figure build; do not weaken the gate
FM-25optional AI schematic capability or credential is unavailablekeep the textual/vector specification and deterministic renderer pathskip AI generation without blocking unrelated result figures
FM-26figure inventory, manifest, path, hash, or human output-bound review failspreserve the proposal and rerun the repository validatorprohibit T7/T10 promotion until corrected

Deliverables

On completion, report:

  • tier and why it was selected
  • plan id and plan directory
  • wall-clock vs estimate
  • research gate verdict and evidence path
  • paper paths: paper.tex, figures, bibliography
  • validated non-empty figure inventory, manifests, and human output-bound review receipts
  • reviewer-readiness.md
  • next-steps.md
  • cleanup_report.md

References

  • references/goal-keywords.md — tier keyword table
  • references/tier-decision-tree.md — tier fallback logic
  • references/plan-template-arxiv.md — arxiv plan shape
  • references/plan-template-conference.md — conference plan shape
  • references/plan-template-journal-q1.md — journal plan shape
  • references/task-prompt-snippets.md — prompt asset index
  • assets/task-prompt-snippets.md — full worker prompt fragments
  • references/research-state-contract.md — state schema and research gate
  • references/lifecycle-contract.md — manifest, resume, cleanup contract
  • references/claude-code-runtime.md — target runtime commands and migration boundary
  • references/learning-promotion-contract.md — two-stage audited memory and proposal gates
  • references/fault-soak-acceptance-contract.md — seven faults, soak evidence, and bounded claims
  • references/scientific-figure-pipeline.md — deterministic plots, optional schematics, manifests, and promotion gate
  • references/figure-artifact.schema.json — machine-readable figure artifact contract
  • references/figure-requirements.schema.json — CP-01-frozen expected figure identities and tier boundary
  • references/frontier-response.schema.json — Codex advisory response schema
  • references/watchdog-prompt-template.md — watchdog system prompt template
  • references/first-action-last-seen.md — hook registration contract
  • assets/first-action-last-seen-hook.md — hook body registered by bootstrap
  • references/reviewer-readiness-rubric.md — reviewer-readiness scoring
  • references/scripts/ — L0, rescue, cleanup, pause/resume/stop helpers

Versioning

Per-release changelog. Versions follow semver-ish semantics within the Harness contract (major = breaking orchestrator contract, minor = new feature, patch = fixes). The full per-commit history is in the git log of this file.

  • v0.14.0 (2026-07-24) — Curated scientific-figure pipeline: source-bound figure manifests, deterministic path/hash/provenance validation, a post-KEEP pre-writing gate, Scientific Visualization as the focused default capability, and Scientific Schematics as optional proposal-only assistance.
  • v0.13.0 (2026-07-23) — Bounded T008 acceptance: all seven production fault classes, multi-session restart soak accounting, evidence manifests, duplicate/loss/overlap/authority checks, and measured-duration claim gates. This release does not claim 24h or 7×24 stability.
  • v0.12.0 (2026-07-23) — Deterministic autonomy and gated learning: closes the existing bounded-worker/deterministic-recovery slice and adds two-stage audited memory/proposal promotion, rejection memory, novelty protection, and proposal-bound human evaluator authorization.
  • v0.11.0 (2026-07-23) — Scientific-truth and failure-routing closure: controller-owned evaluator material snapshots, replayed scientific acceptance with current admission, and isolated deterministic goal-drift / evaluator-integrity detection and routing.
  • v0.10.0 (2026-07-23) — Production transport cutover: canonical context capsules now bind MiniMax task contracts and inputs, derive Codex checkpoint manifests, and admit only controller promotion/transition receipts into the durable evidence loop with exact-once commit recovery.
  • v0.9.0 (2026-07-23) — Durable production loop and evaluator admission: launchd registration, generation-bound tick claims, canonical revisions and projections, fresh context capsules, metadata-only Guardian recovery, and replay/regression/authority-bound eligibility for unattended conference/journal plans.
  • v0.8.0 (2026-07-18) — Claude Code target cutover: authenticated human actions, evidence-bearing evaluator/writing gates, typed failures, complete target runtime operations, hash-bound CP-01–CP-04 transitions, and a no-MAVIS fake-transport integration test.
  • v0.7.0 (2026-07-16) — CLI → tool migration. The legacy mavis agent|cron|session|hook|archive CLI subcommands are removed by the runtime; the skill is rewired to use the native mavis tool for agent/cron/session, direct file writes for hooks (~/.mavis/hooks/...), and direct cron/agent file removal during cleanup. mavis team plan ... remains a CLI (with the v0.7 flag rename abortcancel). mavis communication send is marked deprecated (no replacement contract yet — surface as a finding instead of auto-sending).
  • v0.6.0 (2026-06-26) — Agent Skills monorepo layout. The skill bundle moves to skills/autoresearch-paper/ so npx skills add resolves it. Cleanup-script subcommand fix (mavis agent archivedelete, mavis session archivecompress).
  • v0.4.0 (2026-06-26) — Platform-portable daemon pattern: drop Linux setsid dependency, add producer-discipline pre-flight checklist, and add the harness-paper honest-framing pattern to the reviewer rubric.
  • v0.3.1-r5 (2026-06-25) — Wide-table 2-column span recipe (Step 7.5.a + FM-15) for camera-ready LaTeX output.
  • v0.3.1 (2026-06-25) — V6 evidence: engine-ceiling handling, verifier spot-check recipe, and the "0% framing" honesty pattern for negative results.
  • v0.3.0 (2026-06-24) — Rescue Layer: L0 filesystem-corruption guard, hourly watchdog cron, plan-rescue daemon, and three failure-mode FMs. Also adds the abort-gate and workspace-isolation checkpoint contracts.
  • v0.2.0 and earlier — Three-tier plan templates (arxiv / conference / journal-q1), heartbeat contract, and the original brief-to-paper pipeline.

License

MIT.

Skills relacionados