Skip to content

refactor(persist-user-identity): split 534-LOC index.ts → commands.ts + context.ts (oc-hygiene #6) - #32

Merged
supmo668 merged 2 commits into
mainfrom
oc-hygiene-6-split-pui-land
Jun 21, 2026
Merged

supmo668 merged 2 commits into
mainfrom
oc-hygiene-6-split-pui-land

Conversation

@supmo668

Copy link
Copy Markdown

Release-prep hygiene #6 of 8 (FINAL internal). Pure extraction of persist-user-identity/index.ts: context.ts (pure formatters) + commands.ts (registerIdentityCommands — the 4 command blocks moved VERBATIM) + thin index.ts (config gate, schema latch, hook, register, gateway_stop). No logic change — tsgo --noEmit clean is the deps-wired proof (any unthreaded closure var = unresolved-symbol type error). Added context.test.ts (4) — first unit coverage for this extension, locks the [USER_IDENTITY] block downstream memory plugins parse. sealed 38/38, oxlint 0/0, oxfmt clean. Re-anchored onto latest main. QGR d58a093. CTO code-reviewed (pure-move confirmed) + receipt-verified.

Matthew M.Y. Mo and others added 2 commits June 21, 2026 02:50
…ntity/index.ts into commands.ts + context.ts (oc-hygiene #6)

index.ts had grown to 500 lines: the register() wiring, two prependContext
formatters, and four full slash-command handlers (!verify/!identify/!register/
!whoami) all inline. Split into focused modules:

- context.ts  — formatIdentityContext + formatUnknownUserContext (pure, 69 LOC)
- commands.ts — registerIdentityCommands(api, deps): the 4 command blocks moved
                VERBATIM; deps {sql, authConfig, ensureReady, pendingIdentify}
                thread register()'s closure state, api carries the SDK types (355)
- index.ts    — now a thin 116-LOC wiring layer (config gate, schema latch,
                before_agent_start hook, registerIdentityCommands, gateway_stop)

Behavior-preserving: a pure move, no logic change. tsgo --noEmit passes clean —
which is the proof the extraction wired every closure dependency (a missed one
would be an unresolved-symbol type error). Added context.test.ts (4 tests) — the
FIRST unit coverage for this extension — locking the [USER_IDENTITY] block
downstream memory plugins parse. oxlint 0/0 (no orphaned imports), oxfmt clean,
sealed 38/38.

Generated-With: Claude Code
Co-Authored-By: openclaw <[email protected]>
Co-Authored-By: Claude <[email protected]>
@supmo668
supmo668 merged commit 573aa9a into main Jun 21, 2026
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@supmo668, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 10 minutes and 18 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bf81da2a-839e-458e-8719-ee9d17cab448

📥 Commits

Reviewing files that changed from the base of the PR and between 767e1bd and 6b95d74.

📒 Files selected for processing (4)
  • extensions/persist-user-identity/src/commands.ts
  • extensions/persist-user-identity/src/context.test.ts
  • extensions/persist-user-identity/src/context.ts
  • extensions/persist-user-identity/src/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch oc-hygiene-6-split-pui-land

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

@supmo668
supmo668 deleted the oc-hygiene-6-split-pui-land branch October 17, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant