Skip to content

refactor(test): consolidate loader proof and repair rollback coverage - #207152

Merged
vincentkoc merged 1 commit into
mainfrom
test-loader-proof-cleanup-20261128
Nov 28, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
test-loader-proof-cleanup-20261128

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The plugin loader suite includes a realpath test that always returns before asserting, duplicates import-path checks, and repeats hook configuration coverage. Its failed-registration fixture also never registers a valid reload handler, so the empty reload assertion cannot detect missing rollback.

User Impact

No product behavior changes. The suite retains its real symlink checks and all distinct import and hook contracts while dropping three redundant or inactive cases. Reload rollback coverage now detects an omitted cleanup.

Why This Change Was Made

Move the strict context-cleanup assertion into the existing two-plugin hook test and the two unique import-path assertions into the shared owner test. Keep the invalid reload registration and its warning, then register a valid handler before the deliberate failure. Remove four unread scenario fields.

Evidence

  • Original loader wrapper: 198 cases pass; shared import suite: 2 cases pass.
  • Targeted owner mutations verify retained symlink, hook injection/cleanup, reload rollback, and import pass-through proof.
  • Reduced loader wrapper: 195 cases pass; shared import suite: 2 cases pass.
  • Scoped formatting, lint, and test types pass. Independent preservation reviews are clear.
  • Local ClawSweeper reviewed the complete committed range 501ee91..73a8981 with no findings.
  • Exact-head native suite and review-artifact validation pass.
  • Exact-head CI 46099788888 and completed-hosted native preparation passed; signed head unchanged.

@vincentkoc vincentkoc self-assigned this Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 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.

@clawsweeper clawsweeper Bot added the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label Nov 28, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 28, 2026 02:47
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR consolidates loader assertions, removes an inactive realpath case and unused fixture fields, and repairs a vacuous rollback check.

Example: A plugin registers reload rules for plugins.entries.failing-side-effects and then throws.

  • Before: The fixture registers no valid reload rules, so an empty reload registry cannot demonstrate cleanup.
  • After: The fixture registers valid rules before throwing, making the empty-registry assertion detect missing rollback.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct test cleanup supported by source inspection and exact-head CI; evidence is at the test-harness level.
Proof confidence 🦐 gold shrimp (3/6) There is no user-visible runtime change; source inspection and successful exact-head CI support the test consolidation, with no shipped-entry-point demonstration required.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Maintainers had redundant or inactive loader checks and a reload rollback assertion that could pass without exercising cleanup.
Reason: The maintainer-authored change reduces maintenance while preserving existing contracts and making one regression check meaningful.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored cleanup preserves distinct test contracts and strengthens reload rollback coverage, with no actionable findings.

Reviewed head: 73a89818576af170571bf827c469a6635fd269ff

Before merge

None.

Findings

None.

Agent review details

How this fits together

Synthetic plugins enter the production loader and hook registry; tests inspect registration outcomes, diagnostics, hook context, and rollback, while shared tests cover import-path normalization.

flowchart TD
  A[Synthetic plugin fixtures] --> B[Production plugin loader]
  B --> C[Registration and rollback]
  C --> D[Registry and hook assertions]
  E[Windows import inputs] --> F[Shared import normalizer]
  F --> G[Specifier assertions]
Loading

Technical review

Best possible solution:

Retain this focused consolidation and the valid reload registration without changing production behavior.

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

Source inspection confirms that the old reload fixture supplied no accepted prefixes and the removed realpath case used an already-canonical fixture directory; no target code was executed during this review.

Is this the best way to solve the issue?

The change uses existing test owners, preserves the distinct input and outcome checks, and strengthens rollback coverage without adding scaffolding.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Hook configuration and mutable context keeps the original intent (fix(plugins): preserve mutable hook context #97281: Preserve hook context mutations while exposing pluginConfig only to the owning handler; the retained test still checks both promises.)
  • Failed-registration diagnostics keeps the original intent (fix(plugins): failed plugins retain diagnostics without activating capabilities #125046: Keep earlier load diagnostics while removing failed-plugin contributions; invalid registration still produces its warning before the added valid registration.)
  • Windows import normalization keeps the original intent (cf49910: Normalize Windows paths for Node ESM imports; all removed input variants remain in the shared helper suite.)
  • Realpath-alias test changes intended behavior with a stated reason (unknown: The test names alias acceptance, but its fixture no longer creates an alias. Local git log -S searches encountered an unavailable historical blob; the known suite-splitting commit does not establish original introduction.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6cfa869 adds src/plugins/loader.registration.test-utils.ts:174 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6cfa86992a9c; files: src/plugins/loader.registration.test-utils.ts)
  • Vincent Koc: Raw commit 7601807 adds src/plugins/loader.discovery-and-security.test-utils.ts:734 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7601807fbb5f; files: src/plugins/loader.discovery-and-security.test-utils.ts)

PR surface

Tests -80. Total -80 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 8 88 -80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 8 88 -80

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 10:12 PM ET / November 28, 2026, 03:12 UTC.

@vincentkoc
vincentkoc merged commit 833e9d0 into main Nov 28, 2026
203 of 204 checks passed
@vincentkoc
vincentkoc deleted the test-loader-proof-cleanup-20261128 branch November 28, 2026 07:28
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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