Skip to content

chore: remove dead code found by the 2026-07-11 audit (#286-292) - #330

Merged
scttfrdmn merged 1 commit into
mainfrom
audit/deadcode-286-292
Jul 11, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
audit/deadcode-286-292

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #286, #287, #288, #289, #291, #292. Partially addresses #290 (see below). Part of the audit tracker #328 (Phase 0).

Deletes code with zero callers anywhere in the repo — verified across the main module, cmd/spored, cmd/orchestrator, and all 12 lambda go-modules — plus the tests that only covered the removed code. No user-facing behavior change. ~2.4k lines removed.

Removed

Scope deviations (verified against the live tree, not the finding text)

Verification

CHANGELOG updated under Removed.

Deletes code with zero callers anywhere in the repo (verified across the
main module, cmd/spored, cmd/orchestrator, and all lambda modules) plus
the tests that only covered the removed code. No user-facing change.

- pkg/streaming: unused TCP/gRPC/ZMQ transport library (#286)
- pkg/instance: unused wildcard/pattern helpers (#287)
- pkg/audit/context.go: 7 unused context helpers (#288)
- pkg/dns: DecodeAccountID/GetAccountSubdomain/ParseDNSName + deprecated
  package-level GetFQDN (kept the live Client.GetFQDN method) (#289)
- pkg/queue: DependenciesMet/GetReadyJobs (topo-sort path stays) (#291)
- cmd: waitForDCV/getTagValue/formatTTLDuration (#292)
- one unused alerts constructor (NewClientWithEncryption) + one unused
  scheduler method (UpdateScheduleMetadata) (#290, partial)

Scope notes vs the findings (verified on the live tree):
- #286: kept examples/streaming/ — the pipeline still advertises a
  "network streaming" feature (cmd/pipeline.go, pkg/pipeline peer
  discovery), so the demo dir is out of scope for a dead-code sweep.
- #290: only 2 of the 7 named funcs had zero references. The rest
  (scheduler NewClientWithTableName/RecordExecution, alerts
  NewClientWithTableNames/GetAlert/RecordAlertHistory) are live test
  infrastructure — RecordExecution seeds the test for the live
  GetExecutionHistory — so removing them would strip real coverage.
  Left them; will re-scope #290 accordingly.
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[audit] Dead code: delete pkg/streaming (entirely unused, ~71 funcs across tcp/transport/zmq)

1 participant