Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(security): name StorageMode's groups instead of referring to them by position\n\nThe enum doc said "the first two variants are consent outcomes", but the first\nvariant is `OsKeyring`, which is reached when the OS backend probe succeeds and\nno consent was ever asked for. Two of the three real consent outcomes\n(`ConsentPending`, `Declined`) also sit at the end of the enum, not among the\nfirst two.\n\nGroups are now named explicitly rather than positionally, so reordering or\ninserting a variant cannot make the paragraph wrong again — which is the same\nfailure mode this PR exists to fix.\n\nReported by CodeRabbit on #6096.\n

Shanue50d6c149865
diff --git a/src/openhuman/security/keyring_consent/types.rs b/src/openhuman/security/keyring_consent/types.rs
index cb70b88a6d..786703bc0a 100644
--- a/src/openhuman/security/keyring_consent/types.rs
+++ b/src/openhuman/security/keyring_consent/types.rs
@@ -4,15 +4,22 @@ use serde::{Deserialize, Serialize};
/// Where the process's secrets actually live.
///
-/// The first two variants are **consent outcomes** — the OS keyring was the
-/// intended store, it could not be used, and the user answered the consent
-/// prompt. The next two are **operator-configured backends**: nobody was asked
-/// anything, `OPENHUMAN_KEYRING_BACKEND` (or the staging/production default)
-/// simply selected a different store. Keeping those apart matters because they
-/// are not the same storage: a consented `LocalEncrypted` fallback means
-/// per-field `SecretStore` encryption inside the config, while
-/// `LocalEncryptedFile` means the `encrypted_file` backend's single
-/// `{workspace}/secrets.enc`.
+/// The variants fall into three groups. They are named here rather than
+/// referred to by position, because position is what rots:
+///
+/// - `OsKeyring` — no consent was ever needed; the `os` backend's probe
+/// succeeded and secrets are in the OS credential store.
+/// - `LocalEncrypted` / `ConsentPending` / `Declined` — **consent outcomes**,
+/// reachable only on the `os` path: the OS keyring could not be used, and
+/// the user has either answered the consent prompt or not answered yet.
+/// - `LocalEncryptedFile` / `LocalPlaintextFile` — **operator-configured
+/// backends**: nobody was asked anything, `OPENHUMAN_KEYRING_BACKEND` (or
+/// the staging/production default) simply selected a different store.
+///
+/// The last two groups must stay apart because they are not the same storage:
+/// a consented `LocalEncrypted` fallback means per-field `SecretStore`
+/// encryption inside the config, while `LocalEncryptedFile` means the
+/// `encrypted_file` backend's single `{workspace}/secrets.enc`.
///
/// Read [`KeyringStatus::backend_name`] alongside this — the two answer
/// different questions and must never contradict each other (#6076: every