Repository navigation
refactor(qa): reuse canonical process-counter parsers - #140527
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 6, 2026, 8:13 PM ET / September 7, 2026, 00:13 UTC. ClawSweeper reviewWhat this changesQA Lab replaces private Windows process-counter parsers with existing Plugin SDK helpers while preserving CPU and memory measurements. Merge readiness✅ Ready for maintainer review Keep open as useful, maintainer-requested cleanup that remains absent from current main. The reviewed patch preserves behavior, with no actionable correctness or security findings. Priority: P3 Review scores
Verification
How this fits togetherQA Lab samples the Gateway process and its descendants during testing. Its process-tree reader converts operating-system counters into aggregate CPU time and memory usage. flowchart LR
A[Gateway process ID] --> B[Process snapshot reader]
C[Windows process counters] --> B
D[POSIX process counters] --> B
B --> E[Validate IDs and measurements]
E --> F[Sum process descendants]
F --> G[QA CPU and memory metrics]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -19. Total -19 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing SDK parsers as the single numeric-validation contract while retaining QA Lab's public metric semantics. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes duplicate parsing logic without claiming a user-visible defect; source comparison supports equivalent behavior. Is this the best way to solve the issue? Yes. Reusing already-exported SDK helpers removes duplication without expanding the API or changing accepted inputs and public results. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a03450435fe. 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)
|
3a77491 to
a320362
Compare
|
Merged via squash.
|
Related: #135868
What Problem This Solves
QA Lab carries private process-counter parsers that duplicate helpers already provided by its existing Plugin SDK import. This is maintainer-requested cleanup for the #135868 split campaign and extracts no feature content from that PR.
Why This Change Was Made
Use the canonical positive/nonnegative integer parsers for Windows process IDs and the canonical finite-number sign check for CPU/RSS counters. Only the private absence checks change from null to undefined; the public readers still return number or null.
Before this change, the complete owner matches stable v2026.9.2. The deleted helpers have only local callers, and the existing SDK barrel already exports their replacements. No compatibility, process-ownership, SDK, configuration, or storage contract is removed.
User Impact
No intended behavior change. QA metrics retain strict decimal safe-integer process IDs, fractional and large finite counters, accepted exponent-form metrics, zero values, rounding, and descendant aggregation. Subprocess commands, trusted PowerShell selection, timeouts, and POSIX parsing remain unchanged.
Evidence
node scripts/run-vitest.mjs: Windows process snapshots, POSIX CPU/RSS parsing, and canonical number coercion.node scripts/check-changed.mjsplan passed in 329.66 seconds on clean Linux Blacksmith Testbox (run 34067942680, leasetbx_01m1wj0d2r51fzz2rkta0gs3gp, stopped). Extension and extension-test types, lint, Doctor contract checks, zero dead exports and zero runtime cycles passed. All nine recorded inputs remained unchanged through the main rebase; no lockfile change.Production +14/−33, net −19; one private plugin file, 270→251 lines. Tests, tooling, docs, and baselines unchanged. No build, packaging, dynamic import, new SDK path, or published API change.
ClawSweeper completed its review of the same patch with no correctness or security findings and no before-merge/rank-up requests. Initial exact-head CI 34068374981 passed (35 successful jobs, 16 expected skips). The final landing rebase only picked up unrelated agent-turn test fixtures; all nine proof inputs/lock stayed unchanged, all 39 tests passed again, and fresh branch review was clean. Final-head CI is required before merge.
Final exact-head CI 34068805999 is green on
a320362cb8563a7cc875de376e69f94e2c480d3d: 35 successful jobs, 16 expected skips; canonical watcher GREEN. No test retry or source repair was needed.