test: add unit coverage for permissions module - #49
Conversation
Cover summarizeTool summaries, allow/deny glob matching via checkPermission, and truncateToolResult edge cases.
|
🤖 KlaatAI Review Bot (powered by Klaatu, advisory only — a maintainer makes the real call) Issue matchFully addresses #5. The diff adds Test coverageTests assert exact summary strings and permission outcomes. However, while Correctness concernsNo obvious risks. The VerdictReady to merge as-is, though adding a non-match assertion for This is an automated review to help triage faster, not a gate. Nothing here blocks merging. |
|
One gap worth closing before merge: we test that a command matching the deny list gets blocked, but we don't test that a command not on the deny list is left alone. Right now nothing proves the deny rule is precise rather than accidentally blocking more than it should. Could we add one more case — something like a harmless command (e.g. rm file.txt) checked against a deny list that only contains rm -rf / — and confirm it's not denied? That closes the loop on the pattern-matching behaviour and matches the acceptance criteria in the original issue. |
Summary
src/permissions/index.test.tscoveringsummarizeTool(), allow/deny glob matching throughcheckPermission(), andtruncateToolResult()(closes Add unit tests for src/permissions/index.ts #5).Test plan
bun run typecheckbun testbun run build