Skip to content

[deep-report] Consolidate 5 near-duplicate delta structs in pkg/cli/audit_comparison.go into generic Delta[T] #66884

Description

@github-actions

Description

pkg/cli/audit_comparison.go defines 5 near-identical delta/comparison structs — live-verified at lines 47/55/61/67/73: AuditComparisonDelta, AuditComparisonRouteDelta, AuditComparisonIntDelta, AuditComparisonStringDelta, AuditComparisonMCPFailureDelta. The 2026-10-08 Typist (Go Type Consistency Analysis) report flagged this family as its single highest-leverage type-consolidation opportunity, recommending they collapse into one generic Delta[T].

Expected Impact

Removes duplicated comparison-struct boilerplate and makes it easier to add new delta-tracked fields to audit comparisons without hand-writing another near-identical struct.

Suggested Fix

Introduce a generic AuditComparisonDelta[T any] struct { Before, After T; ... } (matching whatever shared fields the current 5 structs have — e.g. Before/After/Change), and replace the 5 call sites (e.g. pkg/cli/audit_comparison.go:391,396,401 and others) with instantiations of the generic type. Keep comparison output JSON-identical; run pkg/cli tests including audit_comparison_test.go.

Code Region: pkg/cli/audit_comparison.go:47-79 (struct defs) and usages throughout the same file.

Suggested Agent

Developer / Go generics-savvy agent.

Estimated Effort

Medium.

Data Source

DeepReport Intelligence Briefing analysis, 2026-10-08. Source: discussion "[typist] Typist - Go Type Consistency Analysis" (#66860). Live-verified: all 5 struct definitions exist today at the stated lines in pkg/cli/audit_comparison.go.

Generated by 🔬 Deep Report · claude · agent · 342.4 AIC · ⌖ 10.9 AIC · ⊞ 7.1K · ◷

  • expires on Oct 10, 2026, 4:53 AM UTC-08:00

Activity

  1. github-actions commented on Oct 10, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-10-10T12:53:52.809Z.

    Closed by Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions