repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

chore(pi): remove remembered facts

d9ccd326a7b65100a586d69bf43b396a6982fd2f

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

pi/agent/.pi/remember.jsonl

Deleted
deleted file mode 100644
1 -{"op":"add","id":"RM007","ts":"2026-04-28T21:13:02.468Z","tags":["jiti","extensions","dbg","gotcha"],"fact":"jiti loads the same TypeScript module multiple times with separate module identities. Module-scoped let/const are NOT shared across jiti instances of the same file. Must use globalThis for shared state across extensions.","reason":"Debug logging (lib/dbg.ts) used module-scoped _enabled and _sink. dbg.ts extension set the sink on one instance, remember.ts read from a different instance — sink was always the default no-op. globalThis fixes this."}
2 -{"op":"add","id":"RM008","ts":"2026-04-29T21:33:43.604Z","tags":["footer","extensions","architecture"],"fact":"Footer uses event-driven pub/sub architecture. Extensions emit `footer:segment` via `pi.events.emit()`. Only `footer/index.ts` calls `setFooter()`. Producers: git-status, runtime, cost, context, timing, thinking, pr-status. All check `ctx.hasUI` to bail in print mode. Segment protocol defined in `footer/protocol.ts`.\n","reason":"Documents the architecture of the split UI extensions for future reference and debugging."}
3 -{"op":"add","id":"RM009","ts":"2026-04-29T22:31:49.708Z","tags":["cost","sessions","gotcha"],"fact":"`getSessionsDir()` is NOT exported from `@mariozechner/pi-coding-agent` main index (only `getAgentDir` and `VERSION` are). Must read `settings.json` manually to get `sessionDir`, or fall back to `getAgentDir()/sessions`. Actual sessions dir is `/home/me/.local/state/pi/sessions` (flat files, no per-cwd subdirs).\n","reason":"Avoid importing non-existent export. Session layout changed from nested to flat."}
4 -{"op":"add","id":"RM010","ts":"2026-04-30T23:14:16.319Z","tags":["node","gotcha","jiti","extensions"],"fact":"`node:path` realpath is sync only (`realpathSync`). Import async `realpath` from `node:fs/promises` instead. jiti transpilation silently returns `undefined` for `realpath` imported from `node:path`.","reason":"git-safe extension had `(0, _nodePath.realpath) is not a function` error at runtime because realpath was imported from node:path which only exports realpathSync. This took significant debugging to identify since jiti didn't throw at import time."}
5 -{"op":"add","id":"RM011","ts":"2026-04-30T23:30:42.402Z","tags":["extensions","gotcha","pi"],"fact":"Pi extension tool `execute()` — returning `isError: true` in the result object is a NO-OP. Must `throw new Error(msg)` to set the error flag. Docs: \"Returning a value never sets the error flag regardless of what properties you include in the return object.\"","reason":"git-safe extension returned isError:true in error catches, but renderResult saw isError:false, tried to read SafeCloneResult fields from {error:msg} details → undefined rendering. Throwing fixes it."}
6 -{"op":"add","id":"RM012","ts":"2026-05-01T21:28:28.936Z","tags":["angel","zai","advisor","gotcha"],"fact":"`zai/glm-5.1` as advisor model tends to wrap JSON responses in markdown code fences (```json ... ```). Other models (openai-codex/gpt-5.5) don't. parseAdvice must strip fences before parsing.","reason":"Discovered during angel extension testing. zai/glm-5.1 consistently wraps responses in fences, causing parse failures without fence-stripping logic."}

pi/agent/.pi/remember.md

Deleted
deleted file mode 100644
1 -# Project Facts
3 -6 remembered fact(s).
5 -| ID | Tags | Fact | Reason |
6 -|-----|------|------|--------|
7 -| RM007 | jiti, extensions, dbg, gotcha | jiti loads the same TypeScript module multiple times with separate module identities. Module-scoped let/const are NOT shared across jiti instances of the same file. Must use globalThis for shared state across extensions. | Debug logging (lib/dbg.ts) used module-scoped _enabled and _sink. dbg.ts extension set the sink on one instance, remember.ts read from a different instance — sink was always the default no-op. globalThis fixes this. |
8 -| RM008 | footer, extensions, architecture | Footer uses event-driven pub/sub architecture. Extensions emit `footer:segment` via `pi.events.emit()`. Only `footer/index.ts` calls `setFooter()`. Producers: git-status, runtime, cost, context, timing, thinking, pr-status. All check `ctx.hasUI` to bail in print mode. Segment protocol defined in `footer/protocol.ts`.
9 - | Documents the architecture of the split UI extensions for future reference and debugging. |
10 -| RM009 | cost, sessions, gotcha | `getSessionsDir()` is NOT exported from `@mariozechner/pi-coding-agent` main index (only `getAgentDir` and `VERSION` are). Must read `settings.json` manually to get `sessionDir`, or fall back to `getAgentDir()/sessions`. Actual sessions dir is `/home/me/.local/state/pi/sessions` (flat files, no per-cwd subdirs).
11 - | Avoid importing non-existent export. Session layout changed from nested to flat. |
12 -| RM010 | node, gotcha, jiti, extensions | `node:path` realpath is sync only (`realpathSync`). Import async `realpath` from `node:fs/promises` instead. jiti transpilation silently returns `undefined` for `realpath` imported from `node:path`. | git-safe extension had `(0, _nodePath.realpath) is not a function` error at runtime because realpath was imported from node:path which only exports realpathSync. This took significant debugging to identify since jiti didn't throw at import time. |
13 -| RM011 | extensions, gotcha, pi | Pi extension tool `execute()` — returning `isError: true` in the result object is a NO-OP. Must `throw new Error(msg)` to set the error flag. Docs: "Returning a value never sets the error flag regardless of what properties you include in the return object." | git-safe extension returned isError:true in error catches, but renderResult saw isError:false, tried to read SafeCloneResult fields from {error:msg} details → undefined rendering. Throwing fixes it. |
14 -| RM012 | angel, zai, advisor, gotcha | `zai/glm-5.1` as advisor model tends to wrap JSON responses in markdown code fences (```json ... ```). Other models (openai-codex/gpt-5.5) don't. parseAdvice must strip fences before parsing. | Discovered during angel extension testing. zai/glm-5.1 consistently wraps responses in fences, causing parse failures without fence-stripping logic. |