test(policy): separate extension proposal grant from action policy - #74
test(policy): separate extension proposal grant from action policy#74seonghobae wants to merge 5 commits into
Conversation
📝 WalkthroughWalkthrough확장 프로그램에 Changes확장 프로그램 변경 격리
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/originweave-policy/tests/extension_mutation_isolation.rs (1)
122-145: 🔒 Security & Privacy | 🔵 Trivial | 🏗️ Heavy lift확장 제안 테스트를 실제 경계와 일치시키십시오.
evaluate_extension_access는ExtensionAgentGrant만 평가하며ActionRequest를 생성하지 않습니다. 현재 확장 제안 어댑터도 없습니다. 따라서assert_extension_can_propose(&grant)와InstructionSource::User요청은 서로 독립적입니다. 실제 어댑터가 추가되면 해당 경로로 정책 결과를 검증하고, 그렇지 않으면 테스트 이름과 설명을 독립된 권한 및 정책 테스트에 맞게 수정하십시오.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/originweave-policy/tests/extension_mutation_isolation.rs` around lines 122 - 145, Update the test around assert_extension_can_propose and the InstructionSource::User ActionRequest so it matches the implemented boundary: evaluate_extension_access only evaluates ExtensionAgentGrant and no extension proposal adapter creates ActionRequest values. Until such an adapter exists, separate or rename the assertions to represent independent grant authorization and policy evaluation; if an adapter is introduced, verify the policy result through that adapter instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/originweave-policy/tests/extension_mutation_isolation.rs`:
- Around line 122-145: Update the test around assert_extension_can_propose and
the InstructionSource::User ActionRequest so it matches the implemented
boundary: evaluate_extension_access only evaluates ExtensionAgentGrant and no
extension proposal adapter creates ActionRequest values. Until such an adapter
exists, separate or rename the assertions to represent independent grant
authorization and policy evaluation; if an adapter is introduced, verify the
policy result through that adapter instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6096f5d0-719c-4310-81fb-6cfe34f5b117
📒 Files selected for processing (1)
crates/originweave-policy/tests/extension_mutation_isolation.rs
Partial implementation of #27.
Buyer/security gap
OriginWeave already has an extension-access decision for
ExtensionAgentCapability::ProposeTypedActionand a separate core action-policy evaluator. There is not yet a production adapter that converts an extension proposal into anActionRequest. This lane therefore proves the currently implemented boundary without implying a nonexistent composition path: the exact extension/session/context grant can independently authorize proposal permission, while ordinary user-sourced action requests remain independently fail-closed under mutation, execution-mode/purpose, crawler/robots, non-delegable-action, and Human-mode policy.Exact scope
This branch is based directly on protected main
67af7c87589edc2039545af335c95064d9b8391c. Current exact head is0d492564aa61c9094f1315ee4e234b46a1e63a6c.The tests explicitly keep the two implemented evaluators separate:
evaluate_extension_accessproves only that the exact extension/session/context grant allowsProposeTypedAction;Submitrequest remains denied asCrossOriginMutationwhen source and target origins differ;Submitrequest remains denied asOriginNotWritablewithout target write authority;CrawlerMutation;ModePurposeMismatch;RobotsDisallowed,RobotsUnknown, andRobotsNotApplicable;LegalConsentremains denied asForbiddenRisk; andHumanModeNotAgentControlled.No production extension-proposal adapter, action source transformation, execution API, or new authority is added. When a real adapter later exists, its composed extension-proposal -> typed-action path must receive a separate integration regression rather than inheriting this independent-boundary evidence.
Review finding and correction
CodeRabbit reviewed predecessor head
ac8b27ee69229070c382ca2199eaf9ec8b1b12dband correctly identified that the prior test naming implied a composition path that does not exist:evaluate_extension_accessevaluatesExtensionAgentGrant, while the test-createdInstructionSource::UserActionRequestis independent. Current head0d492564aa61c9094f1315ee4e234b46a1e63a6caddresses that exact finding by renaming the helper/tests and adding a module-level truth-boundary explanation. No predecessor review or check is transferred to the moved head.Exact-current evidence
For exact head
0d492564aa61c9094f1315ee4e234b46a1e63a6cagainst unchanged protected main67af7c87589edc2039545af335c95064d9b8391c:31464388199: success;31464388200: success;31464388210: success;COMMENTEDreview described above; no later review is transferred or synthesized; andTruth boundary
A Chrome/extension permission remains extension-access permission only. This branch does not prove that a real extension proposal flows through OriginWeave action policy, because that adapter does not yet exist. It does prove that the extension grant evaluator and ordinary action policy independently preserve their documented fail-closed decisions. This test-only PR does not close #27 and does not establish real Chromium extension-to-Agent composition.