rebuttalflow 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rebuttalflow-0.3.0/LICENSE +21 -0
- rebuttalflow-0.3.0/PKG-INFO +200 -0
- rebuttalflow-0.3.0/README.md +175 -0
- rebuttalflow-0.3.0/pyproject.toml +52 -0
- rebuttalflow-0.3.0/setup.cfg +4 -0
- rebuttalflow-0.3.0/src/rebuttalflow/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/adapters/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/adapters/claude_json.py +131 -0
- rebuttalflow-0.3.0/src/rebuttalflow/adapters/codex_json.py +136 -0
- rebuttalflow-0.3.0/src/rebuttalflow/adapters/process.py +164 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/inspector.py +313 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/inspector_assets/icons.svg +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/inspector_assets/index.html +7 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/inspector_assets/inspector.css +8 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/inspector_assets/inspector.js +40 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/inspector_assets/mark.svg +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/main.py +648 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/onboarding.py +99 -0
- rebuttalflow-0.3.0/src/rebuttalflow/cli/resources/SKILL.md +27 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/battle_map.py +223 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/brief.py +182 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/feedback.py +142 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/metrics.py +322 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/project.py +163 -0
- rebuttalflow-0.3.0/src/rebuttalflow/controller/redteam.py +41 -0
- rebuttalflow-0.3.0/src/rebuttalflow/mcp/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/mcp/server.py +124 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/feedback.py +24 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/issue.py +33 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/metric.py +26 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/recon.py +28 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/response.py +25 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/review.py +48 -0
- rebuttalflow-0.3.0/src/rebuttalflow/models/workspace.py +95 -0
- rebuttalflow-0.3.0/src/rebuttalflow/orchestrator/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/orchestrator/blind.py +78 -0
- rebuttalflow-0.3.0/src/rebuttalflow/orchestrator/native.py +204 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/assets/KaTeX-LICENSE.txt +21 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/assets/katex.min.js +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/assets/math.js +34 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/assets/pack.css +24 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/assets/pack.js +39 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/export.py +122 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/render.py +34 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/drafting/share_html.py +187 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/ingestion/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/ingestion/openreview.py +216 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/ingestion/text.py +359 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/linters/__init__.py +147 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/linters/anonymity.py +23 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/linters/consistency.py +64 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/linters/openreview_syntax.py +83 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/linters/squeezer.py +40 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/recon/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/recon/extractor.py +24 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/recon/fetcher.py +271 -0
- rebuttalflow-0.3.0/src/rebuttalflow/outer_loop/recon/store.py +110 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/__init__.py +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/atomic_io.py +27 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/errors.py +38 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/event_log.py +60 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/impact.py +5 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/locking.py +22 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/machines.py +48 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/projection.py +79 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/snapshot.py +117 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/staleness.py +5 -0
- rebuttalflow-0.3.0/src/rebuttalflow/state/workspace.py +70 -0
- rebuttalflow-0.3.0/src/rebuttalflow.egg-info/PKG-INFO +200 -0
- rebuttalflow-0.3.0/src/rebuttalflow.egg-info/SOURCES.txt +109 -0
- rebuttalflow-0.3.0/src/rebuttalflow.egg-info/dependency_links.txt +1 -0
- rebuttalflow-0.3.0/src/rebuttalflow.egg-info/entry_points.txt +3 -0
- rebuttalflow-0.3.0/src/rebuttalflow.egg-info/requires.txt +13 -0
- rebuttalflow-0.3.0/src/rebuttalflow.egg-info/top_level.txt +1 -0
- rebuttalflow-0.3.0/tests/test_author_journey.py +198 -0
- rebuttalflow-0.3.0/tests/test_invitation_budget.py +65 -0
- rebuttalflow-0.3.0/tests/test_response_plan.py +59 -0
- rebuttalflow-0.3.0/tests/test_review_scales.py +116 -0
- rebuttalflow-0.3.0/tests/test_v03_blind_rubric.py +41 -0
- rebuttalflow-0.3.0/tests/test_v03_brief_scope.py +96 -0
- rebuttalflow-0.3.0/tests/test_v03_commonmark_preflight.py +33 -0
- rebuttalflow-0.3.0/tests/test_v03_coverage.py +83 -0
- rebuttalflow-0.3.0/tests/test_v03_deadline.py +94 -0
- rebuttalflow-0.3.0/tests/test_v03_draft_guard.py +71 -0
- rebuttalflow-0.3.0/tests/test_v03_draft_history.py +86 -0
- rebuttalflow-0.3.0/tests/test_v03_e2e_rebuttal_week.py +101 -0
- rebuttalflow-0.3.0/tests/test_v03_explain_battle_map.py +50 -0
- rebuttalflow-0.3.0/tests/test_v03_feedback.py +106 -0
- rebuttalflow-0.3.0/tests/test_v03_feedback_anchors.py +69 -0
- rebuttalflow-0.3.0/tests/test_v03_inspector.py +140 -0
- rebuttalflow-0.3.0/tests/test_v03_kernel.py +139 -0
- rebuttalflow-0.3.0/tests/test_v03_link_free_preflight.py +54 -0
- rebuttalflow-0.3.0/tests/test_v03_metric_scope.py +53 -0
- rebuttalflow-0.3.0/tests/test_v03_metrics.py +114 -0
- rebuttalflow-0.3.0/tests/test_v03_native.py +275 -0
- rebuttalflow-0.3.0/tests/test_v03_openreview_import.py +303 -0
- rebuttalflow-0.3.0/tests/test_v03_preflight.py +180 -0
- rebuttalflow-0.3.0/tests/test_v03_recon.py +213 -0
- rebuttalflow-0.3.0/tests/test_v03_reference_note.py +31 -0
- rebuttalflow-0.3.0/tests/test_v03_reference_queries.py +55 -0
- rebuttalflow-0.3.0/tests/test_v03_review_import.py +27 -0
- rebuttalflow-0.3.0/tests/test_v03_setup.py +48 -0
- rebuttalflow-0.3.0/tests/test_v03_share_targets.py +75 -0
- rebuttalflow-0.3.0/tests/test_v03_shared_sync.py +33 -0
- rebuttalflow-0.3.0/tests/test_v03_squeeze_evidence.py +75 -0
- rebuttalflow-0.3.0/tests/test_v03_target_export.py +90 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zhoujun Ye
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rebuttalflow
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Lightweight, local-first rebuttal workspace & MCP for Claude Code, Codex & Cursor — cross-session memory, live experiment metrics, citation recon, OpenReview preflight & offline advisor review.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://zhoujun-ye.github.io/RebuttalFlow/
|
|
7
|
+
Project-URL: Repository, https://github.com/Zhoujun-Ye/RebuttalFlow
|
|
8
|
+
Project-URL: Issues, https://github.com/Zhoujun-Ye/RebuttalFlow/issues
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: pydantic<3,>=2
|
|
13
|
+
Requires-Dist: typer<0.30,>=0.29
|
|
14
|
+
Requires-Dist: pyyaml>=6
|
|
15
|
+
Requires-Dist: filelock>=3.13
|
|
16
|
+
Requires-Dist: markdown-it-py<5,>=3
|
|
17
|
+
Requires-Dist: mdit-py-plugins<1,>=0.5
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
21
|
+
Requires-Dist: ruff; extra == "dev"
|
|
22
|
+
Requires-Dist: mypy; extra == "dev"
|
|
23
|
+
Requires-Dist: types-PyYAML; extra == "dev"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
<div align="center">
|
|
27
|
+
|
|
28
|
+
# RebuttalFlow
|
|
29
|
+
|
|
30
|
+
**Lightweight, local-first rebuttal workspace & MCP for Claude Code, Codex, and Cursor.**<br>
|
|
31
|
+
Connect every reviewer question to live experiment results, exact posting limits, and offline advisor review — without losing context across sessions.
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
<a href="https://zhoujun-ye.github.io/RebuttalFlow/"><strong>Project Page</strong></a> ·
|
|
35
|
+
<a href="https://zhoujun-ye.github.io/RebuttalFlow/review-demo.html"><strong>Live Advisor Pack Demo</strong></a> ·
|
|
36
|
+
<a href="#quickstart"><strong>Quickstart</strong></a> ·
|
|
37
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/cli-guide.md"><strong>CLI Guide</strong></a> ·
|
|
38
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/author-response-guide.md"><strong>Author Guide</strong></a> ·
|
|
39
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/README.zh-CN.md"><strong>中文</strong></a>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p>
|
|
43
|
+
<img alt="Python 3.11+" src="https://img.shields.io/badge/Python-3.11%2B-24624f?style=flat-square">
|
|
44
|
+
<img alt="MCP Native" src="https://img.shields.io/badge/MCP-10%20Tools-306c5c?style=flat-square">
|
|
45
|
+
<img alt="Local First" src="https://img.shields.io/badge/Local--First-.rebuttal%2F-49534d?style=flat-square">
|
|
46
|
+
<img alt="Zero Embedded LLM SDK" src="https://img.shields.io/badge/LLM%20SDK-None%20Required-5b6861?style=flat-square">
|
|
47
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/License-MIT-24624f?style=flat-square"></a>
|
|
48
|
+
</p>
|
|
49
|
+
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
<p align="center">
|
|
55
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/assets/rebuttalflow-features.png">
|
|
56
|
+
<img src="https://raw.githubusercontent.com/Zhoujun-Ye/RebuttalFlow/main/docs/assets/rebuttalflow-features.png" alt="RebuttalFlow end-to-end feature map: cross-session brief, question triage, live CSV metric sync, safe compression, three-pane review desk, and offline advisor annotations" width="100%">
|
|
57
|
+
</a>
|
|
58
|
+
<br>
|
|
59
|
+
<sub>Full workflow from initial reviews to final local export · <a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/assets/rebuttalflow-features.excalidraw">Editable Excalidraw source</a></sub>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
## Why RebuttalFlow?
|
|
63
|
+
|
|
64
|
+
Strong coding agents rarely fabricate numbers out of thin air anymore. What actually breaks during a stressful 7-day conference rebuttal is **cross-session amnesia, shifting experiment tables, brutal character limits, and messy advisor handoffs**:
|
|
65
|
+
|
|
66
|
+
> When a late rerun drops from **78.4%** to **70.0%** — crossing below a **72.6%** baseline — updating the number is not enough. Two reviewer letters cite that experiment, and both conclusions now need a second look. RebuttalFlow refreshes every bound value and table together and flags the affected drafts for the author to revisit. *(See the [reproducible synthetic example](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/examples/lightweight_workspace_demo/README.md#replay-a-changed-experiment).)*
|
|
67
|
+
|
|
68
|
+
| Pain point during a 7-day rebuttal | Plain coding agent chat | Coding agent + **RebuttalFlow** |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| **Multi-day / multi-window sessions** | Re-paste reviews and re-explain progress every morning | **`rebuttal brief`** restores open issues, stances, deadlines & char budgets in one call |
|
|
71
|
+
| **Missing papers cited by reviewers** | Manually hunt arXiv, check publication dates & GitHub repos | **`rebuttal recon`** extracts named papers, checks contemporaneous dates & public code |
|
|
72
|
+
| **Late reruns & new seeds** | Hunt and edit hardcoded numbers across Common, R1, and R3 | **`rebuttal metric sync`** updates `{{metric:...}}` / `{{table:...}}` everywhere & flags drift |
|
|
73
|
+
| **OpenReview character limits** | LLMs miscount chars or silently drop key baselines when shortening | **Full draft first + `compress-check`** verifies exact UTF-16 length & locked facts |
|
|
74
|
+
| **Advisor & co-author review** | Trade messy Word/WeChat notes and translate them back to the agent | **`rebuttal share`** exports a single offline HTML file; annotations import cleanly back to the agent |
|
|
75
|
+
| **Submission safety** | Spot-check `\cite{}`, broken tables, or identity leaks by eye | **`rebuttal check`** catches syntax bugs, anonymity leaks, missing answers & cross-reply drift |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Core Features
|
|
80
|
+
|
|
81
|
+
### 1. Cross-Session Memory (`rebuttal brief`)
|
|
82
|
+
Open a fresh Claude Code, Codex, or Cursor session on Day 4 and restore the entire rebuttal state immediately — pending high-leverage issues, reviewer stances, remaining character budgets, synced metric alerts, and open advisor comments — without re-pasting yesterday's chat.
|
|
83
|
+
|
|
84
|
+
### 2. Citation Recon & Priority Map (`rebuttal recon` · `rebuttal map`)
|
|
85
|
+
- **Citation Recon**: Extracts papers mentioned in reviews and queries public metadata (arXiv / Semantic Scholar / GitHub, with `--offline` mode) to track abstracts, contemporaneous publication dates, and official code repositories under `.rebuttal/refs/`.
|
|
86
|
+
- **ROI Priority Map**: Groups overlapping reviewer concerns (`overlap_group`) and ranks work into four actionable buckets — *PDF-grounded clarifications*, *shared high-leverage experiments*, *citation comparisons*, and *scope boundaries* — so one experiment can answer multiple reviewers.
|
|
87
|
+
|
|
88
|
+
### 3. Live CSV / JSON Metric Binding (`rebuttal metric bind` · `sync`)
|
|
89
|
+
Bind local experiment outputs (`.csv` or `.json`) as live `MetricCard`s and embed `{{metric:M1.ours_acc:.2f}}` or `{{table:M1}}` in your response templates. Whenever a script finishes a new seed or baseline, `rebuttal metric sync` refreshes every linked reply automatically and flags claim-strength drift for human review.
|
|
90
|
+
|
|
91
|
+
### 4. Write Full, Compress Safely & Pre-Flight Check (`rebuttal check` · `review compress-check`)
|
|
92
|
+
- **Evidence-first drafting**: Inspect every reviewer's verbatim questions and linked evidence with `rebuttal review plan R1`, save the complete response first, and test shorter candidates via `review compress-check` without overwriting the full draft.
|
|
93
|
+
- **Deterministic pre-flight**: Verifies exact **UTF-16 OpenReview character counts** per posting form (`review check-message`), preserves `locked_spans`, catches leftover LaTeX macros (`\cite{}`, `\ref{}`, unbalanced `$`, broken Markdown tables), scans for **anonymity leaks** (emails, local paths, personal GitHub links, custom `forbidden_terms`), and checks coverage and cross-reply consistency.
|
|
94
|
+
|
|
95
|
+
### 5. Three-Pane Review Desk & Offline Advisor Pack (`rebuttal ui` · `share` · `feedback`)
|
|
96
|
+
- **Local Review Desk (`rebuttal ui`)**: A zero-Node, loopback-only three-pane workspace showing reviews + frozen submission PDF links on the left, live-rendered replies with metric hover cards and character budget bars in the middle, and passage-level feedback (plus optional local CLI agent suggestions) on the right.
|
|
97
|
+
- **Offline Advisor Pack (`rebuttal share`)**: Generates a **standalone, zero-network HTML file** ([preview the public demo](https://zhoujun-ye.github.io/RebuttalFlow/review-demo.html)) you can send over Slack, WeChat, or email. Your advisor highlights passages, writes inline comments, and exports `advisor-comments.json` — import it via `rebuttal feedback import` and let your agent apply every note cleanly.
|
|
98
|
+
|
|
99
|
+
### 6. Blinded Red-Team & Multi-Round Discussion (`redteam` · `review add-followup` · `thread`)
|
|
100
|
+
- **Blinded Critique (`rebuttal redteam prepare`)**: Builds a strict whitelist critique packet containing only the frozen PDF reference, original review, and rendered reply — stripping internal notes and chat history to fight model sycophancy.
|
|
101
|
+
- **Multi-Round Discussions**: Append later reviewer questions without reinitializing (`rebuttal review add-followup R1 note.txt`) and inspect local authorized forum threads (`rebuttal review thread R1 forum.json`).
|
|
102
|
+
- **Local Export Only (`rebuttal export`)**: Exports clean per-reviewer `.md` files or a `one-page-tex` skeleton. No OpenReview write credentials, no accidental posting — **only the author submits**.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Recorded Walkthrough
|
|
107
|
+
|
|
108
|
+
<p align="center">
|
|
109
|
+
<img src="https://raw.githubusercontent.com/Zhoujun-Ye/RebuttalFlow/main/docs/assets/review-walkthrough.gif" alt="Recorded workflow: restore a brief, triage evidence, sync a table, check a draft and import advisor feedback" width="92%">
|
|
110
|
+
<br>
|
|
111
|
+
<sub>End-to-end local run: restore brief → triage & bind CSV → sync rerun drift → check & compress → import advisor feedback</sub>
|
|
112
|
+
</p>
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Quickstart
|
|
117
|
+
|
|
118
|
+
Requires **Python 3.11+** (no Node runtime, external database, or embedded LLM API key needed).
|
|
119
|
+
|
|
120
|
+
With [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, run this in the directory containing your `reviews.md` (use headings such as `# R1`, `# R2`). No repository checkout is needed:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
uvx rebuttalflow init reviews.md --client claude
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
For Codex or Cursor, use `--client codex` or `--client cursor`. This installs the MCP configuration and Skill **only in this project**. Add `--pdf submission.pdf` to register your frozen submission. No reviews handy? [Open the advisor demo](https://zhoujun-ye.github.io/RebuttalFlow/review-demo.html) or [run the synthetic walkthrough](https://github.com/Zhoujun-Ye/RebuttalFlow/tree/main/examples/lightweight_workspace_demo).
|
|
127
|
+
|
|
128
|
+
Then reopen your coding agent in that directory and paste:
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
Read the reviews, split their questions and link my results. Show R1's response plan, then draft a numbered reply with the matched baseline and measured result for each empirical question. Save the full evidence draft first; only then shorten it to the posting limit. Do not submit.
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Everyday commands across the rebuttal week:**
|
|
135
|
+
|
|
136
|
+
Use `uvx rebuttalflow` in place of `rebuttal`, or install the persistent shortcut once with `uv tool install rebuttalflow`. Both the local desk and the single-file advisor pack render `$...$` and `$$...$$` with bundled KaTeX; no CDN, web fonts, or Node runtime is needed.
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
rebuttal brief # Day 2+: restore compact state in a new session
|
|
140
|
+
rebuttal recon run --offline # Extract cited missing papers (drop --offline to query public metadata)
|
|
141
|
+
rebuttal map # View 4-bucket ROI priority map
|
|
142
|
+
rebuttal review plan R1 # Inspect R1's verbatim questions & linked evidence
|
|
143
|
+
rebuttal metric sync # Refresh all bound drafts after an experiment rerun
|
|
144
|
+
rebuttal check # Exact char limit, syntax, anonymity, coverage & drift check
|
|
145
|
+
rebuttal share --out review-pack.html # Export standalone offline HTML for advisor annotations
|
|
146
|
+
rebuttal feedback import advisor-notes.json # Bring advisor comments back for your agent
|
|
147
|
+
rebuttal review add-followup R1 note.txt # Append round-2 reviewer questions without reinitializing
|
|
148
|
+
rebuttal export --format openreview # Export clean local Markdown (or --format one-page-tex)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
<details>
|
|
154
|
+
<summary><strong>Reference: CLI Commands, 10 MCP Tools & <code>.rebuttal/</code> Layout</strong></summary>
|
|
155
|
+
|
|
156
|
+
### Top-Level CLI Commands
|
|
157
|
+
| Command | Purpose |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
| `rebuttal init` | Initialize `.rebuttal/`, import reviews, register frozen PDF & optional `--client` MCP/Skill |
|
|
160
|
+
| `rebuttal setup` | Preview or write project-local MCP config & thin Skill (`codex` / `claude` / `cursor`) |
|
|
161
|
+
| `rebuttal brief` | Emit a compact cross-session status brief (`--json` or Markdown) |
|
|
162
|
+
| `rebuttal map` | Rank concerns across 4 ROI buckets (`pdf_refute`, `experiments`, `citation_clarify`, `boundaries`) |
|
|
163
|
+
| `rebuttal recon` | `run` / `list` / `add` missing paper metadata & public code lookups |
|
|
164
|
+
| `rebuttal metric` | `bind` / `sync` / `list` local CSV/JSON result cards & live table bindings |
|
|
165
|
+
| `rebuttal review` | `plan` / `add-followup` / `thread` / `check-message` / `compress-check` |
|
|
166
|
+
| `rebuttal check` | Deterministic pre-flight check (UTF-16 chars, locked spans, syntax, anonymity, coverage, drift) |
|
|
167
|
+
| `rebuttal ui` | Launch loopback three-pane review desk (`--enable-agent-bridge` for optional local CLI edits) |
|
|
168
|
+
| `rebuttal share` | Export offline advisor HTML pack (paired with `feedback import/list/resolve` & `redteam prepare/run`) |
|
|
169
|
+
| `rebuttal export` | Export checked local replies (`openreview` Markdown or `one-page-tex`) |
|
|
170
|
+
|
|
171
|
+
### 10 MCP Tools Exposed to Coding Agents
|
|
172
|
+
`rebuttal_brief` · `get_context` · `upsert_issues` · `get_battle_map` · `recon_references` · `bind_metric` · `sync_metrics` · `save_draft` · `check_preflight` · `manage_feedback`
|
|
173
|
+
|
|
174
|
+
### Local `.rebuttal/` Directory Structure
|
|
175
|
+
```text
|
|
176
|
+
.rebuttal/
|
|
177
|
+
├── config.yaml # Venue limits, deadline, submission date, frozen_pdf_path, forbidden_terms
|
|
178
|
+
├── state/
|
|
179
|
+
│ ├── events.jsonl # Append-only audit log (replayable via `rebuttal state rebuild`)
|
|
180
|
+
│ └── snapshot.json # Atomic state projection
|
|
181
|
+
├── reviews/raw_snapshot.json # Immutable original reviews & follow-ups
|
|
182
|
+
├── refs/ # Citation recon index & per-paper Markdown cards
|
|
183
|
+
├── metrics/ # Bound CSV/JSON MetricCards & rendered tables
|
|
184
|
+
├── drafts/ # Full templates (*.tmpl.md) & rendered outputs (*.rendered.md)
|
|
185
|
+
└── feedback/ # Advisor annotations & blinded red-team findings
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
|
|
190
|
+
## Safety & Design Boundaries
|
|
191
|
+
|
|
192
|
+
- **File-first & transparent**: All state lives in `.rebuttal/` as plain JSON, JSONL, YAML, and Markdown. Frozen submission PDFs and verbatim review quotes are treated as read-only untrusted data.
|
|
193
|
+
- **No lock-in**: Runs locally as a CLI and review desk even without an agent. Tune venue limits, deadlines, submission dates, and anonymity `forbidden_terms` in `.rebuttal/config.yaml`.
|
|
194
|
+
- **Privacy & control**: Online citation recon only sends reference titles/IDs to public APIs (use `--offline` anytime). Final replies are exported locally — RebuttalFlow never posts to OpenReview on your behalf.
|
|
195
|
+
|
|
196
|
+
## Documentation & Contributing
|
|
197
|
+
|
|
198
|
+
- [CLI Guide](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/cli-guide.md) · [Author Response Guide](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/author-response-guide.md) · [v0.3 Design Spec](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/design/lightweight-agent-exoskeleton-v0.3.md) · [All Docs](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/README.md)
|
|
199
|
+
- Development & verification instructions live in [CONTRIBUTING.md](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/CONTRIBUTING.md) and [AGENTS.md](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/AGENTS.md).
|
|
200
|
+
- Released under the [MIT License](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/LICENSE).
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# RebuttalFlow
|
|
4
|
+
|
|
5
|
+
**Lightweight, local-first rebuttal workspace & MCP for Claude Code, Codex, and Cursor.**<br>
|
|
6
|
+
Connect every reviewer question to live experiment results, exact posting limits, and offline advisor review — without losing context across sessions.
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<a href="https://zhoujun-ye.github.io/RebuttalFlow/"><strong>Project Page</strong></a> ·
|
|
10
|
+
<a href="https://zhoujun-ye.github.io/RebuttalFlow/review-demo.html"><strong>Live Advisor Pack Demo</strong></a> ·
|
|
11
|
+
<a href="#quickstart"><strong>Quickstart</strong></a> ·
|
|
12
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/cli-guide.md"><strong>CLI Guide</strong></a> ·
|
|
13
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/author-response-guide.md"><strong>Author Guide</strong></a> ·
|
|
14
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/README.zh-CN.md"><strong>中文</strong></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p>
|
|
18
|
+
<img alt="Python 3.11+" src="https://img.shields.io/badge/Python-3.11%2B-24624f?style=flat-square">
|
|
19
|
+
<img alt="MCP Native" src="https://img.shields.io/badge/MCP-10%20Tools-306c5c?style=flat-square">
|
|
20
|
+
<img alt="Local First" src="https://img.shields.io/badge/Local--First-.rebuttal%2F-49534d?style=flat-square">
|
|
21
|
+
<img alt="Zero Embedded LLM SDK" src="https://img.shields.io/badge/LLM%20SDK-None%20Required-5b6861?style=flat-square">
|
|
22
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/License-MIT-24624f?style=flat-square"></a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/assets/rebuttalflow-features.png">
|
|
31
|
+
<img src="https://raw.githubusercontent.com/Zhoujun-Ye/RebuttalFlow/main/docs/assets/rebuttalflow-features.png" alt="RebuttalFlow end-to-end feature map: cross-session brief, question triage, live CSV metric sync, safe compression, three-pane review desk, and offline advisor annotations" width="100%">
|
|
32
|
+
</a>
|
|
33
|
+
<br>
|
|
34
|
+
<sub>Full workflow from initial reviews to final local export · <a href="https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/assets/rebuttalflow-features.excalidraw">Editable Excalidraw source</a></sub>
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
## Why RebuttalFlow?
|
|
38
|
+
|
|
39
|
+
Strong coding agents rarely fabricate numbers out of thin air anymore. What actually breaks during a stressful 7-day conference rebuttal is **cross-session amnesia, shifting experiment tables, brutal character limits, and messy advisor handoffs**:
|
|
40
|
+
|
|
41
|
+
> When a late rerun drops from **78.4%** to **70.0%** — crossing below a **72.6%** baseline — updating the number is not enough. Two reviewer letters cite that experiment, and both conclusions now need a second look. RebuttalFlow refreshes every bound value and table together and flags the affected drafts for the author to revisit. *(See the [reproducible synthetic example](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/examples/lightweight_workspace_demo/README.md#replay-a-changed-experiment).)*
|
|
42
|
+
|
|
43
|
+
| Pain point during a 7-day rebuttal | Plain coding agent chat | Coding agent + **RebuttalFlow** |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| **Multi-day / multi-window sessions** | Re-paste reviews and re-explain progress every morning | **`rebuttal brief`** restores open issues, stances, deadlines & char budgets in one call |
|
|
46
|
+
| **Missing papers cited by reviewers** | Manually hunt arXiv, check publication dates & GitHub repos | **`rebuttal recon`** extracts named papers, checks contemporaneous dates & public code |
|
|
47
|
+
| **Late reruns & new seeds** | Hunt and edit hardcoded numbers across Common, R1, and R3 | **`rebuttal metric sync`** updates `{{metric:...}}` / `{{table:...}}` everywhere & flags drift |
|
|
48
|
+
| **OpenReview character limits** | LLMs miscount chars or silently drop key baselines when shortening | **Full draft first + `compress-check`** verifies exact UTF-16 length & locked facts |
|
|
49
|
+
| **Advisor & co-author review** | Trade messy Word/WeChat notes and translate them back to the agent | **`rebuttal share`** exports a single offline HTML file; annotations import cleanly back to the agent |
|
|
50
|
+
| **Submission safety** | Spot-check `\cite{}`, broken tables, or identity leaks by eye | **`rebuttal check`** catches syntax bugs, anonymity leaks, missing answers & cross-reply drift |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Core Features
|
|
55
|
+
|
|
56
|
+
### 1. Cross-Session Memory (`rebuttal brief`)
|
|
57
|
+
Open a fresh Claude Code, Codex, or Cursor session on Day 4 and restore the entire rebuttal state immediately — pending high-leverage issues, reviewer stances, remaining character budgets, synced metric alerts, and open advisor comments — without re-pasting yesterday's chat.
|
|
58
|
+
|
|
59
|
+
### 2. Citation Recon & Priority Map (`rebuttal recon` · `rebuttal map`)
|
|
60
|
+
- **Citation Recon**: Extracts papers mentioned in reviews and queries public metadata (arXiv / Semantic Scholar / GitHub, with `--offline` mode) to track abstracts, contemporaneous publication dates, and official code repositories under `.rebuttal/refs/`.
|
|
61
|
+
- **ROI Priority Map**: Groups overlapping reviewer concerns (`overlap_group`) and ranks work into four actionable buckets — *PDF-grounded clarifications*, *shared high-leverage experiments*, *citation comparisons*, and *scope boundaries* — so one experiment can answer multiple reviewers.
|
|
62
|
+
|
|
63
|
+
### 3. Live CSV / JSON Metric Binding (`rebuttal metric bind` · `sync`)
|
|
64
|
+
Bind local experiment outputs (`.csv` or `.json`) as live `MetricCard`s and embed `{{metric:M1.ours_acc:.2f}}` or `{{table:M1}}` in your response templates. Whenever a script finishes a new seed or baseline, `rebuttal metric sync` refreshes every linked reply automatically and flags claim-strength drift for human review.
|
|
65
|
+
|
|
66
|
+
### 4. Write Full, Compress Safely & Pre-Flight Check (`rebuttal check` · `review compress-check`)
|
|
67
|
+
- **Evidence-first drafting**: Inspect every reviewer's verbatim questions and linked evidence with `rebuttal review plan R1`, save the complete response first, and test shorter candidates via `review compress-check` without overwriting the full draft.
|
|
68
|
+
- **Deterministic pre-flight**: Verifies exact **UTF-16 OpenReview character counts** per posting form (`review check-message`), preserves `locked_spans`, catches leftover LaTeX macros (`\cite{}`, `\ref{}`, unbalanced `$`, broken Markdown tables), scans for **anonymity leaks** (emails, local paths, personal GitHub links, custom `forbidden_terms`), and checks coverage and cross-reply consistency.
|
|
69
|
+
|
|
70
|
+
### 5. Three-Pane Review Desk & Offline Advisor Pack (`rebuttal ui` · `share` · `feedback`)
|
|
71
|
+
- **Local Review Desk (`rebuttal ui`)**: A zero-Node, loopback-only three-pane workspace showing reviews + frozen submission PDF links on the left, live-rendered replies with metric hover cards and character budget bars in the middle, and passage-level feedback (plus optional local CLI agent suggestions) on the right.
|
|
72
|
+
- **Offline Advisor Pack (`rebuttal share`)**: Generates a **standalone, zero-network HTML file** ([preview the public demo](https://zhoujun-ye.github.io/RebuttalFlow/review-demo.html)) you can send over Slack, WeChat, or email. Your advisor highlights passages, writes inline comments, and exports `advisor-comments.json` — import it via `rebuttal feedback import` and let your agent apply every note cleanly.
|
|
73
|
+
|
|
74
|
+
### 6. Blinded Red-Team & Multi-Round Discussion (`redteam` · `review add-followup` · `thread`)
|
|
75
|
+
- **Blinded Critique (`rebuttal redteam prepare`)**: Builds a strict whitelist critique packet containing only the frozen PDF reference, original review, and rendered reply — stripping internal notes and chat history to fight model sycophancy.
|
|
76
|
+
- **Multi-Round Discussions**: Append later reviewer questions without reinitializing (`rebuttal review add-followup R1 note.txt`) and inspect local authorized forum threads (`rebuttal review thread R1 forum.json`).
|
|
77
|
+
- **Local Export Only (`rebuttal export`)**: Exports clean per-reviewer `.md` files or a `one-page-tex` skeleton. No OpenReview write credentials, no accidental posting — **only the author submits**.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Recorded Walkthrough
|
|
82
|
+
|
|
83
|
+
<p align="center">
|
|
84
|
+
<img src="https://raw.githubusercontent.com/Zhoujun-Ye/RebuttalFlow/main/docs/assets/review-walkthrough.gif" alt="Recorded workflow: restore a brief, triage evidence, sync a table, check a draft and import advisor feedback" width="92%">
|
|
85
|
+
<br>
|
|
86
|
+
<sub>End-to-end local run: restore brief → triage & bind CSV → sync rerun drift → check & compress → import advisor feedback</sub>
|
|
87
|
+
</p>
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Quickstart
|
|
92
|
+
|
|
93
|
+
Requires **Python 3.11+** (no Node runtime, external database, or embedded LLM API key needed).
|
|
94
|
+
|
|
95
|
+
With [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, run this in the directory containing your `reviews.md` (use headings such as `# R1`, `# R2`). No repository checkout is needed:
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
uvx rebuttalflow init reviews.md --client claude
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For Codex or Cursor, use `--client codex` or `--client cursor`. This installs the MCP configuration and Skill **only in this project**. Add `--pdf submission.pdf` to register your frozen submission. No reviews handy? [Open the advisor demo](https://zhoujun-ye.github.io/RebuttalFlow/review-demo.html) or [run the synthetic walkthrough](https://github.com/Zhoujun-Ye/RebuttalFlow/tree/main/examples/lightweight_workspace_demo).
|
|
102
|
+
|
|
103
|
+
Then reopen your coding agent in that directory and paste:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
Read the reviews, split their questions and link my results. Show R1's response plan, then draft a numbered reply with the matched baseline and measured result for each empirical question. Save the full evidence draft first; only then shorten it to the posting limit. Do not submit.
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Everyday commands across the rebuttal week:**
|
|
110
|
+
|
|
111
|
+
Use `uvx rebuttalflow` in place of `rebuttal`, or install the persistent shortcut once with `uv tool install rebuttalflow`. Both the local desk and the single-file advisor pack render `$...$` and `$$...$$` with bundled KaTeX; no CDN, web fonts, or Node runtime is needed.
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
rebuttal brief # Day 2+: restore compact state in a new session
|
|
115
|
+
rebuttal recon run --offline # Extract cited missing papers (drop --offline to query public metadata)
|
|
116
|
+
rebuttal map # View 4-bucket ROI priority map
|
|
117
|
+
rebuttal review plan R1 # Inspect R1's verbatim questions & linked evidence
|
|
118
|
+
rebuttal metric sync # Refresh all bound drafts after an experiment rerun
|
|
119
|
+
rebuttal check # Exact char limit, syntax, anonymity, coverage & drift check
|
|
120
|
+
rebuttal share --out review-pack.html # Export standalone offline HTML for advisor annotations
|
|
121
|
+
rebuttal feedback import advisor-notes.json # Bring advisor comments back for your agent
|
|
122
|
+
rebuttal review add-followup R1 note.txt # Append round-2 reviewer questions without reinitializing
|
|
123
|
+
rebuttal export --format openreview # Export clean local Markdown (or --format one-page-tex)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
<details>
|
|
129
|
+
<summary><strong>Reference: CLI Commands, 10 MCP Tools & <code>.rebuttal/</code> Layout</strong></summary>
|
|
130
|
+
|
|
131
|
+
### Top-Level CLI Commands
|
|
132
|
+
| Command | Purpose |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `rebuttal init` | Initialize `.rebuttal/`, import reviews, register frozen PDF & optional `--client` MCP/Skill |
|
|
135
|
+
| `rebuttal setup` | Preview or write project-local MCP config & thin Skill (`codex` / `claude` / `cursor`) |
|
|
136
|
+
| `rebuttal brief` | Emit a compact cross-session status brief (`--json` or Markdown) |
|
|
137
|
+
| `rebuttal map` | Rank concerns across 4 ROI buckets (`pdf_refute`, `experiments`, `citation_clarify`, `boundaries`) |
|
|
138
|
+
| `rebuttal recon` | `run` / `list` / `add` missing paper metadata & public code lookups |
|
|
139
|
+
| `rebuttal metric` | `bind` / `sync` / `list` local CSV/JSON result cards & live table bindings |
|
|
140
|
+
| `rebuttal review` | `plan` / `add-followup` / `thread` / `check-message` / `compress-check` |
|
|
141
|
+
| `rebuttal check` | Deterministic pre-flight check (UTF-16 chars, locked spans, syntax, anonymity, coverage, drift) |
|
|
142
|
+
| `rebuttal ui` | Launch loopback three-pane review desk (`--enable-agent-bridge` for optional local CLI edits) |
|
|
143
|
+
| `rebuttal share` | Export offline advisor HTML pack (paired with `feedback import/list/resolve` & `redteam prepare/run`) |
|
|
144
|
+
| `rebuttal export` | Export checked local replies (`openreview` Markdown or `one-page-tex`) |
|
|
145
|
+
|
|
146
|
+
### 10 MCP Tools Exposed to Coding Agents
|
|
147
|
+
`rebuttal_brief` · `get_context` · `upsert_issues` · `get_battle_map` · `recon_references` · `bind_metric` · `sync_metrics` · `save_draft` · `check_preflight` · `manage_feedback`
|
|
148
|
+
|
|
149
|
+
### Local `.rebuttal/` Directory Structure
|
|
150
|
+
```text
|
|
151
|
+
.rebuttal/
|
|
152
|
+
├── config.yaml # Venue limits, deadline, submission date, frozen_pdf_path, forbidden_terms
|
|
153
|
+
├── state/
|
|
154
|
+
│ ├── events.jsonl # Append-only audit log (replayable via `rebuttal state rebuild`)
|
|
155
|
+
│ └── snapshot.json # Atomic state projection
|
|
156
|
+
├── reviews/raw_snapshot.json # Immutable original reviews & follow-ups
|
|
157
|
+
├── refs/ # Citation recon index & per-paper Markdown cards
|
|
158
|
+
├── metrics/ # Bound CSV/JSON MetricCards & rendered tables
|
|
159
|
+
├── drafts/ # Full templates (*.tmpl.md) & rendered outputs (*.rendered.md)
|
|
160
|
+
└── feedback/ # Advisor annotations & blinded red-team findings
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
## Safety & Design Boundaries
|
|
166
|
+
|
|
167
|
+
- **File-first & transparent**: All state lives in `.rebuttal/` as plain JSON, JSONL, YAML, and Markdown. Frozen submission PDFs and verbatim review quotes are treated as read-only untrusted data.
|
|
168
|
+
- **No lock-in**: Runs locally as a CLI and review desk even without an agent. Tune venue limits, deadlines, submission dates, and anonymity `forbidden_terms` in `.rebuttal/config.yaml`.
|
|
169
|
+
- **Privacy & control**: Online citation recon only sends reference titles/IDs to public APIs (use `--offline` anytime). Final replies are exported locally — RebuttalFlow never posts to OpenReview on your behalf.
|
|
170
|
+
|
|
171
|
+
## Documentation & Contributing
|
|
172
|
+
|
|
173
|
+
- [CLI Guide](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/cli-guide.md) · [Author Response Guide](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/author-response-guide.md) · [v0.3 Design Spec](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/design/lightweight-agent-exoskeleton-v0.3.md) · [All Docs](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/docs/README.md)
|
|
174
|
+
- Development & verification instructions live in [CONTRIBUTING.md](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/CONTRIBUTING.md) and [AGENTS.md](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/AGENTS.md).
|
|
175
|
+
- Released under the [MIT License](https://github.com/Zhoujun-Ye/RebuttalFlow/blob/main/LICENSE).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0.3"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rebuttalflow"
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "Lightweight, local-first rebuttal workspace & MCP for Claude Code, Codex & Cursor — cross-session memory, live experiment metrics, citation recon, OpenReview preflight & offline advisor review."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
dependencies = ["pydantic>=2,<3", "typer>=0.29,<0.30", "pyyaml>=6", "filelock>=3.13", "markdown-it-py>=3,<5", "mdit-py-plugins>=0.5,<1"]
|
|
14
|
+
|
|
15
|
+
[project.optional-dependencies]
|
|
16
|
+
dev = ["pytest>=8", "pytest-cov", "ruff", "mypy", "types-PyYAML"]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Homepage = "https://zhoujun-ye.github.io/RebuttalFlow/"
|
|
20
|
+
Repository = "https://github.com/Zhoujun-Ye/RebuttalFlow"
|
|
21
|
+
Issues = "https://github.com/Zhoujun-Ye/RebuttalFlow/issues"
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
rebuttal = "rebuttalflow.cli.main:app"
|
|
25
|
+
rebuttalflow = "rebuttalflow.cli.main:app"
|
|
26
|
+
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
28
|
+
where = ["src"]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.package-data]
|
|
31
|
+
"rebuttalflow.cli" = ["resources/*.md","inspector_assets/*"]
|
|
32
|
+
"rebuttalflow.outer_loop.drafting" = ["assets/*"]
|
|
33
|
+
|
|
34
|
+
[tool.ruff]
|
|
35
|
+
target-version = "py311"
|
|
36
|
+
|
|
37
|
+
[tool.ruff.lint]
|
|
38
|
+
extend-select = ["I", "UP"]
|
|
39
|
+
|
|
40
|
+
[tool.mypy]
|
|
41
|
+
python_version = "3.11"
|
|
42
|
+
strict = true
|
|
43
|
+
plugins = ["pydantic.mypy"]
|
|
44
|
+
|
|
45
|
+
[tool.pytest.ini_options]
|
|
46
|
+
testpaths = ["tests"]
|
|
47
|
+
|
|
48
|
+
[tool.coverage.run]
|
|
49
|
+
source = ["rebuttalflow.state", "rebuttalflow.controller"]
|
|
50
|
+
|
|
51
|
+
[tool.coverage.report]
|
|
52
|
+
fail_under = 90
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""External research harness independent of any coding-agent runtime."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""External CLI workers; no model client or research-state access."""
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Isolated Claude Code CLI sessions that return structured proposals only."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from tempfile import TemporaryDirectory
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from rebuttalflow.adapters.process import (
|
|
10
|
+
SANDBOX,
|
|
11
|
+
cli_binary,
|
|
12
|
+
launch,
|
|
13
|
+
proposal_prompt,
|
|
14
|
+
require_sandbox,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
AUTH_HINT = (
|
|
18
|
+
"Use a normal macOS terminal with a current native Claude Code CLI and export "
|
|
19
|
+
"exactly one of CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY."
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def binary() -> Path:
|
|
24
|
+
return cli_binary("claude", "Install the native Claude Code CLI on PATH")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def credential() -> str:
|
|
28
|
+
names = [
|
|
29
|
+
name
|
|
30
|
+
for name in ("CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY")
|
|
31
|
+
if os.environ.get(name, "").strip()
|
|
32
|
+
]
|
|
33
|
+
if len(names) != 1:
|
|
34
|
+
raise ValueError(AUTH_HINT)
|
|
35
|
+
return names[0]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def sandbox(exe: Path, cwd: Path) -> list[str]:
|
|
39
|
+
# Runtime files and scratch are readable; host files, including other /tmp
|
|
40
|
+
# workspaces and the dispatch archive, are not. The worker inherits log FDs.
|
|
41
|
+
readable = " ".join(
|
|
42
|
+
f"(require-not (subpath {json.dumps(str(p))}))"
|
|
43
|
+
for p in (cwd, "/System", "/usr/lib", "/usr/share", "/private/etc/ssl")
|
|
44
|
+
)
|
|
45
|
+
executable = f"(literal {json.dumps(str(exe))})"
|
|
46
|
+
policy = (
|
|
47
|
+
f"(version 1)(allow default)"
|
|
48
|
+
f"(deny file-read-data (require-all {readable} (require-not {executable})"
|
|
49
|
+
f' (require-not (literal "/" "/dev/null" "/dev/random" "/dev/urandom"))))'
|
|
50
|
+
f"(deny file-write* (require-all (require-not (subpath {json.dumps(str(cwd))}))"
|
|
51
|
+
f' (require-not (literal "/dev/null"))))'
|
|
52
|
+
f"(deny process-exec (require-not {executable}))"
|
|
53
|
+
)
|
|
54
|
+
return [SANDBOX, "-p", policy, str(exe)]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def request(
|
|
58
|
+
role: str,
|
|
59
|
+
instruction: str,
|
|
60
|
+
context: object,
|
|
61
|
+
schema: dict[str, Any],
|
|
62
|
+
archive: Path,
|
|
63
|
+
timeout: float,
|
|
64
|
+
*,
|
|
65
|
+
fictional: bool = False,
|
|
66
|
+
) -> str:
|
|
67
|
+
require_sandbox()
|
|
68
|
+
auth = credential()
|
|
69
|
+
exe = binary()
|
|
70
|
+
prompt_path = archive / "prompt.txt"
|
|
71
|
+
prompt_path.write_text(
|
|
72
|
+
proposal_prompt(role, instruction, context, schema, fictional), encoding="utf-8"
|
|
73
|
+
)
|
|
74
|
+
with TemporaryDirectory(prefix="rebuttal-claude-") as tmp:
|
|
75
|
+
cwd = Path(tmp).resolve()
|
|
76
|
+
code, status = launch(
|
|
77
|
+
[
|
|
78
|
+
*sandbox(exe, cwd),
|
|
79
|
+
"--print",
|
|
80
|
+
"--safe-mode",
|
|
81
|
+
"--setting-sources",
|
|
82
|
+
"",
|
|
83
|
+
"--settings",
|
|
84
|
+
'{"disableAllHooks":true}',
|
|
85
|
+
"--strict-mcp-config",
|
|
86
|
+
"--mcp-config",
|
|
87
|
+
'{"mcpServers":{}}',
|
|
88
|
+
"--no-chrome",
|
|
89
|
+
"--no-session-persistence",
|
|
90
|
+
"--tools",
|
|
91
|
+
"",
|
|
92
|
+
"--permission-mode",
|
|
93
|
+
"dontAsk",
|
|
94
|
+
"--max-turns",
|
|
95
|
+
"2",
|
|
96
|
+
"--output-format",
|
|
97
|
+
"json",
|
|
98
|
+
"--json-schema",
|
|
99
|
+
json.dumps(schema),
|
|
100
|
+
],
|
|
101
|
+
cwd,
|
|
102
|
+
archive,
|
|
103
|
+
timeout,
|
|
104
|
+
prefixes=[],
|
|
105
|
+
credentials=(auth,),
|
|
106
|
+
extra={
|
|
107
|
+
"HOME": str(cwd),
|
|
108
|
+
"TMPDIR": str(cwd),
|
|
109
|
+
"CLAUDE_CONFIG_DIR": str(cwd / ".claude"),
|
|
110
|
+
"DISABLE_NONESSENTIAL_TRAFFIC": "1",
|
|
111
|
+
},
|
|
112
|
+
stdin_path=prompt_path,
|
|
113
|
+
)
|
|
114
|
+
stdout = archive / "stdout.log"
|
|
115
|
+
if status != "succeeded" or code or stdout.stat().st_size > 512_000:
|
|
116
|
+
raise ValueError(
|
|
117
|
+
f"Claude Code {role} {status} (exit {code}); inspect {stdout} and stderr.log"
|
|
118
|
+
)
|
|
119
|
+
result = json.loads(stdout.read_bytes())
|
|
120
|
+
if (
|
|
121
|
+
not isinstance(result, dict)
|
|
122
|
+
or result.get("type") != "result"
|
|
123
|
+
or result.get("subtype") != "success"
|
|
124
|
+
or result.get("is_error") is not False
|
|
125
|
+
or result.get("permission_denials")
|
|
126
|
+
or not isinstance(result.get("structured_output"), dict)
|
|
127
|
+
):
|
|
128
|
+
raise ValueError("Claude Code did not return a successful structured proposal")
|
|
129
|
+
raw = json.dumps(result["structured_output"], allow_nan=False)
|
|
130
|
+
(archive / "answer.json").write_text(raw, encoding="utf-8")
|
|
131
|
+
return raw
|