Skip to content

About

Evidence-driven debugging Agent Skill: research prior fixes and viable approaches across GitHub, Hugging Face, communities and original papers, map evidence to local code, repair and validate.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Research to Fix

From uncertain failures to evidence-backed repairs.

Checks Retrieval performance MIT License Python 3.10+

English · 简体中文 · Quick start · Benchmark results · User guide

Research first. Repair with evidence. Prove what changed. Research to Fix is an Agent Skills workflow for stubborn bugs, unfamiliar errors, failed reproductions, training instability, and performance regressions. Instead of asking an agent to guess a fix, it helps the agent find relevant prior work, map it to the current code, adapt or combine compatible solutions, and validate the result against the original failure and regressions.

Figure 1. Evidence-first research-to-repair workflow: fingerprint, two evidence paths, mapping, repair, validation, review and reuse.

Figure 1. The host agent handles research and authorized execution; deterministic local helpers handle case retrieval, record checks and evidence packaging. Failed checks feed back into research.

Concept and workflow design: Afloat16. MIT licensed. No mandatory Python third-party packages, hosted search service, or embedding model.

v1.3.0 — Executed repairs, frozen evidence and coverage-first research

Actual repair test executions, semantic evidence auditing, and paired simulated research coverage

42 actual Python test subprocesses · 174 method-level outcomes · 21 audited candidate bundles. Seven controlled Python defects each have unchanged, symptom-only and fully repaired variants. Checking only the original failure accepts 14 candidates, including seven incomplete ones; the complete frozen suite accepts the seven designed fixes and rejects all 14 others. These are constructed diagnostic cases, not model-generated repairs or a field repair-rate estimate.

13/13 named evidence contradictions rejected by semantic audit versus 0/13 by unpinned hash-only verification after resealing. Independently pinned manifest verification rejects all 13 too; a coherent log edit passes both unpinned checks but fails the original pin. A new trusted-local unittest recorder freezes the before/after code, common test inputs and original failure IDs, runs explicitly authorized subprocesses, and binds the resulting claims back to sealed snapshots and the plan digest. No automatic execution of untrusted code; this is not a security sandbox or authenticity certification.

272 matched status simulations: optional coverage-first planning raises mean completed source families from 2.61 to 4.68 and mean completed stages from 4.76 to 5.36 (128 wins, 143 ties, one loss); full six-stage completion rises from 20.6% to 37.9%. Counterevidence completion is unchanged. This is a fixed outcome simulation, not live provider performance. Legacy planning stays the compatible CLI default; the skill recommends the coverage strategy.

Actual benchmark CI · Detailed results and reproduction · Measured snapshot · Trusted local recorder guide.

v1.2.0 — Exact recall, deeper research audits

Exact recall acceleration: six workloads, speedup and exact parity

2.85–4.83× faster median recall · 59.4–65.8% less sampled peak allocation · 288/288 exact results. The indexed path now counts all threshold-qualified candidates but selects and explains only the returned Top-K. Ranking scores, document IDs, counts and explanations are identical to the previous full-explanation path on every tested query. Six generated workloads, 5,000 documents, 48 queries per workload, three timing repeats; prepared-token warm-index comparison, not end-to-end repair speed. No new runtime dependencies.

The research ledger now distinguishes unplanned searches, incomplete/mixed outcomes, completed searches with no valid observations, and completed searches with valid observations; a missing counterexample is never evidence that none exists. A new matched multi-arm agent evaluation protocol freezes model, task, seed, budget and intervention digests before scoring; it does not report unrun agent trials.

Measured CI · Detailed results and reproduction · Raw snapshot · Independent transfer protocol.

New external transfer: Mathematica

Mathematica eight-method retrieval comparison and exact recall results

16,705 documents · 804 real judged queries · eight frozen methods. No ranking changes or tuning on this corpus. Precision Field nDCG@10 = 0.2366, +9.71% vs SQLite Unicode 4 and +5.87% vs actual rank-bm25 0.2.2 (positive pointwise paired 95% intervals). Contextual scores 0.2389; differences against Contextual, SQLite Porter and both BM25S variants are inconclusive. BM25S raw query latency remains substantially lower. Exact relative recall produces identical counts, IDs, scores and explanations on all 804 queries, with P50 35.36 → 7.24 ms (4.88×) in a single paired prepared-token pass. Across the five public evaluation corpora there are 101,597 documents and 2,668 judged queries; results are reported by corpus, not pooled into a leaderboard.

Eight-method run · All metrics, intervals and reproduction · Artifact.

v1.1.0 — External holdouts and precision retrieval

External holdout retrieval comparison and paired intervals

84,892 documents · 1,864 held-out judged queries · four public corpora. Opt-in precision_field combines exact, stem and phrase features with independently normalized title/body fields. The frozen scorer improves nDCG@10 over the development-tuned SQLite baseline on Programmers (+11.52%), Stats (+11.49%), and NASA (+8.32%), with positive pointwise paired 95% intervals. SciFact is inconclusive; SQLite Porter has the strongest measured SciFact score, and v1 Contextual has the strongest Stats score. No clear improvement over v1 Contextual is established on these holdouts. Defaults stay compatible. Index build cost remains higher than SQLite. Actual CI · full evidence and reproduction · frozen reports.

Specialized open-source competitor and exact scoring acceleration

BM25S competitor and optional exact scoring acceleration

The post-holdout diagnostic compares the actual BM25S 0.2.14 library against R2F and SQLite on SciFact and NASA. Precision Field leads the measured NASA methods (nDCG@10 0.4665 vs BM25S Matched 0.4389; +6.27%, pointwise paired 95% interval [0.0036, 0.0525]); SciFact does not establish a R2F advantage. BM25S raw queries and index builds are faster. An explicit optional NumPy score-only adapter achieves 5.22× / 6.70× median prepared-token scoring speedups with exact Top-11 ID/score equality across 512 queries, excluding additional adapter setup, memory and index build. No default dependency or agent-repair claim. Full comparison and tradeoffs · Actual CI.

v1.0.0 — multi-round research and verified decisions

v1.0.0 evidence ranking, simulated scheduling, and exact-attention measurements

98.44% / 95.83% Recall@6 on the original and transfer algorithm development fixtures using explicit paper–code pairing; 2.93× simulated scheduling speedup; 96.06% less peak traced allocation for online exact attention in the local CPU example. These are bounded, reproducible measurements, not universal repair accuracy or GPU speedup. Measured run · frozen JSON · release notes.

  • Research sessions retain up to four rounds, distinct-query budgets, plan-bound payloads and coverage gaps. No automatic repeated requests.
  • Optional public metadata discovery supports GitHub, arXiv, Crossref, Hugging Face, Semantic Scholar, OpenAlex and DBLP; balanced scheduling and up to four workers across independent provider groups are opt-in.
  • Paired ranking promotes explicit implementation relations, not mere URL mentions. Conflicting identifiers and publication warnings are isolated for review. BM25 remains the compatible default.
  • Protocol and candidate-design locks detect post-freeze changes; all-pairs Pareto compares matched replicates, preserving real tradeoffs.

Live scope: one authorized known-item probe returned 15 observations from GitHub, Crossref and OpenAlex, including the target paper DOI and code repository. arXiv was unavailable, Semantic Scholar rate-limited, DBLP returned an invalid response. Probe run. This is an access smoke test, not a representative retrieval score. The optional API is not a full-text reader. Host browsing remains preferred.

Where to start

I want to… Start here
Solve a difficult bug with an agent Install the skill and try a prompt
Reuse earlier fixes Record and retrieve a case
Inspect the results and compare methods Performance & evaluation · benchmark protocol
Understand every command and evidence rule Detailed user guide · case template

What it does

  • Research with a purpose: fingerprint the failure, generate balanced queries, search relevant GitHub issues/PRs, Hugging Face, technical communities, original papers and authors, and separate reliable evidence from leads.
  • Reuse with judgment: retrieve previously recorded cases, compare versions and mechanisms, and map candidate fixes to local files and symbols. Relevance is not proof of compatibility.
  • Repair and test: preserve the original failure check and regression criteria; record alternative approaches, failed attempts and actual before/after outcomes.
  • Deliver auditable evidence: check declared consistency, review missing evidence and test details, and optionally seal selected artifacts with SHA-256 manifests.

Read the source playbook, evidence rules and repair workflow for the full methodology.

Installation

Release archive: v1.3.0 release and SHA-256 checksum. Extract the research-to-fix/ directory into your host's skill directory. The archive contains the committed skill, license and version; it does not include experiment logs or local user data.

Use a host supporting the Agent Skills format. Verify your host's installation tool, then:

npx skills add Afloat16/research-to-fix --skill research-to-fix

Or clone this repository and copy skills/research-to-fix/ into your host's skills directory. The helper commands require Python 3.10+. The host must provide its own search, browsing and execution capabilities (or explicitly authorize the optional fixed public-metadata adapter for discovery); the skill itself does not provide a crawler, credentials or model API.

Usage

Try one of these requests in your agent host.

Use $research-to-fix: Our multi-GPU training intermittently hangs.
Reproduce it, find related issues and fixes, compare versions and
mechanisms, adapt a compatible solution, and verify the original failure
and regression tests. Record any unresolved evidence or failed attempts.
Use $research-to-fix: Our paper reproduction is below the reported result.
Check the original paper, author code, model/dataset configuration and
reproductions. Compare candidate approaches with identical data splits,
seeds and resource budgets, then test the best-supported change.

Research-led algorithm optimization

Find papers and real implementations, then compare repair routes instead of guessing. For difficult algorithm, reproduction and performance problems, the new research-decision workflow plans mechanism, code, paper, verification, alternative and counterevidence searches. Host search is preferred; an optional explicitly approved public-metadata adapter supports GitHub, arXiv, Crossref, Hugging Face, Semantic Scholar, OpenAlex and DBLP without credentials (service access varies). Duplicate identities are collapsed, source and access provenance is retained, and explicit paper–code links and missing coverage guide the next search. Nothing in the ranking proves applicability.

Use $research-to-fix to investigate this algorithmic bottleneck.
Identify relevant papers, author implementations and issue/PR history;
compare at least two distinct viable mechanisms if available.
Freeze the same dataset, seeds, metrics, hardware and acceptance checks.
Run authorized experiments, present the Pareto frontier and tradeoffs,
implement the best justified option, then verify and record the repair.
Step Helper
Bounded multi-round research research_session.py start / next / append / review
Single public research plan research_workflow.py plan
Optional approved public metadata discovery public_discovery.py
Deduplicate, rank, link evidence and identify gaps research_workflow.py triage
Freeze candidate design and compare measured alternatives solution_compare.py --freeze-design / --comparison

Research decision: architecture, source retrieval comparison and measured Pareto candidates

Historical v0 development replay: 32 identities, 44 observations, 16 queries. The default evidence shortlist matches the stemmed BM25 baseline in Recall@6 (92.19%) and complete pair recall (87.5%); both achieve 100% paper-and-code coverage on this fixture. The standalone facet rank is weaker overall, so it remains optional. The five-replicate local variance experiment produces two eligible Pareto options, centered two-pass and online recurrence. Measured CI run · Frozen report. Not an independent evaluation of live APIs or general agent repair success.

See the complete workflow and JSON examples, the public paper/code benchmark, and the reproducible numerical variance experiment. Network access remains opt-in; execution depends on the host and authorization. A result can be partial or blocked; no guarantee of universal repair success.

Performance & evaluation

The retrieval engine has two execution paths: a low-startup scan for one query, and a reusable validated in-memory inverted index for batches. Six explainable lexical ranking modes preserve a compatibility-first default while enabling technical identifier expansion, English stemming, exact/stem fusion and phrase-aware experiments.

Figure 2. Single-query scan versus reusable batch snapshot with compact postings and shared ranking semantics.

Figure 2. Both paths share the default scoring semantics, deterministic tie-breaking, validation and candidate filtering. No persistent query cache; rebuild after the corpus changes.

Synthetic retrieval accuracy

Figure 3. Horizontal zero-based bars comparing MRR@5 and Recall@5 for eight methods on the fixed bilingual synthetic dataset.

Figure 3. 40 authored diagnostic descriptions, 80 positive and three unrelated queries. Hybrid reaches 1.00 MRR@5, Recall@5 and nDCG@5 on this development fixture; all tested methods return no results on the three unrelated queries.

Real-world duplicate-issue retrieval

Figure 4. MRR@5, Recall@5 and median ranking latency for R2F modes and SQLite FTS5 baselines on public duplicate issue titles.

Figure 4. 44 public issue titles, 18 labeled queries. Stemmed improves the legacy MRR@5 from 50.93% to 72.22% and Recall@5 from 61.11% to 83.33%. SQLite Porter has higher MRR (74.07%) and the same recall; Stemmed has lower observed median ranking latency (26.7 vs 39.1 µs). This is a small development sample with unjudged distractors, not a held-out benchmark.

Measured throughput & memory

27.05× faster repeated-case retrieval · 109.34× faster warm sparse-index retrieval · 76.4% lower retained index allocations in the paired workloads below.

Figure 5. Paired performance charts: repeated one-shot versus batch, scan versus packed index, tuple versus packed allocation.

Figure 5. Latest recorded experiment: 120 synthetic case files × 32 queries; 5,000 generated documents × 64 sparse queries; retained Python allocations exclude the input corpus. Batch reports and Top-10 scores were identical. Warm-query timing excludes index construction; speedups are workload-specific.

Reproducibility. Figures 3–5 use one frozen, completed GitHub Actions performance run, Python 3.13.18 on Linux. See the raw JSON snapshot, performance evidence, dataset provenance and commands and figure source. The last evaluated code ran 166 helper tests and six example tests, with all seven OS/Python CI jobs passing (test run).

These are retrieval and resource benchmarks, not agent repair-success scores. Both ranking fixtures were used during development; neither establishes universal superiority. The separate external holdout evaluation is completed above; a matched SWE-bench repair evaluation has not yet been executed.

Record and reuse a case

From the repository root, run an actual failing/fixed comparison on the bundled streaming example. Choose a new output directory:

python examples/streaming-metrics/record_case.py --output /tmp/r2f-case
python skills/research-to-fix/scripts/research_case.py validate /tmp/r2f-case/case.json
python skills/research-to-fix/scripts/research_case.py recall \
  --cases-dir /tmp/r2f-case --error 'single-use iterator count mean' --format markdown

The example records actual commands, exits, per-test results, logs and snapshots from the broken and fixed implementations. Read the full example. Recall only reads the explicit top-level case directory and considers structurally valid records declaring solved.

High-throughput recall and measured ranking

For multiple related questions, supply a separate JSON file containing 1–128 query strings (do not store the query file in the case corpus):

python skills/research-to-fix/scripts/research_case.py recall-batch \
  --cases-dir ./cases --queries-file ./queries.json --ranking stemmed
Mode Choose when…
bm25 (default) You need the exact legacy ranking contract
technical Identifier variants and symptom emphasis matter
stemmed English inflections obscure related issue titles
hybrid Exact technical tokens and stemming both matter
contextual You want to experiment with ordered phrase signals
precision_field You want exact/stem/phrase features with independent field normalization (opt-in)

Use the case reuse guide for limits, score interpretation and snapshot behavior. No ranker establishes repair correctness.

Helper tools

The standard-library CLI, skills/research-to-fix/scripts/research_case.py, provides:

Command Purpose
queries Offline bilingual research plan; review before sending to public services
init Create a new blocked case template without overwriting
recall / recall-batch Local case leads for one or multiple queries
validate Check schema v1 declarations and reference consistency
review Report missing evidence, comparison context or test details

See command examples and options.

Review and preserve evidence

python skills/research-to-fix/scripts/research_case.py review /tmp/r2f-case/case.json
python skills/research-to-fix/scripts/case_bundle.py seal --directory /tmp/r2f-case
python skills/research-to-fix/scripts/case_bundle.py verify --directory /tmp/r2f-case

The evidence helper seals case.json, declared run artifacts and explicitly supplied files; verify checks bytes against the manifest, not authorship or the truth of experimental claims. Retain the manifest digest independently if you need tamper detection relative to that digest. Read the evidence bundle guide and security policy. Review and redact all material before sharing.

Project structure

skills/research-to-fix/    Agent skill, references, offline Python tools
examples/                 Reproducible repair examples
benchmarks/               Labeled datasets, baselines, performance gates
docs/figures/             Reproducible vector graphics and measured data
docs/                     User guide, methodology and release criteria
tests/                    Regression and behavior tests

Validation and contributions

python -m unittest discover -s tests -v
python -m unittest discover -s examples/streaming-metrics -v

For comparative experiments, follow the benchmark protocol. Contributions with real reproductions, comparable checks, source links, documented limitations and carefully redacted case evidence are welcome. See CONTRIBUTING, CODE OF CONDUCT, SECURITY, release checklist, and CHANGELOG.

License

MIT.

Related projects

Explore the Afloat16 project guide, demand review and outreach record.

About

Evidence-driven debugging Agent Skill: research prior fixes and viable approaches across GitHub, Hugging Face, communities and original papers, map evidence to local code, repair and validate.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages