Skip to content

refactor: separate session group membership reads from catalog writes - #155306

Closed
roboclaw-bot wants to merge 1 commit into
openclaw/session-groups-active-registration-custodyfrom
openclaw/session-groups-active-member-reader
Closed

roboclaw-bot wants to merge 1 commit into
openclaw/session-groups-active-registration-custodyfrom
openclaw/session-groups-active-member-reader

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #142863

Stack: follows #155288 (openclaw/session-groups-active-registration-custody). The passive migration drafts remain separate and held.

What Problem This Solves

Group membership discovery is mixed into the catalog writer and reused by authorization and mutations, making the ownership migration harder to review.

User Impact

No user-visible change. The global catalog, member selection, permission checks, defaults, ordering, and registration custody remain unchanged. This does not activate agent-owned groups or change state schema 17.

Why This Change Was Made

Move the existing metadata-only membership resolver into one reader module and switch all four production consumers together, preserving their six call points. The complete function signature/body is byte-identical, including the environment, physical store agent IDs, iteration order, projection: "list", and clone: false. Remove its old export rather than adding a facade. Only the existing resolver test mock changes module ownership.

Evidence

  • Candidate: 50 tests passed across five suites, covering membership metadata, global catalog/rename/delete behavior, group RPCs, sharing authorization, and registration workers. The earlier 38-case baseline run is separate evidence.
  • Core production and canonical selected test-type graphs passed. Formatting/lint, line/suppression/assertion ratchets, whitespace, and production Knip passed; static and runtime import cycles are zero.
  • Source/registration/caller/mock parity and all seven final hashes verified. Fresh independent P0–P2 review: scoped-clean.
  • Seven files, +41/−42 against the immediate base; no new tests, schema fields, runtime flags, compatibility layer, or guard exception.

The first candidate invocation executed no tests because source-shaped proof copies were created during compilation. Those copies were changed to text artifacts after the checks stopped; the compiler guard was left intact. A fresh invocation with a frozen topology produced the 50 passing candidate cases above. The failed receipt remains retained.

Exact-head hosted CI passed. Run 35672510491, attempt 1 completed successfully on 0a5db52f064b1e9dbdd6992c3baf5bd0fc8d30f9: 146 successful jobs and 17 skipped, none failed or pending. Skips are not execution proof. The tested merge c2229aeac659d87d6e00aa1da9fefc660cdcce6e has the exact declared base/head parents and matching tree 3fec3d9dfc0e4afeb9e75720f26daf4161c9dcdd.

All 50 named cases matched individual hosted passing log records: member reader — 3, catalog and registration — 26 + 5, group RPCs — 9, and sharing authorization — 7. Production/test types, production/full-tree dead-code checks, runtime/static cycles and relevant source/lint guards passed. The committed-source trace confirms one resolver, four production importers and six call points, with no old export/facade.

Browser/E2E, native, QA/Docker and compatibility jobs among the 17 skips remain unexecuted proof. The build-artifacts job succeeded, but installation/upgrade behavior was not independently qualified. No broader live-Gateway/native/upgrade claim follows; activation and predecessor qualification gaps remain open.

Extracted from the work requested by @vyctorbrzezowski. Original contributor history remains preserved while the smaller stack is prepared.

Work sessions

Move the existing metadata-only resolver and all active consumers to one reader owner without changing global catalog behavior or authorization.

Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: fuller-stack-dev <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 22, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 22, 2026 00:34
@clawsweeper

clawsweeper Bot commented Sep 22, 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 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 21, 2026, 9:37 PM ET / September 22, 2026, 01:37 UTC.

ClawSweeper review

What this changes

Separates session-group membership discovery from catalog writes and updates all existing consumers and test imports without changing user-visible behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a coherent, behavior-preserving extraction within the requested session-group stack. No introduced correctness defect was found, and current main still contains the combined implementation.

Priority: P3
Reviewed head: 0a5db52f064b1e9dbdd6992c3baf5bd0fc8d30f9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused extraction with complete consumer cutover, preserved test coverage, successful hosted CI, and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this bot-authored internal refactor; the identical reader and unchanged consumers do not materially change authority. Reported tests and verified hosted CI support the extraction without establishing live or upgrade behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this bot-authored internal refactor; the identical reader and unchanged consumers do not materially change authority. Reported tests and verified hosted CI support the extraction without establishing live or upgrade behavior.
Evidence reviewed 8 items Pinned introduced change: The introduced delta moves the resolver, changes its imports, and relocates one test mock. Inspection and an in-memory text comparison confirmed that the complete 24-line resolver signature and body are identical to the immediate base.
Complete consumer cutover: The tree contains one resolver implementation, four production importers, and six production calls. Catalog mutation, defaults visibility, RPC updates, and sharing target selection retain their existing arguments and authorization checks; the old export is removed.
Current-main necessity: Fetched main still defines membership discovery in session-groups.ts. This extraction remains distinct work; the broader agent-owned catalog migration is not implemented by this patch.
Findings None None.
Security None None.

How this fits together

The Gateway discovers group membership from session category metadata across agent stores. Authorization checks and catalog mutations consume those membership results to select and validate affected sessions.

flowchart TD
  A[Agent configuration] --> C[Membership reader]
  B[Session category metadata] --> C
  C --> D[Group member targets]
  D --> E[Authorization checks]
  D --> F[Catalog mutations]
  E --> G[Permitted group operations]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -3, Tests +2. Total -1 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 37 40 -3
Tests 2 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 41 42 -1

Review metrics

None.

Technical review

Best possible solution:

Keep one metadata-only membership reader shared by the existing authorization and catalog owners, with migration activation qualified separately.

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

Not applicable: this PR proposes an internal extraction, and no introduced failing behavior was identified.

Is this the best way to solve the issue?

Yes: moving the unchanged resolver and every consumer together establishes a single reader owner without a compatibility facade or duplicate implementation.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This internal extraction preserves behavior and introduces no new user-facing capability or configuration.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this bot-authored internal refactor; the identical reader and unchanged consumers do not materially change authority. Reported tests and verified hosted CI support the extraction without establishing live or upgrade behavior.

Label justifications:

  • P3: This internal extraction preserves behavior and introduces no new user-facing capability or configuration.
  • 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 ordinary external-contributor proof gate does not apply to this bot-authored internal refactor; the identical reader and unchanged consumers do not materially change authority. Reported tests and verified hosted CI support the extraction without establishing live or upgrade behavior.

Evidence

What I checked:

  • Pinned introduced change: The introduced delta moves the resolver, changes its imports, and relocates one test mock. Inspection and an in-memory text comparison confirmed that the complete 24-line resolver signature and body are identical to the immediate base. (src/gateway/session-group-mutation-targets.ts:7, 0a5db52f064b)
  • Complete consumer cutover: The tree contains one resolver implementation, four production importers, and six production calls. Catalog mutation, defaults visibility, RPC updates, and sharing target selection retain their existing arguments and authorization checks; the old export is removed. (src/gateway/session-group-mutation-targets.ts:7, 0a5db52f064b)
  • Current-main necessity: Fetched main still defines membership discovery in session-groups.ts. This extraction remains distinct work; the broader agent-owned catalog migration is not implemented by this patch. (src/gateway/session-groups.ts, 4311a4ecdf96)
  • Latest-release boundary: The supplied latest release resolves to ec9c1a1 and contains the catalog module but no separate membership-reader module. No released implementation of this extraction was established. (ec9c1a13db89)
  • Existing public contract: The protocol documentation assigns catalog names and order to the Gateway, membership to session category fields, and member authorization to group mutations. The introduced patch preserves this contract and adds no schema, settings, protocol, or plugin API surface. Public docs: docs/gateway/protocol/rpc-session-control.md. (docs/gateway/protocol/rpc-session-control.md:33, 0a5db52f064b)
  • Validation scope: GitHub confirms run 35672510491 completed successfully for the pinned head. The captured body reports 50 passing cases across five suites and explicitly excludes live Gateway, native, and upgrade qualification. This review inspected the modified tests and passed the read-only whitespace check; it did not execute tests. (src/gateway/session-group-mutation-targets.test.ts:21, 0a5db52f064b)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • jalehman: 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.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by the worker-backed membership owner on current main, introduced in #155620 (cf32d5a). Replaying this older synchronous reader would undo that cutover. Keep the current worker/projection paths. The source branch is retained.

@RomneyDa
RomneyDa deleted the openclaw/session-groups-active-member-reader branch October 22, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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: 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