Skip to content

refactor(devtools): share campaign result metadata contracts #598

Closed as not planned

Description

@Sinity

Problem

Devtools campaign result schemas duplicate the same targeting metadata across separate result classes.

Evidence from current master:

  • devtools/mutmut_campaign.py defines CampaignResult for mutation campaigns.
  • devtools/benchmark_campaign.py defines another CampaignResult for pytest-benchmark campaigns.
  • devtools/synthetic_benchmark_runtime.py defines a third CampaignResult for synthetic benchmark campaigns.
  • All three repeat authored-target metadata such as origin, path_targets, artifact_targets, operation_targets, and tags; benchmark variants also carry adjacent maintenance-target fields.
  • Reports/tests import different CampaignResult classes depending on the lane, so campaign output contracts are fragmented by implementation file rather than a shared campaign vocabulary.

This is not currently breaking output, but it is drift-prone. Any future campaign metadata addition has to be copied across multiple dataclasses, renderers, and tests.

Acceptance criteria

  • Introduce a shared campaign metadata/result-base contract in devtools for common fields such as origin, target selectors, tags, command identity, commit/worktree context where applicable, and timestamps.
  • Convert mutation, pytest-benchmark, and synthetic benchmark result records to compose or extend the shared contract while keeping lane-specific payloads explicit.
  • Update campaign report rendering and tests to use the shared vocabulary where possible.
  • Keep serialized JSON output stable unless the PR intentionally documents a schema change.
  • Run focused devtools campaign tests plus devtools verify --quick.

Notes

Found during the wide duplication/source-organization audit recorded in .agent/scratch/574-duplication-organization-audit.md.

Activity

  1. added
    type:refactor
    area:devtools
    on May 1, 2026
  2. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Superseded by #625. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devtoolsarea:qatool:codextype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions