Skip to content

code-metrics: count the files of fully-excluded replication instances in the summary, or say why the scope header and summary disagree #3843

Description

@kyle-sexton

This was generated by AI during triage.

Parent

Refs #3768 (code-metrics 0.1.0 follow-ups, from PR #3766).

What to build

When every instance of a duplication finding is excluded as sanctioned replication, the finding contributes no surviving rows. The report's summary file count then counts only surviving rows, while the scope header for the same run reports the full file count including the excluded ones. A reader comparing the two numbers in one report sees them disagree, with nothing in the report explaining why.

Resolve the disagreement. Both resolutions are legitimate and the implementer should pick one on the merits:

  • Make the numbers agree by counting the files belonging to fully-excluded instances in the summary, so the summary describes the same population the scope header does.
  • Make the disagreement explicit by labeling the two counts distinctly, so it is evident that one is the scanned population and the other the surviving-findings population, and that they are expected to differ whenever anything was excluded.

The second is likely the better answer, because the two numbers genuinely measure different things and forcing them to agree would make the summary less informative rather than more. But that is a judgment about what the summary is for, and the implementer should make it explicitly rather than defaulting to whichever is easier.

What is not acceptable is leaving two same-looking counts that silently mean different things.

Acceptance criteria

  • A run in which one or more duplication findings are fully excluded as sanctioned replication produces a report whose file counts either agree, or are labeled so a reader can tell what each counts.
  • A run with no exclusions is unchanged.
  • The chosen resolution is stated in the report schema's documentation, so a consumer reading the numbers knows which population each describes.
  • A test covers the total-exclusion case; it is the case that produced the discrepancy and it currently has no coverage of this property.
  • scripts/affected-tests.sh --run selects and passes the suites mapped to the changed files.

Out of scope

  • Changing what qualifies as sanctioned replication or how exclusions are declared.
  • Partial-exclusion behavior, which is already coherent.
  • The report path-relativity question, which is a separate item.

Blocked by

None. Can start immediately.

Activity

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

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: lowNice-to-have, cosmetic, or speculative; opportunistic.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions