allod secret declare: write a credential's non-secret half in canonical shape #196

Closed
opened 2026-09-11 00:16:19 +01:00 by allod-agent · 0 comments
Member

Give agents a command that writes a credential's non-secret half in the canonical shape, so the PR that declares a new credential is generated rather than hand-edited across three files.

Primary goals:

  • One command, three entries — allod secret declare <name> --kind <kind> --owner <owner> --to <machine>,... --format <format> --deployed-path <path> --verify <probe> appends the credentials.nix entry in rotation_state = "pending", the secrets.nix line in the [ hostKey ] ++ vmKeys "<machine>" form, and the registry group with service none or forgejo.
  • Runs where agents run — untagged, so it exists on dev machines; it writes no ciphertext and reads no identity, and the inventory check validates its output the same way it validates a hand edit.
  • Refuses a name that exists — an entry, line, or registry credential already present for the name is an error with what was found; the command never edits an existing declaration.

Current state and specifics

allod/tools#182 settled that the host command allod secret create verifies and encrypts and does not author, so the reviewed PR is the only authoring path (see its design comment). That leaves agents writing the three entries by hand from the shapes in the secrets template's README. The credentials.nix entry shape is the agent-pr-token one; secrets.nix lines are "secrets/<name>.age".publicKeys = [ hostKey ] ++ vmKeys "<vm>";; the registry group shape is the one rotate-token's validate_group_metadata accepts. The command should write text, not regenerate files, so the diff stays one block per file.

Scope

In: the three writes, the name-collision refusal, and tests against a fixture checkout. Out: encrypting anything, touching the identity, the consumer module wiring, and the identity export in the secrets flake, which stay hand-written in the same PR.

Give agents a command that writes a credential's non-secret half in the canonical shape, so the PR that declares a new credential is generated rather than hand-edited across three files. Primary goals: - **One command, three entries** — `allod secret declare <name> --kind <kind> --owner <owner> --to <machine>,... --format <format> --deployed-path <path> --verify <probe>` appends the `credentials.nix` entry in `rotation_state = "pending"`, the `secrets.nix` line in the `[ hostKey ] ++ vmKeys "<machine>"` form, and the registry group with `service` `none` or `forgejo`. - **Runs where agents run** — untagged, so it exists on dev machines; it writes no ciphertext and reads no identity, and the inventory check validates its output the same way it validates a hand edit. - **Refuses a name that exists** — an entry, line, or registry credential already present for the name is an error with what was found; the command never edits an existing declaration. ### Current state and specifics allod/tools#182 settled that the host command `allod secret create` verifies and encrypts and does not author, so the reviewed PR is the only authoring path (see its design comment). That leaves agents writing the three entries by hand from the shapes in the secrets template's README. The `credentials.nix` entry shape is the `agent-pr-token` one; `secrets.nix` lines are `"secrets/<name>.age".publicKeys = [ hostKey ] ++ vmKeys "<vm>";`; the registry group shape is the one `rotate-token`'s `validate_group_metadata` accepts. The command should write text, not regenerate files, so the diff stays one block per file. ### Scope In: the three writes, the name-collision refusal, and tests against a fixture checkout. Out: encrypting anything, touching the identity, the consumer module wiring, and the identity export in the secrets flake, which stay hand-written in the same PR.
vnprc closed this issue 2026-09-11 21:34:19 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
allod/tools#196
No description provided.