Skip to content

core: dead code — unused output-parser facade, below-min probe, dead branches in ensureRootBindingIndex and version.ts #156

Description

@Dione-b

Summary

Dead or misleading code in @caatinga/core:

  1. Unused facadestellar-cli/stellar-cli-output-parser.ts is only imported by its own test; all production callers import parse-contract-id/parse-wasm-hash/version directly, so the promised "single contract surface for output-format changes" is not actually used.
  2. Below-min probe underreportsprobe-stellar-cli-features.ts:26-28 returns only ["contract-invoke-sign"] for version < STELLAR_CLI_MIN_VERSION, ignoring contract-build and contract-deploy.
  3. Dead branchbindings/patch-generated-binding-package.ts:226-236: ensureRootBindingIndex returns without writing in both the "matches" and "differs" cases; only the catch (file absent) writes, making the two branches indistinguishable.
  4. Dead __filename branchsrc/version.ts:3-5: __filename is never defined in ESM, so the ternary always uses import.meta.url; the declare const is noise.

Why it matters

Dead branches and an unused facade give false confidence about behavior and output-parsing coverage.

Suggested fix

  • Either migrate callers to the facade and export it from index.ts, or delete it
  • Return all STELLAR_CLI_REQUIRED_FEATURES when below min
  • Collapse ensureRootBindingIndex to try { readFile; return } catch { writeFile }
  • Drop the __filename handling in version.ts

Priority: Low | Release impact: Patch | Breaking: No

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

    Stellar WaveIssues in the Stellar wave programarea: stellar-cliStellar CLI version checking, compat, parsingenhancementNew feature or requestpriority: lowLow priority fix - tech debt or minor consistency

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions