Skip to content

refactor(status): share plugin health section assembly - #155390

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/plugin-health-section-assembly-20260921
Sep 22, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/plugin-health-section-assembly-20260921

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Six plugin-health status categories repeat the same rule: omit empty sections, report the full count, and render only the first eight rows.

User Impact

No user-visible change is intended. Section and row ordering, full counts, the eight-row limit, and category-specific text remain unchanged. Empty sections do not format rows, and entries beyond the limit are not formatted. Diagnostics placement and disabled-plugin grouping retain their existing behavior.

Why This Change Was Made

Keep the repeated section-assembly policy in one private appendSection helper inside the existing status formatter. Each category keeps its own row formatter and defaults. No public API, imports, configuration, or stored shape changes are introduced.

Production changes are +36/−55 lines, net −19. Tests add 167 lines across three public-formatter cases. This is a mechanical internal refactor; no changelog entry is required.

Evidence

  • Independent source review accepted the extraction and its ordering, count, rendering-limit, lazy-formatting, and error-propagation invariants.
  • Matched whole-production-file SCB score: 41.139 → 37.118; cloned SLOC: 24 → 15; raw cyclomatic complexity: 91 → 88; cognitive complexity: 67 → 57. Logical SLOC was 287 → 276. High-complexity counts remained one per measure, and 36 unchanged function instances retained their measured values.
  • SCB compared the production source pair only, with tests excluded. Cloned SLOC is a line measure, not a clone-group count. These structural measurements do not establish correctness or runtime performance; no speedup is claimed.
  • Paired remote proof ran the complete src/status/status-plugin-health.test.ts suite with identical expanded tests: 23 baseline and 23 candidate cases passed, for 46 test executions. The canonical gate for src/status/status-plugin-health.ts and src/status/status-plugin-health.test.ts passed all 31 checks.
  • Independent closeout verified restored source, all 201 install inputs, normal raw-index equality, gate-index semantics, and all three archived index snapshots. The remote command completed with exit 0, and its one-shot lease stopped as completed.
  • Baseline/candidate process wall times were 1.928s/1.362s, including startup and cleanup; inner Vitest durations were 935ms/455ms. The gate took 1428.271s. These single, fixed-order measurements do not establish a speedup or live plugin-loading behavior.
  • The outer local controller returned 70 when shared Git config changed: its prior bytes remained intact with a 122-byte branch-tracking addition. Later current-state observations matched the recorded source, index, and protected evidence, but cannot reconstruct the interrupted historical post-check; the config writer remains unknown. A later diagnostic returned 1 because its summary parser missed one unindented row; independent full-log verification confirmed all 31 checks. A separate portal-sync deadline warning remains recorded.
  • Scoped automated static review reported no P0–P2 findings and assessed the patch as correct with 0.99 confidence. Broader caller/runtime, transitive type, and test-runner contexts were omitted; the review executed no tests and does not override the controller outcome above.
  • Hosted CI attempt 1 passed for head 0b4cf2f0e5d7dc72b33c15d8405cc2be3cd6a575: all 130 jobs were terminal, with 113 successful and 17 skipped. The tested merge checkout was e6cd9637eb69942f7de04cbee0389409e7bbc952; this is separate from the paired proof above.
  • The durable ClawSweeper review covers that same head and reports no findings, security issues, pre-merge actions, or rank-up moves, with a positive best-fix judgment. That review executed no tests.
  • Native landing completed on 2026-09-22 at 10:21:30 UTC, preserving the reviewed source at head 0b4cf2f0e5d7dc72b33c15d8405cc2be3cd6a575 and landing squash commit 0ed077d468ce. This does not change the historical controller limitation above.

@vincentkoc vincentkoc self-assigned this Sep 22, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 22, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 22, 2026 03:20
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 1:28 AM ET / 05:28 UTC (Revision 2).

ClawSweeper review

What this changes

Consolidates six plugin-health report sections into a private helper and adds formatter tests preserving existing text, ordering, counts, and row limits.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, behavior-preserving cleanup absent from current main. The reviewed patch has no actionable correctness or security findings, and the prior review identifies no unresolved follow-up.

Priority: P3
Reviewed head: 0b4cf2f0e5d7dc72b33c15d8405cc2be3cd6a575

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving extraction with useful formatter coverage, successful hosted CI, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored internal refactor is exempt from the external-contributor proof gate. Reported paired formatter tests support output preservation but do not demonstrate live /status plugins collection; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored internal refactor is exempt from the external-contributor proof gate. Reported paired formatter tests support output preservation but do not demonstrate live /status plugins collection; no stored-data contract changes.
Evidence reviewed 8 items Introduced change preserves formatting semantics: The pinned introduction delta replaces six repeated conditional blocks with the same nonempty check, full count, slice-before-format operation, and category-specific text. Diagnostics retain their position; disabled-plugin grouping remains separate.
Cleanup remains absent from main and latest release: The formatter has identical blob identity e3d297b22eaa9be37955e03947c7f0b321aaa4e9 at the introduction base, fetched main, and supplied latest release v2026.9.5. Inspection of the release blob confirms that it still contains the repeated assembly blocks.
Public formatter coverage: Read the complete formatter test module. Three added cases cover empty output, mixed sections with defaults and diagnostic ordering, and nine records per category with full counts but eight sorted rows; the latter two also verify unchanged input. They exercise the existing formatter without adding production test seams.
Findings None None.
Security None None.

How this fits together

The plugin-health formatter converts installed and running plugin diagnostics into the chat reply for /status plugins. The command handler controls access and collects the snapshot before formatting it.

flowchart TD
  A[Status plugins command] --> B[Authorization and command settings]
  B --> C[Installed and runtime health snapshot]
  C --> D[Sort and classify health records]
  D --> E[Shared bounded section assembly]
  E --> F[Detailed chat reply]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -19, Tests +167. Total +148 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 36 55 -19
Tests 1 167 0 +167
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 203 55 +148

Review metrics

None.

Technical review

Best possible solution:

Keep section assembly private to the existing formatter while preserving category-specific text and the established bounded output contract.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this refactor reports no broken behavior; source comparison and formatter cases establish the preservation contract. No tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: the local helper removes repeated assembly policy without introducing another owner, changing callers, or expanding the public API.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 162b956ad90f.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal formatter cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored internal refactor is exempt from the external-contributor proof gate. Reported paired formatter tests support output preservation but do not demonstrate live /status plugins collection; no stored-data contract changes.

Evidence

What I checked:

  • Introduced change preserves formatting semantics: The pinned introduction delta replaces six repeated conditional blocks with the same nonempty check, full count, slice-before-format operation, and category-specific text. Diagnostics retain their position; disabled-plugin grouping remains separate. (src/status/status-plugin-health.ts:322, 0b4cf2f0e5d7)
  • Cleanup remains absent from main and latest release: The formatter has identical blob identity e3d297b22eaa9be37955e03947c7f0b321aaa4e9 at the introduction base, fetched main, and supplied latest release v2026.9.5. Inspection of the release blob confirms that it still contains the repeated assembly blocks. (src/status/status-plugin-health.ts:380, 162b956ad90f)
  • Public formatter coverage: Read the complete formatter test module. Three added cases cover empty output, mixed sections with defaults and diagnostic ordering, and nine records per category with full counts but eight sorted rows; the latter two also verify unchanged input. They exercise the existing formatter without adding production test seams. (src/status/status-plugin-health.test.ts:17, 0b4cf2f0e5d7)
  • Production boundary and security: The command handler checks sender authorization and the plugin-command setting before collecting and formatting health. This PR changes neither those checks nor collection, persistence, plugin loading, imports, dependencies, or public APIs. (src/auto-reply/reply/commands-status.ts:51, 0b4cf2f0e5d7)
  • Validation and review continuity: The supplied complete body reports 23 passing baseline and 23 passing candidate formatter cases, measured process wall times, and 31 passing checks, while explicitly retaining its controller limitation. The previous completed review projection contains no findings or published rank-up moves. These are supporting evidence, not a claim that this review executed tests. (0b4cf2f0e5d7)
  • Hosted CI verified: GitHub reports the referenced hosted CI attempt completed successfully for the exact reviewed head. (0b4cf2f0e5d7)

Likely related people:

  • jalehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • masatohoshino: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed September 22, 2026, 12:46 AM ET / 04:46 UTC sha unknown :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc merged commit 0ed077d into main Sep 22, 2026
257 checks passed
@vincentkoc
vincentkoc deleted the refactor/plugin-health-section-assembly-20260921 branch September 22, 2026 10:21
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '80b9608a25e191a17e1466d750c2f76a38a38507':
  fix(tooling): declare tsx CLI shim exports
  test(gateway): reuse session PR access state fixtures (#155626)
  test(heartbeat): await wake registration before advancing coalescing time
  refactor(status): share plugin health section assembly (#155390)
  fix: CLI and MCP tool completions skip plugin hooks (#155206)
  fix(update): preserve failures and retain running worker code (#153764)
  fix(sqlite): drain idle coordinators at lifecycle teardown
  fix(test): prepare SQLite compile-cache probes before launch
  fix(test): preserve owned compiler caches in Vitest workers
  fix(ios): assistant files are not downloadable in chat (#155195)
  fix(heartbeat): avoid timeouts for busy scheduled polls (#148333)
  test(gateway): hold SSH approval until pending assertions finish
  test(update): cover launcher permission rollback on Linux (#155615)
  fix(edit): avoid duplicate replacements from legacy arguments (#155513)
  feat(browser): support Lightpanda connection-scoped CDP replies (#154342)
  improve(ci): speed up compatible Control UI tests with Bun (#154585)
  test(gateway): prepare remaining approval fixtures before requests (#155589)
  fix(doctor): exclude retained agents from automatic session import
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant