Skip to content

fix: preserve concurrent execution checkpoints - #1609

Merged
kang-heewon merged 8 commits into
trunkfrom
fix/1596-atomic-checkpoints
Jul 30, 2026
Merged

fix: preserve concurrent execution checkpoints#1609
kang-heewon merged 8 commits into
trunkfrom
fix/1596-atomic-checkpoints

Conversation

@kang-heewon

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

Copy link
Copy Markdown
Member

Outcome

Execution checkpoint writes now delegate to a store-level atomic key merge instead of a manager-side read-modify-write cycle. Concurrent writes to different checkpoint keys preserve both values, while same-key writes use the store serialization order and retain the last applied mutation.

The Drizzle adapter performs one PostgreSQL JSONB merge update. A shared, browser-compatible conformance suite now exercises in-memory and durable stores, and CI runs the real PostgreSQL contention cases.

Fixes #1596

Verification

  • pnpm --filter @croco/execution-core test — 93/93 passed, including browser bundle coverage
  • pnpm --filter @croco/execution-drizzle test — 47 passed; 2 credential-gated PostgreSQL tests skipped
  • Real PostgreSQL concurrency suite — 2/2 passed for different-key preservation and same-key last-applied behavior
  • execution-core and execution-drizzle lint, typecheck, and dependency-graph build passed
  • pnpm problem-registry:check — 512/512 discoveries matched current trunk
  • pnpm public-api:check — 114 package snapshots matched
  • pnpm changeset-required:check — affected publishable packages covered
  • generated-app smoke matrix — all cases passed
  • pre-push workspace tests — 232/232 tasks passed
  • pre-push workspace typecheck — 231/231 tasks passed
  • pnpm check — 22 repository gates passed; one not applicable, and the benchmark gate was invalidated by concurrent machine load; its focused rerun passed all thresholds

Review gates

  • Correctness and regression: PASS — manager delegation, atomic JSONB merge, different-key preservation, same-key ordering semantics, missing execution handling, and real row-lock contention are covered.
  • API, compatibility, and release: PASS — the abstract store contract, generated template adapter, reusable conformance API, Problem registry/docs, public API snapshot, CI command allowlist, and changesets are synchronized.
  • Maintainability and minimality: PASS — atomicity belongs to each storage adapter; the manager no longer guesses or coordinates persistence semantics.
  • Independent adversarial review: APPROVE after incorporating current trunk and preserving both execution Problem codes.

Residual risk

Custom ExecutionStore adapters must implement mergeCheckpoint() as a storage-level atomic operation. The conformance suite detects lost different-key updates, but deterministic caller-order semantics for concurrent same-key writes require a stronger adapter-specific version or compare-and-swap contract.

Summary by CodeRabbit

  • 새 기능
    • 체크포인트를 키 단위로 원자적으로 병합하는 업데이트 방식(mergeCheckpoint)을 지원합니다.
    • 동일 키의 동시 업데이트는 저장소 적용 결과 기준으로 마지막 값이 반영됩니다.
    • 체크포인트 스토어 동시성 계약을 검증하는 공개 컨포먼스 스위트/도구를 제공합니다.
    • PostgreSQL 체크포인트 저장소의 동시성/잠금 동작 검증을 추가했습니다.
  • 문서
    • 체크포인트 병합 계약, 동시성 규칙, 관련 API 및 새 오류 코드(ckpt store conformance)를 문서화했습니다.
    • 문제 코드 레지스트리 및 API 문서를 업데이트했습니다.

@coderabbitai

coderabbitai Bot commented Jul 29, 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: 51 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 Plus

Run ID: 24bae395-4a35-4125-b896-27f5a897dc6e

📥 Commits

Reviewing files that changed from the base of the PR and between a7f4205 and b7aeaea.

⛔ Files ignored due to path filters (2)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (46)
  • .changeset/atomic-execution-checkpoints.md
  • .github/workflows/ci.yml
  • docs/problem-code-registry.json
  • packages/admin-ops/src/tests/RetryConsole.spec.ts
  • packages/batch-core/src/tests/ChunkExecutor.spec.ts
  • packages/batch-qstash/src/tests/InMemoryContinuationStore.ts
  • packages/cli/src/tests/integration/jobs-e2e.spec.ts
  • packages/cli/src/tests/jobs.spec.ts
  • packages/create-croco-app/templates/saas/apps/api-server/src/inMemoryAdapters.ts
  • packages/docs/src/content/docs/api/execution-core/src/classes/ExecutionProblems.md
  • packages/docs/src/content/docs/api/execution-core/src/classes/ExecutionStore.md
  • packages/docs/src/content/docs/api/execution-core/src/enumerations/ExecutionProblemCode.md
  • packages/docs/src/content/docs/api/execution-core/src/functions/createExecutionCheckpointStoreConformanceSuite.md
  • packages/docs/src/content/docs/api/execution-core/src/functions/prepareExecutionCheckpoint.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointConcurrencyResult.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceCase.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceOptions.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceSuite.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointValue.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointWrite.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/PreparedExecutionCheckpoint.md
  • packages/docs/src/content/docs/api/execution-drizzle/src/classes/DrizzleExecutionStore.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/execution-core/README.md
  • packages/execution-core/package.json
  • packages/execution-core/src/index.ts
  • packages/execution-core/src/libs/ExecutionCheckpoint.ts
  • packages/execution-core/src/libs/ExecutionManagerImpl.ts
  • packages/execution-core/src/libs/ExecutionProblem.ts
  • packages/execution-core/src/libs/conformance.ts
  • packages/execution-core/src/libs/interfaces/ExecutionStore.ts
  • packages/execution-core/src/tests/BrowserEntry.spec.ts
  • packages/execution-core/src/tests/ExecutionContinuation.spec.ts
  • packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts
  • packages/execution-drizzle/package.json
  • packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.spec.ts
  • packages/tasks-core/src/tests/TaskRunner.integration.spec.ts
  • packages/workflow-core/src/tests/WorkflowCore.spec.ts
  • public-api-surface.snapshot.json
  • scripts/create-croco-app-generated-smoke.mts
  • scripts/tests/ci-workflow.spec.ts
  • scripts/tests/create-croco-app-generated-smoke.spec.ts
  • scripts/workflow-verification-contract.mts
📝 Walkthrough

Walkthrough

ExecutionStore에 체크포인트 키별 원자적 병합 API가 추가되었습니다. 실행 관리자는 새 API를 사용하며, 메모리·Drizzle 저장소와 동시성 적합성 테스트, PostgreSQL CI 검증, 공개 문서 및 문제 코드가 갱신되었습니다.

Changes

체크포인트 병합

Layer / File(s) Summary
핵심 계약과 적합성 스위트
packages/execution-core/src/libs/*, packages/execution-core/src/tests/*, public-api-surface.snapshot.json
mergeCheckpoint 계약과 동시성 적합성 스위트가 추가되고, 실행 관리자의 체크포인트 갱신이 저장소 위임 방식으로 변경되었습니다.
Drizzle 저장소와 PostgreSQL 검증
packages/execution-drizzle/*, .github/workflows/ci.yml, scripts/*
JSONB 키 병합 구현과 SQL·행 잠금 테스트가 추가되며 PostgreSQL 검증이 CI에 연결되었습니다.
메모리 저장소 구현 갱신
packages/*/src/tests/*, packages/create-croco-app/templates/.../inMemoryAdapters.ts
테스트용 및 템플릿 메모리 저장소가 기존 체크포인트를 보존하면서 단일 키를 갱신하고 표준 not-found 문제를 반환합니다.
API 문서와 문제 레지스트리
packages/docs/*, packages/execution-core/README.md, docs/problem-code-registry.json, .changeset/*
병합 계약·적합성 타입·문제 코드·저장소 예시와 릴리스 메타데이터가 문서화되었습니다.
브라우저 번들 및 생성 앱 빌드 지원
packages/execution-core/package.json, packages/execution-core/src/tests/BrowserEntry.spec.ts, scripts/create-croco-app-generated-smoke.mts
브라우저 번들 검증과 플랫폼별 Turbo 동시성 인자 처리가 추가되었습니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant ExecutionManagerImpl
  participant DrizzleExecutionStore
  participant PostgreSQL
  Caller->>ExecutionManagerImpl: checkpoint(id, key, value)
  ExecutionManagerImpl->>DrizzleExecutionStore: mergeCheckpoint(id, key, value)
  DrizzleExecutionStore->>PostgreSQL: JSONB key merge UPDATE
  PostgreSQL-->>DrizzleExecutionStore: Updated execution
  DrizzleExecutionStore-->>ExecutionManagerImpl: Execution
  ExecutionManagerImpl-->>Caller: Execution
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Windows용 Turbo 동시성 인자/테스트 변경은 체크포인트 병합 문제와 직접 관련이 없어 보입니다. 체크포인트 동시성 수정과 무관한 빌드/스모크 테스트 변경은 별도 PR로 분리하거나 범위 근거를 보강하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 체크포인트 동시성 보존이라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed 서로 다른 키 병합, 동일 키 동시성 의미, 스토어 수준 merge, manager RMW 제거, 공통 conformance 테스트가 모두 반영됐습니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1596-atomic-checkpoints

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 29, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 9.3μs 30.0ms 8.2μs +14.1% -
CrocoApp lambdaHandler (10 controllers) 295.1μs 50.0ms 258.4μs +14.2% -
Lambda cold-start simulation 451.2μs 80.0ms 418.1μs +7.9% -
Lambda cold-start with headers 398.8μs 80.0ms 369.7μs +7.9% -
Lambda cold-start with binary body 384.9μs 80.0ms 339.1μs +13.5% -
Lambda cold-start with query params 321.5μs 80.0ms 301.3μs +6.7% -
Lambda cold-start with authorizer context 319.9μs 80.0ms 299.8μs +6.7% -
Lambda cold-start realistic scenario 321.3μs 80.0ms 299.2μs +7.4% -
EventBusConfig.start (10 handlers) 1.6μs 10.0ms 1.4μs +13.3% -
EventPublisher.publishNow single event 1.8μs 2.0ms 1.7μs +7.7% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs +0.0% -
Container.get singleton (cold) 78.9μs 5.0ms 70.3μs +12.3% -
Container.register × 50 components 3.4ms 10.0ms 3.2ms +4.5% -
Container.validate (50 components) 3.8ms 20.0ms 3.4ms +12.7% -
Container.get singleton (warm) 1.7μs 500.0μs 1.6μs +1.8% -
TelemetryRuntime.init (lambda preset) 2.3μs 200.0ms 1.1ms -99.8% -
lambdaPreset config creation 1.5μs 2.0ms 1.4μs +4.3% -

Updated: 2026-07-30T05:32:47.923Z · Commit: 660f222

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

🤖 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/saas/apps/api-server/src/inMemoryAdapters.ts`:
- Around line 404-416: Replace generic missing-execution Errors with
ExecutionProblems.notFound(...) across mergeCheckpoint in
packages/create-croco-app/templates/saas/apps/api-server/src/inMemoryAdapters.ts
and the affected test helpers in
packages/admin-ops/src/tests/RetryConsole.spec.ts,
packages/batch-core/src/tests/ChunkExecutor.spec.ts,
packages/batch-qstash/src/tests/InMemoryContinuationStore.ts,
packages/cli/src/tests/integration/jobs-e2e.spec.ts, and
packages/cli/src/tests/jobs.spec.ts; ensure InMemoryContinuationStore.required()
also uses this standardized problem.

In `@packages/execution-core/package.json`:
- Line 39: Update the esbuild dependency declaration in package.json from the
current ^0.20.2 range to a patched version range starting at ^0.25.0, preferably
the current ^0.28.1 release. Keep the dependency entry otherwise unchanged.

In `@packages/execution-core/src/libs/interfaces/ExecutionStore.ts`:
- Around line 58-67: Update the mergeCheckpoint contract documentation to add an
`@throws` entry stating that it throws an Error when the target execution does not
exist or the merge fails, matching the behavior documented for create, update,
appendLog, and delete. Keep the existing atomic merge and ordering guarantees
unchanged.

In `@packages/execution-drizzle/package.json`:
- Around line 43-46: Update the dependency entries in the package manifest so
vitest, pg, and `@types/pg` use the workspace catalog reference consistently with
drizzle-orm. Add their versions to the catalog configuration in
pnpm-workspace.yaml, then replace the hardcoded versions in the manifest with
catalog references.

In `@packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts`:
- Around line 107-124: Update the checkpoint writer blocking flow around
blockedWrite and waitUntilCheckpointWriterBlocks so timeout failures always
settle blockedWrite before cleanup. Ensure the second client’s in-flight query
is completed or safely cancelled before secondClient.release(), while preserving
the existing commit/rollback behavior and successful blocked-write path.
- Around line 103-104: In the test around firstWrite and secondWrite, validate
that writes contains exactly the expected number of entries before indexing it,
instead of relying on as ExecutionCheckpointWrite assertions. Keep the
subsequent key checks unchanged so insufficient writes produce a clear assertion
failure rather than a TypeError.

In `@packages/execution-drizzle/src/tests/DrizzleExecutionStore.spec.ts`:
- Around line 730-733: In the test around mergeCheckpoint, replace the manual
Error guard for written.checkpoints with a Vitest
expect(expression).toBeDefined() assertion, then continue converting the
expression to SQL as before.
🪄 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 Plus

Run ID: e1b917f6-97d9-4959-8409-c8f2ff092d9f

📥 Commits

Reviewing files that changed from the base of the PR and between 57f5bab and b49c18f.

⛔ Files ignored due to path filters (2)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (39)
  • .changeset/atomic-execution-checkpoints.md
  • .github/workflows/ci.yml
  • docs/problem-code-registry.json
  • packages/admin-ops/src/tests/RetryConsole.spec.ts
  • packages/batch-core/src/tests/ChunkExecutor.spec.ts
  • packages/batch-qstash/src/tests/InMemoryContinuationStore.ts
  • packages/cli/src/tests/integration/jobs-e2e.spec.ts
  • packages/cli/src/tests/jobs.spec.ts
  • packages/create-croco-app/templates/saas/apps/api-server/src/inMemoryAdapters.ts
  • packages/docs/src/content/docs/api/execution-core/src/classes/ExecutionProblems.md
  • packages/docs/src/content/docs/api/execution-core/src/classes/ExecutionStore.md
  • packages/docs/src/content/docs/api/execution-core/src/enumerations/ExecutionProblemCode.md
  • packages/docs/src/content/docs/api/execution-core/src/functions/createExecutionCheckpointStoreConformanceSuite.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointConcurrencyResult.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceCase.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceOptions.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceSuite.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointWrite.md
  • packages/docs/src/content/docs/api/execution-drizzle/src/classes/DrizzleExecutionStore.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/execution-core/README.md
  • packages/execution-core/package.json
  • packages/execution-core/src/index.ts
  • packages/execution-core/src/libs/ExecutionManagerImpl.ts
  • packages/execution-core/src/libs/ExecutionProblem.ts
  • packages/execution-core/src/libs/conformance.ts
  • packages/execution-core/src/libs/interfaces/ExecutionStore.ts
  • packages/execution-core/src/tests/BrowserEntry.spec.ts
  • packages/execution-core/src/tests/ExecutionContinuation.spec.ts
  • packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts
  • packages/execution-drizzle/package.json
  • packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.spec.ts
  • packages/tasks-core/src/tests/TaskRunner.integration.spec.ts
  • packages/workflow-core/src/tests/WorkflowCore.spec.ts
  • public-api-surface.snapshot.json
  • scripts/workflow-verification-contract.mts

Comment thread packages/execution-core/package.json Outdated
Comment thread packages/execution-core/src/libs/interfaces/ExecutionStore.ts
Comment thread packages/execution-drizzle/package.json
Comment thread packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts Outdated
Comment thread packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts Outdated
Comment thread packages/execution-drizzle/src/tests/DrizzleExecutionStore.spec.ts
@kang-heewon
kang-heewon force-pushed the fix/1596-atomic-checkpoints branch from b49c18f to 2d80710 Compare July 29, 2026 15:08
@kang-heewon

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@kang-heewon
kang-heewon force-pushed the fix/1596-atomic-checkpoints branch from 2d80710 to 13b6ff4 Compare July 29, 2026 16:07

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

🤖 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/execution-core/src/tests/ExecutionContinuation.spec.ts`:
- Around line 54-57: Replace the generic Error thrown by
ExecutionStore.mergeCheckpoint when the execution ID is missing with
ExecutionProblems.notFound(...). Also update the unexpected-call mock path at
packages/execution-core/src/tests/ExecutionContinuation.spec.ts#L651-L653 to
throw the appropriate ExecutionProblems subclass, ensuring both sites throw only
RFC 7807 Problem-based errors.

In `@packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts`:
- Around line 108-112: Update mergeCheckpoint in the test mock to throw the
appropriate missing-execution ExecutionProblem from the existing
ExecutionProblems factory or Problem subclass instead of a generic Error,
preserving the current not-found condition and message/context.

In `@packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts`:
- Around line 279-285: Update mergeCheckpoint so its value input is restricted
to the checkpoint contract’s serializable type, or consistently reject
undefined, bigint, and cyclic values with the established ExecutionProblem
checkpoint-conformance Problem before persistence. Ensure JSON.stringify cannot
silently produce an empty object for undefined or leak a raw TypeError for
unsupported values.

In `@packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts`:
- Line 29: Replace the direct Error throw in the row-lock timeout path of the
PostgreSQL checkpoint-writer test with Vitest’s assert.fail(...), preserving the
existing timeout message so the failure is reported as an explicit test
assertion.
- Around line 43-79: Recreate the DrizzleExecutionStore instance for every test:
keep pool and schema setup in beforeAll, but after truncating executions in
beforeEach assign store from a fresh DrizzleExecutionStore built with
drizzle(pool). This ensures createStore: () => store uses an isolated store
instance per test.
- Around line 1-8: DrizzleExecutionStore.postgres 테스트의 import 순서를 가이드라인에 맞게
정리하세요. `@croco/*` 패키지 import를 외부 패키지 import보다 앞에 배치하고, `Execution`과
`PoolClient`는 각각 value import에서 분리해 `import type` 그룹으로 이동하세요. 기존 value import와
테스트 동작은 변경하지 마세요.
🪄 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 Plus

Run ID: ab15eed5-bb41-4f19-a808-9cacbc29f4fb

📥 Commits

Reviewing files that changed from the base of the PR and between b49c18f and 13b6ff4.

⛔ Files ignored due to path filters (2)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (40)
  • .changeset/atomic-execution-checkpoints.md
  • .github/workflows/ci.yml
  • docs/problem-code-registry.json
  • packages/admin-ops/src/tests/RetryConsole.spec.ts
  • packages/batch-core/src/tests/ChunkExecutor.spec.ts
  • packages/batch-qstash/src/tests/InMemoryContinuationStore.ts
  • packages/cli/src/tests/integration/jobs-e2e.spec.ts
  • packages/cli/src/tests/jobs.spec.ts
  • packages/create-croco-app/templates/saas/apps/api-server/src/inMemoryAdapters.ts
  • packages/docs/src/content/docs/api/execution-core/src/classes/ExecutionProblems.md
  • packages/docs/src/content/docs/api/execution-core/src/classes/ExecutionStore.md
  • packages/docs/src/content/docs/api/execution-core/src/enumerations/ExecutionProblemCode.md
  • packages/docs/src/content/docs/api/execution-core/src/functions/createExecutionCheckpointStoreConformanceSuite.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointConcurrencyResult.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceCase.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceOptions.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointStoreConformanceSuite.md
  • packages/docs/src/content/docs/api/execution-core/src/type-aliases/ExecutionCheckpointWrite.md
  • packages/docs/src/content/docs/api/execution-drizzle/src/classes/DrizzleExecutionStore.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/execution-core/README.md
  • packages/execution-core/package.json
  • packages/execution-core/src/index.ts
  • packages/execution-core/src/libs/ExecutionManagerImpl.ts
  • packages/execution-core/src/libs/ExecutionProblem.ts
  • packages/execution-core/src/libs/conformance.ts
  • packages/execution-core/src/libs/interfaces/ExecutionStore.ts
  • packages/execution-core/src/tests/BrowserEntry.spec.ts
  • packages/execution-core/src/tests/ExecutionContinuation.spec.ts
  • packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts
  • packages/execution-drizzle/package.json
  • packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.spec.ts
  • packages/tasks-core/src/tests/TaskRunner.integration.spec.ts
  • packages/workflow-core/src/tests/WorkflowCore.spec.ts
  • public-api-surface.snapshot.json
  • scripts/tests/ci-workflow.spec.ts
  • scripts/workflow-verification-contract.mts

Comment thread packages/execution-core/src/tests/ExecutionContinuation.spec.ts
Comment thread packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts
Comment thread packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts
Comment thread packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts Outdated
Comment thread packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts Outdated
@kang-heewon

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

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

Caution

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

⚠️ Outside diff range comments (1)
packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts (1)

87-94: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

두 번째 커넥션 획득 실패 시 첫 커넥션이 누수됩니다.

pool.connect() 호출이 try 앞에 있으므로 Line 88에서 실패하면 Line 87에서 획득한 firstClientrelease()되지 않습니다. 커넥션 획득을 try 내부로 옮기고, finally에서 실제로 획득된 클라이언트만 조건부 release하세요.

🤖 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 `@packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts`
around lines 87 - 94, Move the pool.connect calls in the contention test setup
inside the existing try block, and track each client as it is acquired. In the
finally block, conditionally release only clients that were successfully
obtained, including firstClient when secondClient acquisition fails.
🤖 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/execution-drizzle/src/libs/DrizzleExecutionStore.ts`:
- Around line 25-43: 정의되지 않은 unknown 체크포인트 계약으로 인해 저장소별 값 처리 방식이 달라집니다.
DrizzleExecutionStore의 serializeCheckpoint에 공통 JSON-safe 타입과 validator를 도입해 거부 및
정규화 정책을 명시하고,
packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts:25-43에서 이를 사용하세요.
packages/execution-core/src/tests/ExecutionContinuation.spec.ts:55-64의 메모리 저장소에도
동일한 검증을 적용하고,
packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts:109-122의
MockExecutionStore가 실제 어댑터와 동일한 값 경계를 재현하도록 수정하세요.

---

Outside diff comments:
In `@packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts`:
- Around line 87-94: Move the pool.connect calls in the contention test setup
inside the existing try block, and track each client as it is acquired. In the
finally block, conditionally release only clients that were successfully
obtained, including firstClient when secondClient acquisition fails.
🪄 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 Plus

Run ID: e9938919-e2da-4df1-a714-898649c7ebef

📥 Commits

Reviewing files that changed from the base of the PR and between 13b6ff4 and a7f4205.

📒 Files selected for processing (8)
  • .changeset/atomic-execution-checkpoints.md
  • packages/execution-core/src/tests/ExecutionContinuation.spec.ts
  • packages/execution-core/src/tests/ExecutionManagerImpl.spec.ts
  • packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.postgres.spec.ts
  • packages/execution-drizzle/src/tests/DrizzleExecutionStore.spec.ts
  • scripts/create-croco-app-generated-smoke.mts
  • scripts/tests/create-croco-app-generated-smoke.spec.ts

Comment thread packages/execution-drizzle/src/libs/DrizzleExecutionStore.ts Outdated
@kang-heewon
kang-heewon force-pushed the fix/1596-atomic-checkpoints branch from a7f4205 to a2814c8 Compare July 29, 2026 18:07
@kang-heewon
kang-heewon force-pushed the fix/1596-atomic-checkpoints branch 2 times, most recently from b5356a3 to e62017f Compare July 30, 2026 04:20
@kang-heewon
kang-heewon force-pushed the fix/1596-atomic-checkpoints branch from dc51a4f to b7aeaea Compare July 30, 2026 05:23
@kang-heewon
kang-heewon merged commit 269d9df into trunk Jul 30, 2026
12 checks passed
@kang-heewon
kang-heewon deleted the fix/1596-atomic-checkpoints branch July 30, 2026 06:06
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.

[execution-core] Concurrent checkpoint updates overwrite unrelated keys

1 participant