@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/README.md CHANGED
@@ -1,79 +1,236 @@
1
1
  # Quorum
2
2
 
3
- **Quorum gives your AI coding assistant persistent memory and judgment and keeps it getting smarter over time.**
3
+ **Git-backed memory and design review for AI coding agents.**
4
4
 
5
- When Claude Code, Copilot, Cursor, or Codex works in your codebase, it forgets everything between sessions. It retries approaches that already failed. It contradicts decisions made last week. It has no idea what the team has already learned.
5
+ Your agent knows how to code. It does not know what your team decided last week.
6
6
 
7
- Quorum fixes this. It installs a persistent knowledge store (Chronicle) into your project, gives your AI a structured workflow for querying it before proposing solutions, validates designs before acting, and writes new knowledge back with you approving every write.
8
-
9
- ---
10
-
11
- ## Get started in one command
7
+ Quorum gives Claude Code, Cursor, Codex, Copilot, and other coding agents a project memory they check before proposing changes and only humans approve what gets remembered.
12
8
 
13
9
  ```bash
14
10
  npx @balpal4495/quorum@latest init
15
11
  ```
16
12
 
17
- Then `npm install`. That's it.
13
+ This creates `.chronicle/`, adds agent instructions to `CLAUDE.md`, `AGENTS.md`, and `.github/copilot-instructions.md`, and gives every future AI session access to the project's approved memory.
14
+
15
+ ---
16
+
17
+ ## The problem
18
+
19
+ AI coding agents forget:
20
+
21
+ - decisions made in prior sessions
22
+ - approaches that already failed and why
23
+ - which parts of the codebase are risky
24
+ - team-specific architecture rules
25
+ - why something was rejected
26
+
27
+ Every new session starts from zero. The same mistakes get proposed again. The same rejected patterns get rediscovered.
28
+
29
+ ---
30
+
31
+ ## Why not just use agent instructions?
32
+
33
+ Agent instructions tell the AI how to behave.
34
+ Quorum tells the AI what the project has already learned.
35
+
36
+ | | Agent instructions | Chronicle |
37
+ |---|---|---|
38
+ | Content | Rules and preferences | Decisions, rejections, outcomes |
39
+ | Growth | Static — you write them | Grows — the agent stages, you approve |
40
+ | Durability | Easy to overwrite or ignore | Git-backed, survives config changes |
41
+ | Failed approaches | Not tracked | Hard stops on refuted patterns |
42
+ | Human approval | Not required | Required for every indexed entry |
43
+
44
+ Instructions are a starting point. Chronicle is accumulated project knowledge.
45
+
46
+ ---
47
+
48
+ ## What changes after Quorum
49
+
50
+ **Without Quorum:**
51
+
52
+ > "I'll replace sessions with HS256 JWTs."
53
+
54
+ **With Quorum:**
55
+
56
+ > "I checked Chronicle first. HS256 was rejected in March — key rotation would invalidate all active sessions. The validated approach is RS256 with short-lived access tokens and refresh rotation in httpOnly cookies."
57
+
58
+ The agent didn't discover this through code archaeology. Chronicle told it. That knowledge was approved by a human and has been there for every session since.
59
+
60
+ ---
61
+
62
+ ## Three guarantees
63
+
64
+ ### 1. It remembers
65
+
66
+ Every session starts from approved project knowledge, not a blank chat window. Decisions, rejected approaches, risky areas, and architectural rules — all available before the first line of code is written.
67
+
68
+ ### 2. It checks
69
+
70
+ Risky proposals are compared against Chronicle evidence before they reach you. Refuted approaches are hard stops. Missing rollback plans and undocumented risks are surfaced before implementation.
71
+
72
+ ### 3. It learns under human control
18
73
 
19
- Quorum copies its modules into `quorum/`, merges instruction files for your AI (`CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`), and creates the Chronicle knowledge store at `.chronicle/`.
74
+ The agent can stage new lessons. Only you decide what becomes project memory. Nothing is indexed without your sign-off.
20
75
 
21
76
  ---
22
77
 
23
- ## How Quorum learns over time
78
+ ## Where Quorum fits
24
79
 
25
- This is the core loop. Every session makes the project smarter.
80
+ Quorum does not replace your coding-agent workflow.
26
81
 
82
+ Use Superpowers, Claude Code, Cursor rules, Codex instructions, or your own process for planning and implementation. Quorum adds the missing memory and evidence layer underneath them.
83
+
84
+ ```
85
+ Agent workflow:
86
+ brainstorm → design → plan → implement → review → merge
87
+
88
+ Quorum layer:
89
+ remember → check evidence → flag risk → stage learning → human approval
27
90
  ```
28
- session start
29
- └─ AI reads Chronicle (quorum advisor brief + query)
30
- └─ work happens informed by accumulated knowledge
31
- └─ decisions and learnings staged as proposals (oracle.propose)
32
- └─ you approve from terminal (quorum commit)
33
- └─ Chronicle grows
34
- └─ PR merged → growth comment posted automatically
35
- └─ periodic: quorum evolve consolidates + improves entries
91
+
92
+ > **Your agent already has a workflow. Quorum gives it institutional memory.**
93
+
94
+ ### Using Quorum with Superpowers
95
+
96
+ | Superpowers phase | Quorum hook |
97
+ |---|---|
98
+ | Brainstorming | `quorum advisor brief` and `quorum advisor query "topic"` before proposing options |
99
+ | Writing the design | Chronicle entries as evidence for accepted and rejected approaches |
100
+ | Planning | `quorum check` on the proposed design before implementation |
101
+ | TDD / implementation | Stage meaningful decisions as Chronicle proposals |
102
+ | Code review | Check whether the change contradicts validated entries |
103
+ | Finish branch | `quorum commit --list`, approve learnings, then `quorum growth` |
104
+
105
+ ---
106
+
107
+ ## The Quorum loop
108
+
36
109
  ```
110
+ 1. Start with memory
111
+ quorum advisor brief
112
+ quorum advisor query "authentication"
113
+
114
+ 2. Check the design
115
+ quorum check --outcome "migrate auth" --design "..."
37
116
 
38
- **Session start** — the AI runs `quorum advisor brief` to see what Chronicle knows, then `quorum advisor query "topic"` to get relevant entries before touching any code.
117
+ 3. Stage what was learned
118
+ The agent proposes a Chronicle entry.
39
119
 
40
- **During work** — Oracle is queried before every significant decision. Refuted entries are treated as hard stops. Validated entries inform the approach.
120
+ 4. Approve memory
121
+ quorum commit --list
122
+ quorum commit <id>
41
123
 
42
- **Session end** — the AI stages Chronicle proposals for every meaningful decision made. You review and commit them with `quorum commit`.
124
+ 5. Keep memory healthy
125
+ quorum growth
126
+ quorum evolve
127
+ ```
128
+
129
+ Every PR merge posts a growth comment showing what Chronicle learned. `quorum evolve` periodically consolidates entries and resolves contradictions.
43
130
 
44
- **On every PR merge** — a growth comment is posted automatically showing exactly what Chronicle learned from that PR.
131
+ ---
45
132
 
46
- **Periodically** `quorum evolve` reviews all entries and proposes consolidations, resolves contradictions, and promotes confirmed knowledge.
133
+ ## What you can do
47
134
 
48
- **Visibility at any time** — `quorum growth` shows whether learning is actually happening, how fast, and what was learned recently.
135
+ | Job | Command |
136
+ |---|---|
137
+ | Ask what the project already knows | `quorum advisor "what did we decide about auth?"` |
138
+ | Search memory without an LLM | `quorum advisor query "auth"` |
139
+ | Start a session with full context | `quorum advisor brief` |
140
+ | Check a design before coding | `quorum check --outcome ... --design ...` |
141
+ | Approve what the agent should remember | `quorum commit <id>` |
142
+ | See whether memory is growing | `quorum growth` |
143
+ | Consolidate stale or duplicate entries | `quorum evolve` |
144
+ | Find undocumented areas | `quorum sentinel coverage` |
145
+ | Understand what the product currently does | `quorum compass map` |
146
+ | Generate product pathways toward a goal | `quorum compass pathways --goal "..."` |
147
+ | Score a product idea | `quorum compass score "add Slack integration"` |
148
+ | Stage a direction decision for Chronicle | `quorum compass propose --from-last` |
49
149
 
50
150
  ---
51
151
 
52
- ## CLI commands
152
+ ## Start small, then add guardrails
153
+
154
+ ### Level 1 — Local memory
155
+ Use `quorum advisor brief` and `quorum advisor query` at the start of AI sessions. No setup beyond `init`.
156
+
157
+ ### Level 2 — Human-approved learning
158
+ Let the agent stage proposals. Approve them with `quorum commit`. Chronicle grows.
159
+
160
+ ### Level 3 — Design checks
161
+ Run `quorum check` before risky changes. Auth, database, payments, PII, crypto — each gets a deterministic preflight and risk level.
162
+
163
+ ### Level 4 — Team memory in Git
164
+ Commit `.chronicle/committed/` so every teammate and every new AI session starts with the same accumulated knowledge.
165
+
166
+ ### Level 5 — CI and PR visibility
167
+ Enable the GitHub Actions workflows for automatic PR growth comments, coverage reports, and drift checks.
168
+
169
+ ---
170
+
171
+ ## Get started
172
+
173
+ ```bash
174
+ npx @balpal4495/quorum@latest init
175
+ npm install
176
+ ```
177
+
178
+ Then run Quorum from your project:
179
+
180
+ ```bash
181
+ npx quorum advisor brief
182
+ npx quorum advisor "what has the team decided about auth?"
183
+ npx quorum check --outcome "..." --design "..."
184
+ ```
185
+
186
+ **Optional — install the CLI globally:**
53
187
 
54
188
  ```bash
55
189
  npm install -g @balpal4495/quorum
56
- # or: npx @balpal4495/quorum <command>
190
+ quorum advisor brief
57
191
  ```
58
192
 
59
- | Command | What it does | LLM |
60
- |---|---|---|
61
- | `quorum advisor "question"` | Ask a plain-language question — answer synthesised from Chronicle evidence | Auto¹ |
62
- | `quorum advisor query "topic"` | Search Chronicle entries by keyword | No |
63
- | `quorum advisor brief` | High-level Chronicle summary | No |
64
- | `quorum growth` | Chronicle health — growth rate, recent learnings, weekly sparkline | No |
65
- | `quorum evolve` | Consolidate and improve Chronicle entries | Auto¹ |
66
- | `quorum status` | Chronicle health — pending proposals, committed entries | No |
67
- | `quorum check --outcome X --design Y` | Deterministic preflight + risk classifier | No |
68
- | `quorum commit <id>` | Approve and index a pending proposal | No |
69
- | `quorum sentinel [coverage]` | Chronicle coverage of your source files | No |
70
- | `quorum init` | Scaffold Quorum into a project | No |
71
-
72
- ¹ **Auto-detect** — Quorum finds whichever LLM is available: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENAI_BASE_URL`, Ollama at localhost:11434, or an authenticated `gemini` CLI. When running inside Claude Code, Copilot, Codex, or any other AI agent without a separate key, these commands output Chronicle evidence and a synthesis request directly — the agent answers inline. No key required.
193
+ > **v2 architecture:** Implementation lives in the npm package (`node_modules/@balpal4495/quorum`). Project memory lives in your repo (`.chronicle/`). Agent docs bridge the two (`quorum/CLAUDE.md`, `.github/copilot-instructions.md`). Nothing is copied into your project that you need to maintain.
194
+
195
+ ---
196
+
197
+ ## Upgrading from v1
198
+
199
+ If your project has a `quorum/modules/` folder (the v1 vendored pattern), migrate in one step:
200
+
201
+ ```bash
202
+ quorum migrate-v2
203
+ ```
204
+
205
+ After any `npm update @balpal4495/quorum`, refresh agent instruction files:
206
+
207
+ ```bash
208
+ quorum sync
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Runtime model
214
+
215
+ The CLI works in plain Node 18+.
216
+
217
+ Programmatic imports are TypeScript-native and require a TS-aware runtime such as `tsx`, `ts-node`, Bun, or a bundler. Plain `node` will not resolve `.ts` files.
218
+
219
+ ```bash
220
+ # recommended for scripts
221
+ npx tsx your-script.ts
222
+
223
+ # or Bun
224
+ bun your-script.ts
225
+ ```
226
+
227
+ For most host-project use cases the CLI is sufficient and requires no loader. See [modules/README.md](modules/README.md) for the full programmatic API.
73
228
 
74
229
  ---
75
230
 
76
- ## `quorum advisor` — ask Chronicle a question
231
+ ## Command reference
232
+
233
+ ### `quorum advisor` — ask Chronicle a question
77
234
 
78
235
  ```bash
79
236
  quorum advisor "what did we decide about authentication?"
@@ -99,11 +256,58 @@ Question: what did we decide about authentication?
99
256
  quorum advisor query "oauth migration" to check current status
100
257
  ```
101
258
 
102
- Advisor validates its own answer internally — if confidence is below 0.7 or blockers exist, it retries up to 2 times with the previous answer as context before returning.
259
+ No LLM required for `query` and `brief`. When an LLM is available, `advisor` synthesises and validates answers internally — retrying up to 2 times if confidence is below 0.7. When running inside Claude Code, Copilot, or Codex with no separate API key, it outputs Chronicle evidence and a synthesis request for the agent to answer inline.
103
260
 
104
261
  ---
105
262
 
106
- ## `quorum growth` — is Chronicle actually learning?
263
+ ### `quorum check` — instant risk triage
264
+
265
+ ```bash
266
+ quorum check \
267
+ --outcome "migrate auth from sessions to JWT" \
268
+ --design "replace session middleware with HS256 tokens on all routes"
269
+ ```
270
+
271
+ ```
272
+ Preflight
273
+ ⚠ Sensitive areas: auth
274
+ ✗ No rollback strategy mentioned
275
+ ✗ No test strategy mentioned
276
+
277
+ Risk
278
+ Level: CRITICAL
279
+ Council mode: full
280
+ Reasons:
281
+ · authentication or authorisation logic
282
+
283
+ ⚠ Critical risk — human architecture review required before proceeding.
284
+ ```
285
+
286
+ Exit codes: `0` = low/medium, `1` = high, `2` = critical — pipe directly into CI scripts.
287
+ Accepts JSON on stdin: `echo '{"outcome":"…","design":"…"}' | quorum check --json`
288
+
289
+ ---
290
+
291
+ ### `quorum commit` — the human gate
292
+
293
+ ```bash
294
+ quorum commit --list # see all pending proposals
295
+ quorum commit a1b2c3d4 # approve and index (partial ID works)
296
+ quorum commit a1b2c3d4 --dry-run # preview without writing
297
+ ```
298
+
299
+ Writes to `.chronicle/committed/`, updates `SUMMARY.md`, removes the proposal. Always works — no extra dependencies required. Install `@xenova/transformers` and `vectordb` to also embed entries for semantic search.
300
+
301
+ ```
302
+ .chronicle/
303
+ proposals/ ← AI-staged entries waiting for your approval
304
+ committed/ ← approved entries, indexed and searchable
305
+ SUMMARY.md ← auto-generated context for your AI to read
306
+ ```
307
+
308
+ ---
309
+
310
+ ### `quorum growth` — is Chronicle actually learning?
107
311
 
108
312
  ```bash
109
313
  quorum growth
@@ -131,11 +335,11 @@ Chronicle growth
131
335
  e57c30d5 Releases trigger from PR labels, not manual tag pushes… 2026-05-16
132
336
  ```
133
337
 
134
- Status levels: `EMPTY` → `STALLED` (14 days with no commits) → `SLOW` (7 days) → `HEALTHY` → `THRIVING` (3+ commits this week). When stalled, it tells you exactly what to do.
338
+ Status levels: `EMPTY` → `STALLED` (14 days) → `SLOW` (7 days) → `HEALTHY` → `THRIVING` (3+ this week). When stalled, it tells you what to do.
135
339
 
136
340
  ---
137
341
 
138
- ## `quorum evolve` — Chronicle self-improvement
342
+ ### `quorum evolve` — Chronicle self-improvement
139
343
 
140
344
  ```bash
141
345
  quorum evolve # analyse and stage improvement proposals
@@ -169,88 +373,9 @@ Every proposed improvement goes through the human gate (`quorum commit`). Nothin
169
373
 
170
374
  ---
171
375
 
172
- ## `quorum check` — instant risk triage
173
-
174
- ```bash
175
- quorum check \
176
- --outcome "migrate auth from sessions to JWT" \
177
- --design "replace session middleware with HS256 tokens on all routes"
178
- ```
179
-
180
- ```
181
- Preflight
182
- ⚠ Sensitive areas: auth
183
- ✗ No rollback strategy mentioned
184
- ✗ No test strategy mentioned
185
-
186
- Risk
187
- Level: CRITICAL
188
- Council mode: full
189
- Reasons:
190
- · authentication or authorisation logic
191
-
192
- ⚠ Critical risk — human architecture review required before proceeding.
193
- ```
194
-
195
- Exit codes: `0` = low/medium, `1` = high, `2` = critical — pipe directly into CI scripts.
196
- Also accepts JSON on stdin: `echo '{"outcome":"…","design":"…"}' | quorum check --json`
197
-
198
- ---
199
-
200
- ## `quorum commit` — the human gate
201
-
202
- ```bash
203
- quorum commit --list # see all pending proposals
204
- quorum commit a1b2c3d4 # approve and index (partial ID prefix works)
205
- quorum commit a1b2c3d4 --dry-run # preview without writing
206
- ```
207
-
208
- Writes to `.chronicle/committed/`, updates `SUMMARY.md`, removes the proposal. Always works — no extra dependencies required. Install `@xenova/transformers` and `vectordb` to also embed and index in the vector store for semantic search.
209
-
210
- ---
211
-
212
- ## What changes after setup
213
-
214
- ### Your AI starts every session with full project context
215
-
216
- Before touching any code, your AI reads Chronicle:
217
-
218
- ```bash
219
- quorum advisor brief # what has the project learned?
220
- quorum advisor query "topic of the work" # what's relevant to today's task?
221
- ```
222
-
223
- > *"I queried Chronicle before proposing the Redis session approach. Entry `[abc-123]` shows we rejected this in March — key rotation wasn't viable. I'm proposing JWT with RS256 instead."*
224
-
225
- ### Designs are validated before they reach you
226
-
227
- Every proposal goes through Jury (confidence scoring against evidence) and Council (adversarial panel) before it surfaces. Low-confidence or contested ideas get challenged internally first.
228
-
229
- > *"Jury scored this 0.41 — gaps in lock strategy and rollback plan. Council flagged the same. I've revised the migration to use a shadow column approach before bringing it to you."*
230
-
231
- ### You approve what gets remembered
232
-
233
- ```bash
234
- quorum commit --list # see what's pending
235
- quorum commit <id> # approve and index
236
- ```
237
-
238
- Nothing is indexed without your sign-off.
239
-
240
- ```
241
- .chronicle/
242
- proposals/ ← AI-staged entries waiting for your approval
243
- committed/ ← approved entries, indexed and searchable
244
- SUMMARY.md ← auto-generated weekly context for your AI to read
245
- ```
246
-
247
- Commit `.chronicle/committed/` to git. Every future session — yours and your teammates' — starts with that context.
248
-
249
376
  ### Every merged PR shows what Chronicle learned
250
377
 
251
- Quorum ships two GitHub Actions workflows. Enable them by copying `.github/workflows/` from the [Quorum repo](https://github.com/balpal4495/Quorum):
252
-
253
- **`chronicle-on-merge.yml`** — fires on every PR merge. Creates a Chronicle proposal from the PR metadata and posts a growth comment:
378
+ On every PR merge, Quorum automatically posts a growth comment:
254
379
 
255
380
  ```
256
381
  ## Quorum Chronicle — what this PR taught
@@ -268,7 +393,7 @@ Committed this PR:
268
393
  Run quorum growth for full Chronicle health · quorum evolve to consolidate entries
269
394
  ```
270
395
 
271
- **`sentinel-pr.yml`** posts a coverage table and Mermaid heatmap on every PR showing which files Chronicle knows about and which are blind spots.
396
+ Enable by copying `.github/workflows/` from the [Quorum repo](https://github.com/balpal4495/Quorum). `sentinel-pr.yml` also posts a coverage table on every PR showing which files Chronicle knows about and which are blind spots.
272
397
 
273
398
  ---
274
399
 
@@ -276,7 +401,7 @@ Run quorum growth for full Chronicle health · quorum evolve to consolidate entr
276
401
 
277
402
  ### An agent that remembers a past failure
278
403
 
279
- Your AI is about to propose symmetric JWT signing. Oracle returns:
404
+ Your AI is about to propose symmetric JWT signing. Chronicle returns:
280
405
 
281
406
  ```
282
407
  [abc-123] Tried HS256 JWT in March. Rejected — no way to rotate keys without
@@ -284,7 +409,7 @@ Your AI is about to propose symmetric JWT signing. Oracle returns:
284
409
  status: validated · confidence: 0.91
285
410
  ```
286
411
 
287
- Jury flags it as a direct conflict. The agent revises before Council even sees it.
412
+ Jury flags it as a direct conflict. The agent revises before it ever reaches you.
288
413
 
289
414
  ---
290
415
 
@@ -316,7 +441,7 @@ gaps: ["no lock strategy documented", "no rollback plan"]
316
441
  council_brief: challenge
317
442
  ```
318
443
 
319
- Council gives a structured verdict with blockers that must be resolved before proceeding. The agent revises. You approve the Chronicle entry once it's solid — including alternatives considered and why they were rejected — so the next person touching that table has the full reasoning:
444
+ Council gives a structured verdict with blockers. The agent revises. You approve the Chronicle entry once it's solid:
320
445
 
321
446
  ```json
322
447
  {
@@ -329,99 +454,52 @@ Council gives a structured verdict with blockers that must be resolved before pr
329
454
  }
330
455
  ```
331
456
 
457
+ The next person touching that table has the full reasoning. They don't repeat the mistake.
458
+
332
459
  ---
333
460
 
334
- ## What's inside
461
+ ## How it works under the hood
335
462
 
336
- Five portable TypeScript modules installed into `quorum/modules/`:
463
+ You do not need to understand these internals to use Quorum. They live in `node_modules/@balpal4495/quorum` after install. The `quorum/` folder that `init` creates in your project contains agent-readable docs and Chronicle data — not module source.
337
464
 
338
465
  | Module | What it does | LLM |
339
466
  |---|---|---|
340
- | **Advisor** | Plain-language interface to Chronicle. Ask a question, get a concise answer synthesised from evidence, validated with an internal retry loop. | Yes |
467
+ | **Advisor** | Plain-language interface to Chronicle. Ask a question, get an answer synthesised from evidence, validated with an internal retry loop. | Auto |
341
468
  | **Oracle** | Query and write interface to Chronicle. Two-pass retrieval (vector + BM25). | No |
342
469
  | **Jury** | Evaluates a design against Chronicle evidence. Four-dimension confidence score, deterministic preflight, hard-blocker gaps. | Yes |
343
470
  | **Council** | Adversarial panel — advisors challenge independently, reviewers critique anonymously, Chairman gives a structured verdict. Risk-scaled fan-out. | Yes |
344
471
  | **Sentinel** | Coverage reporting (which files Chronicle knows about), drift detection (are entries still accurate), PR coverage maps. | Optional |
472
+ | **Compass** | Product-direction layer — maps current behaviours from code and docs, identifies gaps and opportunities, generates pathways, strategic bets, and idea scores grounded in Chronicle evidence. All writes go through `oracle.propose()`. | Optional |
345
473
 
346
- The modules live in your repo — readable by any AI working in the codebase. Nothing is hidden in `node_modules`.
474
+ ### How Jury works
347
475
 
348
- ---
476
+ Before calling the LLM, Jury runs a **deterministic preflight** — checks sensitive areas (auth, database migrations, crypto, payments, PII, secrets), rollback strategy, and refuted Chronicle conflicts. These are injected as hard ground truth.
349
477
 
350
- ## How Jury works
478
+ The LLM scores across four dimensions: evidence support, feasibility, risk, completeness. Confidence is the exact average — the LLM's stated value is discarded. Jury separates `blocking_gaps` (must resolve) from `gaps` (useful but not blocking).
351
479
 
352
- Before calling the LLM, Jury runs a **deterministic preflight** that checks whether the design touches sensitive areas (auth, database migrations, crypto, payments, PII, secrets), mentions a rollback strategy, and whether any refuted Chronicle entries conflict with the design. These facts are injected into the prompt as hard ground truth.
480
+ ### How Council works
353
481
 
354
- The LLM scores the design across four dimensions:
355
-
356
- | Dimension | What it measures |
357
- |---|---|
358
- | Evidence support | Do validated Chronicle entries confirm this approach works here? |
359
- | Feasibility | Do Chronicle entries suggest this is achievable? |
360
- | Risk | How well does the design address known failure modes? |
361
- | Completeness | Does the design cover the full outcome? |
362
-
363
- Confidence is recomputed as the exact average — the LLM's stated value is discarded. Jury separates `blocking_gaps` (must resolve before proceeding) from `gaps` (useful but not critical).
364
-
365
- ---
366
-
367
- ## How Council works
368
-
369
- A **risk classifier** runs before the panel and scales fan-out accordingly:
482
+ A risk classifier scales the panel before it runs:
370
483
 
371
484
  | Risk | Triggers | Council mode | LLM calls |
372
485
  |---|---|---|---|
373
- | Low | Nothing sensitive | jury-only — Council skipped entirely | 0 |
486
+ | Low | Nothing sensitive | jury-only — Council skipped | 0 |
374
487
  | Medium | Cache, queues, deployments | lite — 1 advisor + 2 reviewers | 5 |
375
488
  | High | DB migrations, PII, permissions | full — 5 advisors + 5 reviewers | 12 |
376
489
  | Critical | Auth, payments, crypto, data deletion | full + human flag | 12 |
377
490
 
378
- Refuted entries in the evidence pack always elevate risk by at least one level.
379
-
380
- The Chairman's verdict is structured with `blockers` (must resolve), `warnings` (should address), `advisor_split` (shows disagreement), and `citation_validation` (hallucinated Oracle IDs are stripped before the Chronicle proposal is written).
381
-
382
- ---
383
-
384
- ## Eval suite
385
-
386
- `evals/` contains canonical test cases — known-bad proposals that should block, known-good ones that should pass:
387
-
388
- | Case | Expected |
389
- |---|---|
390
- | Naive NOT NULL migration on large table | Block — no lock strategy |
391
- | HS256 JWT when RS256 was already chosen | Block — cites refuted entry |
392
- | PII fields logged to stdout | Block — GDPR violation in evidence |
393
- | Payment charge without idempotency key | Block — duplicate charge risk |
394
- | Safe internal rename | Proceed — low risk, no conflicts |
395
- | RS256 JWT (approved pattern) | Proceed — matches validated entry |
396
- | Migration with rollback + shadow column | Proceed — addresses documented failure mode |
397
-
398
- Deterministic assertions run on every CI pass. LLM assertions activate with `EVAL_LLM=1`.
399
-
400
- ```bash
401
- npx vitest run evals/
402
- ```
403
-
404
- ---
405
-
406
- ## Sentinel — coverage and drift
407
-
408
- **Coverage** — which parts of your codebase has the AI never documented?
491
+ Refuted entries always elevate risk by at least one level. Citation validation strips hallucinated Oracle IDs before any proposal is written.
409
492
 
410
- ```bash
411
- quorum sentinel coverage --path src
412
- quorum sentinel coverage --json
413
- ```
493
+ ### LLM auto-detection
414
494
 
415
- **Drift** are existing Chronicle entries still accurate? Requires an LLM; use `sentinelAssertions({ llm })` in your test suite.
495
+ Quorum finds whichever LLM is available: `ANTHROPIC_API_KEY` `OPENAI_API_KEY` `GEMINI_API_KEY` `OPENAI_BASE_URL` Ollama at `localhost:11434` authenticated `gemini` CLI. When running inside an AI agent with no separate key, commands output Chronicle evidence and a synthesis request — the agent answers inline.
416
496
 
417
497
  ---
418
498
 
419
499
  ## For custom agent pipelines
420
500
 
421
- Wire the modules directly into any TypeScript agent:
422
-
423
501
  ```typescript
424
- import { setup } from "./quorum/modules/setup"
502
+ import { setup } from "@balpal4495/quorum"
425
503
 
426
504
  const { oracle, evaluate, deliberate, ask } = await setup({ llm: myLLMProvider })
427
505
 
@@ -446,6 +524,39 @@ Full API reference: [modules/README.md](modules/README.md)
446
524
 
447
525
  ---
448
526
 
527
+ ## Eval suite
528
+
529
+ `evals/` contains canonical test cases — known-bad proposals that should block, known-good ones that should pass:
530
+
531
+ | Case | Expected |
532
+ |---|---|
533
+ | Naive NOT NULL migration on large table | Block — no lock strategy |
534
+ | HS256 JWT when RS256 was already chosen | Block — cites refuted entry |
535
+ | PII fields logged to stdout | Block — GDPR violation in evidence |
536
+ | Payment charge without idempotency key | Block — duplicate charge risk |
537
+ | Safe internal rename | Proceed — low risk, no conflicts |
538
+ | RS256 JWT (approved pattern) | Proceed — matches validated entry |
539
+ | Migration with rollback + shadow column | Proceed — addresses documented failure mode |
540
+
541
+ ```bash
542
+ npx vitest run evals/
543
+ ```
544
+
545
+ Deterministic assertions run without any LLM. Set `EVAL_LLM=1` to also test Jury confidence and Council recommendations against a real LLM.
546
+
547
+ ---
548
+
549
+ ## What Quorum is not
550
+
551
+ Quorum is not a coding agent.
552
+ Quorum is not a replacement for TDD, code review, or planning.
553
+ Quorum is not a private SaaS memory store.
554
+ Quorum does not auto-approve what the AI learns.
555
+
556
+ It is a project-local memory, evidence, and review layer for agents you already use.
557
+
558
+ ---
559
+
449
560
  ## Releases
450
561
 
451
562
  Published as `@balpal4495/quorum`. Releases trigger automatically on PR merge via label (`release:patch`, `release:minor`, `release:major`) — GitHub Actions bumps the version, tags, and publishes via OIDC Trusted Publishing.