Skip to content

writ's scopes and segments take singular keys: writ.scope and writ.segment #1024

Open

Description

@David-Noble-at-work

writ's two name-keyed families take singular keys: writ.scopes becomes writ.scope, and writ.segments becomes
writ.segment. The variables family, <program>.variable, takes the same form in #1023.

Ruled 2026-10-02

The owner, asked whether the families' keys should be singular or plural: "whatever we do, we should do it to scopes,
segments, and variables", then "yes, singular for all three". Scopes, segments and variables are the only families
whose entries the user names. The singular gives each family one name on every surface (--segment,
WRIT_SEGMENT_<NAME>, writ.segment), and for a map the file key yields its environment variable by #927's rule:
writ.variable.<NAME> is WRIT_VARIABLE_<NAME>.

What changes

  • The schema (schema/devlore-config.json), writ's reads (writ.scopes through viper in cmd/writ/writ,
    writ.segments in cmd/writ/writ/config.go), the defaults, the tests and the pages name writ.scope and
    writ.segment. The plural keys are not read: there is no legacy to keep.
  • Segments keep their declared order: a directory name carries the extra segments in the order they are declared, so
    writ.segment stays an ordered list.
  • --scope stays the selector it is; scopes take no definition flag, since --scope NAME=root would collide with it.
  • Whether a scope's root also reads from WRIT_SCOPE_<NAME>, the environment layer segments and variables have, is
    decided in this issue's plan. If it does, WRIT_SCOPE_ joins the reserved families of The environment prefix is doubled: WRIT_WRIT_VERBOSE works and WRIT_VERBOSE does not; the variable is the prefix plus the bare key, for every program #927's collision test.

Acceptance

  • The schema, writ's code, its tests and fixtures, and every page and guide name writ.scope and writ.segment.
  • A configuration that sets writ.scopes or writ.segments deploys nothing those keys meant.
  • Segments deploy in their declared order, as before.
  • docs/architecture/10-command-line-interface.md §11 already names the singular keys (written 2026-10-02); the
    guides (docs/guides/selectors.md, docs/guides/manage-environments.md) follow when the code does.

Related

#1023 (the variables family, whose <program>.variable follows the same ruling), #927 (the variable-naming rule and
the collision test), #926 (--scope and the scope model), #944 (segments in the selector).

Plan and design documents

Kind Document
Plan Not yet opened
Design docs/architecture/10-command-line-interface.md § Introducing a name and setting its value

Epic: #441 · Feature: #456 · Schedule: #916, lane 41, PR C′, in lane 38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions