Skip to content

ci: cover production PHP transports in compliance profiles - #239

Merged
dustinbyrne merged 3 commits into
mainfrom
ci/sdk-harness-coverage-2026-09-07
Sep 11, 2026
Merged

ci: cover production PHP transports in compliance profiles#239
dustinbyrne merged 3 commits into
mainfrom
ci/sdk-harness-coverage-2026-09-07

Conversation

@dustinbyrne

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

The compliance adapter previously replaced production HTTP/retry handling and supplied capture UUIDs, so passing reports did not establish production transport coverage.

  • Exercise the real LibCurl/HttpClient, Socket and foreground-debug ForkCurl consumers, plus production feature-flag requests. A passive TCP relay observes unchanged bytes; SDK APIs own retries, UUIDs, timestamps, flag values and called-events.
  • Use harness 1.0.0 with distinct profile reports and an independent blocking completeness gate requiring all 30 capture + 17 flags IDs. Assertion failures remain advisory.
  • Preserve SDK capture/flush booleans. Queue length stays unknown where the public SDK cannot expose it; reset isolates owned workers rather than certifying SDK shutdown.

Adapter/test/CI changes only; no shipping SDK API, behavior, defaults or Composer changes. No release intent is needed.

💚 How did you test it?

  • Eight loopback adapter tests, a separate profile-name regression and seven report-checker regressions passed. PHP syntax/style/public-API checks and focused network-safe PHPUnit selections passed.
  • The unchanged pinned Markdown renderer and checker accepted all ten retained complete reports, including reports with failing assertions.
  • Native PHP 8.3 runs with a readiness-controlled mock selected all 47 cases per profile:
Profile Passed Failed
LibCurl 47 0
Socket 36 11
Foreground ForkCurl 36 11

All profiles passed 17/17 flags tests. The 11 alternate-consumer failures expose existing SDK retry/status handling defects documented in the adapter README. Separate raw CLI Socket runs returned 34/47 and 35/47 because of additional setup/readiness failures; these are not classified as expected SDK failures.

Native results predate the report-only follow-ups. Docker/Linux execution and current-head CI artifacts still need verification. Background/fire-and-forget modes, file replay, TLS and optional unsupported protocols are not certified.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with the Pi worker using file-editing, shell, PHP/Python tests, Git and GitHub CLI tools. Fresh read-only agent reviews checked production-path fidelity and the report gate. Human review is required; session transcripts are not publicly linked.

@dustinbyrne dustinbyrne self-assigned this Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

posthog-php-fork_curl Compliance Report

Date: 2026-09-08T15:16:29.188875+00:00
Duration: 112908ms

⚠️ Some Tests Failed

36/47 tests passed, 11 failed


Capture Tests

⚠️ 19/30 tests passed, 11 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 36ms
Format Validation.Event Has Uuid 529ms
Format Validation.Event Has Lib Properties 532ms
Format Validation.Distinct Id Is String 531ms
Format Validation.Token Is Present 532ms
Format Validation.Custom Properties Preserved 531ms
Format Validation.Event Has Timestamp 531ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc 531ms
Retry Behavior.Retries On 503 5535ms
Retry Behavior.Does Not Retry On 400 2535ms
Retry Behavior.Does Not Retry On 401 2534ms
Retry Behavior.Respects Retry After Header 5535ms
Retry Behavior.Implements Backoff 15549ms
Retry Behavior.Retries On 500 5538ms
Retry Behavior.Retries On 502 5538ms
Retry Behavior.Retries On 504 5538ms
Retry Behavior.Max Retries Respected 15544ms
Deduplication.Generates Unique Uuids 542ms
Deduplication.Preserves Uuid On Retry 5535ms
Deduplication.Preserves Uuid And Timestamp On Retry 10543ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5542ms
Deduplication.No Duplicate Events In Batch 538ms
Deduplication.Different Events Have Different Uuids 533ms
Compression.Sends Gzip When Enabled 534ms
Batch Format.Uses Proper Batch Structure 531ms
Batch Format.Flush With No Events Sends Nothing 519ms
Batch Format.Multiple Events Batched Together 522ms
Error Handling.Does Not Retry On 403 2533ms
Error Handling.Does Not Retry On 413 2533ms
Error Handling.Retries On 408 5537ms

Failures

retry_behavior.retries_on_503

Expected at least 3 requests, got 1

retry_behavior.respects_retry_after_header

Expected at least 2 requests, got 1

retry_behavior.implements_backoff

Expected at least 3 requests, got 1

retry_behavior.retries_on_500

Expected at least 2 requests, got 1

retry_behavior.retries_on_502

Expected at least 2 requests, got 1

retry_behavior.retries_on_504

Expected at least 2 requests, got 1

retry_behavior.max_retries_respected

Expected 4 requests, got 1

deduplication.preserves_uuid_on_retry

Need at least 2 requests to check retry

deduplication.preserves_uuid_and_timestamp_on_retry

Expected at least 3 requests, got 1

deduplication.preserves_uuid_and_timestamp_on_batch_retry

Expected at least 2 requests, got 1

error_handling.retries_on_408

Expected at least 2 requests, got 1

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 524ms
Request Payload.Flags Request Uses V2 Query Param 522ms
Request Payload.Flags Request Hits Flags Path Not Decide 523ms
Request Payload.Flags Request Omits Authorization Header 522ms
Request Payload.Token In Flags Body Matches Init 523ms
Request Payload.Groups Round Trip 522ms
Request Payload.Groups Default To Empty Object 523ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 522ms
Request Payload.Disable Geoip Omitted Defaults To False 523ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 522ms
Request Lifecycle.No Flags Request On Init Alone 517ms
Request Lifecycle.No Flags Request On Normal Capture 517ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 526ms
Request Lifecycle.Mock Response Value Is Returned To Caller 523ms
Retry Behavior.Retries Flags On 502 626ms
Retry Behavior.Retries Flags On 504 624ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 533ms

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

posthog-php-lib_curl Compliance Report

Date: 2026-09-08T15:16:56.849225+00:00
Duration: 118587ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 23ms
Format Validation.Event Has Uuid 519ms
Format Validation.Event Has Lib Properties 521ms
Format Validation.Distinct Id Is String 520ms
Format Validation.Token Is Present 521ms
Format Validation.Custom Properties Preserved 520ms
Format Validation.Event Has Timestamp 521ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc 520ms
Retry Behavior.Retries On 503 5829ms
Retry Behavior.Does Not Retry On 400 2524ms
Retry Behavior.Does Not Retry On 401 2524ms
Retry Behavior.Respects Retry After Header 8529ms
Retry Behavior.Implements Backoff 16243ms
Retry Behavior.Retries On 500 5631ms
Retry Behavior.Retries On 502 5629ms
Retry Behavior.Retries On 504 5628ms
Retry Behavior.Max Retries Respected 17045ms
Deduplication.Generates Unique Uuids 225ms
Deduplication.Preserves Uuid On Retry 5629ms
Deduplication.Preserves Uuid And Timestamp On Retry 10836ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5632ms
Deduplication.No Duplicate Events In Batch 525ms
Deduplication.Different Events Have Different Uuids 521ms
Compression.Sends Gzip When Enabled 521ms
Batch Format.Uses Proper Batch Structure 520ms
Batch Format.Flush With No Events Sends Nothing 517ms
Batch Format.Multiple Events Batched Together 511ms
Error Handling.Does Not Retry On 403 2523ms
Error Handling.Does Not Retry On 413 2523ms
Error Handling.Retries On 408 5628ms

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 521ms
Request Payload.Flags Request Uses V2 Query Param 518ms
Request Payload.Flags Request Hits Flags Path Not Decide 519ms
Request Payload.Flags Request Omits Authorization Header 519ms
Request Payload.Token In Flags Body Matches Init 519ms
Request Payload.Groups Round Trip 519ms
Request Payload.Groups Default To Empty Object 519ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 519ms
Request Payload.Disable Geoip Omitted Defaults To False 518ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 519ms
Request Lifecycle.No Flags Request On Init Alone 514ms
Request Lifecycle.No Flags Request On Normal Capture 508ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 521ms
Request Lifecycle.Mock Response Value Is Returned To Caller 520ms
Retry Behavior.Retries Flags On 502 621ms
Retry Behavior.Retries Flags On 504 621ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 520ms

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

posthog-php-socket Compliance Report

Date: 2026-09-08T15:17:17.800170+00:00
Duration: 148438ms

⚠️ Some Tests Failed

36/47 tests passed, 11 failed


Capture Tests

⚠️ 19/30 tests passed, 11 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 31ms
Format Validation.Event Has Uuid 524ms
Format Validation.Event Has Lib Properties 526ms
Format Validation.Distinct Id Is String 528ms
Format Validation.Token Is Present 529ms
Format Validation.Custom Properties Preserved 528ms
Format Validation.Event Has Timestamp 528ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc 526ms
Retry Behavior.Retries On 503 9235ms
Retry Behavior.Does Not Retry On 400 2530ms
Retry Behavior.Does Not Retry On 401 2528ms
Retry Behavior.Respects Retry After Header 9238ms
Retry Behavior.Implements Backoff 19246ms
Retry Behavior.Retries On 500 8745ms
Retry Behavior.Retries On 502 9242ms
Retry Behavior.Retries On 504 9239ms
Retry Behavior.Max Retries Respected 19239ms
Deduplication.Generates Unique Uuids 51ms
Deduplication.Preserves Uuid On Retry 9231ms
Deduplication.Preserves Uuid And Timestamp On Retry 13748ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 9243ms
Deduplication.No Duplicate Events In Batch 536ms
Deduplication.Different Events Have Different Uuids 528ms
Compression.Sends Gzip When Enabled 526ms
Batch Format.Uses Proper Batch Structure 526ms
Batch Format.Flush With No Events Sends Nothing 521ms
Batch Format.Multiple Events Batched Together 515ms
Error Handling.Does Not Retry On 403 2531ms
Error Handling.Does Not Retry On 413 2529ms
Error Handling.Retries On 408 5530ms

Failures

retry_behavior.retries_on_503

Expected at least 3 requests, got 1

retry_behavior.respects_retry_after_header

Expected at least 2 requests, got 1

retry_behavior.implements_backoff

Expected at least 3 requests, got 1

retry_behavior.retries_on_500

Expected at least 2 requests, got 1

retry_behavior.retries_on_502

Expected at least 2 requests, got 1

retry_behavior.retries_on_504

Expected at least 2 requests, got 1

retry_behavior.max_retries_respected

Expected 4 requests, got 1

deduplication.preserves_uuid_on_retry

Need at least 2 requests to check retry

deduplication.preserves_uuid_and_timestamp_on_retry

Expected at least 3 requests, got 1

deduplication.preserves_uuid_and_timestamp_on_batch_retry

Expected at least 2 requests, got 1

error_handling.retries_on_408

Expected at least 2 requests, got 1

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 529ms
Request Payload.Flags Request Uses V2 Query Param 524ms
Request Payload.Flags Request Hits Flags Path Not Decide 524ms
Request Payload.Flags Request Omits Authorization Header 523ms
Request Payload.Token In Flags Body Matches Init 523ms
Request Payload.Groups Round Trip 528ms
Request Payload.Groups Default To Empty Object 523ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 525ms
Request Payload.Disable Geoip Omitted Defaults To False 523ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 525ms
Request Lifecycle.No Flags Request On Init Alone 518ms
Request Lifecycle.No Flags Request On Normal Capture 511ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 533ms
Request Lifecycle.Mock Response Value Is Returned To Caller 525ms
Retry Behavior.Retries Flags On 502 627ms
Retry Behavior.Retries Flags On 504 626ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 529ms

@dustinbyrne

Copy link
Copy Markdown
Contributor Author

Compliance failures and follow-up plan

At 54b1c75bb77a6d18a4397b9ceaf1327a497c2b25, the published harness 1.0.0 reports show LibCurl 47/47, Socket 36/47 and foreground ForkCurl 36/47. All three pass 17/17 flag tests.

The 11 failed capture cases in each alternate consumer are the 500/502/503/504 retry cases, Retry-After, backoff, maximum retries, the three retry UUID/timestamp-preservation cases, and retry on 408. These are manifestations of a few existing SDK defects/capability gaps, not 22 independent adapter failures.

Consumer / cause Classification Plan
Socket's retry loop reconnects without resetting its request write position, so it does not replay the request bytes. This accounts for ten failing cases. SDK bug. Fix request replay in a separate PHP SDK change. Start with a real 503→200 socket regression requiring the complete original request and SDK UUID to be resent, then rerun retry, backoff, budget and UUID/timestamp cases.
Socket treats 408 as terminal and does not implement the expected Retry-After behavior. SDK policy/capability gap. Specify the required retryable statuses and header handling, then implement/test them in the SDK consumer. Repairing byte replay alone must not be treated as proof of Retry-After compliance.
Foreground/debug ForkCurl has no automatic HTTP-status retry loop and can treat a successful curl process exit as success despite HTTP rejection. SDK behavior gap. Address HTTP-status success detection and the agreed retry/backoff/budget behavior in a separate SDK change. Validate real curl traffic, terminal failures and event identity across retries.

The adapter should continue to expose each real consumer's result, not retry on its behalf or substitute LibCurl. After the SDK fixes, rerun all three complete profiles and retain any remaining failures.

This PR is being put up for review as production-consumer coverage. The ForkCurl result is specifically foreground/debug evidence, not a guarantee of default background completion. Exact failed IDs and runtime/observation boundaries. Successful inventory/workflow checks do not turn these assertions green.

@dustinbyrne
dustinbyrne marked this pull request as ready for review September 11, 2026 18:34
@dustinbyrne
dustinbyrne requested a review from a team as a code owner September 11, 2026 18:34
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "ci: require complete PHP compliance repo..." | Re-trigger Greptile

@dustinbyrne
dustinbyrne merged commit a927790 into main Sep 11, 2026
29 checks passed
@dustinbyrne
dustinbyrne deleted the ci/sdk-harness-coverage-2026-09-07 branch September 11, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants