Repository navigation
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a wizard branch:
Add Results will be posted here when complete. |
commandments.yaml gains <tag>@legacy and <tag>@v1 keys; the generator adds them to a variant's rules by its capture_mode, reading no mode as legacy. The SDK install rules for python, go, rust, swift, ios and flutter now defer to the exact command detect_package_manager returns, and the mode-specific facts from the migration guides (module paths, options arguments, capture_ai, TLS features, SPM-only iOS, deployment targets) sit under the mode keys. The install and review agents run the tool's pinned command for an allowlisted SDK and never move its major. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cb0c0ba to
ed99b18
Compare
…the v1 majors Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| - "`capture`, `screen`, `identify`, `setPersonProperties`, `alias`, `group`, `captureException` and `captureAi` take an `options` argument as their last parameter for per-event controls such as `process_person_profile` (snake_case key). There are no global options: to turn person processing off for every event, `register([\"$process_person_profile\": false])`, which becomes the option at send time" | ||
| - "Send `$ai_*` events with `captureAi`, never with `capture`; the `$ai_` prefix is reserved for them" | ||
| - "On 4.0 a value set on the call beats a registered value, and a `setBeforeSend` hook must pass the event's options through unchanged" | ||
| react-native: |
There was a problem hiding this comment.
[question] React Native has no @v1 rules here. Is that deliberate, or should it get a block like the other mobile SDKs?
| - Capture screen views by adding `PosthogObserver()` to the app's `navigatorObservers`, whatever routing package the app uses; where its routes are unnamed, name them so `$screen` is readable | ||
| - Call `Posthog().identify(...)` after login and `Posthog().reset()` on logout; keep PII in user properties, not event properties | ||
| - Use `beforeSend` to redact or drop Dart-captured events, but remember it does not intercept native session replay, lifecycle, or system properties | ||
| - "For iOS, ensure the minimum deployment target is at least the floor the installed major needs: iOS `13.0` on posthog_flutter 5.x, iOS `15.0` (and macOS `11.0`) on 6.x. If the current `platform :ios` value is lower than that floor or missing, update or add it; if it is already at or above it, leave it unchanged" |
There was a problem hiding this comment.
[nit] #479 rewrites the Flutter beforeSend rule right above this line, so whichever lands second will need a small rebase.
| @@ -322,6 +359,10 @@ commandments: | |||
| - Initialize PostHog in the Application class's `onCreate()` method | |||
| - Ensure every activity has a `android:label` to accurately track screen views. | |||
There was a problem hiding this comment.
[suggestion] Base android: has no rule for staying on the installed major (3.+/4.+), unlike iOS and Flutter. Could we add one so a 3.x app doesn't get bumped to 4.0?
| - Initialize PostHog in the Application class's `onCreate()` method | ||
| - Ensure every activity has a `android:label` to accurately track screen views. | ||
|
|
||
| android@v1: |
There was a problem hiding this comment.
[question] android@v1, ios@v1 and flutter@v1 only reach variants tagged capture_mode: v1, and no mobile variant in integration/config.yaml is tagged, so these rules never apply. Are we adding v1 mobile variants here or in a follow-up?
| android@v1: | ||
| - "`capture`, `screen`, `identify`, `setPersonProperties`, `alias`, `group`, `captureException` and `captureAi` take an options argument as their last parameter for per-event controls such as `process_person_profile` (snake_case key). There are no global options: to turn person processing off for every event, `register(\"$process_person_profile\", false)`, which becomes the option at send time" | ||
| - "Send `$ai_*` events with `captureAi`, never with `capture`; the `$ai_` prefix is reserved for them" | ||
| - "On 4.0 a value set on the call beats a registered value, and a `beforeSend` hook must pass the event's options through unchanged" |
There was a problem hiding this comment.
[suggestion] Could we also cover the other 4.0 breaks agents will hit: apiKey is gone (use projectToken), PostHogConfig.onFeatureFlags moved to the PostHog.onFeatureFlags { } listener, and session replay is screenshot-only?
| - "On 4.0 a value set on the call beats a registered value, and a `beforeSend` hook must pass the event's options through unchanged" | ||
| kmp: | ||
| - com.posthog:posthog-kmp is the Kotlin Multiplatform SDK package name; add it to the shared module's commonMain.dependencies in build.gradle.kts, not to androidMain, iosMain, or any platform-specific source set | ||
| - All PostHog APIs live in the com.posthog.kmp package — import com.posthog.kmp.PostHog, com.posthog.kmp.PostHogConfig, and com.posthog.kmp.PostHogContext |
There was a problem hiding this comment.
[question] KMP has no @v1 rules either, and the base KMP rule still says to check the latest posthog-kmp on Maven Central, which goes against the "don't look up the latest" approach elsewhere in this PR. Should it stay on the installed version too?
|
👋 noting for posterity: wizard team decided to implement version-aware context another way after these were drafted. this and the corresponding wizard repo series won't be shipping; I was asked to leave them open as a reference for wizard team, they will close them out when their implementation is done 👍 |
|
Closing this stack. The design comes back after the agent DAG refactor, where the wizard picks each SDK's major, and the skills written for it, from project traits and context-mill tags. The branch stays. |
Problem
Several framework rules and the install agent tell the agent to install a PostHog SDK by bare name, the Swift rule tells it to look up the latest release, and the review agent may step a major down. Each of those moves a project off the major line the wizard set it up for. The rules also cannot differ between the legacy and v1 majors, which disagree on module paths, options arguments, AI capture methods, TLS features and deployment targets.
Stacked on #453.
Changes
<tag>@v1key incommandments.yamlholds the rules for the capture v1 majors; a variant gets them only when it declarescapture_mode: v1. An untagged variant is mode-neutral and carries the base rules alone, so a skill that serves both modes never contradicts the integration skill beside it.captureExceptionobject form, theregisterfallback on iOS and Android, the personless-option warning, the AI capture method on every SDK, module paths, TLS features and deployment targets.$ai_*events through the AI capture method on the new majors.Test plan
Tests for the mode rules, that no legacy-only key exists, that every v1 key has a base tag some variant carries, and that no rule spells an option key in camelCase.
pnpm test.LLM context
Written with Claude Code (Claude Fable 5.1). An SDK owner should still read their
@v1block against the final guide before that SDK's flip.🤖 Generated with Claude Code