Skip to content

fix(tooling): admit and contain compiler process trees - #160116

Draft
vincentkoc wants to merge 1 commit into
fix/semantic-boundary-memoryfrom
fix/semantic-compiler-memory
Draft

vincentkoc wants to merge 1 commit into
fix/semantic-boundary-memoryfrom
fix/semantic-compiler-memory

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

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

What Problem This Solves

The shared compiler leaf applied Go resource hints without enforcing a kernel memory ceiling. Apparent query flags could bypass ownership while still loading compiler input, and cancellation during artifact release could emit completed-check evidence.

User Impact

All semantic compiler invocations now use the shared host/account admission slot and adaptive kernel process-tree cap. Only exact singleton help/version arguments bypass semantic admission. Native parsing still owns mixed flags and response files. Cancellation remains active through artifact cleanup, and interrupted runs cannot certify completion.

The existing shard scheduler also calls this shared leaf, so its compiler processes become serial at admission. Its first-failure and diagnostic-draining behavior remains unchanged in this slice. Unsupported local hosts receive remote/VM guidance; unbounded fallback is intentionally unavailable.

Evidence

Independent P0–P2 review and targeted formatting/whitespace pass. Exact head 3151e1d3f002e8db3fc671b6a678d4dd487ad431 passed 402 tests across eight focused files, script typechecking, and typed lint of both changed production modules on Testbox. One-worker tests took 148.81s in Vitest and 149.66s through the repository wrapper; the complete proof command took 2m46.243s. Input digest (3,681 entries): dbc161f344712f46b004f2654a33a68e89f8139abbbf9e516f28a4663efaa9c1.

Changed-test typed lint is still pending: the broad root test graph exceeded a 7 GiB kernel budget in the preceding boundary slice. This draft will not land before that proof and required CI are complete.

Crash fixtures isolate their account identity and clean only recorded kernel scopes. The shard ownership test accepts either first lock winner and preserves the blocked-build assertions. Added direct artifact-release cancellation coverage reuses the existing boundary fixture.

This is a compiler activation slice; lint and SDK-preparation activation remain separate work. Production/tooling +35/-18, tests +486/-345, changelog +2. Positive tooling growth owns admission and the cancellation/evidence boundary. No dependency or user configuration surface is added.

@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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: L labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The branch routes TypeScript compiler commands through shared host admission and process-tree memory limits, narrows help and version bypasses, and carries cancellation through artifact release.

Regression provenance

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

Merge readiness

⛔ Blocked before merge - 8 items remain

Keep this PR open. Current main has the shared admission helper but has not connected ordinary compiler checks to it, so the branch remains useful. The current head still has the previously identified platform and timeout regressions, and two declaration-consumer tests now accept a refusal instead of checking declarations.

Priority: P2
Reviewed head: 4cb452921451e4eb00eea9674b7dd5b319906859
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The admission work has useful focused validation, but three concrete compatibility and coverage findings still limit merge confidence.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The ordinary contributor proof gate does not apply to this member-authored PR. The body cites focused Testbox validation at an earlier head for the wrapper-to-compiler path; it does not establish current-head platform behavior or serialized-stripe duration. The diff changes no stored-data contract.
Patch quality 🦐 gold shrimp (3/6) 3 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor proof gate does not apply to this member-authored PR. The body cites focused Testbox validation at an earlier head for the wrapper-to-compiler path; it does not establish current-head platform behavior or serialized-stripe duration. The diff changes no stored-data contract.
Evidence reviewed 8 items Introduced activation: The pinned PR changes the compiler wrapper from direct managed execution to shared semantic admission for every invocation except singleton help or version.
Current-main gap: Fetched main still invokes the prepared compiler through runManagedCommand; the requested admission activation is not already on main.
Platform refusal: The shared admission owner returns status 75 before starting a compiler on non-Linux hosts. The introduced call makes that refusal apply to ordinary tsgo commands.
Findings 3 actionable findings [P1] Preserve a working path for non-Linux typechecks
[P1] Preserve the documented default typecheck duration
[P2] Keep declaration consumers checked on supported hosts
Security None None.

How this fits together

Package scripts and CI send TypeScript projects through the tsgo wrapper. The wrapper starts the compiler, owns its generated artifacts, and returns diagnostics, status, and completion evidence to the caller.

flowchart LR
A[Typecheck command] --> B[TypeScript wrapper]
B --> C{Help or version only?}
C -->|Yes| D[Managed compiler]
C -->|No| E[Host admission and memory limit]
E --> D
D --> F[Diagnostics and completion evidence]
Loading

Decision needed

Question Recommendation
Should this activation preserve working macOS and Windows typechecks and the unbounded default duration, or intentionally make those existing workflows fail closed? Preserve existing workflows: Keep current local typechecks usable while adding bounded Linux admission, then introduce stricter behavior only with an approved route and upgrade proof.

Why: The branch deliberately changes established local tooling behavior, and source review cannot authorize the platform and timeout policy tradeoff.

Before merge

  • Preserve a working path for non-Linux typechecks (P1) - Routing every semantic invocation into runSemanticCheck makes existing macOS and Windows pnpm tsgo:* commands return 75 before the compiler starts. Provide a usable bounded route, or resolve and document the intentional compatibility change before merge.
  • Preserve the documented default typecheck duration (P1) - With no timeout environment variable, this new call picks up admission's 15-minute deadline, whereas the supported wrapper and testing guide leave the watchdog disabled by default. Long existing checks can now fail without a settings change.
  • Keep declaration consumers checked on supported hosts (P2) - This assertion now treats refusal status 75 as success on non-Linux hosts, so the fixture can pass without typechecking its generated declarations. The unified-entry declaration test makes the same change; preserve a real consumer check on those hosts.
  • Resolve merge risk (P1) - Existing macOS and Windows local typecheck commands would stop with status 75 unless a usable bounded route is provided or maintainers explicitly accept that upgrade break.
  • Resolve merge risk (P1) - Previously unbounded default compiler checks would acquire a 15-minute deadline; long checks could now fail without an operator setting change.
  • Resolve merge risk (P1) - Host-wide serial admission can lengthen compiler stripes, but the cited focused test run does not establish the resulting CI time budget.
  • Complete next step (P2) - Resolve the platform and default-deadline decision, repair the declaration-consumer checks, and verify the chosen upgrade behavior and serialized CI duration before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve a working path for non-Linux typechecks — scripts/run-tsgo.mts:117-120
  • [P1] Preserve the documented default typecheck duration — scripts/run-tsgo.mts:117-120
  • [P2] Keep declaration consumers checked on supported hosts — test/scripts/write-plugin-sdk-entry-dts.test.ts:309-315
Agent review details

Security

None.

PR surface

Tests +141, Other +17. Total +158 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 8 486 345 +141
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 35 18 +17
Total 10 521 363 +158

Review metrics

Metric Value Why it matters
Default compiler deadline 1 default changed: unbounded to 15 minutes An existing check can time out without any configuration change.
Declaration-consumer assertions 2 tests now accept status 75 on non-Linux Those cases no longer verify the generated declarations on those hosts.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160010
Summary: This PR is one compiler-activation candidate for the broader open memory-containment issue; its two open prerequisites address distinct entry points and provisioning.

Members:

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

Merge-risk options

Maintainer options:

  1. Restore supported check paths (recommended)
    Repair platform and timeout behavior, keep declaration-consumer checks meaningful, and prove the selected upgrade behavior before merge.
  2. Own the stricter policy
    A maintainer may accept the workflow breaks after documenting the operator path and verifying fresh and upgraded setups plus serialized CI stripes.

Technical review

Best possible solution:

Use the shared compiler admission owner while preserving a working path for supported local checks, then document and prove any approved change to platform or deadline defaults and retain meaningful declaration-consumer coverage.

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

No direct current-main memory-exhaustion reproduction was run in this read-only review. Current source shows ordinary compiler checks bypass shared admission, and the introduced non-Linux refusal follows directly from the wrapper call and admission guard.

Is this the best way to solve the issue?

No. Shared admission is the appropriate owner, but unconditional activation changes supported platform and timeout behavior and weakens two declaration-consumer assertions.

Full review comments:

  • [P1] Preserve a working path for non-Linux typechecks — scripts/run-tsgo.mts:117-120
    Routing every semantic invocation into runSemanticCheck makes existing macOS and Windows pnpm tsgo:* commands return 75 before the compiler starts. Provide a usable bounded route, or resolve and document the intentional compatibility change before merge.
    Confidence: 0.96
  • [P1] Preserve the documented default typecheck duration — scripts/run-tsgo.mts:117-120
    With no timeout environment variable, this new call picks up admission's 15-minute deadline, whereas the supported wrapper and testing guide leave the watchdog disabled by default. Long existing checks can now fail without a settings change.
    Confidence: 0.93
  • [P2] Keep declaration consumers checked on supported hosts — test/scripts/write-plugin-sdk-entry-dts.test.ts:309-315
    This assertion now treats refusal status 75 as success on non-Linux hosts, so the fixture can pass without typechecking its generated declarations. The unified-entry declaration test makes the same change; preserve a real consumer check on those hosts.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.93

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 significant, but non-emergency, local-check compatibility concerns.
  • merge-risk: 🚨 compatibility: The introduced routing can refuse existing non-Linux commands and time out checks that previously had no default deadline.
  • merge-risk: 🚨 automation: Serial admission changes compiler scheduling, while stripe-duration evidence for the resulting CI behavior remains unresolved.
  • 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 ordinary contributor proof gate does not apply to this member-authored PR. The body cites focused Testbox validation at an earlier head for the wrapper-to-compiler path; it does not establish current-head platform behavior or serialized-stripe duration. The diff changes no stored-data contract.

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 the platform and default-deadline policy, then prove the selected upgrade behavior.
  • Restore meaningful declaration-consumer checks on supported hosts.
  • Measure serialized compiler stripes against their CI time budgets.

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 (3 earlier review cycles)
  • reviewed 2026-09-28T04:54:47.117Z sha 3151e1d3f002e8db3fc671b6a678d4dd487ad431 :: blocked before merge. :: [P1] Preserve a working path for non-Linux typechecks | [P2] Keep declaration-consumer checks meaningful on non-Linux hosts | [P2] Remove the release-owned changelog entry
  • reviewed 2026-09-28T05:06:45.899Z sha 3151e1d3f002e8db3fc671b6a678d4dd487ad431 :: blocked before merge. :: [P1] Preserve a working path for non-Linux typechecks | [P1] Preserve the documented default typecheck duration | [P2] Keep declaration consumer checks meaningful on non-Linux hosts | [P2] Remove the release-owned changelog entry
  • reviewed 2026-09-28T05:45:58.853Z sha fbd132e5c18f45542ccdaf4d05ab2cee7e211905 :: blocked before merge. :: [P1] Preserve a working path for non-Linux typechecks | [P1] Preserve the documented default typecheck duration | [P2] Keep declaration consumers checked on supported hosts | [P2] Remove the release-owned changelog entry

@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
@vincentkoc
vincentkoc force-pushed the fix/semantic-boundary-memory branch from 41edba4 to 06bd63c Compare September 28, 2026 05:39
@vincentkoc
vincentkoc force-pushed the fix/semantic-compiler-memory branch from 3151e1d to fbd132e Compare September 28, 2026 05:39
@vincentkoc
vincentkoc force-pushed the fix/semantic-boundary-memory branch from 06bd63c to ebdcb13 Compare September 28, 2026 05:58
@vincentkoc
vincentkoc force-pushed the fix/semantic-compiler-memory branch from fbd132e to 4cb4529 Compare September 28, 2026 06:02

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