@balpal4495/quorum 0.4.2 → 1.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 +226 -176
- package/SETUP.md +14 -4
- 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/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 +1 -1
package/CLAUDE.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Project overview
|
|
4
4
|
|
|
5
|
-
Quorum is a portable reasoning layer for agentic codebases.
|
|
6
|
-
the knowledge and validation layer for all agentic work:
|
|
5
|
+
Quorum is a portable reasoning layer for agentic codebases. Five TypeScript modules:
|
|
7
6
|
|
|
8
7
|
```
|
|
9
|
-
|
|
8
|
+
Advisor → plain-language Chronicle queries
|
|
9
|
+
Oracle → Jury → Council → human gate → Executor
|
|
10
|
+
Sentinel → coverage + drift
|
|
10
11
|
```
|
|
11
12
|
|
|
12
13
|
Full module rules and design decisions: [modules/CLAUDE.md](modules/CLAUDE.md)
|
|
@@ -14,73 +15,132 @@ File ownership map: [modules/AGENTS.md](modules/AGENTS.md)
|
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## Session protocol — run this every session
|
|
19
|
+
|
|
20
|
+
This is not optional. Quorum is a self-improving system. It only improves if you use it.
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
### On session start
|
|
23
|
+
|
|
24
|
+
Run these before reading any code or proposing anything:
|
|
20
25
|
|
|
21
26
|
```bash
|
|
22
|
-
|
|
27
|
+
node bin/quorum.js advisor brief
|
|
23
28
|
```
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
without Gemini. Never try to install it or ask the user to install it mid-task.
|
|
30
|
+
This shows what's in Chronicle. Read it. It tells you what the team has already learned.
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
codebase in a single context window where you work best on focused, precise tasks.
|
|
32
|
+
Then query for the topic at hand:
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- You want a second opinion on an architecture decision before proposing it to the user
|
|
34
|
+
```bash
|
|
35
|
+
node bin/quorum.js advisor query "topic of the work"
|
|
36
|
+
```
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
calls with `source ~/.zshrc &&` so that `GEMINI_API_KEY` and `GEMINI_CLI_TRUST_WORKSPACE`
|
|
38
|
-
are loaded from the user's profile before invoking the CLI.
|
|
38
|
+
If there are relevant entries, treat them as ground truth. If there are none, that's useful to know too — it means you're working in undocumented territory.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
### During the session
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
# Broad survey before narrowing
|
|
44
|
-
source ~/.zshrc && gemini -p "What are all the public exports across modules/ and what does each do?"
|
|
42
|
+
Before making any architectural decision, ask explicitly:
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
```bash
|
|
45
|
+
node bin/quorum.js advisor query "the specific decision you're about to make"
|
|
46
|
+
```
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
Examples:
|
|
49
|
+
- `node bin/quorum.js advisor query "retry logic"`
|
|
50
|
+
- `node bin/quorum.js advisor query "LLM validation"`
|
|
51
|
+
- `node bin/quorum.js advisor query "CLI command structure"`
|
|
52
|
+
|
|
53
|
+
If an entry is refuted, do not retry the approach. Surface the failure reason.
|
|
54
|
+
|
|
55
|
+
### On session end
|
|
56
|
+
|
|
57
|
+
For every significant decision made in the session, create a Chronicle proposal.
|
|
58
|
+
|
|
59
|
+
What counts as Chronicle-worthy:
|
|
60
|
+
- A new module or significant feature and its design rationale
|
|
61
|
+
- An API or interface choice that will affect future sessions
|
|
62
|
+
- A rejected approach and why it was rejected (important — prevents re-trying bad ideas)
|
|
63
|
+
- A configuration or tooling decision that affects all future work
|
|
64
|
+
- A failure or bug root cause that was non-obvious
|
|
65
|
+
|
|
66
|
+
What does NOT need a Chronicle entry:
|
|
67
|
+
- Routine code changes, style fixes, obvious bug fixes
|
|
68
|
+
- Things already fully captured in git commit messages
|
|
69
|
+
- Transient implementation details with no future impact
|
|
70
|
+
|
|
71
|
+
**Template for a Chronicle proposal:**
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
// Run with: node -e "..."
|
|
75
|
+
const { randomUUID } = require('crypto')
|
|
76
|
+
const { writeFileSync, mkdirSync } = require('fs')
|
|
77
|
+
const path = require('path')
|
|
78
|
+
|
|
79
|
+
mkdirSync('.chronicle/proposals', { recursive: true })
|
|
80
|
+
|
|
81
|
+
const proposal = {
|
|
82
|
+
schema_version: 2,
|
|
83
|
+
topic: 'short label — module/area',
|
|
84
|
+
decision: 'One sentence: what was decided and why.',
|
|
85
|
+
key_insight: 'One sentence: what was decided and why.', // same as decision
|
|
86
|
+
affected_areas: ['path/to/relevant/file.ts'],
|
|
87
|
+
scope: ['module-name', 'area-tag'],
|
|
88
|
+
alternatives_considered: ['Other approach that was considered'],
|
|
89
|
+
rejected_reason: ['Why the alternative was rejected'],
|
|
90
|
+
status: 'validated', // or 'open' if still uncertain
|
|
91
|
+
confidence: 0.9, // how certain you are this is right
|
|
92
|
+
source_module: 'council',
|
|
93
|
+
evidence_cited: [],
|
|
94
|
+
work_ref: { type: 'pr', ref: 'PR #N' }, // or spike/story
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const id = randomUUID()
|
|
98
|
+
writeFileSync(path.join('.chronicle', 'proposals', id + '.json'), JSON.stringify(proposal, null, 2), 'utf8')
|
|
99
|
+
console.log('Proposed:', id.slice(0, 8), '—', proposal.topic)
|
|
51
100
|
```
|
|
52
101
|
|
|
53
|
-
|
|
54
|
-
- You reason about Gemini's output — it assists, you decide
|
|
55
|
-
- If Gemini contradicts what you know from reading the code, trust your direct reading
|
|
56
|
-
- Never pass Gemini's response to the user unfiltered; synthesise it through your own judgment
|
|
102
|
+
After creating proposals, tell the user: "I've staged N Chronicle entries — run `quorum commit --list` to review."
|
|
57
103
|
|
|
58
104
|
---
|
|
59
105
|
|
|
60
106
|
## Chronicle — the persistent knowledge store
|
|
61
107
|
|
|
62
|
-
Chronicle lives at `.chronicle/`.
|
|
63
|
-
is stored there.
|
|
108
|
+
Chronicle lives at `.chronicle/`. It is the team's accumulated learning — what has been tried, what worked, what failed, and why decisions were made.
|
|
64
109
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- **Never call `oracle.commit()` autonomously.** Use
|
|
68
|
-
|
|
110
|
+
**Rules:**
|
|
111
|
+
- **Query first, always.** `node bin/quorum.js advisor query "topic"` before proposing any design.
|
|
112
|
+
- **Never call `oracle.commit()` autonomously.** Use the proposal template above. A human must run `quorum commit <id>`.
|
|
113
|
+
- **Cite entries by ID.** When referencing a Chronicle finding, use `[entry-id-prefix]`.
|
|
114
|
+
- **Respect refuted entries.** If an entry is refuted, do not retry the approach without surfacing the failure reason to the user first.
|
|
69
115
|
|
|
70
116
|
---
|
|
71
117
|
|
|
72
|
-
##
|
|
118
|
+
## Gemini CLI (optional assistant)
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
which gemini 2>/dev/null
|
|
122
|
+
```
|
|
73
123
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
124
|
+
If empty, skip. Never install it or ask the user to install it mid-task.
|
|
125
|
+
|
|
126
|
+
**Use Gemini when:**
|
|
127
|
+
- You need to survey many files at once before deciding where to look
|
|
128
|
+
- You want to trace a pattern across the whole codebase
|
|
129
|
+
- You want a second opinion on an architecture decision before proposing it
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
source ~/.zshrc && gemini -p "What are all the public exports across modules/ and what does each do?"
|
|
133
|
+
source ~/.zshrc && find . -name "*.ts" | xargs cat | gemini -p "Find every place oracle.commit() is called"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Reason about Gemini's output — it assists, you decide. Never pass it unfiltered to the user.
|
|
79
137
|
|
|
80
138
|
---
|
|
81
139
|
|
|
82
140
|
## Build and test
|
|
83
141
|
|
|
84
142
|
```bash
|
|
85
|
-
npx vitest run modules/
|
|
143
|
+
npx vitest run modules/ evals/
|
|
86
144
|
```
|
|
145
|
+
|
|
146
|
+
All 141 tests must pass before any PR.
|