@balpal4495/quorum 3.2.0 → 3.3.1

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.
@@ -0,0 +1,117 @@
1
+ # Project Guidelines
2
+
3
+ ## Architecture
4
+
5
+ This project uses six portable reasoning modules: **Advisor**, **Oracle**, **Jury**, **Council**, **Sentinel**, and **Compass**.
6
+ They form the knowledge, validation, and product-direction layer for all agentic work in this codebase.
7
+
8
+ ```
9
+ Advisor → plain-language Chronicle queries
10
+ Oracle → Jury → Council → human gate → Executor
11
+ Sentinel → coverage + drift
12
+ Compass → product-direction synthesis (behaviours, pathways, bets, scoring)
13
+ ```
14
+
15
+ Source: `modules/` — see [modules/README.md](modules/README.md) for full API reference.
16
+
17
+ ---
18
+
19
+ ## Chronicle — the persistent knowledge store
20
+
21
+ Chronicle lives at `.chronicle/` and is the institutional memory of this codebase.
22
+ Every prior decision, investigation finding, and outcome is stored there.
23
+
24
+ **Always query Oracle before proposing a solution.** Treat existing entries as ground truth for what has been tried, what worked, and what failed.
25
+
26
+ ```typescript
27
+ const evidence = await oracle.query("describe what you're about to do")
28
+ // Use evidence to inform your proposal before proceeding
29
+ ```
30
+
31
+ **Never call `oracle.commit()` without explicit human approval.**
32
+ `oracle.propose()` writes a pending file. A human must call `oracle.commit(proposalId)` to index it.
33
+ There are no auto-commits. Do not attempt to bypass this gate.
34
+
35
+ ---
36
+
37
+ ## Module responsibilities
38
+
39
+ | Module | What it does | LLM? |
40
+ |---|---|---|
41
+ | `ask()` | Plain-language question answered from Chronicle — validates internally, retries up to 2× | Yes |
42
+ | `oracle.query()` | Retrieves relevant Chronicle entries by semantic + BM25 search | No |
43
+ | `oracle.propose()` | Stages a new entry for human review | No |
44
+ | `oracle.commit()` | Indexes an approved entry — human-triggered only | No |
45
+ | `jury.evaluate()` | Scores a design against evidence across 4 dimensions | Yes |
46
+ | `council.deliberate()` | Adversarial validation via advisor/reviewer fan-out | Yes |
47
+ | `sentinel` | Coverage reporting, drift detection, and PR coverage maps | Optional |
48
+ | `compass` | Product-direction synthesis — behaviours, opportunities, pathways, bets, idea scoring | Optional |
49
+
50
+ ---
51
+
52
+ ## Setup
53
+
54
+ ```typescript
55
+ import { setup } from "@balpal4495/quorum"
56
+
57
+ const { oracle, evaluate, deliberate, ask, compass } = await setup({ llm: yourProvider })
58
+ ```
59
+
60
+ `setup()` creates Chronicle directories, warms the embedder, and wires all dependencies.
61
+ Call it once at application startup.
62
+
63
+ ---
64
+
65
+ ## Routing rules
66
+
67
+ After `jury.evaluate()`:
68
+
69
+ | `recommendation` | Action |
70
+ |---|---|
71
+ | `proceed` | Pass to `council.deliberate()` |
72
+ | `investigate-more` | Return to Detective with `juryOutput.gaps` |
73
+ | `redesign` | Return to Designer |
74
+
75
+ After `council.deliberate()`:
76
+
77
+ | `satisfied` | `recommendation` | Action |
78
+ |---|---|---|
79
+ | `true` | `proceed` | Human gate → Executor |
80
+ | `false` | `redesign` | Return to Designer with `verdict` as feedback |
81
+ | `false` | `investigate-more` | Return to Detective with `juryOutput.gaps` |
82
+
83
+ ---
84
+
85
+ ## Rules for AI agents
86
+
87
+ - **Evidence first.** Query Oracle before proposing any design or implementation.
88
+ - **No auto-commits.** Never call `oracle.commit()` autonomously. Only propose.
89
+ - **Cite entries.** When referencing Chronicle findings, use the entry ID (e.g. `[abc-123]`).
90
+ - **Respect refuted entries.** A `refuted` entry means this was tried and failed — surface the failure reason, don't ignore it.
91
+ - **Fail loudly.** Jury and Council throw on bad LLM output. Do not swallow errors or default to passing scores.
92
+ - **These modules are the portable core.** Detective, Designer, Executor, and Validator are application-specific — do not add them here.
93
+
94
+ ---
95
+
96
+ ## CLI quick reference
97
+
98
+ ```bash
99
+ quorum advisor brief # full Chronicle summary, no LLM
100
+ quorum advisor query "topic" # keyword search, no LLM
101
+ quorum advisor "plain-language question" # synthesised answer via LLM
102
+ quorum check --outcome "..." --design "..." # instant risk triage
103
+ quorum commit --list # review pending proposals
104
+ quorum commit <id> # approve a Chronicle entry
105
+ quorum compass map # map current product behaviours (no LLM)
106
+ quorum compass brief # product-direction summary (LLM)
107
+ quorum compass pathways --goal "..." # generate product pathways (LLM)
108
+ quorum compass score "idea" # score a product idea (LLM)
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Build and test
114
+
115
+ ```bash
116
+ npx vitest run modules/ evals/
117
+ ```
package/GEMINI.md ADDED
@@ -0,0 +1,73 @@
1
+ # Quorum — Gemini Context
2
+
3
+ > This file is optional. It is only active when Google Gemini CLI is installed and
4
+ > `GEMINI_API_KEY` is set. Projects without Gemini CLI configured can ignore it.
5
+
6
+ ## Your role in this project
7
+
8
+ You are a supporting AI in the Quorum codebase. Claude Code is the primary agent — it handles
9
+ tool execution, file edits, complex reasoning, and final decisions.
10
+
11
+ You are called in two modes:
12
+
13
+ 1. **Assistant mode** — Claude needs large-context analysis it can't efficiently do itself:
14
+ summarise many files, trace a pattern across the codebase, answer questions that require
15
+ holding the entire repo in memory at once.
16
+
17
+ 2. **Second-opinion mode** — Claude asks you to evaluate a design decision before proposing
18
+ it to the user.
19
+
20
+ **When giving a second opinion: be direct and specific. Flag concerns by name. Do not hedge
21
+ excessively. If something will break an invariant (see below), say so plainly.**
22
+
23
+ ---
24
+
25
+ ## Project overview
26
+
27
+ Quorum is a portable reasoning layer for agentic codebases. Three TypeScript modules:
28
+
29
+ | Module | What it does |
30
+ |---|---|
31
+ | **Oracle** | Query and write interface to Chronicle. No LLM required. |
32
+ | **Jury** | Evaluates a proposed design against Oracle evidence. Returns a confidence score + gaps. |
33
+ | **Council** | Adversarial validation via parallel advisors and reviewers. Returns a verdict. |
34
+
35
+ ```
36
+ oracle.query() → jury.evaluate() → council.deliberate() → human gate → Executor
37
+ ```
38
+
39
+ Source lives in `modules/`. Detailed API: `modules/README.md`.
40
+
41
+ ---
42
+
43
+ ## Chronicle
44
+
45
+ Chronicle lives at `.chronicle/` — the persistent institutional memory of the codebase.
46
+
47
+ All writes go through a human-gated path:
48
+ - `oracle.propose()` — stages a pending entry (AI agents may call this)
49
+ - `oracle.commit(proposalId)` — indexes it (human-triggered only, **never AI-triggered**)
50
+
51
+ ---
52
+
53
+ ## Invariants — never suggest breaking these
54
+
55
+ - `oracle.commit()` is **never** called without explicit human input.
56
+ - In `jury/evaluate.ts`, `council_brief` is always overridden from the numeric `confidence`
57
+ value after parsing. The LLM is never trusted to compute it.
58
+ - Both `jury/evaluate.ts` and `council/chairman.ts` throw on schema validation failure.
59
+ There are no fallbacks, defaults, or try/catch that swallows these errors.
60
+ - All dependencies (LLM provider, vector store, embedder) are injected — never hardcoded
61
+ inside module logic. Do not suggest adding imports.
62
+ - `deliberate()` calls `oracle.propose()` at the end of every run — never `oracle.commit()`.
63
+
64
+ ---
65
+
66
+ ## Key file locations
67
+
68
+ | Path | What it contains |
69
+ |---|---|
70
+ | `modules/AGENTS.md` | File ownership map for Oracle, Jury, Council |
71
+ | `modules/CLAUDE.md` | Design decisions and what not to change |
72
+ | `modules/README.md` | Full API reference |
73
+ | `.chronicle/` | LanceDB vector store, pending proposals, query log |
package/SETUP.md ADDED
@@ -0,0 +1,264 @@
1
+ # Quorum — Bootstrap Setup
2
+
3
+ You are reading this because Quorum is being set up in a codebase.
4
+
5
+ ---
6
+
7
+ ## Automated setup (preferred)
8
+
9
+ If you have Node.js 18+ available, run this from the project root:
10
+
11
+ ```bash
12
+ npx @balpal4495/quorum@latest init
13
+ ```
14
+
15
+ This handles all steps below automatically — writing Quorum docs, merging instruction files,
16
+ updating `package.json`, `.gitignore`, and creating the Chronicle directory.
17
+
18
+ After it completes, run `npm install`. The CLI is immediately usable:
19
+
20
+ ```bash
21
+ quorum advisor brief
22
+ quorum advisor "what has the team decided about X?"
23
+ quorum check --outcome '...' --design '...'
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Manual setup (AI-assisted fallback)
29
+
30
+ If the automated script is not available or fails, follow every step below in order.
31
+ Do not skip steps. Do not ask for confirmation between steps — complete the full sequence and then report what was done.
32
+
33
+ ---
34
+
35
+ ## Step 1 — Read before touching anything
36
+
37
+ Read these files in full before proceeding:
38
+
39
+ - `quorum/AGENTS.md` — module file ownership and invariants
40
+ - `quorum/CLAUDE.md` — design decisions and constraints
41
+ - `.github/copilot-instructions.md` — workflow rules for AI agents
42
+
43
+ These are your operating instructions for everything that follows.
44
+
45
+ ---
46
+
47
+ ## Step 2 — Audit the host project
48
+
49
+ Check what already exists at the project root. Record what you find — you will need this in Step 4.
50
+
51
+ ```
52
+ Does .github/copilot-instructions.md exist? yes / no
53
+ Does AGENTS.md exist at the project root? yes / no
54
+ Does CLAUDE.md exist at the project root? yes / no
55
+ Does package.json exist? yes / no
56
+ Does .gitignore exist? yes / no
57
+ Does .chronicle/ exist? yes / no
58
+ ```
59
+
60
+ ---
61
+
62
+ ## Step 3 — Install Quorum
63
+
64
+ Open `package.json` at the project root. Add to `devDependencies` if not already present:
65
+
66
+ ```json
67
+ "@balpal4495/quorum": "^2.0.0"
68
+ ```
69
+
70
+ Then run:
71
+
72
+ ```bash
73
+ npm install
74
+ ```
75
+
76
+ If the project uses `yarn` or `pnpm`, use the appropriate installer instead.
77
+
78
+ ---
79
+
80
+ ## Step 4 — Merge AI instruction files
81
+
82
+ ### 4a. `.github/copilot-instructions.md`
83
+
84
+ The automated init command handles this step automatically.
85
+
86
+ **If completing manually:** fetch `.github/copilot-instructions.md` from the Quorum GitHub repo (`balpal4495/Quorum`) and write it to `.github/copilot-instructions.md` in the project root. If the file already exists and does not contain `<!-- quorum:start -->`, append:
87
+
88
+ ```markdown
89
+ ---
90
+
91
+ <!-- quorum:start -->
92
+ <content from Quorum repo>
93
+ <!-- quorum:end -->
94
+ ```
95
+
96
+ ### 4b. `AGENTS.md`
97
+
98
+ **If it does not exist:**
99
+
100
+ ```markdown
101
+ # Agent Instructions
102
+
103
+ <!-- quorum:start -->
104
+ ## Quorum
105
+
106
+ See [quorum/AGENTS.md](quorum/AGENTS.md) for module file ownership and internals.
107
+ See [.github/copilot-instructions.md](.github/copilot-instructions.md) for workflow rules.
108
+ <!-- quorum:end -->
109
+ ```
110
+
111
+ **If it already exists:** append the `<!-- quorum:start --> ... <!-- quorum:end -->` block above.
112
+
113
+ ### 4c. `CLAUDE.md`
114
+
115
+ **If it does not exist:**
116
+
117
+ ```markdown
118
+ # Claude Instructions
119
+
120
+ <!-- quorum:start -->
121
+ ## Quorum
122
+
123
+ See [quorum/CLAUDE.md](quorum/CLAUDE.md) for design decisions and invariants.
124
+ See [.github/copilot-instructions.md](.github/copilot-instructions.md) for workflow rules.
125
+ <!-- quorum:end -->
126
+ ```
127
+
128
+ **If it already exists:** append the `<!-- quorum:start --> ... <!-- quorum:end -->` block above.
129
+
130
+ ---
131
+
132
+ ## Step 5 — Update .gitignore
133
+
134
+ **If `.gitignore` does not exist**, create it.
135
+
136
+ Add the following block if not already present:
137
+
138
+ ```gitignore
139
+ # Quorum — Chronicle
140
+ # entries/ is a LanceDB binary vector store — do not commit
141
+ .chronicle/entries/
142
+ .chronicle/query-log.jsonl
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Step 6 — Wire setup() into the project (programmatic use only)
148
+
149
+ Skip this step if you are using only the CLI (`quorum advisor`, `quorum check`, etc.).
150
+
151
+ For programmatic use, find the application entry point (e.g. `index.ts`, `server.ts`, `app.ts`).
152
+
153
+ ```typescript
154
+ import { setup } from "@balpal4495/quorum"
155
+
156
+ const { oracle, evaluate, deliberate, ask } = await setup({
157
+ llm: yourLLMProvider, // replace with your project's LLM provider function
158
+ })
159
+ ```
160
+
161
+ `setup()` creates `.chronicle/` directories, warms the embedder, and wires all module dependencies.
162
+ Must be called once before any `oracle.query()`, `evaluate()`, `deliberate()`, or `ask()` call.
163
+
164
+ `ask(question)` is the plain-language interface — it queries Oracle automatically, synthesises Chronicle evidence into a concise answer, and retries internally until the answer meets a confidence threshold.
165
+
166
+ **Approving Chronicle proposals:**
167
+
168
+ ```bash
169
+ quorum commit --list # see pending proposals
170
+ quorum commit <id> # approve and index a proposal
171
+ quorum commit <id> --dry-run # preview without writing
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Step 7 — Verify Chronicle is created
177
+
178
+ Confirm `.chronicle/proposals/` and `.chronicle/committed/` exist:
179
+
180
+ ```bash
181
+ ls .chronicle/
182
+ # expected: committed/ proposals/
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Step 8 — Verify the CLI works
188
+
189
+ ```bash
190
+ quorum advisor brief
191
+ quorum growth
192
+ ```
193
+
194
+ Both commands run without any LLM. If they fail, check that `npm install` completed successfully.
195
+
196
+ To run Quorum's eval suite (optional — tests Quorum's own correctness):
197
+
198
+ ```bash
199
+ npx vitest run node_modules/@balpal4495/quorum/evals/
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Step 9 — Report what was done
205
+
206
+ Once all steps are complete, report:
207
+
208
+ 1. Which files were created vs appended
209
+ 2. Whether `npm install` succeeded
210
+ 3. The path to `setup()` in the entry point if wired (or note if CLI-only)
211
+ 4. Any step that could not be completed and why
212
+
213
+ ---
214
+
215
+ ## Optional: Step 10 — Gemini CLI integration
216
+
217
+ Skip this step if you do not have Google Gemini CLI installed. Quorum is fully functional without it.
218
+
219
+ **10a. Install Gemini CLI** (if not already installed):
220
+
221
+ ```bash
222
+ npm install -g @google/gemini-cli
223
+ ```
224
+
225
+ **10b. Get an API key** from Google AI Studio and add to your shell profile:
226
+
227
+ ```bash
228
+ export GEMINI_API_KEY="your-key-here"
229
+ export GEMINI_CLI_TRUST_WORKSPACE=true
230
+ ```
231
+
232
+ **10c. Create `GEMINI.md`** at the project root. Use `quorum/AGENTS.md` content as a starting point, or write a brief description of the project and the Quorum architecture.
233
+
234
+ Once the key is set and `gemini -p "hello"` responds, Claude Code will automatically detect Gemini and use it for large-context tasks.
235
+
236
+ ---
237
+
238
+ ## After setup
239
+
240
+ You are now operating under Quorum. The rules in `quorum/AGENTS.md` and `.github/copilot-instructions.md` apply to all subsequent work.
241
+
242
+ Key reminders:
243
+ - **Ask Advisor for context.** `quorum advisor "what has the team decided about X?"` before starting any meaningful work.
244
+ - **Never call `oracle.commit()` autonomously.** Only `oracle.propose()`. A human commits.
245
+ - **Chronicle entries are ground truth.** Respect `refuted` entries — do not retry what has already failed.
246
+
247
+ ### CLI quick reference
248
+
249
+ | Command | What it does |
250
+ |---|---|
251
+ | `quorum advisor "question"` | Ask a plain-language question — answer synthesised from Chronicle (needs LLM) |
252
+ | `quorum advisor query "topic"` | Search Chronicle entries by keyword (no LLM) |
253
+ | `quorum advisor brief` | High-level Chronicle summary (no LLM) |
254
+ | `quorum status` | Chronicle health — pending proposals, committed entries |
255
+ | `quorum check --outcome X --design Y` | Preflight + risk classifier (no LLM) |
256
+ | `quorum commit --list` | List pending proposals |
257
+ | `quorum commit <id>` | Approve and index a proposal |
258
+ | `quorum sentinel coverage [--path <dir>]` | Chronicle coverage of source files |
259
+ | `quorum growth` | Chronicle learning health — growth rate, last commit, pending proposals |
260
+ | `quorum evolve` | Consolidate Chronicle — merges duplicates, resolves contradictions, promotes open entries |
261
+
262
+ `quorum check` exit codes: `0` = low/medium risk · `1` = high · `2` = critical
263
+
264
+ `quorum advisor ask` and `quorum evolve` auto-detect any available LLM: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENAI_BASE_URL`, Ollama at localhost:11434, or an authenticated `gemini` CLI. When running inside an AI agent with no separate key, they output Chronicle evidence and a synthesis request for the agent to answer inline.
@@ -1 +1 @@
1
- {"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../../modules/compass/behavior.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACyD,WAAW,EAC9E,gBAAgB,EAAE,oBAAoB,EACvC,MAAM,YAAY,CAAA;AAInB,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,oBAAoB,EAAE,EAChC,KAAK,GAAE,gBAAqB,GAC3B,WAAW,CAkGb;AAID,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAkB7D"}
1
+ {"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../../modules/compass/behavior.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACyD,WAAW,EAC9E,gBAAgB,EAAE,oBAAoB,EACvC,MAAM,YAAY,CAAA;AAInB,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,oBAAoB,EAAE,EAChC,KAAK,GAAE,gBAAqB,GAC3B,WAAW,CA2Fb;AAID,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAkB7D"}
@@ -3,9 +3,8 @@ export function mapBehaviorsFromFindings(findings, input = {}) {
3
3
  const behaviors = [];
4
4
  const gaps = [];
5
5
  const contradictions = [];
6
- // Group CLI commands into behaviours
7
- const cliFindings = findings.filter(f => f.kind === "cli");
8
- for (const f of cliFindings) {
6
+ // CLI command behaviors
7
+ for (const f of findings.filter(f => f.kind === "cli")) {
9
8
  behaviors.push({
10
9
  id: `behavior-cli-${f.id}`,
11
10
  area: inferArea(f),
@@ -17,56 +16,52 @@ export function mapBehaviorsFromFindings(findings, input = {}) {
17
16
  confidence: f.confidence,
18
17
  });
19
18
  }
20
- // Extract documented user flows from docs findings
21
- const docsFindings = findings.filter(f => f.kind === "docs" && f.tags.includes("cli"));
22
- for (const f of docsFindings) {
23
- // Only add if not already covered by a CLI finding
24
- const alreadyPresent = behaviors.some(b => b.current_behavior.toLowerCase().includes(extractCommand(f.summary).toLowerCase()) &&
25
- extractCommand(f.summary).length > 3);
26
- if (!alreadyPresent && extractCommand(f.summary)) {
27
- behaviors.push({
28
- id: `behavior-docs-${f.id}`,
29
- area: inferArea(f),
30
- name: `Documented: ${f.title}`,
31
- description: f.summary,
32
- current_behavior: f.summary,
33
- evidence: [findingToRef(f)],
34
- basis: ["documented"],
35
- confidence: f.confidence * 0.9,
36
- });
37
- }
19
+ // Web route behaviors (code findings with "route" tag)
20
+ for (const f of findings.filter(f => f.kind === "code" && f.tags.includes("route"))) {
21
+ behaviors.push({
22
+ id: `behavior-route-${f.id}`,
23
+ area: inferArea(f),
24
+ name: f.title,
25
+ description: f.summary,
26
+ current_behavior: f.summary,
27
+ evidence: [findingToRef(f)],
28
+ basis: ["implemented"],
29
+ confidence: f.confidence,
30
+ });
38
31
  }
39
- // Cross-reference: documented claims without implementation
40
- const docsHeadings = findings.filter(f => f.kind === "docs" && !f.tags.includes("cli"));
41
- const implementedAreas = new Set(behaviors.map(b => b.area));
42
- // Detect gaps: central product promises with no CLI surface
43
- const EXPECTED_AREAS = ["onboarding", "chronicle", "advisor", "review"];
44
- for (const expected of EXPECTED_AREAS) {
45
- const hasBehavior = behaviors.some(b => b.area === expected || b.name.toLowerCase().includes(expected));
46
- if (!hasBehavior) {
47
- const docRef = docsHeadings.find(f => f.summary.toLowerCase().includes(expected));
32
+ // Documented feature headings (deduplicated, limited to reduce noise)
33
+ const codeNames = new Set(behaviors.map(b => b.name.toLowerCase()));
34
+ for (const f of findings.filter(f => f.kind === "docs").slice(0, 20)) {
35
+ const titleLower = f.title.toLowerCase();
36
+ if ([...codeNames].some(n => n.includes(titleLower.slice(0, 15)) || titleLower.includes(n.slice(0, 15))))
37
+ continue;
38
+ behaviors.push({
39
+ id: `behavior-docs-${f.id}`,
40
+ area: inferArea(f),
41
+ name: f.title,
42
+ description: f.summary,
43
+ current_behavior: f.summary,
44
+ evidence: [findingToRef(f)],
45
+ basis: ["documented"],
46
+ confidence: f.confidence * 0.7,
47
+ });
48
+ codeNames.add(titleLower);
49
+ }
50
+ // Dynamic gap detection: documented areas with no implemented artifact
51
+ const implementedAreas = new Set(behaviors.filter(b => b.basis[0] === "implemented").map(b => b.area));
52
+ const docAreas = behaviors.filter(b => b.basis[0] === "documented").map(b => b.area);
53
+ for (const docArea of new Set(docAreas)) {
54
+ if (!implementedAreas.has(docArea) && docArea !== "general") {
48
55
  gaps.push({
49
- id: `gap-${expected}`,
50
- area: expected,
51
- gap: `No first-class CLI command found for '${expected}'.`,
52
- why_it_matters: `'${expected}' appears in product docs but has no dedicated CLI surface.`,
53
- evidence: docRef ? [findingToRef(docRef)] : [],
54
- confidence: 0.7,
56
+ id: `gap-${docArea}`,
57
+ area: docArea,
58
+ gap: `'${docArea}' is documented but no corresponding route, command, or source module was found.`,
59
+ why_it_matters: "May indicate planned-but-unbuilt functionality.",
60
+ evidence: [],
61
+ confidence: 0.6,
55
62
  });
56
63
  }
57
64
  }
58
- // Gap: no product-direction module (Compass itself)
59
- const hasCompass = behaviors.some(b => b.name.toLowerCase().includes("compass"));
60
- if (!hasCompass) {
61
- gaps.push({
62
- id: "gap-product-direction",
63
- area: "product direction",
64
- gap: "No product behaviour mapping or direction module currently exists.",
65
- why_it_matters: "Quorum helps agents avoid repeating engineering mistakes, but has no module to help avoid repeating product-direction mistakes.",
66
- evidence: [],
67
- confidence: 0.93,
68
- });
69
- }
70
65
  // Filter by area if provided
71
66
  const filteredBehaviors = input.area
72
67
  ? behaviors.filter(b => b.area.toLowerCase().includes(input.area.toLowerCase()) ||
@@ -115,24 +110,20 @@ function findingToRef(f) {
115
110
  };
116
111
  }
117
112
  function inferArea(f) {
118
- if (f.tags.includes("onboarding") || f.tags.includes("init"))
119
- return "onboarding";
120
- if (f.tags.includes("chronicle") || f.tags.includes("commit") || f.tags.includes("proposal"))
121
- return "chronicle review";
122
- if (f.tags.includes("advisor"))
123
- return "memory retrieval";
124
- if (f.tags.includes("sentinel"))
125
- return "coverage";
126
- if (f.tags.includes("compass"))
127
- return "product direction";
128
- if (f.tags.includes("auth"))
129
- return "auth";
130
- if (f.tags.includes("cli"))
131
- return "cli";
132
- return "general";
133
- }
134
- function extractCommand(text) {
135
- const match = text.match(/`(quorum [^`]+)`/);
136
- return match?.[1] ?? "";
113
+ // Route findings: derive area from the route path segments
114
+ if (f.tags.includes("route") && f.path) {
115
+ const parts = f.path.split("/").filter(p => p && !p.startsWith("(") && !p.startsWith("[") &&
116
+ !["app", "pages", "src", "route", "page", "index"].includes(p));
117
+ if (parts.length)
118
+ return parts[0];
119
+ }
120
+ // Domain-specific tags take priority
121
+ const DOMAIN = ["auth", "payments", "database", "onboarding", "api", "llm", "config", "webhook", "middleware", "pii", "deploy"];
122
+ const domain = f.tags.find(t => DOMAIN.includes(t));
123
+ if (domain)
124
+ return domain;
125
+ // First non-infrastructure tag
126
+ const SKIP = new Set(["cli", "command", "code", "source", "directory", "module", "docs", "route", "page", "ui", "package", "identity", "description", "binary", "exports", "dependencies", "testing", "guaranteed-behavior", "workflow", "ci", "test"]);
127
+ return f.tags.find(t => !SKIP.has(t) && !t.startsWith("subcommand:")) ?? "general";
137
128
  }
138
129
  //# sourceMappingURL=behavior.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"behavior.js","sourceRoot":"","sources":["../../modules/compass/behavior.ts"],"names":[],"mappings":"AAMA,gFAAgF;AAEhF,MAAM,UAAU,wBAAwB,CACtC,QAAgC,EAChC,QAA0B,EAAE;IAE5B,MAAM,SAAS,GAAsB,EAAE,CAAA;IACvC,MAAM,IAAI,GAAyB,EAAE,CAAA;IACrC,MAAM,cAAc,GAAmC,EAAE,CAAA;IAEzD,qCAAqC;IACrC,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,CAAA;IAC1D,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,SAAS,CAAC,IAAI,CAAC;YACb,EAAE,EAAE,gBAAgB,CAAC,CAAC,EAAE,EAAE;YAC1B,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;YAClB,IAAI,EAAE,CAAC,CAAC,KAAK;YACb,WAAW,EAAE,CAAC,CAAC,OAAO;YACtB,gBAAgB,EAAE,CAAC,CAAC,OAAO;YAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC3B,KAAK,EAAE,CAAC,aAAa,CAAC;YACtB,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CAAA;IACJ,CAAC;IAED,mDAAmD;IACnD,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