Skip to content

Implement SQS receivers, durable settlement and named health - #465

Merged
thomhurst merged 8 commits into
mainfrom
issue-224-sqs-receiver
Nov 10, 2026
Merged

thomhurst merged 8 commits into
mainfrom
issue-224-sqs-receiver

Conversation

@thomhurst

@thomhurst thomhurst commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

SQS consumer declarations now run through native long polling and Relayer's existing durable receive/failure pipelines. Standard/FIFO workers change native visibility for retries and delete only after durable handling or a successful poison-message copy. Optional named health providers report read-only connectivity and the oldest active worker.

Closes #224

Behavior and reuse

  • Reuses AWSSDK.SQS 4.0.100.25 ReceiveMessageRequest, ChangeMessageVisibilityRequest, native deletion, request retries and queue-attribute reads. The pinned source's AssemblyFileVersion is 4.0.100.25. Invisible FIFO groups own ordering; one-message polls add no group dispatcher.
  • Reuses ReceivePipeline, generated dispatch, FailurePipeline copy-before-complete, existing IFailureScheduler for delays beyond native support, and existing messaging tracing/metrics. The optional health companion reuses the exact-name contracts from Relayer.HealthChecks.
  • Pools receive bodies, delivery state and native settlement requests. Native features expose the unchanged message/client. Monotonic time guards the original receive's remaining twelve-hour budget; repeated visibility changes never restart it. Native redrive thresholds must leave a final attempt for failure metadata.
  • D67 explicitly records SQS's immutable-attribute boundary: native receive counts terminate visibility retries; the final copy preserves previously stored history plus the current delivery's in-process failures. Exceptions from earlier visibility deliveries cannot be recovered from SQS. No process-local retry-history cache or replacement broker runtime is introduced, and no performance budget is relaxed.
  • Direct failure copies preserve binary/Number attributes using the existing native callback mechanism. The existing outbox rejects those non-persistable callbacks without deleting the original. Text-only copies use the existing durable scheduler contract unchanged. Applications must size native visibility for durable work; there is no automatic visibility-renewal runtime.

The website covers configuration, health, lifecycle, retry/history limits, telemetry and conformance. Roadmap and home status are updated. Small related cleanup corrects stale Service Bus/RabbitMQ status text and typed reply-handler execution guidance.

Validation

  • Full solution Release build passes after rebasing onto 6178faf: zero warnings/errors.
  • All 52 SQS/SNS tests pass before the documentation-conflict rebase (range-diff preserves runtime changes), including standard/FIFO production-host LocalStack tests, failed-copy no-delete, outbox commit-before-delete, redrive validation, oldest-worker tracking, cancellation and aborted drain.
  • All 11 transport conformance scenarios execute against LocalStack: 10 pass; native metadata-preserving dead-lettering is an explicit capability skip. The production core-copy fallback is tested separately for both queue kinds. The outage fixture pauses/resumes only its owned container and preserves queue state.
  • npm ci and npm run build pass with Node 26.13.0; final rebased site build covers 60 documents. git diff --check passes, and range-diff confirms the rebase preserved runtime changes and main's new D66.
  • SqsReceiveBindingBenchmarks adds MemoryDiagnoser coverage for the new per-message body encode, counter/header reads and pooled binding. Its retained ShortRun reports 0 B for both raw UTF-8 preparation and the adapter binding. This isolates binding cost, not the full default-JSON receive pipeline or the 5% end-to-end throughput budget; those remain unmeasured. No full repository test run or new Native AOT publish is claimed.

Per-message adapter work is UTF-8 encoding into retained pooled storage, constant-time native count/header reads, one pipeline await and one native settlement await; optional health adds activation/clear writes. The measured binding allocates 0 B in steady state. The performance label is attached.

Implementation-first coverage was followed by focused regression and real-broker checks; this new receiver had no existing runnable failing receiver test to extend. The first broad run caught the obsolete send-only rejection assertion, which now verifies the new actionable declaration validation. The first outage run identified the SDK's TimeoutException shape; it is handled as a transient native connectivity failure and the real outage case now passes.

Retained evidence

Evidence is archived outside the removable worktree at /Users/tom/git/Relayer-evidence/pr-465/cd1e487d97357c3573201a2f0786fe1ba3b9e87e/. All 521 files were SHA-256 checked against their originals; inventory.json records hashes and original paths. It includes sources, native source snapshots, raw logs/reports, current-head test binaries for reproduction and the actual retained benchmark binaries. The original diagnostic run auto-cleaned generated binaries; the retained ShortRun is new evidence, not a recovery claim. Test binaries were rebuilt after the rebase; the 52-case result is from immediately before that rebase, with unchanged adapter code. Local evidence lasts while the PR is open. No traces or dumps are retained.

Review fixes (8eea861)

  • Preserve native FIFO deduplication as a fallback for malformed or differently bound envelope identities. Normal text-only copies remain persistable; native fallback copies follow the existing callback/outbox restriction.
  • Retry exhausted poll failures with cancellable 1–30 second exponential backoff, resetting on success. Invalid native receive counts enter the existing poison pipeline.
  • Native attribute and payload limits remain explicit: reserve up to four failure attributes and space for history. Overflow retains the original without dropping attributes or changing the body; native RedrivePolicy is the broker safety net. No packed wire protocol or truncation is introduced.
  • Focused receive/failure checks pass (14 distinct cases across the initial run and the final seven-case failure run). Both standard/FIFO production-host LocalStack cases pass, including missing-envelope-identity FIFO poison copying. npm ci and the documentation build pass. Implementation-first regression coverage was used for these fixes.
  • Normal per-message change: non-throwing native count parsing and constant-time validation branches, 0 B; backoff changes only the failed-poll path and identity fallback changes only durable error copies. No new benchmark is required for these fixes.
  • New validation evidence, updated sources and current test binaries are retained at /Users/tom/git/Relayer-evidence/pr-465/8eea86134627175df5a293e73cad5ebb30aa84f7/; all 254 files were checked against original SHA-256 hashes in inventory.json. The earlier benchmark evidence remains at the original location above; no benchmark was rerun.

Each worker polls one message at a time (MaxNumberOfMessages = 1), so receive throughput scales through Concurrency. A full raw-client comparison must use the same poll size; the existing binding microbenchmark performs no polling and does not establish the end-to-end 5% budget.

Claude and Codex cleared the earlier 8eea861 head; fresh reviews are required for the subsequent receive-binding fix. Evidence was rechecked before promotion: all 521 earlier and 254 current archive files match inventory SHA-256 hashes; the five still-available original logs also match. Original removed-worktree files are unavailable for another direct comparison; their previously recorded archive verification is preserved above.

Receive binding review fix (e922256)

SQS consumer options now expose the existing HeaderNames binding (default ce_), which is passed unchanged to the existing ReceivePipeline and used for source identity checks in failure copies. This reuses the core CloudEvents decoding and native SQS attributes; no native polling or settlement feature is duplicated. Match it to custom sending-route bindings such as new HeaderNames("event_").

All four production-host LocalStack cases pass: default/custom prefixes on standard/FIFO queues, including handler invocation, native retry, poison-copy identity/attributes and deletion. npm ci and npm run build pass on Node 26.13.0; git diff --check passes. This focused regression was added with the fix rather than first running against the broken implementation. The change chooses the existing header binding at startup; normal per-message cost is unchanged, 0 B additional allocations. No benchmark rerun is required.

New evidence is retained outside the removable worktree at /Users/tom/git/Relayer-evidence/pr-465/e92225677bdaf0e934142a2276128cb2df1674ad/: 249 files (raw logs, test report, current binaries and changed sources), SHA-256 verified against originals in inventory.json. Prior evidence remains at its earlier locations. The PR is back in draft pending fresh current-head reviews.

Native typed FIFO identity review fix (f431667)

Failure copies now count source/destination identities as portable only when their native datatype is exactly String, matching the existing header-copy loop and SqsSendState.Prepare. Native Number and custom String.eventId identities retain the original MessageDeduplicationId through the existing native callback; their native datatypes and values remain unchanged. This reuses AWSSDK.SQS 4.0.100.25's native deduplication field and Relayer's existing failure-copy/send paths; no native feature is duplicated.

Four regression cases failed before the fix and pass after it. All 15 focused SqsFailureTests/SqsReceiveLocalStackTests cases pass, including standard/FIFO production-host tests with default/custom prefixes; FIFO tests verify typed identity, native deduplication, failure metadata and eventual source drain. npm ci, npm run build (60 documents), and git diff --check pass. Normal per-message cost is unchanged; the error-copy path adds two datatype equality checks, 0 B additional allocations. No benchmark is required.

New evidence is retained at /Users/tom/git/Relayer-evidence/pr-465/f4316674398f81b9b8e3965e0a6d3e367a70f1c4/: all 250 files (before/after logs, docs logs, pinned native source, changed sources, test report and current test binaries) were SHA-256 verified against originals in inventory.json. Earlier evidence remains at the recorded locations. The PR is restored to draft for fresh current-head reviews.

CI recovery (ab7882b)

Run 42823238884 completed with a timing-dependent PostgreSQL regression failure: Recovery_groups_commit_progress_within_a_short_tenant_turn expected one committed group but a one-second real deadline expired before commit (three rows remained). The test now advances the existing AdmissionClock pattern past the recovery admission budget without sleeping. An optional internal clock is forwarded through the existing tenant/maintenance/direct dispatch composition; production still uses the existing Stopwatch admission and native PostgreSQL transaction/commit operations. No native feature is duplicated, and no public contract or broker behavior changes (no docs impact for this CI fix).

All 41 focused TenantDispatchTests/MaintenanceTests/DirectDispatchTests pass against real PostgreSQL; final Release build passes with zero warnings/errors, and diff check passes. This follows the diagnosed hosted failing regression rather than reproducing the unreliable sleep locally. Per-message cost: direct dispatch unchanged; budgeted recovery adds a constant-time nullable clock check per destination group, 0 B. No benchmark is required for this branch-only testability change.

New evidence at /Users/tom/git/Relayer-evidence/pr-465/ab7882b120e568d7f6a810c6b8ac27d5835ce4fe/ contains 261 files (logs, report, current binaries and changed sources), SHA-256 verified against originals in inventory.json. Earlier archives remain as documented.

Advisory Performance run 42823238841 reports ConcurrentRoundTrip at 744 B/message versus 740/739 baseline totals, with overlapping timing confidence intervals. The in-memory fixture does not register SQS; only a core XML comment changes, but containing assemblies differ, so unchanged source does not establish attribution. #488 tracks the exact unresolved signal with 784 original artifact files independently retained and hash-verified under issue-488. No rerun, passing-performance claim, relaxed threshold or performance trade-off is made. The PR is restored to draft and requires fresh current-head reviews.

Rebase onto 3314767 (1d15ec8)

Main PR #485 (5cfb1c9) independently implements the deterministic PostgreSQL recovery-admission clock with a wider real SQL deadline. The conflicting ab7882b commit is therefore dropped in full rather than adding a second clock path. All four SQS commits are unchanged according to range-diff; the final diff has no PostgreSQL changes. git diff --check passes. No tests, benchmarks or site build were rerun because this rebase preserves all SQS/runtime/documentation changes and uses main's existing PostgreSQL implementation. Earlier evidence remains evidence of the recorded heads, not new-head validation. Fresh reviews are requested on 1d15ec8; the PR remains draft until cleared. No new native feature or API is added; per-message behavior and cost are unchanged by this rebase.

Standard fair-queue review fix (5b2dc48)

Standard-queue failure copies now preserve native MessageGroupId through the existing SendMessageRequest callback without requesting portable ordering. FIFO copies retain their portable group key. This reuses AWSSDK.SQS 4.0.100.25's native fairness field (verified in pinned SendMessageRequest source), existing native callback/send preparation and copy-before-delete pipeline; no native feature is duplicated. Fair-group callbacks retain the existing explicit outbox restriction, now documented. Production and conformance queue names now use TestContext isolation, with FIFO suffixes preserved.

The new fair-queue regression fails before the fix and passes after it. All 17 focused SqsFailureTests/SqsReceiveLocalStackTests/SqsConformanceTests cases pass, including default/custom prefixes and standard/FIFO native group preservation before source deletion. The conformance case exercises all 11 scenarios, with its existing explicit native dead-letter capability skip. npm ci, the 60-document site build (Node 26.13.0), and diff check pass. Normal per-message cost is unchanged; only the error-copy path adds a queue suffix check, captured group reference and native group assignment, using the existing allocating callback representation. No benchmark is required for this error-path fix.

New evidence is retained at /Users/tom/git/Relayer-evidence/pr-465/5b2dc48e2a7d91d325e3aa717d4e49185b700acd/: all 251 files (before/after logs, docs logs, pinned native source, changed sources, report and current test binaries) were SHA-256 verified against originals in inventory.json. Earlier evidence remains evidence of its recorded heads. The PR remains draft pending fresh current-head reviews.

Deadline progress CI fix (c705448)

CI run 42830668088 failed Ordered_lanes_progress_after_lane_or_tenant_deadline(True): the second three-second tenant turn did not finish both remaining lanes. The test incorrectly required an exact pass count despite schema validation, recovery and SQL work sharing the turn. It now drives passes until both healthy lanes progress after the blocked lane is entered, bounded by a sixty-second cancellation guard. Delivery order, one retained blocked row and connection release remain asserted. This is continued dispatcher operation, not a CI rerun or repeated test invocation.

Both focused deadline variants pass against PostgreSQL in Release (2/2); git diff --check passes. No production code changes, no docs impact, per-message cost unchanged (0 B). Existing native PostgreSQL cancellation and tenant/lane cursor behavior are reused; no native capability is duplicated. No benchmark or unchanged site build was rerun.

All 253 new evidence files (failed hosted log, passing local log/report, source and loaded test binaries) were SHA-256 verified against originals and retained at /Users/tom/git/Relayer-evidence/pr-465/c7054483b1a93def777c4a97863437ee2e82830d/, with inventory.json. Earlier results remain evidence for their recorded heads. Auto-merge was disabled and draft restored before pushing; fresh current-head reviews are required.

Whitespace FIFO identity review fix (c83222c)

FIFO poison copies preserve whitespace destination identity attributes unchanged through the existing native attribute callback, preventing portable header preparation from overriding the native MessageDeduplicationId fallback. This builds on AWSSDK.SQS 4.0.100.25 native deduplication/attribute fields (pinned source inspected), SqsSendState.Prepare and the existing copy-before-delete pipeline; no native feature is duplicated. Standard copies retain their existing portable-header behavior.

All three new unit regressions failed before the fix. All 19 focused SqsFailureTests/SqsReceiveLocalStackTests cases pass afterward, including default/custom prefix standard/FIFO production-host LocalStack cases, whitespace/native typed identity preservation, failure metadata and eventual source drain. npm ci, the final 60-document site build on Node 26.13.0, and git diff --check pass. Normal per-message cost is unchanged; the error-copy path adds constant-time attribute checks and a whitespace scan only for the destination identity. No benchmark is required for this error-path fix.

All 252 new evidence files (before/after logs, documentation logs, pinned native source, changed sources, report and current test binaries) were SHA-256 verified against originals and retained at /Users/tom/git/Relayer-evidence/pr-465/c83222c5155ea6f4fe513eb30354ab212c75a5ec/ with inventory.json. Earlier evidence remains head-specific. The PR remains draft for fresh current-head reviews.

Native deduplication token review fix (3c87664)

FIFO poison copies now preserve native deduplication for exact String identities that cannot serve as SQS tokens, including embedded spaces, non-ASCII characters and lengths above 128. Attributes remain unchanged through the existing native callback. The predicate follows AWSSDK.SQS 4.0.100.25 SendMessageRequest source (the pinned source was inspected and retained); existing Copy and SqsSendState paths supply the fallback. No native broker feature is duplicated.

Three new regressions fail before the fix. All 24 focused SqsFailureTests/SqsReceiveLocalStackTests cases pass after it, including real LocalStack standard/FIFO cases with default/custom prefixes and the new invalid identities; valid 1/128-character punctuation IDs remain persistable. npm ci, the 60-document site build on Node 26.13.0, and git diff --check pass. Normal per-message cost is unchanged; only error-copy identity validation scans at most 128 ASCII characters per check, 0 B additional allocations. No benchmark is required for this error-path fix.

All 250 new evidence files (before/after logs, documentation logs, pinned native source, changed sources, report and current test binaries) were SHA-256 verified against originals and retained at /Users/tom/git/Relayer-evidence/pr-465/3c8766457c13c9b82ad022c91282ae8dd7698b32/ with inventory.json. Earlier evidence remains head-specific. The PR remains draft for fresh current-head reviews.

@thomhurst thomhurst added the performance Run the advisory benchmark regression gate on this PR label Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d383bf3c-bda6-421d-8725-f9db3eb996de
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS receive transport)

The design follows AGENTS.md well. It uses native long-poll, ChangeMessageVisibility and DeleteMessage, with no parallel dispatcher. It reuses ReceivePipeline, FailurePipeline and IFailureScheduler. D67 is recorded, the website pages are updated, and there are tests plus a binding benchmark. I read the diff and pr-head/; I did not build or run the tests.

1. Blocking: a non-transient poll error silently and permanently kills a worker (SqsConsumer.cs:108-112)

  • What happens: any exception that IsTransient rejects is logged and rethrown from RunAsync, which ends that worker task. IsTransient accepts only 5xx, 429, throttling codes and I/O errors. Other 4xx responses, such as ExpiredToken or clock-skew 400s, a briefly AccessDenied role during IAM propagation, or a queue recreated during maintenance, all stop the worker for good.
  • Why it hurts: the host keeps running and the other workers keep going. With Concurrency = N the consumer degrades one worker at a time, down to zero, with only an Error log line. The health check reports it only if the optional Relayer.AmazonSqs.HealthChecks package is registered. Nothing restarts the worker, and StartAsync refuses to run again afterwards. AGENTS.md says never degrade behavior silently.
  • Suggested fix: treat every poll failure as retryable, with a bounded exponential backoff (for example 1s up to 30s) instead of the fixed 1s delay. Reserve stopping the consumer for a deliberate, observable action, such as stopping the host through IHostApplicationLifetime or faulting every worker together. A consumer that has lost only some of its workers is the worst state to be in. Retrying is better because Relayer cannot reliably tell recoverable 4xx responses from permanent ones, and a permanent error then shows up as repeated warnings instead of a half-dead consumer.

2. A malformed ApproximateReceiveCount hot-loops the message (SqsDelivery.cs:55-57)

  • int.Parse and ThrowIfLessThan run inside Prepare, before the pipeline. If either throws, the worker logs the error and does not delete. The message then returns at the next visibility expiry and fails the same way, so it is never dead-lettered.
  • SQS controls this attribute, so the probability is low, but the message loops forever instead of reaching the poison path. Use int.TryParse and fall back to a sentinel or to the poison path, the way _invalidRedeliveries already does for the redelivery attribute.

3. Minor

  • PR description: the body says validation details will be added later and lacks the required list of native and existing Relayer features the change builds on. Per AGENTS.md, fill this in before the ready transition.
  • SqsSendHostedService: the comment about SNS is the only evidence the class is still used. Confirm SNS still uses it, otherwise delete it as dead code.
  • GetHealthState throws when a worker is faulted. Returning an unhealthy state instead would make the health provider contract clearer. Optional.

Once item 1 is addressed and item 2 is handled (or answered with evidence), this looks ready.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T14:45:50.288727Z 3c87664 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

ℹ️ 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".

@thomhurst
thomhurst force-pushed the issue-224-sqs-receiver branch from cd1e487 to 4d06a45 Compare November 10, 2026 12:11
@github-actions

Copy link
Copy Markdown

Review of #465: SQS receivers, durable settlement, health

I read the consumer, delivery, settlement, hosted-service and failure-metadata code. I did not run the tests. The design follows AGENTS.md: native long polling, native visibility changes, a pooled delivery, and copy-before-delete through FailurePipeline. I found one correctness gap and one robustness concern.

1. Blocking: the dead-letter copy can exceed SQS's 10-attribute limit, so poison messages never reach the DLQ

SqsHostedService.Copy copies every source message attribute. The failure pipeline then adds relayer.failure.attempts, relayer.failure.redeliveries and relayer.failure.history, plus relayer.dead_letter.reason for manual dead-lettering (FailureMetadata.SettlementHeaders). SqsSendState throws InvalidOperationException once more than 10 attributes are present.

A source message that already carries 7 or more attributes will fail the DLQ copy. CloudEvents headers, traceparent/tracestate and the message-name header can add up to that. The exception is caught in SqsConsumer.RunAsync and logged as ProcessingFailed. The message is not deleted, becomes visible again, and fails the same way on every receive until retention expires or a native redrive fires. A native redrive can bypass the failure metadata, and it may not be configured at all. This breaks the guarantee that poison messages are dead-lettered instead of looping.

I found no test covering this case. Nothing in SqsFailureTests touches attribute counts.

Suggested fix, in order of preference:

  • Pack the failure metadata into a single attribute for the SQS copy. For example, fold attempts, redeliveries and reason into the history JSON, or into one relayer.failure attribute. That keeps the added attribute count constant.
  • Otherwise, validate the worst-case attribute count at startup, and fail early with an actionable message as AGENTS.md requires.
  • Add a test: a source message with 8 or more attributes that fails and then reaches the DLQ.

The history attribute carries stack traces, so it can also hit the 256 KB message-size limit. The same fix and test should cover it.

2. Non-blocking: a non-transient receive error permanently kills the worker

In RunAsync, any exception that IsTransient does not match is rethrown. Examples are a 400-class KMS throttle or a transient AccessDenied. The worker task faults and polling for that slot stops for good. With concurrency 1 the consumer is silently dead. It is only visible through the log, or through the health check when TrackHealth is on. StopAsync then rethrows through Task.WhenAll.

Consider treating non-fatal 4xx errors (KmsThrottled, KmsAccessDenied) as retryable with backoff. Fail fast only on configuration errors such as QueueDoesNotExist or auth failures that cannot recover. The fixed 1 s retry delay could also use exponential backoff with a cap. Without one, a persistent outage produces about one warning per second per worker.

Notes

  • The 12-hour visibility budget uses monotonic time, as the PR describes.
  • Per-message cost in the hot loop is one Volatile.Write when health tracking is on, and the pooled request objects are reused. This is acceptable without a benchmark.

Please fix #1 before merge.

@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed the original Claude review and latest Claude review in 8eea861:

  1. Poll failures now retry with cancellable exponential backoff (1–30 seconds, reset after success). A focused regression verifies a native authorization-shaped failure does not permanently lose the worker.
  2. Malformed native ApproximateReceiveCount now enters the existing invalid-metadata poison path. The production-host regression verifies a successful copy precedes deletion.
  3. Attribute/payload overflow: declined packing or dropping native attributes as a wire-format/contract change. The existing transport documentation already requires reserving up to four native attributes for failure metadata, and SqsSendState rejects overflow without discarding metadata. A new eight-attribute regression verifies the original is retained and no invalid send occurs. Documentation now explicitly covers error-history size, external producers and native RedrivePolicy as the broker safety net when a copy cannot fit. Even packing failure metadata into one attribute cannot preserve ten source attributes plus new metadata; neither startup validation nor arbitrary stack-trace truncation can guarantee capacity for external messages. The destination's configured native size is enforced by SqsSendTransport.ValidateSize (default 1 MiB, not 256 KiB). This keeps the native format and existing copy-before-delete guarantee rather than silently losing application data. Please review this evidence-based disposition on the new head.
  4. Earlier minor points: the PR body now lists native/existing feature reuse and retained validation. SNS still registers SqsSendHostedService in AmazonSnsBuilderExtensions.cs:33. The optional suggestion to change the health return contract is declined: the existing health wrapper reports the thrown failure as Unhealthy and preserves its exception; the worker-recovery fix addresses the actual degraded-consumer problem.

Focused receive/failure coverage and both production-host LocalStack cases pass; npm ci and the site build pass. Evidence and current binaries are archived under /Users/tom/git/Relayer-evidence/pr-465/8eea86134627175df5a293e73cad5ebb30aa84f7/ (254 files verified by SHA-256). The PR remains draft for fresh reviews.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS consumers)

I read the consumer, delivery, settlement and hosted-service code and the health companion, and checked them against AGENTS.md. I did not build the PR or run its tests, and I only skimmed the docs, decisions and test files. Every CI check on this draft showed SKIPPED when I looked, so none of it has been exercised in CI yet.

What holds up

  • It wraps the native client rather than rebuilding it. Receive uses the native long poll. Retries go through ChangeMessageVisibility, and the message is deleted only after durable handling or a successful copy to the dead-letter queue. A failure never deletes the message.
  • The twelve-hour visibility cap is measured from the original receive with a monotonic timestamp, and a delay past it throws instead of being silently clamped. Both are correct.
  • The per-message path stays pooled. SqsDelivery reuses its body buffer, delete request and visibility request. Settlement uses a pooling ValueTask builder, and the receive path has no LINQ or reflection.
  • Startup validation fails early with actionable messages: declared queues, a distinct dead-letter queue, standard/FIFO parity, and ReceiveMessageRequest constraints.
  • D67 records the SQS immutable-attribute limitation openly, and the docs state it.
  • Health is optional and lives in a separate package that depends only on the exact-name contracts.

Non-blocking notes

  1. Each worker polls with MaxNumberOfMessages=1, so throughput scales only with Concurrency. That is a sensible FIFO-safe default. Please state it in the PR text and the benchmark. A raw-client comparison that batches 10 messages per poll would not be like-for-like against the 5% budget.
  2. StopAsync resets _running even when the drain token expires. StartAsync then refuses to restart because workers are still incomplete, which is the intended 'recreate the host' behaviour. A one-line comment there would help the next reader.

No correctness or security defects found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8eea861346

ℹ️ 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".

@thomhurst

Copy link
Copy Markdown
Owner Author

Disposition of the current Claude review: both notes are non-blocking. The PR description now explicitly states one-message native polls and requires like-for-like raw-client poll size; the binding benchmark does no polling and makes no full-pipeline throughput claim. Declined the optional StopAsync comment and benchmark wording edit because no blocking fix requires a code push; the reviewed behavior and measured scope are already documented.

Both required reviewers cleared 8eea861. All review surfaces have been checked, with the sole inline thread resolved and no subsequent reviewer reply. Before promotion, all 775 archived files were checked against inventory SHA-256 hashes; all five remaining original logs match too. Original removed-worktree files are unavailable for a second direct comparison; the existing archived evidence and prior verification remain intact at the locations in the PR body.

@thomhurst
thomhurst marked this pull request as ready for review November 10, 2026 12:48
@thomhurst
thomhurst enabled auto-merge (squash) November 10, 2026 12:48

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

ℹ️ 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".

@thomhurst
thomhurst marked this pull request as draft November 10, 2026 12:55
auto-merge was automatically disabled November 10, 2026 12:55

Pull request was converted to draft

@thomhurst

Copy link
Copy Markdown
Owner Author

Fixed the custom CloudEvents binding finding in e922256. consumer.Options.HeaderNames now configures the existing ReceivePipeline and source identity used by failure copies. Its default stays ce_; custom prefixes are documented. All four production-host LocalStack cases pass (standard/FIFO × default/custom prefix), exercising actual handler dispatch, poison-copy identity/attributes and deletion. npm ci and the documentation build pass. The PR body records validation and the 249-file SHA-256-verified evidence archive.

The prior wait on CI run 42818882171 was checked before acting: it was still running, but this valid finding required a new head, so the PR was restored to draft and fixed immediately. The previous review approvals apply to 8eea861, not this new head. No linked implementation blocker or replacement exists; #224 remains fully delivered by this PR.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS consumers)

I read SqsConsumer, SqsDelivery, SqsSettlement and SqsHostedService against AGENTS.md. I did not run the tests or the benchmark, and I only skimmed the docs and test diffs.

Reuse of native features. Receive uses native long polling. Retries use native ChangeMessageVisibility, and deletion and request retries are native too. Dead-lettering reuses FailurePipeline and its copy-before-complete step. D67 records the immutable-attribute limitation, and the PR description lists what it builds on.

Correctness

  • A message is deleted only after durable handling or a successful poison copy. Pipeline, copy and settlement failures skip the delete, so native visibility redelivers the message.
  • Poll failures back off from 1 s to 30 s and are not treated as stop signals. The stop race is handled: a poll that already returned a message still drains it.
  • The visibility ceiling is measured with monotonic time from the original receive, and repeated visibility changes never restart it.
  • Malformed redelivery metadata is routed to the core classifier. It does not crash the worker.

Performance. Per message, the receive body buffer, delivery state and settlement requests are pooled, and the settlement path uses a pooling async method builder. I saw no reflection or LINQ on that path. The Any and Contains calls are in startup and validation code only. A benchmark was added.

Tests and docs. Unit, LocalStack, conformance and failure tests were added, and the website pages, roadmap and decision record are updated.

I found nothing actionable.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: e92225677b

ℹ️ 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".

@thomhurst

Copy link
Copy Markdown
Owner Author

The earlier wait on run 42818882171 no longer blocks this PR: that old-head CI run is cancelled after the receive-binding fix. Both required reviewers now clear current head e922256 (Claude run 42820071307/1 and the current Codex summary). All review bodies, conversation comments and resolved threads were checked; no outstanding finding or newer reviewer reply remains. The rework budget is not exceeded (four Claude rounds, one force-push). No linked prerequisite, replacement or superseded PR needs action; #224 is delivered here and Closes #224 remains in the body.

Before promotion, all 1,024 archived evidence files across the three SHA directories listed in the PR body were verified against inventory SHA-256 hashes; all 29 still-available originals match too. Removed originals cannot be compared again; the prior verification claims remain as recorded. Promoting the reviewed head through the protected auto-merge wrapper now.

@thomhurst
thomhurst marked this pull request as ready for review November 10, 2026 13:01
@thomhurst
thomhurst enabled auto-merge (squash) November 10, 2026 13:01
@thomhurst

Copy link
Copy Markdown
Owner Author

Promotion and protected auto-merge arming succeeded on reviewed head e922256. Ready-head CI run 42820768912 is now running: https://github.com/thomhurst/Relayer/actions/runs/42820768912 . GitHub will squash-merge once its required checks pass. This replaces the obsolete wait on cancelled run 42818882171; no on-hold label is needed.

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

ℹ️ 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".

@thomhurst
thomhurst marked this pull request as draft November 10, 2026 13:06
auto-merge was automatically disabled November 10, 2026 13:06

Pull request was converted to draft

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@thomhurst

Copy link
Copy Markdown
Owner Author

Run 42827997417 is cancelled on obsolete ab7882b; that wait no longer holds. Current-head Codex review supplied two valid findings, fixed and pushed as 5b2dc48: preserve standard fair-queue groups natively without portable ordering, and name test queues through isolation. Both threads have commit-linked replies and are resolved. The regression failed before the fix; all 17 focused unit/LocalStack/conformance cases and npm ci/site build pass. All 251 new evidence files were hash-verified against originals at the SHA-specific durable location in the updated PR body. Fresh Codex review is requested and automatic Claude review handles this push; no review wait or competing workflow dispatch is performed.

Resolve routes checked: #224 is delivered by this PR with Closes #224 intact, not already on main; #223 is closed; #224 has no native sub-issues, and parent #39 still has this work open. No linked open prerequisite, replacement/superseded PR, stale remaining scope or reversible undecided option prevents progress. #488 remains an independent advisory investigation. Seven earlier Claude rounds and two force-pushes are below the rework budget. This unit removes actionable findings rather than renewing the obsolete run deferral.

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS consumers)

I read the consumer, delivery, settlement, hosted service, send transport lifecycle, builder and health-check code against AGENTS.md. I did not run the build or tests. I found no blocking issues.

What holds up

  • Reuse: it uses native long polling, ChangeMessageVisibility, DeleteMessage and the SDK's own retries. It reuses ReceivePipeline, FailurePipeline and IFailureScheduler rather than adding parallel machinery, and D67 records the one SQS limitation (immutable attributes).
  • Delivery semantics: the message is deleted only after durable handling or a successful copy to the dead-letter queue. A failure in the pipeline, copy or settlement leaves the message to native visibility timeout, so delivery stays at-least-once.
  • Redrive check: ValidateRedriveAsync rejects maxReceiveCount <= RedeliveryDelays.Length. That leaves the final delivery in which Relayer can copy the message with failure metadata before native redrive would move it.
  • Per-message cost: one pooled SqsDelivery, with pooled body and request objects, per worker. There is no LINQ, reflection or capturing lambda per message. The only allocations are the native client's and the UTF-8 body copy, which the native string Body requires. A benchmark was added.
  • Receive request: it is validated at start and the request is reused per worker.
  • Backoff and shutdown: poll failures back off from 1 to 30 s, and a message returned by a poll that loses the stop race is still drained before the clients close.
  • Health: it is optional, tracked through Interlocked and Volatile writes, and the tracking flag is set in StartingAsync, before the consumers are composed.
  • Docs and tests: docs, the roadmap, the diagnostics-free decision record and tests (including LocalStack and conformance) are updated.

Non-blocking nit

  • In SqsSettlement.VisibilitySeconds (src/Relayer.AmazonSqs/SqsSettlement.cs), checked((int)Math.Ceiling(...)) runs before the range check. A delay above about 68 years throws a bare OverflowException instead of the actionable "exceeds the twelve-hour deadline" message. Compare delay.TotalSeconds to 43200 first, then cast, so the user always sees the guidance. This is an error path with no per-message cost.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 5b2dc48e2a

ℹ️ 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".

@thomhurst

Copy link
Copy Markdown
Owner Author

The earlier wait on run 42827997417 no longer holds: it is cancelled on obsolete ab7882b. Both required reviewers clear current head 5b2dc48 (Claude 42829978192/1 and the current full-SHA Codex summary). All review bodies, conversation comments and five resolved threads were checked; no newer thread reply remains.

Disposition of Claude’s current review: the optional extreme-delay exception-message improvement is non-blocking and declined without a code push. VisibilitySeconds rejects that invalid delay before issuing any native settlement request; normal supported delays retain the actionable twelve-hour check. No blocking fix warrants a new review cycle for this wording nit.

Before promotion, all 1,786 archived files across the six SHA directories documented in the PR body match inventory SHA-256 hashes, and all 44 available originals match. Removed originals remain unavailable for another comparison, as already documented. Durable evidence remains at /Users/tom/git/Relayer-evidence/pr-465/<measured SHA>/; earlier results remain head-specific. No code changed, so tests, benchmarks and site validation were not repeated.

Resolve routes checked: #224 is delivered by this PR with Closes #224 intact; its prerequisite #223 is closed. No linked open prerequisite, replacement/superseded PR, finished parent, stale remaining scope or unresolved reversible decision requires action. #488 tracks an independent advisory investigation and is not a prerequisite. Eight Claude rounds and two force-pushes remain below budget. Proceeding through protected promotion rather than repeating the obsolete wait.

@thomhurst
thomhurst marked this pull request as ready for review November 10, 2026 14:05
@thomhurst
thomhurst enabled auto-merge (squash) November 10, 2026 14:06
@thomhurst

Copy link
Copy Markdown
Owner Author

Protected promotion and auto-merge arming succeeded on reviewed head 5b2dc48. Ready-head CI run 42830668088 is in progress: https://github.com/thomhurst/Relayer/actions/runs/42830668088 . GitHub will squash-merge when required CI passes. This replaces the obsolete wait on cancelled run 42827997417; no hold label is needed.

@thomhurst
thomhurst disabled auto-merge November 10, 2026 14:29
@thomhurst
thomhurst marked this pull request as draft November 10, 2026 14:29
@thomhurst

Copy link
Copy Markdown
Owner Author

Run 42830668088 is terminal/failed, so the earlier wait no longer holds. Fixed its load-sensitive PostgreSQL lane-progress assertion in c705448; the PR body records the diagnosis, preserved assertions, 2/2 focused passing cases and hash-verified evidence. No workflow rerun was used. Main f54f037 does not fix this separate assertion. All review surfaces were read, with five resolved threads and no newer replies; earlier findings have dispositions. Eight Claude rounds and two force-pushes remain below budget.

Resolve routes checked: #224 is delivered by this PR (Closes #224 remains), prerequisite #223 is closed, and #224 has no sub-issues. Parent #39 still has this work open. No replacement/superseded PR, open native prerequisite, stale remaining scope or unresolved reversible choice requires linked-item action. #488 remains an independent advisory investigation; the latest advisory Performance run 42830667883 passed. This unit pushes a concrete CI fix rather than deferring. Fresh current-head reviews are required before promotion.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS receivers, durable settlement, health)

I read the receive, delivery, settlement and hosted-service code against AGENTS.md. I found nothing that should block merge. I did not run the tests.

What holds up

  • Native reuse: it uses native long polling, ChangeMessageVisibility, DeleteMessage and the SDK's own retries, and adds no parallel retry or ordering layer. FIFO ordering comes from one-message polls, so no group dispatcher is needed.
  • Settlement safety: delete happens only after durable handling, or after the FailurePipeline copy to the dead-letter queue. Any failure in the pipeline, the copy or settlement leaves the message to native visibility timeout, so delivery stays at-least-once.
  • Visibility delays: VisibilitySeconds measures the 12-hour ceiling from the original receive on a monotonic clock. Because receivedAt is taken before the long poll, the check errs conservative.
  • Per-message cost: deliveries, delete/visibility requests and body buffers are pooled per worker, and settlement uses a pooled async builder. Native request objects are reused, and ConfigureAwait(false) is used throughout src/. Startup validation fails early with actionable messages.
  • Shutdown and health: the two-token design (stop polling, then abort handlers) drains a message that won the stop race. The health state is per-slot with Volatile, and a faulted worker is reported instead of hidden.
  • Docs and tests: the PR includes decisions/design, site pages, roadmap, a benchmark, and unit plus LocalStack tests.

Non-blocking observations

  1. The PostgreSQL TenantDispatchTests change is unrelated to SQS, though the change itself is reasonable. The PR description could mention it, per AGENTS.md's note about trivial fixes made along the way.
  2. RunAsync catches every exception per message and logs it. A persistent bug in Prepare (for example a malformed body) would therefore redeliver until the native redrive threshold. That is intended and documented, but an operator metric for repeated processing failures would help later.

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

ℹ️ 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".

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS receive transport), head c83222c

I read the diff and pr-head/ and did not build or run the tests.

Earlier findings are addressed.

  • Poll errors: SqsConsumer.RunAsync now logs every poll failure and retries with a backoff of 1s doubling to 30s. A non-transient error no longer ends a worker.
  • Malformed receive count: SqsDelivery.Prepare no longer throws. It flags the bad value so the core classifies it and copies it to the poison path, instead of the message being redelivered forever.

Conformance with AGENTS.md

  • The change wraps native long polling, ChangeMessageVisibility and DeleteMessage. It adds no parallel dispatcher or retry runtime.
  • It reuses ReceivePipeline, FailurePipeline and IFailureScheduler.
  • The per-message path pools its body buffer and the native settlement requests, and it has no LINQ or capturing lambdas. The only exception is ConfigureReceive?.Invoke in CreateRequest, which runs once per worker at startup.
  • The PR adds a decision record (D67), a binding benchmark, tests including LocalStack, and updates to the website pages.
  • Health is exposed only through the optional health package.

No actionable findings.

@thomhurst

thomhurst commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner Author

Run 42830668088 is terminal/failed on obsolete 5b2dc48; its diagnosed PostgreSQL lane-progress assertion was already fixed in c705448, so that wait no longer holds. Current-head Codex supplied a valid whitespace FIFO identity finding, now fixed and pushed in c83222c. Three regressions failed before the fix and all 19 focused failure/LocalStack cases pass afterward. npm ci, final documentation build and diff check pass; 252 evidence files were hash-verified against originals at the durable location recorded in the updated PR body. The finding has a commit-linked reply and is resolved. Fresh Codex review is requested; automatic Claude review handles the push. No CI rerun or review wait was used.

All review surfaces were inspected; six threads are now resolved without later reviewer replies. Claude current-head non-blocking observations: the PostgreSQL fix is already described in the PR body; an optional repeated-failure metric is declined as separate observability work, with existing processing-failure logs/native redrive preserving visibility and safety. Nine prior Claude rounds and two force-pushes remain below budget.

Resolve routes checked: #224 is delivered by this PR with Closes #224 intact, not already on main; prerequisite #223 is closed. #224 has no sub-issues; parent #39 still has #224 open. No open prerequisite, replacement/superseded PR, stale remaining scope or undecided reversible choice needs linked-item action. #488 remains an independent advisory investigation. This unit pushes a concrete review fix rather than renewing the obsolete wait.

Follow-up assigned-unit audit: the obsolete run wait remains removed. Claude run 42835789918 succeeded with CLEAR for current c83222c; Codex summary comment 6764557438 still reports running for that same head, requested by comment 6770157170. There is no running GitHub workflow to retry and no missing review request to recover. Current draft CI is intentionally skipped; promotion must await the required Codex verdict. Rechecked every review surface: all six threads remain resolved with no later reviewer replies. Ten Claude rounds and two force-pushes are below budget. Rechecked Resolve routes: #223 is closed, #224 has no children and is still delivered solely by this open PR with Closes #224; parent #39 cannot close while #224 is open. No replacement, actionable prerequisite, stale scope or reversible decision remains. Main does not contain these seven branch commits; PR is mergeable. This audit changes no code and starts no competing review or CI run. No on-hold/needs-human label is appropriate for this self-ending review wait.

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

ℹ️ 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".

@thomhurst

Copy link
Copy Markdown
Owner Author

The earlier wait on run 42830668088 no longer holds: it failed on obsolete 5b2dc48, and c705448 already fixes its diagnosed PostgreSQL assertion. Codex’s subsequent current-head invalid FIFO token finding is now fixed and pushed in 3c87664. All 24 focused failure/production LocalStack cases, npm ci, site build and diff check pass. The PR body records the native SDK source reuse, error-path cost and 250 hash-verified evidence files. Fresh required reviews are requested for the new draft head; no competing CI/review run or workflow rerun was started.

All review surfaces were inspected: six earlier threads have dispositions without newer replies, and the seventh finding has a commit-linked reply and is resolved. Ten Claude rounds and two force-pushes are below budget. Current Claude CLEAR had no findings; earlier optional metric/text observations already have dispositions.

Resolve routes checked: #224 remains delivered by this PR with Closes #224 intact and is not on main; native prerequisite #223 is closed and #224 has no sub-issues. Parent #39 still has #224 open. No open prerequisite, replacement/superseded PR, stale remaining scope or reversible decision needs linked-item action. #488 remains independent advisory work. This unit delivers a review fix rather than renewing the obsolete wait.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown

Review of #465 (SQS consumer)

I read SqsConsumer, SqsDelivery, SqsSettlement and SqsHostedService against AGENTS.md. I did not run the tests, and I did not read the test files, benchmarks, docs, health-check package or decision records line by line.

What holds up

  • Native reuse (D1/D42): native long polling, ChangeMessageVisibility and DeleteMessage are used as-is. The existing ReceivePipeline, FailurePipeline and IFailureScheduler are reused, and there is no parallel retry runtime.
  • Delivery semantics: delete happens only after durable handling or a successful copy to the dead-letter queue. A failed settlement leaves the message to native visibility redelivery, which keeps delivery at-least-once.
  • Receive deadline: the twelve-hour guard measures from the original receive timestamp, taken before the poll call, so it errs on the safe side. It fails loudly rather than degrading silently.
  • Per-message path: the delivery object, body buffer and native request objects are pooled and reused. Settlement uses a pooling async builder, and I saw no LINQ, reflection or capturing lambdas on that path. The LINQ in ValidateDeclaration and StartAsync runs only at startup.
  • Startup validation: a missing queue declaration, a dead-letter endpoint that matches the source, a FIFO/standard mismatch and invalid ReceiveMessageRequest overrides are all rejected with actionable messages.
  • Shutdown: poll cancellation and abort cancellation are separate, so an in-flight message drains before clients close.

Non-blocking notes

  1. In SqsConsumer.RunAsync, a permanent receive error such as QueueDoesNotExist or AccessDenied retries forever with backoff capped at 30s. Only a warning is logged. It is visible only when the optional health provider is registered. Consider surfacing it at the next startup or health probe, or documenting it on the SQS transport page.
  2. SqsDelivery.Dispose is public, but the doc comment says handlers must not call it. Making it explicit-interface or internal would stop a handler from returning the pooled buffer while the settlement path still reads Body.
  3. State the per-message cost in the PR description if it is not already there. The benchmark file is included, which is fine.

No actionable correctness, security or convention issues found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 3c8766457c

ℹ️ 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".

@thomhurst

Copy link
Copy Markdown
Owner Author

Both required reviewers clear current head 3c87664 (Claude run 42836846295/1; Codex summary 6764557438). All seven review threads have commit-linked dispositions and no subsequent reviewer replies.

Disposition of Claude’s current review: all three observations are non-blocking. Permanent receive failures already retry visibly through warning logs and the optional health provider, as requested by the earlier blocking review; additional startup/probe behavior is optional follow-up and needs no push. The optional Dispose API tightening is declined for this cycle: the borrowed feature’s lifetime contract explicitly prohibits handler disposal, and no blocking fix otherwise warrants a new head. Per-message cost and benchmark scope are already recorded in the PR body.

Before promotion, verified all 2,541 archived files against their inventory SHA-256 hashes at the head-specific locations under /Users/tom/git/Relayer-evidence/pr-465/, plus all 58 originals still available. The other 2,483 original files were removed with earlier worktrees; this is an archive integrity recheck, preserving the prior recorded original-to-archive verification, not new validation. No tests or benchmarks were rerun for this disposition-only unit.

The earlier wait on run 42830668088 no longer holds: it failed, and c705448 fixes its diagnosed deadline assertion. Resolve routes remain clear: #224 is delivered by this PR with Closes #224 intact; prerequisite #223 is closed; #224 has no native sub-issues; parent #39 cannot finish while #224 remains open. No actionable prerequisite, replacement, stale scope, or reversible decision requires another lock. #488 remains independent advisory investigation. Eleven Claude rounds are below budget, with no current blocking finding. Proceeding through the protected promotion script rather than deferring the obsolete wait.

@thomhurst
thomhurst marked this pull request as ready for review November 10, 2026 14:48
@thomhurst
thomhurst enabled auto-merge (squash) November 10, 2026 14:48
@thomhurst
thomhurst merged commit cd52462 into main Nov 10, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Run the advisory benchmark regression gate on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQS receivers, settlement, health and LocalStack conformance

1 participant