Skip to content

anyshift-io/sre-skills / skills/sqs-queue-auditor

sqs-queue-auditor

Verified

FileKindSize
FAILURE_MODES.mdmarkdown6.6 KB
README.mdmarkdown4.9 KB
SKILL.mdskill md13.3 KB
examples/01-no-dlq.mdmarkdown2.9 KB
examples/02-dlq-retention-shorter-than-source.mdmarkdown3.3 KB
examples/03-maxreceivecount-too-low.mdmarkdown2.8 KB
examples/04-poison-ages-out-before-dlq.mdmarkdown3.9 KB
examples/05-default-visibility-short-retention.mdmarkdown3.2 KB
examples/06-public-queue-policy.mdmarkdown3.6 KB
examples/07-fifo-dedup-off.mdmarkdown2.8 KB
examples/08-clean-standard.mdmarkdown2.6 KB
fixtures/01-no-dlq/queue.jsonconfig564 B
fixtures/02-dlq-retention-shorter-than-source/dlq.jsonconfig649 B
fixtures/02-dlq-retention-shorter-than-source/queue.jsonconfig632 B
fixtures/03-maxreceivecount-too-low/dlq.jsonconfig659 B
fixtures/03-maxreceivecount-too-low/queue.jsonconfig637 B
fixtures/04-poison-ages-out-before-dlq/dlq.jsonconfig663 B
fixtures/04-poison-ages-out-before-dlq/queue.jsonconfig648 B
fixtures/05-default-visibility-short-retention/dlq.jsonconfig650 B
fixtures/05-default-visibility-short-retention/queue.jsonconfig631 B
fixtures/06-public-queue-policy/dlq.jsonconfig663 B
fixtures/06-public-queue-policy/queue.jsonconfig908 B
fixtures/07-fifo-dedup-off/dlq.jsonconfig748 B
fixtures/07-fifo-dedup-off/queue.jsonconfig804 B
fixtures/08-clean-standard/dlq.jsonconfig672 B
fixtures/08-clean-standard/queue.jsonconfig1.0 KB
tests/README.mdmarkdown4.2 KB
tests/_audit.pyscript21.8 KB
tests/_replay.pyscript720 B
tests/eval/README.mdmarkdown8.4 KB
tests/eval/eval_results.jsonconfig220.4 KB
tests/eval/judge_prompt.mdmarkdown1.4 KB
tests/eval/queues.pyscript7.6 KB
tests/eval/rubric.mdmarkdown2.6 KB
tests/eval/run_eval.pyscript11.5 KB
tests/replay_01_no_dlq.pyscript1.5 KB
tests/replay_02_dlq_retention.pyscript1.5 KB
tests/replay_03_maxreceivecount.pyscript1.3 KB
tests/replay_04_poison_ages_out.pyscript1.6 KB
tests/replay_05_default_visibility.pyscript1.8 KB
tests/replay_06_public_policy.pyscript1.4 KB
tests/replay_07_fifo_dedup_off.pyscript1.4 KB
tests/replay_08_clean_standard.pyscript1.6 KB

examples/05-default-visibility-short-retention.md

View on GitHub
# Worked example 5: default visibility timeout and short retention (R5, R6)

Two soft flags on one queue. Neither is a confirmed message-loss bug from the config alone; both are defaults that are usually accidental rather than chosen, and both defer their final verdict to something behind the boundary. This example exists to show the skill's honesty: it flags without overclaiming. Fixtures and replay test under `../fixtures/05-default-visibility-short-retention/` and `../tests/replay_05_default_visibility.py`.

## Scenario

- **Queue**: `click-events`, with DLQ `click-events-dlq`.
- **Context**: a high-volume analytics ingest queue. Two attributes look like they were never set deliberately.

## Step 1: parse the attributes

```
VisibilityTimeout      30       (the AWS default)
MessageRetentionPeriod 300      (5 minutes)
RedrivePolicy          {"deadLetterTargetArn":"...:click-events-dlq","maxReceiveCount":5}
```

## Step 2: audit the redrive path

DLQ present, `maxReceiveCount=5` in band, DLQ retention (14 days) far exceeds source (5 minutes). No R2, no R3.

## Step 3: audit the message lifecycle

- `VisibilityTimeout=30` is the AWS default. That raises **R5 (low)**. If any consumer takes longer than 30 seconds to process a click event, the message becomes visible again mid-processing and is delivered to a second consumer, causing duplicate work. Whether that actually happens depends on the consumer's processing time, **which is not a queue attribute**. So this is a flag to verify, not a confirmed bug, and it is surfaced as low severity for exactly that reason.
- `MessageRetentionPeriod=300` (5 minutes) raises **R6 (medium)**. Any consumer outage, deploy, or scaling lag longer than 5 minutes silently drops every queued message. For an analytics ingest that may be an acceptable trade (stale clicks are worthless), or it may be an accident. The config flags it; the operator decides.
- R4 does not fire: `5 x 30 = 150s`, under the 300s retention (barely, which is itself worth noting to the operator).

## Steps 4-5: exposure, FIFO

Clean. SSE on, no resource policy, standard queue.

## Findings

| Code | Severity | Attribute | Fix |
|---|---|---|---|
| R6 | medium | `MessageRetentionPeriod` | Raise retention to cover the longest plausible consumer outage, unless dropping stale messages is the intended behaviour. |
| R5 | low | `VisibilityTimeout` | Set the visibility timeout deliberately, above the consumer's p99 processing time, if duplicate delivery matters. |

## Boundary

Both findings defer to something the queue does not contain.

- Whether the 30s visibility timeout is actually too short is the consumer's processing-time distribution, not a queue attribute. Join: queue to its consumers.
- Whether the 5-minute retention actually loses messages is the consumer outage history, a time-series. Join: queue to its metrics over time.

## Why this is the R5 / R6 reference

It demonstrates the skill declining to overclaim. R5 in particular could be written as "visibility timeout too short, messages double-processed", but the skill cannot prove that from the config: it depends on consumer behaviour. Flagging it low and naming the join is the correct, honest move. A skill that asserted a bug here would be wrong as often as it was right.
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall