Skip to content

fix: patch runtime dependencies and bound brace nesting - #252

Open
jefft72 wants to merge 3 commits into
codex/token-pr-companion-00-catalog-fixturesfrom
codex/token-pr-companion-01-deps
Open

jefft72 wants to merge 3 commits into
codex/token-pr-companion-00-catalog-fixturesfrom
codex/token-pr-companion-01-deps

Conversation

@jefft72

@jefft72 jefft72 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Review size: 1146 meaningful changed lines, plus 195 generated lockfile lines and 49 documentation lines, counted as additions plus deletions.

Base: codex/token-pr-companion-00-catalog-fixtures; head: codex/token-pr-companion-01-deps.

Updates runtime transport and test dependencies and fixes deeply nested build-tool glob patterns exhausting the brace parser's stack.

Fixes clean npm 10 installs reporting Missing: braces@3.0.3 from lock file by applying the private patch consistently across workspace dependencies.

The vendored JavaScript, private package manifest, MIT license, configuration, and regression tests are included in the meaningful count.

Reasoning

Undici and Vitest patch pins and regenerated distribution locks keep source, installed runtime, and shipped CLI dependency graphs consistent.

GHSA-vfj7-8cjw-p6xm has no upstream patched release, so the existing development-tool shx dependency chain uses a reviewed local patch of braces 3.0.3 with a transparent private name and version.

The patch bounds structural recursion to 100 levels independently of caller options and checks caller-supplied AST values before coercion.

It preserves normal glob behavior and the existing build tools, with provenance and retirement instructions included beside the source.

Registry audit results do not independently establish the security of the private source; its review and regression coverage provide additional evidence.

The root override is required because npm 10 does not reliably propagate the ancestor-scoped override through workspace dependencies, causing clean CI installation to reject the unchanged lockfile.

The current affected consumer is shx; production distribution locks exclude this local development dependency.

Future braces consumers inherit the root override and require compatibility review.

The prerequisite isolates deterministic catalog tests and enables full hosted CI on every stacked head.

Changes

  • Updates Undici to 8.10.2, Vitest and coverage packages to 4.1.11, and the transitive brace-expansion patch.
  • Preserves exact direct dependency versions across all affected workspace manifests and regenerates the root, shrinkwrap, and CLI installation locks.
  • Vendors the reviewed MIT-licensed braces source as @diffex-cloud/braces@3.0.3-diffex.1, pinning its fill-range dependency to 7.1.1.
  • Adds a local development dependency and a root override that resolves the private patch consistently under npm 10 and npm 11, without adding it to shipped production locks.
  • Copies the vendor directory into the runtime image build stage before dependency installation.
  • Tests the actual installed shx dependency chain, build-tool CLI copy behavior, normal alternatives and ranges, depth boundaries, cycles, and malformed AST values.

Testing

  • Reproduced stack exhaustion through the installed shx -> shelljs -> fast-glob dependency and verified the existing CLI literal-pattern fallback.
  • Reproduced the hosted clean-install failure in Linux with Node 22.23.3 and bundled npm 10.9.9.
  • npm ci --ignore-scripts using the unchanged generated lockfile passed under npm 10.9.9 and npm 11.16.0; both installed the private patch through the real shx dependency chain and passed all 11 security tests.
  • npm run check, including all pin, distribution-lock, type, and browser checks.
  • npm run build, using captured public provider responses with Together's DeepSeek-V4-Pro omitted.
  • node --test scripts/vendored-braces-security.test.mjs: 11 tests passed.
  • From packages/ai: node ../../node_modules/vitest/dist/cli.js --run test/together-models.test.ts test/generate-models-strict.test.ts: 7 tests passed.
  • ./test.sh, using the repository's credential-isolated runner.
  • Fresh npm audit --json and npm audit --omit=dev --json: zero registry-reported vulnerabilities.
  • Independently reviewed the complete vendor source and companion integration, including the regenerated lockfile and Docker installation path.

@jefft72 jefft72 self-assigned this Oct 2, 2026
@jefft72
jefft72 changed the base branch from main to codex/token-pr-companion-00-catalog-fixtures October 3, 2026 04:30
@jefft72 jefft72 changed the title chore: patch runtime transport and test dependencies fix: patch runtime dependencies and bound brace nesting Oct 3, 2026
@jefft72 jefft72 added the documentation Improvements or additions to documentation label Oct 3, 2026
@Pepps233
Pepps233 self-requested a review October 4, 2026 18:02
@Pepps233
Pepps233 added this pull request to stack #256 October 4, 2026 18:34
Update exact Undici, Vitest and coverage versions to the reviewed security patches and preserve the corresponding generated distribution locks. Keep the dependency-only review separate from hosted model behavior while maintaining one consistent source, installation and shipped CLI graph.
The shx dependency chain still uses braces 3.0.3, which can exhaust recursive AST walkers on deeply nested patterns and has no upstream patched release. Vendor the reviewed MIT source with fixed depth and AST-value guards under a transparent private version, scope its override to shx, copy it before Docker installation, and verify the real installed glob and CLI paths while preserving existing transport and test dependency patches.
Apply the reviewed local braces patch through a root override so npm 10 and npm 11 resolve it consistently across workspace build dependencies. Preserve the private package identity and unchanged generated lockfile, and document the current development-only consumer scope.
@Pepps233
Pepps233 force-pushed the codex/token-pr-companion-01-deps branch from 91aceee to f8a98ea Compare October 4, 2026 18:35

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

bug fix coding-agent documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants