Skip to content

fix: reuse installed private packages without registry auth, add ponharu age keys, harden yarn scan#1022

Merged
exKAZUu merged 9 commits into
mainfrom
fix/private-package-installed-copy-and-ponharu-keys
Jul 19, 2026
Merged

fix: reuse installed private packages without registry auth, add ponharu age keys, harden yarn scan#1022
exKAZUu merged 9 commits into
mainfrom
fix/private-package-installed-copy-and-ponharu-keys

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Jul 19, 2026

Copy link
Copy Markdown
Member

Customer Summary

  • wb setup-private-packages now works in environments without private-registry credentials (e.g. CI test steps) as long as the private packages are already installed, so repositories like ai-ocr can drop their custom workaround scripts.
  • Repositories managed by wbfy now encrypt fnox secrets for ponharu's two machines in addition to existing recipients.
  • The yarn→bun script conversion handles more shell edge cases correctly, and unsafe --out-dir values can no longer delete unrelated directories.

Technical Summary

  • wb setup-private-packages: registry packages whose installed copy in node_modules (root or .bun store) satisfies an exact-version or semver-range specifier are copied (dereferencing isolated-linker symlinks, preserving bundledDependencies subtrees) instead of downloaded; registry auth is resolved and required only when a download remains (dist-tag specifiers, including *, always download). Nested private dependencies of installed copies are deep-scanned eagerly; compatible version requirements merge order-independently (narrower requirement wins while queued, and requirements satisfied by the selected materialization's actual version are accepted); packages are marked selected before their manifests are deep-scanned so self-references validate against the selection.
  • Safety: --out-dir must not overlap @willbooster-private, node_modules, or the staging directory, and every recursively deleted output path is rejected if it contains a symlink component (canonical/lexical mismatch).
  • Version comparisons: exact versions compare as strings (build metadata distinguishes registry artifacts) in installedVersionSatisfies, specifierSubset, and materializedVersionSatisfies.
  • wbfy fnox recipients: added ponharu's two age public keys; the next wbfy run on each repository re-encrypts committed secrets for the new recipient set.
  • Yarn conversion scan: nested case statements restore the enclosing context at esac; ;& and ;;& clause terminators return to pattern context; <(/>( process substitutions and $(...) command substitutions execute even in data contexts; &< tokenizes as & + < (only &>/&>> are compound redirects).
  • Docs: CLI help and README describe the credential-free reuse and its dist-tag limitation.

Why

Testing

  • bun verify (type check + lint) passes; bun run test in packages/wb (171 tests) and packages/wbfy (210 tests) passes.
  • Manually verified against ai-ocr: bun wb setup-private-packages with no VERDACCIO_TOKEN copies @willbooster-private/llm-proxy@5.38.1 from the isolated-install store without contacting the registry.
  • CLI fixtures verified: bundled-dependency preservation, order-independent compatible constraints (including late-discovered nested ones via a local HTTP registry), genuine conflicts still failing, */dist-tag specifiers requiring registry access, self-referencing manifests validating against the selection, and symlinked/overlapping output paths being rejected while defaults succeed.
  • Multi-agent review (skills review, run 20260719-182356-7csa1d) converged to "No concern." after 8 rounds; CI on this PR is green.

exKAZUu and others added 2 commits July 20, 2026 03:20
…finish yarn-scan substitution handling

- wb setup-private-packages now copies @willbooster-private/* packages from
  node_modules when the installed version satisfies the specifier, so CI steps
  without Verdaccio credentials (e.g. ai-ocr's test step) can materialize them;
  downloads (and registry auth) are only required for packages that are not
  installed.
- Add ponharu's two age public keys to wbfy's fnox recipient set.
- Treat `$(...)` substitutions inside case subjects/patterns and array literals
  as executable in the yarn conversion scan, and tokenize `&>`/`&<` compound
  redirections correctly.
- Name the CaseContext type so the type-aware linter accepts the outer-state
  snapshot field.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
… in the yarn scan

`$(...)` inside a case subject/pattern or array literal executes its content,
so yarn there must convert; also tokenize `&>`/`&<` compound redirections as
redirects rather than separators, and fix adjacency detection for `name=(`
array literals appearing mid-separator-run.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
@exKAZUu exKAZUu self-assigned this Jul 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes the private package setup in packages/wb by reusing registry packages already installed in node_modules or the .bun store when they satisfy the version specifier, avoiding unnecessary downloads in credential-free environments like CI. Additionally, in packages/wbfy, it updates the FNOX age recipients and refactors the shell script tokenizer to correctly parse compound redirections (e.g., &>) and nested command substitutions within data contexts, supported by new test cases. There are no review comments, so I have no feedback to provide.

exKAZUu and others added 7 commits July 20, 2026 03:38
…enization

- Compare exact versions as strings in installedVersionSatisfies,
  specifierSubset, and materializedVersionSatisfies: semver comparisons ignore
  build metadata, but resolveVersion fetches exact specifiers verbatim, so
  artifacts differing only in build metadata must not be conflated.
- Preserve declared bundledDependencies subtrees when copying installed
  registry packages (the tarball legitimately contains them); git checkouts
  still exclude node_modules.
- Tokenize `&<` as `&` followed by `<` (only `&>`/`&>>` are compound
  redirections), so `true &</dev/null yarn compile` converts.
- Document the credential-free installed-package reuse in the CLI help and
  README.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
… yarn scan

- Track enclosing case contexts in a stack so a nested case's esac restores
  the outer pattern context instead of discarding it.
- Recognize adjacent `<(`/`>(` process substitutions as executable contexts in
  data positions (case subjects/patterns, array literals).
- Reject --out-dir values overlapping node_modules or the registry staging
  directory, which the command would otherwise delete or silently discard.
- Merge compatible nested version requirements (narrower wins) while a package
  is still queued, and accept requirements the selected materialization's
  actual version satisfies, so discovery order cannot fabricate conflicts.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
…use docs

- In collectNestedPrivatePackages, a package still awaiting its download (no
  installed copy selected, nothing extracted) narrows to a compatible nested
  requirement instead of reporting a conflict, matching collectPrivatePackages'
  queue behavior; materialized entries still conflict loudly.
- Document that only installed copies satisfying an exact version or semver
  range are reused without registry access; dist-tag specifiers always
  download (CLI help, error remediation, README).

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
- `*` resolves through the `latest` dist-tag, so installedVersionSatisfies and
  specifierSubset no longer treat it as a statically checkable range: an
  installed copy is never reused for `*`, and `*` never merges with other
  requirements.
- Insert a package into privatePackages before deep-scanning its manifests so
  a self-referencing nested requirement validates against the already selected
  version instead of narrowing the specifier after selection.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
A symlink component (e.g. `escape -> node_modules`) could smuggle the
recursive deletes past the lexical --out-dir guards and destroy the symlink's
target. All containment/overlap checks (and the paths later deleted/created)
now operate on canonicalized paths: symlinks in the deepest existing ancestor
are resolved and the not-yet-existing remainder reattached.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
- setup-private-packages output directories (--out-dir, @willbooster-private,
  the staging directory) are recursively deleted, so any canonical/lexical
  mismatch (a symlink component) is now rejected up front instead of resolving
  the delete onto the symlink's target.
- The yarn scan recognizes bash's `;&` clause terminator (tokenized as `;`
  plus an adjacent `&`) in addition to `;;`/`;;&`, so the following pattern is
  no longer rewritten as a command.

Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
…nstalled-copy-and-ponharu-keys

# Conflicts:
#	packages/wbfy/src/generators/packageJson.ts
#	packages/wbfy/test/packageJson.test.ts
@exKAZUu exKAZUu changed the title fix: reuse installed private packages without registry auth, add ponharu age keys, refine yarn scan fix: reuse installed private packages without registry auth, add ponharu age keys, harden yarn scan Jul 19, 2026
@exKAZUu
exKAZUu merged commit a4d8a2f into main Jul 19, 2026
7 checks passed
@exKAZUu
exKAZUu deleted the fix/private-package-installed-copy-and-ponharu-keys branch July 19, 2026 20:56
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