fix: report doctor advisory readiness - #1196
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughcroco doctor에 advisory release-hardening readiness 체크가 추가되어 core coverage, bundle baseline, benchmark evidence, static allowlist 메타데이터를 검증합니다. 관련 진단 코드, 테스트, 스크립트 파서, 문서, 체인지셋도 함께 갱신됐습니다. ChangesAdvisory Gate Readiness
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant runDoctor
participant advisoryGateReadinessCheck
participant DoctorPackage
participant advisoryDiagnostic
runDoctor->>advisoryGateReadinessCheck: rootDir, workspace.packages
advisoryGateReadinessCheck->>DoctorPackage: read package private flag and normalized fields
advisoryGateReadinessCheck->>advisoryDiagnostic: build warning diagnostics
advisoryGateReadinessCheck-->>runDoctor: pass/fail/skipped summary
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 696313b222
ℹ️ 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".
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-07-05T07:57:47.562Z · Commit: 0a5ea1e |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f90ad90ddc
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c11a6298d0
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0ede96ad4
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fedd33785f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03cd6ac6b9
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e91f762f42
ℹ️ 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".
There was a problem hiding this comment.
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 `@packages/cli/src/commands/doctor.ts`:
- Around line 1639-1654: `matchesGitHubActionsRunUrl` is hardcoding the GitHub
org/repo path, which will break the advisory check for forks or renamed
repositories. Extract the `/croco-dev/framework/actions/runs/${runId}` portion
into a reusable constant alongside the existing top-level constants block, and
have `matchesGitHubActionsRunUrl` build `expectedPath` from that shared value so
the repo path is configurable in one place.
- Around line 1419-1467: The benchmark evidence validation is incorrectly
forcing checks.promotedBaselineFailures to be 0, which conflicts with the row
validation that expects the real regression count. Update
validateBenchmarkEvidenceChecks to exclude promotedBaselineFailures from the
zero-only list and keep it aligned with the artifact failure counts pattern used
for the other structured evidence keys in doctor.ts.
In `@packages/cli/src/tests/doctor.spec.ts`:
- Around line 1291-1392: writeBenchmarkVarianceEvidence currently hardcodes the
markdown evidence rows to a single “Example benchmark” entry even when
resultReports is passed, so update the helper to build the JSON rows from
resultReports using the existing BenchmarkResultReport shape and keep
writeBenchmarkResult aligned. Add a rows override option to
BenchmarkVarianceEvidenceOptions so drift-focused tests can still force
mismatched markdown evidence when needed, and update the doctor.spec.ts helpers
that call writeBenchmarkVarianceEvidence to use the new override where they
intentionally rely on the mismatch.
🪄 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: 4912e32e-8325-4248-88c7-70abfe477417
📒 Files selected for processing (7)
.changeset/doctor-advisory-readiness.mddocs/llm-governance.mdpackages/cli/src/commands/doctor.tspackages/cli/src/libs/diagnosticCodes.tspackages/cli/src/tests/doctor.spec.tspackages/diagnostics-core/src/libs/DiagnosticCodes.tspackages/docs/src/content/docs/api/diagnostics-core/src/variables/CROCO_DIAGNOSTIC_CODE_DEFINITIONS.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfa7ea61c7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2ed3c190d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 464d1f9932
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5323e9e766
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8671e3c018
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10f52ca08a
ℹ️ 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".
There was a problem hiding this comment.
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/cli/src/commands/doctor.ts`:
- Line 171: The hashed chunk normalization regex in doctor.ts only matches
uppercase hashes, so lowercase chunk names can slip through and be treated as
real changes. Update hashedChunkArtifactPattern (and any related normalization
logic in the same doctor command) to match both uppercase and lowercase
8-character hashes so chunk-abcdef12.js is normalized the same as
chunk-ABCDEF12.js.
- Around line 1052-1056: 요약: hasObjectExport가 세미콜론이 없는 object export를 놓쳐
CORE_COVERAGE_THRESHOLDS를 잘못 missing 처리합니다. doctor.ts의 hasObjectExport에서 export
const 패턴을 찾는 정규식을 완화해, 객체 본문 뒤에 세미콜론이 없어도 매칭되도록 하세요. 특히
escapeRegExp(exportName)로 만드는 RegExp의 끝부분을 }; 고정 대신 }\\s*;? 형태로 바꾸어 세미콜론 유무 모두
인식되게 수정하면 됩니다.
🪄 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: 26986650-8ed4-4bdc-9752-e3f40706ce36
📒 Files selected for processing (2)
packages/cli/src/commands/doctor.tspackages/cli/src/tests/doctor.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1720115dfd
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e768919c8
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/core-coverage-warning-check.mts (1)
142-226: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift
--filter파싱 로직을 공통 유틸로 분리하세요.scripts/core-coverage-warning-check.mts와packages/cli/src/commands/doctor.ts가 같은CORE_COVERAGE=true이후 필터 정규식을 각각 유지하고 있어, 한쪽만 바뀌면 doctor 진단과 CI 경고 기준이 쉽게 어긋날 수 있습니다.🤖 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/core-coverage-warning-check.mts` around lines 142 - 226, The `--filter` parsing logic is duplicated and can drift between `parseCoreCoveragePackageFilters` in `scripts/core-coverage-warning-check.mts` and the corresponding `doctor.ts` logic. Extract the shared `CORE_COVERAGE=true`/`--filter` regex parsing into a common utility and have both callers use it so there is one source of truth for package filter extraction. Keep the existing behavior and ensure the shared helper covers the same quoted/unquoted filter formats currently handled by `parseCoreCoveragePackageFilters`.
🤖 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/core-coverage-warning-check.mts`:
- Around line 181-188: `parseCoreCoverageThresholds` is now a reusable parser,
but its error path still hardcodes `vitestConfigPath`, so update the failure
message to reflect the actual input source instead of the module-scoped path.
Add a source label parameter (or equivalent context) to
`parseCoreCoverageThresholds` and propagate it from
`readCoreCoverageThresholds`, then use that label in the thrown error so callers
like tests get accurate diagnostics.
---
Outside diff comments:
In `@scripts/core-coverage-warning-check.mts`:
- Around line 142-226: The `--filter` parsing logic is duplicated and can drift
between `parseCoreCoveragePackageFilters` in
`scripts/core-coverage-warning-check.mts` and the corresponding `doctor.ts`
logic. Extract the shared `CORE_COVERAGE=true`/`--filter` regex parsing into a
common utility and have both callers use it so there is one source of truth for
package filter extraction. Keep the existing behavior and ensure the shared
helper covers the same quoted/unquoted filter formats currently handled by
`parseCoreCoveragePackageFilters`.
🪄 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: 4c0b3249-9c75-40d1-8c53-c0d7c8fbe93c
📒 Files selected for processing (4)
packages/cli/src/commands/doctor.tspackages/cli/src/tests/doctor.spec.tsscripts/core-coverage-warning-check.mtsscripts/tests/core-coverage-warning-check.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fbb0169cb
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7efadb81e2
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/cli/src/commands/doctor.ts`:
- Line 736: The selectedPackages setup in doctor.ts is using
parseCoreCoveragePackageFilters directly, which can diverge from the real core
coverage script parsing and make doctor.spec.ts fixtures inconsistent. Update
the doctor command to use the shared parseCoreCoverageScriptFilters logic for
extracting package filters from coreCoverageScript, so it handles
CORE_COVERAGE=true and quoted filter forms the same way as the actual input.
Keep the change localized around selectedPackages and the related parsing helper
names.
🪄 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: 5ee47898-1cdd-4e92-a477-7f84a9d3f1f0
📒 Files selected for processing (7)
packages/cli/src/commands/doctor.tspackages/cli/src/libs/coreCoverageFilters.tspackages/cli/src/tests/doctor.spec.tsscripts/core-coverage-warning-check.mtsscripts/package-quality-report.mtsscripts/tests/core-coverage-warning-check.spec.tsscripts/tests/package-quality-report.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57adeefe58
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fdd974adb
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6c13cf8db
ℹ️ 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".
|
Merge-readiness refresh: all checks are green on head |
Fixes #1145.
Summary
advisory-gate-readinessdoctor check that reports warning diagnostics for core coverage selection gaps, bundle-size baseline readiness, benchmark variance evidence, and static-misuse allowlist metadata.CROCO_DOCTOR_*definitions in the shared diagnostic catalog and exposes the new codes through CLI doctor JSON output.@croco/cliand@croco/diagnostics-core.Verification
CI=true corepack pnpm --filter @croco/cli exec vitest run src/tests/doctor.spec.ts src/tests/diagnosticCodes.spec.ts- passed, 27 tests.CI=true corepack pnpm --filter @croco/diagnostics-core exec vitest run src/tests/DiagnosticCodes.spec.ts- passed, 5 tests.CI=true corepack pnpm exec oxfmt --check packages/cli/src/commands/doctor.ts packages/cli/src/tests/doctor.spec.ts packages/cli/src/libs/diagnosticCodes.ts packages/diagnostics-core/src/libs/DiagnosticCodes.ts .changeset/doctor-advisory-readiness.md- passed.CI=true corepack pnpm exec oxlint packages/cli/src/commands/doctor.ts packages/cli/src/tests/doctor.spec.ts packages/cli/src/libs/diagnosticCodes.ts packages/diagnostics-core/src/libs/DiagnosticCodes.ts- passed.CI=true corepack pnpm typecheck --filter @croco/cli --filter @croco/diagnostics-core- passed, 46 tasks.CI=true corepack pnpm check- passed.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm changeset-required:check -- --base origin/trunk --head HEAD- passed.git diff --checkandgit diff --cached --check- passed.Self-review gates
Review and QA
Notes
LEFTHOOK=0after the equivalent focused tests, diagnostics tests, formatter, lint, typecheck, full check, changeset, and diff gates above passed explicitly through Corepack/manual commands before PR creation.Summary by CodeRabbit
croco doctor에 “릴리즈 하드닝 준비 상태” 점검을 추가해 커버리지 선택 증거, 번들 크기 베이스라인, 벤치마크 변동 증거, 보안 allowlist 메타데이터 문제를 경고합니다.--filter파싱 및 임계값 추출 로직이 더 안정적으로 동작하도록 개선되었습니다.