Skip to content

feat: add native SQS sending and queue topology - #229

Merged
thomhurst merged 4 commits into
mainfrom
issue-223-sqs-sending
Nov 10, 2026
Merged

thomhurst merged 4 commits into
mainfrom
issue-223-sqs-sending

Conversation

@thomhurst

@thomhurst thomhurst commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Adds AWS SDK v4 standard/FIFO SQS sending and non-destructive queue topology. Receivers, settlement, health and conformance remain #224; SNS remains #225.

Closes #223

Native and existing features reused

AWSSDK.SQS 4.0.100.22 SendMessageRequest and its marshaller already provide the string MessageDeduplicationId field; their source and AssemblyFileVersion were checked. Relayer's existing HeaderNames, captured route options, pooled send state and header traversal supply the identity. No replacement deduplication, ordering, retry or broker runtime is introduced.

The metrics correction reuses Relayer's existing SendTracing.RecordNativeSend and StartNativeSend, as the Kafka and Service Bus adapters do. Each actual SDK call counts its entries and records duration through success, exception or partial batch failure. Empty batches and preparation failures record no native attempt. No replacement AWS runtime is introduced.

Maintainer performance decision

Option 1 was explicitly approved on #223 under D52, recorded on main in 76402e0 and included by this rebase. The SQS site names required body, attribute-value and group-ID strings. SqsBindingBenchmarks retains the raw-client allocation pin. The earlier 856 B/message on both paths is a historical report, not new measurement; the full default-JSON 5% throughput budget remains unmeasured. Fixed-capacity stable-header caching is an optional follow-up, per the maintainer.

This correction adds native counter/timer calls and finally completion, with 0 additional B/message from those helpers. SqsSendBenchmarks now covers metrics enabled/disabled; the performance label remains attached. No new benchmark result is claimed.

Validation of a59bd05

Rebased onto main (07f543f) to resolve roadmap/status conflicts caused by the completed Service Bus receiver work. The resolution preserves main's Service Bus implementation status and SQS sending status; range-diff confirms the FIFO identity and metrics fix commits are unchanged. No runtime changes were introduced by this rebase.

  • Full Release build: zero warnings/errors, .NET SDK 10.0.403.
  • All 21 focused SqsSendTests pass.
  • npm ci and npm run build pass, Node 26.13.0.
  • git diff --check passes; range-diff reviewed for lost changes.
  • No new real-broker run, full suite, Native AOT publish or throughput measurement is claimed. Earlier LocalStack results remain historical.

Evidence

New validation logs, changed sources, test binaries and report are archived at /Users/tom/git/Relayer-evidence/pr-229/a59bd050e8bd62c5f6ad0c1a5ea49d051901aa17/. All 143 files were SHA-256 checked against originals; inventory.json records the hashes. Local retention lasts while this PR is open. Earlier evidence remains historical and is not evidence for this rebased head.

Draft with auto-merge disabled for fresh Claude and Codex reviews of this head.

FIFO group decoding correction

Fixed the duplicate FIFO group decoding in 86ff83d: Prepare retains the first decoded MessageGroupId and restores that same string after native configuration, including batch entry copying. This reuses existing WireString decoding and the native request field; no native capability is reimplemented. Per-message cost: removes one string allocation and UTF-8 conversion for a nonempty UTF-8 ordering key; no added allocation, loop, lock or await. SqsBindingBenchmarks now includes standard/FIFO parameters with equivalent raw-client group and deduplication preparation; performance label remains.

Regression test failed before the fix on string reference identity and passes after it. All 22 SqsSendTests pass, full Release build (including benchmarks) passes with zero warnings/errors, npm ci and npm run build pass, and git diff --check passes. No new broker run, full suite, AOT publish or throughput measurement is claimed. Callback precedence remains unchanged; the website documents the single decode and FIFO benchmark case.

Evidence for this head is archived at /Users/tom/git/Relayer-evidence/pr-229/86ff83de2ea47d29bf208eab6a21fc5694b0eda7/: all 129 files were SHA-256 compared to originals; inventory.json records the hashes. Earlier validation remains historical.

Disposition of Claude run 42726992678/1: both observations are non-blocking suggestions. Keep streaming batch preparation: the site already documents non-atomic batches and earlier delivery before failure, and a validation pre-pass adds per-message work without providing atomic delivery. Keep the current native provisioning wait; parallel startup provisioning is an optional optimization outside this fix. No separate optional-refactor push is warranted.

Run 42725296168 succeeded; the earlier wait no longer holds. This pushed fix requires fresh head-bound reviews and stays draft with auto-merge disabled.

@thomhurst thomhurst added needs-human Requires an explicit maintainer decision performance Run the advisory benchmark regression gate on this PR labels Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 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: 377f5f56-08f7-4267-ae77-c188f71ded55
  • 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

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review of PR #229 (SQS send adapter). The pooled-state design is sound, and the send, batch and topology paths hold up when I read them. One item blocks merge.

Blocking: per-message allocations without maintainer approval (AGENTS.md, D18). SqsSendState.Prepare allocates on every message: Utf8.GetString(outgoing.Body.Span) for the body, header.Value.ToString() for each header, orderingKey.ToString() for the group id, and a second full pass with Utf8.GetByteCount(Request.MessageBody). The PR description says this is blocked on a maintainer decision and that no exception is recorded. I agree it can't merge as is, because AGENTS.md says not to trade allocations against anything else without explicit approval. Keep this draft until the decision is recorded in docs/decisions.md, or until the allocations are removed.

If an exception is approved, these would reduce the cost without changing the public API:

  • Compute the size from outgoing.Body.Length and the header byte lengths, since the string is already validated UTF-8.
  • Cache the header strings that are stable per endpoint, such as the CloudEvents ce_* type and source.
  • Use the reusable MessageAttributeValue slots only for values that change per message.

Minor

  • Prepare sets Request.QueueUrl twice and MessageGroupId twice. Drop the duplicates.
  • AmazonSqsBatchException takes an offset that is relative to the destination group built in SendBatchAsync, not to the caller's original span. When a call spans several destinations, callers can't map a failed entry back to their own message. Pass the absolute index or document that it is group-relative.
  • A partial batch failure stops the remaining sub-batches, and the earlier ones have already been sent. Say so in the exception documentation and on the website page.

Process. Attach the SHA-bound validation evidence and the per-message cost line once the D18 decision is made. The benchmarks added here do move per-message cost, so the performance label is appropriate.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

The D18 allocation decision is explicitly unresolved. Please review this head's correctness and native semantics; keep the draft gate intact.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-10T00:30:10.418055Z 86ff83d Draft marked ready
ℹ️ 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.

@thomhurst

Copy link
Copy Markdown
Owner Author

Disposition of Claude's current-head review, for 4eaa966:

  • Blocking, accepted: D18 allocations remain unresolved. SQS native queue sending and topology #223 and this PR carry needs-human, and the PR stays draft with auto-merge disabled. The issue records the maintainer options. No exception has been accepted.
  • Non-blocking optimization suggestions: defer size-loop/header caching changes until the performance decision. A native callback can replace MessageBody, so counting outgoing.Body.Length alone would undercount the actual SDK payload. The current byte count validates the final native text and attributes. Stable-value caching would also need bounded retention and its own allocation/cost evidence.
  • Incorrect duplicate-assignment finding: the first QueueUrl/MessageGroupId assignments populate the callback's native request; the second assignments, after ApplyNative, enforce the declared destination and portable ordering key over callback changes. Removing either phase changes the documented callback contract.
  • Non-blocking BatchOffset clarification: already documented as relative to the contiguous destination group in both the public XML documentation and website Batching and telemetry section. Native entry IDs are zero-based within that batch. The API does not claim an absolute index across destinations; no code change is needed.
  • Non-blocking partial-failure wording: the native batch exception is thrown immediately, so subsequent sub-batches are not submitted. Earlier successful deliveries remain delivered. The exception and website already warn that successful entries are not resent and batches are non-atomic. This clarification is recorded here; no separate wording-only push while the blocking decision remains.
  • Evidence/process: the PR body now contains the per-message cost and SHA-bound evidence archive. Its 1,128 files, including raw reports, sources, test binaries and retained generated benchmark harnesses, were checked against their originals with SHA-256 before citation. The earlier review ran before that final body update.

No new head was pushed, so the pending Codex request still targets the current head. No promotion or merge is authorized by these dispositions.

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

ℹ️ 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 src/Relayer.AmazonSqs/SqsSendState.cs Resolved
@thomhurst
thomhurst force-pushed the issue-223-sqs-sending branch from 4eaa966 to 8b7b93d Compare November 2, 2026 14:18
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review of PR #229 (SQS send transport)

Blocking: FIFO deduplication ID is tied to the literal ce_id header. src/Relayer.AmazonSqs/SqsSendState.cs:44 sets MessageDeduplicationId only when header.Key == "ce_id". With custom SendRouteOptions.HeaderNames bindings the identity header has a different name, so the native dedup ID is never set. FIFO queues without content-based dedup will then reject the send, or deduplicate on the wrong key. This was flagged in an earlier review thread and no fix is pushed at this head.

Suggested fix: take the identity header name from the resolved route binding, which is resolved once at startup and costs nothing per message. Alternatively, reject unsupported bindings at startup (D16/D24). Add a regression test with a custom header binding on a FIFO queue.

Blocking: the D18 gate is unresolved. The PR description itself reports 856 B/message from Relayer's own text conversion, against the zero-allocation budget. AGENTS.md requires explicit maintainer approval for that trade-off, and docs/decisions.md has no recorded exception. Merge needs either an approved and recorded exception naming the AWS SDK string requirement, or a design that avoids the allocation. A full-pipeline 5% throughput measurement is also not claimed.

Everything else I looked at is consistent with the stated design: native batching, native groups and timers, and read-only validation. Docs and sidebar are updated.

@thomhurst
thomhurst force-pushed the issue-223-sqs-sending branch from 8b7b93d to 2542d93 Compare November 2, 2026 14:25
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review of PR #229 (SQS send adapter)

Blocking findings (verified against the head in pr-head/):

  1. FIFO deduplication ID is hard-coded to ce_id (src/Relayer.AmazonSqs/SqsSendState.cs:44). The code has no reference to SendRouteOptions.HeaderNames. A route with a custom identity header binding never sets MessageDeduplicationId. SQS then either rejects the send or, with content-based deduplication, silently dedupes on the wrong key. Fix: read the identity header name from the configured route bindings. If the configuration can't be honoured, fail at startup (D16/D24) instead of degrading silently. Add a regression test with a custom binding. This is the open thread at discussion_r4443260416, and no fix has been pushed.

  2. D18 allocation gate is unresolved. The PR description's own probe shows 856 B/message from Relayer's string conversions for body and headers. That breaks the zero-allocation rule, and AGENTS.md requires explicit maintainer approval for a trade-off. No exception is recorded in docs/decisions.md. Either record an approved, narrowly scoped native-text-conversion exception (naming the AWS SDK v4 string requirement), or avoid the per-message string materialization. This can't merge without that decision.

Non-blocking: the PR states the 5% throughput budget and Native AOT publish were not validated. Please address both before promotion.

Docs, tests (LocalStack), batching and topology are otherwise reasonable. The draft should stay a draft until items 1 and 2 are resolved.

@thomhurst
thomhurst force-pushed the issue-223-sqs-sending branch from 2542d93 to d746fb9 Compare November 2, 2026 15:21
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review of #229: native SQS sending and queue topology

I reviewed SqsSendTransport, SqsSendState, the registration extensions, and the tests that exercise them. I found nothing that should block merge.

What I checked

  • Wrap, don't replace (D1, D22): Sends go through SendMessage/SendMessageBatch. Batches are limited to 10 entries and 1 MiB. Group, deduplication and delay use native fields. Topology uses GetQueueUrl, CreateQueue, GetQueueAttributes and ListQueueTags. I found no parallel implementation of a native feature.
  • Pooled batch state: The count-boundary and byte-boundary flushes clear the right slots. The byte-boundary swap carries the already-prepared request into slot 0 without running the callback twice. Used is kept accurate, so Clear on the exception path covers every dirtied slot. Pool rent and return are lock-free.
  • Topology: Validate is read-only. Provision creates missing queues and never updates existing ones. Policy JSON compares structurally. CreateQueue is idempotent for identical attributes, so concurrent provisioners don't conflict.
  • Fail-early behaviour: Receiver declarations, undeclared destinations, FIFO/.fifo mismatches, more than 10 attributes, tombstones, timers on FIFO queues, and sends before queue URLs are resolved all throw actionable errors.
  • Tests: They cover batch splitting, partial failure, timers not leaking to later messages, concurrent borrowed storage, cancellation and disposal, telemetry, and LocalStack end-to-end.

Non-blocking notes

  1. Prepare allocates per message: header.Value.ToString(), orderingKey.ToString(), and the UTF-8 body string. The AWS SDK's string-typed request model forces most of these. If Header.Value is already string-backed, check that ToString() doesn't copy. Please state the per-message cost in the PR description, as AGENTS.md asks.
  2. DateTimeOffset.UtcNow is read directly for DeliverAt. Taking a TimeProvider would make the timer tests deterministic.
  3. The PR body says the D18 gate is still unresolved, so keeping it as a draft with no closing keyword is right.

@thomhurst

Copy link
Copy Markdown
Owner Author

Disposition of the earlier Claude reviews at 4eaa966, 8b7b93d and 2542d93: the FIFO custom-header finding is fixed in 5e3120f and the inline Codex thread has been replied to and resolved. The startup-resolved binding reuses the existing header comparison with no additional per-message allocation. The separate D18 allocation decision remains blocking; this PR stays draft and needs-human. The earlier minor findings retain their evidence-based dispositions in #229 (comment). Final Release build and all 22 SQS/configuration/LocalStack tests pass. Local documentation installation remained incomplete, and the build attempt lacked Docusaurus; the PR body records this limitation and withdraws the inaccessible old evidence-retention claim. No throughput or Native AOT validation is claimed for this head.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

This head fixes configured FIFO identity mapping and rebases onto main. The separate D18 maintainer decision remains unresolved; review correctness without treating this request as performance approval. Local docs installation did not complete, as recorded in validation.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Review of PR #229 at head 5e3120f (SQS send adapter).

Earlier finding resolved. The ce_id FIFO deduplication defect is fixed in 5e3120f. ResolveIdentityHeaders reads route.SendOptions.HeaderNames.Id for each .fifo CloudEvents route and passes it to SqsSendState.Prepare. It throws at startup when routes to the same queue disagree. That matches the fail-early rule. Tests cover a custom event_ prefix, in both the unit tests and LocalStack, and the conflict message.

Blocking: per-message allocations without maintainer approval (AGENTS.md, D18). The PR description reports 856 B/message from the string conversions of body and headers in SqsSendState.Prepare. The AWS SDK requires strings, but the allocation is still Relayer's. AGENTS.md says not to trade allocations away without explicit maintainer approval, and no exception is recorded in docs/decisions.md. Keep this as a draft until one of these happens:

  • the maintainer approves a narrow native-text-conversion exception and it is recorded in docs/decisions.md, naming the SDK limitation, or
  • the allocations are removed.

If the exception is approved, these cheaper steps stay within it:

  • Cache header strings that are stable per endpoint, such as the ce_type and ce_source values.
  • Compute the byte size from Body.Length and header lengths instead of calling Utf8.GetByteCount on the new string.

Minor, non-blocking

  • A batch failure's offset should be documented as relative to the destination group, not the caller's span. Also document that a partial failure stops later sub-batches.
  • Non-CloudEvents FIFO routes fall back to ce_id, since ResolveIdentityHeaders skips them. Confirm that is intended and say so in the website docs.

Process. Attach the performance label. This change moves per-message cost, and the benchmarks cover it. I did not rerun the build or tests; this review is from reading the diff.

@thomhurst

Copy link
Copy Markdown
Owner Author

Disposition of Claude run 42309111127/1 on 5e3120f:

  • Blocking D18 decision remains accepted and unresolved in SQS native queue sending and topology #223; draft/needs-human and disabled auto-merge remain. The FIFO correctness finding is fixed, as this review confirms.
  • Non-blocking caching/size optimization suggestions retain the earlier disposition: native callbacks can replace MessageBody, so Body.Length alone can undercount the actual SDK payload. Stable-value caching needs bounded retention and separate performance evidence; do not introduce that trade-off while the maintainer decision is unresolved.
  • BatchOffset is already documented as relative to the contiguous destination group in AmazonSqsBatchException XML and the website Batching and telemetry section. The website also documents non-atomic batches and earlier delivery before failures. Explicitly adding the later-sub-batch stopping sentence is an optional wording follow-up; no separate push for a non-blocking clarification under the review-cycle rule.
  • Raw/low-level fallback is intentional: without a CloudEvents route there is no captured envelope identity binding. The FIFO ordering section now explicitly says low-level replay uses the configured queue identity header, or ce_id when no CloudEvents route declares one; missing event IDs require native deduplication configuration or a callback ID.
  • The performance label is already attached and the original adapter benchmarks remain. This correction uses the same existing per-header comparison with a cached string; it adds no per-message allocation, loop, lock, await or copy. No extra benchmark is required for that correction.

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

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

Maintainer decision is on #223: option 1 approved under D52.

@thomhurst thomhurst removed the needs-human Requires an explicit maintainer decision label Nov 9, 2026
@thomhurst
thomhurst force-pushed the issue-223-sqs-sending branch from 5e3120f to 2185789 Compare November 9, 2026 23:59
@thomhurst

Copy link
Copy Markdown
Owner Author

Fixed the native-metrics finding in 2185789: single sends and each split native batch count actual entries, and duration completes on success, exceptions and partial batch failure. Deterministic tests verify completion timing and failure tags; preparation failures and empty batches remain excluded. All 21 SqsSendTests, full Release build and website build pass. Metrics-on/off benchmark cases were added.

The maintainer approved the former D18 blocker in #223 under D52 (76402e0). This head rebases onto that decision and documents the native-required string conversions and retained raw-baseline pin. The PR remains draft for fresh reviews; no performance approval is inferred from review results.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

This head fixes native send metrics and includes the maintainer-approved D52 decision from main. The SQS page names the required native strings; the raw binding benchmark remains the allocation pin. Please review the current head. Full Release build, 21 focused tests and docs build pass; full default-JSON throughput is not newly measured.

@github-actions

Copy link
Copy Markdown

Review of PR #229 (SQS send and topology)

I read SqsSendTransport.cs and SqsSendState.cs in full, plus the PR description and the earlier discussion. I did not read the tests, benchmarks or docs files line by line, and I did not build or run anything.

Correctness. I found no actionable issues.

  • The batch splitting is consistent: the flush at 10 entries, the flush at 1 MiB with the prepared request carried over into slot 0, and the batchStart offset passed to AmazonSqsBatchException.
  • state.Used is set before Prepare, so the pool's Clear also resets a message that failed to prepare.
  • Native metrics are recorded only around actual SDK calls. duration.Complete(failed) runs in finally, and partial batch failure is counted as failed. Empty batches and preparation failures record no native attempt.
  • Topology is non-destructive. Provision only creates a missing queue, and Validate reports a difference instead of changing anything. Policy attributes are compared with JsonElement.DeepEquals.

Project rules.

  • The PR reuses the native SendMessageRequest.MessageDeduplicationId field and Relayer's SendTracing helpers, and it lists the features it builds on, as AGENTS.md requires.
  • The per-message string conversions are required by the SDK, and D52 approves them. The allocation baseline stays in SqsBindingBenchmarks.
  • The full default-JSON 5% throughput budget is not newly measured. The PR says so openly and treats it as maintainer-owned, so I'm not blocking on it.

Non-blocking notes.

  • ValidateDeclarations compares FifoQueue with the exact string "true". A "True" value is reported as a suffix mismatch, which is probably fine because AWS expects lowercase.
  • On a FIFO queue, a message whose identity header is absent gets no MessageDeduplicationId. That only works if the queue has ContentBasedDeduplication enabled. A startup or send-time check would make the failure clearer.

The change is sound.

@thomhurst

Copy link
Copy Markdown
Owner Author

Disposition of Claude review 42724822323/1 on 2185789: both notes are non-blocking. Keep the exact lowercase FIFO attribute validation: it follows the native attribute representation and rejects mismatches early. Keep native deduplication validation for low-level sends: the website FIFO section already requires native deduplication configuration or an explicit callback ID when the event identity is absent; SqsSendState.Prepare preserves a callback-supplied MessageDeduplicationId. Adding another check is an optional follow-up, so no wording-only or optional-validation push is warranted.

Claude is CLEAR for this head; prior inline threads remain resolved with no newer reviewer replies. Codex review request #229 (comment) is pending (the summary reports running on this exact head), within its 15-minute request window. Leave draft and auto-merge disabled until its verdict; no duplicate request or competing review run was started.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 21857895c7

ℹ️ 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 waiting blocker is cleared: Codex summary now reports completed with no findings for 2185789, matching Claude CLEAR run 42724822323/1. All review surfaces were checked, and both inline threads remain resolved without later reviewer replies. Previous dispositions stand.

Reverified all 123 retained files against the original SHA-256 inventory at /Users/tom/git/Relayer-evidence/pr-229/21857895c73a7d30a402a0b00caccb5a9f765343/: no missing files or hash mismatches. The original worktree has been cleaned, so this verifies the archived inventory rather than repeating comparison to removed originals. No new test or benchmark result is claimed. Proceeding through the guarded promotion and auto-merge script.

@thomhurst
thomhurst marked this pull request as ready for review November 10, 2026 00:03
@thomhurst
thomhurst enabled auto-merge (squash) November 10, 2026 00:03
@thomhurst
thomhurst disabled auto-merge November 10, 2026 00:15
@thomhurst
thomhurst marked this pull request as draft November 10, 2026 00:15
@thomhurst
thomhurst force-pushed the issue-223-sqs-sending branch from 2185789 to a59bd05 Compare November 10, 2026 00:16
@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

Run 42725296168 passed, clearing the previous waiting blocker. Main subsequently introduced documentation conflicts; rebased onto 07f543f and preserved its completed Service Bus receiver status alongside SQS sending. Range-diff confirms both later correctness fixes are unchanged. Release build, 21 SqsSendTests and docs build pass; SHA-bound evidence is in the PR body. Fresh reviews are required for this rebased head; auto-merge is disabled and the PR is draft.

@github-actions

Copy link
Copy Markdown

Review of #229: SQS sending and topology

I read the SQS transport, send state and pool, builder, options and batch exception, and listed the test names. I did not run the build or tests.

Conventions

  • Native features are reused: SendMessageRequest.MessageDeduplicationId, SendMessageBatch, CreateQueueRequest and the queue attributes and tags APIs. No replacement runtime is introduced.
  • Topology never modifies or deletes existing queues, and drift is reported instead of reconciled.
  • The per-message path is pooled and lock-free, with no LINQ or reflection.
  • The metrics fix uses RecordNativeSend and StartNativeSend, the same helpers the Kafka and Service Bus adapters use.
  • Awaits use ConfigureAwait(false).
  • The PR body states the performance decision (D52) and links the native source.
  • Docs, sidebar and roadmap are updated in the same PR.

Correctness

  • The batch loop handles both split boundaries correctly. The 10-entry flush resets state before reuse. In the byte-boundary flush, the already prepared pending entry is swapped to slot 0 without re-running callbacks. Used tracks the right count, so the Return path clears every dirty slot, including after a mid-batch exception.
  • Partial batch failure counts the attempt, completes the timer as failed, and throws AmazonSqsBatchException with the offset. Later chunks are not sent.
  • FIFO rules (group ID required, no per-message delay, dedup ID taken from the bound identity header) and the 10-attribute limit are enforced before any native call.

Non-blocking observations

  1. SendBatchCoreAsync calls Validate and Prepare lazily per message. A tombstone, a missing group ID or an oversized message at index 15 is only detected after the first 10 entries have been sent. The exception's BatchOffset does not cover this case, so callers cannot tell that earlier entries were delivered. Prepare cannot easily run ahead because the state is pooled per slot, but a cheap pre-pass over Validate would remove the partial-send surprise for the structural checks. I did not treat this as blocking.
  2. Task.Delay(1s) after each CreateQueue runs serially, so provisioning N queues takes at least N seconds at startup. This only affects Provision mode. If you later need faster startup, issue the creates first and wait once.

No actionable blocking 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: a59bd050e8

ℹ️ 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 src/Relayer.AmazonSqs/SqsSendState.cs Resolved
@thomhurst

Copy link
Copy Markdown
Owner Author

Fixed the duplicate FIFO group decoding in 86ff83d: Prepare retains the first decoded MessageGroupId and restores that same string after native configuration, including batch entry copying. This reuses existing WireString decoding and the native request field; no native capability is reimplemented. Per-message cost: removes one string allocation and UTF-8 conversion for a nonempty UTF-8 ordering key; no added allocation, loop, lock or await. SqsBindingBenchmarks now includes standard/FIFO parameters with equivalent raw-client group and deduplication preparation; performance label remains.

Regression test failed before the fix on string reference identity and passes after it. All 22 SqsSendTests pass, full Release build (including benchmarks) passes with zero warnings/errors, npm ci and npm run build pass, and git diff --check passes. No new broker run, full suite, AOT publish or throughput measurement is claimed. Callback precedence remains unchanged; the website documents the single decode and FIFO benchmark case.

Evidence for this head is archived at /Users/tom/git/Relayer-evidence/pr-229/86ff83de2ea47d29bf208eab6a21fc5694b0eda7/: all 129 files were SHA-256 compared to originals; inventory.json records the hashes. Earlier validation remains historical.

Disposition of Claude run 42726992678/1: both observations are non-blocking suggestions. Keep streaming batch preparation: the site already documents non-atomic batches and earlier delivery before failure, and a validation pre-pass adds per-message work without providing atomic delivery. Keep the current native provisioning wait; parallel startup provisioning is an optional optimization outside this fix. No separate optional-refactor push is warranted.

Run 42725296168 succeeded; the earlier wait no longer holds. This pushed fix requires fresh head-bound reviews and stays draft with auto-merge disabled.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

This head reuses the decoded FIFO group string after native callbacks, fixing the duplicate allocation. The regression fails before/passes after; all 22 focused tests, full Release build and docs build pass. FIFO/raw-client binding benchmark coverage is extended; no new throughput measurement is claimed.

@github-actions

Copy link
Copy Markdown

Review of PR #229 (SQS send and topology)

I read SqsSendTransport and SqsSendState in the PR head against AGENTS.md and found no actionable issues. I did not run the build or tests, and I did not read the unit tests, LocalStack tests, benchmarks or docs pages beyond the file list and the PR description.

  • Batching: the 10-entry and 1 MiB flush boundaries, the pending-request swap, entry ids, and the failure offset (batchStart) are consistent. State is cleared in Return, including when Prepare or a flush throws.
  • FIFO: the deduplication id comes from the existing HeaderNames.Id binding through the SDK's native MessageDeduplicationId. The group id is required, and per-message delay is rejected. Mismatched identity headers across routes to one queue fail at startup, before an owned client is created.
  • Topology: the Validate and Provision modes only create queues that are missing. Existing queues are never modified. Differences are reported and policy attributes are compared as JSON.
  • Metrics: RecordNativeSend and StartNativeSend are called only around actual SDK calls, matching the Kafka and Service Bus adapters. Partial batch failure is recorded as failed.
  • Conventions: it reuses pooled state, ConfigureAwait(false) is used throughout, there are no static mutable fields, and the D52 performance decision and the website docs are covered per the PR description.

@thomhurst

Copy link
Copy Markdown
Owner Author

The earlier wait on CI run 42725296168 is cleared: that run succeeded. The current head is 86ff83d, so that older CI result is historical.

Current-head audit: Claude run 42728062528/1 succeeded with CLEAR and no findings. Codex request #229 (comment) is within its 15-minute request window; the mutable summary explicitly reports running on this head. No duplicate review request or workflow dispatch is warranted. All review bodies, inline comments, conversation comments and all three resolved threads were checked; existing dispositions stand, with no newer reviewer replies. Eight Claude rounds and six force-pushes are below the rework limits.

The PR is mergeable, remains draft and has no auto-merge request. Draft CI skips are expected. #223 already has Closes linkage here and its D52 decision is approved; there is no remaining agent-workable prerequisite, finished parent, stale scope or superseding PR to act on. Promotion awaits the current Codex verdict under the draft review lifecycle. This is a pending review, not a human/upstream/credentials deferral; no hold label was added. No new validation result is claimed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 86ff83de2e

ℹ️ 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 42725296168 is cleared: it succeeded. Both required reviewers now approve current head 86ff83d: Claude CLEAR run 42728062528/1 and the Codex summary completed with no findings. Rechecked all review surfaces; all three threads remain resolved without later reviewer replies, and prior dispositions stand.

Reverified all 129 archived files against inventory.json at /Users/tom/git/Relayer-evidence/pr-229/86ff83de2ea47d29bf208eab6a21fc5694b0eda7/: no missing files or SHA-256 mismatches. The original worktree has been cleaned, so this rechecks the retained inventory rather than repeating comparison to removed originals. No new validation result is claimed. The approved D52 decision and Closes #223 linkage already cover the prerequisite; no stale scope, finished parent or replacement needs action. Proceeding through guarded promotion and auto-merge.

@thomhurst
thomhurst marked this pull request as ready for review November 10, 2026 00:28
@thomhurst
thomhurst enabled auto-merge (squash) November 10, 2026 00:28
@thomhurst
thomhurst merged commit 1c3ad4f 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 native queue sending and topology

1 participant