Skip to content

[audit] Dup: formatDuration and formatDurationForTTL are byte-identical — collapse to one #294

Closed

Description

@scttfrdmn

Filed from the 2026-07-11 spawn audit. Full report: docs/spawn-audit-2026-07-11.md. Assessment-only — no code changed yet.

Phase: Phase 0 — do now (dup)

Evidence

  • cmd/list.go:480-501 formatDuration
  • cmd/state.go:566-587 formatDurationForTTL — bodies verified IDENTICAL via diff
  • both in package cmd; formatDuration has ~20 callers, formatDurationForTTL used on the TTL path

Recommendation
Delete formatDurationForTTL, point the state.go TTL path at formatDuration; update state_test.go:141/143/168/329. Do NOT fold pkg/slurm's separate variant.

User-facing / SemVer: No — internal. No bump.

Adversarially verified during the audit (62/62 findings survived verification; severities/scope adjusted where the first pass was wrong).

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

    audit:2026-07

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions