Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


id: config kind: intent statement: “WHEN the tool adopts genesis::config THE tool SHALL implement ConfigFile, delegate all config file I/O to genesis, register its config with ConfigRegistry at startup, and remove dead config code without new clippy warnings.”


config spec delta: adopt genesis::config

Constraints

idkindexprtraces_to
C-configfile-implinvariantthe tool’s config struct implements genesis::config::ConfigFile and all config file I/O (read, write, parse) delegates to genesis, with cargo test passing[[config]]
C-startup-registrationinvariantat startup the tool registers its config struct with ConfigRegistry[[config]]
C-configstore-advisoryadvisoryconfig discovery and validation SHOULD use ConfigStore[[config]]
C-dead-code-removedinvariantafter adoption the old config parsing code is removed, cargo clippy introduces no new warnings, and cargo test passes[[config]]

Model

States

  • own-config
  • genesis-config
  • registered

Transitions

idfromtoguard
t-adoptown-configgenesis-config[[config.C-configfile-impl]]
t-registergenesis-configregistered[[config.C-startup-registration]]
t-pruneregisteredregistered[[config.C-dead-code-removed]]

Properties

idkindderives_fromgeneratorpredicate
P-configfileunit[[config.C-configfile-impl]]the adopted config structit implements ConfigFile; every read, write, and parse call routes through genesis; tests pass
P-registrationunit[[config.C-startup-registration]]a startup runthe config struct is registered with ConfigRegistry before config is first read
P-configstoreunit[[config.C-configstore-advisory]]config discovery and validation pathsthey use ConfigStore where the advisory is honored
P-pruneunit[[config.C-dead-code-removed]]the post-adoption treeno old config parsing code remains; cargo clippy adds no new warnings and cargo test passes

Purpose

Adopt genesis::config as the shared config substrate: the tool’s config implements ConfigFile, all file I/O delegates to genesis, startup registers with ConfigRegistry, and dead local config code is removed cleanly.

Non-Goals

  • Defining the tool’s config schema or default values — each tool owns its own config content
  • genesis::config internals — the substrate’s behavior is an upstream concern
  • Remote or secret-management config sources — local file I/O only

Requirements

Requirement: Shared config management

The tool SHALL adopt genesis::config for shared config management.

Scenario: config struct implements ConfigFile

  • GIVEN the tool needs config management
  • WHEN the tool adopts genesis::config
  • THEN the tool’s config SHALL implement genesis::config::ConfigFile
  • AND all config file I/O (read, write, parse) SHALL delegate to genesis
  • AND cargo test SHALL pass
  • VERIFIES [[config.P-configfile]]
  • VERIFIES [[config.P-configstore]]

Scenario: config registered at startup

  • GIVEN the tool starts up
  • WHEN it initializes
  • THEN it SHALL register its config struct with ConfigRegistry
  • AND it SHOULD use ConfigStore for config discovery and validation
  • VERIFIES [[config.P-registration]]

Scenario: dead config code removed

  • GIVEN the tool has adopted genesis::config
  • WHEN the old config parsing code is removed
  • THEN cargo clippy SHALL introduce no new warnings
  • AND cargo test SHALL pass
  • VERIFIES [[config.P-prune]]

Scenario: Config I/O bypassing genesis is rejected

  • GIVEN the tool has adopted genesis::config
  • WHEN a config read, write, or parse call routes anywhere other than genesis
  • THEN the delegation property is violated and the change is rejected
  • AND cargo test SHALL fail
  • VERIFIES [[config.P-configfile]]