@balpal4495/quorum 1.0.0 → 3.0.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/SETUP.md CHANGED
@@ -12,9 +12,16 @@ If you have Node.js 18+ available, run this from the project root:
12
12
  npx @balpal4495/quorum@latest init
13
13
  ```
14
14
 
15
- This handles all steps below automatically — copying modules, merging instruction files, updating `package.json`, `.gitignore`, and creating the Chronicle directory.
15
+ This handles all steps below automatically — writing Quorum docs, merging instruction files,
16
+ updating `package.json`, `.gitignore`, and creating the Chronicle directory.
16
17
 
17
- After it completes, run `npm install` and wire `setup()` into your entry point (see Step 6 below).
18
+ After it completes, run `npm install`. The CLI is immediately usable:
19
+
20
+ ```bash
21
+ quorum advisor brief
22
+ quorum advisor "what has the team decided about X?"
23
+ quorum check --outcome '...' --design '...'
24
+ ```
18
25
 
19
26
  ---
20
27
 
@@ -29,9 +36,9 @@ Do not skip steps. Do not ask for confirmation between steps — complete the fu
29
36
 
30
37
  Read these files in full before proceeding:
31
38
 
32
- - `quorum/modules/README.md` — module overview and quick-start
33
- - `quorum/modules/AGENTS.md` — file ownership and invariants
34
- - `.github/copilot-instructions.md` — workflow rules for AI agents (installed at project root by init)
39
+ - `quorum/AGENTS.md` — module file ownership and invariants
40
+ - `quorum/CLAUDE.md` — design decisions and constraints
41
+ - `.github/copilot-instructions.md` — workflow rules for AI agents
35
42
 
36
43
  These are your operating instructions for everything that follows.
37
44
 
@@ -52,14 +59,12 @@ Does .chronicle/ exist? yes / no
52
59
 
53
60
  ---
54
61
 
55
- ## Step 3 — Install dependencies
62
+ ## Step 3 — Install Quorum
56
63
 
57
- Open `package.json` at the project root. Add the following to `dependencies` if they are not already present:
64
+ Open `package.json` at the project root. Add to `devDependencies` if not already present:
58
65
 
59
66
  ```json
60
- "zod": "^3.23.0",
61
- "vectordb": "^0.4.0",
62
- "@xenova/transformers": "^2.17.0"
67
+ "@balpal4495/quorum": "^2.0.0"
63
68
  ```
64
69
 
65
70
  Then run:
@@ -70,77 +75,57 @@ npm install
70
75
 
71
76
  If the project uses `yarn` or `pnpm`, use the appropriate installer instead.
72
77
 
73
- > `zod` is required for all structured LLM output validation.
74
- > `vectordb` is the LanceDB adapter (swappable — see `quorum/modules/oracle/adapters/`).
75
- > `@xenova/transformers` is the local ONNX embedder (swappable — see `quorum/modules/oracle/adapters/xenova-embedder.ts`).
76
-
77
78
  ---
78
79
 
79
80
  ## Step 4 — Merge AI instruction files
80
81
 
81
82
  ### 4a. `.github/copilot-instructions.md`
82
83
 
83
- The automated init command (`npx @balpal4495/quorum@latest init`) handles this step automatically — it creates or appends to `.github/copilot-instructions.md` at the project root.
84
+ The automated init command handles this step automatically.
84
85
 
85
- **If you are completing this step manually:**
86
-
87
- Check whether `.github/copilot-instructions.md` already exists.
88
-
89
- **If it does not exist:** Fetch the Quorum copilot instructions from the Quorum GitHub repo (`balpal4495/Quorum`) at `.github/copilot-instructions.md` and write it to `.github/copilot-instructions.md` in the project root.
90
-
91
- **If it already exists and does not contain `<!-- quorum -->`:** Append the Quorum instructions to the existing file, preceded by:
86
+ **If completing manually:** fetch `.github/copilot-instructions.md` from the Quorum GitHub repo (`balpal4495/Quorum`) and write it to `.github/copilot-instructions.md` in the project root. If the file already exists and does not contain `<!-- quorum:start -->`, append:
92
87
 
93
88
  ```markdown
94
89
  ---
95
90
 
96
- <!-- quorum -->
91
+ <!-- quorum:start -->
92
+ <content from Quorum repo>
93
+ <!-- quorum:end -->
97
94
  ```
98
95
 
99
- Do not replace or overwrite existing content.
100
-
101
96
  ### 4b. `AGENTS.md`
102
97
 
103
98
  **If it does not exist:**
104
- Create `AGENTS.md` at the project root with this content:
105
99
 
106
100
  ```markdown
107
101
  # Agent Instructions
108
102
 
109
- See [quorum/modules/AGENTS.md](quorum/modules/AGENTS.md) for Quorum module internals.
103
+ <!-- quorum:start -->
104
+ ## Quorum
105
+
106
+ See [quorum/AGENTS.md](quorum/AGENTS.md) for module file ownership and internals.
110
107
  See [.github/copilot-instructions.md](.github/copilot-instructions.md) for workflow rules.
108
+ <!-- quorum:end -->
111
109
  ```
112
110
 
113
- **If it already exists:**
114
- Append to it:
115
-
116
- ```markdown
117
-
118
- ## Quorum modules
119
-
120
- See [quorum/modules/AGENTS.md](quorum/modules/AGENTS.md) for Advisor, Oracle, Jury, Council, and Sentinel internals.
121
- ```
111
+ **If it already exists:** append the `<!-- quorum:start --> ... <!-- quorum:end -->` block above.
122
112
 
123
113
  ### 4c. `CLAUDE.md`
124
114
 
125
115
  **If it does not exist:**
126
- Create `CLAUDE.md` at the project root with this content:
127
116
 
128
117
  ```markdown
129
118
  # Claude Instructions
130
119
 
131
- See [quorum/modules/CLAUDE.md](quorum/modules/CLAUDE.md) for Quorum module internals.
120
+ <!-- quorum:start -->
121
+ ## Quorum
122
+
123
+ See [quorum/CLAUDE.md](quorum/CLAUDE.md) for design decisions and invariants.
132
124
  See [.github/copilot-instructions.md](.github/copilot-instructions.md) for workflow rules.
125
+ <!-- quorum:end -->
133
126
  ```
134
127
 
135
- **If it already exists:**
136
- Append to it:
137
-
138
- ```markdown
139
-
140
- ## Quorum modules
141
-
142
- See [quorum/modules/CLAUDE.md](quorum/modules/CLAUDE.md) for Advisor, Oracle, Jury, Council, and Sentinel internals.
143
- ```
128
+ **If it already exists:** append the `<!-- quorum:start --> ... <!-- quorum:end -->` block above.
144
129
 
145
130
  ---
146
131
 
@@ -148,27 +133,25 @@ See [quorum/modules/CLAUDE.md](quorum/modules/CLAUDE.md) for Advisor, Oracle, Ju
148
133
 
149
134
  **If `.gitignore` does not exist**, create it.
150
135
 
151
- Add the following block if it is not already present:
136
+ Add the following block if not already present:
152
137
 
153
138
  ```gitignore
154
139
  # Quorum — Chronicle
155
140
  # entries/ is a LanceDB binary vector store — do not commit
156
141
  .chronicle/entries/
157
-
158
- # proposals/ contains pending human-approval writes — commit these
159
- # (remove the line above if you want to ignore the whole store)
142
+ .chronicle/query-log.jsonl
160
143
  ```
161
144
 
162
145
  ---
163
146
 
164
- ## Step 6 — Wire setup() into the project
147
+ ## Step 6 — Wire setup() into the project (programmatic use only)
165
148
 
166
- Find the application entry point (e.g. `index.ts`, `server.ts`, `app.ts`, or equivalent).
149
+ Skip this step if you are using only the CLI (`quorum advisor`, `quorum check`, etc.).
167
150
 
168
- Add the following import and call at startup, **before** any agent or workflow code runs:
151
+ For programmatic use, find the application entry point (e.g. `index.ts`, `server.ts`, `app.ts`).
169
152
 
170
153
  ```typescript
171
- import { setup } from "./quorum/modules/setup"
154
+ import { setup } from "@balpal4495/quorum"
172
155
 
173
156
  const { oracle, evaluate, deliberate, ask } = await setup({
174
157
  llm: yourLLMProvider, // replace with your project's LLM provider function
@@ -176,13 +159,11 @@ const { oracle, evaluate, deliberate, ask } = await setup({
176
159
  ```
177
160
 
178
161
  `setup()` creates `.chronicle/` directories, warms the embedder, and wires all module dependencies.
179
- It must be called once before any `oracle.query()`, `evaluate()`, `deliberate()`, or `ask()` call.
180
-
181
- `ask(question)` is the plain-language interface — it queries Oracle automatically, synthesises Chronicle evidence into a concise answer, and retries internally until the answer meets a confidence threshold. Use it to answer questions rather than to evaluate designs.
162
+ Must be called once before any `oracle.query()`, `evaluate()`, `deliberate()`, or `ask()` call.
182
163
 
183
- If no entry point exists yet, note that `setup()` must be called before first use do not inline it.
164
+ `ask(question)` is the plain-language interface — it queries Oracle automatically, synthesises Chronicle evidence into a concise answer, and retries internally until the answer meets a confidence threshold.
184
165
 
185
- **Approving Chronicle proposals:** after an agent calls `oracle.propose()`, approve and index the entry from the terminal:
166
+ **Approving Chronicle proposals:**
186
167
 
187
168
  ```bash
188
169
  quorum commit --list # see pending proposals
@@ -190,39 +171,33 @@ quorum commit <id> # approve and index a proposal
190
171
  quorum commit <id> --dry-run # preview without writing
191
172
  ```
192
173
 
193
- Requires `@xenova/transformers` and `vectordb` (both added in Step 3).
194
-
195
174
  ---
196
175
 
197
176
  ## Step 7 — Verify Chronicle is created
198
177
 
199
- Run the project (or call `setup()` in isolation). Confirm that `.chronicle/proposals/` exists after startup.
178
+ Confirm `.chronicle/proposals/` and `.chronicle/committed/` exist:
200
179
 
201
180
  ```bash
202
181
  ls .chronicle/
203
- # expected: proposals/
204
- # entries/ will appear after the first oracle.commit()
182
+ # expected: committed/ proposals/
205
183
  ```
206
184
 
207
- If the directory is not created, re-check that `setup()` is being awaited correctly.
208
-
209
185
  ---
210
186
 
211
- ## Step 8 — Run module tests
212
-
213
- Confirm the modules are working in this environment:
187
+ ## Step 8 — Verify the CLI works
214
188
 
215
189
  ```bash
216
- # Module unit tests
217
- npx vitest run quorum/modules/
218
-
219
- # Eval suite — deterministic assertions, no LLM required
220
- npx vitest run quorum/evals/
190
+ quorum advisor brief
191
+ quorum growth
221
192
  ```
222
193
 
223
- All tests should pass. If they fail due to missing dependencies, re-run Step 3.
194
+ Both commands run without any LLM. If they fail, check that `npm install` completed successfully.
224
195
 
225
- The eval suite runs canonical test cases (known-bad proposals that should block, known-good ones that should pass) through the deterministic preflight and risk classifier. These pass without any LLM. If you later want to test Jury confidence and Council recommendations against a real LLM, set `EVAL_LLM=1` when running.
196
+ To run Quorum's eval suite (optional tests Quorum's own correctness):
197
+
198
+ ```bash
199
+ npx vitest run node_modules/@balpal4495/quorum/evals/
200
+ ```
226
201
 
227
202
  ---
228
203
 
@@ -231,10 +206,9 @@ The eval suite runs canonical test cases (known-bad proposals that should block,
231
206
  Once all steps are complete, report:
232
207
 
233
208
  1. Which files were created vs appended
234
- 2. Which dependencies were added (if any were already present, note that)
235
- 3. Whether tests passed
236
- 4. The path to `setup()` in the entry point, and the LLM provider that was wired (or a note if it was left as a placeholder)
237
- 5. Any step that could not be completed and why
209
+ 2. Whether `npm install` succeeded
210
+ 3. The path to `setup()` in the entry point if wired (or note if CLI-only)
211
+ 4. Any step that could not be completed and why
238
212
 
239
213
  ---
240
214
 
@@ -242,10 +216,7 @@ Once all steps are complete, report:
242
216
 
243
217
  Skip this step if you do not have Google Gemini CLI installed. Quorum is fully functional without it.
244
218
 
245
- If you do have it (or want to add it later), this enables Claude Code to delegate large-context
246
- analysis to Gemini — useful when a task requires surveying the whole codebase at once.
247
-
248
- **10a. Install Gemini CLI** (if not already installed — requires Node.js 18+):
219
+ **10a. Install Gemini CLI** (if not already installed):
249
220
 
250
221
  ```bash
251
222
  npm install -g @google/gemini-cli
@@ -258,30 +229,23 @@ export GEMINI_API_KEY="your-key-here"
258
229
  export GEMINI_CLI_TRUST_WORKSPACE=true
259
230
  ```
260
231
 
261
- **10c. Create `GEMINI.md`** at the project root so Gemini understands the codebase.
262
- Copy `quorum/modules/AGENTS.md` content as a starting point, or write a brief description of
263
- the project and the Quorum architecture. The `GEMINI.md` in the Quorum repo itself is a
264
- working example.
232
+ **10c. Create `GEMINI.md`** at the project root. Use `quorum/AGENTS.md` content as a starting point, or write a brief description of the project and the Quorum architecture.
265
233
 
266
- Once the key is set and `gemini -p "hello"` responds, Claude Code will automatically detect
267
- Gemini and use it for large-context tasks.
234
+ Once the key is set and `gemini -p "hello"` responds, Claude Code will automatically detect Gemini and use it for large-context tasks.
268
235
 
269
236
  ---
270
237
 
271
238
  ## After setup
272
239
 
273
- You are now operating under Quorum. The rules in `quorum/modules/AGENTS.md` and `.github/copilot-instructions.md` apply to all subsequent work.
240
+ You are now operating under Quorum. The rules in `quorum/AGENTS.md` and `.github/copilot-instructions.md` apply to all subsequent work.
274
241
 
275
242
  Key reminders:
276
243
  - **Ask Advisor for context.** `quorum advisor "what has the team decided about X?"` before starting any meaningful work.
277
- - **Query Oracle before proposing anything.** `oracle.query("what you're about to do")` first.
278
244
  - **Never call `oracle.commit()` autonomously.** Only `oracle.propose()`. A human commits.
279
245
  - **Chronicle entries are ground truth.** Respect `refuted` entries — do not retry what has already failed.
280
246
 
281
247
  ### CLI quick reference
282
248
 
283
- These commands are available globally after `npm install -g @balpal4495/quorum`:
284
-
285
249
  | Command | What it does |
286
250
  |---|---|
287
251
  | `quorum advisor "question"` | Ask a plain-language question — answer synthesised from Chronicle (needs LLM) |
@@ -297,4 +261,4 @@ These commands are available globally after `npm install -g @balpal4495/quorum`:
297
261
 
298
262
  `quorum check` exit codes: `0` = low/medium risk · `1` = high · `2` = critical
299
263
 
300
- `quorum advisor ask` and `quorum evolve` auto-detect any available LLM: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENAI_BASE_URL`, Ollama at localhost:11434, or an authenticated `gemini` CLI. When running inside an AI agent (Claude Code, Copilot, Codex, Gemini) with no separate key, they output Chronicle evidence and a synthesis request for the agent to answer inline.
264
+ `quorum advisor ask` and `quorum evolve` auto-detect any available LLM: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENAI_BASE_URL`, Ollama at localhost:11434, or an authenticated `gemini` CLI. When running inside an AI agent with no separate key, they output Chronicle evidence and a synthesis request for the agent to answer inline.