Skip to content

refactor: canonicalize aliases and classify test suites - #122407

Merged
steipete merged 4 commits into
mainfrom
steipete/naming-odds-ends-0811
Aug 12, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/naming-odds-ends-0811

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves two maintainer-tooling problems: selected re-export aliases hid their defining symbol names from repository search, and imported Gateway *.suite.ts test sources were classified as production by CI and max-lines governance.

Why This Change Was Made

The Gateway session read and workspace migration receipt paths now use their defining-module names through every caller. Deliberate filesystem, media-kind, and transcript domain aliases remain, with each re-export explicitly marked as sanctioned.

The existing *.suite.ts convention remains intact: three Gateway auth suites are imported by thin *.test.ts entry files, and Knip/dynamic-import/topology tooling already recognizes the suffix. Shared path facts, CI build-impact classification, and oxlint now consistently treat it as imported test support without making it a directly runnable Vitest entry.

server.auth.control-ui.suite.ts remains above the test-side 1,000-line budget, so its existing grandfathered max-lines debt still needs a separate split. This PR adds no suppression or baseline entry.

User Impact

No product behavior changes. Maintainers get truthful symbol searches, test-only CI routing for *.suite.ts, and the correct test-side max-lines policy.

Evidence

  • Pre-fix classifier reproduction: server.auth.control-ui.suite.ts reported buildArtifact: true, isChangedLaneTest: false, and isTestOnly: false; after the fix it reports false, true, and true respectively while changed-test planning still selects server.auth.control-ui.test.ts.
  • Focused classifier proof: 2 Vitest shards, 39 tests passed.
  • Focused owner proof: Gateway 224 tests, workspace migration 29 tests, Plugin SDK runtime 5 tests passed.
  • pnpm lint:tmp:export-name-collisions passed; the two verified misleading aliases are gone and sanctioned aliases remain informational with inline triage comments.
  • pnpm check:wrapper-shadowing passed.
  • pnpm plugin-sdk:surface:check passed.
  • pnpm check:max-lines-ratchet --base origin/main passed with 934 grandfathered entries and no growth.
  • Two Codex autoreview passes were clean with no accepted/actionable findings.
  • node scripts/check-changed.mjs passed all stages through deprecated API usage, then stopped on the existing unrelated plugin-boundary compatibility debt (eligibleForRemoval=1); this diff does not change that registry or compatibility surface.

Raw numstat classification: production +108/-87 (net +21, formatter reflow from the longer canonical identifier; semantic production LOC net 0), tests/test-support +59/-37 (net +22), tooling/config +19/-21 (net -2). Total: 61 files, +186/-145.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime labels Aug 12, 2026
@steipete
steipete marked this pull request as ready for review August 12, 2026 03:18
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 12, 2026
@steipete
steipete requested a review from a team as a code owner August 12, 2026 03:18
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 12, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 Aug 12, 2026
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:05 AM ET / 04:05 UTC.

ClawSweeper review

What this changes

The PR removes selected internal re-export aliases and recognizes imported *.suite.ts files as test support for CI and lint policy without making them direct Vitest entries.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. Current main still has the ambiguous Gateway re-export and does not classify *.suite.ts as test-only, while the PR head is not contained in main; no concrete patch defect was found.

Priority: P3
Reviewed head: 994b2674fcc1ebb42f3e36ff499e19877815adf8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with supplied classifier proof; remaining exact-head CI is the material merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored internal tooling PR; its body nevertheless includes after-fix terminal classifier and focused-test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored internal tooling PR; its body nevertheless includes after-fix terminal classifier and focused-test evidence.
Evidence reviewed 7 items Current main still exposes the alias: The Gateway barrel re-exports the canonical store function under the shorter loadSessionEntryReadOnly name, so the naming cleanup is not already on main.
Current main lacks suite classification: The shared path predicates only recognize test/spec/e2e and test-support naming; suite is absent from both changed-lane and test-only patterns.
Owner boundary: The canonical read-only Gateway session accessor already exists in the store owner and delegates to the same read-only mode, so renaming barrel consumers does not alter session-store behavior.
Findings None None.
Security None None.

How this fits together

Gateway callers read persisted session state through a shared accessor barrel, and CI path classifiers decide whether changed files require build artifacts or focused test work. The PR clarifies the accessor name and routes suite-support files through test-only policy.

flowchart LR
A[Changed repository path] --> B[Shared path facts]
B --> C[Build impact decision]
B --> D[Changed test planner]
E[Gateway caller] --> F[Session accessor barrel]
F --> G[Read-only session store]
C --> H[CI build work]
D --> I[Focused test entry]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still in progress, and the latest ClawSweeper comment was not available locally; read any remaining Rank-up moves before merge.
  • Resolve merge risk (P1) - The local partial clone could not materialize several historical blobs because origin was unreachable, so the supplied PR metadata and pending exact-head CI remain necessary complements to local inspection.
  • Complete next step (P2) - This protected, actively maintained PR needs normal exact-head validation and maintainer review rather than an automated repair job.
Agent review details

Security

None.

PR surface

Source +21, Tests +23, Other -2. Total +42 across 63 files.

View PR surface stats
Area Files Added Removed Net
Source 35 113 92 +21
Tests 24 59 36 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 19 21 -2
Total 63 191 149 +42

Review metrics

Metric Value Why it matters
Production vs test LOC production +108/-87 raw, semantic net 0; tests/test support +59/-37; tooling/config +19/-21 The PR body identifies the raw production delta as formatting caused by canonical names; the behavioral change is concentrated in CI classification and its coverage.

Stored data model

Persistent data-model change detected: durable storage schema: src/gateway/worker-environments/worker-session-tool-executor.test.ts, durable storage schema: src/gateway/worker-environments/worker-session-tool-executor.ts, durable storage schema: src/gateway/worker-environments/worker-session-tool-topology.ts, serialized state: src/gateway/server-methods/sessions-create.ts, serialized state: src/gateway/server-methods/sessions-diff.test.ts, serialized state: src/gateway/server-methods/sessions-diff.ts, and 15 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Finish exact-head validation (recommended)
    Wait for the remaining checks and confirm the latest ClawSweeper Rank-up moves before merging the CI-routing change.

Technical review

Best possible solution:

Merge after the exact-head checks and any latest ClawSweeper Rank-up moves are satisfied; retain the canonical accessor export and classify suite files as test support rather than standalone test entries.

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

Not applicable as a user bug: source inspection establishes the current classifier and accessor aliases, while the PR body provides after-fix terminal evidence for the internal tooling behavior.

Is this the best way to solve the issue?

Yes. Renaming consumers at the Gateway barrel and treating *.suite.ts as test support in shared classification preserves one canonical runtime accessor and avoids making imported suites direct Vitest targets.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2a1eba771342.

Labels

Label justifications:

  • P3: This is internal naming and maintainer-tooling cleanup with no stated product behavior change.
  • merge-risk: 🚨 automation: The PR changes the path classification that selects build artifacts and focused CI test work.
  • 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 is a maintainer-authored internal tooling PR; its body nevertheless includes after-fix terminal classifier and focused-test evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the canonical session accessor and CI classifier to Peter Steinberger’s recent feature commit, and the PR author is steipete. (role: current feature owner and recent area contributor; confidence: high; commits: cd0a1235a30c, 994b2674fcc1; files: src/gateway/session-utils-store.ts, scripts/lib/changed-path-facts.mjs, scripts/lib/ci-changed-node-test-plan.mts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let exact-head CI complete.
  • Read and satisfy any Rank-up moves in the latest ClawSweeper comment before merge.

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.

@steipete
steipete merged commit f6fff4f into main Aug 12, 2026
121 checks passed
@steipete
steipete deleted the steipete/naming-odds-ends-0811 branch August 12, 2026 04:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
)

* refactor: use canonical re-export names

* fix(test): classify suite support as test source

* fix(agents): retarget gateway stub session-entry import

* test(gateway): retarget session-utils mock keys after alias removal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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