mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 16:45:22 +00:00
2.8 KiB
2.8 KiB
issue, issue_title
| issue | issue_title |
|---|---|
| 48 | Auto-allow reads from Pi package and agent directories in external_directory checks |
Retro: #48 — Auto-allow reads from Pi package and agent directories in external_directory checks
Final Retrospective (2026-05-05T04:42:00Z)
Session summary
Implemented Pi infrastructure read auto-allow for the external_directory gate.
Read-only tools (read, find, grep, ls) targeting Pi infrastructure directories now bypass the gate entirely.
Shipped as v4.9.0 with full test coverage (43 new tests), schema/docs updates, and an optional piInfrastructureReadPaths config field for user-configured extras.
Observations
What went well
- The user's early intervention ("Is
npm root -gsafe? What about Homebrew/pnpm/bun?") redirected the design towardimport.meta.urlself-discovery before any code was written — avoiding a fragile subprocess-based approach that would have required package-manager detection logic. - The
isPiInfrastructureReadpure function design made testing straightforward — no mocks needed for the core logic, just pass in directories and tool names. - The plan's separation of "static infra dirs at construction" vs "config extras at call time" resolved the timing issue cleanly without requiring runtime rebuilds on config reload.
What caused friction (agent side)
other— AddingpiInfrastructureReadPaths: undefinedtoDEFAULT_EXTENSION_CONFIGbroke 3 existing tests that usedassert.deepEqualagainst inline objects without the new key. Required reading the test failures, understandingdeepEqualsemantics for explicit-undefined-vs-missing-key, then restructuringnormalizePermissionSystemConfigto conditionally set the field. Impact: one extra fix cycle and a commit that combined the fix with the feat.other— Inserting anelsebranch into the external-directory gate insrc/handlers/tool-call.tsopened a brace but didn't close it, causing a parse error. The structural edit required both the opening and closing to be in one edit, but the closing point was ~80 lines away from the opening. Impact: autoformat failure, required reading the affected region and fixing the brace in a follow-up edit.premature-convergence— First attempt at the test file edit (step 3) produced a mangled duplicate test declaration (test("...", () => { // eslint-disable-next-line\n test("...", () => {). The edit tried to insert a comment before a test but duplicated the test header instead. Impact: biome parse error, required full file rewrite.
What caused friction (user side)
- No significant friction from the user side.
The early design question about
npm root -gsafety was well-timed and prevented wasted work.
Changes made
- Added rule to
AGENTS.md§ Configuration about optional config fields andundefinedinDEFAULT_EXTENSION_CONFIG.