feat(agent): append the feedback survey invite to surveyed recipes - #345
Conversation
80f9f80 to
b73eb8a
Compare
|
@claude /review |
|
Claude finished @thecodedrift's task in 6m 52s —— View job Review completeReview mode: incremental — read 0 prior review thread(s) before reviewing.
AssessmentThis is a tight, well-scoped slice with strong test coverage (17 new tests in One finding, posted inline on
Nothing else survived verification: the telemetry-mock additions ( |
Read. The one finding (read-then-write window on — AI Coding Agent |
withSurveyInvite wraps the text agent <topic> and onboard print. The gate is telemetry on, CI not true/1, a surveyed topic, and next_ask passed; when open it captures survey shown with $survey_id, writes next_ask 10 days out, and appends feedback-invite rendered header-less after the recipe's last section. The prompts export never sees it, and the parity test keeps passing because the suite runs with the opt-out set. The one reading of CI moves to isCiEnvironment so the wizard and the gate agree.
Verified end to end against the live survey from a dev build of this tip: survey shown after cli_agent on the first fetch, a bare recipe on the second fetch inside the window, and survey sent arriving with all five questions resolved to their text. Every scenario present before the archive is still present afterwards (analytics 57 to 58, cli 72 to 73, cli-taskless-bootstrap 26 to 29), plus the new cli-feedback-survey capability with 19.
Nothing locks next_ask, so two CLI processes that read it in the same instant can both see the gate open and both serve the invite. The write used to land after getRecipe and a getTelemetry await; it now lands the moment surveyGateIsOpen returns true, so the race is the width of one read-then-write rather than a render and a client init. Accepted tradeoff: the worst case is one duplicate invite and one duplicate survey shown, which the funnel over-counts by design. A lock file was rejected because it would need a TTL to survive a crashed process. The new test has the mocked getTelemetry read the cadence file when called and asserts it already holds the advanced value.
a51c0ec to
5ad8ca2
Compare
Stack (root → tip):
Slice 4 of 4 of
qualitative-survey-feedback(stacked on #344). The switch-on: with this,agent onboard/create-sg-rule/create-vale-rule/create-remote-ruleandtaskless onboardstart carrying the invite.What
src/survey/invite.ts:surveyGateIsOpen(telemetry on,CInottrue/1, topic surveyed,next_askabsent/corrupt/passed) andwithSurveyInvite, which on an open gate capturessurvey shown { $survey_id }, writesnext_ask10 days out, and appendsfeedback-inviterenderedheader: falseafter the recipe's last section. Closed gate returns the recipe byte-identical.agent.tsandonboard.tsboth call it aftergetRecipe();onboard --mark-completeand the already-onboarded early return do not. The prompts render path is untouched, so theagent/promptsbyte-parity test passes as-is (the suite runs with the opt-out set, which closes the gate).isCiEnvironment()inutil/interactive.tsis now the one reading ofCI;shouldLaunchWizarduses it too.isTelemetryEnabled: () => falseso they keep measuringcli_agentalone.3b4d737) after the end-to-end verification 4.6 asked for: a dev build of this branch firedcli_agent→survey shownon the first fetch, served the bare recipe on the second fetch inside the window, andsurvey sentarrived in PostHog with all five questions resolved to their text (completedrecognised as the single-choiceYes). Scenario retention checked per CLAUDE.md: analytics 57→58, cli 72→73, cli-taskless-bootstrap 26→29, plus the newcli-feedback-surveyspec with 19. The test response (uuid01a0b255-83c6-7f57-8bb9-215aef81a256, opens withLOCAL VERIFICATION 4.6) is still live and should be archived from the survey's responses view.Tests
survey-invite.test.ts(17): open gate appends exactly the fragment with one# Topic:line, capturessurvey shown, writes the cadence; each of the four topics is surveyed; within-window, opt-out (cadence not even read),CI=true/1, unsurveyed topic, and corrupt-file repair; then through the commands:agent create-sg-ruleprints the invite aftercli_agent,agent checkdoes not,taskless onboarddoes,--mark-completeand an already-onboarded project do not.Refs #341