Skip to content

Commit 0908f8b

Browse files
authored
feat(remote): add Cloudflare archive mode
* chore: add autoreview skill * chore(deps): use crawlkit remote archive APIs * feat(remote): add Cloudflare archive read mode * feat(remote): publish archives to cloud worker * feat(remote): add github login flow * feat(remote): support github token login bootstrap * docs(remote): clarify worker deployment ownership * chore(remote): use crawlkit v0.8.0 * test(remote): cover cloud archive paths * fix(remote): bound cloud integer conversions * fix(remote): avoid cloud integer downcasts
1 parent b7bf40e commit 0908f8b

20 files changed

Lines changed: 3526 additions & 30 deletions

.agents/skills/autoreview/SKILL.md

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
---
2+
name: autoreview
3+
description: "Auto Review closeout. Codex review is the default when no engine is set and is the recommended reviewer."
4+
---
5+
6+
# Auto Review
7+
8+
Run the bundled structured review helper as a closeout check. This is code review, not Guardian `auto_review` approval routing.
9+
10+
Codex review is the default when no engine is set. It usually delivers the best review results and should remain the normal final closeout engine.
11+
12+
Use when:
13+
14+
- user asks for Codex review / Claude review / autoreview / second-model review
15+
- after non-trivial code edits, before final/commit/ship
16+
- reviewing a local branch or PR branch after fixes
17+
18+
## Contract
19+
20+
- Treat review output as advisory. Never blindly apply it.
21+
- Verify every finding by reading the real code path and adjacent files.
22+
- Read dependency docs/source/types when the finding depends on external behavior.
23+
- Reject unrealistic edge cases, speculative risks, broad rewrites, and fixes that over-complicate the codebase.
24+
- Prefer small fixes at the right ownership boundary; no refactor unless it clearly improves the bug class.
25+
- Keep going until structured review returns no accepted/actionable findings.
26+
- If a review-triggered fix changes code, rerun focused tests and rerun the structured review helper.
27+
- For security-audit suppression changes, verify accepted findings remain auditable: suppressed findings stay in structured output, active output keeps an unsuppressible suppression notice, and aggregate findings cannot hide unrelated active risk.
28+
- Never switch or override the requested review engine/model. If the review hits model capacity, retry the same command a few times with the same engine/model.
29+
- Be patient with large bundles. Structured review can take up to 30 minutes while the model call is active, especially with Codex tools or web search.
30+
- Treat heartbeat lines like `review still running: ... elapsed=... pid=...` as healthy progress, not a hang. Let the helper continue while heartbeats are advancing. Pass `--stream-engine-output` when live engine text is useful; Codex and Claude filter tool/file chatter, other engines pass raw output through.
31+
- Do not kill a review just because it has been quiet for 2-5 minutes, or because it is still running under the 30-minute window. Inspect the process only after missing multiple expected heartbeats, after 30 minutes, or after an obviously failed subprocess; prefer letting the same helper command finish.
32+
- Tools are useful in review mode. The helper allows read-only inspection tools and web search by default so reviewers can check dependency contracts, upstream docs, and current behavior.
33+
- Security perspective is always included, but it should not cripple legitimate functionality. Report security findings only when the change creates a concrete, actionable risk or removes an important safety check.
34+
- For regression provenance, if no blamed PR is traceable, use the blamed commit as the provenance: commit SHA, date, and author username. Do not guess a merger or frame missing PR metadata as a separate finding.
35+
- Do not invoke built-in `codex review`, nested reviewers, or reviewer panels from inside the review. The helper builds one bundle, calls one selected engine, validates one structured result, and stops.
36+
- Stop as soon as the helper exits 0 with no accepted/actionable findings. Do not run an extra review just to get a nicer "clean" line, a second opinion, or clearer closeout wording.
37+
- Treat the helper's successful exit plus absence of actionable findings as the clean review result, even if the underlying Codex CLI output is terse.
38+
- Multi-reviewer panels are opt-in only. Use them when explicitly requested or when risk justifies the extra spend; the main agent still verifies every accepted finding before fixing.
39+
- If rejecting a finding as intentional/not worth fixing, add a brief inline code comment only when it explains a real invariant or ownership decision that future reviewers should know.
40+
- If `gh`/Gitcrawl reports `database disk image is malformed`, run `gitcrawl doctor --json` once to let the portable cache repair before retrying review; do not bypass the shim unless repair fails and freshness requires live GitHub.
41+
- If Gitcrawl reports a portable manifest mismatch, source/runtime DB health error, or stale portable-store checkout, run `gitcrawl doctor --json` and inspect `source_db_health`, `runtime_db_health`, and `portable_store_status` before falling back to live GitHub.
42+
- Do not push just to review. Push only when the user requested push/ship/PR update.
43+
44+
## Pick Target
45+
46+
Dirty local work:
47+
48+
```bash
49+
<autoreview-helper> --mode local
50+
```
51+
52+
Use this only when the patch is actually unstaged/staged/untracked in the
53+
current checkout. For committed, pushed, or PR work, point the helper at the commit
54+
or branch diff instead; do not force `--mode local` / `--uncommitted` just
55+
because the helper docs mention dirty work first. A clean local review
56+
only proves there is no local patch.
57+
58+
Branch/PR work:
59+
60+
```bash
61+
<autoreview-helper> --mode branch --base origin/main
62+
```
63+
64+
Optional review context is first-class:
65+
66+
```bash
67+
<autoreview-helper> --mode branch --base origin/main --prompt-file /tmp/review-notes.md --dataset /tmp/evidence.json
68+
```
69+
70+
If an open PR exists, use its actual base:
71+
72+
```bash
73+
base=$(gh pr view --json baseRefName --jq .baseRefName)
74+
<autoreview-helper> --mode branch --base "origin/$base"
75+
```
76+
77+
Committed single change:
78+
79+
```bash
80+
<autoreview-helper> --mode commit --commit HEAD
81+
```
82+
83+
or with the helper:
84+
85+
```bash
86+
/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode commit --commit HEAD
87+
```
88+
89+
Use commit review for already-landed or already-pushed work on `main`. Reviewing
90+
clean `main` against `origin/main` is usually an empty diff after push. For a
91+
small stack, review each commit explicitly or review the branch before merging
92+
with `--base`.
93+
94+
## Parallel Closeout
95+
96+
Format first if formatting can change line locations. Then it is OK to run tests and review in parallel:
97+
98+
```bash
99+
scripts/autoreview --parallel-tests "<focused test command>"
100+
```
101+
102+
Tradeoff: tests may force code changes that stale the review. If tests or review lead to code edits, rerun the affected tests and rerun review until no accepted/actionable findings remain. Once that rerun exits cleanly, stop; do not spend another long review cycle on redundant confirmation.
103+
104+
## Review Panels
105+
106+
Run multiple reviewers against one frozen bundle:
107+
108+
```bash
109+
<autoreview-helper> --reviewers codex,claude
110+
```
111+
112+
`--panel` is shorthand for Codex plus Claude unless `--engine` changes the first reviewer:
113+
114+
```bash
115+
<autoreview-helper> --panel
116+
```
117+
118+
Set reviewer models and thinking/effort explicitly:
119+
120+
```bash
121+
<autoreview-helper> --reviewers codex,claude --model codex=gpt-5.1 --thinking codex=high --model claude=sonnet --thinking claude=max
122+
```
123+
124+
Inline syntax is also supported:
125+
126+
```bash
127+
<autoreview-helper> --reviewers codex:gpt-5.1:high,claude:sonnet:max
128+
```
129+
130+
Codex maps thinking to `model_reasoning_effort` and accepts `low`, `medium`,
131+
`high`, or `xhigh`. Claude maps thinking to `--effort` and also accepts `max`.
132+
Engines without a real thinking knob reject `--thinking`.
133+
134+
## Context Efficiency
135+
136+
Run the helper directly so target selection, engine choice, structured validation, and exit status all stay in one path. If output is noisy, summarize the completed helper output after it returns; do not ask another agent or reviewer to rerun the review.
137+
138+
## Helper
139+
140+
OpenClaw repo-local helper:
141+
142+
```bash
143+
.agents/skills/autoreview/scripts/autoreview --help
144+
```
145+
146+
`agent-scripts` checkout helper:
147+
148+
```bash
149+
skills/autoreview/scripts/autoreview --help
150+
```
151+
152+
Global helper from `agent-scripts`:
153+
154+
```bash
155+
~/.codex/skills/agent-scripts/autoreview/scripts/autoreview --help
156+
```
157+
158+
If installed from `agent-scripts`, path is:
159+
160+
```bash
161+
/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --help
162+
```
163+
164+
The helper:
165+
166+
- chooses dirty local changes first
167+
- otherwise uses current PR base if `gh pr view` works
168+
- otherwise uses `origin/main` for non-main branches
169+
- supports `--engine codex`, `claude`, `droid`, and `copilot`; default is `AUTOREVIEW_ENGINE` or `codex`; Codex should remain the default when nothing is set
170+
- use `--mode commit --commit <ref>` for already-committed work, especially clean `main` after landing
171+
- should be left in `--mode auto` or forced to `--mode branch` for PR/branch work; do not force `--mode local` after committing
172+
- writes only to stdout unless `--output`, `--json-output`, or live streamed engine stderr is set
173+
- supports `--dry-run`, `--parallel-tests`, `--prompt`, `--prompt-file`, `--dataset`, `--no-tools`, `--no-web-search`, and commit refs
174+
- supports `--stream-engine-output` or `AUTOREVIEW_STREAM_ENGINE_OUTPUT=1` for live engine text while preserving structured validation; Codex and Claude hide tool/file event details, emit compact activity summaries, and report usage at turn completion
175+
- supports opt-in review panels with `--panel` / `--reviewers`, plus per-engine `--model` and `--thinking`
176+
- allows read-only tools and web search by default where the selected CLI supports them; forbids nested review in the prompt; Codex is run through `codex exec` with read-only sandbox and structured output
177+
- prints `review still running: <engine> elapsed=<seconds>s pid=<pid>` to stderr at long-running intervals while waiting for the selected review engine, unless streamed output or compact Codex activity has been visible recently
178+
- prints `autoreview clean: no accepted/actionable findings reported` when the selected review command exits 0
179+
- exits nonzero when accepted/actionable findings are present
180+
181+
## Final Report
182+
183+
Include:
184+
185+
- review command used
186+
- tests/proof run
187+
- findings accepted/rejected, briefly why
188+
- the clean review result from the final helper/review run, or why a remaining finding was consciously rejected
189+
190+
Do not run another review solely to improve the final report wording. If the final helper run exited 0 and produced no accepted/actionable findings, report that exact run as clean.

0 commit comments

Comments
 (0)