← Back to Pull requests

docs(reference): operation correlation matches exact request text, and refuses an invalid ID #1828

Closed
unknown closed this pull request without merging on Oct 23, 2026 10:28 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 09:45 UTC
Author

What a user gets

A client using X-OpenRig-Operation-Id learns two facts that change how it retries:

  • Exact text: a retry must resend the exact request text. Reformatted or reordered JSON counts as a different request and gets 409.

  • ID format: an ID that isn't a UUID gets 400.
  • The change

    docs/reference/operation-correlation.md, two sentences, read from the source at 2fc23521:

  • Matching compares the exact request text. reserveOperation hashes the raw body: each route passes c.req.text(), and import's two behaviour headers are hashed with it. So a whitespace or key-order change is a different request, not an equivalent one.

  • An invalid ID gets HTTP 400 Invalid X-OpenRig-Operation-Id. validOperationId accepts an RFC UUID, and each of the three routes checks it first. Host read-through middleware can still answer before the route. The existing 409 sentence now says it applies once a request passes the route's own validation.
  • Cost: +1/−1 (one paragraph line, numstat).

    How you verified it

    Read at source on all three routes: routes/rigs.ts (create and member add) and routes/rigspec.ts (import). Text only, so no tests.

  • One concern per PR; no version bump; no CHANGELOG.md edit

  • Tests added or updated where the change is testable

  • I listed the checks I ran, their results, and any checks I could not run
  • Refs #1790

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Documentation
    Clarified that operation IDs must be UUIDs and are case-normalized; malformed IDs return HTTP 400 before route handling.
    Documented that an ID conflict returns HTTP 409 only after the request passes route validation.
    Specified that request matching uses exact request text, so changes to whitespace or key order count as different requests. Exact replays return HTTP 200 with the current database state.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 264 lines (+198 / -66) across 3 files Reviewer: mvschwarz Review duration: 42m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 264 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1828"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.3% (MEDIUM) · Higher = larger blast radius
    39.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.5% · Safe to merge
    15.5%