answer_blinded_preview,brain,cache_creation,cache_read,category,checks_lesson_table,duration_api_ms,duration_ms,error,expected_file,expected_keyword,expected_lesson_id,id,input_tokens,judge_disagreement,judge_errors,judge_grades,mode,num_turns,output_tokens,prompt,repo_path,result,rubric_note,score,should_reuse,total_cost_usd,wall_s The MCP calls need your permission to query AI-Bran's lesson log. Could you approve `[tool]` and `[tool]` so I can pull the actual recorded FTS5 pitfalls instead of guessing? Once approved I'll re-run,curated,20314,83665,apply_lesson,,35788.0,34744.0,,core/code_indexer/indexer.py,tree-sitter,77b13dd3-0592-48f0-b991-7b618fac1863,T-AL4,19,False,0,"[0, 0]",baseline,6,1392,I'm extending the indexer to add support for Go source files. What pitfalls should I watch out for based on what Cosmos has already learned about its FTS5 layer?,/Users/kabir/Works/py/AI-Bran,The MCP calls need your permission to query AI-Bran's lesson log. Could you approve `mcp__cosmos__code_list_errors` and `mcp__cosmos__find_relevant_code` so I can pull the actual recorded FTS5 pitfalls instead of guessing? Once approved I'll re-run them and answer based on what's in the lesson log.,"AI must recall THREE coverage gaps the lesson encodes (file-level entries, function-body recursion, language-specific tokenization) and apply to Go. Tests cross-file lesson application.",0.0,False,0.204152,37.57 I need permission to query the AI-Bran/[brain] tools to pull past FTS5 lessons before I can give you a grounded answer. Could you approve `[tool]` and `[tool]` so I can look up what's already been rec,curated,12220,91622,apply_lesson,,24663.0,23433.0,,core/code_indexer/indexer.py,tree-sitter,77b13dd3-0592-48f0-b991-7b618fac1863,T-AL4,19,False,0,"[0, 0]",mcp_only,6,1306,I'm extending the indexer to add support for Go source files. What pitfalls should I watch out for based on what Cosmos has already learned about its FTS5 layer?,/Users/kabir/Works/py/AI-Bran,"I need permission to query the AI-Bran/Cosmos MCP tools to pull past FTS5 lessons before I can give you a grounded answer. Could you approve `mcp__cosmos__code_list_errors` and `mcp__cosmos__find_relevant_code` so I can look up what's already been recorded? Without those, I'd be guessing at FTS5 pitfalls from general knowledge rather than what Cosmos has actually burned time on — which defeats the point of asking. Once approved, I'll pull the relevant lessons (likely covering tokenizer choice, trigger ordering, content-table sync, special-char escaping, etc.) and tell you which apply to a Go-source extension.","AI must recall THREE coverage gaps the lesson encodes (file-level entries, function-body recursion, language-specific tokenization) and apply to Go. Tests cross-file lesson application.",0.0,False,0.155388,25.0 "I need permission to query Cosmos. Could you approve `[tool]` and `[tool]` so I can pull the past FTS5 lessons for this project? Without those, I'd just be guessing at general SQLite FTS5 gotchas rath",curated,18985,58946,apply_lesson,,16634.0,15312.0,,core/code_indexer/indexer.py,tree-sitter,77b13dd3-0592-48f0-b991-7b618fac1863,T-AL4,13,False,0,"[0, 0]",mcp_plus_rules,4,830,I'm extending the indexer to add support for Go source files. What pitfalls should I watch out for based on what Cosmos has already learned about its FTS5 layer?,/Users/kabir/Works/py/AI-Bran,"I need permission to query Cosmos. Could you approve `mcp__cosmos__find_relevant_code` and `mcp__cosmos__code_list_errors` so I can pull the past FTS5 lessons for this project? Without those, I'd just be guessing at general SQLite FTS5 gotchas rather than answering from what Cosmos has actually learned here. If you'd rather I proceed without Cosmos, say the word and I'll fall back to reading the indexer source directly — but the whole point of your question is the prior lessons, so the MCP lookup is the right tool.","AI must recall THREE coverage gaps the lesson encodes (file-level entries, function-body recursion, language-specific tokenization) and apply to Go. Tests cross-file lesson application.",0.0,False,0.16972925,16.83 "I don't have access to your AI-Bran brain/lessons store right now (permission to call its MCP tools wasn't granted), and your local memory directory for this project is empty — so I have no record of ",curated,17743,107927,past_lesson,True,21828.0,20588.0,,,,,D3,15,False,0,"[0, 0]",baseline,5,843,"Have we hit a JWT plain-JSON collision before, and how was it resolved?",/Users/kabir/Works/py/AI-Bran,"I don't have access to your AI-Bran brain/lessons store right now (permission to call its MCP tools wasn't granted), and your local memory directory for this project is empty — so I have no record of a prior ""JWT plain-JSON collision"" incident to recall. If you want me to check, approve `mcp__cosmos__brain_search` / `mcp__cosmos__find_relevant_code` and I'll search past lessons. Otherwise, if you can point me at the repo or paste the symptom, I can dig in directly.",Replaces the Python sidecar port prompt — JWT collision has a recorded lesson. Adjust to another recorded entry if this one rotates.,0.0,,0.18643225000000002,22.14 "Yes — this exact concern is already addressed in the codebase, in `core/billing/license.py`. **The collision risk**: A license file can be either a signed JWT (production) or a plain JSON object (dev",curated,17294,175476,past_lesson,True,42947.0,41330.0,,,,,D3,17,False,0,"[4, 4]",mcp_only,11,2360,"Have we hit a JWT plain-JSON collision before, and how was it resolved?",/Users/kabir/Works/py/AI-Bran,"Yes — this exact concern is already addressed in the codebase, in `core/billing/license.py`. **The collision risk**: A license file can be either a signed JWT (production) or a plain JSON object (dev). A naive ""3-part dot split"" detector misclassifies plain JSON because emails and ISO timestamps contain dots. **How it's resolved** (`core/billing/license.py:66-80`, `_looks_like_jwt`): 1. Reject anything starting with `{` or `[` up front — that's JSON, not a JWT. 2. Require exactly 3 non-empty dot-separated parts. 3. Require the first segment to start with `eyJ` (base64url of `{""alg`...) — JWT headers always do, plain JSON never will. **Defense in depth** (`parse_license_text`, lines 156-179): - If a public key is configured → file *must* be a JWT; plain JSON is rejected with `LicenseError` to prevent forgery in production. - If no public key → plain JSON is accepted for dev convenience; JWT without a key raises `MissingPublicKey` rather than silently trusting an unverified token. So the answer is: yes, the collision was anticipated and handled by combining a structural sniff (`eyJ` prefix + leading-brace rejection) with a policy gate (presence of a pubkey forces JWT-only).",Replaces the Python sidecar port prompt — JWT collision has a recorded lesson. Adjust to another recorded entry if this one rotates.,4.0,,0.25533550000000005,42.75 "Cosmos lesson lookup is **denied** (no permission) for `[tool]`, `[tool]`, and `[tool]`, so I can't confirm whether a past lesson was logged. But the collision itself **is already encoded in the live ",curated,27887,259283,past_lesson,True,57164.0,56216.0,,,,,D3,20,False,0,"[3, 3]",mcp_plus_rules,14,3347,"Have we hit a JWT plain-JSON collision before, and how was it resolved?",/Users/kabir/Works/py/AI-Bran,"Cosmos lesson lookup is **denied** (no permission) for `find_relevant_code`, `brain_search`, and `code_list_errors`, so I can't confirm whether a past lesson was logged. But the collision itself **is already encoded in the live code** at `core/billing/license.py:66-80` — meaning the ambiguity has been encountered and resolved in this repo: **The collision** — `parse_license_text()` accepts both formats (signed JWT for prod, plain JSON for dev). A naïve `text.count(""."") == 2` check breaks because plain JSON containing emails or ISO timestamps (e.g. `""trial_expires_at"": ""2026-06-01T...""`) also has 3 dot-separated parts. **The fix** — `_looks_like_jwt()` at `core/billing/license.py:66`: 1. If `text.strip()` starts with `{` or `[` → it's JSON, not a JWT (`license.py:75`). 2. Must split into exactly 3 non-empty parts on `.` (`license.py:77-79`). 3. First segment must start with `eyJ` — base64url of `{""alg"":...` always does, and JSON values can't begin that way (`license.py:80`). There's also a **policy half** of the resolution at `license.py:168-181`: if a public key is configured, plain JSON is rejected outright (production must be signed); plain JSON is only honored in dev when no key is loaded. That closes the downgrade attack the format ambiguity would otherwise enable. If you want the lesson recorded in Cosmos, I'd need permission for `code_remember_error` — say the word and I'll log it.",Replaces the Python sidecar port prompt — JWT collision has a recorded lesson. Adjust to another recorded entry if this one rotates.,3.0,,0.3884732499999999,57.59 "I need permission to query AI-Bran's lesson log — could you approve those tool calls (or run them yourself)? They're the only way I can answer ""has this been seen here before"" without re-deriving from",curated,19786,83313,past_lesson,,36721.0,32475.0,,src/index.css,tailwindcss,25ef5d4a-925c-4871-9d23-ff044bc41f1d,T-PL6,19,False,0,"[0, 0]",baseline,6,1085,After running `pnpm tauri dev` I'm staring at a blank white window. Vite is using ~900% CPU according to Activity Monitor and curl on the dev server times out. Has this been seen here before?,/Users/kabir/Works/py/AI-Bran,"I need permission to query AI-Bran's lesson log — could you approve those tool calls (or run them yourself)? They're the only way I can answer ""has this been seen here before"" without re-deriving from scratch. If you'd rather I troubleshoot directly, the usual suspects for a Tauri+Vite blank window with runaway CPU are: - A glob in `vite.config` watching `src-tauri/target/**` so Vite re-scans the Rust build dir endlessly - An import cycle or `fs.watch` recursion pulling in `node_modules`/`dist` - A symlink loop in the project root But I'd rather check the lessons first before guessing — want to grant the AI-Bran permissions?","Targets non-curated lesson — measures base recall (no pin/scope_glob bias). Critical fairness check: if past_lesson tasks only target curated lessons, the result confounds engine-recall with pin-scoped boost.",0.0,True,0.19301600000000002,34.04 I need permission to query AI-Bran for past lessons before I can answer whether this has been seen here. Could you approve those calls (or give me the go-ahead to retry)? I'm specifically looking up p,curated,11912,91402,past_lesson,,21190.0,20086.0,,src/index.css,tailwindcss,25ef5d4a-925c-4871-9d23-ff044bc41f1d,T-PL6,19,False,0,"[0, 0]",mcp_only,6,1011,After running `pnpm tauri dev` I'm staring at a blank white window. Vite is using ~900% CPU according to Activity Monitor and curl on the dev server times out. Has this been seen here before?,/Users/kabir/Works/py/AI-Bran,I need permission to query AI-Bran for past lessons before I can answer whether this has been seen here. Could you approve those calls (or give me the go-ahead to retry)? I'm specifically looking up past Tauri/Vite errors for this project so I don't re-derive a fix you've already burned time on.,"Targets non-curated lesson — measures base recall (no pin/scope_glob bias). Critical fairness check: if past_lesson tasks only target curated lessons, the result confounds engine-recall with pin-scoped boost.",0.0,True,0.146003,21.45 I need permission to query Cosmos for past lessons on this project — please approve the `[tool]` and `[tool]` calls. Those will tell me if this exact symptom (blank Tauri window + runaway Vite CPU + d,curated,18404,58357,past_lesson,,15050.0,13898.0,,src/index.css,tailwindcss,25ef5d4a-925c-4871-9d23-ff044bc41f1d,T-PL6,13,False,0,"[0, 0]",mcp_plus_rules,4,736,After running `pnpm tauri dev` I'm staring at a blank white window. Vite is using ~900% CPU according to Activity Monitor and curl on the dev server times out. Has this been seen here before?,/Users/kabir/Works/py/AI-Bran,"I need permission to query Cosmos for past lessons on this project — please approve the `mcp__cosmos__find_relevant_code` and `mcp__cosmos__code_list_errors` calls. Those will tell me if this exact symptom (blank Tauri window + runaway Vite CPU + dead dev server) has been hit and fixed here before, so I can apply the known fix instead of re-deriving it.","Targets non-curated lesson — measures base recall (no pin/scope_glob bias). Critical fairness check: if past_lesson tasks only target curated lessons, the result confounds engine-recall with pin-scoped boost.",0.0,True,0.1634935,15.52 "I tried to query AI-Bran's lesson log and brain memory but the MCP calls weren't approved, so I can't actually tell you whether Cosmos has logged this one specifically — approve `[tool]` / `[tool]` an",curated,17483,57868,past_lesson,,28211.0,26743.0,,src-tauri/tauri.conf.json,dragDropEnabled,c3a0c110-b8c1-49ac-a78e-f94b6f260a23,T-PL8,13,False,0,"[3, 3]",baseline,4,1386,"Drag-and-drop of a memory card from one folder to another silently fails inside our Tauri app — no error, the drop just doesn't trigger. Has Cosmos run into a Tauri config gotcha here before?",/Users/kabir/Works/py/AI-Bran,"I tried to query AI-Bran's lesson log and brain memory but the MCP calls weren't approved, so I can't actually tell you whether Cosmos has logged this one specifically — approve `mcp__cosmos__find_relevant_code` / `mcp__cosmos__brain_search` and I'll check. That said, the classic Tauri gotcha that matches your symptom exactly: **Tauri intercepts drag-and-drop at the OS level by default**, and the webview never sees the HTML5 `dragover`/`drop` events. Internal drags inside your React/Svelte/etc UI silently no-op because the native handler is swallowing them. Fix is a one-liner in the window config: - **Tauri v2**: `tauri.conf.json` → `app.windows[].dragDropEnabled: false` - **Tauri v1**: `tauri.conf.json` → `tauri.windows[].fileDropEnabled: false` Once that's off, your in-webview drag handlers fire normally. The tradeoff is you lose the built-in `tauri://file-drop` event for OS files dragged *into* the window — if you need both (external file drop *and* in-app drag), you have to reimplement external file drop manually via the webview's `drop` event. Want me to retry the AI-Bran lookup once permissions are granted to confirm whether your project has a prior lesson recorded?",Second non-curated past_lesson reference for variance control. Tauri config gotcha that public docs bury.,3.0,True,0.17341575,28.32 "I need permission to query AI-Bran. Could you allow `[tool]` and `[tool]` so I can check whether Cosmos has a recorded lesson on this? In the meantime, the most common Tauri gotcha that matches your ",curated,9460,65961,past_lesson,,18489.0,17429.0,,src-tauri/tauri.conf.json,dragDropEnabled,c3a0c110-b8c1-49ac-a78e-f94b6f260a23,T-PL8,13,False,0,"[4, 4]",mcp_only,4,895,"Drag-and-drop of a memory card from one folder to another silently fails inside our Tauri app — no error, the drop just doesn't trigger. Has Cosmos run into a Tauri config gotcha here before?",/Users/kabir/Works/py/AI-Bran,"I need permission to query AI-Bran. Could you allow `mcp__cosmos__find_relevant_code` and `mcp__cosmos__brain_search` so I can check whether Cosmos has a recorded lesson on this? In the meantime, the most common Tauri gotcha that matches your symptoms (silent drop, no error, web-side `drop`/`dragover` listeners never fire) is that Tauri's webview intercepts OS-level file drops by default, which also swallows DOM drag events. In `tauri.conf.json` under `app.windows[]`, set `""dragDropEnabled"": false` (Tauri v2) or `""fileDropEnabled"": false` (v1) so the HTML5 DnD events reach your React/JS layer. After flipping it, fully restart the app — HMR doesn't pick up window config changes. Want me to retry the brain lookup once permissions are granted, and then check your `tauri.conf.json` directly?",Second non-curated past_lesson reference for variance control. Tauri config gotcha that public docs bury.,4.0,True,0.1150285,18.81 "I need permission to query Cosmos to check for past lessons on this. Could you approve those tool calls? Specifically I'm running: 1. `[tool]` with your symptom verbatim, scoped to this project — thi",curated,18458,58316,past_lesson,,23099.0,21966.0,,src-tauri/tauri.conf.json,dragDropEnabled,c3a0c110-b8c1-49ac-a78e-f94b6f260a23,T-PL8,13,False,0,"[3, 3]",mcp_plus_rules,4,931,"Drag-and-drop of a memory card from one folder to another silently fails inside our Tauri app — no error, the drop just doesn't trigger. Has Cosmos run into a Tauri config gotcha here before?",/Users/kabir/Works/py/AI-Bran,"I need permission to query Cosmos to check for past lessons on this. Could you approve those tool calls? Specifically I'm running: 1. `find_relevant_code` with your symptom verbatim, scoped to this project — this is the tool that surfaces past debug lessons. 2. `code_list_errors` with `cross_project=true` — Tauri drag-drop quirks tend to repeat across projects, so a cross-project sweep is worth it here. Once those go through I can tell you whether Cosmos has seen this exact gotcha (the usual suspect is Tauri's native file-drop handler intercepting webview drag events — toggled via `tauri.conf.json` → `app.windows[].dragDropEnabled: false` on v2, or `fileDropEnabled: false` on v1 — but I'd rather confirm against recorded lessons than guess).",Second non-curated past_lesson reference for variance control. Tauri config gotcha that public docs bury.,3.0,True,0.16868650000000002,23.38 I'd like to query AI-Bran for past lessons about this — that's where prior dev-server startup gotchas would be recorded. Could you approve the `[tool]` and `[tool]` permissions so I can check before r,curated,17529,57913,apply_lesson,,31917.0,30847.0,,vite.config.ts,optimizeDeps,4cd762e0-a76d-42c8-904e-60f71eead859,T-AL3,13,False,0,"[3, 3]",baseline,4,1170,"The team wants to ship a Pro upgrade flow that uses `@stripe/stripe-js`. Before I install it, what should I check or set up in this project to avoid a class of dev-server startup error we've hit before with similar packages?",/Users/kabir/Works/py/AI-Bran,"I'd like to query AI-Bran for past lessons about this — that's where prior dev-server startup gotchas would be recorded. Could you approve the `mcp__cosmos__find_relevant_code` and `mcp__cosmos__brain_search` permissions so I can check before recommending anything? In the meantime, here's the rough shape of what I'd want to verify before installing `@stripe/stripe-js`: - **Package manager + lockfile**: confirm which one this repo uses (npm/pnpm/yarn/bun) and that the lockfile is clean — mixed managers often surface as cryptic dev-server crashes after install. - **Node version**: check `.nvmrc` / `engines` against `@stripe/stripe-js`'s requirement. - **Bundler config**: `@stripe/stripe-js` lazy-loads `js.stripe.com` at runtime and exports ESM. If the project uses Vite/Next/webpack with strict CSP, SSR, or `optimizeDeps`/`transpilePackages` allowlists, those usually need an entry. SSR is the common bite — calling `loadStripe()` at module top-level breaks because `window` is undefined. - **Existing Stripe deps**: grep for any prior `stripe` / `@stripe/*` install to avoid version skew. - **Env vars**: a `VITE_` / `NEXT_PUBLIC_` publishable key needs to exist before the dev server boots, or the Stripe init throws on first render. Want me to retry once the MCP permissions are granted, or should I just inspect the repo directly (package.json, bundler config, framework)?",Forward-looking — no symptom yet. AI must proactively recall the vite barrel pattern lesson and propose preventive action. Tests code_list_errors recall + APPLICATION rather than reference.,3.0,False,0.16830275,32.44 "I tried to pull past lessons from AI-Bran (the natural place to find ""errors we've hit before""), but the MCP calls need permission. Can you approve `[tool]` and `[tool]` so I can check for prior lesso",curated,11606,91195,apply_lesson,,24606.0,23571.0,,vite.config.ts,optimizeDeps,4cd762e0-a76d-42c8-904e-60f71eead859,T-AL3,19,False,0,"[0, 0]",mcp_only,6,1233,"The team wants to ship a Pro upgrade flow that uses `@stripe/stripe-js`. Before I install it, what should I check or set up in this project to avoid a class of dev-server startup error we've hit before with similar packages?",/Users/kabir/Works/py/AI-Bran,"I tried to pull past lessons from AI-Bran (the natural place to find ""errors we've hit before""), but the MCP calls need permission. Can you approve `mcp__cosmos__code_list_errors` and `mcp__cosmos__find_relevant_code` so I can check for prior lessons on this exact class of failure before advising? Otherwise I'd be guessing rather than retrieving what your past sessions actually recorded.",Forward-looking — no symptom yet. AI must proactively recall the vite barrel pattern lesson and propose preventive action. Tests code_list_errors recall + APPLICATION rather than reference.,0.0,False,0.14954,24.96 "Found the relevant config. `vite.config.ts:18` sets `optimizeDeps.noDiscovery: true` — automatic dependency discovery is turned off because `@phosphor-icons/react` (6.6MB, 40k+ exports) hung the dev s",curated,23678,140686,apply_lesson,,47081.0,45806.0,,vite.config.ts,optimizeDeps,4cd762e0-a76d-42c8-904e-60f71eead859,T-AL3,16,False,0,"[4, 4]",mcp_plus_rules,9,2527,"The team wants to ship a Pro upgrade flow that uses `@stripe/stripe-js`. Before I install it, what should I check or set up in this project to avoid a class of dev-server startup error we've hit before with similar packages?",/Users/kabir/Works/py/AI-Bran,"Found the relevant config. `vite.config.ts:18` sets `optimizeDeps.noDiscovery: true` — automatic dependency discovery is turned off because `@phosphor-icons/react` (6.6MB, 40k+ exports) hung the dev server. The tradeoff: Vite no longer auto-discovers new deps, so any new import has to be listed explicitly in `optimizeDeps.include`, otherwise you get on-the-fly prebundling that triggers full reloads or 504s. Before `pnpm add @stripe/stripe-js`, add it to the `include` array in `vite.config.ts:19-44`: ```ts include: [ // ...existing entries '@stripe/stripe-js', ], ``` Quick checks worth doing too: - **Don't put it in `exclude`** — that list is reserved for the heavy-export libs that broke discovery in the first place; Stripe's bundle is small. - **Restart the dev server with a clean cache** after installing: `rm -rf node_modules/.vite && pnpm dev`. Stale prebundle caches are the other common source of ""works for everyone except me"" startup errors here. - **Tauri side**: `@stripe/stripe-js` only loads Stripe.js from `js.stripe.com`, so confirm Tauri's CSP (in `src-tauri/tauri.conf.json`) allows `script-src` and `frame-src` for `https://js.stripe.com` and `https://*.stripe.com` before you wire up Elements, or the iframe will silently fail to mount. Want me to make the `vite.config.ts` edit now, or check the Tauri CSP first?",Forward-looking — no symptom yet. AI must proactively recall the vite barrel pattern lesson and propose preventive action. Tests code_list_errors recall + APPLICATION rather than reference.,4.0,False,0.2823835,47.8 "The edit needs your approval to write `src-tauri/src/integrations/mod.rs`. Could you grant write permission so I can apply the change? The change adds: - `detect_goose()` mirroring `detect_windsurf()",curated,21665,337560,apply_lesson,,80004.0,79463.0,,,,,E2,17,False,0,"[4, 4]",baseline,12,5457,Wire up a new MCP target for Goose. Don't re-derive the JSON patcher — use the existing helpers from integrations/mod.rs.,/Users/kabir/Works/py/AI-Bran,"The edit needs your approval to write `src-tauri/src/integrations/mod.rs`. Could you grant write permission so I can apply the change? The change adds: - `detect_goose()` mirroring `detect_windsurf()` — config at `~/.config/goose/mcp.json`, reuses `json_has_aibran_mcp` and `json_has_legacy_aibran_entry`, `supports_skills: false`. - `""goose"" => Some(detect_goose())` in `detect_by_id` — this routes `install_mcp` / `uninstall_mcp` / `migrate_legacy_mcp` through the existing `read_json_or_empty` + `write_json_atomic` path with no new code. - `detect_goose()` appended to the `detect_claude_apps` vec so the UI lists it.",,4.0,"[""read_json_or_empty"", ""write_json_atomic"", ""detect_by_id""]",0.4411582500000001,82.32 "Edit was denied. Here's the change I'd make to `src-tauri/src/integrations/mod.rs` — a new `detect_goose()` modeled on `detect_cursor()`/`detect_windsurf()`, plus two-line additions to `detect_by_id` ",curated,14015,346180,apply_lesson,,94269.0,86695.0,,,,,E2,17,False,0,"[4, 4]",mcp_only,12,6439,Wire up a new MCP target for Goose. Don't re-derive the JSON patcher — use the existing helpers from integrations/mod.rs.,/Users/kabir/Works/py/AI-Bran,"Edit was denied. Here's the change I'd make to `src-tauri/src/integrations/mod.rs` — a new `detect_goose()` modeled on `detect_cursor()`/`detect_windsurf()`, plus two-line additions to `detect_by_id` and `detect_claude_apps`. No new helpers; install/uninstall/migrate flow through the existing `detect_by_id` switch and reuse `read_json_or_empty` + `write_json_atomic` automatically. Insert before `detect_by_id` (after `detect_windsurf` at line 214): ```rust fn detect_goose() -> AppStatus { // Goose (Block) uses ~/.config/goose/ on every platform — same XDG-style // dot-dir convention regardless of OS. let home = home(); let (config_path, app_dir) = match &home { Some(h) => { let base = h.join("".config/goose""); let cfg = base.join(""mcp.json""); (cfg, Some(base)) } None => (PathBuf::new(), None), }; let installed = app_dir.as_ref().map(|p| p.exists()).unwrap_or(false); let mcp_connected = json_has_aibran_mcp(&config_path, ""mcpServers""); let needs_migration = json_has_legacy_aibran_entry(&config_path, ""mcpServers""); AppStatus { id: ""goose"".into(), name: ""Goose"".into(), installed, config_path: config_path.to_string_lossy().to_string(), mcp_connected, needs_migration, supports_skills: false, } } ``` Then add `""goose"" => Some(detect_goose()),` to the `detect_by_id` match (mod.rs:217) and `detect_goose(),` to the `detect_claude_apps` vec (mod.rs:230). Want me to retry the edit?",,4.0,"[""read_json_or_empty"", ""write_json_atomic"", ""detect_by_id""]",0.42220575,88.17 "The edit is blocked pending your approval. Please grant write permission for `src-tauri/src/integrations/mod.rs` (or copy the diff above manually). The change adds: - New `detect_goose()` function po",curated,32925,605444,apply_lesson,,129855.0,127697.0,,,,,E2,24,False,0,"[4, 4]",mcp_plus_rules,19,9111,Wire up a new MCP target for Goose. Don't re-derive the JSON patcher — use the existing helpers from integrations/mod.rs.,/Users/kabir/Works/py/AI-Bran,"The edit is blocked pending your approval. Please grant write permission for `src-tauri/src/integrations/mod.rs` (or copy the diff above manually). The change adds: - New `detect_goose()` function pointing at `~/.config/goose/mcp.json`, reusing the existing `home()`, `json_has_aibran_mcp()`, and `json_has_legacy_aibran_entry()` helpers — no new JSON patcher. - One new arm in `detect_by_id` (`""goose"" => Some(detect_goose())`) so `install_mcp` / `uninstall_mcp` / `migrate_legacy_mcp` work for it automatically. - `detect_goose()` appended to the `detect_claude_apps` list so the UI surfaces it. Frontend needs no changes — `ClaudeIntegrations.tsx` renders whatever the backend returns.",,4.0,"[""read_json_or_empty"", ""write_json_atomic"", ""detect_by_id""]",0.73718825,129.13 "The MCP queries need your approval. Want me to retry — `[tool]` checks past lessons/errors for this project, `[tool]` checks notes — both are read-only.",curated,17446,57854,past_lesson,,16541.0,15537.0,,src/components/GraphView/NeuralMap.tsx,useFrame,01933dc9-fdef-4b5d-a12f-1d78f13f7db0,T-PL5,13,False,0,"[0, 0]",baseline,4,638,QA reports the Neural Map view becomes sluggish after users click a node — sometimes it locks up the whole app for a few seconds before recovering. Has Cosmos investigated something in this area before?,/Users/kabir/Works/py/AI-Bran,"The MCP queries need your approval. Want me to retry — `find_relevant_code` checks past lessons/errors for this project, `brain_search` checks notes — both are read-only.",Phrased as QA report. Lesson body documents 3-cause root (Zustand selector misuse + per-frame allocs + duplicate OrbitControls). Mode C scope_glob src/components/GraphView/** should land it instantly.,0.0,True,0.1544535,17.13 I need permission to query AI-Bran. Could you approve `[tool]` and `[tool]` so I can check whether Cosmos has any prior lessons or notes on Neural Map node-click slowdowns? Once approved I'll re-run t,curated,9384,65906,past_lesson,,18243.0,17193.0,,src/components/GraphView/NeuralMap.tsx,useFrame,01933dc9-fdef-4b5d-a12f-1d78f13f7db0,T-PL5,13,False,0,"[0, 0]",mcp_only,4,616,QA reports the Neural Map view becomes sluggish after users click a node — sometimes it locks up the whole app for a few seconds before recovering. Has Cosmos investigated something in this area before?,/Users/kabir/Works/py/AI-Bran,I need permission to query AI-Bran. Could you approve `mcp__cosmos__find_relevant_code` and `mcp__cosmos__brain_search` so I can check whether Cosmos has any prior lessons or notes on Neural Map node-click slowdowns? Once approved I'll re-run the searches and report back.,Phrased as QA report. Lesson body documents 3-cause root (Zustand selector misuse + per-frame allocs + duplicate OrbitControls). Mode C scope_glob src/components/GraphView/** should land it instantly.,0.0,True,0.107547,18.52 "Yes — there are two prior Cosmos investigations that match the QA report almost exactly. Both are recorded in `.aibran/lessons.md`: **1. 2026-04-30 · ""click node on Neural Map first time freezes grap",curated,29861,167683,past_lesson,,58962.0,57285.0,,src/components/GraphView/NeuralMap.tsx,useFrame,01933dc9-fdef-4b5d-a12f-1d78f13f7db0,T-PL5,17,False,0,"[4, 4]",mcp_plus_rules,9,3372,QA reports the Neural Map view becomes sluggish after users click a node — sometimes it locks up the whole app for a few seconds before recovering. Has Cosmos investigated something in this area before?,/Users/kabir/Works/py/AI-Bran,"Yes — there are two prior Cosmos investigations that match the QA report almost exactly. Both are recorded in `.aibran/lessons.md`: **1. 2026-04-30 · ""click node on Neural Map first time freezes graph for 1-3s""** (Error ID `0236c9a4-8604-44df-9e36-76c9225bf8cf`, Severity 2) - **Cause:** `src/App.tsx` had a single outer `` wrapping all view tabs. Clicking a node mounted `DynamicEditor` (lazy), which suspended → suspension propagated upward → entire view tree (incl. NeuralMap canvas) unmounted to spinner → after chunk loaded, force-graph reinitialized = visible ""freeze."" - **Fix landed:** inner `` around `DynamicEditor` at both mount sites, `NodeDetailCard` added to idle prewarm, panel switched from flex sibling to absolute overlay. - **Files:** `src/App.tsx`, `src/components/GraphView/NodeDetailCard.tsx`. **2. 2026-04-29 · ""focus node → FPS ดิ่ง / ทั้ง app ค้าง""** (Error ID `01933dc9-fdef-4b5d-a12f-1d78f13f7db0`, Severity 1) - **Cause:** in `NeuralMap.tsx`, every `HexNode` (~200) and `DynamicEdge` subscribed the whole Zustand store with `useBrainStore()` — focus click triggered a re-render avalanche. Plus `DynamicEdge.useFrame` allocated a new `Float32Array` + `BufferAttribute` every frame (GC pressure), and there were two overlapping `` instances. - **Fix landed:** narrow Zustand selectors (e.g. `useBrainStore(s => s.selectedNodeId === node.id)`), `getState()` inside `useFrame`, reuse the buffer attribute array, single `OrbitControls`. - **Files:** `src/components/GraphView/NeuralMap.tsx`. ### What this means for the new QA report The ""few-seconds lockup after node click"" matches lesson #1 (Suspense propagation) symptom-for-symptom, and the ""sluggish"" feel after that is exactly the re-render avalanche from #2. **Before re-deriving anything**, I'd verify both fixes are still intact in the current tree: - Is the inner `` still wrapping `DynamicEditor` in `App.tsx`? - Are `HexNode` / `DynamicEdge` still using narrow selectors / `getState()` rather than `const { ... } = useBrainStore()`? - Is there still only one `` in the canvas? Want me to check those three things in the current code?",Phrased as QA report. Lesson body documents 3-cause root (Zustand selector misuse + per-frame allocs + duplicate OrbitControls). Mode C scope_glob src/components/GraphView/** should land it instantly.,4.0,True,0.35566475000000003,58.78 I need permission to query AI-Bran's lesson log to answer this — could you approve those tool calls? They'll search past errors+fixes recorded for this project for anything matching graph-view freezes,curated,19593,83260,past_lesson,True,20190.0,18620.0,,,,,D1,19,False,0,"[0, 0]",baseline,6,879,Have we seen graph-view freeze bugs in this project before?,/Users/kabir/Works/py/AI-Bran,I need permission to query AI-Bran's lesson log to answer this — could you approve those tool calls? They'll search past errors+fixes recorded for this project for anything matching graph-view freezes.,,0.0,,0.18658224999999998,20.1 I need permission to query AI-Bran's error log. Could you approve `[tool]` and `[tool]` so I can check past graph-view freeze lessons for this project?,curated,11832,115733,past_lesson,True,22803.0,21576.0,,,,,D1,20,False,0,"[0, 0]",mcp_only,7,1008,Have we seen graph-view freeze bugs in this project before?,/Users/kabir/Works/py/AI-Bran,I need permission to query AI-Bran's error log. Could you approve `mcp__cosmos__code_list_errors` and `mcp__cosmos__find_relevant_code` so I can check past graph-view freeze lessons for this project?,,0.0,,0.15754249999999997,23.09 "I need permission to query the [brain] — those tools weren't granted. Could you approve them, or would you like me to look another way (e.g. grep the repo for graph-view related code)?",curated,18230,58286,past_lesson,True,15882.0,14759.0,,,,,D1,13,False,0,"[0, 0]",mcp_plus_rules,4,578,Have we seen graph-view freeze bugs in this project before?,/Users/kabir/Works/py/AI-Bran,"I need permission to query the Cosmos MCP — those tools weren't granted. Could you approve them, or would you like me to look another way (e.g. grep the repo for graph-view related code)?",,0.0,,0.15834949999999998,16.34 "Two corrections worth flagging from the agent's research: the Zustand store actually lives at `src/components/GraphView/useBrainStore.ts` (not `src/store/`), and the Vite-CPU comment is at NeuralMapUn",curated,15715,95080,apply_lesson,,134434.0,133092.0,,src/components/GraphView/NeuralMap.tsx,useFrame,01933dc9-fdef-4b5d-a12f-1d78f13f7db0,T-AL5,9,False,0,"[3, 3]",baseline,6,3295,I'm adding a new R3F-rendered widget to the Dashboard that subscribes to live brain stats. What patterns from prior graph-view work in this repo should I follow to avoid performance regressions?,/Users/kabir/Works/py/AI-Bran,"Two corrections worth flagging from the agent's research: the Zustand store actually lives at `src/components/GraphView/useBrainStore.ts` (not `src/store/`), and the Vite-CPU comment is at NeuralMapUniverse.tsx:840. Everything else checked out. # Patterns to follow The R3F surface in this repo is small — `src/components/GraphView/NeuralMapUniverse.tsx` and `src/components/GraphView/StarField.tsx` are the only real precedents. They're well-tuned, so mirror them: **1. One draw call, not N meshes.** StarField.tsx renders all nodes as a single `` with a custom GLSL vert/frag shader (StarField.tsx:26–69, :71–202). Per-node animation/selection happens on the GPU via uniforms. Don't spawn a mesh per stat. **2. Read store state inside `useFrame`, never in render.** Pattern at NeuralMapUniverse.tsx and Signal.tsx is `const s = useBrainStore.getState()` *inside* `useFrame`. This decouples the R3F tree from React's render cycle so a stat tick doesn't reconcile the scene graph. **3. Use narrow Zustand selectors at the React boundary.** When you do need to subscribe in React (e.g., to remount or change layout), use `useBrainStore(s => s.stats)` with arrow-function selectors so unrelated store slices don't re-render you. Store is at `src/components/GraphView/useBrainStore.ts`. **4. Mutate buffers in place; flip `needsUpdate`.** StarField.tsx:129–145 overwrites the position `Float32Array` and sets `geometry.attributes.position.needsUpdate = true` rather than rebuilding geometry. DynamicEdge guards with a `distanceToSquared < 0.1` check before the flag flip to avoid thrash — copy that. **5. `useDeferredValue` for expensive rebuilds.** NeuralMapUniverse.tsx:835–868 wraps memories/folders so rapid stat updates don't stall the frame. **6. Hoist `useMemo` above JSX.** Comment at NeuralMapUniverse.tsx:840 — inlining `useMemo` inside `` spiked Vite's transformer to 900%+ CPU. Compute buffers/textures at top of the component, pass refs in. **7. Lazy-load the widget.** Every heavy component in App.tsx is `React.lazy` + `Suspense` (App.tsx:14–30, the existing `DashboardWidgets` at line 21 is the model). Add yours the same way so it doesn't block dashboard TTI. **8. Polling is your responsibility.** No live websocket exists for stats; `refreshData()` is called once on mount. If the widget needs ticks, own a `useEffect` + `setInterval` and clear on unmount — don't add a global poller. **9. Cap heuristic O(n²) work.** NeuralMapUniverse.tsx:679 hard-cuts at 500 nodes. If your widget does any cross-stat correlation, gate it the same way. **10. Disposal is currently implicit** — fine if you cache via `useMemo`, but if your widget churns textures/materials per stat update, add an explicit `dispose()` cleanup; nothing in the existing code does this and it'd be a new risk. The single biggest regression risk in this repo is subscribing to the store in render — do all live reads inside `useFrame` and you'll be aligned with how the existing graph survives 10k+ nodes.","New widget on Dashboard ≠ NeuralMap, but patterns (selector discipline + frame-allocation hygiene + single OrbitControls) generalize. Tests cross-file lesson application.",3.0,False,0.4167799,134.65 "Here are the patterns established in this repo's prior R3F work that you should follow. The core lesson is captured in `.aibran/lessons.md` (error `01933dc9`, 2026-04-29) and is enforced throughout `s",curated,4733,73438,apply_lesson,,93613.0,92777.0,,src/components/GraphView/NeuralMap.tsx,useFrame,01933dc9-fdef-4b5d-a12f-1d78f13f7db0,T-AL5,8,False,0,"[3, 3]",mcp_only,3,1935,I'm adding a new R3F-rendered widget to the Dashboard that subscribes to live brain stats. What patterns from prior graph-view work in this repo should I follow to avoid performance regressions?,/Users/kabir/Works/py/AI-Bran,"Here are the patterns established in this repo's prior R3F work that you should follow. The core lesson is captured in `.aibran/lessons.md` (error `01933dc9`, 2026-04-29) and is enforced throughout `src/components/GraphView/NeuralMapUniverse.tsx`. **State subscription rules (most important):** - In components rendered inside `` — especially anything using `useFrame` — never destructure the Zustand store via hook. Read via `useBrainStore.getState()` inside the frame callback. See `NeuralMapUniverse.tsx` Signal component (~lines 86–88) and DynamicEdge (~lines 146–229). - Outside the frame loop, use fine-grained selectors: `useBrainStore(s => s.selectedNodeId)`, never `const { ... } = useBrainStore()`. The 2D `NeuralMap.tsx` (lines 148–160) is the reference. - The original regression was 200 nodes × whole-store subscription → click triggers avalanche re-render. Don't recreate it. **Three.js object reuse:** - `useMemo` for geometries and materials keyed on shape. - Mutate `BufferAttribute.array` in place and set `needsUpdate = true` (DynamicEdge lines 220–228) instead of allocating new `Float32Array`s per frame. - Early-exit in `useFrame` when the delta is below a threshold (DynamicEdge lines 212–215). **Render scheduling:** - If your widget only updates when stats change (likely for a stats widget), set `` and call `invalidate()` on stat updates rather than running the loop at 60fps. - Clamp `dpr={[1, 2]}` to keep retina from doubling fragment cost. **Dashboard integration:** - Lazy-load the widget and wrap it in `` at the *widget* level, not above the parent canvas — error `0236c9a4` showed Suspense at the wrong level unmounted the whole 3D scene on chunk load. - The slot is `src/components/Dashboard/SQLCharts.tsx` (`DashboardWidgets`), which already fetches `/api/v2/brain/overview` on mount. For ""live"" stats you'll need to add polling or extend that fetch — there's no websocket/RxJS plumbing in the repo today. - Side panels: use `absolute top-0 right-0` overlay positioning, not a flex sibling, so the canvas isn't reflowed. **Things to skip:** no instancedMesh, LOD, or sprite-cache pattern from the 2D `NeuralMap.tsx` is needed unless your widget renders many objects. A stats widget with a handful of meshes won't hit those thresholds — don't preemptively build them. Want me to sketch the widget skeleton in `SQLCharts.tsx` against these patterns?","New widget on Dashboard ≠ NeuralMap, but patterns (selector discipline + frame-allocation hygiene + single OrbitControls) generalize. Tests cross-file lesson application.",3.0,False,0.23411920000000003,94.16 "Here are the patterns from the existing R3F graph work (`NeuralMapUniverse.tsx`, `StarField.tsx`) that you should mirror — and the gotchas the comments call out as past regressions. ## Subscribing to",curated,62872,276295,apply_lesson,,104456.0,103665.0,,src/components/GraphView/NeuralMap.tsx,useFrame,01933dc9-fdef-4b5d-a12f-1d78f13f7db0,T-AL5,18,False,0,"[4, 4]",mcp_plus_rules,15,6242,I'm adding a new R3F-rendered widget to the Dashboard that subscribes to live brain stats. What patterns from prior graph-view work in this repo should I follow to avoid performance regressions?,/Users/kabir/Works/py/AI-Bran,"Here are the patterns from the existing R3F graph work (`NeuralMapUniverse.tsx`, `StarField.tsx`) that you should mirror — and the gotchas the comments call out as past regressions. ## Subscribing to the store - **Use per-field selectors, not destructuring.** `NeuralMap.tsx:148-160` does `useBrainStore(s => s.memories)` one field at a time. `NeuralMapUniverse.tsx:829` still does `const { memories, folders, ... } = useBrainStore()` — this re-renders on *any* store change, which is exactly what kills a live-stats widget. Don't copy that line; copy the selector pattern. - **In `useFrame`, read via `useBrainStore.getState()`** (`StarField.tsx:121`, `Signal` line 87, `DynamicEdge` line 149). Subscribing inside the frame loop forces a React re-render every tick. - **Wrap heavy derived data in `useDeferredValue`** before feeding it to a `useMemo` builder (`NeuralMapUniverse.tsx:835-837`). For a live stats stream this is the single biggest lever — defer the rebuild so the slider/scrub interactions stay responsive while a stats burst is processing. ## R3F-specific patterns - **Stable callback refs at module scope** (`NeuralMapUniverse.tsx:13-14` — `NOOP_NODE_CLICK`/`NOOP_HOVER`). Inline `() => {}` props break `React.memo` on per-node children. The comment is explicit that this was a regression. - **`React.memo` every per-element 3D component** (`Signal`, `DynamicEdge`, `ChatBeam`, `GalaxyNucleus`). - **Generate textures inside `useMemo`, never per-frame** (`generateAuraTexture` usage in `Signal:80`, `CoreNode:381`). The 2D analog at `NeuralMap.tsx:88-112` has the explicit comment that uncached `createRadialGradient` allocations were the dominant hot path at 1700+ nodes. - **Build large `Float32Array` buffers in module-level or `useMemo`, not inline JSX** (`NeuralMapUniverse.tsx:842-863`). Comment notes inline buffers spiked vite's transformer to 900% CPU. - **DPR clamp on the Canvas**: `` (line 915). ## Render-loop hygiene - **Single draw call for many primitives**: `StarField.tsx` is the canonical example — one `` with packed per-vertex attributes + a shader, scales to 10k+. If your widget renders many similar elements, copy this shape rather than mapping over a ``. - **Short-circuit unchanged updates inside `useFrame`** (`DynamicEdge` lines 212-215 — `distanceToSquared < 0.1` early return before writing the position attribute). - **Mutate buffers in place + `needsUpdate = true`** (StarField line 143). Don't recreate geometries. - **O(1) lookups, never `.find()` in hot paths**: `nodeById` (line 648), `idToIndex` (StarField line 109), `useMemo`-resolved focused node in `CameraFocus` (line 796) — comment explicitly calls out the prior `nodes.find()` per frame. ## Scale limits - **Cap O(n²) work at a threshold**: `HEURISTIC_LIMIT = 500` (line 682) with comment ""1.4M iters @ 1.7k"". If your widget derives anything from pairs of memories, add a similar gate. - **Density factor** (line 492) compresses positions as count grows so visuals remain usable. ## Dashboard-specific gap There's no existing live-subscription pattern in `Dashboard/`. `SQLCharts.tsx:62-75` fetches `/api/v2/brain/overview` once on mount — no polling, no SSE. So you'll be introducing the live wiring yourself; please don't put a `setInterval` directly inside the R3F component (it'll cause re-renders that fight `useFrame`). Either: 1. Land the polling in `useBrainStore` so the widget reads via a selector, OR 2. Use a ref + `useFrame` to throttle the read of an external mutable source. ## One thing worth confirming before you start The `NeuralMapUniverse.tsx` header (lines 824-827) says the 3D view is preserved as a flagged ""Universe Map"" — `react-force-graph-2d` is the primary view as of 2026-04-29. Worth checking with the team whether the new R3F widget should share rendering infra with that flagged view (e.g. lift `StarField` / aura-texture helpers into a shared module) rather than starting fresh. Note: I tried the Cosmos `find_relevant_code` and `code_list_errors` tools first (which would have surfaced past lessons directly) but permissions weren't granted in this session — if you re-run with those allowed, you'd likely get the same patterns plus any incident notes I can't see from the source.","New widget on Dashboard ≠ NeuralMap, but patterns (selector discipline + frame-allocation hygiene + single OrbitControls) generalize. Tests cross-file lesson application.",4.0,False,0.6880314999999999,105.09 ,curated,,,past_lesson,,,,timeout,core/code_indexer/project_summarizer.py,_delete_previous_summaries,ca204c2e-bbd2-415b-ab36-8d541dc24444,T-PL7,,False,0,"[null, null]",baseline,,,We're seeing duplicate `code_summary` memories accumulate over multiple indexer runs even though the deletion logic looks idempotent. Why might that be?,/Users/kabir/Works/py/AI-Bran,,Same symptom as the lesson but phrased as developer's diagnostic question. Tests scope_glob recall (lesson scope_globs include project_summarizer.py). Race condition + watcher-self-trigger interaction is non-obvious.,,True,,180.0 ,curated,,,past_lesson,,,,timeout,core/code_indexer/project_summarizer.py,_delete_previous_summaries,ca204c2e-bbd2-415b-ab36-8d541dc24444,T-PL7,,False,0,"[null, null]",mcp_only,,,We're seeing duplicate `code_summary` memories accumulate over multiple indexer runs even though the deletion logic looks idempotent. Why might that be?,/Users/kabir/Works/py/AI-Bran,,Same symptom as the lesson but phrased as developer's diagnostic question. Tests scope_glob recall (lesson scope_globs include project_summarizer.py). Race condition + watcher-self-trigger interaction is non-obvious.,,True,,180.0 "This exact bug is recorded in `.aibran/lessons.md` (entry from 2026-04-30, error ID `ca204c2e-bbd2-415b-ab36-8d541dc24444`). The deletion logic *is* idempotent on paper — but two things defeat it: **",curated,54065,461403,past_lesson,,178801.0,177748.0,,core/code_indexer/project_summarizer.py,_delete_previous_summaries,ca204c2e-bbd2-415b-ab36-8d541dc24444,T-PL7,24,False,0,"[4, 4]",mcp_plus_rules,18,12353,We're seeing duplicate `code_summary` memories accumulate over multiple indexer runs even though the deletion logic looks idempotent. Why might that be?,/Users/kabir/Works/py/AI-Bran,"This exact bug is recorded in `.aibran/lessons.md` (entry from 2026-04-30, error ID `ca204c2e-bbd2-415b-ab36-8d541dc24444`). The deletion logic *is* idempotent on paper — but two things defeat it: **1. Cross-transaction race in `summarize()`.** Two overlapping `summarize()` calls each run their own DELETE+INSERT in separate transactions. Neither sees the other's uncommitted rows, so both commit successfully → duplicate set. The coarse `_delete_previous_summaries` in `project_summarizer.py:190` only protects against serial re-runs, not concurrent ones. **2. The hot-reload trap (this is the part that makes it look unfixable).** `core/code_indexer/watcher.py` watches the source tree. When you save the patched `project_summarizer.py`, the watcher fires the indexer → `summarize()` runs → but FastAPI/uvicorn has the **old** module already imported, so it executes the pre-patch code and creates dups again. The fix on disk is dormant until you kill+restart `python3.11 -m core.api.rest_server_v2`. That's why ""fixing on disk did not stop the bug — new dups kept appearing."" **Bonus leak**: `memories_v2` and `memories_fts` have no sync triggers, so every raw DELETE leaves orphan FTS rows (the lesson notes 626 stale rows = ~80% bloat at the time). **Fix already on disk** (verify at `project_summarizer.py:222-233`): targeted per-title DELETE inside `_save_note` before the INSERT, plus an FTS orphan sweep. That makes overlapping runs race-safe by serializing on `(folder_id, title)` instead of the project folder as a whole. **Action**: confirm the patch is present (it is), then `kill` the running rest_server_v2 process and restart it — otherwise the watcher will keep re-firing the stale in-memory `summarize()`.",Same symptom as the lesson but phrased as developer's diagnostic question. Tests scope_glob recall (lesson scope_globs include project_summarizer.py). Race condition + watcher-self-trigger interaction is non-obvious.,4.0,True,0.87833175,179.4 ,curated,,,apply_lesson,,,,timeout,,,,E1,,False,0,"[null, null]",baseline,,,Add a 'restart Python sidecar' button to the Settings → Advanced section. Use the launcher pattern we already have for spawning Python.,/Users/kabir/Works/py/AI-Bran,,,,"[""src-tauri/src/lib.rs sidecar spawn block""]",,180.0 ,curated,,,apply_lesson,,,,timeout,,,,E1,,False,0,"[null, null]",mcp_only,,,Add a 'restart Python sidecar' button to the Settings → Advanced section. Use the launcher pattern we already have for spawning Python.,/Users/kabir/Works/py/AI-Bran,,,,"[""src-tauri/src/lib.rs sidecar spawn block""]",,180.0 ,curated,,,apply_lesson,,,,timeout,,,,E1,,False,0,"[null, null]",mcp_plus_rules,,,Add a 'restart Python sidecar' button to the Settings → Advanced section. Use the launcher pattern we already have for spawning Python.,/Users/kabir/Works/py/AI-Bran,,,,"[""src-tauri/src/lib.rs sidecar spawn block""]",,180.0 I need permission to query AI-Bran's lesson log to answer this. Want me to retry the calls (`[tool]` and `[tool]` against this repo) so I can check for past drag-drop canvas lessons? Otherwise I can f,curated,19753,109887,past_lesson,True,23202.0,21262.0,,,,,D2,20,False,0,"[0, 0]",baseline,7,979,Any past issues with drag-drop on the canvas silently failing?,/Users/kabir/Works/py/AI-Bran,"I need permission to query AI-Bran's lesson log to answer this. Want me to retry the calls (`find_relevant_code` and `code_list_errors` against this repo) so I can check for past drag-drop canvas lessons? Otherwise I can fall back to grepping the source for drop handlers, but that won't surface prior debug sessions.",Replaces a Tauri deep-link prompt that had no recorded lesson — drag-drop has a real entry. Adjust to a different recorded lesson if drag-drop is stale at run time.,0.0,,0.20340175000000002,22.91 I need permission to query AI-Bran's lesson log. Want me to retry — or would you prefer I just grep the codebase for drag/drop handlers?,curated,11952,91382,past_lesson,True,18078.0,17012.0,,,,,D2,19,False,0,"[0, 0]",mcp_only,6,756,Any past issues with drag-drop on the canvas silently failing?,/Users/kabir/Works/py/AI-Bran,I need permission to query AI-Bran's lesson log. Want me to retry — or would you prefer I just grep the codebase for drag/drop handlers?,Replaces a Tauri deep-link prompt that had no recorded lesson — drag-drop has a real entry. Adjust to a different recorded lesson if drag-drop is stale at run time.,0.0,,0.139818,18.46 I need permission to query the [brain] tools. Please approve the `[tool]` and `[tool]` calls so I can check past lessons for drag-drop failures on the canvas in this project.,curated,18260,58264,past_lesson,True,14519.0,13328.0,,,,,D2,13,False,0,"[0, 0]",mcp_plus_rules,4,615,Any past issues with drag-drop on the canvas silently failing?,/Users/kabir/Works/py/AI-Bran,I need permission to query the Cosmos MCP tools. Please approve the `find_relevant_code` and `code_list_errors` calls so I can check past lessons for drag-drop failures on the canvas in this project.,Replaces a Tauri deep-link prompt that had no recorded lesson — drag-drop has a real entry. Adjust to a different recorded lesson if drag-drop is stale at run time.,0.0,,0.159457,14.9 "Quick read of `core/billing/plan.py`, `core/billing/license.py`, `src/lib/license.ts`, and `supabase/functions/license/index.ts`. Things to verify before you start: **Plan enum lives in three places ",curated,21873,126767,apply_lesson,,65176.0,64193.0,,core/billing/license.py,current_status,42ada388-8f96-4fc5-bdb0-6276bfa10974,T-AL6,10,False,0,"[3, 3]",baseline,9,3302,We're adding a new license tier for educational users. The tier needs to be detected from the same license.json file. What should I verify about Cosmos's existing license-loading code before I start?,/Users/kabir/Works/py/AI-Bran,"Quick read of `core/billing/plan.py`, `core/billing/license.py`, `src/lib/license.ts`, and `supabase/functions/license/index.ts`. Things to verify before you start: **Plan enum lives in three places — they must move together** - `core/billing/plan.py:31` — `Plan` enum (Python source of truth) - `src/lib/license.ts:11` — `Plan` type union (UI mirror) - `supabase/functions/license/index.ts:54` — inline plan literal type - And the `users.plan` DB column likely has a CHECK / enum constraint — confirm via the Supabase migrations. **The feature matrix is exhaustive, not defaulting** - `_MATRIX` at `plan.py:58` lists each `Feature` → set of plans that unlock it. Adding `EDU` to the enum without updating every entry silently treats edu users like Free for that feature. Decide up-front: does edu get all Pro features, a subset, or its own column? - Mirror gate on the TS side: `PRO_FEATURES` at `src/lib/license.ts:139` is an inverted set, and `featureEnabled` short-circuits `pro`/`trial_pro` to true (`license.ts:151`). If edu should unlock Pro features, that branch needs widening. **Expiry & downgrade is duplicated three times — keep them in sync** - `plan.py:178-185`, `license.ts:115-128`, `index.ts:58-65` all auto-downgrade expired trial/pro to free. If edu expires (semester? annual verification?), you need a parallel `edu_expires_at` field and matching downgrade in all three. - `LicenseStatus` (`plan.py:83`) only carries `trial_expires_at` + `pro_until`; `days_remaining()` (`plan.py:91`) only checks those two. Decide whether to add a third field or reuse `pro_until`. **The signed JWT is the contract** - Server signs claims at `index.ts:76-84`; client verifies at `license.py:101`. The new plan value must round-trip — the verifier doesn't constrain `plan`, but `_load_from_file` at `plan.py:170` does `Plan(raw_plan)` and silently returns `None` on `ValueError`, so a JWT with an unknown plan currently degrades to default Free without an error. Worth adding a test for that path. **Caching & rollout** - `plan.py:104` — 60s in-process cache. `license.ts:32` — 7-day refresh interval. Existing users on edu plan won't see it instantly after a DB flip; QA scripts should call `_clear_cache()` / clear localStorage. - Dev mode (plain JSON, no pubkey) at `license.py:166-189` accepts any plan string — useful for fixtures, but production builds with `AIBRAN_LICENSE_PUBKEY` set will reject anything but a JWT. **Tests already enumerate plans** - `core/billing/tests/test_plan.py` and `test_license.py` exist — read them first; they likely have `@pytest.mark.parametrize` over `Plan` that'll need an edu case, and the matrix completeness assertion (if there is one) will catch missing entries. Want me to dig into the DB migration / users table constraint, or sketch the minimal diff?",Targets non-curated lesson — apply_lesson recall in base engine without pin/scope_glob bias. New tier needs same detection path.,3.0,False,0.28313475,65.8 "Here's what I'd verify before touching the code. The license system is more layered than it looks — there are at least 5 places a new tier has to land in lockstep, plus a couple of schema decisions th",curated,11947,136922,apply_lesson,,65281.0,64170.0,,core/billing/license.py,current_status,42ada388-8f96-4fc5-bdb0-6276bfa10974,T-AL6,10,False,0,"[1, 1]",mcp_only,8,3663,We're adding a new license tier for educational users. The tier needs to be detected from the same license.json file. What should I verify about Cosmos's existing license-loading code before I start?,/Users/kabir/Works/py/AI-Bran,"Here's what I'd verify before touching the code. The license system is more layered than it looks — there are at least 5 places a new tier has to land in lockstep, plus a couple of schema decisions that aren't local to ""the loader."" ## Things to confirm in the existing code **1. The `Plan` enum is the choke point — and it's duplicated.** - Python: `core/billing/plan.py:31-34` (`FREE | TRIAL_PRO | PRO`) - TypeScript: `src/lib/license.ts:11` (`""free"" | ""trial_pro"" | ""pro""`) These have to stay in sync. Adding `educational` to one and not the other will silently break UI gating vs. backend gating. **2. The feature matrix is ""frozen; source of truth for the roadmap table""** (`plan.py:55-69`). Every entry in `_MATRIX` must explicitly include or exclude the new tier — there's no default. So before you start, decide which of the 10 features `educational` unlocks. Confirm against the roadmap (section 5.9.1 per the comment). **3. Expiry semantics — does educational expire?** `LicenseStatus` (`plan.py:82-97`) only carries `trial_expires_at` and `pro_until`, and the auto-downgrade at lines 178-185 only handles those two. If educational has, say, an academic-year end date, you're changing the **license file schema**, not just the parser: - New claim field in the JWT payload (the Supabase Edge Function `/functions/v1/license` has to start emitting it) - New field on `LicenseStatus` - New branch in `days_remaining()` (line 91-97) - Possibly a new env var alongside `AIBRAN_TRIAL_EXPIRES` (`plan.py:27`) **4. JWTs are signed by Supabase — you can't hand-edit the file in production.** `parse_license_text` (`license.py:156`) refuses unsigned JSON when a public key is configured. So verify with whoever owns the Supabase function that it can mint `plan: ""educational""` tokens before you ship client code that expects them. The dev path (plain JSON, no pubkey) is fine for local testing. **5. The TS side has a coarser model than Python.** `featureEnabled` in `license.ts:149-154` is binary — ""pro/trial_pro unlocks everything in `PRO_FEATURES`."" If educational gets a *subset* of Pro features, this function can't represent that; you'll need to mirror the Python matrix on the TS side, not just add a string to the union. **6. `effectivePlan` does its own expiry check on the TS side** (`license.ts:115-129`), independently from Python. If educational expires, both downgrade paths need the new branch, or they'll disagree. **7. `AIBRAN_PLAN` env var override** (`plan.py:131`) parses via `Plan(...)` so it'll pick up the new value for free — but it bypasses the license file entirely, which is the override that gets used in dev/tests. Worth knowing it exists. **8. Caches.** Python caches for 60s (`plan.py:104`); the TS side refreshes every 7 days (`license.ts:32`). Tier changes won't propagate instantly — fine, but call it out so you don't chase a ""stale plan"" ghost during testing. ## Open questions to settle before coding - Does `educational` expire, and on what field? (Drives schema change vs. enum-only change.) - Which exact features does it unlock? (Drives `_MATRIX` and the TS mirror.) - Is the Supabase function already issuing it, or does the backend change land first? If you can answer those three, the code change is mechanical: enum + matrix + TS union + (maybe) a new date field threaded through `LicenseStatus`, `_load_from_file`, `days_remaining`, and `effectivePlan`. Tests live in `core/billing/tests/test_license.py` and `test_plan.py` — extend, don't replace.",Targets non-curated lesson — apply_lesson recall in base engine without pin/scope_glob bias. New tier needs same detection path.,1.0,False,0.23519974999999999,66.57 "License loading is split across `core/billing/license.py` (parse + signature verify) and `core/billing/plan.py` (apply to a `LicenseStatus`). The verifier doesn't care about plan values, so the bulk o",curated,27416,112653,apply_lesson,,54042.0,52934.0,,core/billing/license.py,current_status,42ada388-8f96-4fc5-bdb0-6276bfa10974,T-AL6,15,False,0,"[3, 3]",mcp_plus_rules,8,3090,We're adding a new license tier for educational users. The tier needs to be detected from the same license.json file. What should I verify about Cosmos's existing license-loading code before I start?,/Users/kabir/Works/py/AI-Bran,"License loading is split across `core/billing/license.py` (parse + signature verify) and `core/billing/plan.py` (apply to a `LicenseStatus`). The verifier doesn't care about plan values, so the bulk of what you need to check is in `plan.py`: 1. **`Plan` enum (plan.py:31)** — only `FREE`, `TRIAL_PRO`, `PRO`. Note `_load_from_file` does `Plan(raw_plan)` inside a `try/except ValueError → return None` (line 170-173), which silently falls back to FREE for unknown values. Decide whether old clients seeing `""edu""` should fall back to FREE (current behavior) or something else. 2. **Feature matrix (plan.py:58-69)** — every `Feature` lists which plans enable it. Missing EDU from a row means the feature is off for EDU, which is the safe default but easy to forget. You'll need to decide per-feature what EDU gets (likely some Pro features but not e.g. CLOUD_AI_QUOTA?). 3. **Expiration / downgrade logic (plan.py:179-185)** — only `TRIAL_PRO`/`trial_expires_at` and `PRO`/`pro_until` auto-downgrade. If EDU expires (end of academic year, re-verification), you need a parallel field + downgrade branch, and a matching field on `LicenseStatus` (line 82-89). If it doesn't expire, document that. 4. **Env override (plan.py:131-151)** — `AIBRAN_PLAN` accepts any enum value via `Plan(raw)`, so adding the variant auto-enables dev override; but the trial-default branch is hardcoded to `TRIAL_PRO` only (line 141), which is fine — just confirm EDU doesn't need its own default-expiry handling. 5. **Frontend mirror** — `src/lib/license.ts` and `src/contexts/LicenseContext.tsx` parallel this; they must agree on plan strings or the UI will mis-gate. 6. **Tests** — `core/billing/tests/test_plan.py` likely iterates the matrix exhaustively; new variant will need fixture coverage and any ""all plans"" assertions updated. 7. **Backend issuer** — `supabase/functions/license/index.ts` is what mints the JWT in production; verify it can emit `""plan"": ""edu""` and any new claim fields (e.g. `edu_expires_at`). The single biggest gotcha is #1 — silent fallback to FREE means old clients won't error on an EDU license, they'll just downgrade the user. That may or may not be what you want.",Targets non-curated lesson — apply_lesson recall in base engine without pin/scope_glob bias. New tier needs same detection path.,3.0,False,0.3057745,54.38 I need permission to query AI-Bran's lesson log. Could you approve the `[tool]` and `[tool]` calls? Those are the only tools that can surface past debug sessions for this exact pattern (Tauri + Vite +,curated,20083,83616,past_lesson,,26129.0,25035.0,,vite.config.ts,optimizeDeps.include,4cd762e0-a76d-42c8-904e-60f71eead859,T-PL4,19,False,0,"[0, 0]",baseline,6,1028,"Right after installing a new React UI package, the Tauri dev server starts throwing a Vite import/export SyntaxError on first navigation. Has this codebase hit this pattern before?",/Users/kabir/Works/py/AI-Bran,I need permission to query AI-Bran's lesson log. Could you approve the `mcp__cosmos__code_list_errors` and `mcp__cosmos__find_relevant_code` calls? Those are the only tools that can surface past debug sessions for this exact pattern (Tauri + Vite + new React UI package → SyntaxError on first nav) — grep can't replicate it. Once approved I'll re-run both (current-project scoped + cross-project) and report what's been seen before.,Recurring vite barrel pattern. Lesson encodes the project-specific recipe (add to optimizeDeps.include + nuke .vite cache). Mode A re-derives from Vite docs; Modes B/C should land the recipe via recall. Mode C with rules+pin+scope_glob should be fastest.,0.0,True,0.19359674999999998,26.6 "I need permission to query AI-Bran's lessons store. Could you approve `[tool]` and `[tool]`? Those are the only tools that surface past lessons — grep can't see them. Once approved I'll run: - `[tool",curated,11647,91259,past_lesson,,23247.0,22182.0,,vite.config.ts,optimizeDeps.include,4cd762e0-a76d-42c8-904e-60f71eead859,T-PL4,18,False,0,"[0, 0]",mcp_only,6,1006,"Right after installing a new React UI package, the Tauri dev server starts throwing a Vite import/export SyntaxError on first navigation. Has this codebase hit this pattern before?",/Users/kabir/Works/py/AI-Bran,"I need permission to query AI-Bran's lessons store. Could you approve `mcp__cosmos__find_relevant_code` and `mcp__cosmos__code_list_errors`? Those are the only tools that surface past lessons — grep can't see them. Once approved I'll run: - `find_relevant_code` with the Tauri/Vite/React-package symptom - `code_list_errors` with `cross_project=true` (Vite/Tauri quirks tend to be universal, so a lesson from another watched project may apply here) If a past lesson matches, I'll apply that fix directly rather than re-derive it.",Recurring vite barrel pattern. Lesson encodes the project-specific recipe (add to optimizeDeps.include + nuke .vite cache). Mode A re-derives from Vite docs; Modes B/C should land the recipe via recall. Mode C with rules+pin+scope_glob should be fastest.,0.0,True,0.14416825,23.58 I need permission to query Cosmos. Could you approve the `[tool]` and `[tool]` calls? Those are the right tools to check whether this codebase has seen this Vite SyntaxError-after-package-install patt,curated,18409,58346,past_lesson,,15730.0,14682.0,,vite.config.ts,optimizeDeps.include,4cd762e0-a76d-42c8-904e-60f71eead859,T-PL4,13,False,0,"[0, 0]",mcp_plus_rules,4,759,"Right after installing a new React UI package, the Tauri dev server starts throwing a Vite import/export SyntaxError on first navigation. Has this codebase hit this pattern before?",/Users/kabir/Works/py/AI-Bran,"I need permission to query Cosmos. Could you approve the `mcp__cosmos__find_relevant_code` and `mcp__cosmos__code_list_errors` calls? Those are the right tools to check whether this codebase has seen this Vite SyntaxError-after-package-install pattern before — `find_relevant_code` runs your symptom against past lessons, and `code_list_errors` lists prior fixes for this project.",Recurring vite barrel pattern. Lesson encodes the project-specific recipe (add to optimizeDeps.include + nuke .vite cache). Mode A re-derives from Vite docs; Modes B/C should land the recipe via recall. Mode C with rules+pin+scope_glob should be fastest.,0.0,True,0.16406225,16.34