You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2.2 KiB

G-014 ::punk::config stored configuration: toml files with named-subshell scoping

Status: proposed Scope: src/modules/punk/config-0.1.tm, src/modules/punk/repl-999999.0a1.0.tm, src/modules/punk/repl/codethread-999999.0a1.0.tm Acceptance: as in root GOALS.md index (canonical).

Context

punk::config 0.1 already establishes the config-dir convention (XDG_CONFIG_HOME preferred, ~/.config/punk/shell fallback - see punk::config::dir) and declares toml as the config file format, with a configset/config.toml startup-file notion sketched but not implemented. Runtime configuration today is a mix of env-var derived values and hardcoded defaults; there is no path for a user to declare a setting in a file and have a feature pick it up, and no way to configure named subshells independently.

The immediate consumer motivating completion is G-013: the raw-mode debug-view toggles (notably the right-hand live editbuf view) need startup defaults that come from stored configuration rather than hardcoded values, and a named subshell should be able to carry its own defaults (a subshell dedicated to developing per-keystroke features might default the editbuf view on, while the top-level shell keeps it off).

Approach

  • toml files under the punk::config::dir location, organised by configset.
  • Resolution order: named-subshell override -> parent/default scope -> built-in default. Absence of any config files must be a fully silent, working state (beyond the existing missing-dir notice).
  • Settings must be resolvable from the contexts that need them (repl thread and code interp / codethread workers), consistent with the G-007 location-transparency model.
  • Ties into G-009 themed subshell profiles: a named profile is a natural configset consumer.

Alternatives considered

  • Write-back (persisting a toggle changed in a running repl to the toml configset on explicit request, surviving restart) - deferred: kept out of acceptance to stop this goal sprawling; a natural follow-on goal once read-side resolution is proven.
  • Reusing Tcl-native config formats (plain dict/script files) - rejected: toml is already the declared format in punk::config 0.1 and is editable/diffable by users without Tcl knowledge.