Skip to content

fix(relay): bump mix.exs to 0.29.4 + pin runtime vsn to declared version#13

Merged
priceflex merged 1 commit into
mainfrom
feature/relay-mixexs-version-bump-0.29.4
May 22, 2026
Merged

fix(relay): bump mix.exs to 0.29.4 + pin runtime vsn to declared version#13
priceflex merged 1 commit into
mainfrom
feature/relay-mixexs-version-bump-0.29.4

Conversation

@priceflex
Copy link
Copy Markdown
Owner

Summary

Bumps relay/mix.exs from version: "0.29.3""0.29.4" so the OTP release reports Application.spec(:ztlp_relay, :vsn) == "0.29.4" and stops lying about which git tag is actually running.

Adds three regression tests under describe "version reporting (regression pin)" in release_test.exs:

  1. Semver-shape guard on the declared version string.
  2. Runtime-vs-declared drift detector — fails if the loaded :ztlp_relay app's vsn doesn't match mix.exs. Catches the v0.29.4 defect class going forward.
  3. Floor guard at "0.29.4" — prevents accidental down-bump that would re-ship the pre-strict-routing relay.

Why

The v0.29.4 strict-routing tag (#12, 829abdf) was cut without bumping relay/mix.exs. A container built directly from the tag reports vsn = '0.29.3'. Health checks and on-call dashboards rely on this RPC value matching the deployed tag — especially during multi-version rollouts.

Discovered while doing a local-only docker build of priceflex/ztlp-relay:v0.29.4 from 829abdf to verify the deploy artifact builds clean:

$ docker exec relay /app/bin/ztlp_relay rpc 'Application.spec(:ztlp_relay, :vsn)'
{:version, '0.29.3', ...}   # ← wrong; image is built from the v0.29.4 tag

Tests

  • cd relay && mix test: 597 passed, 0 failures (was 594; +3 for the new pin tests).
  • TDD verified: with mix.exs still at "0.29.3", the floor-guard test fails with the expected diagnostic. Bumping makes 15/15 in release_test.exs.

Validation

  • Built priceflex/ztlp-relay:v0.29.4-vsnbump locally from this branch.
  • docker exec ... rpc 'Application.spec(:ztlp_relay, :vsn)' now reports {:vsn, "0.29.4"} ✅ — fix verified end-to-end on the actual deploy artifact.
  • Local cargo test --lib --release: 858 passed (unchanged).
  • Local ztlp.net launch tests: 48 passed (unchanged).

Follow-up (intentionally not in this PR)

  • The pushed v0.29.4 tag still points at 829abdf (pre-bump). Decide whether to cut a fresh tag (e.g. v0.29.5) including this bump, or fold it into the next functional release. No urgency — strict-routing is the substantive change; this is the operational cleanup.
  • gateway/mix.exs and ns/mix.exs are still at "0.24.0" — pre-existing drift, out of scope.
  • proto/Cargo.toml is at "0.29.3" — pre-existing drift, out of scope.

Risk

Pure metadata change. No runtime behavior, no FFI, no wire format, no test deletions. Pin tests are additive.

What
----
Bumps `relay/mix.exs` `version` from "0.29.3" to "0.29.4" so the OTP
release reports `Application.spec(:ztlp_relay, :vsn) == "0.29.4"` and
matches the git tag `v0.29.4` already pushed on `main` at `829abdf`.

Adds three regression tests under `describe "version reporting (regression pin)"`
in `relay/test/ztlp_relay/release_test.exs`:
  1. Semver-shape guard on the declared version string.
  2. Runtime-vs-declared drift detector — fails if the loaded
     `:ztlp_relay` application's vsn doesn't match `mix.exs`.
  3. Floor guard at "0.29.4" — prevents an accidental down-bump
     that would silently re-ship the pre-strict-routing relay.

Why
---
The v0.29.4 strict-routing tag (PR #12, `829abdf`) was cut without
bumping `relay/mix.exs`, so a container built directly from the tag
reports `vsn = '0.29.3'`. Health checks and on-call diagnostics run
`docker exec ztlp-relay /app/bin/ztlp_relay rpc 'Application.spec(...)'`
and that value goes straight into status dashboards. It must not lie
about which tag is actually running, especially when we have multiple
relay versions in the fleet during a rollout.

Details
-------
- `relay/mix.exs`: single-line version bump.
- `relay/test/ztlp_relay/release_test.exs`: new describe block with
  comments explaining why each assertion exists and how to debug
  it if it fails.
- No source/runtime changes to the relay. The contract on
  `pick_gateway_for_service/1` from v0.29.4 strict-routing is
  preserved exactly.

Tests
-----
- `cd relay && mix test`: 597 passed, 0 failures
  (was 594 on main; +3 for the new vsn-pin tests).
- TDD verified: with `mix.exs` still at "0.29.3", the floor-guard
  test fails with the expected message:
    `mix.exs version 0.29.3 is older than the v0.29.4 strict-routing tag`
  After the bump: 15/15 in `release_test.exs`.

Validation
----------
- Locally built `priceflex/ztlp-relay:v0.29.4-vsnbump` from this branch.
- Started the container and ran:
    docker exec ... /app/bin/ztlp_relay rpc \
      'IO.inspect({:vsn, to_string(Application.spec(:ztlp_relay, :vsn))})'
  Output: `{:vsn, "0.29.4"}` — fix verified end-to-end on the actual
  deploy artifact shape, not just the unit test.
- Local cargo test --lib --release (proto) unchanged: 858 passed.
- Local ztlp.net launch tests unchanged: 48 passed.

Follow-up
---------
- The existing pushed `v0.29.4` tag points at `829abdf`, which still
  has the pre-bump mix.exs. The bumped version will land on `main`
  via this PR; Steve to decide whether to cut a fresh tag (v0.29.5)
  that includes the bump, or to fold this into the next functional
  release. No rush — the strict-routing fix is the substantive change;
  this PR is the cosmetic/operational cleanup.
- `gateway/mix.exs` and `ns/mix.exs` are still at "0.24.0" — pre-existing
  drift, NOT addressed here to keep this PR scoped.
- `proto/Cargo.toml` is at "0.29.3" — also pre-existing drift on the
  Rust workspace, NOT addressed here.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Warning

Rate limit exceeded

@priceflex has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 51 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c44f743-b828-4ad5-9d7d-2a1642248807

📥 Commits

Reviewing files that changed from the base of the PR and between 829abdf and 61a5dc1.

📒 Files selected for processing (2)
  • relay/mix.exs
  • relay/test/ztlp_relay/release_test.exs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/relay-mixexs-version-bump-0.29.4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@priceflex priceflex merged commit d22afbf into main May 22, 2026
8 checks passed
@priceflex priceflex deleted the feature/relay-mixexs-version-bump-0.29.4 branch May 22, 2026 18:07
priceflex added a commit that referenced this pull request May 23, 2026
… with regression pins (#14)

What
- Bumps `gateway/mix.exs` and `ns/mix.exs` from 0.24.0 → 0.29.4.
- Bumps `proto/Cargo.toml` from 0.29.3 → 0.29.4.
- Adds the same "version reporting (regression pin)" describe block to
  `gateway/test/ztlp_gateway/release_test.exs` and
  `ns/test/ztlp_ns/release_test.exs` that PR #13 added for relay
  (semver shape + runtime-vs-declared drift + ≥0.29.4 floor guard).
- Adds `proto/tests/version_pin_test.rs` with two equivalent Rust-side pins
  (parseable semver + ≥0.29.4 floor guard) using the in-crate
  `ztlp_proto::updater::SemVer` to avoid taking a new external dependency.

Why
- PR #13 fixed the relay's version-string drift but explicitly left the rest
  of the tree as follow-up scope (handoff Known Problems #6: "gateway/mix.exs
  and ns/mix.exs at 0.24.0; proto/Cargo.toml at 0.29.3"). Gateway and NS had
  been pinned at 0.24.0 for five minor versions, so
  `Application.spec(:ztlp_gateway, :vsn)` and `Application.spec(:ztlp_ns, :vsn)`
  were lying about which tag was actually deployed — the exact bug class
  PR #13 fixed for relay. Same lie, three more components.
- Without regression pins on these other components, the same drift can
  silently recur on the next tag cut.

Details
- Floor guard uses `Version.compare(declared, "0.29.4") in [:gt, :eq]` (Elixir)
  / `actual.cmp(&floor)` (Rust) rather than asserting a literal version string.
  This is deliberate: literal-string assertions become test maintenance burden
  on every routine bump, whereas a floor guard only fails on accidental
  down-bumps below the v0.29.4 strict-routing tag.
- Runtime-vs-declared drift test catches both directions of the bug PR #13
  found: (a) mix.exs bumped but .app cache stale, and (b) tag cut without
  bumping mix.exs.
- Rust-side test re-uses the in-crate `updater::SemVer` parser rather than
  pulling in the external `semver` crate. This exercises the same code path
  the self-updater uses, so if that parser ever regresses both will catch it.
- mix.exs comment blocks explain the bump inline so future readers see the
  on-call story at the point of change, not just in the test file or handoff.
- No source-code logic changed; this is a version-string + test-only PR.
  Public API, wire format, and runtime behavior are untouched.

Tests (TDD discipline followed)
- RED step verified per-component before bump:
  * gateway: `mix test test/ztlp_gateway/release_test.exs --seed 0` →
    "mix.exs version 0.24.0 is older than the v0.29.4 strict-routing tag"
    (1/15 failures, all in the new floor-guard test, exactly as designed).
  * ns: `mix test test/ztlp_ns/release_test.exs --seed 0` →
    "mix.exs version 0.24.0 is older than the v0.29.4 strict-routing tag"
    (1/15 failures, identical message).
  * proto: `cargo test --test version_pin_test` →
    "proto/Cargo.toml version 0.29.3 is older than the v0.29.4 strict-routing
    tag" (1/2 failures, parseable-semver test still green so we know the
    fixture is sane).
- GREEN step after bumps:
  * gateway: 15/15 in release_test.exs; 835/835 in full `mix test` (seed 1).
    Note: seed 55290 surfaces two pre-existing test-ordering flakes
    (TLS port reuse in tls_phase2_test.exs and a GenServer teardown race in
    crl_server_test.exs) — both also reproduce on plain `main` and are
    unrelated to this PR. Confirmed by stash + checkout `main`-only files +
    rerun on the same seed.
  * ns: 15/15 in release_test.exs; 729/729 in full `mix test`.
  * proto: 2/2 in version_pin_test; 858/858 in `cargo test --lib --release`
    (matches the pre-branch baseline).

Validation (non-test)
- `cargo check --release` clean (31 pre-existing dead-code warnings in
  `proto/src/bin/ztlp-cli.rs` unchanged — Known Problems #4 scope).
- Relay suite re-run unchanged: 597/597 (confirms no cross-component
  collateral damage).
- ztlp.net Python suite unchanged: 48/48 in `tests.test_launch_app`.
- Infra untouched. No relay restart, no gateway restart, no NS restart.
  Live binaries still on v0.29.3 (relay) / v0.24.0 (gateway, ns) — actual
  deployment of the bumped versions is a separate, Steve-gated step.

Follow-up
- After merge, decide tag strategy with v0.29.4 already in the past:
  either (a) cut v0.29.5 that includes this + PR #13's mix.exs bump
  (cleanest), or (b) accept "tag is source of truth; mix.exs is
  best-effort" for the trailing v0.29.4 and reset on v0.30.0.
- Task #3 (per-zone HMAC `Config.registration_secret/0`) is still the
  prod-readiness blocker and is the hard dependency for the Bootstrap
  workstream (handoff §"HARD DEPENDENCY uncovered while locking in #5").
- Known Problems #4 (`cargo fix` pass on 31 dead-code warnings in
  `proto/src/bin/ztlp-cli.rs`) still open; left out of scope here to keep
  this PR tight.

Refs
- PR #12 (v0.29.4 strict-routing): 829abdf
- PR #13 (relay mix.exs vsn pin): d22afbf
- Handoff: ~/hermes_session_handoff.md "Known Problems #6", "Open Question #1"
priceflex added a commit that referenced this pull request May 23, 2026
…lean v0.29.5 tag (#15)

What
- Bumps `relay/mix.exs`, `gateway/mix.exs`, `ns/mix.exs` from 0.29.4 → 0.29.5.
- Bumps `proto/Cargo.toml` from 0.29.4 → 0.29.5.
- No test changes — the regression pins added in PR #13 / PR #14 still
  catch drift (semver-shape + runtime-vs-declared + ≥0.29.4 floor).

Why
- v0.29.4 tag was cut at commit `829abdf` BEFORE PR #13 and PR #14 bumped
  the four declared versions. That means a container built from the
  v0.29.4 tag reports its runtime vsn as the PRE-bump value, which is
  exactly the on-call-lying bug PR #13 introduced regression tests for.
- The fix is to cut a NEW tag whose commit POST-DATES the bumps. v0.29.5
  is the smallest possible bump that achieves this — pure version-string
  alignment, no functional change.
- After this PR merges and v0.29.5 is tagged: git tag == relay vsn ==
  gateway vsn == ns vsn == proto CARGO_PKG_VERSION == "0.29.5". The
  existing `release_test.exs` runtime-vs-declared drift test, run inside
  any container built from this tag, will report agreement instead of
  drift.

Details
- Floor guard in `release_test.exs` and `version_pin_test.rs` stays at
  0.29.4. This is deliberate: the floor is a stable lower bound, not the
  current version. Ratcheting it on every routine bump is the exact
  maintenance burden the floor-guard pattern was designed to avoid (see
  the PR #13/#14 commit messages). 0.29.5 satisfies ≥0.29.4, and an
  accidental down-bump below 0.29.4 (which would lose the strict-routing
  fix) is what the floor exists to catch.
- mix.exs comment blocks updated in-place to reference both PR #14 and
  this PR, so the version-line provenance is readable at the point of
  change without chasing PRs in git log.
- No source-code logic changed. Public API, wire format, runtime behavior
  unchanged.

Tests (green on this branch)
- `cd proto && cargo test --lib --release`: 858 passed
- `cd proto && cargo test --test version_pin_test`: 2 passed
- `cd relay && mix test`: 597 passed
- `cd gateway && mix test --seed 1`: 835 passed
  (seed 1 avoids the two pre-existing seed-55290 flakes in tls_phase2_test
  and crl_server_test — both documented in the handoff as Task #6 and
  unrelated to this PR.)
- `cd ns && mix test`: 729 passed
- `cd ztlp.net && python3 -m unittest tests.test_launch_app`: 48 passed
- Total: 3,069 tests, 0 failures.

The runtime-vs-declared drift test in each release_test.exs was the key
verification — it exercises the same `Application.spec/2` RPC that lies
on a misbuilt container. All three Elixir suites pass after the bump,
which means mix recompiled the .app files to match the new declared
version. This is the in-source-tree equivalent of the
`docker exec ... rpc 'Application.spec(_, :vsn)'` check that found the
original PR #13 bug.

Validation
- `git diff --stat` matches expectation: 4 files, ~23 insertions, ~19
  deletions (the changes are mostly comment-block updates around the
  one-character version bumps).
- No source code changes; no risk of breaking runtime behavior.
- No infra touched.

Follow-up (post-merge)
- Tag `v0.29.5` on main, push tag with openclaw SSH key, watch the
  Release workflow to green.
- Deploy `priceflex/ztlp-relay:v0.29.5` to staging relay
  (`34.218.240.106`) when Steve OKs the restart (iOS bench risk). A
  container built from v0.29.5 will report `:vsn = "0.29.5"` correctly,
  closing out the original PR #13 defect end-to-end.
- Task #2 (per-zone HMAC `Config.registration_secret/0`) remains the
  prod-readiness blocker and hard dependency for the Bootstrap workstream.

Refs
- PR #12 (v0.29.4 strict-routing): 829abdf
- PR #13 (relay mix.exs vsn pin): d22afbf
- PR #14 (gateway/ns/proto vsn pin): 0a6fbb6
- Handoff: ~/hermes_session_handoff.md "Active Tasks → Task 0" decision
  list (Option 1 — cut v0.29.5 immediately).
priceflex added a commit that referenced this pull request May 23, 2026
…0.29.6 tag (#23)

What
-----
Bump the four declared versions (relay/mix.exs, gateway/mix.exs,
ns/mix.exs, proto/Cargo.toml) from 0.29.5 to 0.29.6 so the upcoming
v0.29.6 git tag captures a coherent release where all four versions
agree.

Why
---
v0.29.6 is the coherent Phase 1 + 1.5 + 2 per-zone HMAC ship:
  * Phase 1 (PR #20, 7848f36) — relay HmacSecrets module + V1
    fallback path with 31 new tests.
  * Phase 1.5 (PR #21, 5f4085f) — relay V2 wire frames (0x0E
    GATEWAY_REGISTER_V2 / 0x0F CLIENT_ROUTE_V2) with explicit
    zone_id field. 13 new tests.
  * Phase 2 (PR #22, bff6cd5) — gateway HmacSecrets module +
    RelayRegistrar V2 emission gated by ZTLP_GATEWAY_USE_V2_FRAMES.
    25 new tests.

Per the v0.29.4 → v0.29.5 lesson (PR #14, PR #15), we bump declared
versions in the same commit that the tag will point at — not after,
so containers built from the tag report their correct vsn.

Details
-------
No code changes — pure version bump. Cargo.lock is gitignored at
proto/.gitignore:3 so it doesn't show in the diff; `cargo update -p
ztlp-proto` was run locally to refresh it for the workspace.

The regression-floor tests verify the bump is consistent:

  * proto/tests/version_pin_test.rs — both pin tests pass
  * relay/test/ztlp_relay/release_test.exs — 15/15 pass
  * gateway/test/ztlp_gateway/release_test.exs — 15/15 pass
  * ns/test/ztlp_ns/release_test.exs — 15/15 pass

Validation
----------
  cd ~/ztlp
  grep -rn '0\.29\.[0-9]' --include='*.exs' --include='*.toml' \
    relay/mix.exs gateway/mix.exs ns/mix.exs proto/Cargo.toml
  # Each file should now read 0.29.6 in its version: declaration

  cd ~/ztlp/proto && cargo test --test version_pin_test --release    # 2/2
  cd ~/ztlp/relay && mix test test/ztlp_relay/release_test.exs       # 15/15
  cd ~/ztlp/gateway && mix test test/ztlp_gateway/release_test.exs   # 15/15
  cd ~/ztlp/ns && mix test test/ztlp_ns/release_test.exs             # 15/15

Follow-up
---------
After this merges to main, tag v0.29.6 from the merge commit. Then
the deploy procedure (handoff § "Deploy procedure") builds relay +
gateway images from that tag and SSH-pipes them to the staging
hosts. Phase 3 operator rollout follows.

Refs
----
- Task #2 Phase 1+1.5+2 in `~/hermes_session_handoff.md`
- Design doc: `docs/per_zone_hmac_design.md`
- Prior tag bumps for context: PR #13 (relay 0.29.4), PR #14
  (gateway/ns/proto 0.29.4), PR #15 (all four 0.29.4 → 0.29.5)
priceflex added a commit that referenced this pull request May 24, 2026
…t floors (#41)

What:
  Coordinated version bump across all four component manifests to match
  the v0.30.3 git tag cut from a5993ee (PR #40 — Z2LS gateway-auth
  enrollment API). Floors in release_test.exs / version_pin_test.rs
  ratcheted from 0.29.4 → 0.30.3 so a future v0.30.4 cut without bumping
  these files will fail CI loudly.

Why:
  v0.30.0 through v0.30.2 produced Docker image tags and a git tag but
  did not have a coordinated four-component manifest bump. That's the
  exact PR #13/#14 drift class — runtime services on v0.30.2 containers
  report Application.spec(:ztlp_ns, :vsn) == '0.30.0' (or some other
  stale value depending on when they were last compiled). The
  release-version-pinning skill prescribes ratcheting the floor +
  bumping the manifests in one PR after the tag so the next tag cut
  exercises the floor.

Files:
  proto/Cargo.toml                            0.30.0 → 0.30.3
  ns/mix.exs                                  0.30.0 → 0.30.3
  relay/mix.exs                               0.30.0 → 0.30.3
  gateway/mix.exs                             0.30.0 → 0.30.3
  proto/tests/version_pin_test.rs             floor 0.29.4 → 0.30.3
  ns/test/ztlp_ns/release_test.exs            floor 0.29.4 → 0.30.3
  relay/test/ztlp_relay/release_test.exs      floor 0.29.4 → 0.30.3
  gateway/test/ztlp_gateway/release_test.exs  floor 0.29.4 → 0.30.3
  .gitignore                                  + .ssh/ (defense against
                                                 accidental key commits)

Tests:
  TDD: RED → bumped manifests → GREEN.

  RED (manifests still at 0.30.0, floors ratcheted to 0.30.3):
    ns:      mix.exs version 0.30.0 is older than the v0.30.3 Z2LS gateway-auth tag
    relay:   mix.exs version 0.30.0 is older than the v0.30.3 Z2LS gateway-auth tag
    gateway: mix.exs version 0.30.0 is older than the v0.30.3 Z2LS gateway-auth tag
    (proto deferred to CI — local cargo 1.75 doesn't grok Cargo.lock v4)

  GREEN (after bump, full release_test.exs per component):
    ns:      15 tests, 0 failures
    relay:   15 tests, 0 failures
    gateway: 15 tests, 0 failures

  The runtime-vs-declared drift test (Application.spec/2 == mix.exs)
  also passes in GREEN, confirming the OTP .app cache was recompiled
  correctly after the bump.

Validation:
  - Full relay test suite running in background to confirm no collateral
    damage from the bump.
  - CI on the PR will exercise proto/tests/version_pin_test.rs (the
    floor guard there is the inverse direction — fails if Cargo.toml
    drops below the floor).

Follow-up:
  - Cut v0.30.4 from THIS commit so the tag and four-component manifests
    agree (the v0.30.3 tag is the 'tag points at pre-bump commit' case
    per the release-version-pinning skill).
  - Rebuild + redeploy ztlp-node and ztlp-bootstrap images tagged
    v0.30.4 so the on-disk SaaS state catches up to the source.
  - Bootstrap currently has no version manifest (Rails app, not a
    packaged artifact). Adding a VERSION file + initializer + test is
    listed in docs/plans/2026-05-24-z2ls-via-gateway-admin-auth.md as
    a follow-up — kept out of this PR to keep the scope tight.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant