Repository navigation
feat(install): carry campaign attribution through setup - #638
Conversation
|
Live verification before this PR:
This PR adds the missing marker to the maintained guide source, carries the installer flag into the existing installation identity, and includes the Worker route/config. After merge and the next candidate/stable guide publication, deploy the test Worker, verify injection, then enable the production route. |
|
Heads-up: PR #263 is also open for the same campaign-linked install attribution work, with overlapping installer, tracking, Worker, and regression-test files. Since both PRs are from the same contributor, would you like to consolidate them into one current branch? The maintainer team can then review a single integration result. |
|
Fixed in |
|
Follow-up |
qd1993102
left a comment
There was a problem hiding this comment.
Attribution plumbing is coherent end to end: the Worker marker gate, --utm-source parsing, identity update and sender fields line up, and the new Worker/installer tests pass plus a manual transform of docs/install.md produces the expected four command rows. Three fixes are worth making before this data is relied on: where the installation events are emitted in the setup sequence, coverage of the public /motion/install.md mapping, and the tracking contract docs that still describe this work as unimplemented.
🔁 Powered by Looper · runner=reviewer · agent=omp · An autonomous AI dev team for your GitHub repos.
qd1993102
left a comment
There was a problem hiding this comment.
@app/open-design-crew
Thanks for the careful follow-up here — moving recordInstallationStart ahead of plan.register() is the right shape for the funnel: a failed host registration now still reports the attributed start, while installation_result stays tied to registration success.
Repair-frontier verification for 232c9fd8..2990d275:
- The installer reorder is the only change since the previously reviewed head.
saveInstallationSourceruns beforecreateAppTracking, so thesourcegetter inshared/tracking.tssees the explicit--utm-sourceon both events.- Attribution failures remain non-fatal: each dynamic import/tracking block is caught independently and registration proceeds.
npm run check,tests/install-attribution-worker.test.ts, and the fulltests/npm-installer.test.tssuite pass, including the explicit-source/untagged-upgrade test.
Appreciate the focused fix and the clear end-to-end write-up in docs/install-attribution.md — this reads well.
🔁 Powered by Looper · runner=reviewer · agent=omp · An autonomous AI dev team for your GitHub repos.
qd1993102
left a comment
There was a problem hiding this comment.
@app/open-design-crew Reviewed the repair delta from 232c9fd to 2990d27. Moving recordInstallationStart ahead of plan.register() closes the ordering gap: attribution is persisted before any host-started MCP event can create or read the installation identity, and the untagged-upgrade preservation test still passes. I also re-ran the attribution Worker test and the full npm-installer test file locally; both are green, and the two earlier fix commits address the release-link and event-ordering feedback.
One deployment-config issue is attached inline: the new Worker's Wrangler account id is truncated, so the documented deploy command cannot resolve the account. The rest of the repair frontier looks addressed.
🔁 Powered by Looper · runner=reviewer · agent=omp · An autonomous AI dev team for your GitHub repos.
qd1993102
left a comment
There was a problem hiding this comment.
One blocking packaging regression in the new early installation_started path; the inline comment carries the detail. The Worker host mapping and the corrected 32-character account id check out, and the moved installation_result now waits for onboarding persistence and public Skill installation as documented. The prior target areas are addressed: start no longer waits for host registration and the account id is complete.
🔁 Powered by Looper · runner=reviewer · agent=omp · An autonomous AI dev team for your GitHub repos.
qd1993102
left a comment
There was a problem hiding this comment.
@app/open-design-crew
Repair-frontier review at 70cc62f: the delta since c9af9e6 is limited to scripts/npm-installer.mjs, and it resolves the remaining gap in the attribution path.
What changed: attribution is now loaded from the extracted application root (appRoot/shared/install-attribution.ts) after the .npm-install.json identity checks, instead of resolving ../shared/install-attribution.ts against the published installer package, which only ships scripts/. The single imported module is reused for the closing recordInstallation call, so start and result events share one implementation.
Verification I ran:
node --experimental-strip-types --test tests/npm-installer.test.ts— 43 pass, includingsetup records an explicit attribution source and preserves it on untagged upgrades(source saved, untagged upgrade preserves it, explicit new source updates onlyutm_sourceand keepsinstallation_id).node --experimental-strip-types --test tests/install-attribution-worker.test.ts— 2 pass.- Packaging check by inspection:
scripts/distribution.tsincludesshared/install-attribution.tsexplicitly and walksshared/plus the explicittracking/*.tsentries, so the app-root import resolves in package-built installs while the installer tarball does not need to carry it.
The fixture also now copies the real attribution/tracking modules into the fake application, so the test exercises the installed layout rather than the source checkout. Small, well-shaped fix with coverage that matches the bug — thanks for the careful follow-through. CI on this head is green.
🔁 Powered by Looper · runner=reviewer · agent=omp · An autonomous AI dev team for your GitHub repos.
Why
ProductHunt and other campaign links currently lose their source before a user reaches the OpenMotion installer. The existing landing attribution can preserve a visit locally, but the current OpenMotion main branch has no supported installer parameter or guide Worker to carry that source into the installed runtime.
This adds a small, opt-in attribution path that keeps untagged installs and upgrades unchanged while allowing campaign cohorts to be measured through the existing installation identity.
What changed
workers/install-guide/that reads the stable or DEV guide from the existing R2 bucket and injects a validated--utm-sourceonly into supported setup commands when the guide marker is present.--utm-sourceto the npm installer. Explicit installs update only the saved source; untagged upgrades retain the existing source and installation ID.utm_sourceandod_utm_sourceon subsequent OpenMotion events, and record installer start and successful installer events with a bounded host category.Validation
npm run checknpm run typecheck:backendinstallation_startedandinstallation_resultattribution passedgit diff --checkThe Worker is not deployed by this PR. The checked-in Wrangler route enables the existing test host first; the production host should be added after the stable guide contains the marker and the test URL is verified.
Surface area
Review follow-up
?utm_source=producthunt.