@pella-labs/pinakes 0.3.15 → 0.4.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 +16 -7
- package/dist/cli/audit-wiki.d.ts +45 -1
- package/dist/cli/audit-wiki.d.ts.map +1 -1
- package/dist/cli/audit-wiki.js +346 -117
- package/dist/cli/audit-wiki.js.map +1 -1
- package/dist/cli/claims.d.ts +49 -0
- package/dist/cli/claims.d.ts.map +1 -0
- package/dist/cli/claims.js +169 -0
- package/dist/cli/claims.js.map +1 -0
- package/dist/cli/contradiction.d.ts +46 -28
- package/dist/cli/contradiction.d.ts.map +1 -1
- package/dist/cli/contradiction.js +182 -115
- package/dist/cli/contradiction.js.map +1 -1
- package/dist/cli/index.js +4 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/progress.d.ts +19 -0
- package/dist/cli/progress.d.ts.map +1 -0
- package/dist/cli/progress.js +44 -0
- package/dist/cli/progress.js.map +1 -0
- package/dist/db/client.js +1 -1
- package/dist/db/migrations/0003_add_pinakes_claims.sql +13 -0
- package/dist/db/migrations/0004_add_confidence_score.sql +12 -0
- package/dist/db/migrations/meta/_journal.json +14 -0
- package/dist/db/schema.d.ts +161 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +24 -1
- package/dist/db/schema.js.map +1 -1
- package/dist/gate/confidence.d.ts +82 -0
- package/dist/gate/confidence.d.ts.map +1 -0
- package/dist/gate/confidence.js +190 -0
- package/dist/gate/confidence.js.map +1 -0
- package/dist/ingest/ingester.d.ts.map +1 -1
- package/dist/ingest/ingester.js +4 -3
- package/dist/ingest/ingester.js.map +1 -1
- package/dist/ingest/repo-mirror.d.ts.map +1 -1
- package/dist/ingest/repo-mirror.js +5 -1
- package/dist/ingest/repo-mirror.js.map +1 -1
- package/dist/init/copy.d.ts.map +1 -1
- package/dist/init/copy.js +9 -0
- package/dist/init/copy.js.map +1 -1
- package/dist/init/scanner.js +7 -0
- package/dist/init/scanner.js.map +1 -1
- package/dist/mcp/tools/search.d.ts.map +1 -1
- package/dist/mcp/tools/search.js +2 -2
- package/dist/mcp/tools/search.js.map +1 -1
- package/dist/retrieval/fts.d.ts +1 -0
- package/dist/retrieval/fts.d.ts.map +1 -1
- package/dist/retrieval/fts.js +18 -2
- package/dist/retrieval/fts.js.map +1 -1
- package/dist/retrieval/hybrid.d.ts +1 -0
- package/dist/retrieval/hybrid.d.ts.map +1 -1
- package/dist/retrieval/hybrid.js +5 -0
- package/dist/retrieval/hybrid.js.map +1 -1
- package/dist/retrieval/vec.d.ts +1 -0
- package/dist/retrieval/vec.d.ts.map +1 -1
- package/dist/retrieval/vec.js +17 -2
- package/dist/retrieval/vec.js.map +1 -1
- package/dist/sandbox/bindings/pinakes.d.ts.map +1 -1
- package/dist/sandbox/bindings/pinakes.js +9 -2
- package/dist/sandbox/bindings/pinakes.js.map +1 -1
- package/package.json +30 -19
package/README.md
CHANGED
|
@@ -145,13 +145,14 @@ knowledge_query({
|
|
|
145
145
|
All data is stored under `~/.pinakes/` (override with `PINAKES_ROOT`). Project data lives at `~/.pinakes/projects/<mangled-path>/`.
|
|
146
146
|
|
|
147
147
|
```bash
|
|
148
|
-
npx @pella-labs/pinakes serve
|
|
149
|
-
npx @pella-labs/pinakes rebuild
|
|
150
|
-
npx @pella-labs/pinakes status
|
|
151
|
-
npx @pella-labs/pinakes audit
|
|
152
|
-
npx @pella-labs/pinakes
|
|
153
|
-
npx @pella-labs/pinakes
|
|
154
|
-
npx @pella-labs/pinakes
|
|
148
|
+
npx @pella-labs/pinakes serve [--wiki-path <dir>] # Start the stdio MCP server
|
|
149
|
+
npx @pella-labs/pinakes rebuild [--wiki-path <dir>] # Full rebuild from markdown
|
|
150
|
+
npx @pella-labs/pinakes status # Health check + row counts
|
|
151
|
+
npx @pella-labs/pinakes audit [--n 20] # Tail the audit log
|
|
152
|
+
npx @pella-labs/pinakes audit-wiki # Wiki audit (contradictions, gaps)
|
|
153
|
+
npx @pella-labs/pinakes purge --scope <s> --confirm # Delete a scope's DB
|
|
154
|
+
npx @pella-labs/pinakes export --scope <s> [--out f] # Dump nodes + edges as JSON
|
|
155
|
+
npx @pella-labs/pinakes import --scope <s> --in f # Restore from dump
|
|
155
156
|
```
|
|
156
157
|
|
|
157
158
|
## Embedder configuration
|
|
@@ -192,6 +193,14 @@ Changing the embedder requires a full rebuild (`pinakes rebuild`) since the vect
|
|
|
192
193
|
- **Deterministic IDs**: `sha1(scope + ':' + source_uri + ':' + section_path)` means re-indexing is idempotent
|
|
193
194
|
- **Centralized storage**: all data under `~/.pinakes/`, project paths mirrored as `~/.pinakes/projects/<mangled-path>/`
|
|
194
195
|
|
|
196
|
+
## Wiki auditing
|
|
197
|
+
|
|
198
|
+
Two paths for auditing your knowledge base:
|
|
199
|
+
|
|
200
|
+
**Claude Code users** — run `/audit-wiki` for a deep agent-powered audit. This runs the pipeline first, then has Claude read through wiki files to find cross-file contradictions, broken references, terminology inconsistencies, and stale info that the pipeline can't catch.
|
|
201
|
+
|
|
202
|
+
**All users** — run `npx @pella-labs/pinakes audit-wiki` (or `pnpm run pinakes -- audit-wiki` from source) for the deterministic pipeline audit. Produces `_audit-report.md` in the wiki directory with contradictions, documentation gaps, and health metrics. Requires an LLM provider (Ollama, API key, or `claude` CLI).
|
|
203
|
+
|
|
195
204
|
## Development
|
|
196
205
|
|
|
197
206
|
```bash
|
package/dist/cli/audit-wiki.d.ts
CHANGED
|
@@ -1,14 +1,58 @@
|
|
|
1
|
+
import type { Database as BetterSqliteDatabase } from 'better-sqlite3';
|
|
2
|
+
import { type GapRow } from '../gaps/detector.js';
|
|
3
|
+
import { type LlmProvider } from '../llm/provider.js';
|
|
1
4
|
import { type ContradictionResult } from './contradiction.js';
|
|
5
|
+
import { createProgressReporter } from './progress.js';
|
|
2
6
|
export interface WikiAuditOptions {
|
|
3
7
|
projectRoot?: string;
|
|
4
8
|
dbPath?: string;
|
|
5
9
|
scope?: 'project' | 'personal';
|
|
10
|
+
quiet?: boolean;
|
|
11
|
+
generateStubs?: boolean;
|
|
6
12
|
}
|
|
7
13
|
export interface WikiAuditResult {
|
|
8
14
|
contradictions: ContradictionResult;
|
|
9
15
|
gaps_found: number;
|
|
10
|
-
|
|
16
|
+
topology_gaps: number;
|
|
17
|
+
stubs_generated: number;
|
|
11
18
|
audit_report_path: string;
|
|
12
19
|
}
|
|
13
20
|
export declare function auditWikiCommand(opts: WikiAuditOptions): Promise<WikiAuditResult>;
|
|
21
|
+
export declare function llmFilterGaps(gaps: GapRow[], llmProvider: LlmProvider, progress?: {
|
|
22
|
+
tick: (label: string, detail?: string) => void;
|
|
23
|
+
}): Promise<GapRow[]>;
|
|
24
|
+
export declare function parseLlmFilterResponse(response: string): string[];
|
|
25
|
+
export interface TopologyGap {
|
|
26
|
+
topic: string;
|
|
27
|
+
in_degree: number;
|
|
28
|
+
source: 'graph-topology';
|
|
29
|
+
}
|
|
30
|
+
export declare function findTopologyGaps(reader: BetterSqliteDatabase, scope: string): TopologyGap[];
|
|
31
|
+
export interface GapContext {
|
|
32
|
+
topic: string;
|
|
33
|
+
mentions: Array<{
|
|
34
|
+
source_uri: string;
|
|
35
|
+
excerpt: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export declare function gatherGapContexts(reader: BetterSqliteDatabase, scope: string, gaps: GapRow[]): GapContext[];
|
|
39
|
+
export declare function generateSynthesisStubs(gaps: GapRow[], contexts: GapContext[], wikiRoot: string, llmProvider: LlmProvider, progress?: ReturnType<typeof createProgressReporter>): Promise<number>;
|
|
40
|
+
export interface HealthMetrics {
|
|
41
|
+
file_count: number;
|
|
42
|
+
chunk_count: number;
|
|
43
|
+
node_count: number;
|
|
44
|
+
edge_count: number;
|
|
45
|
+
}
|
|
46
|
+
export declare function getHealthMetrics(reader: BetterSqliteDatabase, scope: string): HealthMetrics;
|
|
47
|
+
/**
|
|
48
|
+
* Filter out noise from the gap detector (D42 Tier 1 tightening).
|
|
49
|
+
*
|
|
50
|
+
* Rejects topics that are:
|
|
51
|
+
* - Too short
|
|
52
|
+
* - URLs, file paths, qualified names
|
|
53
|
+
* - Code fragments (snake_case, camelCase, SCREAMING_SNAKE)
|
|
54
|
+
* - Common stopwords (English + technical)
|
|
55
|
+
* - Single-word generic terms that aren't proper nouns/acronyms
|
|
56
|
+
*/
|
|
57
|
+
export declare function isRealGap(topic: string): boolean;
|
|
14
58
|
//# sourceMappingURL=audit-wiki.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-wiki.d.ts","sourceRoot":"","sources":["../../src/cli/audit-wiki.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit-wiki.d.ts","sourceRoot":"","sources":["../../src/cli/audit-wiki.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQzE,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAgBvD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,mBAAmB,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAsB,gBAAgB,CAAC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