wicked-brain 0.4.9 → 0.4.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-brain",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "description": "Digital brain as skills for AI coding CLIs — no vector DB, no embeddings, no infrastructure",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-brain-server",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "description": "SQLite FTS5 search server for wicked-brain digital knowledge bases",
6
6
  "keywords": [
@@ -9,8 +9,15 @@ Factory skill for wicked-brain agents. Lists available agents and dispatches the
9
9
 
10
10
  ## Config
11
11
 
12
- Read `_meta/config.json` for brain path and server port.
13
- If it doesn't exist, trigger wicked-brain:init.
12
+ Resolve the brain config via the shared resolution in
13
+ wicked-brain:init § "Resolving the brain config". In short: try
14
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
15
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
16
+ wicked-brain:init. Read the resolved file for brain path and server port.
17
+
18
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
19
+ against the current working directory and brain files will end up in the
20
+ project root.
14
21
 
15
22
  ## Parameters
16
23
 
@@ -25,8 +25,15 @@ For the brain path default:
25
25
 
26
26
  ## Config
27
27
 
28
- Read `_meta/config.json` for brain path and server port.
29
- If it doesn't exist, trigger wicked-brain:init.
28
+ Resolve the brain config via the shared resolution in
29
+ wicked-brain:init § "Resolving the brain config". In short: try
30
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
31
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
32
+ wicked-brain:init. Read the resolved file for brain path and server port.
33
+
34
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
35
+ against the current working directory and brain files will end up in the
36
+ project root.
30
37
 
31
38
  ## Process
32
39
 
@@ -9,8 +9,15 @@ Writes a contextual `## wicked-brain` section into the active CLI/IDE's agent co
9
9
 
10
10
  ## Config
11
11
 
12
- Read `_meta/config.json` for brain path and server port.
13
- If it doesn't exist, trigger wicked-brain:init.
12
+ Resolve the brain config via the shared resolution in
13
+ wicked-brain:init § "Resolving the brain config". In short: try
14
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
15
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
16
+ wicked-brain:init. Read the resolved file for brain path and server port.
17
+
18
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
19
+ against the current working directory and brain files will end up in the
20
+ project root.
14
21
 
15
22
  ## Process
16
23
 
@@ -24,8 +24,15 @@ For the brain path default:
24
24
 
25
25
  ## Config
26
26
 
27
- Read `_meta/config.json` for brain path and server port.
28
- If it doesn't exist, trigger wicked-brain:init.
27
+ Resolve the brain config via the shared resolution in
28
+ wicked-brain:init § "Resolving the brain config". In short: try
29
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
30
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
31
+ wicked-brain:init. Read the resolved file for brain path and server port.
32
+
33
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
34
+ against the current working directory and brain files will end up in the
35
+ project root.
29
36
 
30
37
  ## Parameters
31
38
 
@@ -24,8 +24,15 @@ For the brain path default:
24
24
 
25
25
  ## Config
26
26
 
27
- Read `_meta/config.json` for brain path and server port.
28
- If it doesn't exist, trigger wicked-brain:init.
27
+ Resolve the brain config via the shared resolution in
28
+ wicked-brain:init § "Resolving the brain config". In short: try
29
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
30
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
31
+ wicked-brain:init. Read the resolved file for brain path and server port.
32
+
33
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
34
+ against the current working directory and brain files will end up in the
35
+ project root.
29
36
 
30
37
  ## Process
31
38
 
@@ -22,8 +22,15 @@ and the archive-rename convention used by wicked-brain:agent dispatch consolidat
22
22
 
23
23
  ## Config
24
24
 
25
- Read `_meta/config.json` for brain path and server port.
26
- If it doesn't exist, trigger wicked-brain:init.
25
+ Resolve the brain config via the shared resolution in
26
+ wicked-brain:init § "Resolving the brain config". In short: try
27
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
28
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
29
+ wicked-brain:init. Read the resolved file for brain path and server port.
30
+
31
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
32
+ against the current working directory and brain files will end up in the
33
+ project root.
27
34
 
28
35
  ## Parameters
29
36
 
@@ -25,8 +25,15 @@ For the brain path default:
25
25
 
26
26
  ## Config
27
27
 
28
- Read `{brain_path}/_meta/config.json` for brain path and server port.
29
- If it doesn't exist, trigger wicked-brain:init.
28
+ Resolve the brain config via the shared resolution in
29
+ wicked-brain:init § "Resolving the brain config". In short: try
30
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
31
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
32
+ wicked-brain:init. Read the resolved file for brain path and server port.
33
+
34
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
35
+ against the current working directory and brain files will end up in the
36
+ project root.
30
37
 
31
38
  ## Parameters
32
39
 
@@ -45,7 +52,8 @@ curl -s -f -X POST http://localhost:{port}/api \
45
52
  ```
46
53
 
47
54
  If this fails (connection refused or non-2xx), invoke `wicked-brain:server` to start it
48
- before continuing. Re-read `_meta/config.json` after the server starts to get the
55
+ before continuing. Re-read `{brain_path}/_meta/config.json` (the resolved
56
+ config from the Config section above) after the server starts to get the
49
57
  actual port it bound to.
50
58
 
51
59
  ### Step 1: Assess scope
@@ -400,7 +408,7 @@ Archived files are invisible to the file watcher, so the server won't clean them
400
408
 
401
409
  ### Step 5: Record source path
402
410
 
403
- After ingesting a directory, write the absolute source path to `_meta/config.json`
411
+ After ingesting a directory, write the absolute source path to the resolved `{brain_path}/_meta/config.json`
404
412
  so the brain server can use it as the LSP workspace root (enabling symbol lookup,
405
413
  go-to-definition, and diagnostics for the ingested project):
406
414
 
@@ -47,6 +47,30 @@ For the brain path default:
47
47
  - macOS/Linux: `~/.wicked-brain/projects/{project_name}`
48
48
  - Windows: `%USERPROFILE%\.wicked-brain\projects\{project_name}`
49
49
 
50
+ ## Resolving the brain config
51
+
52
+ **This section is the canonical resolution logic. Other skills point here —
53
+ keep it authoritative.** Never read a bare relative `_meta/config.json`: the
54
+ model will resolve it against the current working directory and brain files
55
+ will land in the project root.
56
+
57
+ To locate the brain config for the current session:
58
+
59
+ 1. Compute `{cwd_basename}` — the basename of the current working directory,
60
+ lowercased, with non-alphanumerics replaced by hyphens.
61
+ 2. Try `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first
62
+ (Windows: `%USERPROFILE%\.wicked-brain\projects\{cwd_basename}\_meta\config.json`).
63
+ 3. If that file doesn't exist, fall back to the legacy flat path
64
+ `~/.wicked-brain/_meta/config.json` (Windows:
65
+ `%USERPROFILE%\.wicked-brain\_meta\config.json`).
66
+ 4. If neither exists, trigger `wicked-brain:init`.
67
+ 5. Read the resolved file. It contains `brain_path` and `server_port` (and
68
+ optionally `source_path`). All subsequent operations use these values —
69
+ never hardcode the port or path.
70
+
71
+ Any skill that needs to read, write, or reference `_meta/config.json` MUST use
72
+ this resolution. Never compute `_meta/config.json` against the project's `cwd`.
73
+
50
74
  ## When to use
51
75
 
52
76
  - User explicitly asks to create/initialize a brain
@@ -56,13 +80,23 @@ For the brain path default:
56
80
 
57
81
  ### Step 1: Ask the user
58
82
 
59
- Compute the default project name from the current working directory basename
60
- (lowercase, replace non-alphanumerics with hyphens). Then ask:
83
+ **Ask in this exact order do not reverse the questions:**
84
+
85
+ First, compute `{cwd_basename}`: take the basename of the current working directory,
86
+ lowercase it, and replace any non-alphanumeric characters with hyphens.
87
+
88
+ Then ask **two questions, in order**:
89
+
90
+ 1. **"What should this project's brain be called?"**
91
+ - Default: `{cwd_basename}` (the current directory name, not the string "wicked-brain")
92
+ - Wait for the user's answer (or acceptance of default) before asking question 2.
61
93
 
62
- 1. "What should this project's brain be called?" — Default: `{cwd_basename}`
63
- 2. "Where should it live?" — Default:
64
- - macOS/Linux: `~/.wicked-brain/projects/{project_name}`
65
- - Windows: `%USERPROFILE%\.wicked-brain\projects\{project_name}`
94
+ 2. **"Where should it live?"**
95
+ - Default:
96
+ - macOS/Linux: `~/.wicked-brain/projects/{project_name}` (where `{project_name}` is the name from question 1)
97
+ - Windows: `%USERPROFILE%\.wicked-brain\projects\{project_name}`
98
+ - The default path MUST include the `projects/` subdirectory and the project name.
99
+ **Never default to just `~/.wicked-brain/`** — that is the parent container, not a brain.
66
100
 
67
101
  If the user supplies a path that is exactly `~/.wicked-brain` (the parent
68
102
  directory, not a project subdirectory), push back: explain the per-project
@@ -25,8 +25,15 @@ For the brain path default:
25
25
 
26
26
  ## Config
27
27
 
28
- Read `_meta/config.json` for brain path and server port.
29
- If it doesn't exist, trigger wicked-brain:init.
28
+ Resolve the brain config via the shared resolution in
29
+ wicked-brain:init § "Resolving the brain config". In short: try
30
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
31
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
32
+ wicked-brain:init. Read the resolved file for brain path and server port.
33
+
34
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
35
+ against the current working directory and brain files will end up in the
36
+ project root.
30
37
 
31
38
  ## Process
32
39
 
@@ -40,8 +40,15 @@ whether the language server process is running and review its stderr logs.
40
40
 
41
41
  ## Config
42
42
 
43
- Read `_meta/config.json` for brain path and server port.
44
- If it doesn't exist, trigger wicked-brain:init.
43
+ Resolve the brain config via the shared resolution in
44
+ wicked-brain:init § "Resolving the brain config". In short: try
45
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
46
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
47
+ wicked-brain:init. Read the resolved file for brain path and server port.
48
+
49
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
50
+ against the current working directory and brain files will end up in the
51
+ project root.
45
52
 
46
53
  ## Prerequisites — Source Path
47
54
 
@@ -72,7 +79,7 @@ If `source_path` is **missing** — LSP will fail. Fix it before continuing.
72
79
  wicked-brain:ingest source=/path/to/project
73
80
  ```
74
81
 
75
- **Option B** — Write it manually to `_meta/config.json`, then restart the server:
82
+ **Option B** — Write it manually to the resolved `{brain_path}/_meta/config.json` (from the Config section), then restart the server:
76
83
  ```bash
77
84
  # Read current config, add source_path, write back
78
85
  python3 -c "
@@ -269,7 +276,7 @@ If installation fails, report to the user:
269
276
  | `language_server_crashed` | The server crashed 3 times. Report to user, suggest checking the language server logs. |
270
277
  | `unsupported_language` | No known language server for this file extension. |
271
278
  | `lsp_timeout` | The language server took too long. May be initializing a large project. Retry once. |
272
- | `file_outside_workspace` | The file isn't under `source_path`. Check `_meta/config.json` — `source_path` must be the project root that contains the file. Set it and restart the server with `--source`. |
279
+ | `file_outside_workspace` | The file isn't under `source_path`. Check the resolved `{brain_path}/_meta/config.json` — `source_path` must be the project root that contains the file. Set it and restart the server with `--source`. |
273
280
 
274
281
  ### Step 5: Use results
275
282
 
@@ -21,8 +21,15 @@ Store and recall experiential learnings in the brain's memory system.
21
21
 
22
22
  ## Config
23
23
 
24
- Read `_meta/config.json` for brain path and server port.
25
- If it doesn't exist, trigger wicked-brain:init.
24
+ Resolve the brain config via the shared resolution in
25
+ wicked-brain:init § "Resolving the brain config". In short: try
26
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
27
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
28
+ wicked-brain:init. Read the resolved file for brain path and server port.
29
+
30
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
31
+ against the current working directory and brain files will end up in the
32
+ project root.
26
33
 
27
34
  ## Parameters
28
35
 
@@ -171,7 +171,7 @@ and ask them to resolve manually before retrying.
171
171
  `server_port: 4242` is the *preferred starting port*, not the guaranteed port.
172
172
  When the server starts in Step 7 it probes from this value upward and writes
173
173
  the actual bound port back to this same file. After Step 7, always re-read
174
- `_meta/config.json` to get the real port — never hardcode `4242` in downstream
174
+ `{target_path}/_meta/config.json` to get the real port — never hardcode `4242` in downstream
175
175
  calls. This matters especially when migrating while another brain is already
176
176
  running on 4242.
177
177
 
@@ -14,8 +14,15 @@ You answer questions from the brain's content by dispatching a query subagent.
14
14
 
15
15
  ## Config
16
16
 
17
- Read `_meta/config.json` for brain path and server port.
18
- If it doesn't exist, trigger wicked-brain:init.
17
+ Resolve the brain config via the shared resolution in
18
+ wicked-brain:init § "Resolving the brain config". In short: try
19
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
20
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
21
+ wicked-brain:init. Read the resolved file for brain path and server port.
22
+
23
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
24
+ against the current working directory and brain files will end up in the
25
+ project root.
19
26
 
20
27
  ## Parameters
21
28
 
@@ -15,7 +15,15 @@ more than the user or calling skill needs.
15
15
 
16
16
  ## Config
17
17
 
18
- Read the brain path from `_meta/config.json`. If it doesn't exist, trigger wicked-brain:init.
18
+ Resolve the brain config via the shared resolution in
19
+ wicked-brain:init § "Resolving the brain config". In short: try
20
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
21
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
22
+ wicked-brain:init. Read the resolved file for brain path and server port.
23
+
24
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
25
+ against the current working directory and brain files will end up in the
26
+ project root.
19
27
 
20
28
  ## Parameters
21
29
 
@@ -21,8 +21,15 @@ Scan chunks and memories with thin tagging and expand their `contains:` with syn
21
21
 
22
22
  ## Config
23
23
 
24
- Read `_meta/config.json` for brain path and server port.
25
- If it doesn't exist, trigger wicked-brain:init.
24
+ Resolve the brain config via the shared resolution in
25
+ wicked-brain:init § "Resolving the brain config". In short: try
26
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
27
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
28
+ wicked-brain:init. Read the resolved file for brain path and server port.
29
+
30
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
31
+ against the current working directory and brain files will end up in the
32
+ project root.
26
33
 
27
34
  ## Parameters
28
35
 
@@ -23,8 +23,15 @@ compact, navigable list.
23
23
 
24
24
  ## Config
25
25
 
26
- Read `_meta/config.json` for brain path and server port.
27
- If it doesn't exist, trigger wicked-brain:init.
26
+ Resolve the brain config via the shared resolution in
27
+ wicked-brain:init § "Resolving the brain config". In short: try
28
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
29
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
30
+ wicked-brain:init. Read the resolved file for brain path and server port.
31
+
32
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
33
+ against the current working directory and brain files will end up in the
34
+ project root.
28
35
 
29
36
  ## Parameters
30
37
 
@@ -26,8 +26,15 @@ For the brain path default:
26
26
 
27
27
  ## Config
28
28
 
29
- Read `_meta/config.json` for brain path and server port.
30
- If it doesn't exist, trigger wicked-brain:init.
29
+ Resolve the brain config via the shared resolution in
30
+ wicked-brain:init § "Resolving the brain config". In short: try
31
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
32
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
33
+ wicked-brain:init. Read the resolved file for brain path and server port.
34
+
35
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
36
+ against the current working directory and brain files will end up in the
37
+ project root.
31
38
 
32
39
  ## Parameters
33
40
 
@@ -18,8 +18,23 @@ platform differences, alternatives are shown. Your native tools (Read, Write,
18
18
  Grep, Glob) work everywhere — prefer them over shell commands when possible.
19
19
 
20
20
  For the brain path default:
21
- - macOS/Linux: ~/.wicked-brain
22
- - Windows: %USERPROFILE%\.wicked-brain
21
+ - macOS/Linux: `~/.wicked-brain/projects/{cwd_basename}`
22
+ - Windows: `%USERPROFILE%\.wicked-brain\projects\{cwd_basename}`
23
+
24
+ ## Config
25
+
26
+ Resolve the brain config via the shared resolution in
27
+ wicked-brain:init § "Resolving the brain config". In short: try
28
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
29
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
30
+ wicked-brain:init. Read the resolved file to get `brain_path` and `server_port`.
31
+
32
+ If the calling skill already passed `brain_path`, use that directly instead of
33
+ re-resolving.
34
+
35
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
36
+ against the current working directory and brain files will end up in the
37
+ project root.
23
38
 
24
39
  ## When to use
25
40
 
@@ -48,7 +63,7 @@ For the brain path default:
48
63
  - Or use Python: `python3 -c "import os; os.kill({pid}, 0)" 2>/dev/null || python -c "import os; os.kill({pid}, 0)"`
49
64
 
50
65
  c. If the process is dead or no PID file, start the server.
51
- Also pass `--source` if `source_path` is set in `_meta/config.json`
66
+ Also pass `--source` if `source_path` is set in `{brain_path}/_meta/config.json`
52
67
  (this roots LSP language servers at the ingested project so symbol
53
68
  lookup and go-to-definition work correctly):
54
69
  ```bash
@@ -24,8 +24,15 @@ For the brain path default:
24
24
 
25
25
  ## Config
26
26
 
27
- Read `_meta/config.json` for brain path and server port.
28
- If it doesn't exist, trigger wicked-brain:init.
27
+ Resolve the brain config via the shared resolution in
28
+ wicked-brain:init § "Resolving the brain config". In short: try
29
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
30
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
31
+ wicked-brain:init. Read the resolved file for brain path and server port.
32
+
33
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
34
+ against the current working directory and brain files will end up in the
35
+ project root.
29
36
 
30
37
  ## Parameters
31
38
 
@@ -25,8 +25,15 @@ For the brain path default:
25
25
 
26
26
  ## Config
27
27
 
28
- Read `_meta/config.json` for brain path and server port.
29
- If it doesn't exist, trigger wicked-brain:init.
28
+ Resolve the brain config via the shared resolution in
29
+ wicked-brain:init § "Resolving the brain config". In short: try
30
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
31
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
32
+ wicked-brain:init. Read the resolved file for brain path and server port.
33
+
34
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
35
+ against the current working directory and brain files will end up in the
36
+ project root.
30
37
 
31
38
  ## Synonym File
32
39