Skip to content

Say which copy of a session you are reading, and pick one with -a everywhere - #21

Merged
lr00rl merged 1 commit into
mainfrom
feature/20261022_which-copy
Oct 23, 2026
Merged

lr00rl merged 1 commit into
mainfrom
feature/20261022_which-copy

Conversation

@lr00rl

@lr00rl lr00rl commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Summary

A session copied between accounts keeps its id. show took -a to pick a copy, but log, export and view rejected it (ccli log 1087b979 -a default failed), and none of them said which copy they had chosen.

  • show, log, export and view all take -a <account>, the same as writing <account>:<id>. Naming two different accounts is refused; an unknown account is reported. view without an id takes -a as a list filter, like the list commands.
  • Without an account they still use the copy with the latest activity, and now say on stderr which copy that is and how to pick another.
  • In a copy's ccli log, turns that came in with a copy or a fork show copied in the COST column, and a line under the table says where they came from and where their usage counts (from the ledger's byte ranges, so only for copies ccli made). show's copies section says the same in one line.
  • README gains a "Sessions, copies and accounts" reference: each entity, how to name it, and per command what it works on and what -a means. Tutorial and DESIGN.md follow.

Test plan

  • go vet ./..., gofmt -l ., go test ./...
  • New tests: the read commands' stderr note and -a; log -a work marking copied turns and log default:<id> not; conflicting accounts refused; unknown account refused; notes for a copy and a fork.
  • On the real index: ccli log 1087b979 names the talcum copy and marks turns 1 to 99 as copied from default; ccli log 1087b979 -a default reads default's copy; -a default with talcum:1087b979 is refused.
  • -h of every list command shows -a as documented.

…-a everywhere

A session copied between accounts keeps its id, and the commands that
read one session disagreed about how to choose a copy: show took -a,
log, export and view rejected it, and none of them said which copy they
had picked. `ccli log 1087b979 -a default` failed with "flag provided but
not defined".

show, log, export and view now all take -a <account>, which means the
same as writing <account>:<id>; naming two different accounts is
refused, and an unknown account is reported. Without one they use the
copy with the latest activity, as before, and now say on stderr which
copy that is and how to pick another. view without an id takes -a as a
filter on its list, as the list commands do.

A copy's turn list explained nothing about its blank costs. log now
writes `copied` in the COST column of the turns that came in with a copy
or a fork, from the ledger's byte ranges, and a line under the table
names where they came from and where their usage counts. show's copies
section says the same in one line.

The README gains a "Sessions, copies and accounts" reference: what an
account, session, copy, fork, turn and agent are, how to name each, and
for every command what it works on and what -a means there. The
tutorial and DESIGN.md follow.
@lr00rl
lr00rl merged commit ef0675e into main Oct 23, 2026
2 checks passed
@lr00rl
lr00rl deleted the feature/20261022_which-copy branch October 23, 2026 09:34
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