@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/.github/copilot-instructions.md +29 -6
- package/README.md +304 -193
- package/SETUP.md +60 -96
- package/bin/commands/compass.js +422 -0
- package/bin/commands/init.js +65 -60
- package/bin/commands/migrate-v2.js +136 -0
- package/bin/commands/sentinel.js +1 -1
- package/bin/commands/sync.js +97 -0
- package/bin/quorum.js +35 -0
- package/bin/templates/CLAUDE.md +101 -0
- package/modules/README.md +57 -10
- package/modules/compass/behavior.ts +161 -0
- package/modules/compass/create.ts +365 -0
- package/modules/compass/evidence/collect.ts +109 -0
- package/modules/compass/index.ts +7 -0
- package/modules/compass/prompts/index.ts +230 -0
- package/modules/compass/prompts/system.ts +24 -0
- package/modules/compass/propose.ts +152 -0
- package/modules/compass/schemas.ts +121 -0
- package/modules/compass/score.ts +77 -0
- package/modules/compass/sources/index.ts +413 -0
- package/modules/compass/types.ts +431 -0
- package/modules/setup.ts +33 -0
- package/package.json +21 -11
- package/bin/init.js +0 -378
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 —
|
|
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
|
|
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/
|
|
33
|
-
- `quorum/
|
|
34
|
-
- `.github/copilot-instructions.md` — workflow rules for AI agents
|
|
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
|
|
62
|
+
## Step 3 — Install Quorum
|
|
56
63
|
|
|
57
|
-
Open `package.json` at the project root. Add
|
|
64
|
+
Open `package.json` at the project root. Add to `devDependencies` if not already present:
|
|
58
65
|
|
|
59
66
|
```json
|
|
60
|
-
"
|
|
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
|
|
84
|
+
The automated init command handles this step automatically.
|
|
84
85
|
|
|
85
|
-
**If
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
149
|
+
Skip this step if you are using only the CLI (`quorum advisor`, `quorum check`, etc.).
|
|
167
150
|
|
|
168
|
-
|
|
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 "
|
|
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
|
-
|
|
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
|
-
|
|
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:**
|
|
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
|
-
|
|
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 —
|
|
212
|
-
|
|
213
|
-
Confirm the modules are working in this environment:
|
|
187
|
+
## Step 8 — Verify the CLI works
|
|
214
188
|
|
|
215
189
|
```bash
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
194
|
+
Both commands run without any LLM. If they fail, check that `npm install` completed successfully.
|
|
224
195
|
|
|
225
|
-
|
|
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.
|
|
235
|
-
3.
|
|
236
|
-
4.
|
|
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
|
-
|
|
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
|
|
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/
|
|
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
|
|
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.
|