pi-para 0.5.2 → 0.6.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.
Files changed (195) hide show
  1. package/ARCHITECTURE.md +160 -0
  2. package/CHANGELOG.md +51 -0
  3. package/CONFIGURATION.md +243 -0
  4. package/README.md +140 -237
  5. package/SETUP.md +196 -112
  6. package/STRUCTURE.md +140 -0
  7. package/package.json +86 -18
  8. package/scripts/build-assets.mjs +29 -0
  9. package/scripts/install.ps1 +55 -0
  10. package/scripts/install.sh +63 -0
  11. package/scripts/smoke-install.mjs +63 -0
  12. package/skills/para/SKILL.md +1 -1
  13. package/skills/setup/SKILL.md +1 -1
  14. package/src/atomic-write.ts +17 -0
  15. package/src/capture.ts +4 -4
  16. package/src/cli-legacy.ts +43 -0
  17. package/src/cli.ts +133 -28
  18. package/src/commands.ts +203 -243
  19. package/src/config.ts +355 -0
  20. package/src/context.ts +29 -14
  21. package/src/credentials.ts +100 -0
  22. package/src/daemon.ts +1 -1
  23. package/src/doctor.ts +209 -0
  24. package/src/gepa/index.ts +1 -1
  25. package/src/index.ts +119 -40
  26. package/src/maintainer.ts +4 -4
  27. package/src/model-resolver.ts +96 -0
  28. package/src/paths.ts +48 -0
  29. package/src/processor.ts +4 -4
  30. package/src/qmd-providers.ts +63 -0
  31. package/src/query.ts +15 -1
  32. package/src/repair.ts +49 -0
  33. package/src/scheduler/controls.ts +125 -0
  34. package/src/scheduler/index.ts +210 -0
  35. package/src/scheduler/leases.ts +98 -0
  36. package/src/scheduler/session-capture.ts +146 -0
  37. package/src/scheduler/state.ts +304 -0
  38. package/src/session-tools.ts +1 -1
  39. package/src/settings.ts +126 -0
  40. package/src/setup.ts +116 -0
  41. package/src/status.ts +115 -0
  42. package/src/store.ts +116 -31
  43. package/src/summarize.ts +72 -16
  44. package/src/templates/prompts.ts +1 -1
  45. package/src/tools.ts +280 -90
  46. package/src/wiki-tool-guidance.ts +84 -0
  47. package/src/wiki.ts +98 -26
  48. package/dist/capture.d.ts +0 -34
  49. package/dist/capture.d.ts.map +0 -1
  50. package/dist/capture.js +0 -461
  51. package/dist/capture.js.map +0 -1
  52. package/dist/cli.d.ts +0 -15
  53. package/dist/cli.d.ts.map +0 -1
  54. package/dist/cli.js +0 -405
  55. package/dist/cli.js.map +0 -1
  56. package/dist/commands.d.ts +0 -15
  57. package/dist/commands.d.ts.map +0 -1
  58. package/dist/commands.js +0 -786
  59. package/dist/commands.js.map +0 -1
  60. package/dist/context.d.ts +0 -61
  61. package/dist/context.d.ts.map +0 -1
  62. package/dist/context.js +0 -289
  63. package/dist/context.js.map +0 -1
  64. package/dist/daemon.d.ts +0 -49
  65. package/dist/daemon.d.ts.map +0 -1
  66. package/dist/daemon.js +0 -226
  67. package/dist/daemon.js.map +0 -1
  68. package/dist/frontmatter.d.ts +0 -59
  69. package/dist/frontmatter.d.ts.map +0 -1
  70. package/dist/frontmatter.js +0 -170
  71. package/dist/frontmatter.js.map +0 -1
  72. package/dist/gepa/dataset.d.ts +0 -36
  73. package/dist/gepa/dataset.d.ts.map +0 -1
  74. package/dist/gepa/dataset.js +0 -148
  75. package/dist/gepa/dataset.js.map +0 -1
  76. package/dist/gepa/evaluator.d.ts +0 -51
  77. package/dist/gepa/evaluator.d.ts.map +0 -1
  78. package/dist/gepa/evaluator.js +0 -317
  79. package/dist/gepa/evaluator.js.map +0 -1
  80. package/dist/gepa/index.d.ts +0 -66
  81. package/dist/gepa/index.d.ts.map +0 -1
  82. package/dist/gepa/index.js +0 -240
  83. package/dist/gepa/index.js.map +0 -1
  84. package/dist/gepa/llm.d.ts +0 -35
  85. package/dist/gepa/llm.d.ts.map +0 -1
  86. package/dist/gepa/llm.js +0 -268
  87. package/dist/gepa/llm.js.map +0 -1
  88. package/dist/gepa/optimized/capture-prompt.txt +0 -65
  89. package/dist/gepa/optimizer.d.ts +0 -29
  90. package/dist/gepa/optimizer.d.ts.map +0 -1
  91. package/dist/gepa/optimizer.js +0 -249
  92. package/dist/gepa/optimizer.js.map +0 -1
  93. package/dist/gepa/targets.d.ts +0 -39
  94. package/dist/gepa/targets.d.ts.map +0 -1
  95. package/dist/gepa/targets.js +0 -326
  96. package/dist/gepa/targets.js.map +0 -1
  97. package/dist/gepa/types.d.ts +0 -168
  98. package/dist/gepa/types.d.ts.map +0 -1
  99. package/dist/gepa/types.js +0 -124
  100. package/dist/gepa/types.js.map +0 -1
  101. package/dist/index.d.ts +0 -21
  102. package/dist/index.d.ts.map +0 -1
  103. package/dist/index.js +0 -294
  104. package/dist/index.js.map +0 -1
  105. package/dist/ingest.d.ts +0 -88
  106. package/dist/ingest.d.ts.map +0 -1
  107. package/dist/ingest.js +0 -105
  108. package/dist/ingest.js.map +0 -1
  109. package/dist/link-discovery.d.ts +0 -40
  110. package/dist/link-discovery.d.ts.map +0 -1
  111. package/dist/link-discovery.js +0 -122
  112. package/dist/link-discovery.js.map +0 -1
  113. package/dist/link-utils.d.ts +0 -30
  114. package/dist/link-utils.d.ts.map +0 -1
  115. package/dist/link-utils.js +0 -145
  116. package/dist/link-utils.js.map +0 -1
  117. package/dist/lint.d.ts +0 -39
  118. package/dist/lint.d.ts.map +0 -1
  119. package/dist/lint.js +0 -827
  120. package/dist/lint.js.map +0 -1
  121. package/dist/maintainer.d.ts +0 -24
  122. package/dist/maintainer.d.ts.map +0 -1
  123. package/dist/maintainer.js +0 -358
  124. package/dist/maintainer.js.map +0 -1
  125. package/dist/processor.d.ts +0 -14
  126. package/dist/processor.d.ts.map +0 -1
  127. package/dist/processor.js +0 -361
  128. package/dist/processor.js.map +0 -1
  129. package/dist/query.d.ts +0 -69
  130. package/dist/query.d.ts.map +0 -1
  131. package/dist/query.js +0 -107
  132. package/dist/query.js.map +0 -1
  133. package/dist/raw.d.ts +0 -57
  134. package/dist/raw.d.ts.map +0 -1
  135. package/dist/raw.js +0 -219
  136. package/dist/raw.js.map +0 -1
  137. package/dist/redact.d.ts +0 -21
  138. package/dist/redact.d.ts.map +0 -1
  139. package/dist/redact.js +0 -143
  140. package/dist/redact.js.map +0 -1
  141. package/dist/scope.d.ts +0 -54
  142. package/dist/scope.d.ts.map +0 -1
  143. package/dist/scope.js +0 -161
  144. package/dist/scope.js.map +0 -1
  145. package/dist/scripts/bulk-link-fix.d.ts +0 -9
  146. package/dist/scripts/bulk-link-fix.d.ts.map +0 -1
  147. package/dist/scripts/bulk-link-fix.js +0 -106
  148. package/dist/scripts/bulk-link-fix.js.map +0 -1
  149. package/dist/session-tools.d.ts +0 -33
  150. package/dist/session-tools.d.ts.map +0 -1
  151. package/dist/session-tools.js +0 -211
  152. package/dist/session-tools.js.map +0 -1
  153. package/dist/state.d.ts +0 -54
  154. package/dist/state.d.ts.map +0 -1
  155. package/dist/state.js +0 -176
  156. package/dist/state.js.map +0 -1
  157. package/dist/store.d.ts +0 -56
  158. package/dist/store.d.ts.map +0 -1
  159. package/dist/store.js +0 -227
  160. package/dist/store.js.map +0 -1
  161. package/dist/summarize.d.ts +0 -56
  162. package/dist/summarize.d.ts.map +0 -1
  163. package/dist/summarize.js +0 -231
  164. package/dist/summarize.js.map +0 -1
  165. package/dist/tag-registry.d.ts +0 -56
  166. package/dist/tag-registry.d.ts.map +0 -1
  167. package/dist/tag-registry.js +0 -146
  168. package/dist/tag-registry.js.map +0 -1
  169. package/dist/templates/prompts.d.ts +0 -63
  170. package/dist/templates/prompts.d.ts.map +0 -1
  171. package/dist/templates/prompts.js +0 -260
  172. package/dist/templates/prompts.js.map +0 -1
  173. package/dist/tools.d.ts +0 -26
  174. package/dist/tools.d.ts.map +0 -1
  175. package/dist/tools.js +0 -1033
  176. package/dist/tools.js.map +0 -1
  177. package/dist/watcher.d.ts +0 -25
  178. package/dist/watcher.d.ts.map +0 -1
  179. package/dist/watcher.js +0 -84
  180. package/dist/watcher.js.map +0 -1
  181. package/dist/webui/client/dist/index.html +0 -1885
  182. package/dist/webui/server.d.ts +0 -31
  183. package/dist/webui/server.d.ts.map +0 -1
  184. package/dist/webui/server.js +0 -566
  185. package/dist/webui/server.js.map +0 -1
  186. package/dist/wiki.d.ts +0 -103
  187. package/dist/wiki.d.ts.map +0 -1
  188. package/dist/wiki.js +0 -428
  189. package/dist/wiki.js.map +0 -1
  190. package/scripts/gepa/__pycache__/dataset.cpython-313.pyc +0 -0
  191. package/scripts/gepa/__pycache__/lm_providers.cpython-313.pyc +0 -0
  192. package/scripts/gepa/__pycache__/metric.cpython-313.pyc +0 -0
  193. package/scripts/gepa/__pycache__/program.cpython-313.pyc +0 -0
  194. package/scripts/gepa/__pycache__/wiki_reader.cpython-313.pyc +0 -0
  195. package/scripts/gepa/uv.lock +0 -2241
@@ -0,0 +1,160 @@
1
+ # pi-para Architecture
2
+
3
+ pi-para is a Pi extension that maintains a PARA markdown wiki with scoped search, context injection, safe mutation tools, and scheduler-backed background capture.
4
+
5
+ ## High-level runtime
6
+
7
+ ```text
8
+ Pi process
9
+ └─ pi-para extension
10
+ ├─ wiki filesystem (~/.pi/wiki)
11
+ ├─ QMD SDK store (.qmd.sqlite)
12
+ ├─ in-process scheduler (.pi-para.sqlite)
13
+ ├─ tools + slash commands
14
+ ├─ context injection
15
+ └─ optional WebWiki UI
16
+ ```
17
+
18
+ No separate OS daemon is required. The scheduler runs while Pi is open and catches up on the next startup if Pi was closed.
19
+
20
+ ## Startup flow
21
+
22
+ ```text
23
+ Pi starts
24
+ -> pi-para loads ~/.pi/para/config.jsonc
25
+ -> migrates legacy ~/.pi/wiki/config.json if needed
26
+ -> registers tools and slash commands
27
+ -> session_start
28
+ -> initWiki(wikiDir)
29
+ -> open QMD SDK store
30
+ -> detect/restore project scope
31
+ -> register capture handler if model/auth is available
32
+ -> start scheduler
33
+ -> enqueue completed-session catch-up
34
+ ```
35
+
36
+ Failures in optional background systems are fail-open: Pi startup and foreground wiki tools should keep working whenever possible.
37
+
38
+ ## Wiki filesystem
39
+
40
+ The wiki is durable markdown:
41
+
42
+ ```text
43
+ ~/.pi/wiki/
44
+ ├── schema.md
45
+ ├── index.md
46
+ ├── log.md
47
+ ├── sessions.md
48
+ ├── projects/
49
+ ├── areas/
50
+ ├── resources/
51
+ ├── archives/
52
+ ├── raw/
53
+ ├── .completed-sessions
54
+ ├── .pi-para.sqlite
55
+ └── .qmd.sqlite
56
+ ```
57
+
58
+ Generated SQLite files are ignored by git. Durable markdown, raw source markdown, and logs are the important user data.
59
+
60
+ ## QMD SDK
61
+
62
+ `src/store.ts` opens QMD via `qmd-engine` SDK with inline collection config. It indexes:
63
+
64
+ - `wiki`: all markdown except `raw/**`,
65
+ - `raw`: source material, excluded from default query results.
66
+
67
+ Provider config precedence:
68
+
69
+ 1. pi-para provider profiles from `~/.pi/para/config.jsonc`,
70
+ 2. legacy `~/.config/qmd/index.yml` only when explicit compatibility mode is used,
71
+ 3. an inert API provider shim when no provider is configured.
72
+
73
+ pi-para never uses QMD local/node-llama-cpp LLM defaults. BM25 search works without calling an LLM; accidental vector/chat calls without a configured API provider fail fast instead of downloading/building local models.
74
+
75
+ Global `qmd` CLI is optional for debugging and not part of normal runtime.
76
+
77
+ ## Scheduler
78
+
79
+ `src/scheduler/` implements durable background work:
80
+
81
+ - queue/history tables,
82
+ - SQLite leases,
83
+ - bounded retries,
84
+ - periodic ticks,
85
+ - task handlers.
86
+
87
+ Initial tasks include:
88
+
89
+ - `wiki-maintenance`,
90
+ - `capture-session`.
91
+
92
+ The scheduler is process-local but coordinates via SQLite so multiple Pi processes do not process the same task concurrently.
93
+
94
+ ## Capture flow
95
+
96
+ ```text
97
+ session_compact/session_shutdown/manual capture
98
+ -> append .completed-sessions entry
99
+ -> enqueue capture-session task if scheduler is available
100
+ -> scheduler handler runs createCaptureSessionHandler
101
+ -> capture agent reads session file and uses wiki tools
102
+ -> StateDB records processed session/history
103
+ ```
104
+
105
+ Capture model selection uses `config.models.capture` and credential refs. If no model/auth is available, capture handler registration is skipped; queued entries remain for a later session.
106
+
107
+ ## Config model
108
+
109
+ Canonical config:
110
+
111
+ ```text
112
+ ~/.pi/para/config.jsonc
113
+ ```
114
+
115
+ The runtime still converts to a small legacy-compatible shape internally in some modules. New code should depend on `ParaUserConfig` from `src/config.ts` where possible.
116
+
117
+ Credential refs never store secret values in config:
118
+
119
+ ```text
120
+ pi-auth:<provider>
121
+ secret:<name>
122
+ none
123
+ ```
124
+
125
+ ## Tool safety and guidance
126
+
127
+ Mutation tools are intentionally split:
128
+
129
+ - `wiki_edit`: atomic exact text replacements for existing pages.
130
+ - `wiki_write mode=create`: creates only, skips existing pages.
131
+ - `wiki_write mode=replace`: explicit full-page replacement.
132
+
133
+ This avoids accidental destructive rewrites from broad LLM edits.
134
+
135
+ Tool API contracts and behavioral guidance are separated:
136
+
137
+ - `src/wiki-tool-guidance.ts`: canonical tool descriptions, prompt snippets, per-tool guidelines, and shared wiki behavior guidance.
138
+ - `src/tools.ts`: host registration, schemas, rendering, and execution only.
139
+ - `src/context.ts`: injects the shared guidance once with wiki context so agents learn when to search, verify stale pages, and self-heal with `wiki_edit`.
140
+
141
+ ## GEPA optimizer
142
+
143
+ GEPA lives in two layers:
144
+
145
+ - `src/gepa/index.ts`: TypeScript target extraction/orchestration and CLI.
146
+ - `scripts/gepa/`: Python/uv DSPy program, metric, dataset, custom LMs.
147
+
148
+ It uses DSPy GEPA, not a custom TypeScript optimizer, and uses custom `dspy.BaseLM` providers for Anthropic OAuth/MiniMax/OpenRouter.
149
+
150
+ ## Compatibility surfaces
151
+
152
+ Kept temporarily:
153
+
154
+ - `pi-para-daemon` binary alias,
155
+ - `/wiki-daemon` slash command alias,
156
+ - legacy daemon CLI subcommands,
157
+ - legacy config migration from `~/.pi/wiki/config.json`,
158
+ - legacy QMD YAML provider fallback.
159
+
160
+ Primary docs and setup should point users to `pi-para`, `/wiki-scheduler`, and `~/.pi/para/config.jsonc`.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## [0.6.0] — 2026-07-14
6
+
7
+ ### Breaking
8
+ - Node.js >= 22 is now required (`engines.node`), matching the embedded qmd-engine SDK. Installers reject Node 20/21.
9
+
10
+ ### Changed
11
+ - Upgraded `qmd-engine` to ^2.5.0 — `node-llama-cpp` is now an optional peer dependency upstream, so API-provider installs no longer pull the native llama.cpp toolchain.
12
+ - Upgraded `better-sqlite3` to ^12.8.0 (prebuilt binaries for current Node majors, including Node 25 on Windows).
13
+ - Wiki context is injected as a named `<system-reminder name="pi-para-wiki-context">` block with explicit wiki operating rules (search first, verify stale claims, persist decisions, prefer wiki_edit, no secrets).
14
+
15
+ ### Performance
16
+ - `wiki_write` inline overhead cut from ~2.3s to ~0.6s on 500+ page wikis: single-pass parallel `rebuildIndex`, readdir-only slug scan for auto-linking, and QMD reindex deferred to the debounced background maintenance queue (same as `wiki_edit`).
17
+ - `wiki_query` self-heals stale search state: on zero results it refreshes the QMD filesystem index once and retries before reporting no matches.
18
+
19
+ ### Fixed (Windows)
20
+ - `scripts/install.ps1` requires Node >= 22, invokes `npx.cmd` explicitly (bare `npx` resolves to npx.ps1 and is blocked under restricted execution policies), and propagates `$LASTEXITCODE`.
21
+ - `scripts/install.sh` minimum Node raised to 22.
22
+ - Build/clean npm scripts are cross-platform (Node-based asset copy instead of POSIX `mkdir -p`/`cp`/`rm -rf`).
23
+ - Fresh-install smoke test works on Windows (`fileURLToPath` for paths; sets both `HOME` and `USERPROFILE`).
24
+ - `pi-para doctor` no longer emits a false secrets-permission warning on Windows/NTFS.
25
+ - CI now includes a `windows-latest` job (typecheck, build, fresh-install smoke).
26
+
27
+ ### Changed (docs/infra)
28
+ - Primary setup/runtime documentation now targets the no-daemon in-process scheduler architecture.
29
+ - Added cross-platform install wrappers in `scripts/install.sh` and `scripts/install.ps1`.
30
+ - Deprecated legacy daemon setup artifacts: `setup.sh` now delegates to the current setup flow, and `pi-para-daemon.service` / `DAEMON-PLAN.md` are marked legacy.
31
+ - Legacy daemon CLI commands (`start`, `stop`, `process`, `process-recent`, `retry-failed`, `history`, `legacy-status`) now print deprecation guidance toward scheduler/task commands.
32
+ - `pi-para status` now reports config/wiki/page/scheduler/QMD status instead of legacy daemon status; old daemon status moved to `pi-para legacy-status`.
33
+ - Added `pi-para status --json` and `npm run smoke:install` for fresh-install smoke validation.
34
+ - Added GitHub Actions CI for typecheck, tests, coverage, build, and fresh-install smoke validation.
35
+
36
+ ## [0.5.5] — 2026-05-07
37
+
38
+ ### Changed
39
+ - `wiki_edit` stays fast but now schedules debounced background maintenance to rebuild `index.md` and refresh QMD search after surgical edits.
40
+
41
+ ## [0.5.4] — 2026-05-07
42
+
43
+ ### Fixed
44
+ - Wiki edits no longer stage generated SQLite/search state in git auto-commits.
45
+ - New wiki directories seed a `.gitignore` for `.qmd.sqlite*`, `.daemon.sqlite*`, and GEPA scratch output.
46
+
47
+ ## [0.5.3] — 2026-05-02
48
+
49
+ ### Changed
50
+ - `wiki_write` is now safer: `mode=create` skips existing pages instead of overwriting them.
51
+ - Added `wiki_edit` for atomic surgical page edits with exact `oldText→newText` replacements.
52
+ - Updated prompts/tool guidance to prefer `wiki_edit` for self-healing stale pages and reserve `wiki_write mode=replace` for intentional full-page rewrites.
53
+
3
54
  ## [0.5.2] — 2026-05-02
4
55
 
5
56
  ### Added
@@ -0,0 +1,243 @@
1
+ # pi-para Configuration
2
+
3
+ Canonical user config lives at:
4
+
5
+ ```text
6
+ ~/.pi/para/config.jsonc
7
+ ```
8
+
9
+ The wiki defaults to:
10
+
11
+ ```text
12
+ ~/.pi/wiki
13
+ ```
14
+
15
+ ## Precedence
16
+
17
+ Current implemented precedence:
18
+
19
+ 1. built-in defaults,
20
+ 2. `~/.pi/para/config.jsonc`,
21
+ 3. migrated legacy `~/.pi/wiki/config.json` when canonical config is missing,
22
+ 4. command-specific CLI flags.
23
+
24
+ Planned/project-level overrides may use `<project>/.pi/para.jsonc` in a later slice.
25
+
26
+ ## Minimal config
27
+
28
+ ```jsonc
29
+ {
30
+ "version": 1,
31
+ "wiki": {
32
+ "dir": "~/.pi/wiki",
33
+ "autoCapture": true,
34
+ "captureOnCompact": true,
35
+ "captureOnStartup": true
36
+ },
37
+ "context": {
38
+ "maxTokens": 4000,
39
+ "includeSchema": true,
40
+ "includeIndex": true,
41
+ "searchLimit": 10,
42
+ "searchGraphBoost": true
43
+ },
44
+ "scheduler": {
45
+ "enabled": true,
46
+ "startupCatchup": true,
47
+ "intervalMinutes": 15,
48
+ "maxConcurrentTasks": 1
49
+ },
50
+ "models": {
51
+ "capture": "auto",
52
+ "summarize": "auto",
53
+ "judge": "auto"
54
+ },
55
+ "qmd": {
56
+ "mode": "sdk",
57
+ "embedEnabled": true,
58
+ "providerConfig": "pi-para-profiles"
59
+ },
60
+ "lint": {
61
+ "autoFix": true,
62
+ "staleDays": 90
63
+ },
64
+ "webWiki": {
65
+ "enabled": false,
66
+ "host": "127.0.0.1",
67
+ "port": 10973,
68
+ "launch": "manual"
69
+ },
70
+ "gepa": {
71
+ "useOptimized": false,
72
+ "studentModel": "anthropic/claude-sonnet-4-20250514",
73
+ "teacherModel": "anthropic/claude-opus-4-6",
74
+ "judgeModel": "anthropic/claude-sonnet-4-20250514",
75
+ "auto": "light",
76
+ "threads": 2,
77
+ "seed": 42
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Credential refs
83
+
84
+ Config stores references, not secret values.
85
+
86
+ ```text
87
+ pi-auth:<provider> # Pi AuthStorage, e.g. ~/.pi/agent/auth.json
88
+ secret:<name> # ~/.pi/para/secrets.json
89
+ none # local/no-auth endpoint
90
+ ```
91
+
92
+ Examples:
93
+
94
+ ```jsonc
95
+ {
96
+ "models": {
97
+ "capture": {
98
+ "provider": "anthropic",
99
+ "model": "claude-sonnet-4-20250514",
100
+ "credentialRef": "pi-auth:anthropic"
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ ```jsonc
107
+ {
108
+ "qmd": {
109
+ "embedding": {
110
+ "provider": "openai",
111
+ "model": "text-embedding-3-small",
112
+ "dims": 1536,
113
+ "apiFormat": "openai",
114
+ "credentialRef": "secret:embedding"
115
+ },
116
+ "rerank": {
117
+ "provider": "jina",
118
+ "model": "jina-reranker-v2-base-multilingual",
119
+ "credentialRef": "secret:rerank"
120
+ }
121
+ }
122
+ }
123
+ ```
124
+
125
+ Store local secrets with:
126
+
127
+ ```bash
128
+ pi-para providers set-secret embedding <key>
129
+ pi-para providers set-secret rerank <key>
130
+ ```
131
+
132
+ Inspect without leaking values:
133
+
134
+ ```bash
135
+ pi-para providers
136
+ pi-para doctor
137
+ ```
138
+
139
+ ## Sections
140
+
141
+ ### `wiki`
142
+
143
+ | Field | Meaning |
144
+ |---|---|
145
+ | `dir` | Wiki directory |
146
+ | `defaultScope` | Optional default project scope |
147
+ | `autoCapture` | Enable session capture features |
148
+ | `captureOnCompact` | Queue capture on Pi compaction |
149
+ | `captureOnStartup` | Catch up queued captures on startup |
150
+
151
+ ### `context`
152
+
153
+ Controls wiki context injection and default search behavior.
154
+
155
+ | Field | Meaning |
156
+ |---|---|
157
+ | `maxTokens` | Context budget |
158
+ | `includeSchema` | Include schema/conventions in context |
159
+ | `includeIndex` | Include wiki index summary |
160
+ | `searchLimit` | Default search limit |
161
+ | `searchGraphBoost` | Enable wikilink graph boost in search |
162
+
163
+ ### `scheduler`
164
+
165
+ Controls in-process background work. No OS daemon is required.
166
+
167
+ | Field | Meaning |
168
+ |---|---|
169
+ | `enabled` | Enable scheduler |
170
+ | `startupCatchup` | Enqueue/process missed sessions on startup |
171
+ | `intervalMinutes` | Periodic scheduler tick interval |
172
+ | `maxConcurrentTasks` | Local concurrency limit |
173
+
174
+ ### `models`
175
+
176
+ Role-based model selections. Each value is either `"auto"` or a provider profile.
177
+
178
+ Currently used:
179
+
180
+ - `capture`: session capture model.
181
+
182
+ Planned/advanced:
183
+
184
+ - `summarize`,
185
+ - `judge`.
186
+
187
+ ### `qmd`
188
+
189
+ QMD SDK configuration.
190
+
191
+ | Field | Meaning |
192
+ |---|---|
193
+ | `mode` | Always `sdk` for current runtime |
194
+ | `embedEnabled` | Whether to run background embeddings |
195
+ | `providerConfig` | `pi-para-profiles` or `legacy-qmd-compatible` |
196
+ | `embedding` | Optional embedding provider profile |
197
+ | `rerank` | Optional rerank provider profile or `null` |
198
+
199
+ `legacy-qmd-compatible` reads `~/.config/qmd/index.yml` for compatibility only. New installs and migrated local setups should use `pi-para-profiles`.
200
+
201
+ pi-para never uses QMD's local/node-llama-cpp LLM fallback. If no API provider is configured, BM25 search still works and vector/chat calls fail fast instead of downloading local models.
202
+
203
+ ### `lint`
204
+
205
+ | Field | Meaning |
206
+ |---|---|
207
+ | `autoFix` | Default lint autofix behavior |
208
+ | `staleDays` | Age threshold for stale pages |
209
+
210
+ ### `webWiki`
211
+
212
+ Optional browser UI.
213
+
214
+ | Field | Meaning |
215
+ |---|---|
216
+ | `enabled` | Show/use WebWiki status |
217
+ | `host` | Bind host |
218
+ | `port` | Port |
219
+ | `launch` | `manual` or `disabled` |
220
+
221
+ ### `gepa`
222
+
223
+ DSPy GEPA optimizer defaults.
224
+
225
+ | Field | Meaning |
226
+ |---|---|
227
+ | `useOptimized` | Load optimized prompt overrides |
228
+ | `studentModel` | Proxy/evaluation model |
229
+ | `teacherModel` | Reflection/mutation model |
230
+ | `judgeModel` | LLM-as-judge model |
231
+ | `auto` | Budget preset: `light`, `medium`, `heavy` |
232
+ | `threads` | Parallel eval threads |
233
+ | `seed` | Reproducibility seed |
234
+
235
+ ## Diagnostics
236
+
237
+ ```bash
238
+ pi-para doctor
239
+ pi-para doctor --fix
240
+ pi-para doctor --test-capture-model
241
+ ```
242
+
243
+ Doctor checks config, wiki directory, scheduler DB, secrets permissions, generated-state `.gitignore`, provider profiles, capture model credentials, QMD SDK health, and capture backlog.