Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
e91ebd6
CLI v0.5.0: add bootstrap, lead, and contribute orchestration commands
alanzabihi Apr 20, 2026
faea286
Remove POLYRESEARCH.md and SKILL.md replaced by CLI orchestration
alanzabihi Apr 20, 2026
2d47aca
Fix recovery observation fabrication, stale AppContext leak, and env_…
alanzabihi Apr 20, 2026
8f6dd20
Fix stale GitHubClient after clone, unused protected_globs, and direc…
alanzabihi Apr 20, 2026
f765739
Add scenario flow tests for bootstrap, contribute, and lead user jour…
alanzabihi Apr 20, 2026
aaf7499
Deduplicate decision logic, fix fork for personal accounts, correct p…
alanzabihi Apr 20, 2026
4b721f7
Fix optional baseline, harness path isolation, maintainer rejection g…
alanzabihi Apr 20, 2026
6bc6910
Fix auto-submit error handling, staged-only check, and crashed outcom…
alanzabihi Apr 20, 2026
9839838
Guard lead decisions against stale ledger, skip PRs without thesis re…
alanzabihi Apr 20, 2026
63f729a
Re-derive state between lead loop phases and use saturating_sub for q…
alanzabihi Apr 20, 2026
04dc9b8
Merge pull request #60 from superagent-ai/cli-v2-rebuild
alanzabihi Apr 20, 2026
4963412
Bump cli_version in PROGRAM.md to 0.5.0 to match Cargo.toml
alanzabihi Apr 20, 2026
5635b22
Merge pull request #61 from superagent-ai/fix-smoke-version
alanzabihi Apr 20, 2026
eb51177
Update READMEs for v0.5.0 bootstrap/lead/contribute workflow
alanzabihi Apr 20, 2026
504f43e
Merge pull request #62 from superagent-ai/cli-v2-rebuild
alanzabihi Apr 20, 2026
94aed31
Remove fictional SSH relay pattern from remote machine section
alanzabihi Apr 20, 2026
9b8f474
Merge pull request #63 from superagent-ai/cli-v2-rebuild
alanzabihi Apr 20, 2026
6101767
Tighten README for first-time visitors
alanzabihi Apr 20, 2026
ed2a218
Merge pull request #64 from superagent-ai/readme-cleanup
alanzabihi Apr 20, 2026
b7a707f
Fix bootstrap and contribute to clone into a subdirectory derived fro…
alanzabihi Apr 21, 2026
e505879
Handle trailing-slash URLs in repo_name_from_url
alanzabihi Apr 21, 2026
63c02f8
Merge pull request #66 from superagent-ai/bootstrap-clone-subdir
alanzabihi Apr 21, 2026
d117ed9
Add CLI flags for node config overrides and auto-fork in bootstrap
alanzabihi Apr 21, 2026
46ade57
Extract shared strip_github_url helper, add conflicts_with for --no-fork
alanzabihi Apr 21, 2026
5e6743c
Fix parse_url failing on URLs with trailing slashes
alanzabihi Apr 21, 2026
491144e
Harden parse_url against non-GitHub URLs and extra path segments
alanzabihi Apr 21, 2026
f029480
Merge pull request #67 from superagent-ai/cli-overrides-auto-fork
alanzabihi Apr 21, 2026
2faefc0
Simplify README usage examples to one command per section
alanzabihi Apr 21, 2026
e3802bc
Merge pull request #68 from superagent-ai/simplify-readme-examples
alanzabihi Apr 21, 2026
b61aa31
Extract prompts from inline Rust strings into cli/prompts/
alanzabihi Apr 21, 2026
9aa2ccf
Replace magic-string goal replacement with structural section replace…
alanzabihi Apr 21, 2026
d78f636
Merge pull request #69 from superagent-ai/extract-prompts
alanzabihi Apr 21, 2026
590ad60
Document every CLI flag with type, default, and description in README
alanzabihi Apr 21, 2026
6999066
Merge pull request #70 from superagent-ai/cli-readme-flags
alanzabihi Apr 21, 2026
bd9fba7
Bump version to 0.5.1 for release
alanzabihi Apr 21, 2026
e42c4fd
Merge pull request #71 from superagent-ai/release-v0.5.1
alanzabihi Apr 21, 2026
13e99ea
Use --dangerously-skip-permissions and derive cli_version from Cargo.…
alanzabihi Apr 21, 2026
ab8815e
Merge pull request #73 from superagent-ai/update-claude-perm-flag
alanzabihi Apr 21, 2026
2052985
Support owner/repo shorthand in bootstrap and contribute commands
alanzabihi Apr 21, 2026
ae70d16
Reject extra path segments in RepoRef::parse to prevent bogus repo re…
alanzabihi Apr 21, 2026
353204d
Merge pull request #75 from superagent-ai/shorthand-repo
alanzabihi Apr 21, 2026
cfbdf9e
Bootstrap commits and pushes setup files after writing them
alanzabihi Apr 21, 2026
58f8773
Improve error messages when CLI commands fail
alanzabihi Apr 21, 2026
22d59c5
Fix UTF-8 panic in stdout truncation and thread verbose through harness
alanzabihi Apr 21, 2026
27548fc
Scope staging check and commit to setup files only
alanzabihi Apr 21, 2026
8c7175a
Merge pull request #76 from superagent-ai/bootstrap-commit-setup
alanzabihi Apr 21, 2026
028d7ed
Match "http 404" prefix for 404 hint, consistent with classify_retry
alanzabihi Apr 21, 2026
5020ab8
Merge pull request #78 from superagent-ai/improve-cli-errors
alanzabihi Apr 21, 2026
c9bf2cb
Pull --rebase before commit+push in lead sync to fix non-fast-forward…
alanzabihi Apr 21, 2026
bb136e0
Merge pull request #81 from superagent-ai/fix-lead-sync-push
alanzabihi Apr 21, 2026
5684921
Add interactive confirmation gate before spawning the bootstrap agent
alanzabihi Apr 21, 2026
2d0d398
Merge pull request #77 from superagent-ai/bootstrap-confirm-gate
alanzabihi Apr 21, 2026
b1bc6bc
Close conflicting PRs as stale instead of looping forever (#80)
alanzabihi Apr 21, 2026
61b5330
Return actual outcome from execute_decision so callers report the cor…
alanzabihi Apr 21, 2026
779b709
Make execute_decision own the comment lifecycle and return the actual…
alanzabihi Apr 21, 2026
7b95f75
Restore git pull --rebase in sync_if_stale lost during rebase
alanzabihi Apr 21, 2026
8635bc5
Merge pull request #82 from superagent-ai/fix-conflicting-pr-loop
alanzabihi Apr 21, 2026
4cc894f
Bump CLI version to 0.5.2
alanzabihi Apr 21, 2026
824a55d
Merge pull request #83 from superagent-ai/release-v0.5.2
alanzabihi Apr 21, 2026
fbc5437
Bootstrap: auto-set lead/maintainer login from authenticated GitHub user
alanzabihi Apr 21, 2026
e54401c
Fix ensure_lead_login to replace config lines only, not prose matches
alanzabihi Apr 21, 2026
40fdca4
Merge pull request #84 from superagent-ai/bootstrap-auto-lead-login
alanzabihi Apr 21, 2026
edcc39e
Add 39 new e2e and scenario tests covering previously untested protoc…
alanzabihi Apr 21, 2026
ae8902e
Add 10 spec-divergence tests asserting intended behavior from cli-v2 …
alanzabihi Apr 21, 2026
1141ebf
Fix spec-divergence test descriptions to match spec text exactly
alanzabihi Apr 21, 2026
22a2649
Fix node_id mismatch in contribute_once_errors test flagged by bugbot
alanzabihi Apr 21, 2026
c67b05c
Fix metric-floor advisory to fire for higher_is_better metric direction
alanzabihi Apr 21, 2026
014d46a
Fix batch-claim and duties to allow reclaim after infra_failure release
alanzabihi Apr 21, 2026
235587f
Stop filtering submit duties from contribute blocking check
alanzabihi Apr 21, 2026
109c38b
Add #[ignore] to 4 spec-divergence tests that fail against current impl
alanzabihi Apr 21, 2026
e93ba3a
Merge pull request #91 from superagent-ai/fix-infra-reclaim
alanzabihi Apr 21, 2026
3a23cee
Merge pull request #92 from superagent-ai/fix-submit-duty-filter
alanzabihi Apr 21, 2026
5010c6c
Merge pull request #85 from superagent-ai/e2e-scenario-tests
alanzabihi Apr 21, 2026
aeb9767
Add metric_bound config key so metric-floor advisory handles all metr…
alanzabihi Apr 21, 2026
c6de965
Fix contribute loop: guard auto-submit for resolved theses and run in…
alanzabihi Apr 21, 2026
bdb860b
Narrow auto-submit guard to only check for merged PRs
alanzabihi Apr 21, 2026
e38ca8b
Merge pull request #90 from superagent-ai/fix-metric-floor-hib
alanzabihi Apr 21, 2026
f40cf4a
Merge pull request #86 from superagent-ai/fix-contribute-loop
alanzabihi Apr 21, 2026
2df5eb8
Bump version to 0.5.3
alanzabihi Apr 21, 2026
38d85f6
Merge pull request #93 from superagent-ai/bump-v0.5.3
alanzabihi Apr 21, 2026
e459e63
Recover merge failures via rebase and clean up branches on close (#97)
alanzabihi Apr 22, 2026
4939126
Add severity-based filtering to audit system so only critical finding…
alanzabihi Apr 22, 2026
1bfeb6e
Remove lead operations from contribute loop to prevent race conditions
alanzabihi Apr 22, 2026
2f822f5
Merge pull request #110 from superagent-ai/fix-contribute-lead-races
alanzabihi Apr 22, 2026
2827019
Cap rate limit retry delays at 300s and apply jitter to prevent thund…
alanzabihi Apr 22, 2026
475f98f
Merge pull request #108 from superagent-ai/audit-severity-grading
alanzabihi Apr 22, 2026
648527a
Clean up stale worktree before rebase to prevent permanent blockage
alanzabihi Apr 22, 2026
0193e50
Record post-rebase SHA in Decision comment after successful rebase
alanzabihi Apr 22, 2026
0f580c7
Replace hardcoded "main" branch with resolve_default_branch across al…
alanzabihi Apr 22, 2026
da769aa
Extract shared detect_default_branch_from_git, remove buggy current-b…
alanzabihi Apr 22, 2026
f43303d
Use upward-only jitter for server-provided delays and enforce cap as …
alanzabihi Apr 22, 2026
dae3301
Merge pull request #107 from superagent-ai/fix-merge-recovery
alanzabihi Apr 22, 2026
4e02411
Merge pull request #106 from superagent-ai/fix-hardcoded-main-branch
alanzabihi Apr 22, 2026
8da81dc
Cap secondary fallback delay after jitter to enforce MAX_RETRY_DELAY
alanzabihi Apr 22, 2026
461f1d2
Add configurable agent timeout to kill stuck subprocesses
alanzabihi Apr 22, 2026
e96f6a0
Deduplicate override logic in write_node_config via with_overrides
alanzabihi Apr 22, 2026
a21fca6
Fix bootstrap ignoring --agent-timeout; add NodeOverrides::has_any
alanzabihi Apr 22, 2026
8290fa4
Merge pull request #111 from superagent-ai/fix-rate-limit-retries
alanzabihi Apr 22, 2026
17bd72e
Merge pull request #109 from superagent-ai/agent-timeout
alanzabihi Apr 22, 2026
e988e56
Fix all rustfmt and clippy warnings across the CLI codebase
alanzabihi Apr 22, 2026
875f974
Merge pull request #112 from superagent-ai/clippy-fmt-cleanup
alanzabihi Apr 22, 2026
014ad23
Add DutyContext to decouple contribute duty checks from lead-only dut…
alanzabihi Apr 22, 2026
0b3debd
Add pre-flight validation before lead and contribute loops
alanzabihi Apr 22, 2026
1b20e6a
Merge pull request #113 from superagent-ai/fix-duty-context
alanzabihi Apr 22, 2026
7ad1d33
Merge pull request #114 from superagent-ai/preflight-validation
alanzabihi Apr 22, 2026
de2ed2a
Filter acknowledged-invalid attempts from best-metric baseline in dec…
alanzabihi Apr 22, 2026
b273239
Fix experiment metric trust boundary: prevent agent reverts and add p…
alanzabihi Apr 22, 2026
963789e
Remove dead best_accepted_metric wrapper that lost its only caller
alanzabihi Apr 22, 2026
a6f4902
Add crash cooldown to prevent tight claim-crash-release loops on stru…
alanzabihi Apr 22, 2026
2d94368
Eliminate duplicated claimable predicate in cooldown skip counter
alanzabihi Apr 22, 2026
41e0df9
Use saturating_sub for cooldown skip count to prevent underflow panic
alanzabihi Apr 22, 2026
03e5d5d
Fix prereq failure silently ignored and vacuous test assertion
alanzabihi Apr 22, 2026
49c53f0
Merge pull request #115 from superagent-ai/crash-cooldown
alanzabihi Apr 22, 2026
8102097
Remove unused poisoned_baseline_issue.json fixture and its registration
alanzabihi Apr 22, 2026
823c853
Deduplicate parse_prepare_key by reusing the public version from agen…
alanzabihi Apr 22, 2026
dbf733d
Merge pull request #116 from superagent-ai/fix-poisoned-baseline
alanzabihi Apr 22, 2026
fbc05b1
Merge remote-tracking branch 'origin/main' into fix-metric-trust
alanzabihi Apr 22, 2026
21adb41
Merge pull request #117 from superagent-ai/fix-metric-trust
alanzabihi Apr 22, 2026
4371ac9
Replace CLI orchestration loops with agent workflow prompts
alanzabihi Apr 22, 2026
323fba9
Fix silent agent failure and ignored CLI flags
alanzabihi Apr 22, 2026
44aa062
Write .polyresearch/thesis.md during claim so agents have structured …
alanzabihi Apr 22, 2026
80b8cdc
Merge pull request #127 from superagent-ai/fix-claim-thesis-md
alanzabihi Apr 22, 2026
e741f3e
Guard submit against commits outside the editable surface (#119)
alanzabihi Apr 22, 2026
68125f8
Merge pull request #128 from superagent-ai/fix-119-submit-surface-guard
alanzabihi Apr 22, 2026
8d135dc
Harden lead workflow to reliably generate theses when queue is low (#…
alanzabihi Apr 22, 2026
fd32558
Pipe workflow prompt via stdin instead of CLI argument (#123)
alanzabihi Apr 22, 2026
5bd5459
Contributor agent self-regulates parallelism via pace and capacity (#…
alanzabihi Apr 22, 2026
1cacb0d
Make lead wrapper restart agent when queue is still below min_queue_d…
alanzabihi Apr 22, 2026
7538dc9
Pipe stdout/stderr for failure diagnostics and hard-error on missing …
alanzabihi Apr 22, 2026
d309deb
Remove at-least-1 clamp from parallelism formula so overload guard works
alanzabihi Apr 22, 2026
f6c31d5
Merge pull request #130 from superagent-ai/fix-123-stdin-prompt
alanzabihi Apr 22, 2026
b7bf7db
Handle API failure in post-iteration queue check gracefully
alanzabihi Apr 22, 2026
79abc28
Explicitly set max_slots = 1 in the undersized-machine fallback
alanzabihi Apr 22, 2026
3332ea6
Merge pull request #129 from superagent-ai/fix-125-lead-queue-gen
alanzabihi Apr 22, 2026
35d60c0
Always run benchmarks sequentially; max_slots governs claiming not co…
alanzabihi Apr 22, 2026
8057cd7
Merge pull request #131 from superagent-ai/fix-pace-self-regulation
alanzabihi Apr 22, 2026
188e444
Fix scenario tests for hybrid architecture (#126)
alanzabihi Apr 22, 2026
3fcd184
Convert 3 lead decision tests from lead::run to decide_ready_prs
alanzabihi Apr 22, 2026
82d3ede
Remove dead write_node_config_with_timeout helper
alanzabihi Apr 22, 2026
cb1273a
Merge pull request #132 from superagent-ai/fix-126-scenario-tests
alanzabihi Apr 22, 2026
3327b9e
Break submit-decide infinite loop with rejection tracking and circuit…
alanzabihi Apr 22, 2026
19c4a4c
Scope rejection counting to current claim period in count_prior_rejec…
alanzabihi Apr 22, 2026
76ef5f3
Remove tautological self-seeded assertion from auto-release test
alanzabihi Apr 22, 2026
9cae33e
Remove auto-release from decide::run; duty-side circuit breaker is th…
alanzabihi Apr 22, 2026
e3c7c11
Remove unused submit_reject_loop_issue.json fixture
alanzabihi Apr 22, 2026
fde2302
Merge pull request #133 from superagent-ai/fix-105-submit-decide-loop
alanzabihi Apr 22, 2026
a62cccd
Make sync command pull before commit and push after to keep remote re…
alanzabihi Apr 22, 2026
ab8b134
Restructure sync to pull before loading ledger and push unconditionally
alanzabihi Apr 22, 2026
5333ceb
Replace bare pull --rebase with fetch/ff-only/rebase-with-abort
alanzabihi Apr 22, 2026
4974e6f
Prevent lead from generating theses that duplicate already-accepted work
alanzabihi Apr 22, 2026
8cb681b
Merge pull request #143 from superagent-ai/fix-sync-push
alanzabihi Apr 22, 2026
d67fbe4
Merge pull request #145 from superagent-ai/fix-duplicate-thesis
alanzabihi Apr 22, 2026
43a97ce
Prune worktrees for resolved/rejected theses (#140)
alanzabihi Apr 22, 2026
17fe01e
Fix typo: director(ies) → directory(ies) in prune output
alanzabihi Apr 22, 2026
0ec7aa3
Merge pull request #147 from superagent-ai/fix-stale-worktrees
alanzabihi Apr 22, 2026
ae5b91c
Stream workflow agent output in real time.
alanzabihi Apr 23, 2026
e8e08c0
Merge pull request #159 from superagent-ai/issue-120-hybrid
alanzabihi Apr 23, 2026
25996e1
Force-add polyresearch setup files during bootstrap to handle allowli…
alanzabihi Apr 22, 2026
d7cfb23
Enable GitHub Issues on forked repos during bootstrap
alanzabihi Apr 22, 2026
1fa79a3
Add ApiField enum to distinguish -f (string) from -F (typed) in gh ap…
alanzabihi Apr 22, 2026
abaa6b8
Clear active_claims on resolved theses so stale claims don't persist …
alanzabihi Apr 22, 2026
f09653b
Add bootstrap regression coverage for allowlist gitignore repos.
alanzabihi Apr 23, 2026
78cbefd
Clean up bootstrap setup files so lead starts from a clean worktree
alanzabihi Apr 23, 2026
25f04b5
Fix sync to pull and push results.tsv to origin (#134)
alanzabihi Apr 23, 2026
53f5531
Add polyresearch commit command and empty-diff guard to prevent surfa…
alanzabihi Apr 23, 2026
30faa56
Fall back to the local default branch when submit checks for diffs.
alanzabihi Apr 23, 2026
833cb18
Commit bootstrap benchmark helper files so PREPARE.md never points at…
alanzabihi Apr 23, 2026
f19b596
Update bootstrap tests for helper file commit arguments.
alanzabihi Apr 23, 2026
5ae8f13
Address bugbot review: per-file allowlist staging, protected-file sub…
alanzabihi Apr 23, 2026
dc560f8
Remove redundant submit surface checks and obsolete strip-flow tests …
alanzabihi Apr 23, 2026
2749cde
Merge pull request #161 from superagent-ai/fix-surface-strip-revert
alanzabihi Apr 23, 2026
b11855a
Merge pull request #162 from superagent-ai/issue-149-bootstrap-commit…
alanzabihi Apr 23, 2026
72f2794
Retry lead sync pushes when origin advances so results.tsv is retried…
alanzabihi Apr 23, 2026
d553dd5
Resolve the rebased sync scenario conflict so the lead sync retry cov…
alanzabihi Apr 23, 2026
b34007c
Restart sync after conflicting retry resets so results.tsv is re-deri…
alanzabihi Apr 23, 2026
630d29a
Merge pull request #164 from superagent-ai/issue-137-sync-push-retry
alanzabihi Apr 23, 2026
3b2a664
Keep auto-created node ids aligned with init so contribute cannot re-…
alanzabihi Apr 23, 2026
92c8358
Follow lead policy-pass with a decide sweep.
alanzabihi Apr 23, 2026
3fe0073
Add regression tests for resolved thesis claims.
alanzabihi Apr 23, 2026
bb8d322
Fix GitHub secondary rate limit retries and cover the pace quota path…
alanzabihi Apr 23, 2026
7ac9a69
Resume stale contributor claims before new work so claimed theses sto…
alanzabihi Apr 23, 2026
b05d828
Merge pull request #167 from superagent-ai/fix-153-lead-decide-follow…
alanzabihi Apr 23, 2026
a412a20
Merge pull request #168 from superagent-ai/fix-139-stale-claims-on-re…
alanzabihi Apr 23, 2026
549c1df
Merge pull request #170 from superagent-ai/fix-155-secondary-rate-limit
alanzabihi Apr 23, 2026
5093445
Merge hybrid-agent-cli into issue-154-contribute-resume to resolve PR…
alanzabihi Apr 23, 2026
2c2f57e
Trim HOSTNAME when auto-creating node ids so contribute identity stay…
alanzabihi Apr 23, 2026
2ed1d87
Retry lead queue refill before exiting --once so skipped generation g…
alanzabihi Apr 23, 2026
75e7ab7
Merge pull request #171 from superagent-ai/issue-125-lead-queue-refill
alanzabihi Apr 23, 2026
5fadd59
Reject duplicate thesis titles during lead generation so accepted or …
alanzabihi Apr 23, 2026
a020d7c
Treat punctuation as separators when deduplicating thesis titles.
alanzabihi Apr 23, 2026
b0dff3b
Merge hybrid-agent-cli into issue-156-duplicate-claim-node to resolve…
alanzabihi Apr 23, 2026
b4e8d20
Unify duty context and worktree setup so lead claim gates stay consis…
alanzabihi Apr 23, 2026
f687db1
Merge pull request #165 from superagent-ai/issue-138-duplicate-thesis
alanzabihi Apr 23, 2026
e04d244
Merge hybrid-agent-cli into issue-156-duplicate-claim-node to resolve…
alanzabihi Apr 23, 2026
8b52294
Merge pull request #166 from superagent-ai/issue-156-duplicate-claim-…
alanzabihi Apr 23, 2026
52a5e59
Merge hybrid-agent-cli into issue-154-contribute-resume to resolve re…
alanzabihi Apr 23, 2026
1dcaa09
Enforce the contribute --once thesis-cycle limit in Rust so workflow …
alanzabihi Apr 23, 2026
57299e7
Keep the contribute --once guard cleanup path intact when the workflo…
alanzabihi Apr 23, 2026
f16521e
Resolve the lead workflow merge conflict against hybrid-agent-cli so …
alanzabihi Apr 23, 2026
6fd5553
Merge pull request #172 from superagent-ai/fix-once-cycle-guard
alanzabihi Apr 23, 2026
d6ea711
Separate claim gating from full duties so lead claims are not blocked…
alanzabihi Apr 23, 2026
305dc9e
Merge pull request #169 from superagent-ai/issue-154-contribute-resume
alanzabihi Apr 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
618 changes: 0 additions & 618 deletions POLYRESEARCH.md

This file was deleted.

2 changes: 1 addition & 1 deletion PROGRAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ assignment_timeout: 24h
review_timeout: 12h
min_queue_depth: 5
max_queue_depth: 10
cli_version: 0.4.1
cli_version: 0.5.3

## Goal

Expand Down
102 changes: 38 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,126 +10,100 @@ Polyresearch keeps the same loop and adds three things:
2. **Complete experiment history.** Every attempt gets a row in `results.tsv` and stays as an unmerged branch: accepted, discarded, and crashed. No `git reset`, no lost code. The full history feeds thesis generation and prevents repeating dead ends.
3. **Independent verification.** Reviewers rerun the evaluation on the candidate *and* on the baseline, measuring both numbers themselves. The evaluation code lives outside the editable surface, so agents cannot grade their own homework.

## How it works

A polyresearch project is any GitHub repo with a few coordination files:

- **`PROGRAM.md`** — the research playbook. Same concept as autoresearch's [program.md](https://github.com/karpathy/autoresearch/blob/master/program.md). Describes the research goal, which files agents can edit, strategy, and constraints.
- **`PREPARE.md`** — the evaluation setup. What commands to run, how to parse the metric, what the ground truth is. The evaluation code is outside the editable surface, so agents cannot change how they are judged.
- **`POLYRESEARCH.md`** — the coordination protocol. Same for every project, like a LICENSE file. Not modified.
- **`.polyresearch/`** — the reproducible environment. Setup scripts, evaluators, frozen dependencies. Optional.

Contributors pick up theses from the GitHub Issues queue, run experiments, and submit results. Other contributors independently verify results. The lead manages the queue and merges accepted work. Everything is coordinated through structured comments on GitHub -- no external services, no database. Requires `git` and `gh`.

## Install

Two steps:

1. **Install the CLI.**

```bash
cargo install polyresearch
```

Don't have Rust? See [other install options](cli/README.md#other-install-options).

2. **Install the agent skill.** Copy `skills/polyresearch/SKILL.md` from this repo into your agent's skill directory (e.g. `~/.claude/skills/polyresearch/`, or equivalent for your agent). The skill teaches agents the full protocol -- bootstrapping, the lead loop, the contributor loop, and all CLI usage.

## Usage

Polyresearch has two agent roles: a **lead** and one or more **contributors**. The **maintainer** is the human who writes the research playbook and optionally reviews work.
Polyresearch has two roles: a **lead** and one or more **contributors**. The human who owns the repo is the **maintainer** -- they review the research playbook and optionally approve work.

### Start a new project
### 1. Bootstrap a project

Tell your lead agent to bootstrap polyresearch on any GitHub repo. The skill fetches the protocol templates, drafts `PROGRAM.md` and `PREPARE.md` by exploring the repo, and hands them to you for review.
Point it at any GitHub repo with a codebase and a metric you want to improve:

```
Bootstrap polyresearch on https://github.com/owner/repo.
You are the lead for this project.
```bash
polyresearch bootstrap https://github.com/owner/repo
```

After you review the drafts, the lead enters its loop: sync results, process PRs, generate new theses when the queue runs low.
Use `--goal` to tell the agent what you're optimizing for -- it pre-fills the Goal section of `PROGRAM.md`. Bootstrap checks whether you have push access; if not, it forks to your GitHub account automatically. See the [full flag list](cli/README.md#command-summary) for `--fork`, `--no-fork`, and other options.

### Run a contributor
This writes template files, initializes your machine as a node, and pauses for you to review before spawning the bootstrap agent. When it finishes you'll have:

Point your agent at any repo that has been bootstrapped with polyresearch:

```
Do polyresearch on https://github.com/owner/repo.
```
- `**PROGRAM.md**` -- the research playbook. Describes the goal, which files agents can edit, strategy hints. This is the only file agents read.
- `**PREPARE.md**` -- the evaluation setup. Benchmark command, metric parsing, ground truth. Lives outside the editable surface so agents can't change how they're judged.
- `**results.tsv**` -- the experiment ledger. Every attempt ever recorded.
- `**.polyresearch-node.toml**` -- your machine's identity and capacity setting. Gitignored.

The agent clones the repo, claims work from the issue queue, runs experiments, and submits results in a loop until you stop it. Launch as many contributor agents as you have machines.
Review `PROGRAM.md` and `PREPARE.md`, tweak them for your project, commit, and push.

### Hardware utilization
### 2. Run the lead

A single contributor agent working on one thesis at a time only runs one evaluation at a time. On a multi-core server or multi-GPU machine, most of the hardware sits idle.
From the root of your project (where you ran `bootstrap`):

Polyresearch can use sub-agents to keep that hardware busy. Set `capacity` in `.polyresearch-node.toml` to the percent of the total machine this project may use (default 75). `polyresearch pace` probes the machine and prints your share (cores, memory, GPUs) alongside a live-free load snapshot; the contributor divides that by each eval's resource footprint from PREPARE.md, claims that many theses via `polyresearch batch-claim --count N`, dispatches one sub-agent per worktree, and posts results as each thesis finishes. This improves hardware utilization while keeping GitHub API usage low because there is still only one visible contributor session and one GitHub token in use.
```bash
polyresearch lead
```

### Run on a remote machine
The lead syncs the results ledger, policy-checks open PRs, decides candidates (merge or reject), and generates new theses when the queue runs low. It runs in a loop until you stop it. By default, agents run with `claude -p --dangerously-skip-permissions`. Override with `--agent-command` to use a different model or flags, e.g. `--agent-command "claude -p --dangerously-skip-permissions --model sonnet"`. Use `--once` for a single iteration. See the [full flag list](cli/README.md#command-summary) for all options.

#### Pattern A: Remote evaluation over SSH
### 3. Run contributors

The contributor runs on your local machine. The experiments run on a remote server. Set up the repo, CLI, and `gh` auth on the remote, then tell your agent:
On any machine (yours, a teammate's, a rented GPU box):

```
Do polyresearch on https://github.com/owner/repo.
Run all evaluations and experiments over SSH on user@remote-host.
```bash
polyresearch contribute https://github.com/owner/repo
```

Your local machine only needs the agent; the remote server does the compute.
The contributor clones the repo, claims theses from the issue queue, spawns an agent for each one, records results, and submits PRs. Launch as many contributor machines as you want -- they all pull from the same queue. Use `--capacity` to limit how much of the machine polyresearch can use, or `--agent-command` to override the default agent. See the [full flag list](cli/README.md#command-summary) for all options.

#### Pattern B: Run the contributor on the server

This is the recommended pattern for sub-agents. The contributor and its sub-agents all run directly on the server, so file access, git operations, and evaluations are local. There is no SSH relay in the middle.
### Run on a remote machine

Use `tmux` so the session survives disconnects:
Run the contributor directly on the server so file access, git operations, and evaluations are all local. Use `tmux` so the session survives disconnects:

```bash
ssh user@remote-host
tmux new-session -s polyresearch
claude -p "Do polyresearch on https://github.com/owner/repo."
# Detach with Ctrl-B D. Reconnect with: tmux attach -t polyresearch
polyresearch contribute https://github.com/owner/repo
# Detach with Ctrl-B D
```

Detaching means the process keeps running after your SSH session closes. `tmux` creates a persistent terminal session on the server. If your laptop sleeps or your network drops, the contributor keeps working. Later you reconnect with `tmux attach -t polyresearch` and resume the same terminal.
Detach and reconnect later with `tmux attach -t polyresearch` -- the session persists even if your SSH connection drops.

## CLI

The `polyresearch` CLI handles all protocol state transitions: claiming theses, posting attempts, submitting candidates, syncing results, and more. Agents use it -- not humans. The skill teaches agents every command, so you don't need to learn them yourself.
The `polyresearch` CLI handles all coordination: claiming theses, recording attempts, submitting candidates, syncing results, deciding PRs. Agents don't need to understand the protocol. The CLI runs the protocol; agents run experiments.

Full command reference in [cli/README.md](cli/README.md).

## Design

**Protocol, not a platform.** Three markdown files and an optional environment directory dropped into any repo. No opinions on agent, model, sandbox, or language.

**Structured comments as state.** Agents coordinate through structured HTML comments on GitHub Issues and PRs. State is derived from the comment trail, not from labels or a database. Every transition is append-only and auditable.
**Agent-agnostic.** The CLI handles all coordination. Agents only need to read `PROGRAM.md`, run experiments, and report results. No opinions on model, sandbox, or language.

**Claim-based work distribution.** Theses live on GitHub Issues. Contributors claim them atomically through the CLI. Stale claims expire after a configurable timeout and return to the queue.
**Structured comments as state.** Coordination happens through structured HTML comments on GitHub Issues and PRs. State is derived from the comment trail, not from labels or a database. Every transition is append-only and auditable.

**The evaluation is the trust boundary.** `PREPARE.md` defines how results are judged. The evaluation code lives outside the editable surface. Agents cannot modify the evaluator or the scoring logic.

**Peer review.** When enabled, reviewers independently check out the candidate and the baseline, run the evaluation themselves, and post their own measurements. The lead only merges when reviewers agree.

**Human-in-the-loop.** Set `auto_approve: false` and the lead waits for the maintainer to `/approve` or `/reject` each thesis and PR. Maintainer feedback steers future thesis generation.

**Failed experiments are data.** Every attempt gets a row in `results.tsv` and stays as an unmerged branch. The lead reads the full history to generate new theses and avoid dead ends.

**Resource pacing.** Each node sets a `capacity` percentage in `.polyresearch-node.toml` (default 75). The `polyresearch pace` command probes the hardware, prints the project's share plus live load, and lets the agent pick how many theses to run in parallel given each eval's footprint. Multi-project coexistence on one machine is honor-system: set each project's `capacity` so the sum stays safe.
**Hardware utilization.** Each node sets a `capacity` percentage in `.polyresearch-node.toml` (default 75). `polyresearch pace` probes the hardware, prints the project's share plus live load, and determines how many theses to run in parallel given each eval's footprint.

## Examples


| Example | What it does |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [corewar](examples/corewar/) | Evolve a Redcode warrior against a frozen gauntlet. Free to evaluate, fast iteration, deterministic results. 218% score improvement over 27 experiments. |
| [eslint](examples/eslint/) | Optimize ESLint's core linting performance on a dual-workload benchmark. Real-world codebase, V8-level depth. Single-file linting 24% faster over 75 experiments. |
| [postcss](examples/postcss/) | Optimize PostCSS's CSS processing on a dual-workload benchmark. Plugin pipeline 16% faster over 50 experiments. |
| Example | What it does |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [corewar](examples/corewar/) | Evolve a Redcode warrior against a frozen gauntlet. Free to evaluate, fast iteration, deterministic results. 218% score improvement over 27 experiments. |
| [eslint](examples/eslint/) | Optimize ESLint's core linting performance on a dual-workload benchmark. Real-world codebase, V8-level depth. Single-file linting 24% faster over 75 experiments. |
| [postcss](examples/postcss/) | Optimize PostCSS's CSS processing on a dual-workload benchmark. Plugin pipeline 16% faster over 50 experiments. |


## License

MIT

By Superagent Technologies, Inc.
By Superagent Technologies, Inc.
Loading