openclaw/scripts/run-stylelint.mts
Peter Steinberger 62395281ff
fix(tooling): prevent accidental shared dependency installs (#141719)
* fix(tooling): prevent accidental shared dependency installs

Stop creating implicit checkout-root dependency links during tool bootstrap.
Refuse default pnpm reconciliation through borrowed roots before linking,
while preserving explicit hydrated aliases, existing read-only borrows,
and configured-to-local toolchain fallback.

Include the early guard in package files and document its checkout-root
scope, lifecycle bypasses, and concurrent-path limits.

Validation: 127 focused Linux tests, seven real pnpm install cases,
packaged-root command proof, full checks plus final scoped loader checks,
and independent P0-P2 review.

* fix(tooling): audit install hook and align bootstrap coverage

Include the dependency ownership guard in the exact install lifecycle
contract and dependency fingerprint inputs so CI admits the hook and
invalidates cached dependencies when its implementation changes.

Update the existing wrapper expectation for the intentionally removed
implicit primary-checkout borrowing path while retaining hydration proof.

Validation: reproduced both failures, 517 workflow guards (2 existing
skips), 98 bootstrap/ownership tests, full scoped Linux checks, and
independent P0-P2 review.

* test(tooling): align isolated harness and routing contracts

Provision the copied Docker harness's TypeScript package explicitly and
update the preflight diagnostic and dedicated shim test routing expectations.

Validate compact tooling runner capacity from each resulting group's compiler
membership, preserving all file-policy and negative mutation checks without
freezing incidental compiler co-tenants onto a larger runner.

Validation: all 604 affected Linux tests, complete scoped checks, original
failure reproductions, planner inventory attribution and independent P0-P2
review. No production dependency or capacity policy changed in this follow-up.

* test(tooling): keep bootstrap cases in the runtime owner suite

Preserve all eight bootstrap cases and fixture logic in the existing local
runtime suite, with scoped environment cleanup and precise test routing.
The standalone filename fragmented the integrated GitHub compact plan into
81 jobs; the actual consolidated merge fits all three plans within80.

Keep the cap, estimates, compiler capacity, assertions and test coverage.
Validation: identical moved AST/token bodies, 571 local tests, 624 integrated
Linux tests and full scoped checks, exact merged planner proof, and clean
independent P0-P2 review.
2026-09-07 20:09:36 -07:00

21 lines
811 B
TypeScript

// Runs Stylelint through the linked-worktree-aware repository toolchain.
import path from "node:path";
import { runWithFailedTrailer } from "./lib/failed-trailer.mts";
import { resolveRepoToolBinPath } from "./lib/local-check-runtime.mts";
import { runManagedCommand } from "./lib/managed-child-process.mts";
export async function runStylelint(args: string[] = process.argv.slice(2)) {
const stylelintPath = resolveRepoToolBinPath("stylelint");
return await runManagedCommand({
args: ["--config", path.resolve("config", "stylelint.config.mjs"), ...args],
bin: stylelintPath,
env: process.env,
requireProcessTreeExit: process.platform !== "win32",
});
}
if (import.meta.main) {
await runWithFailedTrailer("stylelint", async () => {
process.exitCode = await runStylelint();
});
}