Dataset Viewer
Auto-converted to Parquet Duplicate
source_code
stringclasses
3 values
state_transitions
listlengths
3
5
idempotency_analysis
stringclasses
3 values
control_flow_analysis
dict
component_dependencies
listlengths
3
3
delivery_behavior_impact
stringclasses
3 values
retry_and_fallback_analysis
dict
type Channel = 'email' | 'sms'; type JobStatus = 'queued' | 'retry_wait' | 'sending' | 'delivered' | 'failed'; type SendResult = { ok: true } | { ok: false; retryable: boolean }; interface DeliveryJob { id: string; channel: Channel; attempts: number; recipient: string; payload: string; } interface JobReposit...
[ { "from_state": "queued or retry_wait", "to_state": "sending", "condition": "The job is due and claimDue successfully claims it." }, { "from_state": "sending", "to_state": "retry_wait", "condition": "The provider returns a retryable failure and attempts is less than two; the repository s...
The repository's documented claimDue operation atomically claims a due job and moves it to sending, which can prevent two workers from processing the same eligible job concurrently if the repository honors that contract. The job ID serves as the claim identifier, but no provider-side idempotency key is passed. If a pro...
{ "main_flow": "QueueWorker first asks the repository to claim the due job; if the claim fails, it does nothing. It sends through the job's current channel. Success completes the job as delivered. A retryable failure within the retry budget is persisted for a later attempt. Once that budget is exhausted, or after a n...
[ { "component_name": "QueueWorker", "responsibility": "Claims due jobs, invokes the selected provider, and chooses retry, fallback, or completion behavior.", "dependencies": [ "JobRepository", "Provider", "Date.now" ] }, { "component_name": "JobRepository", "responsibili...
Persisted exponential backoff limits rapid repeat attempts and can absorb transient provider failures, while the email-to-SMS switch provides an alternate channel after email's retry budget is exhausted. The fallback resets the attempt count, giving SMS its own retry budget and potentially increasing eventual delivery ...
{ "retry_trigger": "Only a returned failure marked retryable triggers a same-channel retry, and only while the job's attempts value is less than two. Non-retryable results proceed directly to fallback or terminal failure. Thrown exceptions are not caught.", "retry_policy": "The worker allows up to two scheduled ret...
type DeliveryStatus = 'sending' | 'sent' | 'failed'; type SendResult = { ok: true } | { ok: false; retryable: boolean; error: string }; interface Provider { send(recipient: string, body: string): Promise<SendResult>; } interface NotificationStore { getStatus(key: string): Promise<DeliveryStatus | undefined>; set...
[ { "from_state": "absent or failed", "to_state": "sending", "condition": "The stored status is neither sent nor sending, and delivery begins." }, { "from_state": "sending", "to_state": "sent", "condition": "The primary provider succeeds, or the backup provider succeeds." }, { "fro...
The store status check suppresses a repeated call when the key is already sent or sending. However, the read and subsequent setStatus are separate operations, so concurrent callers can both pass the check; atomic claiming or a unique-key constraint is not shown. A crash after marking sending can leave the key in that s...
{ "main_flow": "DeliveryService first reads the stored status and returns immediately for a notification already marked sent or sending. Otherwise it marks the notification sending, tries the primary provider up to three times, and records sent on success. A non-retryable failure or exhausted retry budget leads to on...
[ { "component_name": "DeliveryService", "responsibility": "Coordinates status checks, primary-channel retries, backup-channel delivery, and final status updates.", "dependencies": [ "Provider", "NotificationStore", "delay" ] }, { "component_name": "Provider", "responsibi...
The three-attempt primary loop can improve delivery when failures are transient, at the cost of added latency from its two backoff delays. A permanent primary failure avoids unnecessary primary retries but still incurs one backup attempt. Because the status check and write are not atomic and no provider idempotency key...
{ "retry_trigger": "Only a primary-provider result with ok false and retryable true triggers another primary attempt. A non-retryable result skips remaining primary attempts and proceeds to the backup. Thrown exceptions are not caught in this code.", "retry_policy": "The primary is called at most three times. Delay...
type SendResult = { ok: true } | { ok: false; retryable: boolean }; type ClaimResult = 'acquired' | 'delivered' | 'busy'; type StoredStatus = 'delivered' | 'failed'; interface Provider { send(recipient: string, body: string): Promise<SendResult>; } interface IdempotencyStore { // claim atomically reserves a key un...
[ { "from_state": "unclaimed", "to_state": "in_flight", "condition": "The store returns acquired from the atomic claim operation." }, { "from_state": "in_flight", "to_state": "delivered", "condition": "Any provider on the ordered route succeeds and the sender records delivered." }, { ...
The sender relies on IdempotencyStore.claim to atomically distinguish acquired, delivered, and busy keys before any provider call. This prevents concurrent sends only if the store fulfills the documented atomic-claim contract. The key is not passed to providers, so provider-side deduplication is not shown. Exceptions a...
{ "main_flow": "RoutedSender first atomically claims the notice key. It returns without sending if the key is already delivered or in flight. For an acquired key, it walks the requested route in order, skips channels without a configured provider, and makes up to two attempts per available provider. A successful send...
[ { "component_name": "RoutedSender", "responsibility": "Claims the idempotency key and coordinates ordered channel attempts and status updates.", "dependencies": [ "Provider", "IdempotencyStore", "sleep" ] }, { "component_name": "Provider", "responsibility": "Sends a not...
Ordered routing makes channel preference explicit and allows later channels to recover from an unavailable or failing earlier channel. Limiting each channel to two attempts bounds per-channel delay, while the 250 ms retry can help with transient failures. A longer route can increase total latency. Atomic claiming reduc...
{ "retry_trigger": "A provider result with ok false and retryable true triggers a retry on the same channel. Non-retryable failures advance immediately to the next route entry. Thrown exceptions are not caught.", "retry_policy": "Each configured provider receives at most two attempts. The only retry delay is 250 ms...

Notification Retry and Fallback Code Reasoning Dataset

Designed for enterprise notification and broadcast communication platforms, this dataset contains source code examples involving notification delivery, failure retries, fallback channels, idempotency, and state transitions. Structured analyses guide models to infer control flow, component dependencies, and delivery states, and to assess how key logic or code changes affect delivery behavior. It is suitable for supervised fine-tuning and evaluation of code reasoning and dependency understanding for notification systems.

Technical Specifications

Field Type Description
source_code string A source code example related to notification delivery, retries, fallback channels, idempotency, or state transitions.
state_transitions array Lists state changes in the notification delivery process that can be inferred from the code and the conditions that trigger them.
idempotency_analysis string Explains how the code prevents duplicate delivery caused by retries or repeated requests, including relevant idempotency keys or state checks; explicitly notes when these mechanisms are not present.
control_flow_analysis object Infers the main control flow and branch conditions in the notification delivery process from the source code.
component_dependencies array Identifies the components involved in notification delivery and the dependencies among them.
delivery_behavior_impact string Analyzes how code changes or key logic affect success rates, duplicate delivery, latency, channel selection, and final delivery outcomes, citing the basis for each inference.
retry_and_fallback_analysis object Analyzes retry strategies and fallback channel behavior after notification delivery failures.

Compliance Statement

Authorization TypeCC-BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike)
Commercial UseRequires exclusive subscription or authorization contract (monthly or per-invocation charging)
Privacy and AnonymizationNo PII, no real company names, simulated scenarios follow industry standards
Compliance SystemCompliant with China's Data Security Law / EU GDPR / supports enterprise data access logs

Source & Contact

contact@mobiusi.com

Downloads last month
5