Skip to content

fix: enforce runtime dependency audit policy - #1208

Merged
kang-heewon merged 1 commit into
trunkfrom
issue-1188-runtime-audit-policy
Jul 4, 2026
Merged

fix: enforce runtime dependency audit policy#1208
kang-heewon merged 1 commit into
trunkfrom
issue-1188-runtime-audit-policy

Conversation

@kang-heewon

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

Copy link
Copy Markdown
Member

Fixes #1188.

Summary

  • Adds a path-sensitive dependency audit policy that consumes full pnpm audit --audit-level high --json output and classifies findings by workspace manifest edge instead of pnpm's production flag alone.
  • Blocks high/critical runtime, runtime-peer, generated-app, and release-evidence findings unless reviewed [security] Add owner and expiry metadata to security allowlists #1144-compatible owner, reason, and review date metadata exists.
  • Keeps dev/test-only findings advisory, including local Vitest paths, while elevating generated app template runtime fixtures and explicit release evidence tools.
  • Wires the policy into CI security reporting and the release publish gate, and removes the dead root package.json#pnpm.auditConfig GHSA suppression.

Verification

  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm exec vitest run scripts/tests/dependency-audit-policy.spec.ts scripts/tests/ci-workflow.spec.ts scripts/tests/release-workflow.spec.ts --config vitest.config.ts - passed, 28 tests.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm security:audit-policy - passed, wrote ci-reports/security/dependency-audit-policy.md with 0 blocking findings.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm check - passed.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm typecheck - passed, 224 Turbo tasks successful.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm test - passed, 225 Turbo tasks successful.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm build - passed, 113 Turbo tasks successful.
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm changeset-required:check -- --base origin/trunk --head HEAD - passed, no publishable package behavior changes detected.
  • git diff --check and git diff --cached --check - passed.

Self-review gates

  • Correctness/regression: PASS. Runtime and generated-app paths now block without reviewed metadata; dev/test-only paths remain advisory; live workspace audit passes with 0 blocking findings and no configured suppressions.
  • Security/release compatibility: PASS. CI keeps raw audit output as advisory context, runs the policy as the blocking classifier, preserves the security report artifact, and release publish gates use the same policy.
  • Maintainability/minimality: PASS. The policy is a standalone script with fixture-driven tests for runtime metadata, stale metadata, dev/test advisory paths, generated templates, release evidence, and dead auditConfig suppressions.

Review and QA

Notes

  • No changeset is included because the changeset gate reported no publishable package behavior changes.
  • Push hooks were skipped after local verification because the pre-push hook entered an interactive pnpm install prompt; the equivalent check, typecheck, test, build, policy, changeset, and diff gates above were run explicitly before PR creation.

Summary by CodeRabbit

  • New Features

    • 새 의존성 감사 정책 검사를 추가해, 릴리스 및 CI에서 보안 관련 의존성 상태를 더 엄격하게 확인합니다.
    • 앱 템플릿 생성 시 최신 패키지 버전과 필요한 런타임/개발 의존성이 반영되도록 개선했습니다.
  • Bug Fixes

    • 템플릿 및 설치 흐름에서 누락되던 의존성 검증을 보강해 생성된 프로젝트의 안정성을 높였습니다.
    • 일부 테스트 및 워크플로우 검증을 최신 환경에 맞게 업데이트했습니다.

@coderabbitai

coderabbitai Bot commented Jul 3, 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: 47 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: 8435a38d-72f9-451b-adcf-b754b536e18e

📥 Commits

Reviewing files that changed from the base of the PR and between f32fd3b and 0335245.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (62)
  • .changeset/c4d7fa0c.md
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .gitignore
  • package.json
  • packages/admin-generated/package.json
  • packages/analytics-posthog/src/tests/Integration.spec.ts
  • packages/audit-drizzle/package.json
  • packages/cli/src/tests/doctor.spec.ts
  • packages/cli/src/tests/projectMap.spec.ts
  • packages/create-croco-app/src/tests/e2e-generation.spec.ts
  • packages/create-croco-app/src/tests/generator-install.spec.ts
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/templates/addons/graphql-nextjs/apps/web/package.json.hbs
  • packages/create-croco-app/templates/addons/trpc-nextjs/apps/web/package.json.hbs
  • packages/create-croco-app/templates/addons/web-graphql/apps/web/package.json.hbs
  • packages/create-croco-app/templates/addons/web-meta-vite-fullstack/api-worker/package.json.hbs
  • packages/create-croco-app/templates/addons/web-meta-vite-fullstack/api-worker/src/index.ts
  • packages/create-croco-app/templates/addons/web-meta-vite-fullstack/api-worker/tsconfig.json.hbs
  • packages/create-croco-app/templates/addons/web-trpc/apps/web/package.json.hbs
  • packages/create-croco-app/templates/admin-console/package.json.hbs
  • packages/create-croco-app/templates/ai-saas/package.json.hbs
  • packages/create-croco-app/templates/base-ddd/libs/shared/provider-database/package.json.hbs
  • packages/create-croco-app/templates/blank/package.json.hbs
  • packages/create-croco-app/templates/saas/libs/shared/provider-rpc/package.json.hbs
  • packages/create-croco-app/templates/saas/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/libs/shared/provider-rpc/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/container-fullstack/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/ssr-lambda/package.json.hbs
  • packages/customer-health-drizzle/package.json
  • packages/entitlements-drizzle/package.json
  • packages/framework-context/package.json
  • packages/framework-module/package.json
  • packages/framework-routes/package.json
  • packages/meta-vite/package.json
  • packages/migration-runner/package.json
  • packages/openapi-spec/package.json
  • packages/protocols-core/package.json
  • packages/protocols-graphql/package.json
  • packages/protocols-graphql/vitest.config.ts
  • packages/protocols-rest/package.json
  • packages/protocols-trpc/package.json
  • packages/rpc-codegen/package.json
  • packages/search-core/package.json
  • packages/tasks-core/package.json
  • packages/telemetry-api/package.json
  • packages/testing/package.json
  • packages/transports-cloudflare-workers/package.json
  • packages/transports-cloudflare-workers/src/tests/PublishedWorkerTypes.spec.ts
  • packages/transports-http/package.json
  • packages/triggers-core/package.json
  • packages/workflow-core/package.json
  • pnpm-workspace.yaml
  • scripts/dependency-audit-policy.mts
  • scripts/package-entrypoint-smoke.mts
  • scripts/security-allowlist-metadata.json
  • scripts/tests/ci-workflow.spec.ts
  • scripts/tests/dependency-audit-policy.spec.ts
  • scripts/tests/package-bin-smoke.spec.ts
  • scripts/tests/package-entrypoint-smoke.spec.ts
  • scripts/tests/release-workflow.spec.ts
📝 Walkthrough

Walkthrough

경로 인식 의존성 감사 정책 스크립트(scripts/dependency-audit-policy.mts)를 신규 추가하고 CI/릴리스 워크플로우에서 audit:prod 대신 security:audit-policy를 사용하도록 전환했다. pnpm을 11.9.0으로 업그레이드하고 다수 패키지에 devDependencies를 추가했으며, create-croco-app 템플릿의 next/drizzle-orm 버전과 provider-rpc 의존성을 갱신하고 관련 테스트를 업데이트했다.

Changes

의존성 감사 정책 코어 및 CI/릴리스 연동

Layer / File(s) Summary
감사 정책 타입/실행 흐름
scripts/dependency-audit-policy.mts
CLI 옵션 파싱, pnpm audit 실행/병합, 감사 결과 분류(runtime/dev/generated-app/release-evidence), 블로킹/고위험 판정, 메타데이터 검증, 마크다운 리포트 생성 및 exitCode 결정 로직을 구현한 runDependencyAuditPolicy 함수를 신규 추가.
정책 스크립트 단위 테스트
scripts/tests/dependency-audit-policy.spec.ts
신규 Vitest 스펙으로 런타임 미검토 실패, 에러 응답, reviewBy 허용, 프로덕션/템플릿 경로 병합, generated-app/release-evidence 승격, dead suppression 위반, 만료 메타데이터 시나리오를 검증.
CI/릴리스 워크플로우 연동
.github/workflows/ci.yml, .github/workflows/release.yml, package.json, .gitignore, scripts/security-allowlist-metadata.json, pnpm-workspace.yaml, scripts/tests/ci-workflow.spec.ts, scripts/tests/release-workflow.spec.ts
pnpm audit:prodpnpm security:audit-policy로 대체하고 요약 문구를 갱신, security:audit-policy npm 스크립트 등록, 억제 목록(ignoreGhsas)을 제거하고 allowBuilds 설정 추가, 회귀 테스트 갱신.

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

패키지 매니저 업그레이드, 의존성 추가 및 템플릿 갱신

Layer / File(s) Summary
pnpm 11.9.0 업그레이드
package.json, packages/create-croco-app/templates/..., packages/create-croco-app/test-fixtures/..., packages/cli/src/tests/*.spec.ts, scripts/tests/package-bin-smoke.spec.ts
루트 및 각 템플릿/픽스처의 packageManagerpnpm@10.15.1에서 pnpm@11.9.0으로 일괄 갱신, 관련 테스트 기대값도 동기화.
devDependencies/dependencies 추가
packages/admin-generated/..., packages/audit-drizzle/..., packages/customer-health-drizzle/..., packages/entitlements-drizzle/..., packages/framework-context/..., packages/meta-vite/..., packages/migration-runner/..., packages/protocols-graphql/vitest.config.ts, packages/protocols-trpc/..., packages/search-core/..., packages/telemetry-api/..., packages/transports-cloudflare-workers/package.json, packages/workflow-core/...
reflect-metadata, better-sqlite3, @types/, @opentelemetry/ 등 개발/런타임 의존성 추가 및 vitest alias 경로 수정.
provider-rpc problems-core 의존성
packages/create-croco-app/templates/saas/..., .../spa-be-split/..., packages/create-croco-app/src/tests/e2e-generation.spec.ts, .../templates-build.spec.ts
saas/spa-be-split의 provider-rpc 템플릿에 @croco/problems-core workspace 의존성 추가 및 관련 e2e/빌드 테스트 검증 추가.
템플릿 버전 갱신 및 워커 개선
packages/create-croco-app/templates/addons/*/apps/web/package.json.hbs, .../base-ddd/.../provider-database/package.json.hbs, .../web-meta-vite-fullstack/api-worker/*
next 버전을 ^15.5.18로, drizzle-orm을 ^0.45.2로 갱신, api-worker의 default export를 ExportedHandler<ApiWorkerEnv> 타입으로 리팩터링 및 Cloudflare Workers 타입 추가.
스모크/단위 테스트 리팩터링
packages/analytics-posthog/src/tests/Integration.spec.ts, scripts/package-entrypoint-smoke.mts, scripts/tests/package-entrypoint-smoke.spec.ts, packages/transports-cloudflare-workers/src/tests/PublishedWorkerTypes.spec.ts
PostHog capture 검증을 spy 기반으로 변경, package-entrypoint-smoke의 외부 의존성 탐색을 packageDir 우선 후 rootDir로 변경, PublishedWorkerTypes 테스트를 InstalledPackage[] 구조로 리팩터링.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CI as CI Workflow
  participant Release as Release Workflow
  participant Script as security:audit-policy
  participant Policy as dependency-audit-policy.mts
  participant Report as ci-reports/security

  CI->>Script: pnpm security:audit-policy 실행
  Release->>Script: pnpm security:audit-policy 실행
  Script->>Policy: runDependencyAuditPolicy 호출
  Policy->>Policy: pnpm audit 결과 수집/분류
  Policy->>Report: 마크다운 리포트 작성
  Policy-->>Script: exitCode 반환
  Script-->>CI: 성공/실패 상태 보고
  Script-->>Release: publish 차단 여부 결정
Loading

Possibly related issues

Possibly related PRs

  • croco-dev/framework#731: 두 PR 모두 scripts/package-entrypoint-smoke.mtsrunPackageSmoke/의존성 설치 로직을 수정함.
  • croco-dev/framework#819: SaaS provider-rpc 템플릿에 @croco/problems-core 의존성을 추가하는 부분이 SaaS 프리셋 템플릿 생성 관련 PR과 겹침.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Next/패키지매니저 버전 갱신과 여러 unrelated 의존성 추가 등 감사 정책과 직접 무관한 변경이 다수 포함됩니다. 감사 정책과 CI/릴리스 연동에 필요한 파일만 남기고, 템플릿 버전·불필요한 의존성 추가는 별도 PR로 분리하세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 런타임 의존성 감사 정책 강제라는 핵심 변경을 간결하게 잘 요약합니다.
Linked Issues check ✅ Passed 의존성 경로 분류, CI/릴리스 게이트 연동, 런타임 예외 메타데이터 검증, allowlist 연계가 모두 반영되었습니다.
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 issue-1188-runtime-audit-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 -3.0% -
CrocoApp lambdaHandler (10 controllers) 272.1μs 50.0ms 258.4μs +5.3% -
Lambda cold-start simulation 420.6μs 80.0ms 418.1μs +0.6% -
Lambda cold-start with headers 371.4μs 80.0ms 369.7μs +0.5% -
Lambda cold-start with binary body 343.6μs 80.0ms 339.1μs +1.3% -
Lambda cold-start with query params 297.1μs 80.0ms 301.3μs -1.4% -
Lambda cold-start with authorizer context 293.0μs 80.0ms 299.8μs -2.3% -
Lambda cold-start realistic scenario 291.6μs 80.0ms 299.2μs -2.5% -
EventBusConfig.start (10 handlers) 1.8μs 10.0ms 1.4μs +29.1% -
EventPublisher.publishNow single event 1.9μs 2.0ms 1.7μs +15.6% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs -13.7% -
Container.get singleton (cold) 68.1μs 5.0ms 70.3μs -3.1% -
Container.register × 50 components 3.6ms 10.0ms 3.2ms +10.0% -
Container.validate (50 components) 3.6ms 20.0ms 3.4ms +5.9% -
Container.get singleton (warm) 1.9μs 500.0μs 1.6μs +16.7% -
TelemetryRuntime.init (lambda preset) 2.0μs 200.0ms 1.1ms -99.8% -
lambdaPreset config creation 1.4μs 2.0ms 1.4μs -2.1% -

Updated: 2026-07-04T04:57:27.244Z · Commit: 13a7b66

@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: 0ebc3a0c11

ℹ️ 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/dependency-audit-policy.mts Outdated
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from 0ebc3a0 to 35f4eab Compare July 4, 2026 00:26

@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: 35f4eab4ce

ℹ️ 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/dependency-audit-policy.mts Outdated
Comment thread scripts/dependency-audit-policy.mts Outdated
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch 2 times, most recently from 0924e00 to a54fa4a Compare July 4, 2026 01:30
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from a54fa4a to 33ef3f3 Compare July 4, 2026 01:33
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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

ℹ️ 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 .github/workflows/ci.yml
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from 33ef3f3 to 546289f Compare July 4, 2026 02:35
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from 546289f to 33ff1a0 Compare July 4, 2026 02:41
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from 33ff1a0 to 1b1cd4b Compare July 4, 2026 02: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: 1b1cd4b223

ℹ️ 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/dependency-audit-policy.mts Outdated
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from 1b1cd4b to f32fd3b Compare July 4, 2026 03:34
coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 4, 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: 9

🤖 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/create-croco-app/templates/addons/web-graphql/apps/web/package.json.hbs`:
- Line 16: The Next dependency in the web GraphQL template was changed from an
exact pin to a caret range, so verify whether this template should keep
reproducible builds; if so, update the package.json.hbs entry in the web addon
template to use the same exact versioning pattern as before. Check the
dependency declaration for next in the template and keep it consistent with the
intended versioning strategy used by the other addon templates.

In `@packages/customer-health-drizzle/package.json`:
- Around line 42-43: `customer-health-drizzle`의 package.json에서
`reflect-metadata` 버전 표기가 레포 내 다른 패키지들과 불일치합니다. 이 패키지군의 기존 규칙에 맞춰
`drizzle-orm`처럼 버전 표기를 하나로 통일하고, `reflect-metadata`도 동일한 방식으로 맞추세요.
`package.json`의 dependencies 항목에서 해당 두 의존성 표기를 확인해 일관되게 수정하면 됩니다.

In `@packages/protocols-trpc/package.json`:
- Around line 43-44: `reflect-metadata` version is inconsistent across packages,
which can cause mismatched metadata behavior for typedi and other
reflection-based code. Update the dependency entry in the package manifest here
to use the same version range as the rest of the monorepo, and make sure any
related package manifests that reference `reflect-metadata` (including the
workflow-core package) are aligned to one shared version. Use the
`reflect-metadata` dependency entry as the anchor for the change.

In
`@packages/transports-cloudflare-workers/src/tests/PublishedWorkerTypes.spec.ts`:
- Around line 167-180: Duplicate external dependency entries are overwriting the
first valid local install path in the PublishedWorkerTypes.spec test setup. In
the loop that builds externalDependencies, update the logic so
installedPackage.packageDir is only recorded if that dependencyName has not
already been seen, or otherwise prefer the packageDir whose
installedDependencyDir actually exists on disk. Keep the existing
sorting/iteration over externalDependencies, but ensure the source directory
resolution in installedDependencyDir uses a preserved valid path instead of the
last package to declare the dependency.

In `@scripts/dependency-audit-policy.mts`:
- Around line 230-243: The pnpm subprocess calls can hang indefinitely because
`spawnSync` is used without a timeout. Add a bounded `timeout` to both
`runPnpmAudit` and `runGeneratedTemplateAudit` so `pnpm audit` and `pnpm install
--lockfile-only` fail fast under registry/network delays, and handle the
timeout/error path consistently with the existing `result.error` and stderr
reporting.
- Around line 498-519: `readConfiguredSuppressions` is scanning only the
`packages` workspace, so `examples/*/package.json` suppressions are missed while
`readWorkspaceManifests` already includes both workspace roots. Update
`readConfiguredSuppressions` to also traverse the `examples` directory (using
the same manifest discovery approach as
`readWorkspaceManifests`/`findPackageJsonFiles`), and merge those results into
the suppression scan so `pnpm.auditConfig` entries under examples are detected
as dead policy state.
- Around line 755-768: The readWorkspaceSuppressions helper currently scans
pnpm-workspace.yaml with a global regex, so it can pick up GHSA/CVE entries
outside the intended auditConfig scope. Update readWorkspaceSuppressions in
dependency-audit-policy.mts to parse the YAML structure and extract only
pnpm.auditConfig.ignoreGhsas and pnpm.auditConfig.ignoreCves values, instead of
matching all text. Keep the existing ConfiguredSuppression shape and source
mapping, but ensure the logic is scoped to the actual keys so unrelated lists or
comments do not produce suppressions.
- Around line 163-267: The script currently throws generic Error instances in
parseArgs, runPnpmAudit, parseAuditJson, and runGeneratedTemplateAudit instead
of using a Problem subclass. Add or import a dedicated Problem type for this CLI
(for example DependencyAuditPolicyProblem) and replace every throw new Error
path with that subclass, keeping the same messages and labels so all failures in
the dependency-audit-policy flow follow the project convention.

In `@scripts/tests/dependency-audit-policy.spec.ts`:
- Around line 430-450: The advisory() test fixture only generates dependency
paths without version suffixes, so it can’t catch regressions in
parseAuditPath/dependencyFieldFor handling real pnpm audit paths. Update the
dependency-audit-policy.spec.ts fixtures to include at least one advisory case
whose path includes an `@version` suffix on the final segment, and make sure the
existing test assertions cover that path shape through advisory() and the
related audit-path parsing behavior.
🪄 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: 7b292062-fdde-4843-accf-9a0ca1401cf0

📥 Commits

Reviewing files that changed from the base of the PR and between 46bf238 and f32fd3b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (51)
  • .changeset/c4d7fa0c.md
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .gitignore
  • package.json
  • packages/admin-generated/package.json
  • packages/analytics-posthog/src/tests/Integration.spec.ts
  • packages/audit-drizzle/package.json
  • packages/cli/src/tests/doctor.spec.ts
  • packages/cli/src/tests/projectMap.spec.ts
  • packages/create-croco-app/src/tests/e2e-generation.spec.ts
  • packages/create-croco-app/src/tests/generator-install.spec.ts
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/templates/addons/graphql-nextjs/apps/web/package.json.hbs
  • packages/create-croco-app/templates/addons/trpc-nextjs/apps/web/package.json.hbs
  • packages/create-croco-app/templates/addons/web-graphql/apps/web/package.json.hbs
  • packages/create-croco-app/templates/addons/web-meta-vite-fullstack/api-worker/package.json.hbs
  • packages/create-croco-app/templates/addons/web-meta-vite-fullstack/api-worker/src/index.ts
  • packages/create-croco-app/templates/addons/web-meta-vite-fullstack/api-worker/tsconfig.json.hbs
  • packages/create-croco-app/templates/addons/web-trpc/apps/web/package.json.hbs
  • packages/create-croco-app/templates/admin-console/package.json.hbs
  • packages/create-croco-app/templates/ai-saas/package.json.hbs
  • packages/create-croco-app/templates/base-ddd/libs/shared/provider-database/package.json.hbs
  • packages/create-croco-app/templates/blank/package.json.hbs
  • packages/create-croco-app/templates/saas/libs/shared/provider-rpc/package.json.hbs
  • packages/create-croco-app/templates/saas/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/libs/shared/provider-rpc/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/container-fullstack/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/ssr-lambda/package.json.hbs
  • packages/customer-health-drizzle/package.json
  • packages/entitlements-drizzle/package.json
  • packages/framework-context/package.json
  • packages/meta-vite/package.json
  • packages/migration-runner/package.json
  • packages/protocols-graphql/vitest.config.ts
  • packages/protocols-trpc/package.json
  • packages/search-core/package.json
  • packages/telemetry-api/package.json
  • packages/transports-cloudflare-workers/package.json
  • packages/transports-cloudflare-workers/src/tests/PublishedWorkerTypes.spec.ts
  • packages/workflow-core/package.json
  • pnpm-workspace.yaml
  • scripts/dependency-audit-policy.mts
  • scripts/package-entrypoint-smoke.mts
  • scripts/security-allowlist-metadata.json
  • scripts/tests/ci-workflow.spec.ts
  • scripts/tests/dependency-audit-policy.spec.ts
  • scripts/tests/package-bin-smoke.spec.ts
  • scripts/tests/package-entrypoint-smoke.spec.ts
  • scripts/tests/release-workflow.spec.ts

Comment thread packages/create-croco-app/templates/addons/web-graphql/apps/web/package.json.hbs Outdated
Comment thread packages/customer-health-drizzle/package.json Outdated
Comment thread packages/protocols-trpc/package.json Outdated
Comment thread packages/transports-cloudflare-workers/src/tests/PublishedWorkerTypes.spec.ts Outdated
Comment thread scripts/dependency-audit-policy.mts
Comment thread scripts/dependency-audit-policy.mts
Comment thread scripts/dependency-audit-policy.mts
Comment thread scripts/dependency-audit-policy.mts
Comment thread scripts/tests/dependency-audit-policy.spec.ts
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from f32fd3b to 6e548b6 Compare July 4, 2026 04:31

@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: 6e548b61e3

ℹ️ 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/dependency-audit-policy.mts Outdated
@kang-heewon
kang-heewon force-pushed the issue-1188-runtime-audit-policy branch from 6e548b6 to 0335245 Compare July 4, 2026 04:49
@kang-heewon
kang-heewon dismissed coderabbitai[bot]’s stale review July 4, 2026 05:22

Addressed CodeRabbit findings on the current head; latest CodeRabbit review could not run because prepaid credits are exhausted.

@kang-heewon
kang-heewon merged commit a125d51 into trunk Jul 4, 2026
9 checks passed
@kang-heewon
kang-heewon deleted the issue-1188-runtime-audit-policy branch July 4, 2026 05:33
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.

[security] Add path-sensitive runtime dependency audit policy for PRs

1 participant