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
- 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.
- Both consumers use the SAME constant: the CLI (
zfa --version) and the MCP server.
- Expose the version in the MCP server too: a
--version flag AND the MCP protocol initialize response (serverInfo) — same constant, same value.
- 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.
Expected
zfa --versionand the MCP server report the current pubspec version (6.0.0). A version bump inpubspec.yamlshould 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 --versionprintsv5.1.0(lib/src/cli/cli_runner.dart:23 imports version.dart).bin/zuraffa_mcp_server.dart:19readslib/src/version.dartas a file (File('lib/src/version.dart')) — same stale value; and the stdio MCP server has no--versionflag at all (it just waits on stdin).Request — single source of truth, auto-updating
lib/src/version.dartfrompubspec.yaml(prebuild hook / small codegen step in the build scripts), OR read the package version at runtime — so the constant can never drift.zfa --version) and the MCP server.--versionflag AND the MCP protocolinitializeresponse (serverInfo) — same constant, same value.zfa doctoroutput 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.