Skip to content

fix(release): parse noisy pnpm pack output - #382

Merged
NWYLZW merged 1 commit into
mainfrom
codex/fix-npm-pack-json
Aug 17, 2026
Merged

fix(release): parse noisy pnpm pack output#382
NWYLZW merged 1 commit into
mainfrom
codex/fix-npm-pack-json

Conversation

@NWYLZW

@NWYLZW NWYLZW commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Parse the documented pnpm pack --json record when package lifecycle output is interleaved on stdout.
  • Keep frozen tarball paths confined to the approved output directory and publish the exact reviewed source and alias bytes.
  • Update the guard declaration and regression coverage for noisy, concatenated, duplicate, malformed, and incomplete output.

Change Brief

  • Problem: package lifecycle scripts can write to stdout before pnpm pack --json, so parsing the complete stream as one JSON document can fail before an approved tarball is frozen.
  • Non-goals: no package version, dependency, lockfile, workflow, credential, publish, tag, release, deployment, or product behavior change.
  • Invariants: exactly one schema-matching pack record is accepted; package name/version must match; tarballs must resolve to regular .tgz files within the frozen output directory; publishing continues to use the frozen approved bytes.
  • Rollback: revert this single merge commit; no external release state is mutated by this PR.

Impact Map

  • Entry point: freezeApprovedTarballs through the existing npm publish guard.
  • Direct implementation: scripts/npm-publish-guard.mjs.
  • Type surface: scripts/npm-publish-guard.d.mts.
  • Verification: scripts/__tests__/npm-publish-guard.spec.ts plus adjacent publish-plan tests.
  • Unaffected: package manifests, lockfile, dependencies, workflows, product runtime, UI, documentation, and changelog.

Abstraction Decision

  • Decision: extend the existing npm publish guard in place.
  • Evidence: parsing, schema validation, tarball confinement, and frozen-byte ownership already belong to this release guard boundary.
  • New concepts: one bounded JSON-record extractor and one confined tarball reader local to the guard.
  • Alternative not chosen: a shared parser package would add a cross-workspace abstraction for a single release-tooling contract.

Changelog

  • Changelog path or "Not applicable": Not applicable; this is an internal release-pipeline reliability fix with no product-facing behavior change.

Screenshots

Not applicable; no UI change.

Validation

  • 42/42 focused and adjacent release tests passed across four test files.
  • Full repository ESLint passed.
  • Full dprint check passed.
  • All six repository typecheck scopes passed: bundler, bundler:test, web, web:test, node, and node:test.
  • npm publish workflow YAML parse passed.
  • git diff --check passed.
  • Exact three-path scope and canonical fingerprint 6b1554389d12e38b2eab8bd1abeeefd24afe1eb466dfb5e4826943ab5ef28fc6 verified.
  • pnpm tools pr-change-check origin/main HEAD --body-file .logs/pr-body.md
  • pnpm tools pr-preflight origin/main HEAD --body-file .logs/pr-body.md --json

Review Scope

  • Risk: medium; release guard parser and immutable tarball path validation.
  • Applicable profiles: release / trusted publishing / npm publish guard.
  • Evidence: independent read-only review PASS for the exact frozen three-file snapshot.
  • Rule exceptions: none.

Experience Review

  • 已判断是否需要沉淀经验
  • 如需要,已运行 $post-task-experience-review
  • reviewer PASS / NOT APPLICABLE 后才进入 merge

Policy Conflict Review

  • Independent read-only reviewer checked workflow, permission, and release-rule conflicts and reported PASS

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oneworks-dev Ready Ready Preview Aug 17, 2026 5:37am

@NWYLZW
NWYLZW requested a review from a team as a code owner August 17, 2026 05:36

@github-actions github-actions 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.

Experience Review

Before merge, make sure the PR body contains this completed checklist:

## Experience Review
- [x] 已判断是否需要沉淀经验
- [x] 如需要,已运行 `$post-task-experience-review`
- [x] reviewer `PASS` / `NOT APPLICABLE` 后才进入 merge

Checklist to confirm:

  • Decide whether this PR produced reusable project experience.
  • If experience should be captured, run $post-task-experience-review.
  • Merge only after the independent reviewer reports PASS or NOT APPLICABLE for the Experience Review Result.
  • For workflow, permission, or release-rule documentation changes, also add this checked section to the PR body after an independent read-only conflict review:
## Policy Conflict Review
- [x] Independent read-only reviewer checked workflow, permission, and release-rule conflicts and reported PASS

@NWYLZW
NWYLZW merged commit 5642339 into main Aug 17, 2026
21 checks passed
@NWYLZW
NWYLZW deleted the codex/fix-npm-pack-json branch August 17, 2026 05:44
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