@jossuealcala/madre 1.1.2 → 1.1.3

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 (101) hide show
  1. package/CHANGELOG.en.md +21 -1
  2. package/CHANGELOG.md +21 -1
  3. package/README.en.md +3 -3
  4. package/README.md +3 -3
  5. package/SECURITY.md +11 -6
  6. package/bin/madre.mjs +74 -11
  7. package/docs/REFERENCE.md +13 -7
  8. package/docs/SDK.md +8 -8
  9. package/docs/en/REFERENCE.md +10 -6
  10. package/docs/en/SDK.md +8 -8
  11. package/docs/en/training/README.md +1 -1
  12. package/docs/sdk/connector-module.mjs +1 -1
  13. package/docs/sdk/hello-module.mjs +1 -1
  14. package/docs/training/README.md +1 -1
  15. package/docs/training/train.sh +3 -0
  16. package/package.json +4 -2
  17. package/public/activity.js +9 -0
  18. package/public/app.js +988 -171
  19. package/public/attribution.js +9 -0
  20. package/public/brands.js +27 -13
  21. package/public/en.js +1 -2
  22. package/public/es.js +834 -257
  23. package/public/index.html +3 -0
  24. package/public/macroverso.js +24 -5
  25. package/public/manual-content.js +32 -2
  26. package/public/market-view.js +116 -9
  27. package/public/market.js +15 -0
  28. package/public/news-scenes.js +185 -0
  29. package/public/notices.js +66 -0
  30. package/public/power.js +1 -1
  31. package/public/resay.js +3 -0
  32. package/public/salas-mac.css +229 -26
  33. package/public/salas-mac.html +3 -0
  34. package/public/salas-mac.js +454 -37
  35. package/public/styles.css +393 -17
  36. package/public/tips.js +124 -0
  37. package/public/tour-chapters.js +75 -75
  38. package/public/tour.js +36 -8
  39. package/public/troubleshooting.js +215 -22
  40. package/public/welcome-scene.js +358 -0
  41. package/public/welcome.js +514 -273
  42. package/src/adapters/gemini-rest.mjs +236 -0
  43. package/src/adapters/gemini.mjs +9 -7
  44. package/src/adapters/grok.mjs +288 -0
  45. package/src/adapters/process.mjs +14 -3
  46. package/src/auth-probe.mjs +32 -0
  47. package/src/bridge/policy.mjs +1 -1
  48. package/src/capabilities.mjs +30 -0
  49. package/src/checkpoint.mjs +115 -1
  50. package/src/codex-route.mjs +113 -0
  51. package/src/credentials.mjs +46 -8
  52. package/src/dataset.mjs +18 -7
  53. package/src/event-store.mjs +10 -2
  54. package/src/ficha.mjs +142 -0
  55. package/src/files.mjs +36 -2
  56. package/src/lease.mjs +5 -0
  57. package/src/market-check.mjs +1 -1
  58. package/src/market-remote.mjs +135 -1
  59. package/src/mcp/image-server.mjs +1 -1
  60. package/src/mcp/memory-server.mjs +10 -0
  61. package/src/memory-tools.mjs +3 -0
  62. package/src/memory.mjs +29 -4
  63. package/src/models.mjs +21 -3
  64. package/src/modules/ahp.mjs +8 -3
  65. package/src/modules/bishop-exam.mjs +41 -12
  66. package/src/modules/bishop.mjs +2 -2
  67. package/src/modules/choices.mjs +12 -10
  68. package/src/modules/fetch-alone.mjs +7 -0
  69. package/src/modules/helpers.mjs +23 -5
  70. package/src/modules/image-studio.mjs +13 -27
  71. package/src/modules/index.mjs +54 -11
  72. package/src/modules/isolated.mjs +160 -0
  73. package/src/modules/ollama.mjs +35 -6
  74. package/src/modules/playwright.mjs +46 -17
  75. package/src/modules/run-alone.mjs +122 -0
  76. package/src/modules/runs.mjs +11 -8
  77. package/src/modules/sdk.mjs +4 -2
  78. package/src/notices-key.mjs +8 -0
  79. package/src/notices.mjs +185 -0
  80. package/src/ollama.mjs +57 -15
  81. package/src/outbound.mjs +45 -8
  82. package/src/room/archivist.mjs +30 -5
  83. package/src/room/busy.mjs +16 -0
  84. package/src/room/control.mjs +36 -6
  85. package/src/room/guard.mjs +32 -2
  86. package/src/room/prompt.mjs +32 -5
  87. package/src/room/vectors.mjs +7 -1
  88. package/src/room.mjs +94 -28
  89. package/src/router.mjs +1 -1
  90. package/src/runs.mjs +39 -0
  91. package/src/runtime-detection.mjs +46 -6
  92. package/src/salas.mjs +151 -15
  93. package/src/server.mjs +577 -80
  94. package/src/service.mjs +116 -0
  95. package/src/setup-trouble.mjs +20 -1
  96. package/src/skill-check.mjs +269 -0
  97. package/src/skills-import.mjs +128 -0
  98. package/src/skills.mjs +492 -0
  99. package/src/tour.mjs +14 -3
  100. package/src/whats-new.mjs +48 -0
  101. package/src/rumbo.mjs +0 -337
@@ -45,6 +45,10 @@ const installAgent = {
45
45
  darwin: ['curl https://cursor.com/install -fsS | bash'],
46
46
  linux: ['curl https://cursor.com/install -fsS | bash']
47
47
  },
48
+ grok: {
49
+ darwin: ['npm install -g @xai-official/grok'],
50
+ linux: ['npm install -g @xai-official/grok']
51
+ },
48
52
  };
49
53
 
50
54
  const loginAgent = {
@@ -53,10 +57,16 @@ const loginAgent = {
53
57
  gemini: { darwin: ['gemini', '# inside gemini: /auth → "Use Gemini API key" or Google login'], linux: ['gemini', '# inside gemini: /auth']},
54
58
  opencode: { darwin: ['opencode auth login', 'opencode auth list'], linux: ['opencode auth login', 'opencode auth list']},
55
59
  cursor: { darwin: ['cursor-agent login', 'cursor-agent status'], linux: ['cursor-agent login', 'cursor-agent status']},
60
+ grok: { darwin: ['grok login', 'grok models'], linux: ['grok login --device-auth', 'grok models']},
56
61
  };
57
62
 
58
63
  const same = (commands) => ({ darwin: commands, linux: commands });
59
64
 
65
+ const customEndpointFixes = (agent = null) => ({
66
+ darwin: ['env | grep -E \'^(ANTHROPIC|OPENAI)_BASE_URL=\'', '# remove that export from ~/.zshrc, ~/.zprofile or ~/.zshenv; then:', 'unset ANTHROPIC_BASE_URL OPENAI_BASE_URL', ...(agent === 'codex' ? ['# if MADRE names Codex config.toml, remove openai_base_url or model_provider from ~/.codex/config.toml (or $CODEX_HOME/config.toml)'] : []), ...(agent ? ['# reopen the project; only for a gateway you verified:', `PULSE_ALLOW_CUSTOM_AGENT_ENDPOINTS=${agent} madre start`] : [])],
67
+ linux: ['env | grep -E \'^(ANTHROPIC|OPENAI)_BASE_URL=\'', '# remove that export from ~/.bashrc, ~/.profile or ~/.bash_profile; then:', 'unset ANTHROPIC_BASE_URL OPENAI_BASE_URL', ...(agent === 'codex' ? ['# if MADRE names Codex config.toml, remove openai_base_url or model_provider from ~/.codex/config.toml (or $CODEX_HOME/config.toml)'] : []), ...(agent ? ['# reopen the project; only for a gateway you verified:', `PULSE_ALLOW_CUSTOM_AGENT_ENDPOINTS=${agent} madre start`] : [])],
68
+ });
69
+
60
70
  export const CONDITIONS = [
61
71
  {
62
72
  id: 'claude-api-key-shadows-plan',
@@ -78,12 +88,11 @@ export const CONDITIONS = [
78
88
  severity: 'blocking',
79
89
  title: 'The agent is pointed at a custom endpoint',
80
90
  match: /MADRE blocked @(?:codex|claude) before sending the briefing|Subscribe to (?:the )?Telegram|@conduitapi/i,
81
- diagnosis: 'The installed CLI inherited a base-URL override from this computer, so its request was going to another gateway instead of the official agent service. A demand to join a Telegram channel comes from that gateway, not from MADRE, Anthropic or OpenAI. MADRE now names that route and stops before sending the briefing.',
82
- remedy: 'Do not subscribe or enter credentials. Remove the base-URL override and reopen MADRE to use the official service. If the gateway is intentional and you have verified who operates it, explicitly allow only that agent.',
83
- fixes: {
84
- darwin: ['env | grep -E \'^(ANTHROPIC|OPENAI)_BASE_URL=\'', '# remove that export from ~/.zshrc, ~/.zprofile or ~/.zshenv; then:', 'unset ANTHROPIC_BASE_URL OPENAI_BASE_URL', '# reopen the project; only for a gateway you verified:', 'PULSE_ALLOW_CUSTOM_AGENT_ENDPOINTS=claude madre start'],
85
- linux: ['env | grep -E \'^(ANTHROPIC|OPENAI)_BASE_URL=\'', '# remove that export from ~/.bashrc, ~/.profile or ~/.bash_profile; then:', 'unset ANTHROPIC_BASE_URL OPENAI_BASE_URL', '# reopen the project; only for a gateway you verified:', 'PULSE_ALLOW_CUSTOM_AGENT_ENDPOINTS=claude madre start'],
86
- },
91
+ diagnosis: 'The agent has a custom route in this computer\'s environment or, for Codex, in its user configuration. Its request could go to another gateway instead of the official agent service. A demand to join a Telegram channel comes from that gateway, not from MADRE, Anthropic or OpenAI. When MADRE detects the route before a turn, it stops before preparing the briefing.',
92
+ remedy: 'Do not subscribe or enter credentials. Remove the custom route from the environment or Codex configuration and reopen MADRE to use the official service. If the gateway is intentional and you have verified who operates it, explicitly allow only that agent.',
93
+ fixes: customEndpointFixes(),
94
+ perAgent: { codex: customEndpointFixes('codex'), claude: customEndpointFixes('claude') },
95
+ perAgentReplacesFixes: true,
87
96
  },
88
97
  {
89
98
  id: 'codex-reading-stdin',
@@ -148,7 +157,9 @@ export const CONDITIONS = [
148
157
  agent: 'gemini',
149
158
  severity: 'transient',
150
159
  title: 'Gemini model under high demand (503)',
151
- match: /status 503|high demand|UNAVAILABLE/i,
160
+ // MADRE's own sentence too, in the room's language (1.1.2 diagnostics: 14 copies filed «Google
161
+ // reportó el modelo como no disponible (HTTP 503)…» as unknown).
162
+ match: /status 503|high demand|UNAVAILABLE|\(HTTP 503\)/i,
152
163
  diagnosis: 'Google is shedding load on the selected model (HTTP 503). The CLI would retry with backoff for minutes; MADRE stops it after 15 s of that and retries once on gemini-3-flash-preview. The turn failed only if that spare model failed too; the message is still the one about the model you chose.',
153
164
  remedy: 'Ask again in a minute, pick an explicit model from the Write box\'s model menu, or hand the question to another agent. PULSE_GEMINI_FALLBACK_MODEL changes the spare model; left empty, there is none.',
154
165
  fixes: same(['# wait, then resend — or continue with @codex / @claude / @opencode', 'PULSE_GEMINI_FALLBACK_MODEL= madre start']),
@@ -175,7 +186,8 @@ export const CONDITIONS = [
175
186
  code: 'MU-059',
176
187
  severity: 'blocking',
177
188
  title: 'The API account behind this agent has no credit left',
178
- match: /credit balance is too low|purchase credits|insufficient_quota|exceeded your current quota|billing_hard_limit_reached/i,
189
+ // OpenRouter's two ways of saying it (diagnostics of 1.1.2, D-7).
190
+ match: /credit balance is too low|purchase credits|insufficient_quota|exceeded your current quota|billing_hard_limit_reached|requires more credits|exceed your available credits/i,
179
191
  diagnosis: 'The provider refused the turn because the API key it was sent with has no balance left. An API key is billed apart from a subscription: a Claude Pro or Max plan, or ChatGPT, does not pay for it. In OpenCode it is the provider of the model the turn asked for, and a turn that named none ran on the default model of Settings › Agents › OpenCode.',
180
192
  remedy: 'Top up that API account, or give OpenCode a model whose provider has a session that works: your ChatGPT account (openai/…), GitHub Copilot, or OpenCode\'s own free models (opencode/…). Change the default in Settings › Agents › OpenCode, or pick another model in the Write box for one turn.',
181
193
  fixes: same(['# Anthropic API: https://console.anthropic.com/settings/billing', '# OpenAI API: https://platform.openai.com/settings/organization/billing', '# OpenCode, one turn on its own free model:', 'PULSE_OPENCODE_MODEL=opencode/big-pickle madre start', '# or take the key with no balance out of OpenCode:', 'opencode auth logout anthropic']),
@@ -186,7 +198,8 @@ export const CONDITIONS = [
186
198
  agent: 'opencode',
187
199
  severity: 'blocking',
188
200
  title: 'OpenCode\'s free models have run out for now',
189
- match: /Free usage limit reached|free use of OpenCode ran out/i,
201
+ // And MADRE's sentence in Spanish (1.1.2 diagnostics: 5 copies filed it as unknown).
202
+ match: /Free usage limit reached|free use of OpenCode ran out|uso gratis de OpenCode/i,
190
203
  diagnosis: 'OpenCode\'s own free models (opencode/…) answer without an account, but only up to a limit; when it is reached OpenCode retries in silence and never answers. MADRE now stops the turn as soon as OpenCode says so, instead of waiting for the clock. Nothing in the project is wrong.',
191
204
  remedy: 'Connect a provider of yours to OpenCode in Settings › Agents › OpenCode (your ChatGPT account, GitHub Copilot or an API key), ask another agent, or ask @madre, which runs on this computer. The free use comes back after a while.',
192
205
  fixes: same(['# the providers OpenCode can use:', 'opencode auth login', '# subscription for more free use: https://opencode.ai/go']),
@@ -202,6 +215,58 @@ export const CONDITIONS = [
202
215
  remedy: 'Wait for the usage to renew, change the Cursor plan, or ask another agent in the meantime.',
203
216
  fixes: same(['# plan and usage: https://cursor.com/dashboard', 'cursor-agent status']),
204
217
  },
218
+ {
219
+ // Seen with a Grok Plus account on 2026-11-06: every turn refused with «Access to the chat
220
+ // endpoint is denied», in the CLI's own screen too. The sign-in had been made before the plan
221
+ // was active; signing in again fixed it.
222
+ id: 'grok-account-refused',
223
+ code: 'MU-084',
224
+ agent: 'grok',
225
+ severity: 'blocking',
226
+ title: 'xAI refuses this Grok account',
227
+ match: /chat endpoint is denied|xAI refused this Grok account|xAI rechazó esta cuenta de Grok/i,
228
+ diagnosis: 'Grok is signed in, but xAI answers every turn with a 403. It happens when the sign-in was made before the plan was active. It is xAI\'s answer, not MADRE\'s: nothing in the project is wrong.',
229
+ remedy: 'Sign in to Grok again: grok logout, then grok login. If it keeps happening, check at grok.com that your plan is active.',
230
+ fixes: same(['grok logout', 'grok login', 'grok models # «You are logged in with grok.com.»']),
231
+ },
232
+ {
233
+ // 1.1.3: Gemini answers through its API with a key, without its CLI (a575180). Google's «model
234
+ // not found» came back in MADRE's own words, in both languages, and no card knew it.
235
+ id: 'gemini-model-unavailable',
236
+ code: 'MU-085',
237
+ agent: 'gemini',
238
+ severity: 'blocking',
239
+ title: 'This Gemini model is not available for your key',
240
+ match: /does not exist or is not available for this key|no existe o no está disponible para esta llave|is not found for API version|is not supported for generateContent/i,
241
+ diagnosis: 'Gemini answers through its API with your key, and Google says the model chosen in the box does not exist or this key cannot use it. It happens with a model Google retired, a preview your key has no access to, or a name written by hand.',
242
+ remedy: 'Choose another Gemini model in the box, or leave the default one. If you need that model, check in AI Studio that your key has access to it.',
243
+ fixes: same(['# the models your key opens: https://aistudio.google.com/app/apikey']),
244
+ },
245
+ {
246
+ // 1.1.3, the same adapter: through the API the whole briefing goes in one request.
247
+ id: 'gemini-message-too-long',
248
+ code: 'MU-086',
249
+ agent: 'gemini',
250
+ severity: 'blocking',
251
+ title: 'The message is too long for this Gemini model',
252
+ match: /longer than this Gemini model takes|más largo de lo que este modelo de Gemini recibe|exceeds the maximum number of tokens/i,
253
+ diagnosis: 'Through its API, Gemini receives everything in one go: your message, what you attached and the memory that came with it. This time it was more than the chosen model takes.',
254
+ remedy: 'Ask in smaller parts, attach less at once, or choose a Gemini model that takes more. A new chat also sends less of the conversation.',
255
+ fixes: same(['# how much each model takes: https://ai.google.dev/gemini-api/docs/models']),
256
+ },
257
+ {
258
+ // 1.1.3: a module you install runs in a process of its own, fenced by Node's permission model
259
+ // (b454bab). One written for the old way, that writes or starts a program itself, is stopped by
260
+ // Node with ERR_ACCESS_DENIED, which reached nobody as anything they could act on.
261
+ id: 'module-fenced',
262
+ code: 'MU-087',
263
+ severity: 'blocking',
264
+ title: 'A module tried something its fence does not allow',
265
+ match: /ERR_ACCESS_DENIED|Access to this API has been restricted/i,
266
+ diagnosis: 'Since 1.1.3, a module you install runs apart, with limited permissions: it can read its own file, but it cannot write your files or start other programs by itself. This module tried one of those and Node stopped it. Your project and MADRE are fine.',
267
+ remedy: 'Ask the module\'s author for a version made for MADRE 1.1.3, which asks MADRE for what it needs instead of doing it itself. Meanwhile, turn it off in Modules.',
268
+ fixes: same(['# Modules › the module › turn it off']),
269
+ },
205
270
  {
206
271
  // Seen in the diagnostics of 1.1.0 (2026-10-31): Codex on a free ChatGPT account ran out and
207
272
  // the room called it an unknown failure.
@@ -215,6 +280,96 @@ export const CONDITIONS = [
215
280
  remedy: 'Wait until the date Codex gives, change your ChatGPT plan, or ask another agent in the meantime.',
216
281
  fixes: same(['# plan and usage: https://chatgpt.com/codex/settings/usage']),
217
282
  },
283
+ {
284
+ // Seen in the diagnostics of 1.1.2 (2026-11-03 to 11-06, two copies): Codex signed in with a
285
+ // ChatGPT account asks, before each turn, which workspace of that account to send it to, and
286
+ // «workspace routing discovery failed» reached the author as an unknown failure. Its 401 is a
287
+ // session gone, which the signed-out card already reads.
288
+ id: 'codex-workspace-routing',
289
+ code: 'MU-083',
290
+ agent: 'codex',
291
+ severity: 'transient',
292
+ title: 'Codex could not reach its ChatGPT workspace',
293
+ match: /workspace routing discovery (?:failed|timed out)/i,
294
+ diagnosis: 'Signed in with a ChatGPT account, Codex first asks OpenAI which workspace of that account the turn goes to, and that question did not get an answer: OpenAI did not answer in time, or this computer\'s connection did not get through. Nothing in the project is wrong.',
295
+ remedy: 'Try again in a moment. If it keeps happening, sign Codex in again in Settings › Agents › Codex, and check the connection of this computer.',
296
+ fixes: same(['# sign in again:', 'codex logout', 'codex login']),
297
+ },
298
+ {
299
+ // Seen in the diagnostics of 1.1.2 (2026-11-03): a model the ChatGPT plan does not include
300
+ // reached the room as Codex's own English line.
301
+ id: 'codex-model-plan',
302
+ code: 'MU-075',
303
+ agent: 'codex',
304
+ severity: 'blocking',
305
+ title: 'Codex does not offer that model on this account',
306
+ match: /model is not supported when using Codex with a ChatGPT account/i,
307
+ diagnosis: 'The model chosen for this turn is not one your ChatGPT account can use in Codex, so Codex refused the turn before starting. Nothing in the project changed.',
308
+ remedy: 'Choose «default» in the model menu of the Write box, or one of the models listed there: they are the ones your account offers.',
309
+ fixes: same(['# the models your account lists: ~/.codex/models_cache.json', 'codex # then /model']),
310
+ },
311
+ {
312
+ // Seen in the diagnostics of 1.1.2 (2026-11-03, D-7): Claude's plan window ran out, and only the
313
+ // card that explains the usage numbers matched it, which is no reason for a failure.
314
+ id: 'claude-usage-limit',
315
+ code: 'MU-077',
316
+ agent: 'claude',
317
+ severity: 'blocking',
318
+ title: 'Claude has reached its usage limit',
319
+ match: /hit your (?:5-hour|weekly|session|usage) limit|Claude AI usage limit reached/i,
320
+ diagnosis: 'Your Claude account has used up what its plan gives for this window, and Claude refuses every turn until it resets. Claude says when that is at the end of its message. It is Anthropic\'s limit, not MADRE\'s: nothing in the project is wrong.',
321
+ remedy: 'Wait until the time Claude gives, change your Claude plan, or ask another agent in the meantime.',
322
+ fixes: same(['# plan and usage: https://claude.ai/settings/usage', 'claude # then /usage']),
323
+ },
324
+ {
325
+ // Seen in the diagnostics of 1.1.2 (2026-11-03, D-7): a provider of OpenCode refused its key.
326
+ id: 'api-key-invalid',
327
+ code: 'MU-078',
328
+ severity: 'blocking',
329
+ title: 'The provider refused the API key',
330
+ match: /API Key appears to be invalid|invalid api key|incorrect api key provided|api key (?:has |is )?expired/i,
331
+ diagnosis: 'The agent reached its provider, but the provider did not accept the API key it was sent with: it was mistyped, revoked or has expired. In OpenCode it is the key of the provider of the model the turn asked for.',
332
+ remedy: 'Make a new key in the provider\'s console and give it to the agent again in Settings › Agents, or connect that agent another way (your ChatGPT account, GitHub Copilot or a sign-in).',
333
+ fixes: same(['# OpenCode, the key of one provider:', 'opencode auth login', '# or take the key out:', 'opencode auth logout <provider>']),
334
+ },
335
+ {
336
+ // Seen in the diagnostics of 1.1.2 (2026-11-03, D-7): a Kimi plan without the model asked for.
337
+ id: 'plan-lacks-model',
338
+ code: 'MU-079',
339
+ severity: 'blocking',
340
+ title: 'Your plan does not include that model',
341
+ match: /subscription does not have access|Upgrade to higher-tier/i,
342
+ diagnosis: 'The provider answered, but the plan of that account does not include the model this turn asked for, so it refused the turn before starting. Nothing in the project changed.',
343
+ remedy: 'Choose another model in the model menu of the Write box, or «default», or change the plan with that provider.',
344
+ fixes: same(['# OpenCode, the models it can use:', 'opencode models']),
345
+ },
346
+ {
347
+ // Seen in the diagnostics of 1.1.2 (2026-11-03, D-7): STOP ALL and the time limit end a turn
348
+ // before its process closes, so a signal named here came from outside the turn.
349
+ id: 'stopped-from-outside',
350
+ code: 'MU-080',
351
+ severity: 'transient',
352
+ title: 'Something outside the turn stopped the agent',
353
+ match: /\((?:SIGTERM|SIGINT|SIGHUP)\)/,
354
+ diagnosis: 'The agent\'s program received a signal to quit that its turn did not send: the system, another program, a closed terminal or MADRE closing. It is not a failure of the agent or of the project.',
355
+ remedy: 'Ask again. If it keeps happening, look for what closes programs on this computer: a session that ends, WSL shutting down, or a tool that stops processes.',
356
+ fixes: same(['# WSL: what closed the Linux', 'wsl --list --running']),
357
+ },
358
+ {
359
+ // Seen in the diagnostics of 1.1.2 (2026-11-03, D-5): Linux copies with no git at all. The
360
+ // restore point before an AI writes is a git one, also in a project that is not a repository.
361
+ id: 'no-git',
362
+ code: 'MU-081',
363
+ severity: 'blocking',
364
+ title: 'Git is not installed on this computer',
365
+ match: /does not have git, which MADRE needs|no tiene git, que MADRE necesita|spawn git ENOENT/i,
366
+ diagnosis: 'Before an AI writes (#2, #3 or #4), MADRE takes a restore point with git, so that UNDO can bring everything back. This computer has no git, so the turn stopped before writing and nothing was changed. Chatting (#1) works without it.',
367
+ remedy: 'Install git, reload the page and send the message again. In the mode menu the modes that write say NEEDS GIT until it is installed.',
368
+ fixes: {
369
+ darwin: ['xcode-select --install'],
370
+ linux: ['# Ubuntu, Debian or WSL', 'sudo apt install git', '# Fedora', 'sudo dnf install git'],
371
+ },
372
+ },
218
373
  {
219
374
  id: 'not-signed-in',
220
375
  code: 'MU-008',
@@ -222,7 +377,10 @@ export const CONDITIONS = [
222
377
  severity: 'blocking',
223
378
  title: 'Agent installed but signed out',
224
379
  // «set an Auth method»: Gemini with no account chosen exits with code 41 (1.1.0 diagnostics).
225
- match: /not logged in|sign in required|Error authenticating|unauthorized|please (?:log|sign) ?in|no credentials|set an Auth method/i,
380
+ // «Update your environment»: Gemini chosen to use an API key with none set, code 41 too (1.1.2, D-7).
381
+ // Gemini's refusal in MADRE's words, in both languages (1.1.2 diagnostics: 4 copies filed «Google
382
+ // rechazó las credenciales de Gemini» as unknown, and no card matched the English either).
383
+ match: /not logged in|Grok is not signed in|Grok no tiene sesión|sign in required|Error authenticating|unauthorized|please (?:log|sign) ?in|no credentials|set an Auth method|Update your environment and try again|rejected the Gemini credentials|rechazó las credenciales de Gemini/i,
226
384
  diagnosis: 'The CLI is on this computer but has no session for its provider. MADRE never stores credentials; each agent keeps its own.',
227
385
  remedy: 'This agent has no session yet. Connect it once in Settings › Agents (MADRE runs its sign-in for you, nothing to type in a terminal), or ask the same of an agent that is connected.',
228
386
  fixes: same(['npx @jossuealcala/madre setup', '# or directly:', 'codex login', 'claude auth login', 'opencode auth login', 'gemini # then /auth']),
@@ -267,7 +425,7 @@ export const CONDITIONS = [
267
425
  title: 'Agent did not respond before the timeout',
268
426
  // MADRE writes this one itself, in the room's language, so it is matched in both: a room in
269
427
  // Spanish recorded «no contestó antes del tiempo límite» and filed it as unclassified.
270
- match: /did not respond before the timeout|went silent for|no contestó antes del tiempo límite|se quedó callad/i,
428
+ match: /did not respond before the timeout|went silent for|no contestó antes del tiempo límite|no respondió antes del tiempo límite|se quedó callad/i,
271
429
  diagnosis: 'The agent was still reading files or reasoning when its time limit expired (by default 180 s for a turn that reads and 600 s for one that writes), or Gemini stayed silent for 90 s (PULSE_GEMINI_IDLE_MS) and was stopped after one automatic retry. Long questions over many files take longer; MADRE killed the whole process tree. Whatever a writing turn left before it stopped is listed under the failure, with UNDO.',
272
430
  remedy: 'Press Apply below, or type a new number in Settings: Default time limit in Project and turns, or Time limit on the agent in Agents. Each field saves the moment you leave it. It applies to the next turn and persists in ~/.pulse/config.json. Environment variables work too, but only for a server started after exporting them; a running project never sees a later export.',
273
431
  fixes: {
@@ -620,7 +778,7 @@ export const CONDITIONS = [
620
778
  code: 'MU-040',
621
779
  severity: 'informational',
622
780
  title: 'Conversations: many per project, one memory, one at a time',
623
- match: /conversation|already open for this project|ROOM_IN_USE|a turn is running in this conversation|new conversation|chats\.json/i,
781
+ match: /conversation|already open for this project|ya está abierta para este proyecto|ROOM_IN_USE|a turn is running in this conversation|new conversation|chats\.json/i,
624
782
  diagnosis: 'A project has one memory and many conversations. The archive, the agents, the modules and the privacy list belong to the project and do not start over when you open another thread; a conversation is only the record of one line of work, and everything said in any of them feeds the same archive. The first conversation is the ledger that was always there, so a project that existed before opens exactly as it did. The numbering is the project\'s, not the thread\'s: a new conversation starts where the project got to, which is why a citation like #1411 means the same exchange in all of them. One conversation drives the agents at a time — two threads editing the same working tree is a way to lose work — so opening another while a turn runs is refused until it finishes. And one server per project: a second `madre start` on the same project is refused with the address of the project that is already open, because two servers would hand out the same sequence twice and the archive would quietly keep one of them.',
625
783
  remedy: 'The panel on the left of the canvas lists them: open one, or start another at the bottom. Deleting one takes its transcript and nothing else — what the archivist distilled from it is the project\'s memory and stays. If MADRE says the project is already open, use that project and open a conversation inside it instead of starting a second server.',
626
784
  fixes: same(['# project → Conversations → NEW CONVERSATION', '# the address of the open project is in the refusal itself', 'ls ~/.pulse/rooms/*/chats.json # their names and which one is open']),
@@ -684,7 +842,7 @@ export const CONDITIONS = [
684
842
  severity: 'common',
685
843
  title: 'Installing a module somebody else wrote',
686
844
  match: /already taken|must live under \/api\/x\/|not a module|default export must be a module|module file|\.module\.mjs|add a module/i,
687
- diagnosis: 'Modules has + Add a module for a .mjs somebody wrote. It comes through the same door as everything else: written to a scratch copy, imported there, checked against the house rules, and installed only if it passes. Three things get a file refused, each with the reason: an id that belongs to a module MADRE ships with, a route outside its own corner of the API (/api/x/<id>/), and a file that will not load at all. Said plainly, because it is what it is: a module runs inside MADRE, with your permissions, on this computer. MADRE checks that it loads and stays in its corral; what the code intends is the one thing nobody can check for you.',
845
+ diagnosis: 'Modules has + Add a module for a .mjs somebody wrote. MADRE checks it in a separate process and installs it only if it passes. Three things get a file refused, each with the reason: an id that belongs to a module MADRE ships with, a route outside its own corner of the API (/api/x/<id>/), and a file that will not load at all. Once installed, each call runs in a separate Node process with limited permissions. Node cannot guarantee containment of malicious code: review its code and network destinations before installing it.',
688
846
  remedy: 'Install it only if you trust where it came from. A module you wrote can also be updated from where you publish it: declare updates: { url } in the file, or install it from a file and MADRE remembers which, and its page in Modules carries Get a newer file.',
689
847
  fixes: same(['# Modules → + Add a module', 'ls ~/.pulse/modules # every module you installed, and where it came from', '# docs/SDK.md is the whole contract, and docs/sdk/hello-module.mjs is one that works']),
690
848
  },
@@ -729,7 +887,7 @@ export const CONDITIONS = [
729
887
  title: 'What leaves this computer, and how to stop each thing that does',
730
888
  match: /what left this machine|outbound|leaves? (this )?(computer|machine)|sends? (my )?(code|data)|telemetry|phone home|privacy/i,
731
889
  diagnosis: 'MADRE runs here and keeps what it knows in a file you own, and the list that qualifies that sentence is inside the core, under OUTBOUND. Seven addresses, each saying what it carries and where it is switched off: the briefing, which goes to whoever runs the agent you sent the turn to; Gemini embeddings, which carry the text of your memories; the image model, which carries the prompt an agent wrote; the npm registry and GitHub, which get a package name and nothing else; the error collector, which gets a redacted condition and only with your press; and Anthropic, for how much of your Claude plan is left. Ollama is on the list to be seen staying here.',
732
- remedy: 'Under the list is the log itself: every request this process made, MADRE\'s own and any a module made, because a module runs inside MADRE and cannot opt out of the wrapper. No body, no header and no query value is ever written there — only which parameters were set. An address nothing declares is reported as exactly that.',
890
+ remedy: 'Under the list is the fetch log for MADRE and its modules, including a module\'s separate process and its one-file MCP server. It does not include network calls made through other Node protocols or by an agent CLI. No body, header or query value is written there — only which parameters were set. An address nothing declares is reported as exactly that.',
733
891
  fixes: same([
734
892
  '# Memory map → click What is sent → OUTBOUND',
735
893
  'cat ~/.pulse/rooms/*/outbound.jsonl | tail -20 # the same log, on disk',
@@ -774,12 +932,31 @@ export const CONDITIONS = [
774
932
  remedy: 'Write 127.0.0.1 in the tunnel instead of localhost, and open http://127.0.0.1 with the same port in your browser.',
775
933
  fixes: same(['# 127.0.0.1, not localhost, on both sides of the tunnel:', 'ssh -L 5317:127.0.0.1:5317 user@server']),
776
934
  },
935
+ {
936
+ // Seen in the diagnostics of 1.1.1 (D-3, two copies in WSL, 2026-11-01): Ollama could not find
937
+ // registry.ollama.ai, «lookup … on 10.255.255.254:53: i/o timeout». It read as a download that
938
+ // took too long, and the card said to try again.
939
+ id: 'name-lookup',
940
+ code: 'MU-082',
941
+ severity: 'blocking',
942
+ title: 'This computer cannot find internet addresses',
943
+ match: /\blookup \S+ on \S+:53\b|no such host|server misbehaving|Temporary failure in name resolution/i,
944
+ diagnosis: 'Before downloading, a program asks for the address behind a name such as registry.ollama.ai (DNS), and nobody answered. The browser may still work while this Linux cannot ask: in WSL, the address it asks (10.255.255.254) is Windows passing the question on, and it stops answering with a VPN, after the computer sleeps or when the network changes.',
945
+ remedy: 'In WSL, close it from Windows and open it again; with a VPN on, try without it. On Linux, check the network connection. Then try again from the same place.',
946
+ fixes: {
947
+ darwin: ['# whether this Mac finds the name:', 'dscacheutil -q host -a name registry.ollama.ai'],
948
+ linux: ['# whether this Linux finds the name (no answer: it finds none):', 'getent hosts registry.ollama.ai', '# which server it asks:', 'resolvectl status'],
949
+ wsl: ['# in Windows PowerShell, then open Ubuntu again:', 'wsl --shutdown', '# back in Ubuntu, whether the name is found now:', 'getent hosts registry.ollama.ai'],
950
+ },
951
+ },
777
952
  {
778
953
  id: 'install-offline',
779
954
  code: 'MU-064',
780
955
  severity: 'transient',
781
956
  title: 'An install could not download',
782
- match: /ENOTFOUND|EAI_AGAIN|getaddrinfo|ECONNRESET|network (?:is )?unreachable|unable to get local issuer certificate|self[- ]signed certificate in certificate chain|request to https?:\/\/registry\.npmjs\.org\S* failed/i,
957
+ // And Ollama's, in Go's words (D-20, a copy in WSL): the connection to the models' server did
958
+ // not finish, which read as a download that took too long.
959
+ match: /ENOTFOUND|EAI_AGAIN|getaddrinfo|ECONNRESET|network (?:is )?unreachable|unable to get local issuer certificate|self[- ]signed certificate in certificate chain|request to https?:\/\/registry\.npmjs\.org\S* failed|TLS handshake timeout|connection reset by peer|no route to host/i,
783
960
  diagnosis: 'Installing an agent or a model downloads it from the internet: agents from npm, models from Ollama. The download did not get through: there is no connection, the server\'s name could not be found, or something on this network (a VPN, a proxy, a company firewall) stopped it. Nothing was left half installed.',
784
961
  remedy: 'Check that this computer has internet and try again. On a company network or a VPN, try from another one, or ask whoever runs it to allow registry.npmjs.org and ollama.com.',
785
962
  fixes: same(['npm ping', 'curl -I https://registry.npmjs.org', '# behind a proxy, npm has to be told:', 'npm config set proxy http://proxy:port']),
@@ -812,20 +989,36 @@ export const CONDITIONS = [
812
989
  code: 'MU-067',
813
990
  severity: 'blocking',
814
991
  title: 'Ollama does not start',
815
- match: /Ollama did not answer|listen tcp 127\.0\.0\.1:11434: bind|address already in use[^\n]*11434|could not connect to ollama/i,
816
- diagnosis: 'Ollama is installed but nothing answers on its port (11434). Usually it is closed (on a Mac, the app is not open), another copy of Ollama already holds the port, or on Linux its service did not start.',
992
+ // «@madre left the project: Ollama is not running» too (D-12, a copy in WSL wrote to @madre five
993
+ // times in nine minutes): only the card on @madre matched it, which explains the agent and is
994
+ // filed as unknown, not how to start Ollama.
995
+ match: /Ollama did not answer|Ollama is not running|Ollama no está (?:corriendo|encendido)|listen tcp 127\.0\.0\.1:11434: bind|address already in use[^\n]*11434|could not connect to ollama/i,
996
+ diagnosis: 'Nothing answers on Ollama\'s port (11434). Usually it is closed (on a Mac, the app is not open), another copy of Ollama already holds the port, on Linux its service did not start, or it is not installed yet.',
817
997
  remedy: 'On a Mac, open the Ollama app. On Linux, start its service. Then press «I did it», or Check again in Settings › Local AI.',
818
998
  fixes: {
819
999
  darwin: ['open -a Ollama', 'curl http://127.0.0.1:11434/api/version'],
820
1000
  linux: ['sudo systemctl start ollama', 'systemctl status ollama --no-pager', '# without systemd (WSL without it, a container):', 'ollama serve', 'curl http://127.0.0.1:11434/api/version'],
821
1001
  },
822
1002
  },
1003
+ {
1004
+ // Seen in the diagnostics of 1.1.2 (2026-11-03), in WSL: an install of Ollama cut by the time
1005
+ // limit or the network left the program without what runs the models.
1006
+ id: 'ollama-halfway',
1007
+ code: 'MU-076',
1008
+ agent: 'madre',
1009
+ severity: 'blocking',
1010
+ title: 'Ollama was left installed halfway',
1011
+ match: /llama-server binary not found/i,
1012
+ diagnosis: 'Ollama\'s install stopped before it finished, usually because the download (more than a GB) was cut by the network or ran out of time. The program is there but the part that runs the models is not, so every answer of @madre fails.',
1013
+ remedy: 'Install Ollama again from Settings › Local AI: it downloads it whole and finishes it. Your models stay where they are.',
1014
+ fixes: { darwin: ['# Home → Settings → Local AI → Install'], linux: ['# Home → Settings → Local AI → Install', '# or in a terminal:', 'curl -fsSL https://ollama.com/install.sh | sh'] },
1015
+ },
823
1016
  {
824
1017
  id: 'model-download',
825
1018
  code: 'MU-068',
826
1019
  severity: 'transient',
827
1020
  title: 'A model download stopped',
828
- match: /Ollama pull HTTP|pull model manifest|max retries exceeded/i,
1021
+ match: /Ollama pull HTTP|pull model manifest|max retries exceeded|^(?:TypeError: )?terminated$|Ollama closed the connection|Ollama cerró la conexión|other side closed/im,
829
1022
  diagnosis: 'Models are big (from half a GB to dozens) and come down in pieces. A cut connection or a full disk stops the download; what already arrived stays, and trying again picks up where it stopped.',
830
1023
  remedy: 'Try again from the same place. If it stops at the same point, check the free space (the model needs its size plus some room) or choose a smaller model.',
831
1024
  fixes: same(['ollama pull qwen2.5:3b # the model you chose; it resumes where it stopped', 'ollama list', 'df -h ~']),
@@ -915,7 +1108,7 @@ export const allConditions = () => CONDITIONS.map(said);
915
1108
 
916
1109
  // Lowercase and without accents: «limite» finds «límite», and a person types what they type.
917
1110
  const fold = (text) => String(text ?? '').normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase();
918
- const AGENT_WORDS = new Set(['codex', 'claude', 'gemini', 'opencode', 'cursor', 'madre', 'ollama']);
1111
+ const AGENT_WORDS = new Set(['codex', 'claude', 'gemini', 'opencode', 'cursor', 'grok', 'madre', 'ollama']);
919
1112
  const named = (words) => words.find((word) => AGENT_WORDS.has(word.replace(/^@/, '')))?.replace(/^@/, '') ?? null;
920
1113
  const wordsOf = (query) => fold(query).split(/[^a-z0-9#.@_-]+/).filter(Boolean);
921
1114
 
@@ -941,7 +1134,7 @@ const SYMPTOMS = [
941
1134
  /\b(?:sign(?:ed)?|log(?:ged)?)[ -]?(?:in|out)\b|\blog[ -]?in\b|\bauthenticat|\bcredential|\bpassword|\bre-?auth/,
942
1135
  /\b(?:inici\w*|cerr\w*|abr\w*|pide\w*)(?: la| una| mi| de)? sesion|\bsesion (?:cerrada|expirada|vencida)|\bsin sesion|\bautentic|\bcredencial|\bcontrasena|\bme pide (?:entrar|la cuenta|mi cuenta)/,
943
1136
  ],
944
- cards: ['not-signed-in', 'gemini-ineligible-tier', 'opencode-default-provider', 'custom-agent-endpoint'],
1137
+ cards: ['not-signed-in', 'grok-account-refused', 'gemini-ineligible-tier', 'opencode-default-provider', 'custom-agent-endpoint'],
945
1138
  },
946
1139
  {
947
1140
  id: 'no-credit',
@@ -975,7 +1168,7 @@ const SYMPTOMS = [
975
1168
  /\b(?:doesn'?t|does not|isn'?t|is not|not|won'?t|stopped) work\w*|\bbroken\b|\bfail(?:s|ed|ing)?\b/,
976
1169
  /\bno (?:funciona|jala|sirve|anda|arranca|abre)\b|\bfall(?:a|o|ando)\b|\bdej\w* de funcionar|\besta roto\b/,
977
1170
  ],
978
- cards: ['not-signed-in', 'not-installed', 'timeout', 'provider-credit-exhausted', 'gemini-rate-limited', 'gemini-ineligible-tier', 'cursor-usage-limit', 'opencode-default-provider', 'madre-agent', 'ollama', 'adapter-pending'],
1171
+ cards: ['not-signed-in', 'not-installed', 'timeout', 'provider-credit-exhausted', 'gemini-rate-limited', 'gemini-ineligible-tier', 'cursor-usage-limit', 'grok-account-refused', 'opencode-default-provider', 'madre-agent', 'ollama', 'adapter-pending'],
979
1172
  },
980
1173
  ];
981
1174
 
@@ -1055,7 +1248,7 @@ export const WINDOWS_FIRST = ['# On Windows, MADRE runs inside WSL2, Linux insid
1055
1248
  export function fixesFor(condition, platform, agent = null) {
1056
1249
  const base = columnFor(condition.fixes, platform) ?? [];
1057
1250
  const perAgent = condition.perAgent?.[agent] ? columnFor(condition.perAgent[agent], platform) : null;
1058
- const lines = perAgent ? [...perAgent, ...(base.length && !base[0].startsWith('#') ? base : [])] : base;
1251
+ const lines = perAgent ? [...perAgent, ...(condition.perAgentReplacesFixes || !base.length || base[0].startsWith('#') ? [] : base)] : base;
1059
1252
  const ownWindows = condition.fixes?.win32 || condition.perAgent?.[agent]?.win32;
1060
1253
  return platform === 'win32' && !ownWindows && lines.length ? [...WINDOWS_FIRST, ...lines] : lines;
1061
1254
  }