Repository navigation
feat(cli): pin and unpin conversations and workspaces; harden a catalogue-lane wait; bump skills - #1625
Merged
Conversation
The desktop app's pinned section had no CLI: `future session list` is a gRPC call to the Agent, which has no notion of a pin, and nothing read the flag the app stores on `threads.pinned` / `workspaces.pinned`. So a user could see the section in the app and had no way to inspect or change it from a terminal. Adds both scopes, both directions, and both listings: future session pin|unpin <session-id> future session pinned [--json|--format toon] future workspace pin|unpin <path|id|name> future workspace list --pinned [--json] The writes go through `store::pin_thread` / `store::pin_workspace` — the same calls the app and the remote bridge use — so the catalogue-dirty signal that tells the app and a paired phone to re-read is not bypassed, and `pinned` stays an ordering flag rather than becoming an activity event: neither `updated_at` nor `last_opened_at` is rewritten, which a test asserts at both scopes. The readings use the store's own queries (`list_pinned_threads` with the app's `Recent` scope, `list_pinned_workspaces`), so the terminal, the sidebar and the phone cannot disagree about what is pinned or in which order. Two consequences of the app's existing rules are reported rather than left to be discovered: archiving clears the pin (a pinned row on the shelf would hide behind it), so `unpin` is not the inverse of `archive`; and a pin on an archived row, or on a row inside an archived workspace, is stored while the section keeps it out of sight — the note names whichever restore command applies, read from the row and its workspace. Both are easy to get wrong: the first draft printed that note on a successful *unpin* of a live row, and inferred the cause instead of reading it, which only showed up against the real store. Reads never create the app database (`open_existing` first), so a machine that never ran the app gets `count: 0` and an empty-state line, or `[]` under `--json` — not an error, and not a new file. A store `workspace add` created without a `threads` table lists nothing rather than failing on the missing table. The archive module's shared helpers (`parse_target`, `desktop_store`, `resolve_workspace`, `with_flag`, `pretty`) are now `pub(super)` and its test harness moved to `test_store`, rather than duplicating either in the new module.
`catalogue_window_lane_sends_the_newest_rows_and_names_the_rest` failed on
Windows (run 43502377622) at
assertion `left == right` failed: a deleted conversation is named, not
left to be inferred
left: Array []
right: Array [String("sesswindowborn-7856-764")]
The wait had been satisfied — by the wrong packet. It was
`await_publish(&mut tap, &subject, ..)`, which answers with *the next packet on
the subject*: the lane publishes one packet per change, so a second packet on
`p.{pair}.state.sessions` describing the state *before* the deletion (the same
change detected twice, a restarted loop's resync, a second publisher
generation) is taken as the answer, and `removed` reads `[]`. The tap is also a
256-slot ring over a 100/s heartbeat, so the same wait loses a change-driven
packet outright when the reader is descheduled — the reason the bridge test
already reads the broker record instead (#1606).
Both waits now do that: `FakeNats::await_publish` reads the record (nothing is
dropped, and a packet published before the wait began is still found) and is
keyed by `accepts` — the packet that *says* what the caller awaits — not by the
next arrival. The window and delta lane tests ask for `full: true`, for the
packet naming the row that was born, and for the one naming the removal.
The window test also publishes the shift packet once more before deleting: that
one repeated packet is the flake's timing, made deterministic. With the old
wait it is taken and the test fails with the output above, byte for byte; with
the condition-keyed wait it is skipped and the test is green. A wait that times
out now names the newest packet on the subject instead of only the budget.
host: cargo test -p future-host --lib remote → 715 passed, 0 failed
(the window test 5x, the delta lane 1x, the four await_publish tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
dev-huichenbrings the desktop app's pinned section to the terminal, hardens the host catalogue-lane test that flaked on Windows, and bumps the skills submodule to the revision that documents pinning.Commits
feat(cli): pin and unpin conversations and workspaces from the terminal— addsfuture session pin|unpin <session-id>,future session pinned,future workspace pin|unpin <path|id|name>andfuture workspace list --pinned. The writes go throughstore::pin_thread/store::pin_workspace, the same calls the app and the remote bridge use, so the catalogue-dirty signal that makes the sidebar and a paired phone re-read is not bypassed.pinnedstays an ordering flag rather than activity: neitherupdated_atnorlast_opened_atis rewritten. Archiving still clears a pin, and a pin that the pinned section hides (archived row, or a row inside an archived workspace) is stored with a note naming the restore command. Reads useopen_existing, so a machine that never ran the app reportscount: 0instead of creatingapp.db.archive.rs's shared helpers becomepub(super)and its test harness moves totest_storeinstead of being duplicated.test(host): name the packet a catalogue-lane wait is waiting for—FakeNats::await_publishnow reads the broker record and is keyed by what the caller awaits instead of taking the next packet on the subject, so the window and delta lane tests no longer consume a stale duplicate packet (the Windows failure in run 43502377622) or lose a change-driven one to the 256-slot ring under a 100/s heartbeat. A wait that times out now names the newest packet on the subject.chore(skills): bump future-skills to document pinning (#125)— submodule pointer only (b0128a51→9a664399).Verification
Pinned toolchain 1.99.1 (Homebrew 1.96.0 shadowed off PATH),
ulimit -n 8192, run in the main checkout ata0175e0d3with a clean tracked tree:cargo fmt --all -- --check→ cleancargo check -p future-cli -p future-host --all-targets→ clean (29s)cargo clippy -p future-cli -p future-host --all-targets -- -D warnings→ clean (25s)cargo test -p future-host --lib→ 2261 passed, 0 failed, 15 ignored (444s)cargo test -p future-cli --lib→ 1630 passed, 0 failed (79s)make check-docs→ 421 docs OK, 0 pairs pending, provider matrix 13 rowsUser-visible changes
future session pin|unpin|pinnedandfuture workspace pin|unpin, plusfuture workspace list --pinned. Before: the pinned section existed only in the desktop app, and a terminal user could neither inspect nor change it. After: both scopes can be pinned, unpinned and listed, with--json/--format toonoutput, and the app and a paired phone pick the change up on their next read. Revert42a02d4d5.unpinis not the inverse ofarchive; a pin on an archived row or inside an archived workspace is stored but hidden, and the command prints the note naming the restore command. No new default, setting, migration or wire field: the commands read and write the existingthreads.pinned/workspaces.pinnedcolumns and never createapp.dbon a read.