Repository navigation
refactor(gateway): consolidate session method policy - #156071
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 10:41 PM ET / September 23, 2026, 02:41 UTC (Revision 3). ClawSweeper reviewWhat this changesConsolidates Gateway session-method classifications into one table while preserving session targeting, profile requirements, approval handling, and run-start checks. Merge readiness✅ Ready for maintainer review Keep open as a useful, behavior-preserving refactor. The pinned diff preserves the existing classifications and special cases; no actionable correctness or security finding remains, and current main still uses the separate collections. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway classifies incoming RPC methods before resolving session targets and applying authorization. This shared policy also supplies method metadata without loading session storage. flowchart TD
A[Incoming RPC method] --> B[Shared session policy]
B --> C[Profile requirement metadata]
B --> D[Session target resolution]
B --> E[Approval and run-start classification]
C --> F[Gateway authorization]
D --> F
E --> F
F --> G[Reject or dispatch request]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -79. Total -79 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one lightweight policy table behind the existing predicates, preserving all current authorization classifications and explicit special cases. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses duplicated policy definitions rather than a reported runtime defect; source comparison confirms the duplication and preserved classifications. Is this the best way to solve the issue? Yes. Consolidating the existing data behind unchanged predicates removes repeated policy ownership without expanding APIs or coupling metadata discovery to storage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 718027889d76. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
|
Merged via squash.
|
What Problem This Solves
Six separate Gateway method-classification collections repeat the same method names, making their session policies harder to keep aligned.
User Impact
This is an internal refactor with no intended behavior change. Session target fields, required targets, profile dependence, approval handling, and run-start participation keep their existing behavior. No schema or protocol changes are introduced.
Why This Change Was Made
One per-method map now supplies the existing narrow policy predicates. The conditional goal-resume rule and batch-patch special case remain explicit. This removes 79 application lines from one file without changing tests or consumers. Related: #150153.
Evidence
The qualified head is
49c83c855987445ff973cb3eedb196134178aad1, tree8462c04bd9f1dbce2a6377b0ec2e3a0678e5fdce, based on landed main9e998a3a3c7aafa29381ef48f06a22750de677cc. The policy file on the later lookup landing is unchanged from that base.All 31 existing Gateway tests passed before and after the refactor. The classification comparison passed 7,452 assertions, and the full selected changed-file gate passed in 500.93 seconds. Independent P0–P2 review found no actionable issue. The only post-review difference restores an existing explanatory comment; executable source is unchanged. Formatting and diff checks pass.
Exact-head CI run 35807889504 passed: 119 successful jobs, 17 skipped, and the required CI gate succeeded. Preflight checked merge
3d12e2b0d245ca4c2315a4c3f6374e7d1024b817, with the exact candidate as its second parent. The completed ClawSweeper review found no correctness or security issue. Native preparation and merge admission passed, and the exact candidate landed asf08559c33cb2c3214566cd3e61d3d495ba9fa4a1. The actual one-file merge-parent delta is byte-identical to the qualified patch; native receipt and ownership-scoped cleanup are complete. No package publication or deployment is claimed.