Skip to content

feat: enrich Segment events with starter context from config#1772

Merged
levimykel merged 2 commits intomainfrom
lg/starter-tracking-enrichment
Apr 1, 2026
Merged

feat: enrich Segment events with starter context from config#1772
levimykel merged 2 commits intomainfrom
lg/starter-tracking-enrichment

Conversation

@levimykel
Copy link
Copy Markdown
Contributor

@levimykel levimykel commented Apr 1, 2026

Summary

  • Adds an optional starter field to SliceMachineConfig (types + io-ts codecs in both @slicemachine/manager and @slicemachine/plugin-kit) so it persists through config decode/write cycles.
  • Writes the starter value into slicemachine.config.json during @slicemachine/init when the --starter flag is provided.
  • Auto-enriches all outgoing Segment events in TelemetryManager.track() with the starter property read from config — no individual event call-sites need changing.

This lets us build an Amplitude funnel (init → models pushed) filtered by starter to measure how many agentic-migration-starter users actually complete a migration, not just initialize.

Context

Builds on #1771 which added the --starter flag to @slicemachine/init. That PR only tracked the starter name during command:init:end. This PR ensures the value is available on every Segment event (especially changes:pushed) for the lifetime of the project.

Test plan

  • Run npx @slicemachine/init --starter agentic-migration on a fresh project and verify slicemachine.config.json contains "starter": "agentic-migration".
  • Run npx @slicemachine/init (no --starter) and verify the config does not contain a starter field.
  • Start Slice Machine and push changes — verify the changes:pushed Segment event payload includes the starter property.
  • For a project without starter in config, verify events still fire normally with starter: undefined.

Note

Low Risk
Low risk: adds an optional starter field to config schemas/types and enriches telemetry payloads without changing core project logic or write paths beyond config serialization.

Overview
Persists an optional starter identifier in SliceMachineConfig across @slicemachine/manager and @slicemachine/plugin-kit (types + io-ts decoders) so it survives config decode/write cycles.

Updates @slicemachine/init to write starter into slicemachine.config.json when --starter is provided, and updates TelemetryManager.track() to read starter from 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.

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
@levimykel levimykel requested a review from a team as a code owner April 1, 2026 11:52
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
slice-machine Ready Ready Preview Apr 1, 2026 1:51pm

Request Review

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
Copy link
Copy Markdown
Collaborator

@jomifepe jomifepe left a comment

Choose a reason for hiding this comment

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

LGTM!

@levimykel levimykel merged commit df063e3 into main Apr 1, 2026
34 checks passed
@levimykel levimykel deleted the lg/starter-tracking-enrichment branch April 1, 2026 14:56
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