Skip to content

fix: enforce spine entrypoint policy - #1216

Merged
kang-heewon merged 6 commits into
trunkfrom
fix/1181-spine-entrypoint-policy
Jul 5, 2026
Merged

fix: enforce spine entrypoint policy#1216
kang-heewon merged 6 commits into
trunkfrom
fix/1181-spine-entrypoint-policy

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Jul 4, 2026

Copy link
Copy Markdown
Member

Fixes #1181.

Summary

  • Documents the Croco 1.0 spine package manifest policy: source-root local entrypoints by default, with explicit rationale-bearing direct-dist exceptions.
  • Extends package manifest normalization and checks so spine catalog entries must map canonically and source-root packages cannot drift into root dist exports.
  • Makes direct-dist exceptions preserve root and publish entrypoint parity, including the @croco/rpc-codegen CommonJS require target.
  • Adds entrypoint smoke diagnostics for root/publish mismatches that were previously hidden by publish-manifest merging.
  • Aligns the @croco/problems-core, @croco/rpc-codegen, and @croco/telemetry-api manifests and includes a patch changeset for those packages.

Verification

  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm exec vitest run scripts/tests/normalize-packages.spec.ts scripts/tests/package-entrypoint-smoke.spec.ts --config vitest.config.ts - passed, 30 tests.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm package-manifests:check - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm --filter @croco/problems-core typecheck - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm --filter @croco/rpc-codegen exec vitest run src/tests/e2e.spec.ts -t "generates client types from a decorated controller" - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm --filter @croco/cli build - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm --filter @croco/architecture-policy... build && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm architecture-policy:check - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm static-misuse:check - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm check - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm build - passed, 113 tasks.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm package-entrypoints:smoke - passed, 109 packages checked.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm typecheck - passed, 224 tasks.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm test - passed, 225 tasks.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm changeset-required:check -- --base origin/trunk --head HEAD - passed.
  • Pre-push hook test - passed, 225 tasks.
  • Pre-push hook typecheck - passed, 224 tasks.

Self-review gates

  • Correctness/regression: PASS. The package-manifest check now locks spine catalog mapping, source-root defaults, and direct-dist root/publish parity; smoke tests report direct-dist mismatches before publish manifest merging can hide them.
  • API/release compatibility: PASS. Runtime package entrypoints are aligned with the documented policy, direct-dist exceptions are explicit, and a patch changeset covers the affected publishable packages.
  • Maintainability/minimality: PASS. The policy stays in the existing manifest/smoke scripts and focused tests, with no new dependencies.

Review and QA

  • Architecture review: requested canonical catalog validation, direct-dist root/publish parity, and @croco/rpc-codegen CommonJS preservation; those changes are included.
  • Adversarial QA: full validation exposed the @croco/problems-core source-root/CommonJS runtime mismatch and static misuse allowlist drift; fixed with an explicit direct-dist exception and updated metadata.

Notes

  • Typecheck/build generated local API docs during verification; that generated output was cleaned before commit and push.
  • The first push attempt ran the full pre-push hook successfully, but SSH closed before the branch update. The branch was then pushed with --no-verify after the successful hook evidence above.

Summary by CodeRabbit

  • New Features

    • 패키지 엔트리포인트와 배포 설정이 더 엄격하게 정렬되도록 검증이 강화되었습니다.
    • 스파인 패키지와 직접 dist 엔트리포인트에 대한 별도 정책이 적용됩니다.
  • Bug Fixes

    • 일부 패키지의 공개 진입점 노출 방식이 일관되게 정리되었습니다.
    • 런타임 스택 추적 처리와 카테고리 매핑 관련 타입 안정성이 개선되었습니다.
  • Documentation

    • 엔트리포인트 계약, 예외 규칙, 릴리스 문서가 업데이트되었습니다.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: ASSERTIVE

Plan: Pro

Run ID: 5233f363-f707-48f4-9637-ecb80eba001e

📥 Commits

Reviewing files that changed from the base of the PR and between 462c492 and 38eb752.

📒 Files selected for processing (6)
  • docs/release/package-entrypoint-contract.md
  • scripts/normalize-packages.mjs
  • scripts/package-manifest-contracts.mjs
  • scripts/tests/normalize-packages.spec.ts
  • scripts/tests/package-manifest-contracts.spec.ts
  • vitest.config.ts
📝 Walkthrough

Walkthrough

스파인 패키지(1.0)의 엔트리포인트 정책이 도입되어, 로컬 root의 main/types는 소스 파일을, publishConfig는 dist 파일을 가리키도록 검증/정규화하는 로직이 normalize-packages.mjs, package-manifest-contracts.mjs, package-entrypoint-smoke.mts에 추가되었다. Direct-dist 예외 패키지 목록이 도입되고, 관련 package.json(problems-core, rpc-codegen, telemetry-api)이 정렬되었으며 문서와 테스트, changeset이 갱신되었다. 별개로 Problem/ProblemCategoryMapper에 타입 보강이 적용되었다.

Changes

스파인 엔트리포인트 정책 구현

Layer / File(s) Summary
Direct-dist 예외 상수 정의
scripts/package-manifest-contracts.mjs
DIRECT_DIST_ENTRYPOINT_EXCEPTIONS 맵을 도입하고 DIRECT_DIST_ENTRYPOINT_PACKAGES를 해당 키 집합으로 파생시키며, 루트/publishConfig 필드 일치를 판정하는 fieldMatchesPath 헬퍼를 추가함.
normalize-packages 스파인/direct-dist 검증 로직
scripts/normalize-packages.mjs
카탈로그(docs/package-catalog.json) 기반 스파인 패키지명 조회, validatePackage/normalizePackage에 컨텍스트 전달, 스파인 root main/typesSRC_INDEX로 강제하는 정책 검증, direct-dist 패키지의 root/publishConfig parity 검증 및 module/exports 정규화 로직을 추가함.
package-entrypoint-smoke 진단 추가
scripts/package-entrypoint-smoke.mts
direct-dist 대상 패키지에 대해 root main/types/exportspublishConfig 값의 불일치를 진단 메시지로 push하는 헬퍼를 추가함.
스파인 패키지 package.json 정렬
packages/problems-core/package.json, packages/rpc-codegen/package.json, packages/telemetry-api/package.json
exports/publishConfig.exports 필드를 types/import/require 순서로 정렬하고, problems-coredevelopment export 조건을 제거했으며, telemetry-apimodule 필드를 추가함.
정책 검증 테스트 및 changeset/문서
scripts/tests/normalize-packages.spec.ts, scripts/tests/package-entrypoint-smoke.spec.ts, docs/release/croco-1.0-spine.md, docs/release/package-entrypoint-contract.md, .changeset/spine-entrypoint-policy.md
스파인/direct-dist 정책의 성공·실패 시나리오 테스트와 writePackageCatalog 헬퍼를 추가하고, 릴리스 게이트 문서 및 엔트리포인트 계약 문서, 패치 changeset을 갱신함.
Problem/ProblemCategoryMapper 타입 보강 및 라인 이동
packages/problems-core/src/libs/Problem.ts, packages/problems-core/src/libs/ProblemCategoryMapper.ts, docs/problem-code-registry.json, packages/docs/.../problem-recovery-cookbook.md
captureStackTrace 호출을 ErrorConstructor 캐스팅 방식으로 변경하고 require("./Problem") 반환 형태에 대한 타입을 추가했으며, 이에 따른 라인 번호 변경을 문서 레지스트리에 반영함.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI as normalize-packages CLI
  participant Catalog as docs/package-catalog.json
  participant Validator as validatePackage
  participant SpinePolicy as validateSpineEntrypointPolicy
  participant DistPolicy as validateDirectDistEntrypoints
  participant Smoke as package-entrypoint-smoke

  CLI->>Catalog: spine.packages 목록 읽기
  Catalog-->>CLI: 스파인 패키지명 집합
  CLI->>Validator: context(spinePackageNames)와 함께 검증 호출
  Validator->>SpinePolicy: 스파인 root main/types == SRC_INDEX 검증
  Validator->>DistPolicy: direct-dist root/publishConfig parity 검증
  SpinePolicy-->>Validator: 위반 목록
  DistPolicy-->>Validator: 위반 목록
  Validator-->>CLI: 종합 위반 결과
  Smoke->>Catalog: DIRECT_DIST_ENTRYPOINT_PACKAGES 조회
  Smoke->>Smoke: fieldMatchesPath로 root/publishConfig 불일치 진단
Loading

Possibly related PRs

  • croco-dev/framework#634: 동일한 패키지 엔트리포인트/매니페스트 계약 검증 게이트(pnpm package-manifests:check, pnpm package-entrypoints:smoke)를 CI/릴리스에 연결하는 변경으로, 본 PR이 구현한 검증 로직을 실행함.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 spine 패키지의 엔트리포인트 정책 강제라는 핵심 변경을 간결하게 요약합니다.
Linked Issues check ✅ Passed 스파인 엔트리포인트 정책 정의, 예외 반영, check/smoke 검증, 문서화까지 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경은 정책 문서, 검증, 스모크 테스트, 관련 매니페스트 정렬에 한정되어 있어 범위를 벗어난 내용이 보이지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1181-spine-entrypoint-policy

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.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 7.9μs 30.0ms 8.2μs -2.9% -
CrocoApp lambdaHandler (10 controllers) 245.9μs 50.0ms 258.4μs -4.8% -
Lambda cold-start simulation 442.7μs 80.0ms 418.1μs +5.9% -
Lambda cold-start with headers 425.9μs 80.0ms 369.7μs +15.2% -
Lambda cold-start with binary body 376.6μs 80.0ms 339.1μs +11.0% -
Lambda cold-start with query params 321.6μs 80.0ms 301.3μs +6.7% -
Lambda cold-start with authorizer context 311.4μs 80.0ms 299.8μs +3.9% -
Lambda cold-start realistic scenario 309.0μs 80.0ms 299.2μs +3.3% -
EventBusConfig.start (10 handlers) 1.4μs 10.0ms 1.4μs -0.7% -
EventPublisher.publishNow single event 1.7μs 2.0ms 1.7μs +1.2% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs -11.2% -
Container.get singleton (cold) 71.1μs 5.0ms 70.3μs +1.3% -
Container.register × 50 components 3.4ms 10.0ms 3.2ms +4.9% -
Container.validate (50 components) 3.7ms 20.0ms 3.4ms +9.2% -
Container.get singleton (warm) 1.7μs 500.0μs 1.6μs +3.1% -
TelemetryRuntime.init (lambda preset) 2.1μs 200.0ms 1.1ms -99.8% -
lambdaPreset config creation 1.5μs 2.0ms 1.4μs +6.4% -

Updated: 2026-07-05T14:35:35.710Z · Commit: ace090e

@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch from 20eb40a to af50b2e Compare July 4, 2026 16:32
@kang-heewon kang-heewon closed this Jul 4, 2026

@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: af50b2e50f

ℹ️ 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 scripts/normalize-packages.mjs
@kang-heewon kang-heewon reopened this Jul 4, 2026
@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch from 154b0b0 to d370fa0 Compare July 4, 2026 16:54

@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: d370fa051f

ℹ️ 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 scripts/normalize-packages.mjs
@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch 2 times, most recently from e18c6aa to be5bf00 Compare July 5, 2026 07:43

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

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@packages/problems-core/src/libs/ProblemCategoryMapper.ts`:
- Around line 3-13: `ProblemClassConstructor` is a local constructor type that
should be aligned with the shared `Constructor<T>` utility pattern used by the
framework. Update `ProblemCategoryMapper` to reuse the existing generic
constructor type instead of defining a bespoke `ProblemClassConstructor`, while
preserving the current `require`-based workaround and the `ProblemModule` shape
so the mapping logic remains unchanged.

In `@scripts/normalize-packages.mjs`:
- Around line 928-938: `validateRootPublishFieldParity` is duplicating the same
dotted-path `publishConfig` lookup and `JSON.stringify` comparison logic already
used by `pushRootPublishFieldDiagnostic` in
`scripts/package-entrypoint-smoke.mts`. Extract that comparison algorithm into a
shared helper in `scripts/package-manifest-contracts.mjs`, then update both
`validateRootPublishFieldParity` and `pushRootPublishFieldDiagnostic` to import
and use it so the policy stays consistent and avoids drift.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a2be5f92-b900-48a7-9544-5dc8df07632f

📥 Commits

Reviewing files that changed from the base of the PR and between 0fa2546 and be5bf00.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (17)
  • .changeset/spine-entrypoint-policy.md
  • docs/problem-code-registry.json
  • docs/release/croco-1.0-spine.md
  • docs/release/package-entrypoint-contract.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/problems-core/package.json
  • packages/problems-core/src/libs/Problem.ts
  • packages/problems-core/src/libs/ProblemCategoryMapper.ts
  • packages/rpc-codegen/package.json
  • packages/telemetry-api/package.json
  • scripts/normalize-packages.mjs
  • scripts/package-entrypoint-smoke.mts
  • scripts/package-manifest-contracts.mjs
  • scripts/static-misuse-raw-error-allowlist.json
  • scripts/tests/normalize-packages.spec.ts
  • scripts/tests/package-entrypoint-smoke.spec.ts
💤 Files with no reviewable changes (1)
  • packages/problems-core/package.json

Comment thread packages/problems-core/src/libs/ProblemCategoryMapper.ts Outdated
Comment thread scripts/normalize-packages.mjs
@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch from be5bf00 to fb3e7cf Compare July 5, 2026 09:04
@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch from fb3e7cf to 1b7baa7 Compare July 5, 2026 10:06

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/normalize-packages.mjs (1)

604-611: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

validateSpineEntrypointPolicyENTRYPOINT_EXEMPTIONS 체크는 도달 불가능한 코드입니다.

validatePackage는 Line 604-606에서 ENTRYPOINT_EXEMPTIONS.has(pkg.name)이면 이미 조기 반환하므로, validateSpineEntrypointPolicy(Line 630에서 호출)에는 해당 패키지가 절대 도달하지 않습니다. Line 912의 ENTRYPOINT_EXEMPTIONS.has(pkg.name) || 조건은 죽은 코드입니다.

♻️ 제안: 죽은 조건 제거
-  if (ENTRYPOINT_EXEMPTIONS.has(pkg.name) || DIRECT_DIST_ENTRYPOINT_PACKAGES.has(pkg.name)) {
+  if (DIRECT_DIST_ENTRYPOINT_PACKAGES.has(pkg.name)) {
     return;
   }

Also applies to: 907-914

🤖 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 `@scripts/normalize-packages.mjs` around lines 604 - 611, Remove the
unreachable ENTRYPOINT_EXEMPTIONS handling from validateSpineEntrypointPolicy
and its caller path, since validatePackage already returns early for exempt
packages. Update the logic around validatePackage,
validateSpineEntrypointPolicy, and the ENTRYPOINT_EXEMPTIONS check near the
package entrypoint validation so the exemption is handled only once and the dead
condition is removed.
🤖 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.

Inline comments:
In `@scripts/normalize-packages.mjs`:
- Around line 491-516: The direct-dist normalization logic is split across two
separate `if (options.directDistRoot)` blocks in `normalize-packages.mjs`; merge
them into a single conditional so all directDistRoot handling in the package
export/main/types/module setup lives together. Keep the existing
`pkg.publishConfig.exports`, `pkg.main`, `pkg.types`, `pkg.exports`, and
`rootImportTargetFor` logic intact, but move it into one
`options.directDistRoot` branch and leave the non-direct path unchanged.
- Around line 372-376: `readSpinePackageNames` currently returns an empty Set
when `CATALOG_METADATA_PATH` is missing, which lets `package-manifests:check`
skip spine validation entirely. Change this path in
`scripts/normalize-packages.mjs` so a missing `docs/package-catalog.json` is
recorded as a violation through the existing `violations` flow (or otherwise
fails the check explicitly) instead of silently succeeding, while keeping the
rest of the `readSpinePackageNames` logic unchanged.

In `@scripts/package-entrypoint-smoke.mts`:
- Around line 326-371: The diagnostic format in pushRootPublishFieldDiagnostic
is inconsistent with the normalize-packages validation messages. Update
directDistRootPublishFaceDiagnostics and/or pushRootPublishFieldDiagnostic so
the emitted text matches the normalize-packages.mjs convention used by
normalize-packages.spec.ts, specifically removing the extra “root ” wording
while keeping the packageName and field comparison context intact.

---

Outside diff comments:
In `@scripts/normalize-packages.mjs`:
- Around line 604-611: Remove the unreachable ENTRYPOINT_EXEMPTIONS handling
from validateSpineEntrypointPolicy and its caller path, since validatePackage
already returns early for exempt packages. Update the logic around
validatePackage, validateSpineEntrypointPolicy, and the ENTRYPOINT_EXEMPTIONS
check near the package entrypoint validation so the exemption is handled only
once and the dead condition is removed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 90e0c996-3075-48f6-8e2b-041981a3e585

📥 Commits

Reviewing files that changed from the base of the PR and between be5bf00 and e61e778.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (17)
  • .changeset/spine-entrypoint-policy.md
  • docs/problem-code-registry.json
  • docs/release/croco-1.0-spine.md
  • docs/release/package-entrypoint-contract.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/problems-core/package.json
  • packages/problems-core/src/libs/Problem.ts
  • packages/problems-core/src/libs/ProblemCategoryMapper.ts
  • packages/rpc-codegen/package.json
  • packages/telemetry-api/package.json
  • scripts/normalize-packages.mjs
  • scripts/package-entrypoint-smoke.mts
  • scripts/package-manifest-contracts.mjs
  • scripts/static-misuse-raw-error-allowlist.json
  • scripts/tests/normalize-packages.spec.ts
  • scripts/tests/package-entrypoint-smoke.spec.ts
💤 Files with no reviewable changes (1)
  • packages/problems-core/package.json

Comment thread scripts/normalize-packages.mjs
Comment thread scripts/normalize-packages.mjs
Comment thread scripts/package-entrypoint-smoke.mts
@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch from 37d643e to 9c8e639 Compare July 5, 2026 12:14
@kang-heewon
kang-heewon force-pushed the fix/1181-spine-entrypoint-policy branch from 2a8652c to 462c492 Compare July 5, 2026 13:32
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 5, 2026

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

Actionable comments posted: 3

🤖 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.

Inline comments:
In `@docs/release/package-entrypoint-contract.md`:
- Around line 56-61: Document the missing `exports["."].development`
normalization policy for direct-dist exception packages: in the
`package-entrypoint-contract` guidance around
`DIRECT_DIST_ENTRYPOINT_EXCEPTIONS`, explicitly state when the `development`
condition is allowed, what dist entrypoint requirements it must satisfy, and how
`check` versus `write` mode handles it. Reference the existing
`normalize-packages` behavior in `scripts/tests/normalize-packages.spec.ts` and
make the rule consistent with the root `main`, `types`, `exports`, and
`publishConfig` alignment requirements already described.

In `@scripts/normalize-packages.mjs`:
- Around line 519-544: The export-condition merge in
directDistPublishedRootExportFor can place types after import/require, which may
break TypeScript resolution. Update directDistPublishedRootExportFor so that
when it backfills from publishedRootExportFor(pkg), the resulting object
preserves types as the first condition (or otherwise guarantees it is ordered
before runtime conditions). Apply the same ordering rule in
publishedRootExportFor if it also builds the default exports["."] object, and
use the existing directDistPublishedRootExportFor and publishedRootExportFor
helpers as the key locations for the fix.

In `@scripts/package-manifest-contracts.mjs`:
- Around line 45-57: `fieldMatchesPath` is using `JSON.stringify` equality,
which makes the root/publish field parity check sensitive to object key order
and can create false mismatches for semantically identical manifests. Update the
comparison in `fieldMatchesPath` to use a structural deep-equality check that
ignores property order for objects while still handling arrays and primitives
correctly, and keep the existing path traversal behavior when reading
`publishFieldPath`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f07c0e7e-fbcd-4cff-90b0-104abd41bc3c

📥 Commits

Reviewing files that changed from the base of the PR and between e61e778 and 462c492.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (16)
  • .changeset/spine-entrypoint-policy.md
  • docs/problem-code-registry.json
  • docs/release/croco-1.0-spine.md
  • docs/release/package-entrypoint-contract.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/problems-core/package.json
  • packages/problems-core/src/libs/Problem.ts
  • packages/problems-core/src/libs/ProblemCategoryMapper.ts
  • packages/rpc-codegen/package.json
  • packages/telemetry-api/package.json
  • scripts/normalize-packages.mjs
  • scripts/package-entrypoint-smoke.mts
  • scripts/package-manifest-contracts.mjs
  • scripts/tests/normalize-packages.spec.ts
  • scripts/tests/package-entrypoint-smoke.spec.ts
💤 Files with no reviewable changes (1)
  • packages/problems-core/package.json

Comment thread docs/release/package-entrypoint-contract.md
Comment thread scripts/normalize-packages.mjs
Comment thread scripts/package-manifest-contracts.mjs
@kang-heewon
kang-heewon dismissed coderabbitai[bot]’s stale review July 5, 2026 15:16

Addressed all actionable comments in follow-up commit 38eb752; CodeRabbit cannot re-run because prepaid credits are exhausted.

@kang-heewon
kang-heewon merged commit 847ecbf into trunk Jul 5, 2026
9 checks passed
@kang-heewon
kang-heewon deleted the fix/1181-spine-entrypoint-policy branch July 5, 2026 15:17
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.

[package-manifests] Normalize root main/types and publishConfig for spine packages

1 participant