Skip to content

build(reproducibility): restack deterministic npm toolchain - #91

Merged
seonghobae merged 38 commits into
mainfrom
build/deterministic-npm-toolchain-on-main
Aug 12, 2026
Merged

build(reproducibility): restack deterministic npm toolchain#91
seonghobae merged 38 commits into
mainfrom
build/deterministic-npm-toolchain-on-main

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Purpose

Clean protected-main successor to superseded #89 after #76 integrated. This branch starts from protected main c85d710804139c0697d7ef8fa47d02b1389e6d84 and replays only #89's unique package-manager/reproducibility delta; predecessor checks/reviews do not transfer.

Exact preservation proof

Fresh comparison of #76's exact predecessor head e0106ce16b7b8b493f46bf075ec5baf58762bd95 to #89 head adcc42d2b0fec3106faabb59bbf7e79124714f7a identified exactly 17 unique files. Fresh comparison of protected main to this replacement branch identifies the same 17 paths with the same per-file additions/deletions. Each replacement file was populated from #89's exact current-head content; #76's already-integrated lockfile, reviewer CI, nanoid doctoring, exact-head CI contract and changelog remediation are inherited from protected main rather than replayed.

Unique paths are:

  • .github/workflows/ci.yml
  • .npmrc
  • CHANGELOG.md
  • docs/doctoring/package-manager-reproducibility.md
  • package.json
  • scripts/lockfile-change-control.mjs
  • nine lockfile/package-manager regression files
  • test/workflow-readiness.test.ts
  • vitest.config.ts

Implemented boundary

  • repository-declared Node.js 24.19.0 / npm 11.17.0 development and lockfile toolchain;
  • strict-allow-scripts=true with exact reviewed install-script identities and an explicit deny for fsevents@2.3.3;
  • exact-head CI checkout plus live-base re-resolution before and after verification;
  • schema-v2 exact-base lockfile change control binding changed package paths to canonical before/after SHA-256 digests;
  • duplicate decoded JSON-key rejection, fatal UTF-8, descriptor/no-follow/bounded-read and identity-drift failure boundaries;
  • explicit separation among package-manager/toolchain evidence, install-script authority, vulnerability scanning, formal review and merge/release authority;
  • exact owned coverage includes scripts/lockfile-change-control.mjs.

Fresh exact-head evidence

Current exact head: ebde3720ee27292be0ce3315986e0438dd66af9f.

  • application ci run 31367707468: terminal success;
  • reviewer-ci run 31367707469: terminal success;
  • central Security Scan run 31367707433: terminal success under its own scanner/revision semantics;
  • formal GitHub reviews: none at the latest fresh read;
  • inline review threads: none at the latest fresh read;
  • GitHub reports the PR mergeable.

The fresh technical evidence is sufficient to leave Draft. It is not merge authority: live enforceable governance under #27 and qualifying independent formal review remain separate fail-closed gates.

Supersession

#89 was closed only after this clean protected-main successor received fresh terminal-success application/reviewer/security evidence proving the restack is technically intact. Old #89 evidence does not transfer.

Merge boundary

Do not merge unless the unchanged exact head still satisfies every actual current CI/security/coverage/package/provenance gate, current review/thread evidence remains clean, live ruleset/governance requirements are proven, and qualifying independent non-author formal approval is satisfied where required. No repair/self-modifying workflow, protection weakening, synthetic approval, version bump, release or deployment authority is introduced.

Related: #27, #29, #77, #79, #80, #90

Summary by CodeRabbit

  • 개선 사항

    • Node.js와 npm 버전을 고정해 개발 및 CI 환경의 재현성을 높였습니다.
    • 승인된 설치 스크립트만 실행되도록 보안을 강화했습니다.
    • 잠금 파일과 기준 브랜치의 일치 여부를 검증해 승인되지 않은 변경을 차단합니다.
    • nanoid 보안 수정 버전을 적용했습니다.
  • 문서

    • 패키지 관리자 재현성, 잠금 파일 갱신 절차 및 검증 기준을 문서화했습니다.
  • 검증

    • 잠금 파일, 정책 입력, CI 환경 및 경계 조건에 대한 자동 검사를 확대했습니다.
    • 설치 및 릴리스 검증 중 기준 브랜치 변경도 감지합니다.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4fd5b96b-9177-4299-9b44-286c1a3a0711

📥 Commits

Reviewing files that changed from the base of the PR and between d04eb1f and 96e6f57.

📒 Files selected for processing (6)
  • test/lockfile-change-control-boundaries.test.ts
  • test/lockfile-change-control-policy-schema.test.ts
  • test/lockfile-change-control-race-boundaries.test.ts
  • test/lockfile-change-control.test.ts
  • test/package-manager-doctoring-contract.test.ts
  • test/package-manager-review-contract.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d62ef16-d267-49dd-a724-f6d944343c71

📥 Commits

Reviewing files that changed from the base of the PR and between 70dcc89 and d04eb1f.

📒 Files selected for processing (1)
  • vitest.config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • vitest.config.ts

📝 Walkthrough

Walkthrough

Node.js/npm 버전과 install script 권한을 고정했습니다. lockfile 변경 제어 모듈과 경계 테스트를 추가했습니다. CI는 정확한 base/head와 lockfile 정책을 검증하고 base drift를 거부합니다.

Changes

패키지 무결성 제어

Layer / File(s) Summary
도구체인 및 install script 정책
.npmrc, package.json, docs/doctoring/..., CHANGELOG.md, test/package-manager-*
Node.js 24.19.0과 npm 11.17.0을 고정했습니다. 허용된 install script와 npm ci 옵션을 검증합니다.
Lockfile 변경 제어 엔진
scripts/lockfile-change-control.mjs, test/lockfile-change-control*
bounded UTF-8 입력, 중복 JSON 키 거부, canonical SHA-256 digest, schemaVersion 3 정책, 패키지 및 최상위 메타데이터 변경 검증을 구현하고 테스트합니다.
CI base 및 lockfile 검증 흐름
.github/workflows/ci.yml, test/package-manager-reproducibility.test.ts, test/package-manager-predecessor-integration.test.ts, test/workflow-readiness.test.ts, vitest.config.ts
PR head와 live base SHA를 검증합니다. 기준 lockfile로 변경 제어를 실행하고 설치 및 release 검증 후 base drift를 다시 확인합니다.
재현성 계약 문서화 및 통합 검증
docs/doctoring/package-manager-reproducibility.md, CHANGELOG.md, test/package-manager-doctoring-contract.test.ts, test/package-manager-review-contract.test.ts
도구체인, install script 권한, lockfile 증거, merge authority 분리와 관련 참고문헌을 문서화하고 계약을 검증합니다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related issues

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant GitHubGraphQL
  participant LockfileControl
  PullRequest->>GitHubActions: PR head SHA와 base SHA 제공
  GitHubActions->>GitHubGraphQL: live base 커밋 조회
  GitHubGraphQL-->>GitHubActions: 현재 base SHA 반환
  GitHubActions->>LockfileControl: base lockfile, head lockfile, policy 전달
  LockfileControl-->>GitHubActions: lockfile 변경 검증 결과 반환
  GitHubActions->>GitHubGraphQL: 설치 및 release 검증 후 base 재조회
  GitHubGraphQL-->>GitHubActions: 최신 base SHA 반환
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 결정적 npm 도구 체인을 재적용하는 주요 변경 사항을 간결하고 정확하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build/deterministic-npm-toolchain-on-main

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed
Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed
Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed
Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed
Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed
Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed
Comment thread test/lockfile-change-control-versioned-policy.test.ts Fixed

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
test/package-manager-review-contract.test.ts (1)

86-104: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

node-version 탐지 패턴이 따옴표 형식에 의존합니다.

정규식 /node-version:\s*"([^"]+)"/g는 큰따옴표 값만 찾습니다. 어떤 workflow가 node-version: 24 또는 node-version: '24.19.0'으로 선언하면 declaredVersions가 비고, 테스트는 "버전 불일치"가 아니라 "선언 없음"으로 실패합니다. 실패 원인이 실제 계약 위반과 달라집니다. 따옴표 유무와 종류를 모두 허용하도록 패턴을 넓히십시오.

♻️ 제안 변경
       const declaredVersions = [
-        ...workflow.matchAll(/node-version:\s*"([^"]+)"/g),
-      ].map((match) => match[1]);
+        ...workflow.matchAll(/node-version:\s*(?:"([^"]+)"|'([^']+)'|([^\s#]+))/g),
+      ].map((match) => match[1] ?? match[2] ?? match[3]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/package-manager-review-contract.test.ts` around lines 86 - 104, Update
the node-version detection regex in the test “validates every declared workflow
Node version instead of only the first match” to capture unquoted,
single-quoted, and double-quoted values. Preserve global matching and ensure
declaredVersions contains each workflow declaration so invalid versions fail the
version assertion rather than the no-declarations check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/package-manager-review-contract.test.ts`:
- Around line 86-104: Update the node-version detection regex in the test
“validates every declared workflow Node version instead of only the first match”
to capture unquoted, single-quoted, and double-quoted values. Preserve global
matching and ensure declaredVersions contains each workflow declaration so
invalid versions fail the version assertion rather than the no-declarations
check.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fce98e26-e6c5-446e-af42-c160f386f5c6

📥 Commits

Reviewing files that changed from the base of the PR and between da48a97 and 70dcc89.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/doctoring/package-manager-reproducibility.md
  • scripts/lockfile-change-control.mjs
  • test/lockfile-change-control-versioned-policy.test.ts
  • test/package-manager-review-contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

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