Skip to content

docs: exempt maintainers from the public API issue-first rule - #976

Merged
turnipdabeets merged 1 commit into
mainfrom
docs/public-api-maintainer-exemption
Sep 21, 2026
Merged

turnipdabeets merged 1 commit into
mainfrom
docs/public-api-maintainer-exemption

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

Problem

Port of PostHog/posthog-js#5044.

The "Public API changes" section in CONTRIBUTING.md and the matching line in AGENTS.md say the API shape must be agreed on an issue first. Nothing in either file exempts maintainers. So when a Client Libraries maintainer's agent changes public API in their own PR, it doesn't find an agreed issue and opens one. We end up closing duplicate issues and paying for the turns and tokens. For the team, the PR is where we discuss API shape.

Changes

  • CONTRIBUTING.md: says the issue-first rule is for external contributors, and adds a path for contributors who already have a PR open. They call out the public API change at the top of the PR description and link or open an issue to discuss it, instead of stopping.
  • AGENTS.md: agents skip the issue when the author is a PostHog maintainer (git email ends in @posthog.com). For contributors, agents stop and ask, or draft an issue body for the user to post. Agents never open an issue on their own.
  • Removed the separate "AI agents: stop and ask" bullet from CONTRIBUTING.md, because AGENTS.md now covers it.

Testing

Docs only. Same wording as posthog-js#5044, which was reviewed and approved.

🤖 Generated with Claude Code

@turnipdabeets
turnipdabeets requested a review from a team as a code owner September 21, 2026 14:36
@turnipdabeets turnipdabeets self-assigned this Sep 21, 2026
@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Retrigger

The policy should not merge until maintainer identity and public API detection are expressed using reliable signals.

Reviews (1) · Last reviewed commit: "docs: exempt maintainers from the public..."

Comment thread AGENTS.md
- The main runtime package is `posthog/`; tests live under `posthog/test/`.
- The project uses `uv` for local development. See `CONTRIBUTING.md` for setup.
- Before adding or changing public API, follow "Public API changes" in [CONTRIBUTING.md](./CONTRIBUTING.md): the API shape must be agreed on the issue first. For SDK design guidance, read https://posthog.com/handbook/engineering/sdks/guidelines.md.
- Public API changes (a diff in `references/public_api_snapshot.txt`): if the author is a PostHog maintainer (git email ends in `@posthog.com`), the PR is the discussion, so don't open or suggest an issue. Otherwise, follow "Public API changes" in [CONTRIBUTING.md](./CONTRIBUTING.md): if there's no agreed issue, stop and tell the user. If a PR already exists, add a public-API note to its description and draft an issue body for the user to post. Never open an issue yourself. For SDK design guidance, read https://posthog.com/handbook/engineering/sdks/guidelines.md.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unreliable maintainer identification

The exemption treats an author as a maintainer when their git email ends in @posthog.com, but Client Libraries maintainers commonly use GitHub noreply or personal addresses, while git email is locally configurable. This can send maintainers through the external-contributor workflow and let non-maintainers bypass it. Use authenticated GitHub team membership or explicit PR metadata instead.

Prompt To Fix With AI
This is a comment left during a code review.
Path: AGENTS.md
Line: 10

Comment:
**Unreliable maintainer identification**

The exemption treats an author as a maintainer when their git email ends in `@posthog.com`, but Client Libraries maintainers commonly use GitHub noreply or personal addresses, while git email is locally configurable. This can send maintainers through the external-contributor workflow and let non-maintainers bypass it. Use authenticated GitHub team membership or explicit PR metadata instead.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread AGENTS.md
- The main runtime package is `posthog/`; tests live under `posthog/test/`.
- The project uses `uv` for local development. See `CONTRIBUTING.md` for setup.
- Before adding or changing public API, follow "Public API changes" in [CONTRIBUTING.md](./CONTRIBUTING.md): the API shape must be agreed on the issue first. For SDK design guidance, read https://posthog.com/handbook/engineering/sdks/guidelines.md.
- Public API changes (a diff in `references/public_api_snapshot.txt`): if the author is a PostHog maintainer (git email ends in `@posthog.com`), the PR is the discussion, so don't open or suggest an issue. Otherwise, follow "Public API changes" in [CONTRIBUTING.md](./CONTRIBUTING.md): if there's no agreed issue, stop and tell the user. If a PR already exists, add a public-API note to its description and draft an issue body for the user to post. Never open an issue yourself. For SDK design guidance, read https://posthog.com/handbook/engineering/sdks/guidelines.md.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Snapshot trigger misses changes

Defining a public API change as a diff in the snapshot misses source changes until that file is explicitly regenerated. An agent can add or change an exported option, method, or type, see no snapshot diff, and skip this policy until CI reports the stale snapshot. Define the trigger as changing public API in source and describe the snapshot diff only as a detection signal.

Prompt To Fix With AI
This is a comment left during a code review.
Path: AGENTS.md
Line: 10

Comment:
**Snapshot trigger misses changes**

Defining a public API change as a diff in the snapshot misses source changes until that file is explicitly regenerated. An agent can add or change an exported option, method, or type, see no snapshot diff, and skip this policy until CI reports the stale snapshot. Define the trigger as changing public API in source and describe the snapshot diff only as a detection signal.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

posthog-python Compliance Report

Date: 2026-09-21 14:41:10 UTC
Duration: 256223ms

✅ All Tests Passed!

111/111 tests passed


Capture_V1 Tests

94/94 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint 516ms
Endpoint And Method.Does Not Use Legacy Endpoints 508ms
Required Headers.Has Authorization Bearer Header 511ms
Required Headers.Has Content Type Json 510ms
Required Headers.Has Posthog Sdk Info Format 508ms
Required Headers.Has Posthog Attempt Header 509ms
Required Headers.Has Posthog Request Id 509ms
Required Headers.Has Posthog Request Timestamp 508ms
Required Headers.Has User Agent 509ms
Body Format.Body Has Created At And Batch 509ms
Body Format.No Api Key In Body 508ms
Body Format.No Sent At In Body 509ms
Event Format.Event Has Required Root Fields 508ms
Event Format.Event Uuid Is Valid 509ms
Event Format.Event Timestamp Is Rfc3339 509ms
Event Format.Distinct Id Is String 508ms
Event Format.Distinct Id At Root Not Properties 509ms
Event Format.Custom Properties Preserved 508ms
Event Format.Set Properties Preserved 508ms
Event Format.Set Once Properties Preserved 509ms
Event Format.Groups Properties Preserved 509ms
Event Format.Sdk Generates Uuid If Not Provided 508ms
Event Format.Event Has Required Root Fields Batch 512ms
Event Format.Event Uuid Is Valid Batch 512ms
Event Format.Event Timestamp Is Rfc3339 Batch 512ms
Event Format.Distinct Id Is String Batch 512ms
Event Format.Distinct Id At Root Not Properties Batch 513ms
Event Format.Custom Properties Preserved Batch 512ms
Event Format.Set Properties Preserved Batch 512ms
Event Format.Set Once Properties Preserved Batch 513ms
Event Format.Groups Properties Preserved Batch 511ms
Event Format.Sdk Generates Uuid If Not Provided Batch 512ms
Batch Behavior.Multiple Events In Single Batch 516ms
Batch Behavior.Batch Envelope Smoke 514ms
Batch Behavior.Flush With No Events Sends Nothing 505ms
Batch Behavior.Flush At Triggers Batch 1010ms
Batch Behavior.Created At Reflects Batch Creation Time 510ms
Deduplication.Generates Unique Uuids 515ms
Deduplication.Different Events Same Content Different Uuids 511ms
Deduplication.Preserves Uuid On Retry 6514ms
Deduplication.Preserves Timestamp On Retry 6514ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 6518ms
Deduplication.No Duplicate Events In Batch 517ms
Header Behavior On Retry.Attempt Header Starts At One 509ms
Header Behavior On Retry.Attempt Header Increments On Retry 13521ms
Header Behavior On Retry.Request Id Preserved On Retry 6518ms
Header Behavior On Retry.Different Requests Have Different Request Ids 3017ms
Header Behavior On Retry.Request Timestamp Changes On Retry 6517ms
Response Format Validation.Success Response Has Uuid Keyed Results 510ms
Response Format Validation.Success Response Has Ok For Each Event 513ms
Response Format Validation.Success No Retry After When All Ok 511ms
Response Format Validation.Success Retry After Present When Retry Events 1513ms
Response Format Validation.Success No Retry After When Drop Only 512ms
Response Format Validation.Response Echoes Request Id 508ms
Retry Behavior.Retries On 408 6513ms
Retry Behavior.Retries On 500 6517ms
Retry Behavior.Retries On 503 8519ms
Retry Behavior.Retries On 504 6518ms
Retry Behavior.Retryable Errors Have Retry After 3514ms
Retry Behavior.Respects Retry After On Retryable Error 11518ms
Retry Behavior.Does Not Retry On 400 2513ms
Retry Behavior.Does Not Retry On 401 2512ms
Retry Behavior.Does Not Retry On 402 2511ms
Retry Behavior.Does Not Retry On 413 2511ms
Retry Behavior.Does Not Retry On 415 2513ms
Retry Behavior.Non Retryable Errors Have No Retry After 2511ms
Retry Behavior.Implements Backoff 22520ms
Retry Behavior.Max Retries Respected 22528ms
Partial Batch Handling.Handles 200 Full Success 2512ms
Partial Batch Handling.Handles 200 With All Ok 3516ms
Partial Batch Handling.Does Not Retry Dropped Events 3512ms
Partial Batch Handling.Does Not Retry Limited Events 3514ms
Partial Batch Handling.Prunes Ok Events On Partial Retry 6516ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry 6520ms
Partial Batch Handling.Retries Only Retry Events From Partial 6521ms
Partial Batch Handling.Partial Retry Preserves Uuids 6516ms
Partial Batch Handling.Partial Retry Attempt Header Increments 6515ms
Partial Batch Handling.Partial Retry Request Id Preserved 6517ms
Partial Batch Handling.Respects Retry After On Partial 8519ms
Partial Batch Handling.Unknown Result Treated As Terminal 3515ms
Partial Batch Handling.Mixed Ok Drop Limited No Retry 3519ms
Compression.Sends Gzip Content Encoding 510ms
Compression.No Content Encoding When Disabled 509ms
Compression.Compressed Body Is Decompressible 508ms
Error Handling.Does Not Retry On Unknown 4Xx 2512ms
Event Options.Cookieless Mode Override 509ms
Event Options.Disable Skew Correction Override 508ms
Event Options.Process Person Profile Override 509ms
Event Options.Product Tour Id Override 508ms
Event Options.Unset Options Omitted 508ms
Event Options.Options Override In Batch 513ms
Geoip And Historical Migration.Geoip Disable Injected Into Properties 509ms
Geoip And Historical Migration.Historical Migration Set In Body 508ms
Geoip And Historical Migration.Historical Migration Absent By Default 509ms

Feature_Flags Tests

17/17 tests passed

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

@turnipdabeets
turnipdabeets enabled auto-merge (squash) September 21, 2026 14:39

@dustinbyrne dustinbyrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The maintainer exemption looks good. One non-blocking clarification about identifying maintainers.

AI-assisted review: source inspection and existing CI; no new tests executed.

Comment thread AGENTS.md
- The main runtime package is `posthog/`; tests live under `posthog/test/`.
- The project uses `uv` for local development. See `CONTRIBUTING.md` for setup.
- Before adding or changing public API, follow "Public API changes" in [CONTRIBUTING.md](./CONTRIBUTING.md): the API shape must be agreed on the issue first. For SDK design guidance, read https://posthog.com/handbook/engineering/sdks/guidelines.md.
- Public API changes (a diff in `references/public_api_snapshot.txt`): if the author is a PostHog maintainer (git email ends in `@posthog.com`), the PR is the discussion, so don't open or suggest an issue. Otherwise, follow "Public API changes" in [CONTRIBUTING.md](./CONTRIBUTING.md): if there's no agreed issue, stop and tell the user. If a PR already exists, add a public-API note to its description and draft an issue body for the user to post. Never open an issue yourself. For SDK design guidance, read https://posthog.com/handbook/engineering/sdks/guidelines.md.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor (non-blocking): Could we treat @posthog.com as one signal of maintainer status rather than the exclusive test? A confirmed Client Libraries maintainer can use a GitHub noreply address, which sends them through the external-contributor issue-first flow despite the exemption in CONTRIBUTING.md. Consider accepting independently confirmed maintainer identity too.

@turnipdabeets
turnipdabeets merged commit 473fa39 into main Sep 21, 2026
43 checks passed
@turnipdabeets
turnipdabeets deleted the docs/public-api-maintainer-exemption branch September 21, 2026 21:05
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