Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .cursor/skills/verify-anyr/artifacts/update-progress/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Proof: update-progress

Feature: `update-progress`
Entry points driven: `anyr update` (fixture, non-TTY), `anyr update --check`, `anyr update` on a PTY
Harness: `.cursor/skills/verify-anyr/control-anyr` (`launch`, `doctor`, `cli`, `pty run`, `test`, `cleanup`)
Binary: `target/debug/anyr` from this checkout (`0.1.11`)
Isolated home: `/tmp/anyr-verify-20260903-060715-6103/home` (removed by cleanup)
Releases: `tests/fixtures/releases.json` via `ANYR_RELEASES_JSON` (offline)

## Commands

```bash
.cursor/skills/verify-anyr/control-anyr launch
.cursor/skills/verify-anyr/control-anyr doctor
ANYR_RELEASES_JSON="$(.cursor/skills/verify-anyr/control-anyr path RELEASES_FIXTURE)"
ANYR_CHANNEL=beta
.cursor/skills/verify-anyr/control-anyr cli --out artifacts/update-progress/update.txt -- update
.cursor/skills/verify-anyr/control-anyr cli --out artifacts/update-progress/check.txt -- update --check
ANYR_SPINNER_MS=20 ANYR_SPINNER_MIN_TICKS=6 \
.cursor/skills/verify-anyr/control-anyr pty run --timeout 6 --out artifacts/update-progress/tty.txt -- update
.cursor/skills/verify-anyr/control-anyr test -- --test cli update_prints_from_to_channel_and_success
.cursor/skills/verify-anyr/control-anyr test -- --test cli update_spinner_animates_on_tty
.cursor/skills/verify-anyr/control-anyr cleanup
```

## Results

| Artifact | Exit | Observable |
| --- | --- | --- |
| `update.txt` | 0 | `Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)`, `✔ Would update to v0.2.0-beta.1`, `Run anyr to start using the new version.` Fixture mode does not replace the binary. |
| `check.txt` | 0 | labeled `current:` / `latest:` / `channel: beta` and `update available` |
| `tty.txt` | 0 | PTY transcript: 10 carriage returns, 6 distinct spinner glyphs (`⠋⠙⠹⠸⠼⠴`), from→to, `beta channel`, success checkmark, restart hint |
| `frames.txt` | — | binary counts for `tty.txt` (animation proof) |

Complementary suite: `update_prints_from_to_channel_and_success` and `update_spinner_animates_on_tty` passed. Lib tests `spinner::tests::live_spinner_writes_multiple_changing_frames` and `upgrade::tests::updating_line_shows_from_to_and_channel` passed.

No `anyr claude` without `--dry-run`. No paid tokens. No live GitHub Releases.

## Cleanup

`control-anyr cleanup` removed the isolated workdir and left this `artifacts/update-progress/` tree in place.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
current: 0.1.11 (built 2026-09-03 06:05:55)
latest: 0.2.0-beta.1
channel: beta
asset: https://github.com/anyrouter-dev/cli/releases/download/v0.2.0-beta.1/anyr-linux-x86_64
status: update available 0.1.11 -> 0.2.0-beta.1
run: anyr update
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
10 changes: 10 additions & 0 deletions .cursor/skills/verify-anyr/artifacts/update-progress/doctor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ok binary /workspace/target/debug/anyr
ok version 0.1.11 (built 2026-09-03 06:05:55)
ok help anyr --help names CORE COMMANDS / LAUNCH
ok isolated ANYROUTER_HOME=/tmp/anyr-verify-20260903-060715-6103/home
ok config /tmp/anyr-verify-20260903-060715-6103/home/config.yaml
ok config_path config path=/tmp/anyr-verify-20260903-060715-6103/home/config.yaml
ok whoami whoami shows masked default profile
ok update_guard ANYR_NO_UPDATE=1 ANYR_NO_CATALOG=1
ok pty stopped
ok paid_guard do not run anyr claude/codex/… without --dry-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bytes=419
cr_count=10
distinct_frames=6
frames=⠋⠙⠹⠸⠼⠴
has_updating=True
has_beta_channel=True
has_from_to=True
has_hint=True
3 changes: 3 additions & 0 deletions .cursor/skills/verify-anyr/artifacts/update-progress/tty.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
⠋ Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)⠙ Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)⠹ Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)⠸ Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)⠼ Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)⠴ Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)✔ Would update to v0.2.0-beta.1

Run anyr to start using the new version.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Updating v0.1.11 -> v0.2.0-beta.1 (beta channel)
✔ Would update to v0.2.0-beta.1

Run anyr to start using the new version.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions .cursor/skills/verify-anyr/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ Keep implementation details out of the map. Name only user paths, stable handles
- [TUI launcher](./tui-launcher.md) covers `menu --dump-tui`, `config --dump-tui`, and optional PTY quit.
- [Accounts and config](./accounts-and-config.md) covers whoami, account switch, config path, and logout against the isolated home.
- [Per-agent bindings](./per-agent-bindings.md) covers inline model/account/key binds per coding agent and launch that honors per-agent keys.
- [Update progress](./update-progress.md) covers `anyr update` from→to + channel copy, the success hint, and a TTY spinner that actually ticks.
38 changes: 38 additions & 0 deletions .cursor/skills/verify-anyr/features/update-progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Update progress

`anyr update` shows a ticking spinner with the current → target version and configured channel, then a checkmark success line and a restart hint. The loader must actually move; a frozen `[loading icon]` is a fail.

## Sub-features

- `update-copy` prints `Updating vX -> vY (<channel> channel)` using the running binary version and the selected GitHub channel.
- `update-success` prints `✔` plus the new version and `Run anyr to start using the new version.`
- `update-spinner` on a TTY rewrites the status line with changing spinner frames (`\r` plus distinct glyphs).
- `update-check` keeps the labeled current/latest/channel report and does not install.

## How to get to it (user POV)

- Run `anyr update` to install the latest release for the configured channel.
- Run `anyr update --beta` or `anyr update --stable` to persist a channel and update it.
- Run `anyr upgrade` (alias) the same way.
- Run `anyr update --check` to compare versions without installing.

## Driving it with control-anyr

Preconditions:

- `control-anyr doctor` is clean.
- Isolated `ANYROUTER_HOME` is in use.
- Set `ANYR_RELEASES_JSON` to `control-anyr path RELEASES_FIXTURE` so the run stays offline.
- Do not hit live GitHub Releases.

- **Non-TTY copy.** Export `ANYR_RELEASES_JSON` to the fixture and `ANYR_CHANNEL=beta`. Run `control-anyr cli --out artifacts/update-progress/update.txt -- update`. Exit code `0`. Stdout contains `Updating`, `->`, `beta channel`, a fixture target version (`0.2.0-beta.1`), `✔`, and `Run anyr to start using the new version.` Stdout does not invent model ids.
- **Check still reports.** Run `control-anyr cli --out artifacts/update-progress/check.txt -- update --check`. Exit code `0`. Stdout contains `current:`, `latest:`, `channel:`, and either `update available` or `up to date`.
- **TTY spinner ticks.** Export `ANYR_RELEASES_JSON`, `ANYR_CHANNEL=beta`, `ANYR_SPINNER_MS=20`, and `ANYR_SPINNER_MIN_TICKS=6`. Run `control-anyr pty run --timeout 6 --out artifacts/update-progress/tty.txt -- update`. The transcript contains at least two distinct spinner glyphs from `⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏`, a carriage return, `Updating`, `beta channel`, and `Run anyr to start using the new version.`
- **Proof.** Keep `update.txt`, `update.txt.exit`, and `tty.txt`. Together they show from→to + channel copy and that the loader frames change.

## Gotchas

- Fixture mode does not replace the binary (`ANYR_RELEASES_JSON` is treated as dry-run). Success copy is `Would update to` instead of `Updated to`.
- `control-anyr cli` is not a TTY, so it will not animate. Use `pty run` for frame-change proof.
- `ANYR_NO_UPDATE=1` only skips background auto-update. Explicit `anyr update` still runs.
- Existing coverage lives in `tests/cli.rs` (`update_prints_from_to_channel_and_success`, `update_spinner_animates_on_tty`) and `src/spinner.rs`. Run those as a complement, not as the only user-path proof.
7 changes: 7 additions & 0 deletions src/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ Channels:
Downloads:
https://github.com/anyrouter-dev/cli/releases/download/<tag>/anyr-<os>-<arch>

While installing, a spinner ticks with the from → to versions and channel:

⠋ Updating v0.1.11 -> v0.1.99 (stable channel)
✔ Updated to v0.1.99

Run anyr to start using the new version.

--check reports current vs latest without installing.
--fixture <path> / ANYR_RELEASES_JSON skips the network (tests / dry-run).
--channel stable|beta overrides the config file for this run only.
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mod parse;
#[cfg(feature = "native")]
pub mod relay;
pub mod spawn;
pub mod spinner;
pub mod term;
#[cfg(feature = "native")]
pub mod tui;
Expand Down
Loading
Loading