Skip to content

[v6][tooling] zfa --version stale (5.1.0 vs pubspec 6.0.0) — single auto-updating version constant for CLI AND MCP server #260

Description

@arrrrny

Expected

zfa --version and the MCP server report the current pubspec version (6.0.0). A version bump in pubspec.yaml should propagate to both binaries automatically.

Actual (verified 2026-08-05, sandbox build via scripts/rebuild.sh)

  • lib/src/version.dart = const version = '5.1.0'; — hardcoded, stale.
  • zfa --version prints v5.1.0 (lib/src/cli/cli_runner.dart:23 imports version.dart).
  • bin/zuraffa_mcp_server.dart:19 reads lib/src/version.dart as a file (File('lib/src/version.dart')) — same stale value; and the stdio MCP server has no --version flag at all (it just waits on stdin).

Request — single source of truth, auto-updating

  1. Generate lib/src/version.dart from pubspec.yaml (prebuild hook / small codegen step in the build scripts), OR read the package version at runtime — so the constant can never drift.
  2. Both consumers use the SAME constant: the CLI (zfa --version) and the MCP server.
  3. Expose the version in the MCP server too: a --version flag AND the MCP protocol initialize response (serverInfo) — same constant, same value.
  4. Bonus: include the version in zfa doctor output so drift is visible.

Why it matters

The vendure-flutter-sdk consumer flow checks tool versions (constitution/runbook toolchain gate); a stale reported version (v5.1.0 vs actual 6.0.0) makes version-gating logic lie. Single constant + auto-generation removes the entire failure class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions