Skip to content

refactor(projects): move registration to shared state worker - #149386

Merged
steipete merged 22 commits into
mainfrom
codex/projects-registration-7e73-successor-20260915
Sep 16, 2026
Merged

steipete merged 22 commits into
mainfrom
codex/projects-registration-7e73-successor-20260915

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Project registration moves insertion and ID allocation to the existing shared-state worker's synchronous transaction. The host retains the original checkout lease and records acknowledgement before worker finalization, preserving cloned checkouts after acknowledged or uncertain write results.

This restores the 17-file registration change on main after #148637 landed. The previously reviewed registration delta is unchanged; current Catalog and approval worker handlers and Gateway test routes are preserved. Names, deduplication, stored records, schemas, and external SDK contracts stay unchanged.

Source 5d58f496a4ee8a3a6859362629d5596912bc7766 on the actual listing parent passed independent P0–P2 review, all 32 selected checks, additional typechecks, 149 routing tests, and six ordinary Projects cases with fresh canonical workers. Refresh and Windows remain separate successors.

Historical artifact 1b295847 passed its normal build and published-driver inventory/Projects Doctor update cell. Its compiled registration averaged 135.08 ms over 20 warm dedupes; clone proof preserved checkout files. Those samples used the older 32-statement cache, while current main uses 64. Native lease/bootstrap work remained; these are not current-head performance or whole-flow zero-SQL results.

Current-head CI is pending. Current artifact qualification is tracked separately. The earlier mock-server exit remains unexplained; this carry does not claim to fix it.

@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@steipete
steipete marked this pull request as ready for review September 15, 2026 19:56
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations size: L maintainer Maintainer-authored PR labels Sep 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 11:05 AM ET / 15:05 UTC (Revision 10).

ClawSweeper review

What this changes

Moves project registration and ID allocation into the shared database worker while preserving cloned checkouts after acknowledged or uncertain writes.

Merge readiness

✅ Ready for maintainer review

The registration change remains useful: current main still performs insertion on the host. No actionable introduced defect was found, and the previously blocking listing dependency has landed.

Priority: P2
Reviewed head: 5d58f496a4ee8a3a6859362629d5596912bc7766

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused refactor with coherent lease and cleanup handling, useful regression coverage, and no blocking correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the ordinary contributor proof gate. Current-source Projects validation and historical compiled registration/clone evidence are distinguished in the body; no unresolved authority violation requires an additional scoped proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the ordinary contributor proof gate. Current-source Projects validation and historical compiled registration/clone evidence are distinguished in the body; no unresolved authority violation requires an additional scoped proof gate.
Evidence reviewed 9 items Current main still needs this change: The fetched main revision retains host-side insertProjectRegistry and its synchronous transaction; the registration migration is not already implemented there.
Live authority remains at write admission: The new projects.insert handler checks checkout scope and root, then requests the original live lease owner's grant inside the synchronous write transaction. The existing lease owner binds that grant to the database and exact identity and retains outstanding settlements.
Acknowledgement and cleanup ordering: Registration records acknowledgement immediately after the worker result. Clone cleanup preserves acknowledged and nested outcome-unknown results; definite failures require both original leases to authorize filesystem removal.
Findings None None.
Security None None.

How this fits together

Projects connects registered local repositories and managed clones to Gateway session creation. Registration validates the checkout, stores its identity, and returns the project record to callers.

flowchart TD
 A[Local repository or managed clone] --> B[Validate checkout]
 B --> C[Hold checkout lease]
 C --> D[Shared database worker]
 D --> E[Verify live lease and insert or deduplicate]
 E --> F[Return project record]
 D --> G[Classify write outcome]
 G --> H[Preserve checkout or authorize cleanup]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +108, Tests +207. Total +315 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 7 316 208 +108
Tests 10 225 18 +207
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 541 226 +315

Review metrics

Metric Value Why it matters
Growth by responsibility Production net +108 lines; tests/support net +205; test routing net +2 Production growth separates checkout preparation from worker insertion and protects cleanup outcomes without adding user-facing configuration.

Technical review

Best possible solution:

Use the existing shared-state worker for registration while preserving project identities, live checkout ownership, and conservative handling of uncertain writes.

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

Not applicable: this is an internal execution-owner refactor, and source review found no concrete introduced failure requiring reproduction.

Is this the best way to solve the issue?

Yes. It extends the existing worker and lease-admission owners while retaining the same insertion, deduplication, and stored-record contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded production storage improvement affecting project registration and clone lifecycle.
  • 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 maintainer-authored PR is exempt from the ordinary contributor proof gate. Current-source Projects validation and historical compiled registration/clone evidence are distinguished in the body; no unresolved authority violation requires an additional scoped proof gate.

Evidence

What I checked:

  • Current main still needs this change: The fetched main revision retains host-side insertProjectRegistry and its synchronous transaction; the registration migration is not already implemented there. (src/projects/project-registry.ts, a58755e9ac9f)
  • Live authority remains at write admission: The new projects.insert handler checks checkout scope and root, then requests the original live lease owner's grant inside the synchronous write transaction. The existing lease owner binds that grant to the database and exact identity and retains outstanding settlements. (src/state/openclaw-state.worker.ts:435, 5d58f496a4ee)
  • Acknowledgement and cleanup ordering: Registration records acknowledgement immediately after the worker result. Clone cleanup preserves acknowledged and nested outcome-unknown results; definite failures require both original leases to authorize filesystem removal. (src/projects/project-registration.ts:57, 5d58f496a4ee)
  • Re-review continuity: Git tree inspection established identical blobs for every Projects file at the previous reviewed head and current head. The introduced worker hunks add registration without removing Catalog or approval handlers. The prior package/update rank-up remains separate qualification, not a demonstrated defect in this schema-preserving refactor. (src/projects/project-registration.ts, 5d58f496a4ee)
  • Merged predecessor and routing history: GitHub verifies that refactor(projects): move project listing to shared state worker #148637 merged the listing migration. Current-main history also connects steipete to registry removal and lease uncertainty handling; registration remains a distinct successor. (src/projects/project-registry.ts:86, 496edc5b6839)
  • Behavioral coverage inspected: Existing registry tests exercise real-path deduplication and registration racing final checkout deletion. Added cleanup tests cover acknowledged results, unknown outcomes, finalization failures, definite rejection, and lost cleanup authority. These tests were inspected, not executed. (src/projects/project-registry.test.ts:451, 5d58f496a4ee)

Likely related people:

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

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-15T23:27:49.698Z sha d4388c2 :: blocked before merge. :: none
  • reviewed 2026-09-16T00:14:13.807Z sha d4388c2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T04:13:20.809Z sha 6691adb :: blocked before merge. :: none
  • reviewed 2026-09-16T07:35:39.623Z sha 1749da0 :: blocked before merge. :: none
  • reviewed 2026-09-16T08:16:04.374Z sha 06e457b :: blocked before merge. :: none
  • reviewed 2026-09-16T10:53:57.975Z sha 0824c42 :: blocked before merge. :: none
  • reviewed 2026-09-16T13:03:10.321Z sha f7819e5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T14:14:44.036Z sha f7819e5 :: blocked before merge. :: none

@steipete
steipete marked this pull request as draft September 15, 2026 22:52
@steipete
steipete force-pushed the codex/projects-list-main6a835-composition-native-20260914 branch from 7e73b8e to 476d5e7 Compare September 15, 2026 22:52
@steipete
steipete force-pushed the codex/projects-registration-7e73-successor-20260915 branch from 65985f7 to d4388c2 Compare September 15, 2026 22:52
@steipete
steipete marked this pull request as ready for review September 15, 2026 22:53
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 16, 2026
Preserve the reviewed removal change while inheriting the canonical wrapper fixture correction and current main ownership. This is a private source composition; prior timeout causes remain unattributed and qualification is still pending.
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 16, 2026
@steipete
steipete marked this pull request as draft September 16, 2026 14:05
@steipete
steipete changed the base branch from codex/projects-list-main6a835-composition-native-20260914 to main September 16, 2026 14:06
@steipete
steipete marked this pull request as ready for review September 16, 2026 14:59
@steipete
steipete merged commit f26c195 into main Sep 16, 2026
257 checks passed
@steipete
steipete deleted the codex/projects-registration-7e73-successor-20260915 branch September 16, 2026 15:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…w#149386)

* refactor(projects): move registry removal to the state worker

* refactor(projects): move project listing to shared state worker

* refactor(projects): register checkouts through shared state worker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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