Skip to content

feat(match): add spanId and correlationId to VOLATILE_KEYS - #36

Merged
protosphinx merged 1 commit into
mainfrom
bot/volatile-span-correlation
Sep 1, 2026
Merged

protosphinx merged 1 commit into
mainfrom
bot/volatile-span-correlation

Conversation

@protosphinx

Copy link
Copy Markdown
Member

Why

spanId and correlationId are per-request observability/tracing IDs that change on every call, just like requestId and traceId (which are already in VOLATILE_KEYS). Without this fix, two otherwise-identical requests differing only in spanId or correlationId fall through normalizedMatch and must be caught by the fuzzyMatch tier, even though fuzzy does normalize them via ID_KEY. Promoting these two keys one tier earlier is purely a correctness improvement: replay becomes more lenient at the right tier, and the match chain is shorter for the common case.

What

  • Add "spanId" and "correlationId" to VOLATILE_KEYS in src/match.ts.
  • No logic changes anywhere else; stripVolatile picks up the new keys automatically.

Tests

  • Four new test cases in test/match.volatile.test.ts:
    • spanId alone: exactMatch returns false, normalizedMatch returns true.
    • correlationId alone: same pattern.
    • Both combined with traceId and requestId: all stripped together.
    • Near-miss keys span and correlation (not in the Set): normalizedMatch correctly returns false.

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (41 lines added, 30 removed in lockfile cleanup)
  • no public-API surface change (src/index.ts not modified)
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended (4 new test cases in test/match.volatile.test.ts)

Generated by Claude Code

Both spanId and correlationId are observability/tracing IDs generated
per-request. The fuzzy match tier already normalized them via ID_KEY,
but normalizedMatch (one tier earlier) did not strip them, so two
requests differing only in spanId or correlationId would fall through
to the fuzzy tier unnecessarily.

Adding them to VOLATILE_KEYS makes normalizedMatch consistent with the
existing treatment of requestId and traceId.

Four new test cases cover: spanId alone, correlationId alone, both
keys combined with other volatile keys, and near-miss keys ('span',
'correlation') that must NOT be stripped.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T16:13:19.357708Z c250512 PR opened
ℹ️ 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.

@protosphinx protosphinx added the automated Opened by the daily bot label Sep 1, 2026 — with Claude
@protosphinx
protosphinx merged commit dc2b959 into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant