Skip to content

fix(tooling): contain SDK declaration preparation across callers - #160152

Draft
vincentkoc wants to merge 2 commits into
fix/semantic-boundary-memoryfrom
fix/semantic-sdk-preparation
Draft

vincentkoc wants to merge 2 commits into
fix/semantic-boundary-memoryfrom
fix/semantic-sdk-preparation

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Related: #160010
Depends on: #160112 and #160014

What Problem This Solves

SDK declaration preparation launched native compilers with only Go GC hints. Its lint and package-check callers also launched a separate preparation supervisor which could be killed before its compiler process tree and locks finished cleanup.

User Impact

Each declaration compiler now uses the shared host admission and Linux kernel process-tree memory limit. Compiler batches run serially on every machine. Preparation exports one operation composed directly into the existing artifact owner in both lint entrypoints and the package boundary checker. One cancellation signal survives admission, execution, inventory publication, and asynchronous ownership release. The package checker retains its 420-second preparation deadline without a competing outer process-kill timer.

Streamed preparation output respects backpressure and rejects lines over 64 KiB; output cleanup errors preserve any unjoined compiler failure. Inherited artifact owners record unverified cleanup before a CLI can catch the error and turn it into an exit status. Interrupted commands cannot publish completion receipts. Unsupported hosts receive the existing bounded remote-worker guidance.

This slice activates declaration preparation only. The package checker's compile/canary leaves and Oxlint itself remain separate tracked activation slices. CI backend provisioning must land first.

Evidence

Focused remote proof used one worker and a 7 GiB kernel scope. At 67ceda95, 189 tests passed across the eight-file selection; the run exposed a relocated fixture import and a real inherited-owner retention regression. At exact head f3f18af4df744537e51314a55e26d2f42fce457b, both repaired suites pass: 70 tests, 33.52 seconds Vitest / 34.21 seconds test wall time. The unchanged other six files passed in the first run. Script typecheck, typed lint of all five changed production modules, formatting and whitespace checks also pass (63.135 seconds combined). Independent review found no actionable P0–P2 finding. Changed-test typed lint and final combined CI remain pending parent graph/backend landing. The new tests cover compiler serialization/fail-stop, oversized output, cleanup-error preservation, a real kernel-contained declaration worker, and existing cold/warm/invalidation/lock-through-consumption behavior.

Production/tooling +230/-108 (net +122) replaces nested supervisors with a shared lifetime. Test changes +303/-95 include fixture composition changes; changelog +2. No dependency change.

@vincentkoc vincentkoc self-assigned this Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 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 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 2:09 AM ET / 06:09 UTC (Revision 3).

ClawSweeper review

What this changes

The branch runs plugin SDK declaration preparation inside the shared memory and cancellation lifecycle used by lint and package-boundary checks.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 5 items remain

This remains a useful part of the reported memory repair, but the previously identified macOS and Windows compatibility blocker is still present. The earlier changelog finding is resolved.

Priority: P2
Reviewed head: 6f5f4faa8bcd49ad3c788a51cd2fc0dfb534029b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The shared-lifecycle repair has focused validation, but its cross-platform regression and unproven combined CI activation limit merge readiness.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The MEMBER-authored PR is exempt from the external-contributor setup-proof gate. Its body reports earlier-head remote compiler and test runs, while current-head combined CI activation is still unshown; the patch changes artifact retention behavior but no stored-data format.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor setup-proof gate. Its body reports earlier-head remote compiler and test runs, while current-head combined CI activation is still unshown; the patch changes artifact retention behavior but no stored-data format.
Evidence reviewed 7 items Introduced compiler routing: Every pending declaration step is marked semantic, so it uses the shared admission owner.
Non-Linux refusal: The existing admission owner returns status 75 without launching a compiler when the host is not Linux; the changed step treats a nonzero status as failure.
Exposed callers: The package-boundary checker and both lint entrypoints call declaration preparation; package.json exposes the package-boundary commands.
Findings 1 actionable finding [P1] Preserve a usable non-Linux declaration-check path
Security None None.

How this fits together

OpenClaw's tooling prepares declaration files before lint and plugin package checks consume them. The preparation step launches native compilers, publishes artifact records, and releases ownership when the work finishes.

flowchart LR
  A[Lint or package check] --> B[Declaration preparation]
  B --> C[Artifact ownership]
  C --> D[Host admission]
  D --> E[Native compiler]
  E --> F[Declaration files and records]
  F --> G[Lint or package result]
Loading

Decision needed

Question Recommendation
Should cold macOS and Windows declaration checks retain a working default path, or may this change require users to move those checks to a bounded Linux worker or VM? Preserve a working default: Provide a bounded route or retain compatible local behavior, then make strict refusal an explicit choice.

Why: The branch intentionally replaces a working local command with a refusal on two supported development platforms; accepting that compatibility change requires maintainer intent.

Before merge

  • Preserve a usable non-Linux declaration-check path (P1) - Every cold declaration step now selects semantic admission, whose existing owner returns 75 on macOS and Windows. Lint and package-boundary checks call this preparation, so they stop before checking files where the current-main path ran the compiler. Preserve a working default route or obtain explicit approval for the platform change.
  • Resolve merge risk (P1) - Cold macOS and Windows lint or package-boundary checks now stop before compilation because their declaration step receives status 75; users must move the check to a Linux worker or VM.
  • Resolve merge risk (P1) - The Linux CI containment provisioning prerequisite is still open, and the PR body has no combined activation result for this head.
  • Complete next step (P2) - Resolve the non-Linux declaration-check compatibility decision and verify the combined path after CI containment provisioning lands.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve a usable non-Linux declaration-check path — scripts/prepare-extension-package-boundary-artifacts.mts:374-375
Agent review details

Security

None.

PR surface

Tests +208, Other +122. Total +330 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 7 303 95 +208
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 5 230 108 +122
Total 12 533 203 +330

Review metrics

Metric Value Why it matters
Tooling and test delta production +230/-108; tests +303/-95 The production growth replaces nested preparation supervisors with a shared lifetime; the test growth covers cancellation, containment, and ownership.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160010
Summary: This branch addresses the declaration-preparation slice of the open host-memory issue; linked branches cover prerequisites and separate compiler or lint slices.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Keep cross-platform checks usable (recommended)
    Repair declaration routing so cold macOS and Windows checks complete through a supported default path, then verify fresh and existing workspaces.
  2. Accept a Linux-only workflow
    Explicitly approve and document the operator change, provision CI, and verify the full check on the resulting runner.

Technical review

Best possible solution:

Keep Linux declaration compilers within one admitted, joined lifecycle while providing a working default route for macOS and Windows and verifying the provisioned CI path before activation.

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

Yes for the introduced platform regression: a cold declaration step on macOS or Windows reaches the admission owner's status-75 return. This review did not execute that path.

Is this the best way to solve the issue?

Not yet. Shared admission and joined cleanup fit the memory problem, but the unconditional platform refusal needs a supported default route or an explicit compatibility decision.

Full review comments:

  • [P1] Preserve a usable non-Linux declaration-check path — scripts/prepare-extension-package-boundary-artifacts.mts:374-375
    Every cold declaration step now selects semantic admission, whose existing owner returns 75 on macOS and Windows. Lint and package-boundary checks call this preparation, so they stop before checking files where the current-main path ran the compiler. Preserve a working default route or obtain explicit approval for the platform change.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded tooling reliability repair with a significant cross-platform check regression to resolve before merge.
  • merge-risk: 🚨 compatibility: Cold local declaration checks that previously ran on macOS and Windows would refuse execution.
  • merge-risk: 🚨 automation: The changed lint and package-check paths require a Linux containment backend that their still-open CI provisioning prerequisite supplies.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The MEMBER-authored PR is exempt from the external-contributor setup-proof gate. Its body reports earlier-head remote compiler and test runs, while current-head combined CI activation is still unshown; the patch changes artifact retention behavior but no stored-data format.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit e07ec8c adds scripts/lib/semantic-check-admission.mts:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e07ec8c700d5; files: scripts/lib/semantic-check-admission.mts)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Resolve and document the macOS and Windows declaration-check behavior with the relevant owner.
  • Verify activation after the CI containment backend lands.

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 (2 earlier review cycles)
  • reviewed 2026-09-28T05:36:06.223Z sha f3f18af4df744537e51314a55e26d2f42fce457b :: blocked before merge. :: [P1] Preserve a usable non-Linux path for declaration checks | [P3] Remove the release-owned changelog edit
  • reviewed 2026-09-28T05:45:52.274Z sha dc493d6 :: blocked before merge. :: [P1] Preserve a usable non-Linux declaration-check path | [P3] Remove the release-owned changelog entry

@vincentkoc
vincentkoc force-pushed the fix/semantic-sdk-preparation branch from dc493d6 to 6f5f4fa Compare September 28, 2026 06:02
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant