Skip to content

writ finds and applies .sops.yaml differently from sops: from the secret's directory, through a chain with a devlore fallback, SOPS_CONFIG ignored, a malformed file skipped silently #1144

Open

Description

@David-Noble-at-work

Writ finds and applies .sops.yaml differently from the sops command, so a secret writ encrypts can get other recipients than one sops encrypt makes from the same repository.

Found 2026-10-22 while planning #977 (lane 47 of #949), by reading writ's pkg/sops against sops v3.12.1, the library version devlore-cli uses.

What differs

sops (the app) writ (pkg/sops/encrypter.go, locate.go)
Search starts at the current directory (config.LookupConfigFile(".")) the secret's own directory
Search stops at 100 levels up the run's root (RuntimeEnvironment().Root())
Files considered the first .sops.yaml found, only every .sops.yaml up the tree, nearest first, until one has a matching creation rule
Global fallback none $XDG_CONFIG_HOME/devlore/sops.yaml
--config / SOPS_CONFIG used, and the search is skipped ignored
A malformed .sops.yaml an error skipped silently: getsops reports a parse failure and "no matching rule" alike, and firstMatchingConfig skips both, so the secret is encrypted for whatever a farther config names
.sops.yml ignored, with a warning ignored, silently

Started at the layer's root, the library's own two functions, config.LookupConfigFile then config.LoadCreationRuleForFile with the secret's absolute path, give exactly the file and rule sops encrypt gives when run from that root, wherever writ itself runs. The two then differ only when a nested .sops.yaml exists or sops is run outside the repository.

Options (the owner's to rule)

  • A. One .sops.yaml at the layer's root, read the library's way from the root, SOPS_CONFIG honored; the chain, the devlore fallback and the silent skip go. Agrees with the secret family's rulings (docs/plans/writ-secret-init.md, ruled 2026-08-10: recipients in the layer root's .sops.yaml).
  • B. Recipients in devlore's configuration rather than .sops.yaml. The library's config functions take only a file path, but writ builds the document itself and needs only key groups, which the library's exported constructors make (age.MasterKeysFromRecipients). devlore's configuration is per machine, so recipients would not travel with the repository, and it reverses the 2026-08-10 ruling.

Discussed 2026-10-22 with a writ sops subcommand to make the sops app unnecessary; the writ secret family already charters decrypt, rekey, list, init and recover (edit is not among them).

Plan and design documents

Kind Document
Plan Not yet opened
Design docs/architecture/3.5.13-encryption-provider.md
Design docs/plans/writ-secret-encrypt.md
Design docs/plans/writ-secret-init.md

Activity

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

    @David-Noble-at-work
    ContributorAuthor

    Taken onto the install-scripts schedule, devlore-cli#949, as lane 61 (ruled 2026-10-23), and removed from it 2026-10-25 with every lane not directly about finishing the install scripts.

  2. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rules it breaks:

    • severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low
    • no-evidence: no Evidence of completion section
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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions