feat: enrich Segment events with starter context from config#1772
Merged
feat: enrich Segment events with starter context from config#1772
Conversation
Persist the `starter` field in slicemachine.config.json during init when `--starter` is used, and auto-enrich all Segment events with it in TelemetryManager.track(). This lets us track migration funnel progression (e.g. changes:pushed) for projects originating from the agentic-migration-starter. Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Combine the starter and repositoryName resolution into a single getSliceMachineConfig() call, and only attempt it when repositoryName is not already provided by the caller. This avoids an additional async file traversal in the init error path, which was causing timing-sensitive tests to fail. Made-with: Cursor
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.
Summary
starterfield toSliceMachineConfig(types + io-ts codecs in both@slicemachine/managerand@slicemachine/plugin-kit) so it persists through config decode/write cycles.startervalue intoslicemachine.config.jsonduring@slicemachine/initwhen the--starterflag is provided.TelemetryManager.track()with thestarterproperty read from config — no individual event call-sites need changing.This lets us build an Amplitude funnel (init → models pushed) filtered by
starterto measure how many agentic-migration-starter users actually complete a migration, not just initialize.Context
Builds on #1771 which added the
--starterflag to@slicemachine/init. That PR only tracked the starter name duringcommand:init:end. This PR ensures the value is available on every Segment event (especiallychanges:pushed) for the lifetime of the project.Test plan
npx @slicemachine/init --starter agentic-migrationon a fresh project and verifyslicemachine.config.jsoncontains"starter": "agentic-migration".npx @slicemachine/init(no--starter) and verify the config does not contain astarterfield.changes:pushedSegment event payload includes thestarterproperty.starterin config, verify events still fire normally withstarter: undefined.Note
Low Risk
Low risk: adds an optional
starterfield to config schemas/types and enriches telemetry payloads without changing core project logic or write paths beyond config serialization.Overview
Persists an optional
starteridentifier inSliceMachineConfigacross@slicemachine/managerand@slicemachine/plugin-kit(types + io-ts decoders) so it survives config decode/write cycles.Updates
@slicemachine/initto writestarterintoslicemachine.config.jsonwhen--starteris provided, and updatesTelemetryManager.track()to readstarterfrom the config (when repository isn’t explicitly passed) and include it on every Segment event payload.Written by Cursor Bugbot for commit ef07d93. This will update automatically on new commits. Configure here.