Skip to content

fix(tooling): contain compiler graph discovery - #160112

Open
vincentkoc wants to merge 5 commits into
mainfrom
fix/semantic-boundary-memory
Open

vincentkoc wants to merge 5 commits into
mainfrom
fix/semantic-boundary-memory

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Related: #160010
Prerequisite merged: #160094
CI provisioning prerequisite: #160014

Problem and repair

Compiler graph discovery starts native programs for configuration expansion and file inventories. These queries can grow far beyond the selected file list. Cancellation previously covered an active child but not admission waits or gaps between queries.

Both public graph-inspection entrypoints now use shared host admission and Linux kernel process-tree containment. Cancellation covers the complete operation, preserves the original signal status, stops later queries and preserves uncertain ownership as an error. Inventory output remains bounded at 256 MiB.

The supplemental boundary scheduler now launches the graph's actual Node owner directly. Its 250 ms force-kill deadline remains for disposable checks; graph cancellation instead joins the implementation through cgroup extinction and admission release. Repeated signals cannot kill that owner, and cancellation stops queued checks from starting.

Platform behavior

Direct native graph queries currently require a qualified Linux backend. macOS and Windows must run the complete check through a bounded Linux worker or VM; there is no unbounded fallback. The documented route now names the actual package command:

node scripts/crabbox-wrapper.mjs run --workload ci-fast --target linux -- corepack pnpm lint:tmp:tsgo-core-boundary

The non-Linux compatibility review and live qualification of that whole-command route remain open. Remote preparation does not promise local generated artifacts. General compiler and lint activation remain separate slices.

Validation

Current head: 7a5e75cf9491238d3b649c00ca34fb40e292674d.

  • Exact-head lifecycle suite: 3/3 passed, one-worker wall 6.70 seconds (7.44 seconds including repository wrapper).
  • Exact-head supplemental scheduler: 31/31 passed, one-worker wall 4.09 seconds (4.88 seconds including wrapper).
  • Real Linux regression starts a compiler with a detached descendant, cancels the scheduler, and verifies both processes stopped, the kernel scope empty/removed, and admission released.
  • Barrier fixtures prove timeout, SIGINT, SIGTERM, SIGHUP and repeated cancellation join cleanup; queued work remains unstarted. Existing disposable-child shutdown fixtures remain green.
  • Scripts typecheck, changed production typed lint, formatting and whitespace passed. Final remote command: 54.187 seconds.
  • Earlier unchanged graph/admission tests and a real repository graph query passed; native query limits were 3.5 GiB. The original focused suite had 51 passing cases.
  • Independent P0–P2 review found no actionable source defect before the mechanical ES library-target correction. It explicitly leaves platform compatibility unverified. Hosted exact-head CI and lifecycle CI cost remain pending.

Previous review fixes: corrected the nonexistent remote entrypoint and recorded this process suite's measured cost. Linux backend qualification and platform policy remain explicit landing requirements.

Production/tooling +158/-61, tests +470/-16, docs +25. Growth owns complete cancellation and the scheduler/graph lifetime boundary; it reuses existing admission and compiler containment without a new runner, dependency or configuration switch.

@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: M 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:51 AM ET / 06:51 UTC (Revision 5).

ClawSweeper review

What this changes

The branch puts TypeScript compiler graph queries under shared memory admission, extends cancellation through cleanup, and updates the supplemental check scheduler, tests, and CI guidance.

Regression provenance

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

Merge readiness

⛔ Blocked before merge - 5 items remain

This PR remains useful: current main has the admission helper but does not apply it to compiler graph discovery. The earlier non-Linux compatibility blocker remains unresolved; the corrected command example and recorded test cost address the other prior findings.

Priority: P2
Reviewed head: 7a5e75cf9491238d3b649c00ca34fb40e292674d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The process-lifetime repair has meaningful focused coverage, but the established non-Linux compatibility break remains a merge blocker.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Its added Linux test drives the registered scheduler and graph owner through real process and kernel-scope cleanup, with an exact-head pass reported in the PR body; non-Linux whole-command qualification remains open. No stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Its added Linux test drives the registered scheduler and graph owner through real process and kernel-scope cleanup, with an exact-head pass reported in the PR body; non-Linux whole-command qualification remains open. No stored-data contract changes.
Evidence reviewed 8 items Introduced activation: The PR replaces the prior managed compiler query with shared semantic admission in both graph-inspection entrypoints.
Current-main behavior: Current main still invokes the managed compiler command directly for graph queries, so the central change is not already implemented.
Non-Linux refusal: The existing admission owner returns status 75 before launching a compiler on every non-Linux host. The PR now calls it from graph discovery.
Findings 1 actionable finding [P1] Preserve a working non-Linux graph-check path
Security None None.

How this fits together

OpenClaw’s CI tooling asks the TypeScript compiler for project configurations and file inventories. Those results feed boundary checks and changed-file type-check planning.

flowchart LR
  A[CI or changed-file check] --> B[Graph discovery]
  G[Supplemental check scheduler] --> B
  B --> C[Host admission]
  C --> D[Compiler process tree]
  D --> E[Project file inventory]
  E --> F[Boundary and type-check plan]
Loading

Decision needed

Question Recommendation
May this change make local graph checks fail closed on macOS and Windows before a qualified complete-command Linux route is available? Qualify the bounded route first: Provide and demonstrate the complete affected workflow on supported non-Linux hosts before activating the refusal, after CI backend provisioning lands.

Why: The branch intentionally trades an existing working local path for a stronger memory boundary; source establishes the break, but accepting that operator impact requires maintainer intent.

Before merge

  • Preserve a working non-Linux graph-check path (P1) - Both public graph-inspection paths now call runSemanticCheck, which returns 75 before launch on macOS and Windows; current main runs these queries locally. The documented command covers a Linux invocation but does not establish a qualified route for the complete affected workflows. Resolve that compatibility path or obtain explicit maintainer acceptance before merge.
  • Resolve merge risk (P1) - Existing macOS and Windows graph-check workflows would stop before compiler launch with status 75. The documented Linux route has not been qualified for the complete affected checks.
  • Resolve merge risk (P1) - The CI containment provisioning prerequisite fix(ci): prepare kernel memory containment for semantic checks #160014 remains open; graph checks on runners without its verified backend can refuse admission.
  • Complete next step (P2) - Resolve the non-Linux compatibility decision and qualify the complete bounded workflow and CI backend before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve a working non-Linux graph-check path — scripts/check-tsgo-core-boundary.mts:55-61
Agent review details

Security

None.

PR surface

Tests +454, Docs +25, Other +97. Total +576 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 470 16 +454
Docs 1 25 0 +25
Config 0 0 0 0
Generated 0 0 0 0
Other 3 158 61 +97
Total 9 653 77 +576

Review metrics

Metric Value Why it matters
Production and test growth production +97 net, tests +454 net The PR explains the production growth as ownership of cancellation through admission release; the larger test addition covers process lifetime.
Reported focused test cost 3 lifecycle cases in 6.70s; 31 scheduler cases in 4.09s The PR body now records one-worker costs for the changed suites.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160010
Summary: This PR is a graph-discovery slice of the broader semantic-check memory repair; the related PRs own distinct prerequisites or activation paths.

Members:

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

Merge-risk options

Maintainer options:

  1. Preserve a supported graph-check route (recommended)
    Qualify the complete bounded Linux workflow for macOS and Windows users, and land CI backend provisioning before enabling admission in these entrypoints.
  2. Own the fail-closed tradeoff
    A maintainer may accept the local behavior change after verifying the documented complete-command route and its operator impact.

Technical review

Best possible solution:

Keep the complete graph-check workflow usable on supported developer hosts through a qualified bounded Linux route, and activate CI admission after its runner backend is provisioned.

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

Yes for the merge regression: the new graph-query call reaches an admission helper that returns 75 on macOS and Windows before launch. The reported high-memory incident was not reproduced in this read-only review.

Is this the best way to solve the issue?

No as submitted. Linux containment addresses the process lifetime, but the complete non-Linux workflow and CI backend must be qualified before the new refusal is safe to land.

Full review comments:

  • [P1] Preserve a working non-Linux graph-check path — scripts/check-tsgo-core-boundary.mts:55-61
    Both public graph-inspection paths now call runSemanticCheck, which returns 75 before launch on macOS and Windows; current main runs these queries locally. The documented command covers a Linux invocation but does not establish a qualified route for the complete affected workflows. Resolve that compatibility path or obtain explicit maintainer acceptance before merge.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded CI tooling repair with a concrete compatibility blocker, rather than an urgent user-facing runtime failure.
  • merge-risk: 🚨 compatibility: Both existing graph-inspection callers would refuse local execution on macOS and Windows.
  • merge-risk: 🚨 automation: The PR activates admission for CI graph checks while their runner containment provisioning prerequisite remains open.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit 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 external-contributor proof gate does not apply to this MEMBER-authored PR. Its added Linux test drives the registered scheduler and graph owner through real process and kernel-scope cleanup, with an exact-head pass reported in the PR body; non-Linux whole-command qualification remains open. No stored-data contract changes.

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)
  • Jesse Merhi: 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.

  • Qualify the complete affected check through a bounded Linux backend from macOS and Windows, or obtain explicit acceptance of the local fail-closed change.
  • Land and verify the CI containment provisioning prerequisite before activating graph admission.

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 (4 earlier review cycles)
  • reviewed 2026-09-28T04:47:39.783Z sha 41edba446f5d9c5ba99e64d160b9caeca17040b9 :: blocked before merge. :: [P1] Preserve a working non-Linux graph-check path | [P3] Record the new lifecycle suite's measured cost
  • reviewed 2026-09-28T05:46:05.393Z sha 06bd63c :: blocked before merge. :: [P1] Preserve a working non-Linux graph-check path | [P3] Record the lifecycle suite's measured cost
  • reviewed 2026-09-28T06:05:34.289Z sha ebdcb13 :: blocked before merge. :: [P1] Preserve a working non-Linux graph-check path | [P2] Fix the remote graph-check command | [P3] Record the lifecycle suite's measured cost
  • reviewed 2026-09-28T06:20:50.066Z sha fd124c2 :: blocked before merge. :: [P1] Preserve a working non-Linux graph-check path | [P2] Fix the remote graph-check command | [P3] Record the lifecycle suite’s measured cost

Base automatically changed from fix/semantic-host-admission to main September 28, 2026 05:34
@vincentkoc
vincentkoc force-pushed the fix/semantic-boundary-memory branch from 41edba4 to 06bd63c Compare September 28, 2026 05:39
@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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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 06bd63c to ebdcb13 Compare September 28, 2026 05:58
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 28, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 28, 2026 06:13
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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

docs Improvements or additions to documentation 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