Repository navigation
refactor(context-engine): remove owner cleanup helper - #128143
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 4:14 AM ET / 08:14 UTC. ClawSweeper reviewWhat this changesThe PR deletes an owner-specific context-engine registry cleanup helper and changes gateway health tests to snapshot and restore the complete registry state. Merge readinessNo blocking findings: the PR removes a production-only test cleanup export and uses the existing full-registry snapshot boundary for fixture restoration. It remains open for explicit maintainer handling because it is member-authored and carries the protected Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherContext engines are registered in a process-wide plugin registry and feed gateway health reporting. Gateway health tests temporarily register engines and reset quarantine state, then must restore the registry so subsequent tests inherit the original process state. flowchart LR
A[Gateway health tests] --> B[Context-engine registry]
B --> C[Legacy and test engines]
C --> D[Quarantine state]
D --> E[Gateway health response]
A --> F[Registry snapshot and restore]
F --> B
Decision needed
Why: The protected maintainer label and member authorship require explicit maintainer handling even though the code review found no repairable defect. Before merge
Agent review detailsSecurityNone. PR surfaceSource -10, Tests -35. Total -45 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the narrow deletion after normal maintainer approval and exact-head required checks, retaining the existing full-state test-support helper as the sole fixture cleanup mechanism. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a behavior-neutral fixture-ownership cleanup, not a report of a user-facing failure. Is this the best way to solve the issue? Yes. Reusing the existing complete registry snapshot avoids retaining a production export used solely by tests and restores more state than selective owner deletion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 79e675521f7c. 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)
|
|
Maintainer decision: mark ready and keep the exact reviewed head.
ClawSweeper merge-risk item handled: meaningful exact-head validation is complete. The stored-data-model flag is a filename false positive; this patch deletes a production helper and test setup only, with no schema, serialization, migration, or persisted-state format change. The two full-suite exec-approval failures reproduce outside the changed path and on unchanged base/head production blobs. They are not a regression from this PR and should be repaired separately. |
|
Merged via squash.
|
What Problem This Solves
Context-engine registry production code exported an owner-specific cleanup helper solely for test fixture cleanup. Gateway health tests used that helper to delete selected registrations instead of restoring the complete registry state they inherited.
Why This Change Was Made
The owner cleanup export and its quarantine-lifecycle test are removed. Gateway health tests now capture the complete context-engine registry state before registering the legacy engine and resetting quarantine state, then restore that snapshot after each test.
This keeps fixture ownership in the existing test-support boundary without changing runtime context-engine registration, selection, or quarantine behavior. Production delta: +1/-11 (net -10). Test delta: +8/-43 (net -35).
User Impact
No intended user-visible change. Context-engine registry production surface is smaller, and gateway health tests restore shared registry state instead of applying owner-specific cleanup.
Evidence
node scripts/run-vitest.mjs src/context-engine/quarantine-health.test.ts- 3 passed, 3 Linux-only skippednode scripts/run-vitest.mjs src/context-engine/context-engine.test.ts- 65 passednode scripts/run-vitest.mjs src/context-engine/host-param-projection.test.ts- 7 passednode scripts/run-vitest.mjs src/gateway/server-methods/server-methods.test.ts -t "merges live context-engine quarantine state into cached health responses"- 2 passed, 422 skipped; 12.55s wall timeserver-methods.test.tsrun: 422 passed in 655.46s; two unrelated exec-approval tests failed before the changed health block. The timeout reproduced alone in 669.94s without touching the changed fixture.oxfmt,git diff --check, privacy scan, and autoreview passedcheck-changedpassed source guards, formatting, dead-export scanning, core typecheck, and lint. Core-test typecheck stopped on missing shared-install UI dependencies (@panzoom/panzoomandpakotypings).