@neocage/council 1.3.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,75 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
+ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.3.0] - 2026-09-09
10
+
11
+ ### Added
12
+ - npm packaging — `package.json` (scoped `@neocage/council`, public access) and an executable `bin/council.js` wrapper around `install.sh`, so the project is installable via `npx @neocage/council`.
13
+ - `.github/workflows/publish.yml` — publishes to npmjs.org and GitHub Packages on `v*.*.*` tag pushes; refuses to publish if the tag and `package.json` version disagree.
14
+
15
+ ## [1.2.0] - 2026-07-04
16
+
17
+ ### Added
18
+ - **Claude Code plugin-marketplace support** (#45) — `.claude-plugin/plugin.json` + `marketplace.json`; install with `/plugin marketplace add NeoCage/Council-of-Cognitive-Excellence` then `/plugin install council@council-of-cognitive-excellence`. Root `SKILL.md` remains the single source of truth via a `skills/council/` symlink; a new Asset Resolution section resolves agents/scripts/configs from either the install.sh layout or `${CLAUDE_PLUGIN_ROOT}`.
19
+ - **Confidence-weighted vote tally** (#44) — a member's vote weight is now base weight (1.0, or 1.5× domain seat) × confidence factor from their `STANCE:` line (`high 1.0 / med 0.75 / low 0.5`). `W_total` stays at full base weights, so a hesitant council raises its own consensus bar and escalates to the user rather than forcing a verdict (Roundtable Policy, arXiv:2509.16839; ConfMAD, arXiv:2509.14034).
20
+ - **Per-member `reasoning_method` frontmatter** (E3 / DMAD, arXiv:2410.12853) (#44) — all 18 personas declare a distinct reasoning method (elenchic-questioning, tail-stress-testing, causal-loop-mapping, …) and Round 1 prompts direct each member to reason via their method: method diversity, not just persona diversity.
21
+ - **Project-level `./.council.yaml` overrides** (E7) (#44) — pin `profile`/`triad`/`members`/`chairman`/`models`/`no_auto_route` per project; CLI flags always win.
22
+ - Standard repo furniture (#42) — `.gitignore`, `SECURITY.md`, `FUNDING.yml`, bug/feature/provider issue templates, and a PR template with a three-file protocol-parity checklist.
23
+ - **Structured stance voting + deterministic weighted tie-break.** The final round (full Round 3 / quick Round 2) now requires each member to emit a machine-parseable `STANCE: <option> | CONFIDENCE: … | DEALBREAKER: …` line, so consensus is a counted weighted tally rather than a prose impression. STEP 6 specifies the exact math: `W_option ≥ (2/3) × W_total`, with the on-domain seat carrying 1.5×. New **Vote Tally** field in the full and quick verdict templates records `option → weight` and which seat carried the weight. Mirrored in `SKILL.codex.md`.
24
+ - Cursor CLI provider support (`cursor_cli` archetype) — sixth dispatch path alongside subagent / codex_exec / gemini_cli / ollama_run / openai_compatible_api. Auto-detected via the `cursor-agent` binary; members run headless and read-only (`cursor-agent -p --mode ask --model <id>`). Cursor is a model aggregator (GPT-5.x / Claude / Gemini / Grok through one CLI), so routing treats it as a single provider for spread and steers diversity seats to cross-family models to avoid duplicating Anthropic bias. New `configs/provider-model-slots.cursor.example.yaml`, `cursor_cli` tiers in `configs/auto-route-defaults.yaml`, and `cursor_cli` as a valid `--chairman` tag.
25
+
26
+ ### Changed
27
+ - **Domain-weight seat (1.5×) is now designated at panel selection (STEP 0), before any positions exist** — previously chosen at tie-break time, which let the coordinator pick the heavyweight after seeing votes. Locking it up front removes that nudge.
28
+ - README "Enforcement Mechanisms" rewritten to state the actual forcing function (bounded round budget + anti-recursion guards) and that genuine splits escalate to the user instead of being forced into consensus.
29
+ - **CI drift guards are now real** (#42) — `council-simulation-checklist.sh` executes in CI (it never ran before), extended with full `SKILL.gemini.md` parity checks and a three-file STANCE/Vote-Tally/1.5×/2-3-threshold parity gate; markdownlint's variadic `--disable` was missing its trailing `--` and silently linted zero files — rule selection now lives in `.markdownlint.json` and covers all doc files.
30
+ - `install.sh` derives the generated `gemini-extension.json` version from CHANGELOG instead of a hardcoded string; model IDs reconciled across configs/docs (`gemini-3-pro`, `gpt-5.4` generation); README/CLAUDE.md document the `--gemini` install path and marketplace install.
31
+
32
+ ### Fixed
33
+ - **`SKILL.gemini.md` drift regression** (#42) — the Gemini coordinator was missing structured stance voting, the weighted 2/3 tie-break, and the Vote Tally verdict field entirely; `SKILL.codex.md` referenced a Vote Tally field its own verdict template lacked.
34
+ - `SKILL.md` `classic` profile said "All 11 members" — the roster is 18 (#42).
35
+ - Shell-injection surface in external dispatch templates — prompts now route through quoted heredocs instead of being inlined into double-quoted argv; API keys no longer appear in `ps`-visible curl argv (#42).
36
+ - Tracked `.DS_Store` and a stray `.gstack` error log removed; junk excluded from release tarballs (#42).
37
+
38
+ ## [1.1.0] - 2026-05-21
39
+
40
+ ### Added
41
+ - `SKILL.codex.md` — dedicated Codex council coordinator
42
+ - Codex install support in `install.sh` (`--codex`, `--codex-only` flags) with reliability hardening
43
+ - NVIDIA NIM provider support (`configs/provider-model-slots.nim.example.yaml`) — auto-detection via `NVIDIA_API_KEY`
44
+ - Round 2 cross-examination anonymization — peer Round 1 outputs are masked behind stable `Member A/B/C` labels in full and quick modes (Choi et al., arXiv:2510.07517; Karpathy `llm-council`)
45
+ - Anti-conformity directive — Round 2 prompts in all three modes now require members to name the specific flaw in their earlier argument before updating; defends correct prior positions against social pressure (Cui et al., Free-MAD, arXiv:2509.11035)
46
+ - Explicit Chairman role — synthesis (STEP 7, QUICK STEP 3, DUO STEP 4) is performed by a named model selected via STEP 1.7; new `--chairman <name>` flag, `chairman_defaults:` block in `configs/auto-route-defaults.yaml`, and a hard constraint that Chairman cannot be a panel member
47
+ - Verdict actionability sections — `Acceptable Compromises`, `Kill Criteria`, `Concrete Next Step` are now required in every verdict (full mode); quick and duo modes require subsets per the per-mode policy
48
+ - `openai_compatible_api` provider archetype — fifth dispatch path alongside subagent / codex_exec / gemini_cli / ollama_run; routes NIM seats (and future Together / Fireworks / vLLM) via `/chat/completions` with credentials resolved from `api_key_env` at runtime
49
+ - Session Metadata block (`schema_version: 1`) — appended to every verdict with `mode`, `panel_size`, `rounds_run`, `tools_used`, `provider_count`, `fallbacks_triggered`, plus best-effort token / duration estimates
50
+ - CI hardening — `.gitattributes` for LF normalization, `.github/workflows/lint.yml` (shellcheck + markdownlint), `.github/workflows/release.yml` (tarball + auto release notes from CHANGELOG on `v*.*.*` tag), `CHANGELOG.md` itself
51
+
52
+ ### Changed
53
+ - README updated with header image, quickstart, and open-source best practices
54
+
55
+ ### Fixed
56
+ - Dead code in `scripts/council-simulation-checklist.sh` that tripped ShellCheck SC2317 under CI
57
+
58
+ ## [1.0.0] - 2026-03-30
59
+
60
+ ### Added
61
+ - 18 council member personas: Aristotle, Socrates, Sun Tzu, Ada Lovelace, Marcus Aurelius, Machiavelli, Lao Tzu, Feynman, Torvalds, Musashi, Watts, Karpathy, Sutskever, Kahneman, Meadows, Munger, Taleb, Rams
62
+ - 3-round structured deliberation protocol: Problem Restate Gate → Blind Analysis → Cross-Examination → Crystallization → Verdict
63
+ - Post-round enforcement scan: dissent quota, novelty gate, agreement check (>70% triggers mandatory counterfactual), evidence labeling, anti-recursion rule
64
+ - Quick mode (2-round), Duo mode (2-member deliberation), pre-defined triads by domain
65
+ - Multi-provider auto-detection (`scripts/detect-providers.sh`) — routes council members across Claude, Codex (OpenAI), and Ollama
66
+ - Execution profiles (`configs/auto-route-defaults.yaml`) and simulation checklist (`scripts/council-simulation-checklist.sh`)
67
+ - Provider model slot template (`configs/provider-model-slots.example.yaml`)
68
+
69
+ ### Fixed
70
+ - Default OpenAI model for Codex set to `gpt-5.4` (E2E test found o3/o4-mini unavailable on standard ChatGPT accounts)
71
+
72
+ [Unreleased]: https://github.com/NeoCage/Council-of-Cognitive-Excellence/compare/v1.2.0...HEAD
73
+ [1.2.0]: https://github.com/NeoCage/Council-of-Cognitive-Excellence/releases/tag/v1.2.0
74
+ [1.1.0]: https://github.com/NeoCage/Council-of-Cognitive-Excellence/releases/tag/v1.1.0
75
+ [1.0.0]: https://github.com/NeoCage/Council-of-Cognitive-Excellence/releases/tag/v1.0.0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 nyk
4
+ Modifications copyright (c) 2026 NeoCage
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,258 @@
1
+ # Council of Cognitive Excellence
2
+
3
+ <p align="center">
4
+ <img src="assets/header.png" alt="Council of Cognitive Excellence" width="800">
5
+ </p>
6
+
7
+ <p align="center">
8
+ Structured multi-perspective deliberation for decisions that deserve more than one reasoning path.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/NeoCage/Council-of-Cognitive-Excellence/actions/workflows/lint.yml"><img src="https://github.com/NeoCage/Council-of-Cognitive-Excellence/actions/workflows/lint.yml/badge.svg" alt="Lint"></a>
13
+ <a href="https://github.com/NeoCage/Council-of-Cognitive-Excellence/releases"><img src="https://img.shields.io/github/v/release/NeoCage/Council-of-Cognitive-Excellence" alt="Release"></a>
14
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ Claude Code · Codex · Gemini CLI · OpenCode
19
+ </p>
20
+
21
+ The council assigns a hard question to deliberately different analytical personas, keeps
22
+ their first positions independent, forces direct disagreement, and returns a verdict that
23
+ preserves unresolved questions, dissent, kill criteria, and the next concrete action.
24
+
25
+ ## Try a council
26
+
27
+ Claude Code users can install the plugin directly:
28
+
29
+ ```text
30
+ /plugin marketplace add NeoCage/Council-of-Cognitive-Excellence
31
+ /plugin install council@council-of-cognitive-excellence
32
+ ```
33
+
34
+ Then convene the full council, a faster panel, or a two-member dialectic:
35
+
36
+ ```text
37
+ /council Should we open-source our agent framework?
38
+ /council --quick Should we add caching here?
39
+ /council --duo Should we use microservices or a monolith?
40
+ ```
41
+
42
+ For Codex, Gemini CLI, or OpenCode, clone once and use the matching installer flag:
43
+
44
+ ```bash
45
+ git clone https://github.com/NeoCage/Council-of-Cognitive-Excellence.git
46
+ cd council-of-cognitive-excellence
47
+
48
+ ./install.sh --codex-only
49
+ ./install.sh --gemini-only
50
+ ./install.sh --opencode-only
51
+ ```
52
+
53
+ Restart the target client after installation. The command remains `/council` on every
54
+ supported host.
55
+
56
+ ## Use it for the decision boundary
57
+
58
+ Good council questions have material downside, competing values, incomplete evidence, or
59
+ an irreversible choice. Write down the decision, constraints, evidence, reversibility, and
60
+ deadline before adding personas.
61
+
62
+ ![Decision field notes](assets/decision-field-notes.png)
63
+
64
+ The field notes distinguish facts from inference, assumptions, and unknowns. They also make
65
+ it harder to use a long deliberation as decoration for a decision already made.
66
+
67
+ ### When to use something smaller
68
+
69
+ - Use a direct answer or primary documentation for factual lookups.
70
+ - Run an experiment when the choice is cheap and reversible.
71
+ - Use `--quick` when cross-examination will not change the outcome.
72
+ - Use `--duo` when one tension matters more than broad coverage.
73
+ - Do not convene a council to manufacture support for a preferred answer.
74
+
75
+ ## Choose a mode
76
+
77
+ | Mode | Shape | Use it when |
78
+ |---|---|---|
79
+ | Full | Independent analysis, cross-examination, final stance, synthesis | Stakes are high and competing frames need contact |
80
+ | Quick | Restate, rapid analysis, final positions | The decision needs breadth but not a full adversarial round |
81
+ | Duo | Opening positions, direct response, final statements | One polarity defines the decision |
82
+
83
+ ![Council mode selector](assets/mode-selector.png)
84
+
85
+ ```text
86
+ /council --full What is the right pricing model?
87
+ /council --quick --triad shipping Should we release today?
88
+ /council --duo --members torvalds,ada Is this abstraction worth it?
89
+ ```
90
+
91
+ Named triads select three relevant lenses without assembling the whole council:
92
+
93
+ ```text
94
+ /council --triad strategy Where is our defensible advantage?
95
+ /council --triad risk What could make this launch irreversible?
96
+ /council --triad ai-product Which capability belongs in the product?
97
+ ```
98
+
99
+ Available domains include `architecture`, `strategy`, `ethics`, `debugging`, `risk`,
100
+ `shipping`, `product`, `founder`, `ai`, `ai-product`, `ai-safety`, `decision`, `systems`,
101
+ `uncertainty`, `design`, `economics`, and `bias`. The canonical routing table lives in
102
+ [`SKILL.md`](SKILL.md).
103
+
104
+ ## What the protocol protects
105
+
106
+ The full protocol has a fixed round budget. Members first restate the problem, analyze
107
+ blind, cross-examine other positions, declare a final stance, and then enter synthesis.
108
+ Enforcement checks look for premature agreement, repeated claims, missing dissent, and
109
+ unsupported confidence.
110
+
111
+ ![Verdict blueprint](assets/verdict-blueprint.png)
112
+
113
+ Verdicts lead with what remains unresolved. A recommendation is paired with acceptable
114
+ compromises, kill criteria, and one concrete next step. When the weighted tally remains
115
+ split, the result returns that split to the user instead of turning it into prose consensus.
116
+
117
+ Evidence labels separate:
118
+
119
+ - `FACT`: directly supported by supplied or retrieved evidence;
120
+ - `INFERENCE`: follows from evidence but is not directly observed;
121
+ - `ASSUMPTION`: required for the argument and still unverified;
122
+ - `UNKNOWN`: missing information that could change the decision.
123
+
124
+ ## Track the outcome
125
+
126
+ A verdict is useful only if it can be checked later. Before acting, record the prediction,
127
+ owner, review date, and evidence that would change the recommendation. At the checkpoint,
128
+ mark the result confirmed, revised, reversed, or inconclusive instead of rewriting the
129
+ original rationale.
130
+
131
+ ![Council outcome ledger](assets/outcome-ledger.png)
132
+
133
+ ## The 18 lenses
134
+
135
+ Members are analytical instruments, not impersonation claims. Each persona has a grounding
136
+ protocol, a method, known blind spots, and a structured response contract.
137
+
138
+ ![Council panel composition](assets/panel-composition.png)
139
+
140
+ | Member | Primary lens | Useful counterweight |
141
+ |---|---|---|
142
+ | Aristotle | Categories and structure | Lao Tzu on emergence and excess structure |
143
+ | Socrates | Assumption destruction | Feynman on reconstruction from first principles |
144
+ | Sun Tzu | Terrain and adversarial strategy | Aurelius on internal control and moral cost |
145
+ | Ada Lovelace | Formal systems and abstraction | Machiavelli on incentives and informal power |
146
+ | Marcus Aurelius | Resilience and moral clarity | Sun Tzu on external competition |
147
+ | Machiavelli | Power and incentives | Ada on formal consistency |
148
+ | Lao Tzu | Non-action and emergence | Aristotle on explicit categories |
149
+ | Richard Feynman | Explanation and empirical debugging | Socrates on the premise itself |
150
+ | Linus Torvalds | Shipping and maintainability | Meadows on system-level consequences |
151
+ | Miyamoto Musashi | Timing and decisive action | Torvalds on acting before the ideal moment |
152
+ | Alan Watts | Reframing and false problems | Torvalds on concrete implementation |
153
+ | Andrej Karpathy | Empirical ML behavior | Sutskever on frontier risk |
154
+ | Ilya Sutskever | Scaling and AI safety | Karpathy on observation and iteration |
155
+ | Daniel Kahneman | Cognitive bias | Feynman on explicit causal reasoning |
156
+ | Donella Meadows | Feedback loops and high-impact interventions | Torvalds on local fixes |
157
+ | Charlie Munger | Inversion and model lattices | Aristotle on single-system classification |
158
+ | Nassim Taleb | Tail risk and fragility | Karpathy on smooth empirical trends |
159
+ | Dieter Rams | User clarity and restraint | Ada on what can be formalized |
160
+
161
+ The repository stores each member contract under [`agents/`](agents/). Custom panels can
162
+ use `--members`, named triads, or the `classic`, `exploration-orthogonal`, and
163
+ `execution-lean` profiles documented in [`SKILL.md`](SKILL.md).
164
+
165
+ ## Multi-provider routing
166
+
167
+ The detection script checks which supported providers are available, then the coordinator
168
+ distributes seats across them. Polarity pairs are separated when possible so a single model
169
+ family does not play both sides of a disagreement.
170
+
171
+ ![Council provider routing](assets/provider-routing.png)
172
+
173
+ | Provider path | Detection |
174
+ |---|---|
175
+ | Native host subagents | Available through the active supported client |
176
+ | OpenAI | `codex` executable |
177
+ | Google | `gemini` executable |
178
+ | Ollama | `ollama` executable |
179
+ | NVIDIA NIM | `NVIDIA_API_KEY` |
180
+ | Cursor | `cursor-agent` executable or configured login |
181
+
182
+ Preview routing without running a council:
183
+
184
+ ```text
185
+ /council --dry-route --triad decision Should we accept this acquisition offer?
186
+ ```
187
+
188
+ Use `--no-auto-route` to keep native-host defaults. Use `--models <path>` with a copy of
189
+ [`configs/provider-model-slots.example.yaml`](configs/provider-model-slots.example.yaml)
190
+ for an explicit seat map. Provider failure is reported before the seat falls back to the
191
+ native host.
192
+
193
+ ## Installation reference
194
+
195
+ ```bash
196
+ ./install.sh # Claude Code
197
+ ./install.sh --codex # Claude Code + Codex
198
+ ./install.sh --codex-only # Codex only
199
+ ./install.sh --gemini # Claude Code + Gemini CLI
200
+ ./install.sh --gemini-only # Gemini CLI only
201
+ ./install.sh --opencode # Claude Code + OpenCode
202
+ ./install.sh --opencode-only # OpenCode only
203
+ ./install.sh --copy-configs # Include provider-routing templates
204
+ ./install.sh --dry-run # Preview writes
205
+ ```
206
+
207
+ Custom target directories are supported through `--claude-dir`, `--codex-dir`,
208
+ `--gemini-dir`, and `--opencode-dir`. Run `./install.sh --help` for the current contract.
209
+
210
+ ## Verify the checkout
211
+
212
+ ```bash
213
+ ./scripts/council-simulation-checklist.sh
214
+ ./install.sh --dry-run --codex
215
+ ./install.sh --dry-run --gemini
216
+ ./install.sh --dry-run --opencode
217
+ ```
218
+
219
+ The checklist validates persona structure, host-protocol parity, routing configuration,
220
+ execution checkpoints, verdict fields, and installer behavior. Use the
221
+ [demo session pack](demos/session-pack.md) to exercise full, quick, and duo modes.
222
+
223
+ ## Repository map
224
+
225
+ ```text
226
+ SKILL.md canonical coordinator protocol
227
+ SKILL.codex.md Codex host mirror
228
+ SKILL.gemini.md Gemini CLI host mirror
229
+ SKILL.opencode.md OpenCode host mirror
230
+ agents/ 18 grounded persona contracts
231
+ configs/ provider and model-routing examples
232
+ demos/ sample sessions and verdict template
233
+ scripts/ detection, conversion, and validation tools
234
+ assets/ brand system and README visuals
235
+ install.sh multi-host installer
236
+ ```
237
+
238
+ Protocol changes start in `SKILL.md` and must remain behaviorally aligned with each host
239
+ mirror. See [CONTRIBUTING.md](CONTRIBUTING.md) for the required checks and review contract.
240
+ Security reports belong in [SECURITY.md](SECURITY.md), not a public issue.
241
+
242
+ ## Project links
243
+
244
+ - [Release history](CHANGELOG.md)
245
+ - [Brand kit](assets/BRAND.md)
246
+ - [Issues](https://github.com/NeoCage/Council-of-Cognitive-Excellence/issues)
247
+ - [Maintainer: NeoCage](https://github.com/NeoCage)
248
+
249
+ <p align="center">
250
+ <picture>
251
+ <source media="(prefers-color-scheme: dark)" srcset="assets/star-history-dark.svg">
252
+ <img src="assets/star-history-light.svg" alt="Council of Cognitive Excellence star history" width="600">
253
+ </picture>
254
+ </p>
255
+
256
+ ## License
257
+
258
+ [MIT](LICENSE)
package/SKILL.codex.md ADDED
@@ -0,0 +1,250 @@
1
+ ---
2
+ name: council
3
+ description: "Convene the Council of Cognitive Excellence in Codex when the user asks for /council, council deliberation, triads, duo debates, or multi-perspective decision analysis."
4
+ ---
5
+
6
+ # /council for Codex
7
+
8
+ You are the Council Coordinator. Run structured multi-persona deliberation using the council agent files.
9
+
10
+ ## Invocation Patterns
11
+
12
+ ```
13
+ /council [problem]
14
+ /council --quick [problem]
15
+ /council --duo [problem]
16
+ /council --triad [domain] [problem]
17
+ /council --members socrates,feynman,ada [problem]
18
+ /council --profile exploration-orthogonal [problem]
19
+ ```
20
+
21
+ ## Flags
22
+
23
+ | Flag | Effect |
24
+ |------|--------|
25
+ | `--full` | Use all 18 members |
26
+ | `--quick` | 2-round fast mode |
27
+ | `--duo` | 2-member polarity dialectic |
28
+ | `--triad [domain]` | Use predefined 3-member panel |
29
+ | `--members a,b,c` | Use explicit member names |
30
+ | `--profile [name]` | Use profile panel (`classic`, `exploration-orthogonal`, `execution-lean`) |
31
+
32
+ If no panel flag is present, auto-select the best triad from problem context.
33
+
34
+ ## Member Roster
35
+
36
+ `aristotle, socrates, sun-tzu, ada, aurelius, machiavelli, lao-tzu, feynman, torvalds, musashi, watts, karpathy, sutskever, kahneman, meadows, munger, taleb, rams`
37
+
38
+ ## Triads
39
+
40
+ | Domain | Members |
41
+ |--------|---------|
42
+ | `architecture` | aristotle, ada, feynman |
43
+ | `strategy` | sun-tzu, machiavelli, aurelius |
44
+ | `ethics` | aurelius, socrates, lao-tzu |
45
+ | `debugging` | feynman, socrates, ada |
46
+ | `innovation` | ada, lao-tzu, aristotle |
47
+ | `conflict` | socrates, machiavelli, aurelius |
48
+ | `complexity` | lao-tzu, aristotle, ada |
49
+ | `risk` | sun-tzu, aurelius, feynman |
50
+ | `shipping` | torvalds, musashi, feynman |
51
+ | `product` | torvalds, machiavelli, watts |
52
+ | `founder` | musashi, sun-tzu, torvalds |
53
+ | `ai` | karpathy, sutskever, ada |
54
+ | `ai-product` | karpathy, torvalds, machiavelli |
55
+ | `ai-safety` | sutskever, aurelius, socrates |
56
+ | `decision` | kahneman, munger, aurelius |
57
+ | `systems` | meadows, lao-tzu, aristotle |
58
+ | `uncertainty` | taleb, sun-tzu, sutskever |
59
+ | `design` | rams, torvalds, watts |
60
+ | `economics` | munger, machiavelli, sun-tzu |
61
+ | `bias` | kahneman, socrates, watts |
62
+
63
+ ## Profiles
64
+
65
+ - `classic`: all 18 members
66
+ - `exploration-orthogonal`: socrates, feynman, sun-tzu, machiavelli, ada, lao-tzu, aurelius, torvalds, karpathy, sutskever, kahneman, meadows
67
+ - `execution-lean`: torvalds, feynman, sun-tzu, aurelius, ada
68
+
69
+ ## Execution Protocol
70
+
71
+ ### Step 1: Locate Council Assets
72
+
73
+ Resolve council files in this order:
74
+
75
+ 1. `~/.codex/skills/council/agents/`
76
+ 2. `./agents/`
77
+
78
+ If neither exists, stop and tell the user to run `./install.sh --codex`.
79
+
80
+ ### Step 2: Parse Request
81
+
82
+ Project overrides: if `./.council.yaml` exists in the working directory, treat its keys (`profile`, `triad`, `members`, `chairman`, `models`, `no_auto_route`) as default flag values. Explicit flags always win.
83
+
84
+ Extract:
85
+
86
+ - Mode: `full` (default), `quick`, or `duo`
87
+ - Problem statement
88
+ - Panel selection via `--members`, `--triad`, `--profile`, or `--full`
89
+
90
+ For `--duo` without explicit members, choose a polarity pair from keywords:
91
+
92
+ - architecture/structure: `aristotle` + `lao-tzu`
93
+ - shipping/execution: `torvalds` + `musashi`
94
+ - strategy/competition: `sun-tzu` + `aurelius`
95
+ - ai/ml/model: `karpathy` + `sutskever`
96
+ - decision/bias: `kahneman` + `feynman`
97
+ - default fallback: `socrates` + `feynman`
98
+
99
+ ### Step 2.5: Runtime Reliability Defaults
100
+
101
+ Use these defaults unless the user requests stricter/faster behavior:
102
+
103
+ - `spawn_timeout_ms`: 45000 per member
104
+ - `round_timeout_ms`: 60000 for quick/duo, 90000 for full
105
+ - `retry_attempts`: 2 retries after initial attempt (max 3 total attempts per seat per round)
106
+ - `retry_backoff_sec`: 2, then 5
107
+ - `hard_min_live_seats`: 2
108
+
109
+ Track seat state per member:
110
+
111
+ - `live`: normal agent responses
112
+ - `degraded`: agent timed out/failed and is being simulated from persona file
113
+ - `offline`: could not recover enough information for this seat
114
+
115
+ ### Step 3: Run Restatement Gate (Parallel)
116
+
117
+ Spawn one sub-agent per selected member with `spawn_agent`, `fork_context=true`.
118
+
119
+ Prompt template:
120
+
121
+ ```
122
+ Read and follow this persona file exactly: {agent_file_path}
123
+
124
+ Problem:
125
+ {problem}
126
+
127
+ Return only:
128
+ 1) Your restatement (one sentence)
129
+ 2) Alternative framing (one sentence)
130
+ Maximum 50 words total.
131
+ ```
132
+
133
+ Wait with `spawn_timeout_ms`. If a seat fails or times out:
134
+
135
+ 1. Retry spawn up to `retry_attempts` using backoff.
136
+ 2. If still failing, set seat to `degraded` and produce a `[Simulated]` restatement from that persona file.
137
+ 3. If persona file cannot be read, mark seat `offline`.
138
+
139
+ If live seats drop below `hard_min_live_seats`, switch to fully simulated mode for all seats and state this explicitly.
140
+
141
+ ### Step 3.5: External Seats (HTTP and CLI archetypes)
142
+
143
+ Some provider archetypes are dispatched outside the host runtime's `spawn_agent`. Anonymization (Step 4) and Chairman selection (Step 5) apply equally to these seats — no special-case logic.
144
+
145
+ **`openai_compatible_api` (NVIDIA NIM today; Together / Fireworks / vLLM in the future)** — dispatch via HTTP:
146
+
147
+ - Read `base_url` and `api_key_env` from the seat config (or detection JSON for auto-routing).
148
+ - Resolve the API key from the env var at routing time. Never inline.
149
+ - POST to `{base_url}/chat/completions` with an OpenAI-compatible payload (system+user messages, `temperature: 0.7`, `max_tokens: 1200`).
150
+ - Extract `.choices[0].message.content`. If empty or non-2xx, mark the seat `degraded` and apply the standard fallback (anthropic per the agent's `model` frontmatter).
151
+ - Per-seat timeout: 90 seconds (hosted open-weight endpoints are slower than first-party APIs).
152
+
153
+ **`cursor_cli` (Cursor)** — dispatch via subprocess. Cursor is a model aggregator: one binary (`cursor-agent`) serves GPT-5.x, Claude, Gemini, and Grok families.
154
+
155
+ - Run headless and read-only: `cursor-agent -p --mode ask --model {model} --output-format text "{full prompt}"`.
156
+ - Auth is resolved by the CLI itself (prior `cursor-agent login` or `CURSOR_API_KEY`). Never inline a key. On auth error, mark the seat `degraded` and apply the standard fallback.
157
+ - Empty stdout or non-zero exit → `degraded` + fallback. Per-seat timeout: 90 seconds.
158
+ - Counts as a single provider for spread. Because Cursor can serve `claude-*` models, prefer cross-family models (`gpt-*`, `gemini-*`, `grok-*`) for any seat opposite a native `anthropic` seat in a polarity pair. Verify live IDs with `cursor-agent --list-models`.
159
+
160
+ ### Step 4: Deliberation Rounds
161
+
162
+ Keep the same spawned agents for all rounds via `send_input`.
163
+
164
+ **Round 2 anonymization (full and quick modes).** Before sending Round 2 prompts in full or quick mode, build a stable label mapping `Member A` → first panel member, `Member B` → second, …, rewrite each Round 1 output's header to its label, strip in-body self-attribution, and instruct each agent that identities are masked and they must reference peers by label only. Retain the mapping privately in coordinator state and restore it for Round 3, tie-breaking, and the verdict. Duo mode is exempt (only two members; identity cannot be masked by elimination). Rationale: Choi et al. (arXiv:2510.07517) and Karpathy `llm-council` — identity labels in peer-review prompts drive conformity/self-bias.
165
+
166
+ **Anti-conformity directive (Round 2, all modes).** When sending Round 2 prompts, include this paragraph verbatim before the per-mode instructions:
167
+
168
+ > Anti-conformity directive. If your Round 1 position was correct, defend it. Do not update merely because peers disagree, because consensus is forming, or because a position is repeated by multiple members. Update only when presented with sound, validity-aligned reasoning that exposes a specific flaw in your earlier argument. Naming that flaw is required when you update; if you cannot name it, you should not update.
169
+
170
+ Rationale: Choi et al. (arXiv:2510.07517), Free-MAD (arXiv:2509.11035), controlled-study arXiv:2511.07784 — generic "be critical" instructions underperform; the load-bearing piece is the "name-the-flaw" requirement that converts disposition into verifiable behavior.
171
+
172
+ Round 1 prompts must instruct each member to reason via the reasoning_method field in their frontmatter (DMAD, arXiv:2410.12853) — method diversity, not just persona diversity.
173
+
174
+ Full mode:
175
+
176
+ 1. Round 1: Independent analysis, blind-first, max 300 words/member.
177
+ 2. Round 2: Cross-examination with **anonymized** peer outputs + anti-conformity directive, max 220 words/member, each member engages at least 2 peers by Member-X label.
178
+ 3. Round 3: Final position, max 100 words/member. Real names restored.
179
+
180
+ Quick mode:
181
+
182
+ 1. Round 1: Restate + rapid analysis, max 200 words/member.
183
+ 2. Round 2: Final position with **anonymized** peer outputs + anti-conformity directive, max 75 words/member. Real names restored in the verdict.
184
+
185
+ Duo mode:
186
+
187
+ 1. Round 1: Opening position, max 250 words/member.
188
+ 2. Round 2: Direct response to counterpart with anti-conformity directive, max 180 words/member. (No anonymization — see rationale above.)
189
+ 3. Round 3: Final statement, max 60 words/member.
190
+
191
+ (Round word caps above are deliberately tighter than `SKILL.md`'s Claude-host caps — this host runs a compressed protocol. The caps in this file are canonical when coordinating from Codex.)
192
+
193
+ Structured stance & weighted tie-breaking (full + quick modes):
194
+
195
+ 1. **Designate the domain-weight seat at panel selection** (before any analysis): the single member whose domain most directly matches the problem carries **1.5×** weight; all others **1.0×**. Lock it up front — selecting it after seeing positions would let the coordinator nudge the outcome. If the match is ambiguous, designate none and tie-break on equal weights.
196
+ 2. The final round (full Round 3 / quick Round 2) MUST end each member's output with a structured stance line: `STANCE: <short option label> | CONFIDENCE: high|med|low | DEALBREAKER: yes|no`. Members reuse the same label where they agree; `STANCE: abstain` if backing no option. Re-prompt for a missing/unparseable line — never infer stance from prose.
197
+ 3. Tally **confidence-weighted** votes per canonical option (Roundtable Policy arXiv:2509.16839; ConfMAD arXiv:2509.14034): vote weight = base weight (1.0, or 1.5 for the domain seat) × confidence factor (`high → 1.0`, `med → 0.75`, `low → 0.5`). Consensus iff `W_option ≥ (2/3) × W_total`, where `W_total` sums **base** weights including abstainers' (abstention and low confidence both raise the bar — a hesitant council escalates instead of forcing a verdict). Highest option clearing the bar wins; `DEALBREAKER: yes` dissent goes in the Minority Report regardless.
198
+ 4. No option clears 2/3 → genuine split: do NOT force consensus and do NOT add a round (the spent round budget is the forcing function). Present each option with its weighted tally to the user. Record the tally (`option → weight`, marking the 1.5× seat) in the verdict's Vote Tally field. Duo mode issues no tally — it is dialectic, not decision-issuing.
199
+
200
+ Round execution reliability policy:
201
+
202
+ 1. Send prompts to all `live` seats in parallel.
203
+ 2. Wait using `round_timeout_ms`.
204
+ 3. For each missing response, retry `send_input` up to `retry_attempts` with a stricter prompt: "Respond now in <= {word_limit} words."
205
+ 4. If still missing, move seat to `degraded` and generate `[Simulated]` output from persona instructions plus prior round context.
206
+ 5. Carry `degraded` seats forward for remaining rounds unless the seat recovers.
207
+ 6. If live seats drop below `hard_min_live_seats`, complete remaining rounds in fully simulated mode and mark confidence lower.
208
+
209
+ ### Step 5: Synthesis Output (CHAIRMAN)
210
+
211
+ Synthesis is performed by an explicit **Chairman** — a model that did NOT deliberate in Rounds 1–3. The Chairman is selected before Round 1 using this algorithm (first match wins):
212
+
213
+ 1. **Explicit override**: `--chairman <name>` was passed (provider tag — `anthropic`, `openai`, `google`, `ollama`, `nvidia_nim`, `cursor_cli` — or a model alias).
214
+ 2. **Auto-select**: highest-tier model among available providers, **preferring one not on the panel** when possible. Tie-breaker: provider listed first by the host runtime.
215
+ 3. **Single-provider fallback**: use that provider's highest tier and note the overlap in the verdict.
216
+
217
+ The Chairman is dispatched as a single call with the full audit transcript (Round 2 de-anonymized using the mapping retained in coordinator state — see Step 4 anonymization). Constraint: Chairman MUST NOT be a deliberating member in the same session.
218
+
219
+ Return a verdict with this order, produced by the Chairman:
220
+
221
+ 1. `Selected Panel` (members + mode)
222
+ 2. `Chairman` (name, provider, model, selection rationale)
223
+ 3. `Acceptable Compromises` — what this verdict gives up, named explicitly (required in full; optional in quick; encouraged in duo)
224
+ 4. `Kill Criteria` — observable conditions that would falsify the verdict; format `"If <X> by <date>, invalidated → <Y>"` (required in full and quick; encouraged in duo)
225
+ 5. `Concrete Next Step` — exactly one action with an artifact-producing verb (required in all modes)
226
+ 6. `Unresolved Questions`
227
+ 7. `Key Agreements`
228
+ 8. `Key Disagreements`
229
+ 9. `Vote Tally` — the weighted stance tally from Step 4: one line per option `<option> — <weight> (<backers>)`, marking the 1.5× domain-weight seat, with the 2/3 threshold and whether it was cleared (full + quick modes; duo issues no tally)
230
+ 10. `Decision Options` (2-4 options with tradeoffs)
231
+ 11. `Recommended Next Steps` (additional actions beyond Concrete Next Step; ordered)
232
+ 12. `Confidence` (high/medium/low + why)
233
+ 13. `Execution Reliability` (live/degraded/offline seat counts and any timeout caveats)
234
+
235
+ Always preserve dissent. Never flatten disagreements into fake consensus. Sections 3-5 are non-negotiable in full mode — they make the verdict operational (observable, falsifiable, actionable) instead of advisory prose.
236
+
237
+ **Chairman fallback**: if the Chairman call fails or times out, the coordinator synthesizes the verdict directly and annotates `Chairman: <name> (FAILED — synthesized by coordinator fallback)`.
238
+
239
+ ### Step 6: Fallback Behavior
240
+
241
+ If `spawn_agent` is unavailable or too many seats fail, run a local simulated council:
242
+
243
+ - Read each selected persona file.
244
+ - Produce clearly labeled `[Simulated]` outputs per member.
245
+ - Keep the same round structure.
246
+ - Explicitly state why fallback was used (`spawn unavailable`, `timeouts`, or `seat failures`).
247
+
248
+ ### Step 7: Session Metadata (issue #7, Phase 1)
249
+
250
+ After the verdict is emitted, append a `Session Metadata` block with `schema_version: 1` containing: `mode`, `panel_size`, `rounds_run`, `tools_used`, `provider_count`, `fallbacks_triggered`, and best-effort `input_tokens_estimate` / `output_tokens_estimate` / `duration_seconds` (write `~unknown` if not available from the host runtime). Block is delimited by `---` so it's grep-able and redirectable.