Skip to content

feat(prepack): gate installed dependencies (AB7014/AB7015); host-native INSTALL.md - #547

Merged
ScriptedAlchemy merged 38 commits into
mainfrom
feat/prepack-dependency-gate
Sep 4, 2026
Merged

feat(prepack): gate installed dependencies (AB7014/AB7015); host-native INSTALL.md#547
ScriptedAlchemy merged 38 commits into
mainfrom
feat/prepack-dependency-gate

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Why

npm install -g cargo-hauler@0.4.7 fails for every consumer on npm 12:

npm error code EALLOWREMOTE
npm error Refusing to fetch "@agent-bundle/runtime@https://pkg.pr.new/…"

Nothing shipped in that package imports @agent-bundle/runtime, effect, bashjsast, or any other third-party module — the build inlines all of them into dist/bin and the host packs — but package.json still listed the whole build-time stack under dependencies, including a pkg.pr.new tarball and a github: ref that npm 12 refuses by default (allow-git=none, allow-remote=none). The framework's own templates and examples modelled that shape.

What

  • AB7014 (prepack): a dependencies / optionalDependencies / peerDependencies field names packages that no packed JavaScript imports or requires, one diagnostic per field. Evidence is read from the packed bytes npm would publish (ESM lexer for import, literal require("…") scan, package-name reduction, Node built-ins ignored); a mention in a comment can only keep a dependency, never report one. devDependencies are never inspected.
  • AB7015 (prepack): an installed-dependency entry resolves outside a registry (git / github: & friends / owner/repo shorthand / http(s): tarball / file: / link: / relative path). npm: aliases and workspace: protocols count as registry specifiers.
  • Emitted INSTALL.md now states the bundle is self-contained and nothing requires the agent-bundle CLI; the Claude and Codex uninstall blocks use the host's own claude plugin uninstall … --keep-data + marketplace remove / codex plugin remove + marketplace remove (the exact commands agent-bundle uninstall runs), and every remaining agent-bundle install/uninstall/doctor mention is marked optional.
  • create-agent-bundle mcp-server and cli-tool templates, and examples/{audiobook-curator,host-test,worktree-proximity}, declare @agent-bundle/runtime, react, zod under devDependencies.
  • Docs: docs/diagnostics.md, en+zh guide/distribution/{validation,installation}.mdx, reference/{index,targets-artifacts}.mdx. Changeset included.

Proof

Run against the real published cargo-hauler@0.4.7 tarball (77 files, 138 MB, 1.1 s):

[AB7014] package.json dependencies names packages no packed JavaScript imports: "@agent-bundle/runtime", "@effect/atom-react", "@effect/platform-node", "@modelcontextprotocol/server", "bashjsast", "effect", "proper-lockfile", "react", "react-dom", "scheduler", "zod". …
[AB7015] package.json dependencies resolves packages outside a registry: "@agent-bundle/runtime" -> "https://pkg.pr.new/…", "bashjsast" -> "github:woolkingx/bashjsast#131f4b6…". …

Local: pnpm typecheck, rslint on changed files, pnpm test:unit (3260 pass), integration prepack/install/uninstall/doctor/adapter suites (427 pass), pnpm docs:site:build (parity OK).

Review status

  • Awaiting chatgpt-codex-connector.

Self-review

Reviewer: change-risk-reviewer subagent, model gpt-5.6-sol-medium, run against the diff vs origin/main at 9ce8c938f. Three findings, all fixed in 1e6e5cf76:

  1. Qualified createRequire factory calls (pack-dependencies.ts, loadCall) — Module.createRequire(…)("dep") and require("node:module").createRequire(…)("dep") reported as unrecognised, giving a false AB7014. Disposition: fixed in 1e6e5cf76factoryQualifier (dotted namespace of any depth, or require(…).) now precedes the factory in factoryCall/loadCall (so literalLoad and computedLoad) and in loaderBinding; the direct forms turned out to be matched already through the \b before createRequire, so the change makes that explicit and closes the one real gap (multi-level namespace bindings, ns.default.createRequire(…)). Seven it.each rows pin the behaviour (five direct forms including .resolve, one two-level binding, two computed → incomplete).
  2. Inline programs not scanned for import() (installScriptCommandDependencies) — node -e "import('optional-driver')" left a fetched optional dependency at warning AB7015. Disposition: fixed in 1e6e5cf76moduleLoads(source) is extracted from javaScriptEvidence (lexer imports + literal require/createRequire + completeness) and run over each inline program; a computed import(x) marks it incomplete and escalates every declared optional. Six-row table: literal import(), --input-type=module … await import(), computed import(), require() → error; import.meta and the name in a string → warning.
  3. Malformed installed manifest crashes prepack (executableCommands) — node_modules/<dep>/package.json that is not JSON threw a raw SyntaxError. Disposition: fixed in 1e6e5cf76readManifest parses with core/strict-json.ts's parseJsonWithoutDuplicateKeys inside a try, and a parse failure or non-object result takes the existing unreadable-manifest path (unscoped name as the guessed bin, known: false), never a throw. Test writes { not json for a declared broken-dep run by postinstall and asserts the gate completes with broken-dep not reported unused.

Second pass. Reviewer change-risk-reviewer, model gpt-5.6-sol-medium, run against the diff vs origin/main at 1e6e5cf76. Two warnings, both in pack-dependencies.ts, both fixed in 76056b7d1:

  1. Lexer failure treated as complete evidence (moduleLoads) — when readModuleImports() threw, imports became [] with complete still true, so a packed file or inline node -e program es-module-lexer rejects could hide a real import(): a fetched optional dependency the install script needs stayed at warning AB7015, and AB7014 could report a package such a file loads. Disposition: fixed in 76056b7d1 — a lexer failure now forces complete: false, the same conservative path as a computed load. Tests: a packed dist/unlexable.mjs with an unbalanced import("chosen-at-runtime" withholds AB7014; an inline node -e "import('optional-driver'" row escalates AB7015 to error. Both fail on 1e6e5cf76 (AB7014 reported / severity warning).
  2. Duplicate-key installed manifests lose npm-compatible bin evidence (readManifest) — parseJsonWithoutDuplicateKeys rejected a manifest npm reads fine (last duplicate key wins), so it fell to the guessed-bin path and an alias whose effective name decides a string-form bin ran undetected. Disposition: fixed in 76056b7d1 — third-party manifests are parsed with plain JSON.parse inside the same try plus the object check, mirroring npm; a comment states why this is deliberately not core/strict-json.ts (the semantics differ: that parser guards our own config). Test: a git-specifier optional dependency whose installed manifest has "name": "first-name", "name": "@scope/effective" and "bin": "cli.js", with postinstall: effective --init → AB7015 error and no AB7014, proving last-key-wins. Fails on 1e6e5cf76 (severity warning).

Docs (docs/diagnostics.md, en/zh validation.mdx) and the changeset gained one clause each for the two behaviours (lexer-rejected source withholds AB7014; manifests read as npm reads them, unscoped name standing in when not JSON). Gate green locally (typecheck, lint, test:unit, full prepack.test.ts, docs:site:build); CI green on 76056b7d1 without reruns.

…mitted INSTALL.md host-native

A published plugin installs nothing beyond its own files: the build inlines
every dependency into dist/bin and the host packs, so package.json
dependencies/optionalDependencies/peerDependencies entries only make every
consumer's npm install fetch build-time packages — and fail outright under
npm 12's default allow-git=none / allow-remote=none when one is a git or
remote specifier (cargo-hauler 0.4.7 is uninstallable for exactly this).

- AB7014: an installed-dependency field names packages no packed JavaScript
  imports or requires (evidence read from the packed bytes, one diagnostic
  per field).
- AB7015: an installed-dependency entry resolves through git, a GitHub
  shorthand, a remote tarball, or a path.
- Emitted INSTALL.md states the bundle is self-contained, uses the host's
  own claude plugin / codex plugin commands for uninstall, and marks every
  agent-bundle install/uninstall/doctor mention as optional automation.
- create-agent-bundle mcp-server and cli-tool templates, and the examples,
  declare @agent-bundle/runtime, react, and zod under devDependencies.
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dd51de5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Patch
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T20:00:53.010694Z a093992 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@547
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@547
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@547
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@547

commit: dd51de5

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3252614d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts
…ssifier fixes

- readModuleImports consults the digest cache itself (a parsed result answers
  a lexed request); rememberedModuleImports and its three call-site lookups
  are gone.
- pack-dependencies.ts is evidence only (declared entries, imported names,
  classifiers); AB7014/AB7015 are emitted in pack-inventory.ts beside
  AB7010-AB7013 through its diagnostic helper and a shared quoteAll.
- isRegistrySpecifier catches scp-style git@host:path and Windows drive
  paths; packageNameOf drops its dead @-guard for one positive shape.
- readFile errors other than ENOENT propagate; packed files are read in
  parallel; AB7015 says optionalDependencies fail to fetch, not install.
- Table tests for the classifiers; prepack fixture tests share
  withPackageDocument and assert codes/names rather than sentences.
- Claude/Codex INSTALL.md share the optional-CLI paragraphs.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

…ts, optional peers, and the packer

- ~1.2.3 is a semver range, not a home path (AB7015 false positive).
- Packed .d.ts/.d.mts/.d.cts files count as dependency usage: a consumer
  needs the package that provides referenced types even without a runtime
  import (AB7014 false positive).
- peerDependenciesMeta optional peers are never installed by npm and are
  not inspected.
- workspace:/catalog: are registry specifiers only when pnpm, Yarn, or Bun
  runs the pack (npm_config_user_agent) and rewrites them; npm publishes
  them verbatim and consumers fail with EUNSUPPORTEDPROTOCOL.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48165af029

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-inventory.ts Outdated
Comment thread packages/agent-bundle/src/install/surface.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
…classifiers, table-tested scanners

- prepack() turns npm_config_user_agent into packerRewritesWorkspaceProtocols;
  isRegistrySpecifier classifies the string as written and isWorkspaceProtocol
  lets the emitter apply the policy. RegistrySpecifierOptions is gone.
- optionalPeers is one set computed once; declarationSpecifiers is exported
  and table-tested; requireCall and declarationSpecifier share quotedLiteral.
- The JS path keeps the lexer on purpose: bundled library docblocks contain
  literal 'from "effect"' lines a text scan would count as usage.
- pack-inventory uses isErrno and sha256Hex like its sibling; module-imports
  caches per check level only; AB7015 wording per partition; docs/changeset
  name declaration references and workspace protocols.
…s; INSTALL.md gates marketplace removal

- require.resolve / createRequire(...).resolve / import.meta.resolve with a
  literal argument count as usage for AB7014.
- bundleDependencies (name list or true, either spelling) are embedded in the
  tarball and never reported by AB7015.
- A name under both dependencies and optionalDependencies is judged by its
  optional entry, as npm does.
- Emitted INSTALL.md no longer lists 'plugin marketplace remove' in the
  uninstall block: it is a separate step gated on 'plugin list' showing no
  other plugin from the marketplace (any scope or project, for Claude).
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99e53f8640

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
- bundleDependencies never covers peerDependencies (npm packs no
  node_modules entry for a peer-only name) and 'true' covers dependencies
  only, so AB7015 still reports a peer's file:/git/workspace specifier.
- An npm: alias is a registry specifier only when its target is: npm:bar@file:../bar,
  npm:bar@workspace:*, and nested npm: are reported.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a2be523b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/install/surface.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread website/docs/en/guide/distribution/validation.mdx Outdated
…lds AB7014, Claude marketplace inventory

- /// <reference types="x" /> counts for x and @types/x (@types/scope__name
  when scoped): the declaration cannot say which one the consumer needs.
- A computed import(expression) in packed JavaScript may load any declared
  package, so importedPackageNames reports complete=false and AB7014 is
  withheld; the recovery text and docs say so.
- Claude INSTALL.md: marketplace removal is gated on the cross-project
  registry plugins/installed_plugins.json, not just 'claude plugin list',
  and points at the optional uninstaller that performs that inventory.
- Docs: externalized runtime packages belong under dependencies; AB7014
  permits them.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e3554d4e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-inventory.ts Outdated
…ript bins count as usage

- A packed '#subpath' import counts for every package the manifest's
  imports map targets (conditional targets included).
- require(expression) withholds AB7014 like import(expression); bundler
  runtimes (__webpack_require__) never match.
- A dependency a consumer-side preinstall/install/postinstall/prepare script
  names, or whose bin command it runs (read from node_modules/<name>), is
  used.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ca79200fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-inventory.ts Outdated
…vable optional deps warn

- require.resolve(x), import.meta.resolve(x), and a direct
  createRequire(...)(x) with a non-literal argument mark the evidence
  incomplete like require(x); path.resolve/Promise.resolve never match.
- AB7015 on optionalDependencies is a warning: npm continues an install
  without an optional dependency it cannot fetch.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 346da1b08c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-inventory.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
… computed loads withhold AB7014

- prepack() throws only on error-severity diagnostics and returns the
  surviving warnings on PrepackResult.diagnostics; the CLI prints them.
- require("driver/" + variant) and the template-literal form count as
  computed loads and mark the evidence incomplete.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

… names

createRequire(new URL("./entry.js", import.meta.url))("driver") is a
load: the factory argument may nest calls two deep. A delegated npm run
"setup" names the script the shell unquotes.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76b2de6684

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-inventory.ts
Comment thread packages/agent-bundle/src/build/pack-inventory.ts
…cript files load optional deps

A file: or bare path inside the package whose source directory manifest or
tarball file is packed is installable from the consumer's copy, so AB7015
exempts it like a packed bundleDependencies entry. An install script that
runs a packed file (node install.cjs) needs every package that file loads,
following relative imports through the tarball, so a fetched optional
dependency reached that way stays fatal.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0351b9c38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-inventory.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
…test/start delegation, validate packed file: sources

installScriptFiles tokenizes the shell command keeping quoted words whole and resolves an extensionless path the way Node does (scripts/install -> scripts/install.js; .cjs/.mjs are never tried). Delegated-run traversal follows npm's direct script commands (test/t/tst/start/stop/restart) with their pre/post hooks. A file: source shipped in the tarball is exempt from AB7015 only when the packed copy is installable: a directory whose package.json parses to an object, or a (gzipped or plain) tar holding <dir>/package.json.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb2f5fc15e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
…, follow own-file imports targets, allow call-site comments

tarHoldsPackage validates each ustar header checksum and payload bounds and JSON-parses the <dir>/package.json payload before a packed file: tarball exempts AB7015 (npm: TAR_BAD_ARCHIVE / EJSONPARSE). shellWords splits &&, ||, ;, |, & without surrounding whitespace so 'node install.js&&echo done' still follows install.js. Install-script module traversal enqueues relative imports-map targets ('#setup' -> ./setup.js) instead of dropping them. Comments between a CommonJS loader and its parentheses, or around the literal, are trivia for literalLoad and never start a computed argument.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1711da468

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
…rts wildcards, shadowed peers

AB7015 escalation of an optional dependency now needs the install script to run it: a bin in command position (after env assignments, options, npx/bunx/cross-env/env wrappers and pnpm/npm/yarn/bun exec|dlx|x), a node_modules/<name>/ file, or a require in an inline node -e program; a bare mention (echo foo) stays keep-only AB7014 evidence. packedModule consults each packed directory manifest's main before index.js, as Node does. Imports-map specifiers resolve to the exact or best wildcard key with * substituted, for install traversal and for AB7014 reachability. declaredDependencies drops a peer that dependencies or optionalDependencies also names, whose selector npm never reads.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b5441c93c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6a5d214a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/api.ts
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a093992d08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/build/pack-dependencies.ts
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts Outdated
Comment thread packages/agent-bundle/src/build/pack-dependencies.ts
ScriptedAlchemy and others added 4 commits September 4, 2026 20:54
…led manifests as npm does

Second self-review pass on 1e6e5cf (gpt-5.6-sol-medium):

- A packed file or inline `node -e` program es-module-lexer rejects now
  marks its evidence incomplete: its `import()` calls cannot be reported,
  so AB7014 is withheld for the package and a skipped optional dependency
  an install script needs escalates to an AB7015 error instead of hiding
  behind an empty import list.
- `node_modules/<dep>/package.json` is parsed with plain `JSON.parse`,
  as npm parses it, so the last of duplicate keys decides a string-form
  `bin` name; the strict duplicate-key parser is for our own config, not
  a third party's manifest (comment says why it is not strict-json.ts).

Tests: lexer-rejected packed file withholds AB7014; lexer-rejected inline
program escalates AB7015; duplicate-`name` manifest resolves the effective
unscoped bin. All three fail on 1e6e5cf. Docs (diagnostics.md, en/zh
validation.mdx) and the changeset gain one clause each.
@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) September 4, 2026 22:16
@ScriptedAlchemy
ScriptedAlchemy merged commit cbda5ab into main Sep 4, 2026
14 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the feat/prepack-dependency-gate branch September 4, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant