self-driving: background general scout on active projects, step 1 (small pilot cohort)
Why
Self-driving starts with setup today. A person has to turn on scouts or signal sources before anything lands in the inbox, and a project that never does that never sees what the general scout would find. We want the general scout to run in the background on active projects, so the first visit to the inbox already shows reports about that project.
This issue specs step 1 only: a small, hand-picked pilot cohort, weekly cadence, with a clean way to turn it off. It does not wait on billing changes; it is sized so we can read real behavior before widening. The wider rollout (automatic cohort selection, cadence backoff, a set-based planner) is step 2 and gets its own issue once the pilot reads well.
Origin: #team-self-driving thread
Pilot cohort
An explicit list of project ids in the signals-scout flag payload, picked offline with a query. A project qualifies when:
- its organization pays and a member logged in within the last 14 days
- it ingests events steadily (not a demo, test or internal-metrics project)
- no scout and no signal source is enabled on it today, so it is not set up
- its organization has
is_ai_data_processing_approved = True - it is the most recently active project in its organization (one project per org)
Start with about 25 projects, then widen to about 100 by editing the list.
Why not add ids to guaranteed_team_ids
That works today with no code, but it is the wrong shape for this:
- A numeric id takes the force-seed path on every tick: the whole canonical catalog is synced and registered for the project, not one scout.
- The seeded configs make the project read as set up, so inbox onboarding is skipped and the suggestions planner moves it to another tier.
- Nothing marks those configs as background ones, so autostart, auto-pause, metrics and cleanup cannot treat them differently.
- AI-processing consent is only checked at emit time (
tools/emit.py:_preflight_emit_gates), after the model has already read the project's data.
What to build
1. A background block in the signals-scout payload
"background": {
"enabled": false,
"skill_name": "signals-scout-general",
"team_ids": [],
"interval_minutes": 10080,
"max_new_teams_per_tick": 25
}- Parsed in
scout_harness/team_limits.pynext to_parse_enrollment, off the same payload snapshot. - A missing block,
enabled: falseor an emptyteam_idsis a no-op. skip_team_idsstill hard-excludes a project.- Child environments canonicalize to the parent project, like every other id in the payload.
2. Materialize one config per cohort project
In fetch_enabled_signals_scout_runs_activity (planning only, so the workflow body is unchanged and no workflow.patched() is needed):
- For each cohort project with no config for
skill_name, seed only that canonical skill row and create oneSignalScoutConfig: enabled,run_interval_minutes = interval_minutes,enabled_by = null. - Stamp it with a new
enrollment_origin = backgroundfield. Existing rows default touser. - Create at most
max_new_teams_per_tickconfigs per tick, so a larger list ramps in instead of landing in one tick. - After creation, the project participates like a wildcard team (it has an enabled config). Dispatch, slot alignment, per-team caps and the failure breaker all apply unchanged.
- A project that already has a config for the skill is left alone, whatever its state.
Off switch: a project removed from team_ids, or enabled: false for the whole block, pauses its background-origin configs through transition_status_by_system with a new pause_reason = background_removed. A config a person has touched is never paused by this (see 4).
3. Check AI-processing consent before dispatch
Skip any project whose organization has is_ai_data_processing_approved is not True before a run is planned. This is the same strict check the suggestions runner uses (suggestions_runner.py), because the field is nullable.
Required for background configs.
Proposed for every scheduled run: an unapproved org's scout run reads project data with a model and then has every emit dropped, so it spends with no possible output.
4. How a background-origin config behaves
- No autostart. A report written or edited by a background-origin run never starts an implementation task, so no pull request opens without a person.
- Not "set up".
isSelfDrivingSetUp, the inbox onboarding decision and the suggestions planner tier ignore background-origin configs, so onboarding and suggestions still show on the first visit. - A person takes over by touching it. The scout shows in the roster as the normal general scout. A person toggling it, editing it, or changing its schedule sets
enrollment_origin = user, and it leaves the background lane for good. - Identity. No member enabled it, so the run resolves its acting user through the existing team fallback (
resolve_acting_user_id_for_team), and the runner already withholds write scopes for that identity. That is the same read-only posture headless suggestion scans use today.
5. Make it measurable
Stamp enrollment_origin on the run row metadata, on signals_scout_run_started / signals_scout_run_finished, and on the report emitted and edited events, so the pilot can be read without joining through config history.
Reading the pilot
Read these per cohort project after two weeks, and weekly after that:
- first inbox visit after reports landed, report views, thumbs, dismissals
- scout toggled off, or taken over by a person
- emit rate and edit-only rate, compared with user-enabled general scouts
- run failure rate and cost per project
- reports landing unassigned (these projects mostly have no linked GitHub identities)
We widen the list when visits happen and toggles-off stay rare. If a cohort shows no visits at all, we fix the first-visit experience before we widen.
Out of scope for step 1
- Automatic cohort selection (a nightly job over activity, login and consent). This is step 2 and extends the suggestions planner's tier machinery.
- Cadence backoff or a no-audience pause. The pilot is small and time-boxed and gets read by hand, so this has to land before step 2 widens the cohort.
- A set-based planner and a fleet-wide activity roll-up. The per-team loop is fine at pilot size.
- A first-visit explainer in the inbox, notifications or email, and a non-user service identity for scout runs.
Ramp control: a sample percent per band
Beyond the pilot we ramp by band, not by list. Each band gets its own sample percent that we can raise or lower from the flag payload:
"background": {
"bands": {
"1": {"percent": 2, "interval_minutes": 10080},
"2": {"percent": 0, "interval_minutes": 10080},
"3": {"percent": 0, "interval_minutes": 20160},
"4": {"percent": 0, "interval_minutes": 20160}
}
}- Bands come from the nightly selection job (step 2): paying or not, event volume, member login recency. A project must also be not set up and have AI processing approved.
- A project is sampled when
hash(team_id) % 100 < percent. The hash is stable, so going from 2 to 5 keeps the first 2% and adds more on top. - Lowering a percent pauses the background-origin configs that fall outside it, through the same
background_removedpath as the off switch.0turns a band off. A config a person has taken over is never paused. team_idsstays as a hand-picked override that works without bands, for internal and dev projects.max_new_teams_per_tickstill limits how fast newly sampled projects arrive, so a large percent jump ramps in over several ticks.
Step 1 does not need band membership for team_ids, but the parser should accept a bands key now so the payload shape does not change later.
Open questions
- Consent: is the org-level AI-processing approval enough for a run nobody in the project asked for? This needs sign-off before the first customer project.
- Model: should background runs follow the fleet model mix or pin a cheaper model?
- Onboarding: should background-origin reports be visible under the onboarding takeover, or only after setup?
- Pilot size and how long we read it before step 2.
- Should a minimal nightly band job land in step 1, so that per-band percents work from the first customer project and not only from step 2?
Rollout
- Merge dark (
enabled: false). - Turn it on for one or two internal projects that are not set up, and check the config, run, identity, consent skip and off switch end to end.
- Add about 25 cohort projects and read them after two weeks.
- Widen to about 100, then open step 2.
Related: #101681 (no-data gate for suggestions), #104535 (activity check before suggestion scans), #107613 (separate dispatch budget for operational scouts).
Source: PostHog/posthog