Repository navigation
test: exercise core operation owners at module boundaries - #175989
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa5278d959
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| vi.mock("./external-auth.js", async (importOriginal) => { | ||
| const actual = await importOriginal<typeof import("./external-auth.js")>(); |
There was a problem hiding this comment.
Replace the broad partial module mock
When an auth-profile test imports this support file, it replaces the production module with an importOriginal() plus namespace-spread partial mock. This eagerly couples the suite to the full module graph and lets future exports or initialization silently inherit mocked-module behavior—the exact import-bound pattern prohibited by the scoped test rules. Preserve native composition through an explicit factory or narrow helper and mock only that owner.
AGENTS.md reference: src/agents/AGENTS.md:L11-L12
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR moves core test controls to module boundaries and drains accepted asynchronous work before teardown. Example: An OAuth coordination test exits while a refresh is held.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: the fixture improvements are useful, but both previously reported auth partial-mock violations remain unresolved. Priority: P3 Before merge
Findings
Agent review detailsHow this fits togetherThese fixtures exercise auth, Gateway startup, secrets, session migration, and CLI owners using synthetic inputs and controlled I/O; production behavior remains unchanged. flowchart TD
A[Test scenarios] --> B[Module boundary fixtures]
B --> C[Auth and session owners]
B --> D[Gateway startup owners]
C --> E[Controlled external I O]
D --> E
C --> F[Tracked work settlement]
D --> F
Technical reviewBest possible solution: Retain the boundary improvements, reuse the existing external-auth test adapter while runtime cuts are parked, and restore a closed cancellation mock. Do we have a high-confidence way to reproduce the issue? Source inspection establishes both scoped test-policy violations; no production defect is claimed and no target code was executed. Is this the best way to solve the issue? The module-boundary migration preserves useful lifecycle scenarios, but the two broad auth mocks should use the existing narrower owners. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ed2de46114ea. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceTests +443, Other -1. Total +442 across 39 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed October 17, 2026, 11:22 PM ET / October 18, 2026, 03:22 UTC (Revision 3). |
Synchronize startup fixtures on actual entry and preserve stable module mock identities. Retire only the stale-WHAM historical-order expectation explicitly superseded by the accepted best-effort contract in #174632; retained recovery and current-credential security cases stay unchanged.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a448fcad6b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| vi.mock("./oauth-manager.js", async (importOriginal) => ({ | ||
| ...(await importOriginal<typeof import("./oauth-manager.js")>()), |
There was a problem hiding this comment.
Replace the broad OAuth manager partial mock
When this cancellation suite loads oauth-manager.js, spreading importOriginal() eagerly couples the test to the manager's full module graph and silently makes every future export part of the mocked module. Mock the narrow owner explicitly instead of retaining this broad partial mock, as required by the scoped agent-test guardrail.
AGENTS.md reference: src/agents/AGENTS.md:L11-L12
Useful? React with 👍 / 👎.
|
Reviewed the two partial-mock suggestions on the current head. I am retaining these fixtures: both preserve the real module namespace and replace only the factory consumed by the scenario. The external-auth fixture delegates to the actual factory with the same resolver fallback; the cancellation fixture exercises the real OAuth resolution path while controlling the manager result and synthetic store at their existing module boundaries. The scoped guidance says to avoid broad partial mocks, but these reports identify neither a broken contract nor a measured import-cost regression. A closed manual export list would discard namespace completeness, while a new production injection helper would reintroduce the test-only seam this campaign is removing. The tradeoff here is deliberate: retain real namespace composition and the existing cancellation/auth assertions without another production test surface. Exact-head CI39092911682 is green at a448fca. No production behavior or guard is removed in this fixture-first slice. |
|
Merged via squash.
|
Moves openclaw CI macOS jobs to the macOS 27 (`xcode-27`) runners; Swift CodeQL stays on macos-26-intel until github/codeql#22742 adds macOS 27 tracing. Deployment floors stay explicit (native app macOS 26.2, shared Swift packages macOS 15, Tauri macOS 13.0). Admin-merged with three exact-head failures that are inherited from main and not changed by this PR: control-ui-performance (chat boot gzip 1,490,252 B vs 1,490,000 B ceiling, identical on base and head), the OpenAI Decision platform case (matches pinned-main job 117822757020), and the startup-core fixture cold-import race introduced on main by #175989. Autoreview scoped-clean through P2.
…75989) * refactor(auth): remove private external profile test resolver * refactor(gateway): bind startup leaf operations at their owners * refactor(gateway): call the real post-attach sidecar owner * refactor(doctor): remove constant migration environment supplier * refactor(plugin-sdk): narrow private transcript projection capability * refactor(sessions): call startup maintenance owners directly * refactor(tools): call native gateway owners directly * refactor(auth): remove the private refresh queue reset * refactor(agents): use the real payload logger environment and writer * refactor(cli): read cron input from the real stdin boundary * test: preserve fixture initialization while resolving lint diagnostics * test: align operation-owner fixtures with their module boundaries Synchronize startup fixtures on actual entry and preserve stable module mock identities. Retire only the stale-WHAM historical-order expectation explicitly superseded by the accepted best-effort contract in openclaw#174632; retained recovery and current-credential security cases stay unchanged. * chore: shrink obsolete core seam baselines * test: retain core fixtures while parking unproved runtime cuts
Moves openclaw CI macOS jobs to the macOS 27 (`xcode-27`) runners; Swift CodeQL stays on macos-26-intel until github/codeql#22742 adds macOS 27 tracing. Deployment floors stay explicit (native app macOS 26.2, shared Swift packages macOS 15, Tauri macOS 13.0). Admin-merged with three exact-head failures that are inherited from main and not changed by this PR: control-ui-performance (chat boot gzip 1,490,252 B vs 1,490,000 B ceiling, identical on base and head), the OpenAI Decision platform case (matches pinned-main job 117822757020), and the startup-core fixture cold-import race introduced on main by openclaw#175989. Autoreview scoped-clean through P2.
Consolidate matching test fixtures under shared owners while preserving fresh state, real authority, cleanup ordering, all 3477 assertion chains, 825 registrations and 131 module mocks. Remove the unused private OAuth reset wiring retired by #175989. Refresh admission, cohort settlement, cancellation and serialization remain unchanged. This 361-net-line stack uses the authorized 100+ residue exception; no public contract or persisted shape changes.
Consolidate matching test fixtures under shared owners while preserving fresh state, real authority, cleanup ordering, all 3477 assertion chains, 825 registrations and 131 module mocks. Remove the unused private OAuth reset wiring retired by openclaw#175989. Refresh admission, cohort settlement, cancellation and serialization remain unchanged. This 361-net-line stack uses the authorized 100+ residue exception; no public contract or persisted shape changes.
What Problem This Solves
Core fixtures replace private production operations through injection bags and global test controls. This remaining slice moves those fixtures to the actual module boundaries and keeps accepted asynchronous work drained before teardown.
User Impact
No production behavior changes. The current candidate has zero production diff against its merge base: all runtime files and both quota E2E files match main. Public contracts, security and credential authority, durability, FIFO ordering, cancellation and shutdown settlement remain unchanged. The Phase E standalone session-memory backend and all its machinery and tests are untouched.
What Changed
Preserve real module namespaces while controlling the consumed exports, use real stdin for CLI input proof, and connect startup fixtures to stable callable bindings and actual entry gates. Keep existing assertions, tables, timeout values and teardown contracts. Six callers explicitly bind the unchanged owners' required arguments through the same mocked modules, including the pending update factory's asynchronous module-load gate.
Current effective delta: 39 paths; zero production lines changed; 443 test/support lines added; one obsolete mock-baseline entry removed; 442 lines added overall. This is fixture migration, not production-deletion credit. The additional support code maintains real startup, credential and lifecycle proof; it is not counted as cleanup LOC.
Best-effort tradeoffs accepted
deslop/z19-parked-core-runtime-proof-20261015at3c3101ac8ada64b0ef01d79cc0edc32f9fad4b38. It is not represented as landed or proven by this PR.CI Attribution and Reduction
Run39090049569 at701901677fe1ac047ab584effb775a3ab58bc80d completed with three failing jobs and its downstream gate:
The qualified union is exactly18 files:16 production and two quota files. All18 were restored byte-for-byte to freshly fetched main9b707074b5f231f6976456ea7431567893fe7d1c; forty unrelated fixture paths were not blanket reverted. The necessary existing global test publication and assertion tuple were restored consistently. No failure is called inherited merely because its test filename was unchanged, and no admin exception is requested on the original red head.
Evidence
The seven-root restored-contract semantic typecheck passed26.979s; matching six-file lint passed116.296s; formatting passed0.388s and whitespace checks pass. Fresh independent26-path restoration/compatibility review completed scoped-clean throughP2 (correctness0.94). Mandatory suppression proof passed14/14 in143.401s. Earlier unchanged fixture namespace/entry repairs retain their scoped reviews and focused type/lint proof. Author simplification retained only the exact runtime reduction and required call-shape/inventory consistency repairs; there is no blanket unrelated-fixture rollback.
The focused backup replay reached Vitest and a cold worker-cache miss before any case completed. Its owned processes were stopped and joined after211.141s under the campaign's local build budget. That is incomplete runtime proof, not a passing replay, timeout diagnosis or baseline attribution. No local E2E, broad build, timeout increase, retry, skip, suppression or preparation bypass was used. Runtime, architecture and broad gates remain the reduced head's hosted-CI proof.
Current Exact-head CI
Reduced head a448fca completed CI39092911682 GREEN, including all PostgreSQL conformance jobs and aggregate gate117576977218. The full122-check census has no failed or unfinished test jobs; one cancelled label check belongs to auxiliary metadata, not cancelled suite proof. Required CI/dependency/security status contexts are successful. No inherited-failure exception, CI rerun or green-seeking push is used.
Two review suggestions about namespace-preserving partial mocks were inspected and declined with the reasoning in comment6254430096: these fixtures override only the consumed factory at its existing module boundary, preserve real exports and assertions, and do not justify another production test seam or a closed manual export list. The review reports name no concrete behavior failure or measured import-cost regression. Source remains unchanged after the previously completed independent restoration review.