Step 1 of the approved UX plan (#101, #102): the model, the resolver, the store and the CLI. No desktop UI change yet (step 2: the wizard; step 3: Settings).
Account.TokenSource (Own | Default): Default accounts reference the default token saved in Settings and never copy it, so rotating it rotates every such account. Own is the on-disk default and is omitted from accounts.json, so existing files and vault entries stay byte-identical (round-trip tests).
AccountTokenResolver: the one place that turns an account into its token, with a source-specific "missing" description. Used by WorkspaceViewModel, Sync All (through the workspace) and gclo sync --account.
AccountsStore: a Default account is saved with no vault entry (a token for it is rejected); switching to Default removes the own entry vault-first with the same compensation as a delete (consistency tests for the restore and the double-failure paths); CountUsingDefaultToken() for Settings.
CLI: accounts add|edit --use-default-token (fatal when no default token is saved; exclusive with the other token options), accounts list token column + tokenSource JSON field, sync --account errors name the source and the fix. Help text and docs/CLI.md updated.
## What
Step 1 of the approved [UX plan](docs/plans/default-token-ux.md) (#101, #102): the model, the resolver, the store and the CLI. No desktop UI change yet (step 2: the wizard; step 3: Settings).
- `Account.TokenSource` (`Own` | `Default`): `Default` accounts **reference** the default token saved in Settings and never copy it, so rotating it rotates every such account. `Own` is the on-disk default and is omitted from `accounts.json`, so existing files and vault entries stay byte-identical (round-trip tests).
- `AccountTokenResolver`: the one place that turns an account into its token, with a source-specific "missing" description. Used by `WorkspaceViewModel`, Sync All (through the workspace) and `gclo sync --account`.
- `AccountsStore`: a `Default` account is saved with no vault entry (a token for it is rejected); switching to `Default` removes the own entry vault-first with the same compensation as a delete (consistency tests for the restore and the double-failure paths); `CountUsingDefaultToken()` for Settings.
- CLI: `accounts add|edit --use-default-token` (fatal when no default token is saved; exclusive with the other token options), `accounts list` token column + `tokenSource` JSON field, `sync --account` errors name the source and the fix. Help text and `docs/CLI.md` updated.
- Threat model T5 + revision row.
Closes #104 (part of #102, #62).
## How it was tested
- `dotnet build -warnaserror` 0 warnings; `dotnet format --verify-no-changes` clean.
- `gclo.Engine.Tests` 447/447 (+22), `gclo.Cli.Tests` 142/142 (+13); line coverage 100% on `gclo.Engine`, `gclo.ViewModels` and `gclo`.
Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Step 1 of the approved UX plan (#101, #102): the model, the resolver, the store and the CLI. No desktop UI change yet (step 2: the wizard; step 3: Settings).
Account.TokenSource(Own|Default):Defaultaccounts reference the default token saved in Settings and never copy it, so rotating it rotates every such account.Ownis the on-disk default and is omitted fromaccounts.json, so existing files and vault entries stay byte-identical (round-trip tests).AccountTokenResolver: the one place that turns an account into its token, with a source-specific "missing" description. Used byWorkspaceViewModel, Sync All (through the workspace) andgclo sync --account.AccountsStore: aDefaultaccount is saved with no vault entry (a token for it is rejected); switching toDefaultremoves the own entry vault-first with the same compensation as a delete (consistency tests for the restore and the double-failure paths);CountUsingDefaultToken()for Settings.accounts add|edit --use-default-token(fatal when no default token is saved; exclusive with the other token options),accounts listtoken column +tokenSourceJSON field,sync --accounterrors name the source and the fix. Help text anddocs/CLI.mdupdated.Closes #104 (part of #102, #62).
How it was tested
dotnet build -warnaserror0 warnings;dotnet format --verify-no-changesclean.gclo.Engine.Tests447/447 (+22),gclo.Cli.Tests142/142 (+13); line coverage 100% ongclo.Engine,gclo.ViewModelsandgclo.Generated with Claude Code