Skip to content

Duplicate impact-level rendering logic: presentation/audit.ts vs presentation/queries-cli/impact.ts #1756

Description

@carlos-alm

Found during Titan Paradigm phase 25 (fail-fix on src/presentation/audit.ts, gauntlet rule 11).

renderAuditFunction's impact-level rendering loop in src/presentation/audit.ts and printFnImpactLevels in src/presentation/queries-cli/impact.ts:231-243 both render a Record<number, ImpactLevelEntry[]> (transitive-caller levels), but with different output formats:

  • audit.ts: Level {n}: name1, name2, ... (no icons, no truncation, no per-level count)
  • impact.ts printFnImpactLevels: {--}{n} Level {n} ({count} functions): header, then one indented ^ {icon} {name} {file}:{line} line per entry (truncated at 20, with "... and N more")

Gauntlet recommended "extract a shared impact-level-rendering helper used by both this file and presentation/queries-cli/impact.ts," but doing so would necessarily change the CLI output of one of the two commands (codegraph audit or codegraph fn-impact/wherever printFnImpactLevels is used) since the formats aren't the same today.

Phase 25 scope was explicitly behavior-preserving (byte-identical codegraph audit output before/after), so this was intentionally left unaddressed. Filing so it isn't lost.

Suggested fix: decide on one canonical format (probably printFnImpactLevels's richer icon+truncation format), verify no CLI snapshot/consumer depends on the other format, then extract a shared renderImpactLevels(levels, opts) helper and adopt it in both call sites in a dedicated PR (with explicit sign-off that the output format change is intentional).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions