Config: TOML config and state, token resolution, host selection #5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
lazyforge needs to know which forge to talk to and how to sign in, and it has to save that as TOML. This ticket is the config layer. The onboarding, Settings and host-picker screens on top of it moved to #24.
Plan
internal/config: load and saveconfig.tomlandstate.tomlas described in ADR 0004 (atomic writes;0600and a permission check whenever a pasted token is stored; XDG paths). Validation errors name the field.token_cmdthroughsh -cwith a timeout, or use the storedtoken. Tokens are never logged and never appear in error strings.require_green_cion the host, plus a per-repo override table.--host, then the only configured host, thendefault_host, otherwise report that the picker is needed (#24 builds it).--config <path>overrides the config location.Depends on
#4 (merged).
Context
docs/architecture.md→ "Configuration and stored state".go-development→ I/O, context and secrets. The TOML dependency (BurntSushi/toml) is already approved in ADR 0004.Out of scope
OS keyring storage (later). All screens (#24).
Config file, token_cmd and host selectionto Onboarding, Settings screen and TOML configOnboarding, Settings screen and TOML configto Config: TOML config and state, token resolution, host selection🤖 Split: this ticket bundled the config layer with three screens (onboarding, Settings, host picker). The screens should follow the UI patterns #8 sets, so they moved to #24, which depends on #5 and #8. #5 is now the config layer only, and it can land before the UI exists.
🤖 Merged in #25. Settings and remembered values are saved as TOML, the sign-in token comes from the command or a 0600 file, and the host is chosen by --host, then the only host, then default_host. The 'only merge when CI is green' setting is per host with a per-repo override, off by default. The screens are in #24.