Skip to content

refactor(plugins): share source-root display formatting - #148646

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/plugin-source-root-formatting-current-20260914
Sep 15, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/plugin-source-root-formatting-current-20260914

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

This maintainer-requested refactor is part of the approved duplication and complexity reduction deliverable. Plugin source table formatting repeats the same relative-path lookup and labelled return for bundled, workspace and global origins.

User Impact

No intended output change. Bundled sources still use stock:, workspace/global sources retain their labels, and configured sources use the existing home-shortened fallback. Missing or empty roots, exact-root paths and paths outside the matching root retain that fallback. The existing 48-character, UTF-16-safe middle truncation is unchanged.

Why This Change Was Made

Select the existing root key once and share the relative-path formatting branch. Root discovery, lexical containment, slash normalization and verbose/JSON output stay unchanged. The home-shortening fallback and both home-boundary regression cases are preserved.

Production: -10 lines. Tests: +21 lines. This mechanical refactor needs no changelog entry.

Evidence

  • Normal CI and Workflow Sanity passed on exact head 8d384baa5b2222d5fb3819795d994d81941b018e.
  • The actual source-display test job passed all 13 formatter cases, including all six additions and retained home-boundary cases. The tested merge ff73f7872550e4712860212d65ae2bc687535c81 contains the exact reviewed owner and test bytes.
  • Added cases cover missing stock/workspace roots, an empty global root, an exact root, a sibling root and configured-origin fallback. Existing labelled-origin and UTF-16 truncation coverage remains.
  • Full source and independent reviews covered the formatter, origin types, root discovery, canonical containment, list-command caller and relevant dependency contracts. The exact pinned fs-safe containment implementation was inspected; this change keeps its synchronous lexical behavior and separate exact-root exclusion.
  • One exact-head P2 review completed scoped-clean. The latest exact-head ClawSweeper review has no actionable finding, Before merge item or Rank-up move. Its static-only limitation remains separate from hosted execution.

This is formatter fixture evidence. No live plugins-list session, Windows execution or bundle-performance result is claimed.

@vincentkoc vincentkoc self-assigned this Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 15, 2026 00:23
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 15, 2026
@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 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 8:30 PM ET / September 15, 2026, 00:30 UTC.

ClawSweeper review

What this changes

Shares plugin source-path formatting across bundled, workspace, and global origins while preserving displayed labels and adding fallback coverage.

Merge readiness

✅ Ready for maintainer review

The requested cleanup remains absent from current main, and the refactor preserves the existing formatting contract. No actionable defect was found; this member-authored PR should remain open for normal landing.

Priority: P3
Reviewed head: 8d384baa5b2222d5fb3819795d994d81941b018e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving simplification with useful fallback coverage and no identified correctness or security blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal formatter refactor is exempt from external-contributor runtime proof; the body explicitly reports static validation without claiming a live plugins-list run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored internal formatter refactor is exempt from external-contributor runtime proof; the body explicitly reports static validation without claiming a live plugins-list run.
Evidence reviewed 6 items Introduced change preserves formatting: The verified merge-base-to-head diff selects the same root for each supported origin and retains the existing containment, slash normalization, home shortening, and truncation helpers.
Current main still contains duplication: Fetched main retains separate bundled, workspace, and global branches. The requested consolidation is therefore still distinct work. Inspection of the supplied latest-release object was unavailable, so no release inclusion is claimed.
Production caller and contract: The compact list consumes both formatter outputs; JSON returns before loading human renderers, and verbose output uses its existing separate formatter. PluginOrigin contains exactly bundled, global, workspace, and config.
Findings None None.
Security None None.

How this fits together

The plugin inventory command passes source paths, origins, and known installation roots to this formatter. It returns compact table text and the root labels used in the command’s legend.

flowchart TD
  A[Plugin inventory] --> C[Source path formatter]
  B[Known installation roots] --> C
  C --> D{Path beneath matching root?}
  D -->|Yes| E[Labeled relative path]
  D -->|No| F[Home shortening and truncation]
  E --> G[Plugin table and root legend]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -10, Tests +21. Total +11 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 15 -10
Tests 1 21 0 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 26 15 +11

Review metrics

None.

Technical review

Best possible solution:

Keep one origin-to-root formatting branch within the existing formatter, preserving all current table and fallback output.

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

Not applicable: this PR removes duplication rather than reporting a runtime defect; source inspection supports equivalent behavior for all four defined origins.

Is this the best way to solve the issue?

Yes. Selecting the existing root once removes repeated formatting logic without adding another owner, changing interfaces, or altering discovery.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a bounded internal simplification 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: This MEMBER-authored internal formatter refactor is exempt from external-contributor runtime proof; the body explicitly reports static validation without claiming a live plugins-list run.

Evidence

What I checked:

  • Introduced change preserves formatting: The verified merge-base-to-head diff selects the same root for each supported origin and retains the existing containment, slash normalization, home shortening, and truncation helpers. (src/plugins/source-display.ts:42, 8d384baa5b22)
  • Current main still contains duplication: Fetched main retains separate bundled, workspace, and global branches. The requested consolidation is therefore still distinct work. Inspection of the supplied latest-release object was unavailable, so no release inclusion is claimed. (src/plugins/source-display.ts:42, f0344c1cb9dc)
  • Production caller and contract: The compact list consumes both formatter outputs; JSON returns before loading human renderers, and verbose output uses its existing separate formatter. PluginOrigin contains exactly bundled, global, workspace, and config. (src/cli/plugins-list-command.ts:121, 8d384baa5b22)
  • Meaningful fallback coverage: Six added cases exercise missing roots, an empty root, an exact root, a sibling directory, and configured-origin fallback. Existing labeled-origin and home-boundary cases remain intact. Tests were inspected but not executed under the read-only restriction; diff whitespace validation passed. (src/plugins/source-display.test.ts:89, 8d384baa5b22)
  • Area history and attribution limits: Recent formatter history identifies Peter Steinberger as a routing candidate, including home-path preservation and table readability work. Deeper pickaxe/blame inspection encountered unavailable Git objects; no source-line introduction attribution is asserted. (src/plugins/source-display.ts, 6f21bfa05db4)
  • Maintainer context and proof scope: The captured PR body describes a maintainer-requested duplication-reduction deliverable and explicitly claims no runtime result. The author association is MEMBER and the PR carries the maintainer label. No scoped maintainer-notes directory was present. (8d384baa5b22)

Likely related people:

  • Peter Steinberger: 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.

@vincentkoc
vincentkoc merged commit aa0f68e into main Sep 15, 2026
263 of 264 checks passed
@vincentkoc
vincentkoc deleted the refactor/plugin-source-root-formatting-current-20260914 branch September 15, 2026 07:36
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 15, 2026
* commit '0945dabbe487213e95e84a72ad1aae3659e0e000': (115 commits)
  fix: omit automation service aliases from squash coauthors (#148883)
  test: restore services typecheck shard headroom (#148885)
  perf(trajectory): avoid native probes for truncation records (#148870)
  improve(gateway): load cron only when reload requests it (#143500)
  fix: resolve issue #146088 — [Bug]: The most recent Linux AppImage does not ship with the correct versions of libs needed to run (#148174)
  refactor(theme): share nonvirtual ANSI color lookup (#148717)
  perf(gateway): scope exact session row topology reads (#148836)
  improve(memory): reduce vector replacement overhead (#148201)
  fix(i18n): keep HTTP headers out of native translations (#147119)
  refactor(plugins): share source-root display formatting (#148646)
  fix(cron): reject blank script paths before mutations (#148787)
  refactor(config): share audit positional scanning (#148643)
  fix(test): restore infrastructure typecheck shard headroom (#148861)
  fix(release): harden package validation fallbacks (#148729)
  refactor(config): share leaf and descendant unset pruning (#148216)
  test: reuse prepared runtime for pristine preflight (#148858)
  fix(ui): settle global model drafts across agent switches (#148843)
  fix(queue): avoid repeated scans when cancelling backlogs (#148754)
  fix(logging): orphaned \\\\?\\ path markers corrupt redacted Windows diagnostics (#147542)
  refactor(hooks): share optional reply metadata projection (#148641)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 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: XS 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