Skip to content

refactor(gateway): register resident lifecycles - #121996

Merged
steipete merged 1 commit into
mainfrom
steipete/gateway-resident-registry
Aug 11, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/gateway-resident-registry

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Phase-2 PR 5 gives every Gateway resident from the design-verified R6-R21 inventory a uniform lifecycle owner after the landed socket-free kernel factory (#121981).

Why This Change Was Made

The new resident registry records { name, start, stop } owners for discovery, task/skills maintenance, event subscriptions, diagnostics, event-loop health, control-UI assets, Tailscale, update checks, post-bind plugin loading, sidecars, database verification, scheduled services, config reload, post-ready maintenance, and retained-plugin cleanup. Existing call sites still start and stop them at the same points, so listener attachment, sidecar sequencing, close trace order, and the post-ready barrier do not move.

Resident publications now go through named kernel setters for early-runtime handles, discovery replacement, scheduled services, post-attach handles, plugin services, config reload, lifetime/post-ready sidecars, and maintenance handles. No config, protocol, default, log ordering, or user-visible behavior changes.

This is phase-2 PR 5 of the Gateway kernel split. The design-verified resident inventory preceded the implementation; next is PR 6, the config-reloader inversion through kernel.swapCronState(), kernel.swapHeartbeatRunner(), and kernel.reloadPlugins().

User Impact

No user-visible change. Gateway resident ownership is now explicit and enumerable, preparing final kernel/transport/resident composition without altering startup or shutdown behavior.

Evidence

  • server-close, server-startup-post-attach, server-lifetime-sidecars, and both restart-sentinel suites: 5 files, 204 passed; existing restart-trace step assertions preserve shutdown order
  • socket-free kernel + minimal boot regression: 2 files, 3 passed
  • core and core-test tsgo lanes: passed
  • node scripts/check-changed.mjs -- <touched>: formatting, dead exports, lint, plugin boundaries, schema/runtime/import-cycle/auth guards passed locally after remote backend fallback
  • pnpm build: passed
  • Codex autoreview: clean, no accepted/actionable findings

The default local multi-project Gateway runner currently reproduces an unrelated current-main stale state-schema inlining failure for cron_job_runtime_authorities; the same untouched restart-sentinel suite and the full required group pass with OPENCLAW_GATEWAY_PROJECT_SHARDS=0. This is recorded as heal-check provenance, not hidden by retries or weaker assertions.

ClawSweeper review metrics: production +562/-302 (net +260) for the explicit 16-resident lifecycle table and kernel-owned live-state setter boundary; test support +2/-0. AI-assisted; implementation and evidence were reviewed directly.

@clawsweeper

clawsweeper Bot commented Aug 11, 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 the gateway Gateway runtime label Aug 11, 2026
@steipete steipete self-assigned this Aug 11, 2026
@steipete
steipete marked this pull request as ready for review August 11, 2026 10:35
@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Aug 11, 2026
@steipete
steipete force-pushed the steipete/gateway-resident-registry branch from 0427d2f to 3f3da1e Compare August 11, 2026 10:35
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof:

  • Native review: READY FOR /prepare-pr, zero findings.
  • Exact-head CI: green for 3f3da1e.
  • Required resident proof: 5 files, 204 passed, including restart-trace shutdown ordering.
  • Socket-free kernel and minimal boot regression: 2 files, 3 passed.
  • Changed-file gates, core/core-test tsgo, lint/architecture guards, and pnpm build: passed.
  • Fresh commit-mode autoreview: clean.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 121996: passed.
  • ClawSweeper first review is explicitly queued; the latest published comments have no findings or Rank-up moves. Per repository policy, the late publisher does not block an otherwise exact-head-green landing.

This is phase-2 PR 5 of the Gateway kernel split. The design-verified resident inventory preceded this table; next is the config-reloader inversion PR.

@steipete
steipete merged commit ad22faf into main Aug 11, 2026
119 checks passed
@steipete
steipete deleted the steipete/gateway-resident-registry branch August 11, 2026 10:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant