Repository navigation
Description
Problem
Two reports on the same team can reach auto-start with findings that name the same file and the same causative commit, and the pipeline opens a PR for each. Nothing after research compares a report with its siblings.
Each research run writes signal_finding artefacts (SignalFinding in products/signals/backend/artefact_schemas.py) with relevant_code_paths and relevant_commit_hashes, plus an actionability_judgment (ActionabilityAssessment.already_addressed). maybe_autostart_implementation_task (products/signals/backend/auto_start.py) gates on already_addressed but has no view of other reports. already_addressed is filled by the research agent's own gh pr list check, which is an instruction, not a mechanism (see the companion issue on feeding known PRs into research).
On one customer project, eight reports over five days all carried findings on the same providers.tsx path and the same commit hash (an unguarded analytics init letting local dev servers report into production). Three of them auto-started and opened three PRs changing that file. The signals were genuinely different exceptions, so grouping could not have joined them; the overlap only exists at the finding level, after research.
Fixes
- Sibling overlap check before auto-start. In
maybe_autostart_implementation_task(or a small helper inauto_start.pyit calls), load thesignal_findingartefacts of the otherreadyreports on the team from the last N days (30 is a reasonable start) and compare with the new report's findings. Treat as overlapping when they share a causative commit hash, or share the primary code path (first entry, or any path present in every finding of the new report). Pure Postgres, no LLM call. - On overlap, do not auto-start. Log a
skip_reasonofsibling report already targets the same fix: <report id>(the existingskip_reasonpattern). Record it on the report as alogartefact so the inbox shows why no PR opened, and link the two reports (arelated_reportartefact or the existing linking mechanism if one fits). - Prefer the report that already has a PR. If a sibling has an implementation
task_runwith apr_url, point the new report's summary at it rather than at nothing. - Do not merge reports automatically in this issue; linking plus no second PR is the outcome. Merging is a product decision for later.
- Tests: two reports, overlapping commit hash, second one must skip auto-start with the sibling reason; overlapping path only; no overlap (auto-starts as today).
Why
The pipeline already has, in its own artefacts, the fact that two reports name the same fix. Checking that is deterministic and cheap, and it is the check that would have prevented three PRs for one line of code. Relying on the research agent's gh lookup alone has already failed in production.
From this Slack thread; the investigation is written up in the self-driving-debugging skill in the skills store.
Activity
feat(signals): act on typed report links in research, auto-start and …
feat(signals): act on typed report links in research, auto-start and …