@balpal4495/quorum 0.4.2 → 2.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,40 +1,200 @@
1
1
  # Quorum
2
2
 
3
- **Quorum gives your AI coding assistant memory and judgment.**
3
+ **Git-backed memory and design review for AI coding agents.**
4
4
 
5
- When Claude Code, Copilot, or Cursor 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 into your project and gives your AI a structured workflow for querying it before proposing solutions, validating designs before acting, and writing new knowledge back with you approving every write.
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.
8
+
9
+ ```bash
10
+ npx @balpal4495/quorum@latest init
11
+ ```
12
+
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
+ ## What changes after Quorum
32
+
33
+ **Without Quorum:**
34
+
35
+ > "I'll replace sessions with HS256 JWTs."
36
+
37
+ **With Quorum:**
38
+
39
+ > "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."
40
+
41
+ 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.
42
+
43
+ ---
44
+
45
+ ## Three guarantees
46
+
47
+ ### 1. It remembers
48
+
49
+ 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.
50
+
51
+ ### 2. It checks
52
+
53
+ 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.
54
+
55
+ ### 3. It learns under human control
56
+
57
+ The agent can stage new lessons. Only you decide what becomes project memory. Nothing is indexed without your sign-off.
58
+
59
+ ---
60
+
61
+ ## Where Quorum fits
62
+
63
+ Quorum does not replace your coding-agent workflow.
64
+
65
+ 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.
66
+
67
+ ```
68
+ Agent workflow:
69
+ brainstorm → design → plan → implement → review → merge
70
+
71
+ Quorum layer:
72
+ remember → check evidence → flag risk → stage learning → human approval
73
+ ```
74
+
75
+ > **Your agent already has a workflow. Quorum gives it institutional memory.**
76
+
77
+ ### Using Quorum with Superpowers
78
+
79
+ | Superpowers phase | Quorum hook |
80
+ |---|---|
81
+ | Brainstorming | `quorum advisor brief` and `quorum advisor query "topic"` before proposing options |
82
+ | Writing the design | Chronicle entries as evidence for accepted and rejected approaches |
83
+ | Planning | `quorum check` on the proposed design before implementation |
84
+ | TDD / implementation | Stage meaningful decisions as Chronicle proposals |
85
+ | Code review | Check whether the change contradicts validated entries |
86
+ | Finish branch | `quorum commit --list`, approve learnings, then `quorum growth` |
87
+
88
+ ---
89
+
90
+ ## The Quorum loop
91
+
92
+ ```
93
+ 1. Start with memory
94
+ quorum advisor brief
95
+ quorum advisor query "authentication"
96
+
97
+ 2. Check the design
98
+ quorum check --outcome "migrate auth" --design "..."
99
+
100
+ 3. Stage what was learned
101
+ The agent proposes a Chronicle entry.
102
+
103
+ 4. Approve memory
104
+ quorum commit --list
105
+ quorum commit <id>
106
+
107
+ 5. Keep memory healthy
108
+ quorum growth
109
+ quorum evolve
110
+ ```
111
+
112
+ Every PR merge posts a growth comment showing what Chronicle learned. `quorum evolve` periodically consolidates entries and resolves contradictions.
8
113
 
9
114
  ---
10
115
 
11
- ## Get started in one command
116
+ ## What you can do
117
+
118
+ | Job | Command |
119
+ |---|---|
120
+ | Ask what the project already knows | `quorum advisor "what did we decide about auth?"` |
121
+ | Search memory without an LLM | `quorum advisor query "auth"` |
122
+ | Start a session with full context | `quorum advisor brief` |
123
+ | Check a design before coding | `quorum check --outcome ... --design ...` |
124
+ | Approve what the agent should remember | `quorum commit <id>` |
125
+ | See whether memory is growing | `quorum growth` |
126
+ | Consolidate stale or duplicate entries | `quorum evolve` |
127
+ | Find undocumented areas | `quorum sentinel coverage` |
128
+
129
+ ---
130
+
131
+ ## Start small, then add guardrails
132
+
133
+ ### Level 1 — Local memory
134
+ Use `quorum advisor brief` and `quorum advisor query` at the start of AI sessions. No setup beyond `init`.
135
+
136
+ ### Level 2 — Human-approved learning
137
+ Let the agent stage proposals. Approve them with `quorum commit`. Chronicle grows.
138
+
139
+ ### Level 3 — Design checks
140
+ Run `quorum check` before risky changes. Auth, database, payments, PII, crypto — each gets a deterministic preflight and risk level.
141
+
142
+ ### Level 4 — Team memory in Git
143
+ Commit `.chronicle/committed/` so every teammate and every new AI session starts with the same accumulated knowledge.
144
+
145
+ ### Level 5 — CI and PR visibility
146
+ Enable the GitHub Actions workflows for automatic PR growth comments, coverage reports, and drift checks.
147
+
148
+ ---
12
149
 
13
- Run this from your project root:
150
+ ## Get started
14
151
 
15
152
  ```bash
16
153
  npx @balpal4495/quorum@latest init
154
+ npm install
17
155
  ```
18
156
 
19
- Then run `npm install`.
157
+ Then install the CLI globally for terminal access:
20
158
 
21
- That's the whole setup. 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/`.
159
+ ```bash
160
+ npm install -g @balpal4495/quorum
161
+ ```
22
162
 
23
163
  ---
24
164
 
25
- ## CLI commands
165
+ ## Command reference
26
166
 
27
- After `npm install -g @balpal4495/quorum` (or `npx @balpal4495/quorum`), you get:
167
+ ### `quorum advisor` ask Chronicle a question
28
168
 
29
- | Command | What it does | LLM? |
30
- |---|---|---|
31
- | `quorum init` | Scaffold Quorum into a project | No |
32
- | `quorum status` | Chronicle health — pending proposals, committed entries, recent activity | No |
33
- | `quorum check --outcome X --design Y` | Deterministic preflight + risk classifier | No |
34
- | `quorum commit <id>` | Approve and index a pending proposal | No |
35
- | `quorum sentinel [coverage]` | Chronicle coverage of your source files | No |
169
+ ```bash
170
+ quorum advisor "what did we decide about authentication?"
171
+ quorum advisor query "session handling" # keyword search, no LLM
172
+ quorum advisor brief # full Chronicle summary, no LLM
173
+ ```
36
174
 
37
- ### `quorum check` — instant risk triage before the full pipeline
175
+ ```
176
+ Question: what did we decide about authentication?
177
+
178
+ What we know
179
+ The team settled on RS256 JWT after rejecting HS256 — key rotation without
180
+ invalidating active sessions was the blocker. Tokens are 15-min expiry with
181
+ refresh rotation in httpOnly cookies.
182
+
183
+ Recommendation
184
+ Follow the RS256 pattern. Entry [abc-123] is validated at 0.91 confidence.
185
+
186
+ Risks
187
+ · OAuth migration is planned for Q3 — coordinate before adding new auth surfaces
188
+
189
+ Next step
190
+ quorum advisor query "oauth migration" to check current status
191
+ ```
192
+
193
+ 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.
194
+
195
+ ---
196
+
197
+ ### `quorum check` — instant risk triage
38
198
 
39
199
  ```bash
40
200
  quorum check \
@@ -57,117 +217,117 @@ Risk
57
217
  ⚠ Critical risk — human architecture review required before proceeding.
58
218
  ```
59
219
 
60
- Exit codes: `0` = low/medium, `1` = high, `2` = critical — pipe into CI scripts directly.
61
- Also accepts JSON on stdin: `echo '{"outcome":"…","design":"…"}' | quorum check --json`
220
+ Exit codes: `0` = low/medium, `1` = high, `2` = critical — pipe directly into CI scripts.
221
+ Accepts JSON on stdin: `echo '{"outcome":"…","design":"…"}' | quorum check --json`
62
222
 
63
- ### `quorum status` — see what's pending and what's been learned
223
+ ---
64
224
 
65
- ```bash
66
- quorum status
67
- ```
225
+ ### `quorum commit` — the human gate
68
226
 
227
+ ```bash
228
+ quorum commit --list # see all pending proposals
229
+ quorum commit a1b2c3d4 # approve and index (partial ID works)
230
+ quorum commit a1b2c3d4 --dry-run # preview without writing
69
231
  ```
70
- Chronicle status .chronicle/
71
-
72
- 8 committed entries (6 accepted, 1 refuted, 1 other)
73
- 2 pending proposals
74
232
 
75
- Pending proposals (awaiting quorum commit <id>)
76
- a1b2c3d4 JWT key rotation approach needs RS256 not HS256
77
- oracle/propose.ts, modules/auth/
233
+ 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.
78
234
 
79
- Recent entries
80
- e5f6a7b8 [accepted] Shadow column migration avoids exclusive lock on 50M rows 2d ago
81
235
  ```
82
-
83
- ### `quorum commit <id>` the human gate from your terminal
84
-
85
- ```bash
86
- quorum commit --list # see pending proposals with full detail
87
- quorum commit a1b2c3d4 # approve and index (supports partial ID prefix)
88
- quorum commit a1b2c3d4 --dry-run # preview without writing
236
+ .chronicle/
237
+ proposals/ ← AI-staged entries waiting for your approval
238
+ committed/ ← approved entries, indexed and searchable
239
+ SUMMARY.md ← auto-generated context for your AI to read
89
240
  ```
90
241
 
91
- Embeds the entry via the local ONNX model, upserts to LanceDB, writes to `.chronicle/committed/`, updates `SUMMARY.md`, and removes the proposal — the full oracle commit in one command. Requires `@xenova/transformers` and `vectordb` to be installed (both are optional deps from `quorum init`).
242
+ ---
92
243
 
93
- ### `quorum sentinel coverage` — see where Chronicle goes dark
244
+ ### `quorum growth` — is Chronicle actually learning?
94
245
 
95
246
  ```bash
96
- quorum sentinel coverage --path modules
247
+ quorum growth
248
+ quorum growth --json # machine-readable, for CI
97
249
  ```
98
250
 
99
251
  ```
100
- Chronicle coverage modules/
101
-
102
- ████░░░░░░░░░░░░░░░░ 20% (6/30 files)
103
-
104
- Covered
105
- oracle/propose.ts (3 entries)
106
- oracle/query.ts (1 entry)
107
-
108
- Uncovered (no Chronicle entries reference these files)
109
- ✗ council/chairman.ts
110
- jury/evaluate.ts
111
-
252
+ Chronicle growth
253
+
254
+ Status THRIVING
255
+ Total entries 17
256
+ Last 7 days 6 commits
257
+ Last 30 days 17 commits
258
+ Last commit 0 days ago 2026-05-16
259
+ Pending 2 proposals awaiting quorum commit
260
+
261
+ Weekly commits
262
+ w/c 2026-05-11 ▪▪▪▪▪▪ 6
263
+ w/c 2026-05-04 ▪▪▪▪▪▪▪▪▪▪▪ 11
264
+
265
+ Recent learnings
266
+ bf448871 Low-risk designs skip Council entirely — Jury alone is sufficient… 2026-05-16
267
+ 3efb1789 Advisor validates answers before returning — retries up to 2 times… 2026-05-16
268
+ 090c7dc6 Advisor is a read-only path — never calls oracle.propose()… 2026-05-16
269
+ e57c30d5 Releases trigger from PR labels, not manual tag pushes… 2026-05-16
112
270
  ```
113
271
 
114
- ---
272
+ Status levels: `EMPTY` → `STALLED` (14 days) → `SLOW` (7 days) → `HEALTHY` → `THRIVING` (3+ this week). When stalled, it tells you what to do.
115
273
 
116
- ## Then just talk to your AI
274
+ ---
117
275
 
118
- Once initialized, open your AI in agent mode and tell it:
276
+ ### `quorum evolve` Chronicle self-improvement
119
277
 
120
- > "Follow quorum/SETUP.md"
278
+ ```bash
279
+ quorum evolve # analyse and stage improvement proposals
280
+ quorum evolve --dry-run # preview without writing
281
+ ```
121
282
 
122
- Your AI reads the instruction files, wires the modules into your project's entry point, runs the tests, and reports what it did. From that point it operates under Quorum — querying Chronicle before every proposal, running designs through Jury and Council, and staging entries for your approval.
283
+ ```
284
+ Quorum evolve 17 entries · via Anthropic
123
285
 
124
- **Works with:**
125
- - Claude Code (`claude` CLI or VS Code extension)
126
- - GitHub Copilot (agent mode)
127
- - Cursor
128
- - Any other AI that can read files and run terminal commands
286
+ ✓ Analysis complete
129
287
 
130
- ---
288
+ 2 improvements found
131
289
 
132
- ## What changes after setup
290
+ ✓ consolidate 10b848a2 + d93b6f40
291
+ Both entries describe Mermaid rendering failures — distinct symptoms, same root cause
292
+ → Mermaid diagrams have three known failure modes in GitHub PR descriptions…
133
293
 
134
- ### Your AI now has a memory
294
+ ✓ promote 55278b3d validated (0.88)
295
+ Confirmed by three subsequent entries referencing SUMMARY.md temporal context
135
296
 
136
- Before proposing anything, your AI queries Chronicle the project's knowledge store. If a similar approach was tried and rejected, it knows. If a design decision was made last month, it knows.
297
+ 2 proposals stagedrun quorum commit --list to review
298
+ ```
137
299
 
138
- > *"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."*
300
+ Three improvement types:
139
301
 
140
- ### Your AI validates designs before acting
302
+ - **consolidate** two entries covering the same ground → one sharper entry with `supersedes`
303
+ - **resolve** — a validated entry contradicted by a newer one → mark it `refuted`
304
+ - **promote** — an `open` entry confirmed by later entries → elevate to `validated`
141
305
 
142
- Every proposal goes through Jury (confidence scoring against evidence) and Council (adversarial panel review) before it reaches you. Low-confidence or contested ideas get challenged internally first.
306
+ Every proposed improvement goes through the human gate (`quorum commit`). Nothing is auto-committed.
143
307
 
144
- > *"Jury scored this 0.41 — gaps in lock strategy and rollback plan. Council flagged the same issue. I've revised the migration plan to use a shadow column approach before bringing it to you."*
308
+ ---
145
309
 
146
- ### You approve what gets remembered
310
+ ### Every merged PR shows what Chronicle learned
147
311
 
148
- When a decision is made, your AI stages a Chronicle entry using `oracle.propose()`. You approve it from the terminal:
312
+ On every PR merge, Quorum automatically posts a growth comment:
149
313
 
150
- ```bash
151
- quorum commit --list # see what's pending
152
- quorum commit <id> # approve and index
153
314
  ```
315
+ ## Quorum Chronicle — what this PR taught
154
316
 
155
- Nothing is indexed without your explicit sign-off.
156
-
157
- ```
158
- .chronicle/
159
- proposals/ ← AI-staged entries waiting for your approval
160
- committed/ ← approved entries, indexed and searchable
161
- SUMMARY.md ← auto-generated weekly context for your AI to read
162
- ```
317
+ Chronicle grew from 14 17 entries
163
318
 
164
- Commit `.chronicle/committed/` to git. Future sessions — and your teammates' sessions — start with that context.
319
+ Committed this PR:
320
+ ✅ [bf448871] Low-risk designs skip Council entirely — jury-only, 0 LLM calls
321
+ ✅ [3efb1789] Advisor validates answers before returning — retries up to 2 times
322
+ ✅ [090c7dc6] Advisor is a read-only path — never calls oracle.propose()
165
323
 
166
- ### Every merged PR can create a Chronicle proposal automatically
324
+ 2 proposals pending run quorum commit --list to review.
167
325
 
168
- Quorum ships a GitHub Actions workflow (`chronicle-on-merge.yml`) that fires when any PR merges to main. It creates a Chronicle proposal capturing the decision, which files changed, and any explicitly deferred items from the PR description. The proposal sits in `proposals/` until you commit it — nothing is auto-indexed.
326
+ ---
327
+ Run quorum growth for full Chronicle health · quorum evolve to consolidate entries
328
+ ```
169
329
 
170
- To enable this in your project, copy `.github/workflows/chronicle-on-merge.yml` and `scripts/chronicle-pr.js` from the [Quorum repo](https://github.com/balpal4495/Quorum) into your own repo.
330
+ 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.
171
331
 
172
332
  ---
173
333
 
@@ -175,15 +335,15 @@ To enable this in your project, copy `.github/workflows/chronicle-on-merge.yml`
175
335
 
176
336
  ### An agent that remembers a past failure
177
337
 
178
- Your AI is about to propose symmetric JWT signing. Oracle returns:
338
+ Your AI is about to propose symmetric JWT signing. Chronicle returns:
179
339
 
180
340
  ```
181
341
  [abc-123] Tried HS256 JWT in March. Rejected — no way to rotate keys without
182
342
  invalidating all active sessions. Decision: RS256 with short-lived tokens.
183
- status: committed · confidence: 0.91
343
+ status: validated · confidence: 0.91
184
344
  ```
185
345
 
186
- Jury flags it as a direct conflict. The agent revises before Council even sees it.
346
+ Jury flags it as a direct conflict. The agent revises before it ever reaches you.
187
347
 
188
348
  ---
189
349
 
@@ -192,16 +352,16 @@ Jury flags it as a direct conflict. The agent revises before Council even sees i
192
352
  Day one of a new Claude Code session. Before touching anything:
193
353
 
194
354
  ```
195
- > query Chronicle for: authentication, session handling, token strategy
355
+ quorum advisor query "authentication, session handling, token strategy"
196
356
 
197
357
  6 entries found:
198
- - HS256 rejected (key rotation problem) → use RS256
199
- - Redis sessions tried and removed (memory overhead at scale)
200
- - Current approach: RS256 JWT, 15-min expiry, refresh rotation in httpOnly cookies
201
- - Upcoming: OAuth migration planned for Q3
358
+ · HS256 rejected (key rotation problem) → use RS256
359
+ · Redis sessions tried and removed (memory overhead at scale)
360
+ · Current: RS256 JWT, 15-min expiry, refresh rotation in httpOnly cookies
361
+ · Upcoming: OAuth migration planned for Q3
202
362
  ```
203
363
 
204
- The AI works with full project context from the first message — no archaeology through git history.
364
+ Full project context from the first message — no archaeology through git history.
205
365
 
206
366
  ---
207
367
 
@@ -215,24 +375,7 @@ gaps: ["no lock strategy documented", "no rollback plan"]
215
375
  council_brief: challenge
216
376
  ```
217
377
 
218
- Council's Chairman gives a structured verdict:
219
-
220
- ```json
221
- {
222
- "satisfied": false,
223
- "blockers": [
224
- {
225
- "issue": "Naive ALTER TABLE takes an exclusive lock for minutes on a 50M-row table",
226
- "evidence": ["db-017"],
227
- "required_fix": "Use shadow column pattern or pg_repack. Add rollback path."
228
- }
229
- ],
230
- "warnings": [],
231
- "advisor_split": { "proceed": 0, "redesign": 4, "investigate-more": 1 }
232
- }
233
- ```
234
-
235
- The agent revises the plan. You approve the Chronicle entry once it's solid. The reasoning — including alternatives considered and why they were rejected — is on record for the next time someone touches that table:
378
+ Council gives a structured verdict with blockers. The agent revises. You approve the Chronicle entry once it's solid:
236
379
 
237
380
  ```json
238
381
  {
@@ -240,171 +383,122 @@ The agent revises the plan. You approve the Chronicle entry once it's solid. The
240
383
  "alternatives_considered": ["naive ALTER TABLE", "pg_repack"],
241
384
  "rejected_reason": ["ALTER TABLE takes exclusive lock for minutes on 50M rows"],
242
385
  "scope": ["database", "migrations"],
243
- "affected_areas": ["db/migrations/", "src/models/user.ts"],
244
- "validation_plan": ["Confirm 100% backfill before applying NOT NULL constraint", "Test rollback path on staging"],
386
+ "validation_plan": ["Confirm 100% backfill before applying NOT NULL constraint"],
245
387
  "review_after": "2026-08-01"
246
388
  }
247
389
  ```
248
390
 
391
+ The next person touching that table has the full reasoning. They don't repeat the mistake.
392
+
249
393
  ---
250
394
 
251
- ## What's inside
395
+ ## How it works under the hood
252
396
 
253
- Four portable TypeScript modules installed into `quorum/modules/`:
397
+ You do not need to understand these internals to use Quorum. They are installed into `quorum/modules/` so any AI working in the codebase can inspect and use them directly.
254
398
 
255
- | Module | What it does |
256
- |---|---|
257
- | **Oracle** | Query and write interface to Chronicle. No LLM required. |
258
- | **Jury** | Evaluates a proposed design against Chronicle evidence. Returns a decomposed confidence score and hard-blocker gaps. |
259
- | **Council** | A panel of advisors challenges the design independently, reviewers critique anonymously, a Chairman gives a structured verdict with blockers and warnings. |
260
- | **Sentinel** | Shows which files the AI knows nothing about, flags stale knowledge, and posts a coverage map on every PR. |
399
+ | Module | What it does | LLM |
400
+ |---|---|---|
401
+ | **Advisor** | Plain-language interface to Chronicle. Ask a question, get an answer synthesised from evidence, validated with an internal retry loop. | Auto |
402
+ | **Oracle** | Query and write interface to Chronicle. Two-pass retrieval (vector + BM25). | No |
403
+ | **Jury** | Evaluates a design against Chronicle evidence. Four-dimension confidence score, deterministic preflight, hard-blocker gaps. | Yes |
404
+ | **Council** | Adversarial panel advisors challenge independently, reviewers critique anonymously, Chairman gives a structured verdict. Risk-scaled fan-out. | Yes |
405
+ | **Sentinel** | Coverage reporting (which files Chronicle knows about), drift detection (are entries still accurate), PR coverage maps. | Optional |
261
406
 
262
- The modules live in your repo — readable by any AI working in the codebase. Nothing is hidden in `node_modules`.
407
+ ### How Jury works
263
408
 
264
- ---
409
+ 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.
265
410
 
266
- ## How Jury works
411
+ 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).
267
412
 
268
- Before calling the LLM, Jury runs a **deterministic preflight** — no LLM required — 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 Jury prompt as hard ground truth.
413
+ ### How Council works
269
414
 
270
- The LLM then scores the design across four dimensions:
415
+ A risk classifier scales the panel before it runs:
271
416
 
272
- | Dimension | What it measures |
273
- |---|---|
274
- | Evidence support | Do validated Chronicle entries confirm this approach works here? |
275
- | Feasibility | Do Chronicle entries suggest this is achievable? |
276
- | Risk | How well does the design address known failure modes? |
277
- | Completeness | Does the design cover the full outcome? |
417
+ | Risk | Triggers | Council mode | LLM calls |
418
+ |---|---|---|---|
419
+ | Low | Nothing sensitive | jury-only Council skipped | 0 |
420
+ | Medium | Cache, queues, deployments | lite 1 advisor + 2 reviewers | 5 |
421
+ | High | DB migrations, PII, permissions | full 5 advisors + 5 reviewers | 12 |
422
+ | Critical | Auth, payments, crypto, data deletion | full + human flag | 12 |
423
+
424
+ Refuted entries always elevate risk by at least one level. Citation validation strips hallucinated Oracle IDs before any proposal is written.
425
+
426
+ ### LLM auto-detection
278
427
 
279
- Confidence is recomputed as the exact average of those four scores the LLM's stated confidence is discarded. Jury also separates `blocking_gaps` (must resolve before proceeding) from `gaps` (useful but not critical).
428
+ 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.
280
429
 
281
430
  ---
282
431
 
283
- ## How Council works
432
+ ## For custom agent pipelines
284
433
 
285
- Before running the full panel, a **risk classifier** reads the design text and Chronicle evidence and assigns a risk level:
434
+ ```typescript
435
+ import { setup } from "@balpal4495/quorum"
286
436
 
287
- | Risk | Council mode | LLM calls |
288
- |---|---|---|
289
- | Low | 1 advisor + 1 reviewer | 4 |
290
- | Medium | 1 advisor + 2 reviewers | 5 |
291
- | High | 5 advisors + 5 reviewers | 12 |
292
- | Critical | 5 advisors + 5 reviewers (+ human architecture flag) | 12 |
437
+ const { oracle, evaluate, deliberate, ask } = await setup({ llm: myLLMProvider })
293
438
 
294
- Auth, crypto, payments, and data deletion trigger Critical. Database migrations, PII, permissions trigger High. Cache, queues, deployments trigger Medium. Everything else is Low.
439
+ // Ask a plain-language question
440
+ const answer = await ask("what did the team decide about authentication?")
295
441
 
296
- The Chairman's verdict is **structured**:
442
+ // Full evaluation pipeline
443
+ const evidence = await oracle.query("authentication patterns")
444
+ const jury = await evaluate({ outcome, design, evidence })
445
+ const verdict = await deliberate({ outcome, design, evidence, jury_output: jury })
446
+ ```
297
447
 
298
- ```json
299
- {
300
- "blockers": [
301
- {
302
- "issue": "No rollback plan for destructive migration",
303
- "evidence": ["db-017"],
304
- "required_fix": "Add shadow-column migration and rollback path before execution"
305
- }
306
- ],
307
- "warnings": [
308
- {
309
- "issue": "No integration test for token expiry edge case",
310
- "suggested_fix": "Add test covering token rotation during concurrent requests"
311
- }
312
- ],
313
- "advisor_split": { "proceed": 2, "redesign": 2, "investigate-more": 1 }
448
+ ```typescript
449
+ // Wire any LLM provider
450
+ const llm: LLMProvider = async (messages, model = "claude-3-5-sonnet-20241022") => {
451
+ const res = await anthropic.messages.create({ model, messages, max_tokens: 2048 })
452
+ return res.content[0].type === "text" ? res.content[0].text : ""
314
453
  }
315
454
  ```
316
455
 
317
- Blockers must be resolved before the human gate. Warnings can be ticketed. High `advisor_split` disagreement is surfaced explicitly — it means genuine uncertainty, not a safe proceed.
318
-
319
- Every Oracle ID cited in the verdict is also validated against the evidence pack that was actually sent. Hallucinated citations are flagged in `citation_validation.hallucinated_ids` and stripped from the Chronicle proposal.
456
+ Full API reference: [modules/README.md](modules/README.md)
320
457
 
321
458
  ---
322
459
 
323
460
  ## Eval suite
324
461
 
325
- `evals/` contains canonical test cases — known-bad proposals that Council should block and known-good ones it should pass:
462
+ `evals/` contains canonical test cases — known-bad proposals that should block, known-good ones that should pass:
326
463
 
327
- | Case | Expected outcome |
464
+ | Case | Expected |
328
465
  |---|---|
329
466
  | Naive NOT NULL migration on large table | Block — no lock strategy |
330
- | HS256 JWT when RS256 was already chosen | Block — cites refuted entry auth-022 |
467
+ | HS256 JWT when RS256 was already chosen | Block — cites refuted entry |
331
468
  | PII fields logged to stdout | Block — GDPR violation in evidence |
332
469
  | Payment charge without idempotency key | Block — duplicate charge risk |
333
- | Redis sessions (previously removed) | Block — memory overhead already documented |
334
- | Cache without stampede protection | Block — prior incident in Chronicle |
335
470
  | Safe internal rename | Proceed — low risk, no conflicts |
336
- | RS256 JWT (approved pattern) | Proceed — matches validated Chronicle entry |
471
+ | RS256 JWT (approved pattern) | Proceed — matches validated entry |
337
472
  | Migration with rollback + shadow column | Proceed — addresses documented failure mode |
338
- | Novel WebSocket design, no evidence | Investigate-more — no Chronicle evidence either way |
339
-
340
- Deterministic assertions (preflight, risk classifier) run on every CI pass. LLM-dependent assertions (confidence bounds, Council recommendation) activate with `EVAL_LLM=1`.
341
473
 
342
474
  ```bash
343
475
  npx vitest run evals/
344
476
  ```
345
477
 
346
- ---
347
-
348
- ## Sentinel — coverage and drift
349
-
350
- Sentinel surfaces two things Chronicle can't tell you about itself.
351
-
352
- **Coverage** — which parts of your codebase has the AI never documented?
353
-
354
- ```bash
355
- quorum sentinel coverage --path src # quick check from the terminal
356
- quorum sentinel coverage --json # machine-readable, for scripts
357
- ```
358
-
359
- **Drift** — do existing Chronicle entries still accurately describe the code, or have they gone stale? Drift detection requires an LLM; use `sentinelAssertions({ llm })` in your test suite (the CLI surfaces the message and directs you there).
360
-
361
- To get a coverage comment on every PR, copy `.github/workflows/sentinel-pr.yml` from the [Quorum repo](https://github.com/balpal4495/Quorum) into your project. Every PR then gets a comment showing a full-project coverage table and a colour-coded heatmap. Changed modules are highlighted. Reviewers see exactly where knowledge is solid and where it goes dark.
478
+ Deterministic assertions run without any LLM. Set `EVAL_LLM=1` to also test Jury confidence and Council recommendations against a real LLM.
362
479
 
363
480
  ---
364
481
 
365
- ## For custom agent pipelines
366
-
367
- If you're building your own agent workflow programmatically, the modules expose a clean TypeScript API. Wire your LLM provider and call directly:
368
-
369
- ```typescript
370
- import { setup } from "./quorum/modules/setup"
371
-
372
- const { oracle, evaluate, deliberate } = await setup({ llm: myLLMProvider })
373
-
374
- const evidence = await oracle.query("authentication patterns")
375
- const jury = await evaluate({ outcome, design, evidence })
376
- const verdict = await deliberate({ outcome, design, evidence, jury_output: jury })
377
- ```
378
-
379
- The `LLMProvider` type is a simple function — wire OpenAI, Anthropic, or anything else:
380
-
381
- ```typescript
382
- // Anthropic
383
- const llm = async (messages, model = "claude-3-5-sonnet-20241022") => {
384
- const res = await anthropic.messages.create({ model, messages, max_tokens: 2048 })
385
- return res.content[0].type === "text" ? res.content[0].text : ""
386
- }
482
+ ## What Quorum is not
387
483
 
388
- // OpenAI
389
- const llm = async (messages, model = "gpt-4o") => {
390
- const res = await openai.chat.completions.create({ model, messages })
391
- return res.choices[0].message.content ?? ""
392
- }
393
- ```
484
+ Quorum is not a coding agent.
485
+ Quorum is not a replacement for TDD, code review, or planning.
486
+ Quorum is not a private SaaS memory store.
487
+ Quorum does not auto-approve what the AI learns.
394
488
 
395
- Full API reference: [modules/README.md](modules/README.md)
489
+ It is a project-local memory, evidence, and review layer for agents you already use.
396
490
 
397
491
  ---
398
492
 
399
493
  ## Releases
400
494
 
401
- Quorum is published as `@balpal4495/quorum`. New versions release automatically when a semver tag is pushedvia GitHub Actions and OIDC Trusted Publishing, no stored tokens.
495
+ 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.
402
496
 
403
497
  ---
404
498
 
405
499
  ## Docs
406
500
 
407
- - [SETUP.md](SETUP.md) — full bootstrap sequence (the file you point your AI at)
501
+ - [SETUP.md](SETUP.md) — full bootstrap sequence (point your AI at this)
408
502
  - [modules/README.md](modules/README.md) — TypeScript API reference
409
503
  - [modules/AGENTS.md](modules/AGENTS.md) — file ownership map
410
504
  - [modules/CLAUDE.md](modules/CLAUDE.md) — design decisions and invariants