Repository navigation
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…o v2 sends it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d delta Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
eli-r-ph
force-pushed
the
eli/capture-v1-specs
branch
from
October 27, 2026 16:05
6c6daa2 to
41b4023
Compare
…rors Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…arning result Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
capture,retry-queue,http-clientandevent-batcherspecs still describe the legacy wire (/batch/,api_keyin the body,$libstamped into properties, global defaults overwriting the call,429retried, batches shrunk on413).v1branches, worked out during the ports.Changes
capturegains the capture v1 wire contract: the endpoint, the body envelope, strict field types, the required headers and which ones change on a retry, and the per-eventresultsmap withduplicates_dropped.capturegains per-eventoptions, the hoisting of the four legacy option properties afterbefore_send, and global and context options where an SDK has global and context properties.capturegains the server event-building order: the call wins, context and global values fill only unset keys, SDK values fill last,before_sendhas the final say. This folds in the flag-property rule from docs(capture): place server feature flag properties in the merge order #145.capturegains the rules capture v1 makes observable: blank distinct ids, the$groupidentifyfallback id, timestamps at millisecond precision or finer, per-event serialization,$libowned by the header, fail-open on a missing or personal API key.retry-queuegains the capture v1 status set (404/408/429/500/502/503/504 and network errors retried; 402/413 terminal), four attempts with 100 ms doubling waits and jitter,Retry-Afteras a clamped floor, and no HTTP-library retries. "429 retryable" and "shrink on 413" are marked legacy.http-clientgains bearer auth, the acceptedContent-Encodingvalues, and same-origin 307/308 redirects only.event-batchergains byte-aware check-before-append batching and the end of 413 batch shrinking.migration/yaml-parity-v1mirrors the harness capture v1 suite update (posthog-sdk-test-harness#92): 404, 429 and 502 retry scenarios, and thewarningresult in place oflimited, which capture never sends.capture_v0*harness features are untouched.Note
Three open PRs touch the same ground and need a decision before merge: #145 (folded in here), #140 (requires
nullfor non-finite numbers, while posthog-go v2 drops the event locally; this change records both as allowed), #81 (gzip by default, while the v1 server SDKs default to no compression).How did you test this code?
openspec validate add-capture-v1 --type change --strictpassed before archiving.openspec validate --specs --strict --no-interactiveafter archiving: 67 passed, 0 failed, the same totals asmain.master(rust/capture/src/v1/) and against the four SDKv1branches, including their open pre-release PRs. Sources are listed in the archiveddesign.md.SDK_V2_SPECSpointing at this branch: discovery ready with no missing bindings (160 migrated cases), and the retry and outcome features pass against the harness reference hosts. The harness case-count test needs 157 → 160 when the harness bumps its specs pin.@sdk:server; that needs an end-to-end run against a real adapter.🤖 Agent context
🤖 Generated with Claude Code