Repository navigation
fix(core): restore permission decision diagnostics - #56271
ZXLyyds100 wants to merge 4 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The fix works. I ran the #56247 reproduction (simulated model, a shell ask rule answered with Allow once) from source on the base and on this branch. On the base the log has no permission lines. With this change it gets permission evaluated, permission asking and permission replied lines tagged role=server, with matching per_… IDs and no command text or metadata. bun test test/permission.test.ts (114 pass) and the packages/core type check both pass.
The public API is unchanged: this only adds Info log lines.
The deny, ask and allow results and what the permission.evaluate hook receives are the same as before. Replies are logged only after the event is published, and error handling is unchanged.
Two small points, inline: the new tests could be simpler, and the logged rule number is hard to trace back to the user's config.
|
AI-assisted follow-up: merged Local verification: 6,671 pass, 43 existing skips, 0 failures, plus 1,160 randomized permission tests alongside the full suite. Core typecheck, root GitHub now reports |
|
Resolved the current dev conflict in Permission tests: 1,330 passes across ten randomized runs. Root check: 35/35; core TypeScript: passed. The full core run recorded 7,193 passes, 36 skips and 10 failures: three shell failures reproduce on unchanged dev, and seven Session timeouts did not recur in the focused rerun. This is not a fully green core suite. The branch is now conflict-free. Could a maintainer approve the pending workflows and review the update when convenient? AI-assisted follow-up. |
Issue for this PR
Closes #56247
Type of change
What does this PR do?
Restores V2 Info-level permission evaluation, ask and reply diagnostics. Authorization is unchanged; resources, rulesets, metadata, hook messages and feedback stay private.
Evaluations separate the effective and pre-hook decisions. The zero-based rule index (
-1for default) includes agent/session rules and consulted saved approvals. Asks/replies share session/request identifiers.How did you verify your code works?
Current head:
4bb78ffad818f4148f7212e3d78a023f520f0de7(November 4). The latest dev synchronization, validation and remaining limits are recorded in this follow-up. That updated full core run was not fully green: it recorded 7,193 passes, 36 skips and 10 failures; its baseline controls and focused rerun are disclosed in the follow-up. The zero-failure results forbfa44c2below are historical and must not be read as results for this head. No project tests were rerun for this description clarification, and hosted workflows still require maintainer approval.bfa44c2mergesdevat6bac3b9, retainingLogger, upstreamSchema, metadata sanitization and its encoding regression.On macOS, Bun 1.4.2 and task-local Bash 5.3.20, with isolated HOME and temporary directories:
bun typecheck, rootbun run check(34 tasks), Prettier andgit diff --check: pass. Lint: 1,306 non-blocking warnings, none in the changed files.Two initial config-discovery failures disappeared after moving TMPDIR outside personal ancestor directories, without source changes, retry flags or timeout increases. These are local results, not hosted CI.
Screenshots / recordings
No UI change. Historical boundary capture: real permission service, SQLite and file logger; synthetic fixtures, no live model or HTTP/TUI end-to-end run. Eight identical decisions: zero diagnostics before, sixteen after, no private sentinel leakage.
5.8-second comparison · Runnable reproduction and original logs
Captured on
101ec31; not recaptured for this refresh.Checklist
Visual
Release illustration only, not a screenshot or runtime recording. The real historical before/after evidence and its source SHA remain above.
AI assistance
Implementation, tests and this description used AI assistance. Automated self-review does not replace independent maintainer review. The verification above retains its original source head and dates; this description-only update does not claim a new project-test run.