From e7e8b616aa273e7ab0dcd2dbbf8b01a30376c42d Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 15 Nov 2026 21:33:46 -0500 Subject: [PATCH] docs(transfer): state the mixed-version move rules and the reference build workspaces.md now says when a target refuses a segment from another build and what a change to a carried table must avoid. testing.md describes move_versions_test.py, the pinned reference build, its cache, how to bump the pin, and the move to the reference that 4de2d000 broke. --- robot-docs/testing.md | 47 ++++++++++++++++++++++++++++++++++++++++ robot-docs/workspaces.md | 24 ++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/robot-docs/testing.md b/robot-docs/testing.md index 17c2ea831..5e02f9c68 100644 --- a/robot-docs/testing.md +++ b/robot-docs/testing.md @@ -78,6 +78,52 @@ scenario that owns that home. Run the script on the scratch root to clear processes left by an interrupted run. That also stops the daemons of a gate still running in another checkout. +## Mixed-version moves + +[`move_versions_test.py`](../test/e2e/move_versions_test.py) moves sessions +between this checkout's daemon and an older reference daemon, in both +directions. Both run as peer daemons. The move is the real one, over the +loopback ssh that `move_test.py` uses. Each session carries a transcript, kernel +cells, a memory note, a work item, a vent, a delivered webhook letter, a +schedule, and a workspace link. The scenario finishes the checklist and runs a +cell and a turn on the target. A third scenario adds a column only this daemon +has to `sessions`. It checks that the reference refuses the manifest at staging +with `transfer_version` and that the source keeps the session. The rules these +scenarios check are in +[moves between versions](workspaces.md#moves-between-versions). + +[test/reference-daemon.sh](../test/reference-daemon.sh) pins the reference +commit in `REFERENCE`. Albedo has no release tags, so the pin is a commit on +`main`. The script extracts it with `git archive`, builds it with that commit's +own `test/snapshot-daemon.sh` and its CLI, and prints the directory. It fetches +the commit first when a shallow clone lacks it. Builds are cached under +`ALBEDO_REFERENCE_CACHE`, which defaults to `~/.cache/albedo-reference`, one +directory per commit. A cold build took 37 s on a developer machine with warm +Hex and Go module caches. A cached run returns at once. CI keeps the directory +in its `albedo-reference` cache, keyed by the script, so `./test.sh --full` +builds it once per pin. + +Bump the pin when a commit that users run lands, such as one deployed to another +host, or when the reference falls back past a transfer protocol change. + +1. Set `REFERENCE` to the full commit hash. +2. Run `nix develop -c python3 test/e2e/run.py move_versions_test.py`. +3. Report any failure as an incompatibility between the two builds. Do not + loosen an assertion to make it pass. + +[`areas.toml`](../test/e2e/areas.toml) selects the file for changes to transfer +code, adapters, migrations, and the core tables in `conversation.gleam` and +`mail.gleam`. A schema change in another owner reaches it only through +`./test.sh --full`. Run it directly after adding a column or table that a +transfer carries. + +The move from this daemon to the reference is marked `expectedFailure`. Commit +`4de2d000` added the carried columns `sessions.pending_switch_caller`, +`pending_switch_provider`, `pending_switch_model` and `mail.held_until`, and the +carried table `session_side_questions`. The reference refuses that manifest with +`core/sessions here lacks pending_switch_caller, pending_switch_provider, pending_switch_model`. +Remove the mark with the fix. + ## Offline Antigravity scenarios [`antigravity_test.py`](../test/e2e/antigravity_test.py) drives the real adapter @@ -112,3 +158,4 @@ checks are separate from the automated gate. - [Change guidance](contributing.md) - [Gleam lint](gleam-lint.md) - [Storage migrations](migrations.md) +- [Workspaces and moves](workspaces.md) diff --git a/robot-docs/workspaces.md b/robot-docs/workspaces.md index dd4f63ba9..794e10053 100644 --- a/robot-docs/workspaces.md +++ b/robot-docs/workspaces.md @@ -59,6 +59,29 @@ After a move, extensions reach the session's new daemon through `extension.Daemon.tell_refused` and `hook_gone`. These callbacks keep relay and refusal behavior with [`moves`](../src/albedo/daemon/moves.gleam). +### Moves between versions + +A move runs between daemons of different builds when both speak the same +`transfer.protocol`. The source checks the target's protocol before it exports. +Moves must work in both directions, to an older daemon as well as from one. The +target refuses a segment at staging in `transfers.known` when: + +- its owner is an extension the target lacks (`transfer_unsupported`) +- its table is one that owner does not carry there (`transfer_unsupported`) +- its table version differs (`transfer_version`) +- it has a column the target's table lacks (`transfer_version`, as + `owner/table here lacks column`) + +The manifest lists every carried table and every column, including empty ones. A +new column or table in a carried table therefore breaks moves to older daemons. +Keep new local state in a table no transfer carries, as +[extensions](extensions.md) describes. Keep adapter names stable, because the +target finds a segment's adapter by its owner name. Settle imported rows from an +older daemon in the adapter's `activate`. +[`move_versions_test.py`](../test/e2e/move_versions_test.py) moves sessions both +ways between this checkout and a pinned older build. See +[mixed-version moves](testing.md#mixed-version-moves). + ## Browsing [`folders.directory`](../src/albedo/daemon/folders.gleam) returns a directory @@ -72,3 +95,4 @@ unavailable host is a distinct failure from a missing local directory. - [Change guidance](contributing.md) - [Worktrees](worktrees.md) - [Session attachment](sessions.md) +- [Test execution](testing.md) -- knotmirror 0.0.1