Skip to content

feat: run deterministic application failure scenarios - #1793

Merged
kang-heewon merged 2 commits into
trunkfrom
feat/1486-deterministic-scenario-runtime
Aug 9, 2026
Merged

feat: run deterministic application failure scenarios#1793
kang-heewon merged 2 commits into
trunkfrom
feat/1486-deterministic-scenario-runtime

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Aug 9, 2026

Copy link
Copy Markdown
Member

Outcome

Applications can now compose ordered, named failure timelines with a runner-neutral ScenarioRuntime across transaction, event, task, trigger, provider, retry, and telemetry boundaries. The runtime provides virtual time, deterministic replay metadata, stable versioned reports, strict Problem and evidence multiplicity assertions, and explicit injection for duplicate delivery, response loss, timeout, retryable or terminal failure, process interruption, and exporter failure.

Generated SaaS applications extend the existing operational failure catalog with a real billing-gateway scenario that commits checkout creation, loses the response, retries with the same idempotency key, and proves exactly one checkout was created.

Fixes #1486

Reviewer context

  • Existing generic and operational failure-drill exports and behavior remain intact; ScenarioRuntime is additive.
  • Replay input is validated as plain JSON-compatible data and preserves public Problem category, status, title, instance, and extensions while redacting secret-bearing values.
  • Failure injection stays in the testing package and generated smoke scenario; production code has no test-environment branch.
  • Public API snapshots, generated API docs, Problem registry/recovery guidance, and changesets for @croco/testing, create-croco-app, and the generated @croco/problems-core registry are synchronized.

Verification

  • pnpm --dir packages/testing test — 9 files and 175 tests passed
  • generated template tests — 20 passed
  • CROCO_GENERATED_SMOKE_CASES=goal-saas-api pnpm create-croco-app:smoke — generated app lint, contracts, doctor, typecheck, build, tests, demo flow, and failure drill passed
  • pnpm strict-contract-typecheck — no added diagnostics; 503 accepted baseline diagnostics matched
  • pnpm public-api:check — 115 package snapshots matched
  • pnpm problem-registry:check — 591/591 codes matched
  • pnpm docs:api-triggers:check — passed
  • pnpm changeset-required:check — all affected publishable packages covered
  • pnpm check — 24/25 repository gates passed; 1 not applicable
  • Pre-push workspace test — 234/234 tasks passed
  • Pre-push workspace typecheck — 233/233 tasks passed
  • git diff --check — passed

The full API-doc drift command regenerated and built all documentation successfully, then reported only pre-existing unrelated drift for RuntimeInspector and HTTP diagnostics pages on trunk; no testing API page drift remained.

Review gates

  • Correctness and regression — PASS. Tests prove commit-success/response-loss/retry idempotency, duplicate webhook delivery, ordered failures, virtual time, all requested failure kinds, exact evidence multiplicity, malformed replay rejection, secret redaction, and byte-stable replay reports.
  • API, security, compatibility, and release — PASS. The API is additive, existing drill contracts remain unchanged, replay rejects unsafe shapes, Problem details are preserved and redacted, and all required public/release artifacts are synchronized.
  • Maintainability and minimality — PASS. The implementation reuses TestRuntime and existing evidence redaction, keeps failure behavior at explicit boundary wrappers, and adds one application-backed template scenario without replacing the operational catalog.
  • Independent adversarial review — PASS after fixes. Review findings around unexpected Problem handling, replay fidelity, unsafe evidence, app-backed idempotency proof, and generated docs were resolved; final review found no P0/P1/P2 issue.

Residual risk

Scenario replay reproduces the deterministic failure schedule and controls, not arbitrary external system state or process checkpoints; those remain explicit non-goals of this API.

Summary by CodeRabbit

  • 새로운 기능

    • 가상 시간과 다양한 실패 주입을 지원하는 시나리오 실행·재현 기능을 추가했습니다.
    • 실패 타임라인, 문제·증거·복구 결과를 포함한 버전 관리 보고서를 생성할 수 있습니다.
    • 결제 체크아웃 응답 손실 및 재시도 시나리오에서 중복 생성을 검증합니다.
    • 결제 및 테스트 관련 문제 코드 3개를 추가했습니다.
  • 문서

    • 시나리오 런타임, 실패 도우미, 보고서 형식 및 관련 API 문서를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Aug 9, 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: 32 minutes

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

How can I continue?

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

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

How do review limits work?

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

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

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d57508d0-3740-4b7c-96b2-a0e285a97caf

📥 Commits

Reviewing files that changed from the base of the PR and between 2ccacb5 and 17aebf6.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (9)
  • docs/problem-code-registry.json
  • packages/docs/src/content/docs/api/problems-core/src/classes/Problem.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/testing/README.md
  • packages/testing/src/index.ts
  • packages/testing/src/libs/ScenarioRuntime.ts
  • packages/testing/src/tests/ScenarioRuntime.spec.ts
  • public-api-surface.snapshot.json
📝 Walkthrough

Walkthrough

ScenarioRuntime을 추가해 경계별 실패 주입, 가상 시간, 기대값 검증, 결정적 replay 및 버전이 지정된 보고서를 지원합니다. SaaS 템플릿에는 checkout 응답 손실과 idempotent retry 시나리오를 추가했습니다. 문제 코드와 API 문서도 갱신했습니다.

Changes

시나리오 런타임

Layer / File(s) Summary
런타임 계약과 실행 구현
packages/testing/src/libs/ScenarioRuntime.ts, packages/testing/src/index.ts, public-api-surface.snapshot.json
실패 주입 도우미, ScenarioRuntime, replay 메타데이터, 보고서 스키마, 증거·문제·타임라인 타입을 추가했습니다. 실행, 검증, 정규화, 직렬화 및 공개 export를 구현했습니다.
실행 검증과 사용 계약
packages/testing/src/tests/ScenarioRuntime.spec.ts, packages/testing/README.md, packages/docs/src/content/docs/api/testing/..., .changeset/replayable-application-scenarios.md
응답 손실, 중복 전달, 실패 순서, replay 결정성, 입력 오류 및 민감 정보 마스킹을 검증했습니다. API와 보고서 형식을 문서화했습니다.
SaaS checkout 시나리오와 문제 카탈로그
packages/create-croco-app/templates/saas/..., packages/create-croco-app/src/tests/templates-build.spec.ts, docs/problem-code-registry.json, scripts/problem-registry.mts, packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
checkout 응답 손실, idempotent retry 및 생성 횟수 검증을 추가했습니다. 결제 및 테스트 문제 코드를 레지스트리와 복구 문서에 등록했습니다.
API 문서와 문서 형식 정리
packages/docs/src/content/docs/api/framework-context/..., packages/docs/src/content/docs/api/integrations-posthog/..., packages/docs/src/content/docs/api/problems-core/..., packages/docs/src/content/docs/api/transports-graphql/..., packages/docs/src/content/docs/api/transports-http/..., packages/docs/src/content/docs/api/protocols-core/..., packages/docs/src/content/docs/api/telemetry-sdk-node/...
ScenarioContractProblem API 문서를 추가했습니다. 기존 API 문서의 구분선, 속성 배치, 예제 공백 및 선언 순서를 갱신했습니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant SaaSScenario
  participant ScenarioRuntime
  participant DemoBillingGateway
  participant ScenarioReport
  SaaSScenario->>ScenarioRuntime: run checkout response-loss scenario
  ScenarioRuntime->>DemoBillingGateway: execute first checkout with lost response
  DemoBillingGateway-->>ScenarioRuntime: reuse checkout on retry
  SaaSScenario->>DemoBillingGateway: replay the same checkout request
  DemoBillingGateway-->>ScenarioReport: return the same checkout and creation count
  ScenarioRuntime->>ScenarioReport: record evidence and validate expectations
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning 기능 변경과 무관한 여러 API 문서의 서식 변경이 포함되어 있어 이슈 범위를 벗어난 변경으로 보입니다. framework-context, integrations-posthog, transports-*, protocols-core, telemetry-sdk-node 문서의 무관한 서식 변경을 제거하거나 별도 PR로 분리하십시오.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 ScenarioRuntime, 실패 주입, 가상 시간, 재생 보고서, SaaS 시나리오, 멱등성 및 중복 전달 테스트가 이슈 #1486의 요구사항을 충족합니다.
✨ 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 feat/1486-deterministic-scenario-runtime

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.

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

ℹ️ 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 packages/testing/src/libs/ScenarioRuntime.ts Outdated
Comment thread packages/testing/src/libs/ScenarioRuntime.ts Outdated
Comment thread packages/testing/src/libs/ScenarioRuntime.ts Outdated

@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
`@packages/docs/src/content/docs/api/testing/src/classes/ScenarioContractProblem.md`:
- Line 8: Update the source JSDoc for ScenarioContractProblem to describe it as
the concrete Problem subclass for the testing/scenario-contract-invalid problem
code and scenario contract validation failures, rather than the generic RFC 7807
base class. Regenerate TypeDoc so ScenarioContractProblem.md reflects the
corrected description.

In `@packages/testing/src/tests/ScenarioRuntime.spec.ts`:
- Line 63: Replace the invalid toHaveLength assertions with size-based
assertions for the Map/Set collections: update
packages/testing/src/tests/ScenarioRuntime.spec.ts lines 63-63 for committed and
lines 93-93 for handled to assert each collection’s size equals 1.
- Around line 154-167: Update the second replay test around runtime.execute so
it explicitly asserts that execute rejects, using the rejects-based assertion
while preserving the existing Problem type and shape checks on the captured
error. Ensure the test fails when replay.run completes without throwing.
🪄 Autofix

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: 5d08be5d-5ecf-4751-8e49-e2bb973ad620

📥 Commits

Reviewing files that changed from the base of the PR and between b8fdd47 and a6c0044.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (42)
  • .changeset/replayable-application-scenarios.md
  • docs/problem-code-registry.json
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/templates/saas/apps/api-server/src/demo/failure-drill-smoke.ts
  • packages/create-croco-app/templates/saas/apps/api-server/src/saasDemo.ts
  • packages/docs/src/content/docs/api/problems-core/src/classes/Problem.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/api/testing/src/classes/ScenarioContractProblem.md
  • packages/docs/src/content/docs/api/testing/src/classes/ScenarioRuntime.md
  • packages/docs/src/content/docs/api/testing/src/functions/createScenarioRuntime.md
  • packages/docs/src/content/docs/api/testing/src/functions/duplicateDelivery.md
  • packages/docs/src/content/docs/api/testing/src/functions/failExporter.md
  • packages/docs/src/content/docs/api/testing/src/functions/interruptProcess.md
  • packages/docs/src/content/docs/api/testing/src/functions/loseResponse.md
  • packages/docs/src/content/docs/api/testing/src/functions/replayScenarioRuntime.md
  • packages/docs/src/content/docs/api/testing/src/functions/retryableFailure.md
  • packages/docs/src/content/docs/api/testing/src/functions/serializeScenarioReport.md
  • packages/docs/src/content/docs/api/testing/src/functions/terminalFailure.md
  • packages/docs/src/content/docs/api/testing/src/functions/timeout.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioBoundary.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioDuplicateDelivery.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioEvidence.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioEvidenceKind.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioExpectation.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioFailure.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioFailureKind.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioProblemFailure.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioReplayDuplicateDelivery.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioReplayFailure.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioReplayMetadata.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioReplayProblemDetails.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioReplayProblemFailure.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioReport.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioRuntimeOptions.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioTimelineEntry.md
  • packages/docs/src/content/docs/api/testing/src/variables/SCENARIO_REPORT_SCHEMA_VERSION.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/testing/README.md
  • packages/testing/src/index.ts
  • packages/testing/src/libs/ScenarioRuntime.ts
  • packages/testing/src/tests/ScenarioRuntime.spec.ts
  • public-api-surface.snapshot.json

Comment thread packages/docs/src/content/docs/api/testing/src/classes/ScenarioContractProblem.md Outdated
Comment thread packages/testing/src/tests/ScenarioRuntime.spec.ts Outdated
Comment thread packages/testing/src/tests/ScenarioRuntime.spec.ts
@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from a6c0044 to 2ac6a70 Compare August 9, 2026 09:06
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 44.3μs 30.0ms 8.2μs +441.4% -
CrocoApp lambdaHandler (10 controllers) 2.1ms 50.0ms 258.4μs +716.1% -
Lambda cold-start simulation 1.9ms 80.0ms 418.1μs +343.0% -
Lambda cold-start with headers 1.6ms 80.0ms 369.7μs +331.4% -
Lambda cold-start with binary body 1.6ms 80.0ms 339.1μs +361.8% -
Lambda cold-start with query params 1.5ms 80.0ms 301.3μs +400.6% -
Lambda cold-start with authorizer context 1.5ms 80.0ms 299.8μs +405.1% -
Lambda cold-start realistic scenario 1.5ms 80.0ms 299.2μs +404.1% -
EventBusConfig.start (10 handlers) 1.7μs 10.0ms 1.4μs +20.9% -
EventPublisher.publishNow single event 1.9μs 2.0ms 1.7μs +14.3% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs +0.0% -
Container.get singleton (cold) 89.8μs 5.0ms 70.3μs +27.9% -
Container.register × 50 components 3.4ms 10.0ms 3.2ms +4.5% -
Container.validate (50 components) 3.8ms 20.0ms 3.4ms +13.1% -
Container.get singleton (warm) 1.7μs 500.0μs 1.6μs +2.5% -
TelemetryRuntime.init (lambda preset) 12.8μs 200.0ms 1.1ms -98.8% -
lambdaPreset config creation 1.5μs 2.0ms 1.4μs +5.7% -

Updated: 2026-08-09T13:38:23.619Z · Commit: c5af5aa

@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from 2ac6a70 to 7d21177 Compare August 9, 2026 09:28
@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from 7d21177 to 9d60ea6 Compare August 9, 2026 10:56

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

🤖 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/problem-code-registry.json`:
- Around line 2075-2104: Update the recovery metadata for
billing/checkout-idempotency-drift so it explicitly describes an
already-detected idempotency violation after retries, uses a non-retryable
retryability value, and replaces the generic retry-oriented userAction with
guidance appropriate for investigation and reconciliation. Keep the problem
code, category, status, telemetry, lifecycle, and source metadata unchanged.

In `@packages/testing/src/libs/ScenarioRuntime.ts`:
- Around line 8-61: Unify the boundary and failure-kind definitions by declaring
SCENARIO_BOUNDARIES and SCENARIO_FAILURE_KINDS with as const, then derive
ScenarioBoundary and ScenarioFailureKind from each array’s element type using
indexed access. Remove the duplicated string-literal unions while preserving the
existing values and readonly behavior.
- Around line 334-363: Prevent repeated invocation of ScenarioRuntime.run by
tracking whether the instance has already started or completed a run and
throwing ScenarioContractProblem on any subsequent call. Ensure the guard
executes before the existing scenario execution and report-validation flow so
evidence, problems, and timeline cannot accumulate across runs.
- Around line 540-552: Update assertReplayMetadata to accept unknown and give it
an assertion signature that narrows the value to ScenarioReplayMetadata after
validation. Also change replayScenarioRuntime’s input to unknown and rely on the
post-assertion narrowed replay value, preserving the existing runtime checks and
parsed JSON flow.
- Around line 365-380: Update executeOperation so failures from
recordProblem(error), including normalizeProblemDetails failures, are caught and
linked to the original Problem as its cause while preserving the original
Problem as the error ultimately thrown. Ensure reporting failure does not
prevent the original boundary Problem from being propagated.
- Around line 645-693: Update assertPlainJsonShape and normalizeJsonValue so
undefined is allowed only as an object property value: skip validation for such
properties and omit their keys from normalized objects. Continue rejecting
undefined nested within retained values, including array elements and standalone
inputs, while preserving conditional empty objects such as Problem.toJSON()
results.

In `@packages/testing/src/tests/ScenarioRuntime.spec.ts`:
- Around line 4-17: Separate ScenarioReplayMetadata from the value import in
ScenarioRuntime.spec.ts and import it through a dedicated import type
declaration. Keep all runtime symbols in the existing import from ../index
unchanged.
- Around line 303-305: Replace the TypeError thrown by the timedStep validation
in ScenarioRuntime.spec.ts with ScenarioContractProblem, preserving the existing
invalid-fixture condition and message while supplying the appropriate stable
diagnostic code required by the Problem contract.
🪄 Autofix

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: 54c7af1b-8f5a-4ba9-91cb-691a8e35509a

📥 Commits

Reviewing files that changed from the base of the PR and between a6c0044 and 9d60ea6.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (14)
  • docs/problem-code-registry.json
  • packages/docs/src/content/docs/api/framework-context/src/classes/RuntimeInspectorConfigurationProblem.md
  • packages/docs/src/content/docs/api/framework-context/src/type-aliases/RuntimeInspectorOptions.md
  • packages/docs/src/content/docs/api/integrations-posthog/src/variables/POSTHOG_CONFIG_TOKEN.md
  • packages/docs/src/content/docs/api/problems-core/src/classes/Problem.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/api/testing/src/classes/ScenarioContractProblem.md
  • packages/docs/src/content/docs/api/transports-graphql/src/classes/GraphQLRequestHandlingFailedProblem.md
  • packages/docs/src/content/docs/api/transports-http/src/classes/DiagnosticsConfigurationProblem.md
  • packages/docs/src/content/docs/api/transports-http/src/type-aliases/DiagnosticsConfigurationProblemOptions.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/testing/src/libs/ScenarioRuntime.ts
  • packages/testing/src/tests/ScenarioRuntime.spec.ts
  • public-api-surface.snapshot.json

Comment thread docs/problem-code-registry.json
Comment thread packages/testing/src/libs/ScenarioRuntime.ts Outdated
Comment thread packages/testing/src/libs/ScenarioRuntime.ts
Comment thread packages/testing/src/libs/ScenarioRuntime.ts
Comment thread packages/testing/src/libs/ScenarioRuntime.ts Outdated
Comment thread packages/testing/src/libs/ScenarioRuntime.ts
Comment thread packages/testing/src/tests/ScenarioRuntime.spec.ts
Comment thread packages/testing/src/tests/ScenarioRuntime.spec.ts
@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from 9d60ea6 to bc2caa6 Compare August 9, 2026 11:24
@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from bc2caa6 to 2ccacb5 Compare August 9, 2026 11:57

@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

🤖 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/testing/src/libs/ScenarioRuntime.ts`:
- Around line 725-734: Update durationToMilliseconds to validate numeric
durations before returning them: require a finite, non-negative integer, and
throw ScenarioContractProblem for invalid values such as negative, fractional,
or NaN inputs. Apply the same constraint to parsed string durations so the
values passed to toReplayFailure and advanceBy always satisfy replay metadata
requirements.
🪄 Autofix

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: 4fe345a3-70fa-4b5c-aa43-0e2a3c73129e

📥 Commits

Reviewing files that changed from the base of the PR and between 9d60ea6 and 2ccacb5.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (15)
  • docs/problem-code-registry.json
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/docs/src/content/docs/api/problems-core/src/classes/Problem.md
  • packages/docs/src/content/docs/api/problems-core/src/variables/CROCO_PROBLEM_CODE_REGISTRY.md
  • packages/docs/src/content/docs/api/protocols-core/src/variables/PROJECT_MANIFEST_BUNDLE_ARTIFACTS.md
  • packages/docs/src/content/docs/api/telemetry-sdk-node/src/classes/TelemetryInitializationConflictProblem.md
  • packages/docs/src/content/docs/api/testing/src/classes/ScenarioRuntime.md
  • packages/docs/src/content/docs/api/testing/src/functions/replayScenarioRuntime.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioBoundary.md
  • packages/docs/src/content/docs/api/testing/src/type-aliases/ScenarioFailureKind.md
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/testing/src/libs/ScenarioRuntime.ts
  • packages/testing/src/tests/ScenarioRuntime.spec.ts
  • public-api-surface.snapshot.json
  • scripts/problem-registry.mts
💤 Files with no reviewable changes (1)
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md

Comment thread packages/testing/src/libs/ScenarioRuntime.ts
@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from 2ccacb5 to a2ddeb7 Compare August 9, 2026 12:20
@kang-heewon

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@kang-heewon
kang-heewon force-pushed the feat/1486-deterministic-scenario-runtime branch from a2ddeb7 to 17aebf6 Compare August 9, 2026 13:28
@kang-heewon
kang-heewon merged commit f24f196 into trunk Aug 9, 2026
12 checks passed
@kang-heewon
kang-heewon deleted the feat/1486-deterministic-scenario-runtime branch August 9, 2026 17:37
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.

[testing] Generalize failure drills into deterministic application scenarios

1 participant