Skip to content

[Code Quality] refactor: collapse AuditOptions/auditCommandOptions/auditRunConfig cascade in pkg/cli/audit.go #48889

Description

@github-actions

Description

pkg/cli/audit.go manually re-declares the same ~12-field audit-configuration concept three times: AuditOptions (line 25, 14 fields), auditCommandOptions (line 76, 11 fields, 9 map 1:1), and auditRunConfig (line 309, 14 fields, 12 map 1:1). This is a high-impact maintainability risk: updating one struct without the others is an easy-to-miss bug class.

Suggested Changes

  • Have auditCommandOptions and auditRunConfig embed AuditOptions and add only the genuinely distinct fields (e.g. stdin, evalsArtifactRequested) instead of re-declaring the full field set at each pipeline stage.

Files Affected

  • pkg/cli/audit.go (lines 25, 76, 309)

Success Criteria

  • auditCommandOptions and auditRunConfig embed AuditOptions rather than duplicating fields
  • Cobra flag binding and downstream call sites updated accordingly
  • All existing audit command tests pass

Source

Extracted from Typist - Go Type Consistency Analysis #48872

Priority

Medium - 2-3 hours effort, removes a recurring drift-bug class

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · aut00 · 51.4 AIC · ⌖ 5.2 AIC · ⊞ 9.9K · ◷

  • expires on Jul 30, 2026, 5:24 AM UTC-08:00

Activity

  1. github-actions commented on Jul 30, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-07-30T13:24:26.869Z.

    Closed by Workflow

  2. github-actions commented on Jul 30, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-07-30T13:24:26.869Z.

    Closed by Workflow

  3. github-actions commented on Jul 30, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-07-30T13:24:26.869Z.

    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