Repository navigation
refactor(logging): move diagnostic aggregate test resets into fixtures - #175223
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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. |
|
@clawsweeper re-review The only repair removes diagnostic.ts's orphaned count-one assertion-safety allowance. All four originally reviewed source/test files are byte-identical. Fresh independent review is scoped-clean through P2; the canonical one-file checker confirms zero assertions/zero allowance. Required suppression reproduced the same two untouched baseline mismatches. The body preserves the incomplete local runtime gap and attributes the original ratchet/aggregate failures. Current-head CI remains required. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR moves aggregate diagnostic resets into test fixtures, removes their private runtime facade, and updates recovery coverage to use production timing defaults. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused ownership cleanup, with no introduced correctness or security defect found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway diagnostics collect session activity and memory observations, emit heartbeat events, and request stalled-session recovery; test fixtures reset those owners between scenarios. flowchart TD
A[Test fixtures] --> B[Heartbeat lifecycle]
A --> C[Seven diagnostic reset owners]
D[Gateway scheduler] --> B
E[Session activity] --> B
B --> F[Diagnostic events]
B --> G[Recovery coordinator]
Technical reviewBest possible solution: Retain the fixture-owned reset sequence and default-timing coverage, with the existing exact-head CI gates completing before landing. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor rather than a reported product defect; source inspection confirms the aggregate test facade exists on current main. Is this the best way to solve the issue? Moving sequencing into the existing fixture is a focused solution that preserves leaf ownership, production timing, and heartbeat lifecycle behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 489323a0f01f. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -33, Tests -9, Other -1. Total -43 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 17, 2026, 2:30 AM ET / 06:30 UTC. |
|
Exact-head inherited-failure attribution for 33fff54 (CI run 39009847992). All 128 exact-head check runs were enumerated with paginated commit check-runs: 61 success, 62 skipped, one neutral, two failed, two superseded metadata cancellations. Canceled auto-response117329895585 and context117329844864 have same-head successful replacements117329844940 and117329895028; neither is a missing runtime suite. Security and dependency contexts succeeded. No enforced review remains outstanding.
The main-flakes registry has no matching open signature. The last six completed scheduled main runs were enumerated (39006528379,39002992814,38999305057,38995631641,38991549274,38988964265). Latest baseline bbb775b does not contain introducing8d894498588 (#175077), so those older runs cannot establish this new defect's attribution. Main3fe1f834 and later870fe9fd retain identical owner/declarations; complete source/introducing diff was inspected. The clean-main type replay is running without a result yet, not claimed as completed proof; independent disjoint exact-head PR reproduction supplies the campaign's unrelated-PR signature evidence. The initial owned orphaned assertion-baseline entry was removed in this head; the four reviewed source/test files remain byte-identical to the original signed source head. That earlier failure is not called inherited. Exact-head runtime, remaining type/lint/architecture/security jobs passed. Local incomplete runtime and unrelated suppression replay gaps remain disclosed in the PR body. Standing campaign authority permits the inherited-only exact-SHA landing exception after attribution, and the recorded native infrastructure failures permit the exact-SHA fallback. No CI rerun, green-seeking re-push, arbitrary rebase, suppression expansion, or Phase E change. Completed clean-main reproduction: at main3fe1f834c3a5a7a3699b9ce398403d60fccd5be6, |
The worktree read-pool, plugin cleanup and Solid UI cutovers left 11 unused exports/types or imports that Knip could not follow. Keep live read-operation maps in the same lazy parallel loader, make in-module helpers private, and remove unused forwarding exports and metadata type. Model the existing validator generator in the production Knip graph. Production cleanup moved to clearPluginRunContext in #174872. Remove its unused wrapper and exercise the owner directly; retain namespace isolation and all four scheduler cases. Drop only callback-result forwarding proof for that deleted wrapper. Live cleanup and handler maps are unchanged. Keep the seven diagnostic test seams retained by #175223 and the staged MCP dependencies from #175254; do not add ignores. Proof: 176 focused tests with --maxWorkers=1 passed in 434.17s; core, UI, scripts and affected test type lanes, targeted type-aware/boundary lint, formatting, and validator generation check passed. Production findings drop from 18 to seven intentional test seams; three unrelated full-tree test-support exports and staged dependencies remain.
Mistral bundling keeps its runtime transitives external, but Knip cannot follow the SDK code inside the built AI package. Project the existing externalization policy into the root and AI manifest import graphs. Keep optional peers optional and preserve all manifests and lockfiles. Prove the required schema dependency loads during packaged streaming and the semantic conventions load when optional telemetry peers are present. The original no-peer streaming and SDK-bundling assertions remain intact. Validation: focused package test passed in 11.72s wall time; targeted tsgo, typed lint, boundary lint and format passed; P2 review found no actionable findings. Dependency scan clears all four Mistral entries and retains only the four MCP packages and seven diagnostic hooks explicitly kept by #175254 and #175223. The unused-files audit is clean.
Remove unused API surfaces after the canonical-owner cutovers in #175577, #175069, #175517 and #175538. Current Add deletion admission, credential authority, provider sanitization, reserved-key filtering, workspace exclusion and package lease checks stay at their live owners. Register the two live Gateway benchmark subprocess fixtures. Make internal dependency-evidence helpers and provenance types private; remove obsolete test-only surfaces while preserving explicit probe, warning-cache and 2000-character compaction assertions. Proof: 504 distinct focused cases validated with --maxWorkers=1. The migrated auth-reader fixture initially failed while its synchronous close was still draining; await the existing async close owner, then rerun only its two cases successfully. Core/scripts and five owning type graphs, scoped lint, format and final P2 review pass. Full-tree/script export and unused-file scans pass. Production deadcode still reports only the seven diagnostic hooks retained by #175223 and @modelcontextprotocol/client retained by #175254. No ignores or baseline increases. The all-graph selector reports existing root-count budgets; explicit owning compiler graphs passed without changing that budget.
openclaw#175223) * refactor(logging): move aggregate diagnostic resets into test support * chore(logging): shrink retired diagnostic assertion allowance
The worktree read-pool, plugin cleanup and Solid UI cutovers left 11 unused exports/types or imports that Knip could not follow. Keep live read-operation maps in the same lazy parallel loader, make in-module helpers private, and remove unused forwarding exports and metadata type. Model the existing validator generator in the production Knip graph. Production cleanup moved to clearPluginRunContext in openclaw#174872. Remove its unused wrapper and exercise the owner directly; retain namespace isolation and all four scheduler cases. Drop only callback-result forwarding proof for that deleted wrapper. Live cleanup and handler maps are unchanged. Keep the seven diagnostic test seams retained by openclaw#175223 and the staged MCP dependencies from openclaw#175254; do not add ignores. Proof: 176 focused tests with --maxWorkers=1 passed in 434.17s; core, UI, scripts and affected test type lanes, targeted type-aware/boundary lint, formatting, and validator generation check passed. Production findings drop from 18 to seven intentional test seams; three unrelated full-tree test-support exports and staged dependencies remain.
) Mistral bundling keeps its runtime transitives external, but Knip cannot follow the SDK code inside the built AI package. Project the existing externalization policy into the root and AI manifest import graphs. Keep optional peers optional and preserve all manifests and lockfiles. Prove the required schema dependency loads during packaged streaming and the semantic conventions load when optional telemetry peers are present. The original no-peer streaming and SDK-bundling assertions remain intact. Validation: focused package test passed in 11.72s wall time; targeted tsgo, typed lint, boundary lint and format passed; P2 review found no actionable findings. Dependency scan clears all four Mistral entries and retains only the four MCP packages and seven diagnostic hooks explicitly kept by openclaw#175254 and openclaw#175223. The unused-files audit is clean.
…aw#175673) Remove unused API surfaces after the canonical-owner cutovers in openclaw#175577, openclaw#175069, openclaw#175517 and openclaw#175538. Current Add deletion admission, credential authority, provider sanitization, reserved-key filtering, workspace exclusion and package lease checks stay at their live owners. Register the two live Gateway benchmark subprocess fixtures. Make internal dependency-evidence helpers and provenance types private; remove obsolete test-only surfaces while preserving explicit probe, warning-cache and 2000-character compaction assertions. Proof: 504 distinct focused cases validated with --maxWorkers=1. The migrated auth-reader fixture initially failed while its synchronous close was still draining; await the existing async close owner, then rerun only its two cases successfully. Core/scripts and five owning type graphs, scoped lint, format and final P2 review pass. Full-tree/script export and unused-file scans pass. Production deadcode still reports only the seven diagnostic hooks retained by openclaw#175223 and @modelcontextprotocol/client retained by openclaw#175254. No ignores or baseline increases. The all-graph selector reports existing root-count budgets; explicit owning compiler graphs passed without changing that budget.
…6285) ## What Problem This Solves Fixes: `check-dependencies` fails on main because Knip reports 7 unused `reset*ForTest` exports in `src/logging/diagnostic-*.ts`. #175223 moved the aggregate reset into `diagnostic.test-support.ts`, which Knip's production scan ignores, so the per-module resets lost their only production consumer. ## User Impact No user-visible change. The dependency and export deadcode scans pass again. ## Why This Change Was Made These resets are test-support hooks by design. Each export now carries `/** @internal */`, the pattern main already uses for test helpers (for example `src/infra/container-environment.ts`). The production scan skips them, and the full-tree scan still checks them against their test-support caller. No logic changes. ## Evidence - Before: hourly CI runs 39136213920 and 39140721112 fail `deadcode:dependencies` and `deadcode:exports` with these 7 entries. They first appear in run 39010956087, the first run after #175223. - After: `pnpm run deadcode:dependencies` and `pnpm run deadcode:exports` pass with 0 entries. - `pnpm exec vitest run src/logging/diagnostic.test.ts src/logging/diagnostic-memory.test.ts src/logging/diagnostic-stability.test.ts src/logging/diagnostic.incognito.test.ts`: 94 passed. `oxfmt` and `oxlint` are clean. Co-authored-by: Ayaan Zaidi <[email protected]>
…nclaw#176285) ## What Problem This Solves Fixes: `check-dependencies` fails on main because Knip reports 7 unused `reset*ForTest` exports in `src/logging/diagnostic-*.ts`. openclaw#175223 moved the aggregate reset into `diagnostic.test-support.ts`, which Knip's production scan ignores, so the per-module resets lost their only production consumer. ## User Impact No user-visible change. The dependency and export deadcode scans pass again. ## Why This Change Was Made These resets are test-support hooks by design. Each export now carries `/** @internal */`, the pattern main already uses for test helpers (for example `src/infra/container-environment.ts`). The production scan skips them, and the full-tree scan still checks them against their test-support caller. No logic changes. ## Evidence - Before: hourly CI runs 39136213920 and 39140721112 fail `deadcode:dependencies` and `deadcode:exports` with these 7 entries. They first appear in run 39010956087, the first run after openclaw#175223. - After: `pnpm run deadcode:dependencies` and `pnpm run deadcode:exports` pass with 0 entries. - `pnpm exec vitest run src/logging/diagnostic.test.ts src/logging/diagnostic-memory.test.ts src/logging/diagnostic-stability.test.ts src/logging/diagnostic.incognito.test.ts`: 94 passed. `oxfmt` and `oxlint` are clean. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Diagnostics publish private aggregate reset and timing helpers from production solely for tests, keeping fixture sequencing and a process-global test facade in the runtime owner.
User Impact
No user-visible change or migration. Diagnostic collection, recovery, current authority, memory-pressure handling and shutdown behavior remain unchanged. Public SDK diagnostics controls and real QA timing capability remain available.
Why This Change Was Made
Move aggregate reset sequencing into existing test support: stop the real heartbeat, then call the same seven existing leaf resets in the same order. Delete the orphaned Symbol publication, timing wrappers and exact test-publication inventory entry. The seven independent leaf seams remain for later cuts; this is not their retirement.
The recovery test now exercises the real 120-second warning/360-second abort defaults through the existing fake Gateway scheduler. It retains no-early-recovery, stalled classification/reason/work-kind and recovery argument assertions. No new production export or replacement runtime seam is introduced. Preserve main's newer heartbeat observation lifecycle by applying only qualified contexts.
This is the logging aggregate area slice of the wider shared private-test-facade family. Formatted production adds1/removes34:33 net production lines removed (raw packet30; formatter consolidates the surviving phase import). Tests/support remove8, inventory removes1, the orphaned assertion-safety baseline shrinks by one, overall43 removed. No schema, durability, retention, permission, protocol, config, dependency or Phase E standalone memory change.
Best-effort tradeoffs accepted
No production guard is removed. Tests accept the owner's existing process-lifetime webhook counters rather than resetting them through a private runtime hook. All14 other aggregate consumer suites and seven shared harnesses were read: no cumulative webhook-counter assertion or fresh diagnostic-owner reimport was found. Fixtures now reset their statically imported graph, not the latest Symbol-published graph; executable non-isolated module identity remains a proof obligation.
Introducing #121845 internalized these helpers; it is merged active functionality, not a dormant foundation. Exact-name open-PR searches found no activation dependency. The separately reported diagnostic semantic-progress suspicion was disproved and is not changed here.
Evidence
Release-note context: internal diagnostic test ownership cleanup, no user-visible behavior change.