Skip to content

Dead-code triage: production-unreachable subtrees needing product decisions (TEE/CoCo, encrypted replies, unwired validation, OpenClaw wallet) #748

Description

@bussyjd

Context

A repo-wide deadcode ./cmd/... triage (2026-07-14, alongside #745/#746/#747) found, beyond mechanically-deletable symbols, several production-unreachable subtrees kept alive only by their own tests. These need owner/product decisions, not routine cleanup — some look like shelved features, one may indicate missing input validation.

Subtrees needing a decision

Subtree ~LOC What it is Recommendation
internal/tee/coco.go + internal/tee/verify.go (+MarshalReport) 577+ Entire CoCo (Confidential Containers) install/check + TDX/SNP/Nitro attestation-verification machinery. The tee package itself is live (ParseTEEType/NewKey/Attest), but this whole half is orphaned (from monetization M1-M3, b2bc258). Biggest item — decide: is confidential-compute verification still on the roadmap? Kill or wire in.
internal/inference/client.go 239 Encrypted-replies HTTP client (EnableEncryptedReplies, pubkey fetch, RoundTripper). Staged feature, never wired. Decide with the TEE item — they're the same story.
internal/inference/detect.go (ProbeEndpoint/ScanLocalEndpoints/DetectServerType/ParseModelsResponse subtree) 345 Local inference-server auto-detection — apparently superseded by the discovery path actually used at stack up. Verify which scan path autoDetectLocalProviders really uses before killing. Confirm supersession, then kill.
internal/validate/validate.go (whole package) 134 Generic CLI input-validation helpers (Namespace, WalletAddress, ChainName, Price, Path, NoControlChars) — built, tested, never wired to any command. ⚠️ Check first whether the CLI is missing input validation these were meant to provide; wiring in may beat deleting.
internal/openclaw/wallet.go, wallet_backup.go, wallet_resolve.go ~1200 OpenClaw-specific wallet import/backup/namespace-resolution — shadowed by the live hermes package equivalents (same names, different packages). Kill after verifying no OpenClaw runbook still documents these paths.
internal/openclaw/openclaw.go overlay-sync cluster SyncOverlayModels root removed in #747; unit-tested helpers (rankModels, patchAgentModelsJSON, patchOverlayModelList) remain, now with no prod caller. Wire in (model changes → overlay sync?) or kill helpers + tests.
internal/erc8004/client.go superseded methods ~150 Register/RegisterDetailed/SetAgentURI/SetMetadata/NewClient — cleanly superseded by the ...WithOpts(Detailed) variants prod calls. Kill (with their tests) — textbook superseded API.
internal/x402/chains.go ResolveAssetInfo/BuildV1Requirement, internal/x402/tokens.go TokenSupportedOnChain, internal/x402/serviceoffer_source.go RouteRulesForOffer ~200 Superseded x402 helpers; RouteRulesForOffer is pinned by a cross-package golden test (moderate blast radius). Kill the first three; decide on RouteRulesForOffer with the golden-test owner.
internal/hermes/hermes.go hermesExecArgs Doc comment self-identifies as "legacy argv-builder signature". Kill.

Not debt (deadcode false positives, verified): internal/images test-support exports ("exported for tests" by design), internal/ui.NewForTest, internal/enclave.LoadKey/DeleteKey (cross-package test setup), all legacy/deprecated-commented migration code (actively functioning compat paths).

Mechanical zero-reference deletions and stale flow-script fixes were applied in #747. Full triage table lives in that PR's history.

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