Repository navigation
refactor(gateway): consolidate doctor test fixtures - #118478
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 1:11 AM ET / 05:11 UTC. ClawSweeper reviewWhat this changesThe PR replaces repeated Gateway doctor-memory test invocation plumbing and dream-memory fixture construction with typed shared helpers in the doctor RPC test suite. Merge readinessThis is a focused, test-only cleanup that preserves the doctor RPC test contract while consolidating repeated invocation and fixture setup. The refreshed head has no actionable correctness or security finding; keep it open for normal maintainer merge review. Likely related people: Priority: P3 Review scores
Verification
How this fits togetherGateway doctor RPC handlers process diagnostic and memory-maintenance requests using runtime configuration, optional scheduler data, and the memory subsystem. This PR changes the test harness that supplies those inputs and checks the handlers’ responses; production request handling is unchanged. flowchart LR
Client[Diagnostic RPC request] --> Handler[Gateway doctor handler]
Handler --> Runtime[Runtime configuration]
Handler --> Scheduler[Optional scheduler status]
Handler --> Memory[Memory maintenance services]
Memory --> Reply[Diagnostic response]
Tests[Shared test helpers] --> Handler
Before merge
Agent review detailsSecurityNone. PR surfaceTests -156. Total -156 across 1 file. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the shared test helpers if the final exact-head merge and required checks remain clean; retain the handler-facing test cases and their existing response assertions as the canonical behavior contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test fixtures rather than reporting a user-facing defect. The relevant verification is preservation of the existing doctor-handler test contract, which source comparison supports. Is this the best way to solve the issue? Yes: a single typed invocation helper with conditional cron context matches the current handler boundary and removes duplicate fixture shapes without changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b58b2057a340. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
2aa706e to
63b89fe
Compare
|
Merged via squash.
|
What Problem This Solves
The 1,867-line doctor RPC test suite repeated method invocation plumbing, memory-manager mocks, and dense dreaming-entry fixtures. That repetition made the suite harder to audit while extending doctor memory behavior.
Why This Change Was Made
This maintainer-requested cleanup replaces the repeated setup with one typed doctor invocation helper plus typed memory-manager and dreaming-entry fixture builders. It preserves all 45 test titles and their order, exact request parameters, cron-context presence, response assertions, status/error strings, mocks, environment handling, and cleanup. Production code and product behavior are unchanged.
AI-assisted: yes. The diff was implemented and verified with Codex, including an isolated
gpt-5.6-solxhigh autoreview.User Impact
No user-visible impact. Maintainers get the same doctor RPC coverage with 156 fewer net test lines and fewer fixture shapes to keep synchronized.
Evidence
origin/mainbefore rebase.git diff --checkpassed; all 45describe/ittitles and order compare exactly withorigin/main.gpt-5.6-sol, xhigh, one pass, TruffleHog clean, no findings, patch correct at 0.99 confidence.