diff --git a/crates/manager-core/src/apply_api.rs b/crates/manager-core/src/apply_api.rs index 8355ae8..7de7c91 100644 --- a/crates/manager-core/src/apply_api.rs +++ b/crates/manager-core/src/apply_api.rs @@ -183,11 +183,13 @@ async fn group_extension_points_handler( /// `[project]`, so the plan can preview the ownership outcome + attach ceiling. #[derive(Deserialize)] pub struct PlanRequest { - // Flattened so the bundle fields sit at the JSON top level: an older `pic` - // (pre-§7) that POSTs a bare bundle still deserializes (`project` defaults - // to `None`), and a newer client sends the same bundle fields plus a - // top-level `project` key. Keeps the plan wire compatible in both skew - // directions, matching the additive compatibility of the apply request. + // Flattened so the bundle fields sit at the JSON top level — restoring the + // pre-§7 plan wire, which took a BARE `Json`. An older `pic` that + // POSTs a bare bundle still deserializes (`project` defaults to `None`), and + // a newer client sends the same bundle fields plus a top-level `project` + // key. (Apply is deliberately NOT flattened — its pre-§7 wire was already + // `{bundle, prune, …}`, so flattening it would instead break old apply + // clients; the two endpoints are asymmetric because their histories are.) #[serde(flatten)] pub bundle: Bundle, #[serde(default)] diff --git a/crates/manager-core/src/apply_service.rs b/crates/manager-core/src/apply_service.rs index ce4c01e..593773c 100644 --- a/crates/manager-core/src/apply_service.rs +++ b/crates/manager-core/src/apply_service.rs @@ -2192,8 +2192,7 @@ impl ApplyService { /// §7 M3.2: descendant apps of `gid` grouped by their nearest-claimed- /// ancestor project, EXCLUDING `exclude` (the planning project) — the apps /// a change to `gid`'s inherited config fans out to across other repos. - /// Ancestor resolution is memoized per group, so the cost is one walk per - /// distinct descendant group, not per app. + /// Resolved in one set-based recursive query (see below). async fn group_blast_radius( &self, gid: GroupId, @@ -2218,7 +2217,7 @@ impl ApplyService { UNION ALL SELECT ac.app_id, g.parent_id, ac.depth + 1 FROM app_chain ac JOIN groups g ON g.id = ac.gid - WHERE g.parent_id IS NOT NULL + WHERE g.parent_id IS NOT NULL AND ac.depth < 64 ), nearest AS ( SELECT DISTINCT ON (ac.app_id) ac.app_id, g.owner_project