Skip to content

Adopt the shared build-identity contract: pty has no --version, and three numbers claim to be its version #107

Description

@schickling-assistant

pty has no build identity at all, and three different numbers claim to be its version.

Today

  • pty --versionUnknown command: --version, exit 1. There is no version flag.
  • Three disagreeing version literals:
    • package.json0.10.0
    • flake.nix0.1.0 (so the built store path is named pty-0.1.0)
    • a downstream conformance check asserts pty 0.11.0
  • Nothing in src/ reads package.json, embeds a git rev, or carries a build stamp.
  • The TUI and session-manager screens render no version; the wire protocol carries no version field; there is no telemetry, so no service.version.

Net effect: given a running pty, there is no way to determine which source snapshot it was built from.

Proposed: adopt the shared build-identity contract

Model the same canonical fields we use in our other CLIs, and derive two outputs from them:

field meaning
baseVersion package version from the manifest
rev short VCS revision of the built source
dirty uncommitted changes present at build/run time
sourceKind local (running from a checkout) or nix (packaged build)
commitTs commit timestamp
  • machineVersion — stable and parseable, for telemetry, APIs, logs, and exact comparison: 0.10.0, 0.10.0+7d5211e, 0.10.0+7d5211e-dirty. No prose, no relative time.
  • displayVersion — human-facing, for --version and UI surfaces: 0.10.0+7d5211e — committed 4 days ago, with uncommitted changes.

Canonical names, so this stays consistent with our other tools:

  • source placeholder: __CLI_BUILD_STAMP__
  • runtime env var for source runs: CLI_BUILD_STAMP

Scope

  • Add pty --version, printing displayVersion; make machineVersion available internally for diagnostics.
  • Inject the stamp at build time by substituting __CLI_BUILD_STAMP__; fall back to CLI_BUILD_STAMP when running from source.
  • Collapse the version literals to one source of truth — derive the flake version from the manifest instead of maintaining a second number.
  • Surface the same identity in the TUI (footer or debug view). Space-constrained surfaces may abbreviate but must not change semantics.

Unlike the sibling repos, pty is packaged by its own flake, so both halves — the CLI-side resolver and the build-time stamp injection — land here.

Sibling issues adopting the same contract: compoundingtech/smalltalk#103, compoundingtech/convoy#83. The three should land the same field names and the same two derived outputs so a version string means the same thing across the toolchain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions