comitia 0.1.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.
Files changed (74) hide show
  1. comitia-0.1.0/.gitignore +11 -0
  2. comitia-0.1.0/LICENSE +21 -0
  3. comitia-0.1.0/LICENSES/crossby-MIT.txt +21 -0
  4. comitia-0.1.0/PKG-INFO +589 -0
  5. comitia-0.1.0/README.md +566 -0
  6. comitia-0.1.0/pyproject.toml +68 -0
  7. comitia-0.1.0/src/comitia/__init__.py +3 -0
  8. comitia-0.1.0/src/comitia/__main__.py +3 -0
  9. comitia-0.1.0/src/comitia/api.py +68 -0
  10. comitia-0.1.0/src/comitia/catalog.py +82 -0
  11. comitia-0.1.0/src/comitia/cli.py +950 -0
  12. comitia-0.1.0/src/comitia/control.py +156 -0
  13. comitia-0.1.0/src/comitia/diffs.py +120 -0
  14. comitia-0.1.0/src/comitia/discussion/__init__.py +0 -0
  15. comitia-0.1.0/src/comitia/discussion/api.py +152 -0
  16. comitia-0.1.0/src/comitia/discussion/cli.py +1254 -0
  17. comitia-0.1.0/src/comitia/discussion/config.py +167 -0
  18. comitia-0.1.0/src/comitia/discussion/console.py +366 -0
  19. comitia-0.1.0/src/comitia/discussion/converse.py +1221 -0
  20. comitia-0.1.0/src/comitia/discussion/journal.py +382 -0
  21. comitia-0.1.0/src/comitia/discussion/panel.py +1647 -0
  22. comitia-0.1.0/src/comitia/discussion/panel_view.py +445 -0
  23. comitia-0.1.0/src/comitia/discussion/prompts/converse_asker.md +3 -0
  24. comitia-0.1.0/src/comitia/discussion/prompts/converse_summary.md +27 -0
  25. comitia-0.1.0/src/comitia/discussion/transcript.py +88 -0
  26. comitia-0.1.0/src/comitia/engine.py +1223 -0
  27. comitia-0.1.0/src/comitia/findings.py +270 -0
  28. comitia-0.1.0/src/comitia/host.py +2067 -0
  29. comitia-0.1.0/src/comitia/plan.py +957 -0
  30. comitia-0.1.0/src/comitia/posting.py +328 -0
  31. comitia-0.1.0/src/comitia/prompts.py +750 -0
  32. comitia-0.1.0/src/comitia/recipe.py +430 -0
  33. comitia-0.1.0/src/comitia/report.py +581 -0
  34. comitia-0.1.0/src/comitia/settings.py +66 -0
  35. comitia-0.1.0/src/comitia/skill/SKILL.md +75 -0
  36. comitia-0.1.0/src/comitia/starters/decision-debate.yml +27 -0
  37. comitia-0.1.0/src/comitia/starters/deep-review.yml +12 -0
  38. comitia-0.1.0/src/comitia/starters/message-test.yml +15 -0
  39. comitia-0.1.0/src/comitia/starters/pr-review-light.yml +78 -0
  40. comitia-0.1.0/src/comitia/starters/pr-review.yml +100 -0
  41. comitia-0.1.0/src/comitia/starters/prd-review.yml +10 -0
  42. comitia-0.1.0/src/comitia/store.py +212 -0
  43. comitia-0.1.0/src/comitia/web/__init__.py +13 -0
  44. comitia-0.1.0/src/comitia/web/server.py +244 -0
  45. comitia-0.1.0/src/comitia/web/service.py +679 -0
  46. comitia-0.1.0/src/comitia/web/static/app.js +1521 -0
  47. comitia-0.1.0/src/comitia/web/static/index.html +38 -0
  48. comitia-0.1.0/src/comitia/web/static/styles.css +262 -0
  49. comitia-0.1.0/tests/conftest.py +397 -0
  50. comitia-0.1.0/tests/discussion/__init__.py +0 -0
  51. comitia-0.1.0/tests/discussion/test_converse.py +977 -0
  52. comitia-0.1.0/tests/discussion/test_converse_cmd.py +971 -0
  53. comitia-0.1.0/tests/discussion/test_journal.py +391 -0
  54. comitia-0.1.0/tests/discussion/test_panel.py +1709 -0
  55. comitia-0.1.0/tests/discussion/test_panel_cmd.py +441 -0
  56. comitia-0.1.0/tests/discussion/test_panel_settings.py +172 -0
  57. comitia-0.1.0/tests/discussion/test_panel_view.py +284 -0
  58. comitia-0.1.0/tests/fixtures/crossby-0.63-journal.jsonl +13 -0
  59. comitia-0.1.0/tests/fixtures/make_crossby_journal.py +116 -0
  60. comitia-0.1.0/tests/test_antigravity_cursor_host.py +390 -0
  61. comitia-0.1.0/tests/test_api.py +59 -0
  62. comitia-0.1.0/tests/test_codex_host.py +534 -0
  63. comitia-0.1.0/tests/test_discussion.py +436 -0
  64. comitia-0.1.0/tests/test_host.py +478 -0
  65. comitia-0.1.0/tests/test_import.py +292 -0
  66. comitia-0.1.0/tests/test_plan_and_cli.py +1034 -0
  67. comitia-0.1.0/tests/test_posting.py +231 -0
  68. comitia-0.1.0/tests/test_resume.py +244 -0
  69. comitia-0.1.0/tests/test_review_fixes.py +86 -0
  70. comitia-0.1.0/tests/test_scenarios.py +583 -0
  71. comitia-0.1.0/tests/test_settings.py +60 -0
  72. comitia-0.1.0/tests/test_turns.py +204 -0
  73. comitia-0.1.0/tests/test_web.py +445 -0
  74. comitia-0.1.0/uv.lock +1048 -0
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ .mypy_cache/
5
+ .ruff_cache/
6
+ .pytest_cache/
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ .coverage
11
+ .DS_Store
comitia-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ivan Viragine
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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ivan Viragine
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.
comitia-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,589 @@
1
+ Metadata-Version: 2.5
2
+ Name: comitia
3
+ Version: 0.1.0
4
+ Summary: Know what's fixed, what's still open and what's new before your agent builds.
5
+ Project-URL: Repository, https://github.com/ivanviragine/comitia
6
+ Project-URL: Issues, https://github.com/ivanviragine/comitia/issues
7
+ Author: Ivan Viragine
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ License-File: LICENSES/crossby-MIT.txt
11
+ Requires-Python: >=3.11
12
+ Requires-Dist: crossby<0.72.0,>=0.71.0
13
+ Requires-Dist: pydantic>=2.0
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: rich>=13.0
16
+ Requires-Dist: typer<0.26,>=0.12
17
+ Provides-Extra: dev
18
+ Requires-Dist: mypy>=1.10; extra == 'dev'
19
+ Requires-Dist: pytest>=8.0; extra == 'dev'
20
+ Requires-Dist: ruff>=0.4; extra == 'dev'
21
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # comitia
25
+
26
+ **Know what's fixed, what's still open and what's new before your agent builds.**
27
+
28
+ Several AI models review a spec independently, your own agent revises it, and
29
+ each later check gives every earlier finding a verdict. It runs on the
30
+ coding-agent CLIs you already have, through [crossby](https://github.com/ivanviragine/crossby).
31
+
32
+ It runs a recipe in one of three formats: independent answers, a consultation
33
+ (a lead questions one other participant) or a panel (a lead questions several),
34
+ and checks a revised document against its last run. Comitia supports Claude
35
+ Code, Codex, Antigravity CLI, and Cursor CLI as hosts.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ uv tool install git+https://github.com/ivanviragine/comitia # `comitia` on your PATH
41
+ comitia setup # in your project: the `discuss` skill (and, under `approval: strict`, the approval rules)
42
+ ```
43
+
44
+ The tool install puts `comitia` on your PATH. Under `approval: strict`, the
45
+ host's approval rules expect the plain `comitia run` command. For local
46
+ development, use `uv tool install --editable .` from the checkout.
47
+
48
+ ## Use it from your agent
49
+
50
+ Ask Claude Code: *"Have Claude and Gemini review PRD.md."* The `discuss` skill
51
+ picks or writes a recipe, shows you the plan, and starts the run once Claude
52
+ Code's own permission flow lets it. Then: *"address the open findings"*, and
53
+ *"check again"*.
54
+
55
+ By default (`approval: host`, see [Approval](#approval)) that flow decides, in
56
+ whatever permission mode you set. `comitia setup` installs the `discuss` skill and
57
+ configures Claude Code's read-only commands and sandbox exclusions. Choose
58
+ `approval: strict` for the additional approval rules and hooks described
59
+ below. Start Claude Code from the project you set up and accept its workspace
60
+ trust dialog so it loads the project's rules.
61
+
62
+ ### From Codex
63
+
64
+ `comitia setup` installs the `discuss` skill for Codex in `.agents/skills`.
65
+ Under `approval: strict`, it adds a rule in `~/.codex/rules/comitia.rules` that makes Codex ask
66
+ before every `comitia run`, `dismiss`, `post`, `resume` and `import-journal`
67
+ (a `prompt` rule wins over any `allow`), and comitia's hook in
68
+ `~/.codex/hooks.json`, which stops a wrapped one. Codex runs a new hook only once
69
+ you trust it, so open `/hooks` in Codex and trust comitia's.
70
+
71
+ Under Codex, a run counts as approved when it passes through Codex's own
72
+ approval path, whoever your Codex settings send that to: you, or Codex's
73
+ automatic reviewer if you set `approvals_reviewer = "auto_review"`. That is a
74
+ choice you made in Codex, so comitia follows it, and the run records that it
75
+ was approved through Codex. Before counting on it, comitia asks Codex itself
76
+ (`codex execpolicy check`) whether the rules Codex loads (yours, and a trusted
77
+ project's) make it ask for the command as you gave it, and asks Codex's app
78
+ server whether it would run the hook, enabled and trusted. comitia counts on
79
+ your Codex configuration as written, so a Codex started with configuration on
80
+ its command line (`-c`, `--enable`, `--disable`, `--ignore-rules`,
81
+ `--ignore-user-config`, `-a`, or a profile that changes its rules, hooks or
82
+ approvals) is refused, as is one started with
83
+ `--dangerously-bypass-approvals-and-sandbox`, which skips its approvals.
84
+
85
+ comitia reads those from the command line of the Codex session it runs
86
+ under, so start that session with `codex --no-daemon`. A plain `codex` runs
87
+ its sessions in Codex's shared background server (`codex app-server`), which
88
+ also runs the sessions of Codex's IDE extension and desktop app. Under that
89
+ server, comitia cannot see how a session was started, so it refuses.
90
+
91
+ Codex keeps each conversation's approval setting with the conversation. With
92
+ the automatic reviewer on, the background server can give a conversation a
93
+ setting that turns down every command a rule asks about, without asking anyone,
94
+ and `codex resume --no-daemon` carries that setting over. comitia reads the
95
+ setting from the conversation's log and says so before the run. To change it,
96
+ type `/permissions` in Codex and choose "Ask for approval".
97
+
98
+ Inside Codex's sandbox comitia cannot write its records, and the tools it
99
+ starts cannot reach their companies, so Codex asks to run it outside the
100
+ sandbox, and that request takes the same approval path. A command with a
101
+ variable set in front (`COMITIA_HOME=... comitia run`) is refused like a
102
+ wrapped one: Codex's rules may not see the start of it.
103
+
104
+ ### From Antigravity
105
+
106
+ `comitia setup` installs the `discuss` skill for Antigravity CLI (`agy`) in
107
+ `.agents/skills`. Under `approval: strict`, it adds a hook in
108
+ `~/.gemini/config/hooks.json`, the hooks file Antigravity reads as it starts (a
109
+ project's `.agents/hooks.json` loads only once a session is under way, too late
110
+ for its first command). The hook makes Antigravity always ask you before every
111
+ `comitia run`, `dismiss`, `post`, `resume` and `import-journal`, in any mode
112
+ and whatever you answered "always allow" to before, and it stops a wrapped one.
113
+ Before counting on that prompt, comitia checks that the hook is there and on,
114
+ for each tool Antigravity runs a shell command with, and that nothing else
115
+ names a hook `comitia`. An Antigravity started with
116
+ `--dangerously-skip-permissions` (which runs every command unasked, past the
117
+ hook's question) or with `--settings` is refused.
118
+
119
+ ### From Cursor
120
+
121
+ `comitia setup` installs the `discuss` skill for Cursor CLI in
122
+ `.agents/skills`. Under `approval: strict`, it adds a hook in
123
+ `~/.cursor/hooks.json`, which makes Cursor ask before every `comitia run`,
124
+ `dismiss`, `post`, `resume` and `import-journal` and stops a wrapped one. As
125
+ under Codex, the question goes down the approval path you set: you, or Cursor's
126
+ auto-review. A Cursor started with `--force` or `--yolo`, or set to Run
127
+ Everything (`approvalMode: unrestricted`), runs every command not refused
128
+ outright, past the hook's question, and is refused; so is one whose settings
129
+ (`~/.cursor/cli-config.json`, a project's `.cursor/cli.json`) allow `comitia`
130
+ commands.
131
+
132
+ ## Use it in the browser
133
+
134
+ ```bash
135
+ comitia ui # in your project; opens a local page
136
+ ```
137
+
138
+ The page does everything the commands do: pick a recipe and files, read the
139
+ plan, approve it, watch who is writing, read the report with every source turn
140
+ in place (and, for a consultation or panel, the whole discussion), add notes,
141
+ dismiss findings, check again, resume a stopped run, compare two runs, and edit
142
+ recipes in a form or as YAML. Comparing two runs puts their participants,
143
+ sessions and counts side by side; when one is a check again of the other, or of
144
+ a run before it, each finding gets one row with its status in both, and two
145
+ unrelated runs have their findings listed apart, since the same ID names a
146
+ different point in each.
147
+
148
+ In the recipe form, the model and effort lists follow the tool you pick: they
149
+ come from crossby's own catalog, so only what that tool takes is offered.
150
+
151
+ It listens on loopback only, with a fresh access token each start, and refuses
152
+ requests from any other page. Under `approval: host` (the default) and `none`
153
+ it approves runs, resumptions, posts and dismissals however `comitia ui` was
154
+ started: your host's own permission flow let it start, as it lets any command.
155
+ The run records `the page (approval: host)`. Under `approval: strict`, or for a
156
+ recipe that tightens to it, it approves only when you started `comitia ui`
157
+ from your own terminal; started any other way (by an agent, say) it shows
158
+ everything and approves nothing. Files it reads as material must be inside the
159
+ project.
160
+
161
+ A new review takes files of the project, a pull request by number, or a Git
162
+ range. For the last two the plan shows the diff it fetched; approving fetches
163
+ it again, and a diff that changed since is refused as a changed plan.
164
+
165
+ ## Use it from the terminal
166
+
167
+ ```bash
168
+ comitia recipe new my-review --from prd-review # writes recipes/my-review.yml
169
+ comitia check my-review --material PRD.md # the plan; starts no agent
170
+ comitia run my-review --material PRD.md # shows the plan, asks, runs, prints the report
171
+ # ...edit PRD.md...
172
+ comitia note F2 --text "added an owner per gate" # a claim, never evidence
173
+ comitia dismiss F4 --note "panels stay" # the author's call
174
+ comitia run my-review --material PRD.md --prior last # every earlier finding gets a verdict
175
+ ```
176
+
177
+ To review code, use the `pr-review` starter: four reviewers read the same diff,
178
+ each through one lens (correctness, security, design, tests), held to the same
179
+ rules: report only what this change should change, show a blocker with an input
180
+ and its wrong result, and report nothing that is fine. For a change that
181
+ touches only tests and docs, `pr-review-light` drops the security lens.
182
+
183
+ ```bash
184
+ comitia check pr-review --pr 123 # a pull request's diff, through gh
185
+ comitia check pr-review --diff main...HEAD # or any Git range in the project
186
+ ```
187
+
188
+ The diff is saved in comitia's store, outside the working tree, and the command
189
+ `check` prints runs that saved copy. Reviewers may read the rest of the project
190
+ for context, so check out the code under review first.
191
+
192
+ | Command | What it does |
193
+ | --- | --- |
194
+ | `recipe new NAME [--from STARTER]`, `recipe list` | Write a recipe; list recipes and starters |
195
+ | `check RECIPE --material FILE... [--diff RANGE] [--pr NUMBER]` | Show the plan: participants and report writer, companies on each route, what each can read, the most sessions |
196
+ | `run RECIPE --material FILE... [--diff RANGE] [--pr NUMBER] [--goal TEXT] [--prior RUN] [--plan ID] [--background]` | Run the approved plan; returns when it ends |
197
+ | `status [RUN]`, `report [RUN]`, `runs`, `stop [RUN]` | Who is writing; the report; past runs; stop a run |
198
+ | `import-journal JOURNAL --material FILE... [--check] [--plan ID] [--background]` | Make a report of an earlier `crossby converse` consultation, with your approval, so it can be checked again like any run |
199
+ | `resume RUN [--check] [--background]` | Take a stopped run up from where it stopped, with your approval; `--check` shows what it keeps and runs |
200
+ | `note FINDING... --text TEXT`, `dismiss FINDING... --note TEXT`, either with `--from-file FILE` | Record what was done; dismiss with the author's approval, once for all the findings named. The file has one `ID: text` line per finding |
201
+ | `post [RUN] [--finding ID...] [--markdown]` | Post the findings on the pull request the run reviewed, with your approval; or print them as Markdown |
202
+ | `setup` | Install the `discuss` skill in each host; under `approval: strict`, also the approval rules and the hook that keeps them honest |
203
+ | `ui [--port N] [--no-open]` | The page, on loopback |
204
+ | `converse ASKER RESPONDER --goal TEXT`, `converse --continue DIR` | A quick consultation between two agents, with no recipe or plan ([below](#quick-consultations-from-the-terminal)) |
205
+ | `panel NAME --goal TEXT` | A lead consults the members of a panel recipe in `.comitia.yml` (or `.crossby.yml`) |
206
+
207
+ Every command takes `--json`. Exit codes: 0 done (a partial result is flagged
208
+ in the output), 1 error or failed run, 2 plan refused, 3 not approved.
209
+
210
+ ## A recipe
211
+
212
+ ```yaml
213
+ # recipes/prd-review.yml
214
+ format: answers
215
+ participants:
216
+ - {id: claude, tool: claude, model: claude-opus-5-5, effort: high}
217
+ - {id: gemini, tool: antigravity-cli, model: gemini-4-argon, effort: high, instructions: personas/skeptical-pm.md}
218
+ limits: {turn_timeout: 15m}
219
+ report_instructions: Rank changes by their effect on the launch decision.
220
+ providers: [anthropic, google] # every company the material may reach
221
+ # synthesizer: {tool: codex} # who writes the report; default: the first participant
222
+ # require_blocked: [reads_outside_workspace] # isolation: Claude Code only; others are refused
223
+ ```
224
+
225
+ A participant has a `tool`, and optionally a `model`, an `effort`, and either
226
+ `instructions` (a file, or text) or a `persona` folder holding
227
+ `instructions.md` and reference files.
228
+
229
+ A participant can also get `skills`: folders of the project that each hold a
230
+ `SKILL.md`. They are copied, as they were when the plan was built, into a
231
+ folder of the participant's own, in the place its tool looks for skills. The
232
+ plan lists them, and a changed skill is a changed plan. A participant with
233
+ skills or a persona answers from that folder, is told where the project is,
234
+ and may read it. Only an isolated recipe keeps a participant to its own folder.
235
+
236
+ ```yaml
237
+ - {id: security, tool: claude, skills: [skills/threat-model]}
238
+ ```
239
+
240
+ A participant can also get MCP servers for the run, on top of the ones its
241
+ tool already has: `mcp` names servers defined in the project's `.mcp.json`.
242
+ Like skills, they put the participant in a folder of its own, from which it
243
+ can still read the project. Their tools run without asking, since nobody is
244
+ there to approve a call, and an MCP server can do whatever it does, so the
245
+ plan names each server and says so. A server's definition is never copied
246
+ into the run; if it changed after you approved the plan, the run stops.
247
+ Claude Code, Codex and Antigravity take them; other tools are refused in the
248
+ plan. An environment entry such as `"TOKEN": "${TOKEN}"` is forwarded from
249
+ your environment on all three.
250
+
251
+ ```yaml
252
+ - {id: docs, tool: claude, mcp: [internal-docs]}
253
+ ```
254
+
255
+ Antigravity (Gemini) has no search tool when it runs unattended: it can only
256
+ read files whose paths it already knows. Left to guess, it can spend a whole
257
+ turn opening names that do not exist, so comitia gives it the project's file
258
+ list (the first 300 paths, shallowest first, from Git where there is a
259
+ repository), and a turn that runs out of time is not tried again. A
260
+ repository-wide check is still slow. `search_commands: true` on a participant lets it run search and read
261
+ commands (`rg`, `grep`, `ls`, `cat`, `git grep`, ...). Antigravity cannot tell
262
+ such a command from one that also writes, so the plan then says that writes
263
+ are not blocked for that participant. Keep it off for material you do not
264
+ trust, such as a pull request from outside; the `pr-review` starter leaves it
265
+ off. Other tools ignore the setting.
266
+
267
+ ```yaml
268
+ - {id: design, tool: antigravity-cli, model: gemini-4-argon, search_commands: true}
269
+ ```
270
+
271
+ Every answer comitia reads is one JSON object in a set form. Antigravity is
272
+ also given that form, and checks the answer against it before it returns it:
273
+ asked in the prompt alone, Gemini 4 Neon once answered in long prose instead,
274
+ twice, and its findings were lost. Claude Code and Codex answer in the form
275
+ the prompt asks for.
276
+
277
+ ## A consultation or a panel
278
+
279
+ In `answers` each participant reviews on its own. In a `consultation` a lead
280
+ questions one other participant, and in a `panel` it questions several,
281
+ addressing each by `@id`, following up until it is confident:
282
+
283
+ ```yaml
284
+ # recipes/deep-review.yml
285
+ format: consultation
286
+ lead: claude # default: the first participant
287
+ participants:
288
+ - {id: claude, tool: claude, effort: high, instructions: Press on anything vague.}
289
+ - {id: gemini, tool: antigravity-cli, model: gemini-4-argon, effort: high}
290
+ limits: {turn_timeout: 15m, max_rounds: 4} # the most messages the lead may send
291
+ providers: [anthropic, google]
292
+ # visibility: shared # a panel only: each also sees the others' replies (default: private)
293
+ ```
294
+
295
+ The discussion runs as a panel on comitia's own engine, in which everyone is
296
+ read-only, the lead included. The lead holds the material and the goal; the others get the material
297
+ with their first message and answer only what the lead sends them (in a
298
+ `shared` panel, also the others' replies). When it ends, each participant, in
299
+ a fresh session given the discussion, lists the points it raised and the turns
300
+ of its own where it raised them, from the discussion alone, without opening
301
+ files; comitia keeps only turns that really are that participant's. From there it is a review like any other: the same
302
+ verdicts on earlier findings, the same report writer (by default the lead's
303
+ tool and model), and the report links each finding to the discussion turns and
304
+ shows the whole discussion. A participant that does not answer is noted at the
305
+ top and the run is partial; if the lead fails, or the only other participant in
306
+ a consultation does, the run fails. The plan counts every session the
307
+ discussion can use, and checks each tool as the resumed session its later turns
308
+ are.
309
+
310
+ An earlier `crossby converse` consultation can join this history:
311
+ `comitia import-journal .crossby/conversations/<time>/events.jsonl --material SPEC.md
312
+ --check` shows the plan (the journal's two sides, with the tools, models and
313
+ efforts it names, the asker leading and writing the report), and the command
314
+ it prints imports it once you approve. The discussion is the journal's and is
315
+ not run again: each side lists the points it raised in it, the report is
316
+ written, and a later `run --prior N` checks a revision against it. The
317
+ material is given again because a journal does not hold it; the run keeps a
318
+ copy, and the journal's hash is part of the plan.
319
+
320
+ The `deep-review` starter is a consultation, and `decision-debate` a shared
321
+ panel where two advocates argue a decision and the lead weighs them. The
322
+ participants the lead questions can have a persona folder, skills or MCP
323
+ servers: each then joins the discussion from a folder of its own, told its part
324
+ there, and may still read the project. The lead answers from the project with
325
+ `instructions`, and `search_commands` and isolation are for `answers`, for now.
326
+
327
+ ## From Python
328
+
329
+ `comitia.api` runs consultations and panels from a program, on the engine a
330
+ recipe's discussion uses. The backends and workspaces come from `crossby.api`,
331
+ which knows each tool:
332
+
333
+ ```python
334
+ from pathlib import Path
335
+
336
+ from crossby.api import CliBackend, ProjectWorkspace
337
+
338
+ from comitia.api import Lead, Member, PanelSpec, panel
339
+
340
+ project = Path.cwd()
341
+ result = panel(
342
+ PanelSpec(
343
+ goal="Would this pricing page convert?",
344
+ lead=Lead(backend=CliBackend(tool="claude"), folder=project),
345
+ members=(
346
+ Member(
347
+ id="cto", backend=CliBackend(tool="codex"), workspace=ProjectWorkspace(path=project)
348
+ ),
349
+ ),
350
+ ),
351
+ on_event=lambda event: print(event.type),
352
+ events_path=project / "panel.jsonl",
353
+ )
354
+ print(result.final_answer)
355
+ ```
356
+
357
+ `comitia.api.panel(PanelSpec(goal=…, lead=Lead(…), members=(Member(id=…,
358
+ backend=CliBackend(…), workspace=…), …)), on_event=…, events_path=…,
359
+ inputs=HumanInput())` runs the panel. `on_event` gets every event on a
360
+ dispatcher thread, and a UI answers a human seat with `inputs.submit(request_id,
361
+ text, recipients=…, done=…)` (or `HumanInput(responder)` answers
362
+ synchronously). A journal problem never stops a panel: the result's
363
+ `journal_error` says why the events file is missing or incomplete, and
364
+ `sink_errors` lists each `on_event` failure that dropped the sink.
365
+ `continue_panel` carries on a panel that stopped without a final answer, from
366
+ its journal; `read_panel` and `read_conversation` read a journal without running
367
+ anything; and `converse` is the two-agent consultation.
368
+
369
+ Moving from `crossby.api`: change the import; the names and arguments are the same.
370
+
371
+ There is no approval step in the library: it runs what it is given, and the
372
+ approval a run needs applies to comitia's commands. `comitia.api` is the
373
+ supported contract; before 1.0 a minor release may change it, with a migration
374
+ note, so pin a minor series.
375
+
376
+ ## Quick consultations from the terminal
377
+
378
+ For a quick, scriptable consultation with no recipe, plan or findings,
379
+ `comitia converse` and `comitia panel` are the commands `crossby converse`
380
+ and `crossby panel` were, with the same flags, defaults and exit codes (0
381
+ answered, 2 stopped by a limit, 1 a session failed, 130 interrupted). Messages
382
+ and progress go to stderr, and the final answer to stdout:
383
+
384
+ ```bash
385
+ # The asker (Claude) checks a diagnosis by questioning the responder (Codex)
386
+ comitia converse claude codex --goal "Check whether this diagnosis is sound: …"
387
+
388
+ # Script it: JSON on stdout, no live messages on stderr
389
+ comitia converse claude cursor --goal-file goal.md --max-rounds 3 --json --quiet
390
+
391
+ # Continue one that stopped on a limit, with up to 3 more answers
392
+ comitia converse --continue .crossby/conversations/20261110T201500123456 --max-rounds 3
393
+
394
+ # A lead consults several read-only members by @id
395
+ comitia panel pricing --goal "Would this pricing page convert?"
396
+ ```
397
+
398
+ The asker holds the goal and the responder never sees it. A panel's recipe
399
+ lives under `panels:` in `.comitia.yml`. A project that keeps its panels in
400
+ `.crossby.yml`, where `crossby panel` read them, works as it is, and the panel's
401
+ opening lines name the file it read:
402
+
403
+ ```yaml
404
+ # .comitia.yml
405
+ panels:
406
+ pricing:
407
+ lead: {tool: claude}
408
+ members:
409
+ - {id: cto, name: Rui, tool: codex, instructions: personas/cto.md}
410
+ - {id: founder, tool: cursor, folder: founder}
411
+ visibility: private # or shared
412
+ max_rounds: 5
413
+ ```
414
+
415
+ Their journals and transcripts are written where crossby wrote them,
416
+ `.crossby/conversations/<time>/` and `.crossby/panels/<time>/`, so a
417
+ consultation can still be imported with `comitia import-journal`. Under
418
+ `approval: host` or `none` these commands never ask: a person who types one ran
419
+ it, and an agent's host has already applied its own permission flow. Under
420
+ `approval: strict` each needs your own approval first, as a run does, and
421
+ `comitia setup` adds rules for them.
422
+
423
+ ## Approval
424
+
425
+ Who approves a run is the project's choice, in `.comitia.yml` at its root:
426
+
427
+ ```yaml
428
+ approval: host # host (default), none, or strict
429
+ ```
430
+
431
+ - `host`: the host's own permission flow decides, such as Claude Code's prompt
432
+ or Codex's approval path. A project with no `.comitia.yml` gets `host`.
433
+ - `none`: runs without asking.
434
+ - `strict`: only your own prompt counts.
435
+
436
+ A recipe may set `approval:` too, but only to tighten: the stricter of the two
437
+ applies (`none`, then `host`, then `strict`). An agent can write a recipe, while
438
+ `.comitia.yml` is yours, and for the same reason there is no flag or
439
+ environment variable for it. Every plan shows its preset, as in `Approval: host
440
+ (the host's own permission flow decides)`, and the preset is part of the plan's
441
+ ID. Each run records it, with how it was approved, at the top of its report. An
442
+ invalid `.comitia.yml` refuses the plan, naming the problem.
443
+
444
+ How each preset approves a run, an import, a resumption, a dismissal or a post:
445
+
446
+ - **`host`**: in your own terminal, comitia asks you. Under a coding agent, the
447
+ agent ran the command through its own permission flow, in whatever mode you
448
+ set, and that is the approval. The run records it as `the host's own
449
+ permission flow (Claude Code)`. With no terminal and no agent (cron, say),
450
+ nothing is approved: set `none` for that.
451
+ - **`none`**: nobody is asked, not even in a terminal. The run records
452
+ `approval: none (.comitia.yml)`.
453
+ - **`strict`**: only your own prompt counts, as [Strict mode](#strict-mode)
454
+ describes.
455
+
456
+ A resumption takes the stricter of its plan's preset and the project's current
457
+ one. `comitia check` warns that a run would be refused only under `strict`,
458
+ the one preset where the host's own setup can refuse it.
459
+
460
+ `comitia setup` installs approval rules and hooks only under `strict`. Under
461
+ all presets it installs the `discuss` skill and configures Claude Code's
462
+ read-only commands and sandbox exclusions. Approval rules and hooks from an
463
+ earlier setup stay active under the host's own permission flow. Claude Code still asks where its `ask` rules for comitia are, and the
464
+ hooks still turn down a wrapped command and make Cursor and Antigravity ask
465
+ before a plain one. comitia cannot relax them per project: a hook sees the
466
+ command, not which project's `.comitia.yml` it will run under (`cd`, `env -C`
467
+ or `sh -c` can change that), so a hook that stood down in a `host` project
468
+ would let a wrapped command reach a `strict` one unasked. To stop them, remove
469
+ the comitia `ask` rules and the `comitia hook` entry from the project's
470
+ `.claude/settings.json`, and the comitia entries from
471
+ `~/.codex/rules/comitia.rules`, `~/.codex/hooks.json`,
472
+ `~/.gemini/config/hooks.json` and `~/.cursor/hooks.json`.
473
+
474
+ ### Strict mode
475
+
476
+ Approval comes from you: a terminal prompt, the page you opened from your
477
+ terminal, or Claude Code's own prompt (an explicit `ask` rule, which prompts in
478
+ every permission mode and wins over any allow rule). An agent with none of
479
+ these is refused. A terminal counts only when no coding agent started
480
+ comitia: an agent can make a terminal and answer its prompt, so under Claude
481
+ Code (or with `codex`, `cursor-agent`, `opencode`, `agy` or `copilot` above it,
482
+ as crossby finds them) only the host's own prompt counts, and a `comitia ui`
483
+ started there approves nothing.
484
+
485
+ comitia counts on that prompt only when the Claude Code it runs under reads
486
+ the rule: from the folder Claude Code was started in, or your own settings. An
487
+ agent that runs `comitia` from another project, whose rules Claude Code never
488
+ loaded, is refused. The rule matches only a command starting with `comitia
489
+ run`, so `setup` also installs a hook that stops a wrapped one (`env comitia
490
+ run`, `sh -c '…'`, `uv run comitia run`, `python -m comitia`) before it runs
491
+ and tells the agent to run the plain command, and the run is refused where that
492
+ hook is missing. The hook takes any quoted argument, heredoc or piped text that
493
+ names a comitia start as a command, unless only a program that prints or
494
+ searches reads it, or it is a message (`-m`, `--body`, ...). It reads a name the
495
+ way a shell writes it back (`com'itia'`, `$'\x63omitia'`). What the command
496
+ line does not show is not caught: a command put together from shell variables,
497
+ aliases or functions, a name a shell expands (a glob, `{comitia,}`), or a
498
+ command kept in a file that a script or tool runs (`bash deploy.sh`, an npm
499
+ script, a Makefile target). Like Claude Code's own rules, these cover the
500
+ commands an agent writes; they are not a wall around the program. A host
501
+ started with flags that skip its approvals (Codex's
502
+ `--dangerously-bypass-approvals-and-sandbox` or `-c`, Cursor's `--force`,
503
+ Antigravity's `--dangerously-skip-permissions`) is refused too.
504
+
505
+ ## What it guarantees
506
+
507
+ - **Permissions are part of the plan.** Every session is a `crossby.api.ask`,
508
+ fresh and unattended, or a turn of a panel on comitia's own engine in which
509
+ every seat is read-only, the lead included. By default, file edits and shell writes must be blocked
510
+ before a participant starts. Antigravity's opt-in search commands can also
511
+ write, and selected MCP servers run with their own permissions. The plan
512
+ discloses these exceptions before approval.
513
+ - **A run does exactly the plan you approved.** The plan's ID is a hash of the
514
+ recipe, the material, every participant's tool, model, effort, version, route
515
+ and instructions, and the approval preset. `run --plan ID` refuses if anything
516
+ changed. Who approves it follows the preset: see [Approval](#approval), and
517
+ [Strict mode](#strict-mode) for what only your own prompt allows.
518
+ - **A stopped run resumes on the same plan.** A run that ended without its
519
+ report (stopped, failed, or its process gone) can resume: what it committed
520
+ is kept, a consultation or panel carries on in its own sessions with no more
521
+ messages than the plan allowed, and only what is missing runs, then the
522
+ report. Every participant is checked again first: a tool that only updated
523
+ itself since is shown, and the resumption uses it; a changed route, reading
524
+ or restriction refuses it.
525
+ `resume --check` shows what it keeps and runs and the most sessions it can
526
+ use, and the resumption is approved like a run, under the stricter of its
527
+ plan's preset and the project's.
528
+ - **Routes are read, not assumed.** Companies on each route come from the
529
+ tool's configuration (Claude Code settings and environment, Codex
530
+ `config.toml`, the gateway and model name for Cursor, Copilot and OpenCode).
531
+ An unknown route produces a warning. If the recipe specifies `providers`,
532
+ every route must be known and every company must be on that list.
533
+ - **Every finding has a source.** Each finding links to the turns it came
534
+ from; `report.html` expands them in place.
535
+ - **Pull request review preview.** `comitia post`, or the button
536
+ on a run's page, shows the review it would leave on the pull request the
537
+ run read: a finding that quotes a line of the diff becomes a comment on that
538
+ line, and the others go in the review body. The approval preset governs
539
+ posting. Comitia submits a comment review under your GitHub login and
540
+ records it with the run. If the pull request changed
541
+ since the run, findings are not placed on lines. Where findings go is not
542
+ part of the recipe: it follows from what was reviewed, and any run can be
543
+ printed as Markdown.
544
+ - **An answer given unread shows.** The report says how many findings each
545
+ participant stated and how many times it used its tools before answering
546
+ (`not at all` when it opened nothing), as its tool reported it: tool calls
547
+ for Codex and Antigravity, tool rounds for Claude Code. A tool that does not
548
+ say is left out.
549
+ - **No finding is lost.** Each participant's findings get references, and any
550
+ the report writer leaves out are added back on their own. If the writer
551
+ fails, the report lists them unmerged and says so at the top.
552
+ - **Resolved needs checked evidence.** On a check-again, reviewers first form
553
+ a fresh view with no earlier findings, then give each earlier finding a
554
+ verdict. `resolved` counts only with a quote that is in this run's copy of
555
+ the material and was not there when the finding was raised, or a cited
556
+ deletion that was there then and is gone. Unchanged material, a bare "fixed", or the
557
+ author's notes never count. If one reviewer has evidence and another says it
558
+ is still open, it stays open and shows as a disagreement.
559
+ - **Dismissed stays dismissed.** A reviewer can object, citing a turn, but
560
+ cannot reopen it.
561
+ - **Nothing else changes.** Runs live in `~/.comitia` (override with
562
+ `COMITIA_HOME`), outside the project, so reviewers reading the workspace do
563
+ not find earlier findings. Each run folder holds `plan.json`, a copy of the
564
+ material, `events.jsonl` (crossby's journal format), `findings.json` and the
565
+ report. The tools' own session storage is the exception.
566
+
567
+ ## Not yet
568
+
569
+ Hosts other than Claude Code, Codex, Antigravity's CLI and Cursor's CLI (the
570
+ Antigravity and Cursor apps are refused). A run that ended with its report, even a partial
571
+ one, is not resumed: its findings already have IDs; run the recipe again.
572
+ Isolation (`require_blocked: [reads_outside_workspace]`) runs on Claude Code
573
+ 2.1.328 or later only, so the `message-test` starter uses two Claude Code
574
+ personas; `comitia check` refuses any other tool there and says why.
575
+
576
+ ## Development
577
+
578
+ ```bash
579
+ uv venv && uv pip install -e ".[dev]"
580
+ .venv/bin/pytest && .venv/bin/ruff check . && .venv/bin/mypy src
581
+ ```
582
+
583
+ Tests run the whole flow against a stand-in for `crossby.api.ask`, so no model
584
+ is called.
585
+
586
+ ## License
587
+
588
+ Comitia is available under the [MIT License](LICENSE). The
589
+ [Crossby MIT notice](LICENSES/crossby-MIT.txt) covers code ported from Crossby.