Skip to content

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

Open

Description

@David-Noble-at-work

Epic: #447 · Feature: #762 The writ lifecycle surface · Schedule: #916, lane 8, PR C

The defect

cmd/internal/cli/viper.go sets viper's environment prefix to the program's name (WRIT, LORE, STAR) and
turns on AutomaticEnv. The configuration keys are themselves namespaced under the program -- writ.verbose --
so the variable viper looks for is WRIT_WRIT_VERBOSE. WRIT_VERBOSE does nothing. Neither spelling is documented.
Every program on the shared root has the same doubled prefix.

The ruling, 2026-09-23

The prefix plus the bare key, for every program: WRIT_VERBOSE, LORE_VERBOSE, STAR_VERBOSE. The program
segment of the key is dropped when the prefix already names the program; WRIT_WRIT_VERBOSE is not honored. This
is how aws, gh and docker name theirs.

Acceptance

Rewritten 2026-10-02 to lane 8's plan: the shared root's flags, --verbose among them, became global settings in
lane 24 (#1010), so this lane covers the settings only one program has.

Amended 2026-10-10: this note, and the one on lane 24 below the list, are superseded. Since lane 8's ruling 18
(2026-10-03, the owner: "EVERY ONE of the DEVLORE_ settings must be in config. add that task to lane 8."), lanes 23
(#1011) and 24 (#1010) are done in this lane with #1026 (lane 43), as #1022 (lane 37) has been since ruling 10. This
lane makes the shared root's flags global settings, and PR C closes #927, #1010, #1011, #1022 and #1026, each to its
own acceptance.

  • a program setting reads the program's prefix plus the bare key: writ.repo from WRIT_REPO; nested keys map
    the same way, writ.deploy.conflict to WRIT_DEPLOY_CONFLICT; a hyphen becomes _
  • the doubled spelling, WRIT_WRIT_REPO, is not honored
  • no two settings share a variable: a test maps every known setting
  • a variable with a program's prefix or DEVLORE_ that nothing reads draws a warning naming it and the near name
    it resembles; one subprocess test per program on the shared root
  • 10-command-line-interface.md states the rule in one line, and the warning

Moved to lane 24 (#1010): the shared root's flags as global settings with DEVLORE_ variables, and the generated
reference naming them.

Plan and design documents

Kind Document
Plan docs/plans/fix/927-env-prefix-doubled.md, lane 8 of #916
Design 10-command-line-interface.md

Activity

  1. David-Noble-at-work commented on Oct 3, 2026

    @David-Noble-at-work
    ContributorAuthor

    Ruled 2026-10-02: #1011 joins this lane

    The owner: "Lane 23 should join lane 8." Lane 8's plan (docs/plans/fix/927-env-prefix-doubled.md) now carries #1011 as well: a flag's hyphen becomes an underscore in its setting and its variable, so --dry-run is writ.dry_run and WRIT_DRY_RUN, beside this issue's prefix plus the bare key. PR C closes both.

    The model flags are left to lane 24 (#1010), where the owner ruled that WRIT_MODEL_PROVIDER goes away in favour of DEVLORE_MODEL_PROVIDER. Lane 8's reference names no variable for them, and until lane 24 lands, WRIT_MODEL_PROVIDER and its kin work undocumented.

  2. David-Noble-at-work commented on Oct 3, 2026

    @David-Noble-at-work
    ContributorAuthor

    2026-10-02: #1022 joins this lane. Enumerating graph parameters for the owner found that --dry-run misses the runtime's skip: Application.DryRun() reads dry_run from the flag map, lore and devlore-test hand it dry-run, so lore deploy --dry-run runs every provider method, and a method called outside a graph is never skipped. The owner ruled that dry-run belongs to the runtime ("I agree that dry_run belongs to the runtime and will add that other settings do too. verbosity comes to mind.") and directed "log the defect and include it in lane 8." It is lane 37 on #916; PR C closes it with this issue. The plan, docs/plans/fix/927-env-prefix-doubled.md, takes it in the next commit.

  3. added 3 commits that reference this issue on Oct 3, 2026
    316b768
    50e0340
    6644c38
  4. David-Noble-at-work commented on Oct 3, 2026

    @David-Noble-at-work
    ContributorAuthor

    2026-10-02: lane 8's phase 2 is done, and the plan records rulings 11 to 15.

    Phase 2 landed as 50e03403 (the mapping) and 6644c382 (the collision test). A program setting's variable is the program's prefix plus the key without its own segment, each . and - as _; the doubled spelling names nothing; cli.EnvironmentPrefix and cli.EnvironmentVariable export the rule. cmd/internal/cli/environment_test.go maps every persistent flag, every documented setting and every key the code reads through viper, and fails when two settings share a variable or one lies in a reserved family.

    The rulings since the charter (docs/plans/fix/927-env-prefix-doubled.md):

    Next: phase 3, the resolver and the warning.

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

Metadata

Metadata

Labels

Epic:WritDeploymentwrit deployment: layers, adoption, and driftbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions