@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/CLAUDE.md +102 -42
- package/README.md +317 -223
- package/SETUP.md +68 -94
- package/bin/commands/advisor.js +301 -0
- package/bin/commands/commit.js +42 -52
- package/bin/commands/evolve.js +285 -0
- package/bin/commands/growth.js +139 -0
- package/bin/commands/init.js +59 -60
- package/bin/commands/sentinel.js +1 -1
- package/bin/quorum.js +28 -0
- package/bin/shared/llm.js +228 -0
- package/modules/AGENTS.md +8 -0
- package/modules/CLAUDE.md +8 -2
- package/modules/README.md +72 -13
- package/modules/advisor/ask.ts +87 -0
- package/modules/advisor/index.ts +2 -0
- package/modules/advisor/prompt.ts +50 -0
- package/modules/advisor/types.ts +26 -0
- package/modules/setup.ts +15 -0
- package/package.json +4 -2
- package/bin/init.js +0 -378
package/README.md
CHANGED
|
@@ -1,40 +1,200 @@
|
|
|
1
1
|
# Quorum
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Git-backed memory and design review for AI coding agents.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Your agent knows how to code. It does not know what your team decided last week.
|
|
6
6
|
|
|
7
|
-
Quorum
|
|
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
|
-
##
|
|
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
|
-
|
|
150
|
+
## Get started
|
|
14
151
|
|
|
15
152
|
```bash
|
|
16
153
|
npx @balpal4495/quorum@latest init
|
|
154
|
+
npm install
|
|
17
155
|
```
|
|
18
156
|
|
|
19
|
-
Then
|
|
157
|
+
Then install the CLI globally for terminal access:
|
|
20
158
|
|
|
21
|
-
|
|
159
|
+
```bash
|
|
160
|
+
npm install -g @balpal4495/quorum
|
|
161
|
+
```
|
|
22
162
|
|
|
23
163
|
---
|
|
24
164
|
|
|
25
|
-
##
|
|
165
|
+
## Command reference
|
|
26
166
|
|
|
27
|
-
|
|
167
|
+
### `quorum advisor` — ask Chronicle a question
|
|
28
168
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
|
61
|
-
|
|
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
|
-
|
|
223
|
+
---
|
|
64
224
|
|
|
65
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
242
|
+
---
|
|
92
243
|
|
|
93
|
-
### `quorum
|
|
244
|
+
### `quorum growth` — is Chronicle actually learning?
|
|
94
245
|
|
|
95
246
|
```bash
|
|
96
|
-
quorum
|
|
247
|
+
quorum growth
|
|
248
|
+
quorum growth --json # machine-readable, for CI
|
|
97
249
|
```
|
|
98
250
|
|
|
99
251
|
```
|
|
100
|
-
Chronicle
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
274
|
+
---
|
|
117
275
|
|
|
118
|
-
|
|
276
|
+
### `quorum evolve` — Chronicle self-improvement
|
|
119
277
|
|
|
120
|
-
|
|
278
|
+
```bash
|
|
279
|
+
quorum evolve # analyse and stage improvement proposals
|
|
280
|
+
quorum evolve --dry-run # preview without writing
|
|
281
|
+
```
|
|
121
282
|
|
|
122
|
-
|
|
283
|
+
```
|
|
284
|
+
Quorum evolve 17 entries · via Anthropic
|
|
123
285
|
|
|
124
|
-
|
|
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
|
-
|
|
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
|
-
|
|
294
|
+
✓ promote 55278b3d → validated (0.88)
|
|
295
|
+
Confirmed by three subsequent entries referencing SUMMARY.md temporal context
|
|
135
296
|
|
|
136
|
-
|
|
297
|
+
2 proposals staged — run quorum commit --list to review
|
|
298
|
+
```
|
|
137
299
|
|
|
138
|
-
|
|
300
|
+
Three improvement types:
|
|
139
301
|
|
|
140
|
-
|
|
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
|
|
306
|
+
Every proposed improvement goes through the human gate (`quorum commit`). Nothing is auto-committed.
|
|
143
307
|
|
|
144
|
-
|
|
308
|
+
---
|
|
145
309
|
|
|
146
|
-
###
|
|
310
|
+
### Every merged PR shows what Chronicle learned
|
|
147
311
|
|
|
148
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
324
|
+
2 proposals pending — run quorum commit --list to review.
|
|
167
325
|
|
|
168
|
-
|
|
326
|
+
---
|
|
327
|
+
Run quorum growth for full Chronicle health · quorum evolve to consolidate entries
|
|
328
|
+
```
|
|
169
329
|
|
|
170
|
-
|
|
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.
|
|
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:
|
|
343
|
+
status: validated · confidence: 0.91
|
|
184
344
|
```
|
|
185
345
|
|
|
186
|
-
Jury flags it as a direct conflict. The agent revises before
|
|
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
|
-
|
|
355
|
+
quorum advisor query "authentication, session handling, token strategy"
|
|
196
356
|
|
|
197
357
|
6 entries found:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
"
|
|
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
|
-
##
|
|
395
|
+
## How it works under the hood
|
|
252
396
|
|
|
253
|
-
|
|
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
|
-
| **
|
|
258
|
-
| **
|
|
259
|
-
| **
|
|
260
|
-
| **
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
413
|
+
### How Council works
|
|
269
414
|
|
|
270
|
-
|
|
415
|
+
A risk classifier scales the panel before it runs:
|
|
271
416
|
|
|
272
|
-
|
|
|
273
|
-
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
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
|
-
|
|
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
|
-
##
|
|
432
|
+
## For custom agent pipelines
|
|
284
433
|
|
|
285
|
-
|
|
434
|
+
```typescript
|
|
435
|
+
import { setup } from "@balpal4495/quorum"
|
|
286
436
|
|
|
287
|
-
|
|
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
|
-
|
|
439
|
+
// Ask a plain-language question
|
|
440
|
+
const answer = await ask("what did the team decide about authentication?")
|
|
295
441
|
|
|
296
|
-
|
|
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
|
-
```
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
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
|
|
462
|
+
`evals/` contains canonical test cases — known-bad proposals that should block, known-good ones that should pass:
|
|
326
463
|
|
|
327
|
-
| Case | Expected
|
|
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
|
|
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
|
|
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
|
-
##
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
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
|