fix: apply W1-W4 from code review sweep (fixes #26)#36
Merged
Conversation
W1 — Audit protocol-level rejections: decode failures, empty paths, empty command, and empty content_b64 now write an audit row with status=rejected before returning an error envelope. Covers read, write, and exec handlers (7 exit points). W2 — Exec handler canonical path: fs.Check's canonical return is now captured and used in audit targets (allowlist denial + success) instead of the raw cwd. Same pattern as the #24 fix for read/write. W3 — Consistent canonical in read/write error audits: post-allowlist error paths (file_not_found, io_error, file_too_large, unknown mode, create_refused) now record the canonical path in both the audit target and the error_detail — matching the success path behaviour established in #24. The actual I/O calls (Stat, ReadFile, WriteFile) still use the raw p.Path since the OS handles its own path resolution; audit/error-detail use canonical. W4 — Remove dead code: NewFileSystemWithIO was exported but never called anywhere (not even in tests). Also cleaned up its docstring reference in NewFileSystem.
a4aa30f to
e0b587c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses W1-W4 from Quinn's full codebase review, plus fixes the canonicalize bug.
Changes
Verification