Skip to main content

fallow_cli/
output_dupes.rs

1//! Typed envelope wrappers for the duplication findings emitted by `fallow
2//! dupes --format json` (and the `dupes` block inside `fallow` and `fallow
3//! audit`).
4//!
5//! Each wrapper flattens the bare finding via `#[serde(flatten)]` so the wire
6//! shape matches the previous `actions`-grafted output byte-for-byte.
7//! `actions` is populated at construction time via each wrapper's
8//! `with_actions` constructor and replaces the legacy `inject_dupes_actions`
9//! post-pass in `crates/cli/src/report/json.rs`. `introduced` on
10//! `CloneGroupFinding` carries the optional audit breadcrumb that
11//! `crates/cli/src/audit.rs::annotate_dupes_json` inserts into the JSON object
12//! via `map.insert`; the wrapper-level field stays `None` when serialized
13//! directly from Rust and is set by the audit pass only when the clone group
14//! was introduced relative to the merge-base.
15//!
16//! Lives in `fallow-cli` rather than `fallow-types` because `CloneFamily`,
17//! `CloneGroup`, and `MirroredDirectory` are defined in `fallow-core`
18//! (`crates/core/src/duplicates/types.rs`) and `AttributedCloneGroup` is
19//! defined in the CLI itself (`crates/cli/src/report/dupes_grouping.rs`);
20//! `fallow-types` is the lower-level crate that neither of those reach.
21
22use std::path::PathBuf;
23
24use fallow_core::duplicates::{
25    CloneFamily, CloneFingerprintSet, CloneGroup, DuplicationReport, DuplicationStats,
26    MirroredDirectory, RefactoringSuggestion,
27};
28use fallow_types::envelope::AuditIntroduced;
29use fallow_types::serde_path;
30use serde::Serialize;
31
32use crate::report::dupes_grouping::AttributedCloneGroup;
33
34/// Per-action wire shape attached to each [`CloneGroupFinding`] and
35/// [`AttributedCloneGroupFinding`]. Mirrors the action types previously
36/// emitted by `inject_dupes_actions::build_clone_group_actions` in
37/// `crates/cli/src/report/json.rs`: `extract-shared` plus `suppress-line`.
38#[derive(Debug, Clone, Serialize)]
39#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
40pub struct CloneGroupAction {
41    /// Action type identifier.
42    #[serde(rename = "type")]
43    pub kind: CloneGroupActionType,
44    /// Whether `fallow fix` can auto-apply this action. Both variants are
45    /// manual today; the field is non-singleton so a future auto-applier
46    /// does not need a schema change.
47    pub auto_fixable: bool,
48    /// Human-readable description of the action.
49    pub description: String,
50    /// The inline comment to insert (e.g.,
51    /// `// fallow-ignore-next-line code-duplication`). Present on
52    /// `suppress-line`; absent on `extract-shared`.
53    #[serde(default, skip_serializing_if = "Option::is_none")]
54    pub comment: Option<String>,
55}
56
57/// Discriminant for [`CloneGroupAction::kind`]. Mirrors the action types
58/// emitted by the legacy `build_clone_group_actions` walker.
59#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
60#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
61#[serde(rename_all = "kebab-case")]
62pub enum CloneGroupActionType {
63    /// Extract the duplicated code into a shared function.
64    ExtractShared,
65    /// Suppress the finding with an inline `// fallow-ignore-next-line
66    /// code-duplication` comment above the duplicated code.
67    SuppressLine,
68}
69
70/// Per-action wire shape attached to each [`CloneFamilyFinding`]. Mirrors
71/// the action types previously emitted by
72/// `build_clone_family_actions`: `extract-shared`, one `apply-suggestion`
73/// per [`RefactoringSuggestion`] on the family, and a trailing
74/// `suppress-line`.
75#[derive(Debug, Clone, Serialize)]
76#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
77pub struct CloneFamilyAction {
78    /// Action type identifier.
79    #[serde(rename = "type")]
80    pub kind: CloneFamilyActionType,
81    /// Whether `fallow fix` can auto-apply this action. All three variants
82    /// are manual today.
83    pub auto_fixable: bool,
84    /// Human-readable description of the action.
85    pub description: String,
86    /// Additional context. Present on `extract-shared` (explaining that
87    /// the family's clone groups share the same files); absent otherwise.
88    #[serde(default, skip_serializing_if = "Option::is_none")]
89    pub note: Option<String>,
90    /// The inline comment to insert (e.g.,
91    /// `// fallow-ignore-next-line code-duplication`). Present on
92    /// `suppress-line` only.
93    #[serde(default, skip_serializing_if = "Option::is_none")]
94    pub comment: Option<String>,
95}
96
97/// Discriminant for [`CloneFamilyAction::kind`].
98#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
99#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
100#[serde(rename_all = "kebab-case")]
101pub enum CloneFamilyActionType {
102    /// Extract the duplicated code blocks into a shared module.
103    ExtractShared,
104    /// Apply one of the family's [`RefactoringSuggestion`]s. One action
105    /// per suggestion entry on the bare family.
106    ApplySuggestion,
107    /// Suppress with an inline `// fallow-ignore-next-line code-duplication`
108    /// comment above the duplicated code.
109    SuppressLine,
110}
111
112const SUPPRESS_COMMENT: &str = "// fallow-ignore-next-line code-duplication";
113const SUPPRESS_DESCRIPTION: &str = "Suppress with an inline comment above the duplicated code";
114
115/// Wire-shape envelope for a [`CloneGroup`] finding. Flattens the bare
116/// group via `#[serde(flatten)]` and carries a typed `actions` array plus
117/// the optional audit-mode `introduced` flag. Replaces the legacy
118/// post-pass injection in `crates/cli/src/report/json.rs::inject_dupes_actions`.
119#[derive(Debug, Clone, Serialize)]
120#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
121pub struct CloneGroupFinding {
122    /// The underlying clone group.
123    #[serde(flatten)]
124    pub group: CloneGroup,
125    /// Stable content fingerprint, usually `dup:<8hex>` and widened on rare
126    /// report collisions. Addressable via `fallow dupes --trace dup:<fp>` (and
127    /// the `trace_clone` MCP tool) to deep-dive this group; shown alongside
128    /// each group in the human listing.
129    pub fingerprint: String,
130    /// Suggested next steps: an `extract-shared` primary and a
131    /// `suppress-line` secondary. Always emitted (possibly empty for
132    /// forward-compat).
133    pub actions: Vec<CloneGroupAction>,
134    /// Set by the audit pass when this clone group is introduced relative
135    /// to the merge-base. `None` when serialized directly from Rust.
136    #[serde(default, skip_serializing_if = "Option::is_none")]
137    pub introduced: Option<AuditIntroduced>,
138}
139
140impl CloneGroupFinding {
141    /// Build the wrapper from a raw [`CloneGroup`], computing the typed
142    /// `actions` array inline. `introduced` stays `None` and is set later
143    /// by `annotate_dupes_json` if the audit pass runs.
144    #[allow(
145        dead_code,
146        reason = "kept for focused wrapper tests and non-report construction paths"
147    )]
148    #[must_use]
149    pub fn with_actions(group: CloneGroup) -> Self {
150        let fingerprint = fallow_core::duplicates::clone_fingerprint(&group.instances);
151        Self::with_fingerprint(group, fingerprint)
152    }
153
154    /// Build the wrapper with a precomputed report-scoped fingerprint.
155    #[must_use]
156    pub fn with_fingerprint(group: CloneGroup, fingerprint: String) -> Self {
157        let line_count = group.line_count;
158        let instance_count = group.instances.len();
159        let actions = vec![
160            CloneGroupAction {
161                kind: CloneGroupActionType::ExtractShared,
162                auto_fixable: false,
163                description: format!(
164                    "Extract duplicated code ({line_count} lines, {instance_count} instance{}) into a shared function",
165                    if instance_count == 1 { "" } else { "s" },
166                ),
167                comment: None,
168            },
169            CloneGroupAction {
170                kind: CloneGroupActionType::SuppressLine,
171                auto_fixable: false,
172                description: SUPPRESS_DESCRIPTION.to_string(),
173                comment: Some(SUPPRESS_COMMENT.to_string()),
174            },
175        ];
176        Self {
177            fingerprint,
178            group,
179            actions,
180            introduced: None,
181        }
182    }
183}
184
185/// Wire-shape envelope for a [`CloneFamily`] finding.
186///
187/// Unlike most `*Finding` wrappers this one is NOT `#[serde(flatten)]` over
188/// the bare [`CloneFamily`], because the family's nested
189/// `groups: Vec<CloneGroup>` field needs to carry the typed
190/// [`CloneGroupFinding`] wrapper too (so every nested clone group gets its
191/// own `actions[]` array, matching the legacy post-pass behavior; see issue
192/// #393 regression test). The wire shape stays byte-identical to the
193/// previous post-pass output. No `introduced` field because `fallow audit`
194/// attributes clone groups (not families) when running against a base ref.
195#[derive(Debug, Clone, Serialize)]
196#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
197pub struct CloneFamilyFinding {
198    /// The files involved in this family (sorted for stable output).
199    #[serde(serialize_with = "serde_path::serialize_vec")]
200    pub files: Vec<PathBuf>,
201    /// Clone groups belonging to this family, each wrapped with typed
202    /// `actions[]` so consumers that read `clone_families[].groups[]`
203    /// directly see the same shape as the top-level `clone_groups[]`.
204    pub groups: Vec<CloneGroupFinding>,
205    /// Total number of duplicated lines across all groups.
206    pub total_duplicated_lines: usize,
207    /// Total number of duplicated tokens across all groups.
208    pub total_duplicated_tokens: usize,
209    /// Refactoring suggestions for this family.
210    pub suggestions: Vec<RefactoringSuggestion>,
211    /// Suggested next steps: an `extract-shared` primary, one
212    /// `apply-suggestion` per [`RefactoringSuggestion`] on the family, and
213    /// a trailing `suppress-line`. Always emitted (possibly empty for
214    /// forward-compat).
215    pub actions: Vec<CloneFamilyAction>,
216}
217
218impl CloneFamilyFinding {
219    /// Build the wrapper from a raw [`CloneFamily`], computing the typed
220    /// `actions` array inline and wrapping each inner clone group with its
221    /// own typed actions.
222    #[allow(
223        dead_code,
224        reason = "kept for focused wrapper tests and non-report construction paths"
225    )]
226    #[must_use]
227    pub fn with_actions(family: CloneFamily) -> Self {
228        let fingerprints = CloneFingerprintSet::from_groups(&family.groups);
229        Self::with_fingerprints(family, &fingerprints)
230    }
231
232    /// Build the wrapper using the report-scoped fingerprint assignment shared
233    /// by all duplication output surfaces.
234    #[must_use]
235    pub fn with_fingerprints(family: CloneFamily, fingerprints: &CloneFingerprintSet) -> Self {
236        let actions = build_clone_family_actions(
237            &family.groups,
238            family.total_duplicated_lines,
239            &family.suggestions,
240        );
241        Self {
242            files: family.files,
243            groups: family
244                .groups
245                .into_iter()
246                .map(|group| {
247                    let fingerprint = fingerprints.fingerprint_for_group(&group);
248                    CloneGroupFinding::with_fingerprint(group, fingerprint)
249                })
250                .collect(),
251            total_duplicated_lines: family.total_duplicated_lines,
252            total_duplicated_tokens: family.total_duplicated_tokens,
253            suggestions: family.suggestions,
254            actions,
255        }
256    }
257}
258
259fn build_clone_family_actions(
260    groups: &[CloneGroup],
261    total_duplicated_lines: usize,
262    suggestions: &[RefactoringSuggestion],
263) -> Vec<CloneFamilyAction> {
264    let group_count = groups.len();
265    let mut actions = Vec::with_capacity(2 + suggestions.len());
266    actions.push(CloneFamilyAction {
267        kind: CloneFamilyActionType::ExtractShared,
268        auto_fixable: false,
269        description: format!(
270            "Extract {group_count} duplicated code block{} ({total_duplicated_lines} lines) into a shared module",
271            if group_count == 1 { "" } else { "s" },
272        ),
273        note: Some(
274            "These clone groups share the same files, indicating a structural relationship; refactor together"
275                .to_string(),
276        ),
277        comment: None,
278    });
279    for suggestion in suggestions {
280        actions.push(CloneFamilyAction {
281            kind: CloneFamilyActionType::ApplySuggestion,
282            auto_fixable: false,
283            description: suggestion.description.clone(),
284            note: None,
285            comment: None,
286        });
287    }
288    actions.push(CloneFamilyAction {
289        kind: CloneFamilyActionType::SuppressLine,
290        auto_fixable: false,
291        description: SUPPRESS_DESCRIPTION.to_string(),
292        note: None,
293        comment: Some(SUPPRESS_COMMENT.to_string()),
294    });
295    actions
296}
297
298/// Wire-shape envelope for an [`AttributedCloneGroup`] finding (per-bucket
299/// duplication attribution emitted under `fallow dupes --group-by`).
300/// Flattens the attributed group and carries the same typed
301/// `CloneGroupAction` array as [`CloneGroupFinding`]; no `introduced`
302/// field because `fallow audit` does not run on grouped output.
303#[derive(Debug, Clone, Serialize)]
304#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
305pub struct AttributedCloneGroupFinding {
306    /// The underlying attributed clone group.
307    #[serde(flatten)]
308    pub group: AttributedCloneGroup,
309    /// Stable content fingerprint, usually `dup:<8hex>` and widened on rare
310    /// report collisions. Addressable via `fallow dupes --trace dup:<fp>`.
311    /// Computed from the group's instances, so it matches the top-level
312    /// `clone_groups[].fingerprint` for the same clone.
313    pub fingerprint: String,
314    /// Suggested next steps. Always emitted.
315    pub actions: Vec<CloneGroupAction>,
316}
317
318impl AttributedCloneGroupFinding {
319    /// Build the wrapper from an [`AttributedCloneGroup`], computing the
320    /// typed `actions` array inline from the attributed group's
321    /// `line_count` and instance count.
322    #[allow(
323        dead_code,
324        reason = "kept for focused wrapper tests and non-report construction paths"
325    )]
326    #[must_use]
327    pub fn with_actions(group: AttributedCloneGroup) -> Self {
328        let fingerprint = group.instances.first().map_or_else(
329            || fallow_core::duplicates::fingerprint_for_fragment(""),
330            |ai| fallow_core::duplicates::fingerprint_for_fragment(&ai.instance.fragment),
331        );
332        Self::with_fingerprint(group, fingerprint)
333    }
334
335    /// Build the wrapper with a precomputed report-scoped fingerprint.
336    #[must_use]
337    pub fn with_fingerprint(group: AttributedCloneGroup, fingerprint: String) -> Self {
338        let line_count = group.line_count;
339        let instance_count = group.instances.len();
340        let actions = vec![
341            CloneGroupAction {
342                kind: CloneGroupActionType::ExtractShared,
343                auto_fixable: false,
344                description: format!(
345                    "Extract duplicated code ({line_count} lines, {instance_count} instance{}) into a shared function",
346                    if instance_count == 1 { "" } else { "s" },
347                ),
348                comment: None,
349            },
350            CloneGroupAction {
351                kind: CloneGroupActionType::SuppressLine,
352                auto_fixable: false,
353                description: SUPPRESS_DESCRIPTION.to_string(),
354                comment: Some(SUPPRESS_COMMENT.to_string()),
355            },
356        ];
357        Self {
358            group,
359            fingerprint,
360            actions,
361        }
362    }
363}
364
365/// Wire-shape payload for `fallow dupes --format json` (the body that
366/// flattens into [`crate::output_envelope::DupesOutput`] and is also
367/// emitted under the `dupes` / `duplication` key inside the combined and
368/// audit envelopes).
369///
370/// Mirrors [`DuplicationReport`] field-for-field, except `clone_groups`
371/// and `clone_families` carry the typed wrapper envelopes instead of bare
372/// findings, so the schema (and any TS / agent consumer) sees the typed
373/// `actions[]` natively.
374#[derive(Debug, Clone, Serialize)]
375#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
376pub struct DupesReportPayload {
377    /// All detected clone groups, each wrapped with typed actions.
378    pub clone_groups: Vec<CloneGroupFinding>,
379    /// Clone families, each wrapped with typed actions. Inner `groups`
380    /// inside each [`CloneFamilyFinding`] are themselves wrapped as
381    /// [`CloneGroupFinding`] entries carrying their own `actions[]` (and
382    /// optional audit-mode `introduced` flag), so JSON-Schema strict
383    /// consumers and TS consumers reading `clone_families[].groups[]` see
384    /// the same shape as the top-level `clone_groups[]` array (preserves
385    /// the issue #393 regression contract).
386    pub clone_families: Vec<CloneFamilyFinding>,
387    /// Mirrored directory pairs.
388    #[serde(default, skip_serializing_if = "Vec::is_empty")]
389    pub mirrored_directories: Vec<MirroredDirectory>,
390    /// Aggregate duplication statistics.
391    pub stats: DuplicationStats,
392}
393
394impl DupesReportPayload {
395    /// Build the payload from a bare [`DuplicationReport`]. Wraps each
396    /// clone group and family with its typed actions; clones the
397    /// `mirrored_directories` and `stats` through unchanged.
398    #[must_use]
399    pub fn from_report(report: &DuplicationReport) -> Self {
400        let fingerprints = CloneFingerprintSet::from_groups(&report.clone_groups);
401        Self {
402            clone_groups: report
403                .clone_groups
404                .iter()
405                .map(|group| {
406                    CloneGroupFinding::with_fingerprint(
407                        group.clone(),
408                        fingerprints.fingerprint_for_group(group),
409                    )
410                })
411                .collect(),
412            clone_families: report
413                .clone_families
414                .iter()
415                .map(|family| CloneFamilyFinding::with_fingerprints(family.clone(), &fingerprints))
416                .collect(),
417            mirrored_directories: report.mirrored_directories.clone(),
418            stats: report.stats.clone(),
419        }
420    }
421}
422
423#[cfg(test)]
424mod tests {
425    use std::path::PathBuf;
426
427    use fallow_core::duplicates::{
428        CloneInstance, DuplicationStats, RefactoringKind, RefactoringSuggestion,
429    };
430
431    use super::*;
432
433    fn instance(path: &str) -> CloneInstance {
434        CloneInstance {
435            file: PathBuf::from(path),
436            start_line: 1,
437            end_line: 10,
438            start_col: 0,
439            end_col: 0,
440            fragment: String::new(),
441        }
442    }
443
444    fn group(instances: usize) -> CloneGroup {
445        CloneGroup {
446            instances: (0..instances)
447                .map(|i| instance(&format!("/root/file_{i}.ts")))
448                .collect(),
449            token_count: 100,
450            line_count: 20,
451        }
452    }
453
454    #[test]
455    fn clone_group_finding_position_0_is_extract_shared() {
456        let finding = CloneGroupFinding::with_actions(group(2));
457        assert_eq!(finding.actions.len(), 2);
458        assert_eq!(
459            finding.actions[0].kind,
460            CloneGroupActionType::ExtractShared,
461            "position 0 of a clone group must be `extract-shared` (jq scripts read .actions[0].type)",
462        );
463        assert_eq!(finding.actions[1].kind, CloneGroupActionType::SuppressLine);
464        assert!(finding.introduced.is_none());
465    }
466
467    #[test]
468    fn clone_group_finding_description_pluralises_instance_count() {
469        let single = CloneGroupFinding::with_actions(group(1));
470        assert!(
471            single.actions[0].description.contains("1 instance"),
472            "single instance should be singular: {}",
473            single.actions[0].description
474        );
475        assert!(
476            !single.actions[0].description.contains("1 instances"),
477            "single instance must not pluralise: {}",
478            single.actions[0].description
479        );
480        let multi = CloneGroupFinding::with_actions(group(3));
481        assert!(
482            multi.actions[0].description.contains("3 instances"),
483            "multiple instances must pluralise: {}",
484            multi.actions[0].description
485        );
486    }
487
488    #[test]
489    fn clone_family_finding_position_0_is_extract_shared_then_suggestions_then_suppress() {
490        let family = CloneFamily {
491            files: vec![PathBuf::from("/root/a.ts"), PathBuf::from("/root/b.ts")],
492            groups: vec![group(2), group(2)],
493            total_duplicated_lines: 40,
494            total_duplicated_tokens: 200,
495            suggestions: vec![
496                RefactoringSuggestion {
497                    kind: RefactoringKind::ExtractFunction,
498                    description: "Extract helper".to_string(),
499                    estimated_savings: 10,
500                },
501                RefactoringSuggestion {
502                    kind: RefactoringKind::ExtractModule,
503                    description: "Extract module".to_string(),
504                    estimated_savings: 30,
505                },
506            ],
507        };
508        let finding = CloneFamilyFinding::with_actions(family);
509        assert_eq!(finding.actions.len(), 4);
510        assert_eq!(
511            finding.actions[0].kind,
512            CloneFamilyActionType::ExtractShared,
513            "position 0 of a clone family must be `extract-shared`",
514        );
515        assert_eq!(
516            finding.actions[1].kind,
517            CloneFamilyActionType::ApplySuggestion
518        );
519        assert_eq!(finding.actions[1].description, "Extract helper");
520        assert_eq!(
521            finding.actions[2].kind,
522            CloneFamilyActionType::ApplySuggestion
523        );
524        assert_eq!(finding.actions[2].description, "Extract module");
525        assert_eq!(finding.actions[3].kind, CloneFamilyActionType::SuppressLine);
526        assert_eq!(finding.groups.len(), 2);
527        for inner in &finding.groups {
528            assert_eq!(inner.actions.len(), 2);
529            assert_eq!(inner.actions[0].kind, CloneGroupActionType::ExtractShared);
530            assert_eq!(inner.actions[1].kind, CloneGroupActionType::SuppressLine);
531        }
532    }
533
534    #[test]
535    fn clone_family_finding_with_no_suggestions_emits_two_actions() {
536        let family = CloneFamily {
537            files: vec![PathBuf::from("/root/a.ts")],
538            groups: vec![group(2)],
539            total_duplicated_lines: 20,
540            total_duplicated_tokens: 100,
541            suggestions: Vec::new(),
542        };
543        let finding = CloneFamilyFinding::with_actions(family);
544        assert_eq!(finding.actions.len(), 2);
545        assert_eq!(
546            finding.actions[0].kind,
547            CloneFamilyActionType::ExtractShared
548        );
549        assert_eq!(finding.actions[1].kind, CloneFamilyActionType::SuppressLine);
550    }
551
552    #[test]
553    fn payload_from_report_wraps_all_findings() {
554        let report = DuplicationReport {
555            clone_groups: vec![group(2), group(3)],
556            clone_families: vec![CloneFamily {
557                files: vec![PathBuf::from("/root/a.ts")],
558                groups: vec![group(2)],
559                total_duplicated_lines: 20,
560                total_duplicated_tokens: 100,
561                suggestions: Vec::new(),
562            }],
563            mirrored_directories: Vec::new(),
564            stats: DuplicationStats::default(),
565        };
566        let payload = DupesReportPayload::from_report(&report);
567        assert_eq!(payload.clone_groups.len(), 2);
568        assert_eq!(payload.clone_families.len(), 1);
569        for finding in &payload.clone_groups {
570            assert_eq!(finding.actions.len(), 2);
571        }
572        assert_eq!(payload.clone_families[0].actions.len(), 2);
573    }
574
575    #[test]
576    fn attributed_clone_group_finding_actions_match_clone_group_shape() {
577        use crate::report::dupes_grouping::AttributedInstance;
578        let attributed = AttributedCloneGroup {
579            primary_owner: "src".to_string(),
580            token_count: 100,
581            line_count: 20,
582            instances: vec![
583                AttributedInstance {
584                    instance: instance("/root/src/a.ts"),
585                    owner: "src".to_string(),
586                },
587                AttributedInstance {
588                    instance: instance("/root/src/b.ts"),
589                    owner: "src".to_string(),
590                },
591            ],
592        };
593        let finding = AttributedCloneGroupFinding::with_actions(attributed);
594        assert_eq!(finding.actions.len(), 2);
595        assert_eq!(finding.actions[0].kind, CloneGroupActionType::ExtractShared);
596        assert_eq!(finding.actions[1].kind, CloneGroupActionType::SuppressLine);
597    }
598}