fix(git-source): managed targets get the type their code shows #458

Merged
sharang merged 1 commits from fix/managed-target-type into main 2026-10-05 20:14:22 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 1cca509d4d fix(git-source): managed targets get the type their code shows
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m31s
Every target the managed git sync created stayed "Backend / API", the
Android+Unity repository and the firmware repositories included. The sync
creates a target when its repository is created, before anything is
pushed, so detection then saw no code and fell back to the default type;
and the classification each scan computes was stored, but never applied
to the target's type.

A scan now applies it to a managed target (OnboardedTarget::detected_type)
when the classifier found evidence (not only the fallback), the evidence
names another type, and no person has chosen the type. The default
compliance profile of the new type comes with it. Changing the type in
the editor sets `type_chosen`, and the scans leave it alone from then on;
the editor sends the type on every save, so only a change counts.
Existing managed targets are re-typed by their next scan.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-10-05 22:00:27 +02:00