POK-46: Normalize Windows subtree scope paths#50
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3de4f8115d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| subtree(path.join("~", ".kube")), | ||
| subtree(path.join("~", ".docker")), | ||
| appendFsSubtreeSuffix(POKOCLAW_SYSTEM_DIR), | ||
| appendFsSubtreeSuffix(path.join("~", ".ssh")), |
There was a problem hiding this comment.
Expand Windows home-relative hard-denies
On Windows, this default is built from path.join("~", ".ssh"), which produces ~\.ssh, and the new subtree helper turns it into ~\.ssh/**. normalizePolicyPath only expands ~/ and not ~\, so this hard-deny normalizes relative to process.cwd instead of the user's home; reads/writes under C:\Users\<user>\.ssh (and the same home-relative secret dirs below) are therefore not blocked by the system policy on Windows. Build these defaults with a form expandHomePrefix handles, or teach it to expand ~\.
Useful? React with 👍 / 👎.
|
@claude help me review |
|
Claude finished @danielwpz's task in 1m 37s —— View job PR Review: POK-46 Windows Subtree Scope PathsSummaryThe implementation is solid overall. Here's my detailed analysis: What's Done Well
Issues Found1. Dead code:
|
|
@claude Please take another pass on this Windows subtree-scope PR against the current upstream main. Focus on whether the subtree scope normalization is still correct with the latest code, and identify any concrete follow-up changes needed on this branch. |
|
@claude Please review this Windows subtree-scope PR again. This is a maintainer-triggered retry after the Claude workflow routing change; treat this comment as the review request. Focus on whether Windows subtree scope normalization is still correct against current main, and call out any concrete code or test changes needed on this branch. |
Review: POK-46 Windows subtree scope normalization
Verdict: Mergeable. The changes are correct, well-scoped, and the normalization chain is complete. The concerns above are maintainability/coverage notes, not correctness blockers. |
|
@claude Please take another pass on this Windows subtree-scope PR now that I have collaborator access. Focus on whether the subtree scope normalization is still correct with the latest code, and identify any concrete follow-up changes needed on this branch. |
Review: POK-46 Windows subtree scope normalization (second pass)The core normalization is correct and complete. Every entry point normalizes to
Verdict: Mergeable. The normalization is correct, the previously flagged |
|
Added a collaborator follow-up commit 8e23f05 to keep the Windows home hard-deny test aligned with runtime path normalization. This preserves the original contributor commits and only fixes the macOS realpath-sensitive assertion. Validation: local preflight passed on the PR branch; merged the updated PR head into current main in a temporary worktree with no conflicts; targeted security tests, build, and related lint all passed. GitHub CI is now green for lint/build, linux tests, and macOS tests. |
Summary
Implements the filesystem subtree scope normalization piece split out as POK-46 from the Windows compatibility work in PR #39.
appendFsSubtreeSuffix()helper that always emits the stable internaltarget/**form instead of platform-specifictarget\**.\**filesystem scope inputs and normalizes them to the internal/**suffix.C:\**.Validation
pnpm test -- tests/security/scope.test.ts tests/tools/permission-block.test.tspnpm buildpnpm exec biome lint --error-on-warnings src/security/scope.ts src/security/policy.ts src/tools/helpers/permission-block.ts src/orchestration/subagents.ts tests/security/scope.test.ts tests/tools/permission-block.test.tsNote: full
pnpm test/ pre-commit preflight still fail on native Windows for existing platform issues unrelated to this PR, including POSIX path expectations, symlink permission failures, and sandbox-runtime unsupported-on-Windows paths.