mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
2.0 KiB
2.0 KiB
issue, issue_title
| issue | issue_title |
|---|---|
| 57 | Replace SessionApprovalCache with session Ruleset |
Retro: #57 — Replace SessionApprovalCache with session Ruleset
Final Retrospective (2026-05-03T21:10:00-04:00)
Session summary
Replaced SessionApprovalCache (directory-prefix matching via isPathWithinDirectory()) with SessionRules (a plain Ruleset evaluated via evaluate() / wildcardMatch()).
Five commits landed matching the five TDD steps in the plan, plus the docs commit.
Released as v3.10.0 with no user-visible behavior change.
This unblocks #51 (generalize session approvals to all permission surfaces).
Observations
What went well
- The plan-to-implementation mapping was 1:1 — every TDD step produced exactly one commit with the suggested message.
- The wildcard semantics concern (sibling directory false positive) was validated immediately by the
session-rules.test.tsintegration tests.wildcardMatch("/other/project/*", "/other/project-b/foo.ts")correctly returns false because the regex is anchored. - The
evaluate()integration approach (checkingsessionRuleset.includes(sessionMatch)to distinguish a real match from a synthetic default) was clean and required no special-casing.
What caused friction (agent side)
missing-context— The plan identifiedtests/handlers/lifecycle.test.tsandtests/handlers/tool-call.test.tsas the test files needing mock updates, but missedtests/handlers/before-agent-start.test.tsandtests/handlers/input.test.ts, which also constructmakeRuntime()helpers withsessionApprovalCache. Vitest (esbuild) does not typecheck, so the stale mocks compiled and ran without error. The mismatch was only caught bynpm run build(tsc) during the final verification step. Impact: required amending the "remove SessionApprovalCache" commit to include two additional test file updates. Self-identified during thetscstep.
What caused friction (user side)
- No friction observed — the session required no user intervention beyond the standard autoformat hooks.