Repository navigation
fix: allow builds and lint in nested checkouts - #158674
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 7:09 AM ET / 11:09 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch routes declaration builds and extension lint through a checkout-bounded TypeScript compiler and replaces native build-info caches with portable input receipts so nested physical worktrees can build. Merge readiness✅ Ready for maintainer review Current main still rejects the reported nested-checkout build path. The branch has direct build, lint, and cache-upgrade evidence, and the documented compiler limitations have explicit maintainer acceptance. I found no discrete introduced defect. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's build tooling reads checkout source, TypeScript configuration, and installed dependencies to produce Plugin SDK and extension declarations. Lint and package-boundary checks then consume those declarations and their cache records. flowchart LR
A[Build or lint command] --> B[Declaration preparer]
B --> C[Checkout compiler]
C --> D{Input inside checkout?}
D -->|Yes| E[Declarations and receipt]
D -->|No| F[Build error]
E --> G[Plugin and SDK checks]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests -43, Config 0, Other -96. Total -138 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep compiler input admission in the shared build owner, rebuild legacy caches on a miss, and retain clear documentation of the accepted native-platform limits. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source and documentation identify the post-resolution ancestor-input failure, and the PR records an original-CLI failure in a nested checkout with an ancestor installation. This read-only review did not execute it. Is this the best way to solve the issue? Yes. A shared compiler filesystem boundary addresses the resolution behavior at its owner, while the recorded legacy-cache run supports the transition to portable receipts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 443a0676b929. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
The legacy-cache upgrade question now has direct proof recorded in the PR body: the real pre-PR preparer and TypeScript 7.0.2 generated an untouched legacy cache; the new preparer rebuilt it into Maintainer decision: accept the documented seven-platform coverage of this pinned development compiler and the disclosed variation in synthesized absent optional The first CI failure was a missed stable-only version validator in trusted parser admission. Commit |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
c2257c6 to
1e137ff
Compare
3d18f16 to
e21a591
Compare
Use the pinned native TypeScript 7.1 API to bound declaration resolution before ancestor installations can influence build and lint inputs. Keep portable input receipts, mutation fences, cache validation, and child cleanup, while preserving the SDK revision renderer dependency contract.
Accept the exact TypeScript prerelease version used by bounded declaration emission before trusted frozen-client parsing. Preserve lock, package, native executable, ownership, and integrity validation, with explicit range and tag rejection coverage.
e21a591 to
672a530
Compare
|
Merged via squash auto-merge.
|
* fix: allow builds and lint in nested checkouts Use the pinned native TypeScript 7.1 API to bound declaration resolution before ancestor installations can influence build and lint inputs. Keep portable input receipts, mutation fences, cache validation, and child cleanup, while preserving the SDK revision renderer dependency contract. * fix: admit pinned prerelease native compilers Accept the exact TypeScript prerelease version used by bounded declaration emission before trusted frozen-client parsing. Preserve lock, package, native executable, ownership, and integrity validation, with explicit range and tag rejection coverage. * test: include compiler worker in artifact ownership fixture
What Problem This Solves
Fixes declaration builds and extension lint failing when an OpenClaw worktree is nested beneath another Node.js checkout with its own
node_modules.User Impact
Developers and agents can use the normal build and lint commands from nested physical worktrees with their own frozen dependency install. This applies to Codex, OpenClaw, and other callers of the repository tooling; no harness-specific hook or operating-system sandbox is required.
Toolchain tradeoff: this pins the development dependency
typescriptto7.1.0-dev.20260917.1for its in-memory native emission API. It is a prerelease. Its native packages cover macOS arm64/x64, Linux arm/arm64/x64, and Windows arm64/x64; it does not supply the BSD, AIX, SunOS, or additional Linux architecture packages present in 7.0.2. There is no runtime configuration or data migration.Declaration stability: native emission can vary the
readonlymodifier on synthesized absent optional fields across repeated builds, including a public SDK declaration chunk. This was reproduced by compiling the same real entry three times in the same unchanged flat checkout, so it is not specific to nesting. This PR does not fix that compiler-emission stability issue or claim byte-identical public declarations.Why This Change Was Made
Some dependency declarations probe parent-relative paths that can reach an ancestor installation. The existing guard correctly rejected those consumed files, but could only report the failure after the compiler had resolved them. The shared compiler now makes outside candidates unavailable before resolution and emits declarations in memory, then validates consumed inputs before publishing outputs.
Build and lint retain checkout-local compiler and dependency ownership, symlink rejection, source/manifest receipts, mutation detection, portable cache validation, and failure cleanup. SDK API comparisons retain their existing ability to render revision snapshots using the installed compiler and linked dependencies. The old resolution-trace parser and native build-info receipts are replaced by recorded compiler reads and portable input receipts. Trusted parser admission also accepts the exact prerelease pin while retaining its manifest, lockfile, package identity, native executable, ownership, and integrity checks; ranges and dist-tags remain rejected.
Evidence
git diff --checkpassed.undefinedproperties gaining/losingreadonly, the expected helper signature adjustment, and resulting public facade/chunk references. No present-field type change was found. Repeatingapproval-auth-helpers.tsemission in the unchanged flat checkout reproduced thereason?: undefined/readonly reason?: undefinedvariation: three runs produced two variants, each with 13,986 recorded inputs and successful snapshot sealing. Complete cross-run input hashes were not retained, so this establishes repeated same-checkout variation without claiming identical full input snapshots.The full lint invocation remains red on three pre-existing
max-linesviolations in unchanged files:src/gateway/server-kernel.test.ts(1003/1000),src/agents/embedded-agent-runner/run/attempt-session-replay.test.ts(1025/1000), andsrc/config/sessions/session-accessor.sqlite-entry-cache-publication.ts(701/700). Windows-specific execution has not been run locally. The first hosted CI run failed 11 frozen Docker-client staging cases because trusted parser admission rejected the prerelease pin; this has been reproduced and repaired. Its remaining lanes were cancelled by CI fail-fast, so they are not counted as passing evidence.Landing verification
Real legacy-cache upgrade: the pre-PR preparer at
12e8edc5with integrity-verified TypeScript 7.0.2 produced a genuine.tsbuildinfoand cache record, then hit that cache. The current preparer saw that untouched old record, rebuilt it in 1.161s, replaced.tsbuildinfowith.inputs.json, and emitted identical declaration bytes for unchanged fixture source. Its next run was a warm hit with unchanged declaration, receipt, and record bytes and nanosecond mtimes. All four phases exited 0; combined preparer wall time was 2.365s.CI repair: all 11 formerly failing June/July committed-client staging cases and all 15 parser-admission table cases passed. The two existing June/July frozen-preflight cases also passed through the real provisioned parser. New range/tag rejection cases took 1.084s and 0.547s; they skip compiler provisioning because rejection must precede package admission. Script/test lint, root-test types, formatting, and diff checks passed.
A separate deliberate TS2322 cache-failure probe preserved old output and build-info bytes, but also reported an
EPERMprocess-group cleanup diagnostic. The group was verified gone and reported terminated. The clean four-phase sequence above is the primary upgrade evidence; this additional diagnostic is not claimed fixed.Final fixture repair: the next hosted run passed 111 jobs before failing the artifact-ownership test because its copied checkout omitted the new compiler worker. The fixture now includes that real worker; all ownership, lint-consumption, and cleanup assertions are unchanged. The formerly failing case passes in 9.79s wall time, targeted lint passes, and independent P0–P2 review is clean. A census found no other real preparer fixtures missing the worker. The fixture repair was validated at
c2257c63bd432ce0766d1cd96a1b1a81da57007f.Main regression and refreshed base: CI then exposed three Codex filesystem imports introduced on
mainby refactor(codex): deslop codex harness third pass #158613, outside this PR. The landed owner fixf2532a051f7auses existing public SDK error helpers without widening the import guard. All 23 guard cases passed on the actual fixed main. This PR was rebased onto repaired main96792697578a4705866aa95e56781de4cf819097;git range-diffreports all three PR commits patch-identical. The frozen install passed, and all 23 guard cases passed again with the PR's pinned compiler (57.17s wall). That refresh was validated at1e137ffde9f6048d5b9a5b3a307849e6b6fe2d31.UI reachability-runtime proof: the next CI run exposed an existing Bun GC test failure. A debug heap identified temporary
JITWorkListretention with no JavaScript owner path. Exact Linux/x64 CI Bun reproduced the failure; relocating fixture scope did not repair it and was discarded. The existing Node lane ran the unchanged chat/usage files: 263 passed in 5.37s. Recreating the original strong memo correctly failed atqueryObjects(...)=0with one retained instance, proving the assertion remains effective. Blacksmith Testbox proof, Node24.19.0 and pinned CI Bun1.4.3-canary.1+ddfce5d01. Main commit7f41da0c7e42already routes chat-thread through that required Node lane. This PR incorporates it via another patch-identical rebase, without changing tests, GC counts, assertions, or production UI code. That refresh was validated at3d18f16a467ddd475babb3322f3d50c58ca48110; its frozen install passed.Concurrent main cleanup reconciled: main
35f17c7f5d97centralized cache-fixture matching and removed redundant tests, creating two test-only conflict hunks. The resolution preserves its shared matching helper, the bounded compiler worker, output-root ownership, and specialized consumer/relocation checks. Fresh isolated Codex integration review is clean. All 44 cache tests passed in 45.65s, two selected boundary tests passed in 13.48s, and the real ownership/lint-consumption/cleanup regression passed in 6.04s. Root-test types, targeted lint, formatting, and diff checks passed. The two follow-up fixes remain patch-identical; package manifest and lockfile are unchanged from the previous frozen install. That reconciliation was validated ate21a591e3a0208ac9181c574a86343b6e2e4ee87.A subsequent main cleanup removed a redundant SDK inventory test, producing one adjacent-import conflict. The mechanical reconciliation keeps the async compiler namespace import and the inventory removal. Independent inspection found no behavior change; both source-mutation fence cases passed in 6.46s and the declaration-printer case passed in 7.26s (wrapper wall times). The two follow-up commits are still patch-identical. Current head:
672a530e6d2d2a096065256e261de06ff9df0f1b, based on main2442c3026935502866361d05dd28cef5cd055137; fresh hosted CI is required.