fix: warn when write globs match no existing files - #24
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesDry-run permissions warning
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
@relayflows/coredelegates permission compilation to@agent-relay/cloud: seepackages/core/src/provisioner.ts:412. The installed cloud compiler retainsreadwritePatterns, but builds token write scopes and mount ACLs from the project walk's concretereadwritePaths. Consequently,files.write: ["impl.txt"]collapses to zero effective write access whenimpl.txtdoes not exist.This PR adds the correct local safety behavior in
packages/core/src/runner.ts:3081-3090: dry-run now warns when write patterns are present but resolve to zero existing writable paths. Regression coverage is inpackages/core/src/__tests__/permissions-integration.test.ts:665-696.Dry-run reproduction
Using the reported restricted configuration with one readable fixture file and
gate.shpresent butimpl.txtabsent:Before, with the production change stashed:
After:
The count remains zero because the runtime authorization defect is in
@agent-relay/cloud; this core change makes that unsafe outcome visible instead of silent.Required
@agent-relay/cloudchangeThe actual fix belongs in the cloud permission compiler (
compileAgentPermissions/resolveAgentPermissions):readwritePathsshould remain an existing-file summary, not the sole authorization input.readwritePatterns(for examplerelayfile:fs:write:/impl.txt) rather than only fromreadwritePaths; enforce the same globs for create operations.impl.txtinto a writable parent-directory ACL, because that would grant sibling files.Verification
The regression was also proved against the source change: after stashing only
src/runner.ts, the new test failed on the missing warning; after restoring it, the test passed.I attempted the requested unfiltered
cd packages/core && bunx vitest run, but it did not complete:run-script.test.tsreachedfalling back to npx tsxand hung. The task baseline notes 9 pre-existing failures in that file onmain; I did not modify or attempt to fix them. No green full-suite claim is made here.🤖 Generated with Claude Code