Skip to content

feat(secrets): add atomic compare-and-set - #66

Closed
senamakel wants to merge 24 commits into
tinyhumansai:mainfrom
senamakel:epic-7419-8-secret-cas
Closed

senamakel wants to merge 24 commits into
tinyhumansai:mainfrom
senamakel:epic-7419-8-secret-cas

Conversation

@senamakel

@senamakel senamakel commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

SecretStore currently has no atomic precondition, so callers that store credentials as whole profiles can overwrite a concurrent update. This adds paired versioned reads and atomic set_if writes to native stores and the confidential Secrets bus contract.

Document stores compare the opaque token and use the native document revision precondition for the write. Encrypted files compute versions from the file identity, secret name, and exact ciphertext snapshot while holding the existing cross-process lock; unrelated file updates conservatively conflict, without changing the file format. Memory stores use per-secret generations and store identity. Keyring reports typed Unsupported(ConditionalSecretWrites) because it has no atomic CAS primitive. set_if returns the revision for its own committed write.

The conformance suite covers stale and absent conditions, same-value rewrites, delete/recreate ABA, concurrent writers, and returned-token identity. Additional tests cover independent file handles and processes, storage-domain binding, the real bus client race, and keyring unsupported behavior. The bus contract is version 5; Secrets remains confidential.

Validation so far: cargo fmt --all and git diff --check pass. Local Cargo checks/tests have not run because the shared local build slot is reserved for another leaf; hosted checks are pending. Keep this draft until required local and hosted gates are green.

Refs senamakel#8
Part of tinyhumansai/openhuman#7419

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@senamakel

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@senamakel

Copy link
Copy Markdown
Member Author

Closing: superseded by tinyhumansai/openhuman#8131, which restructures tinystoragedrivers into types + API + per-primitive crates with engines as features. Any capability still needed here gets re-implemented on that layout (secrets CAS in senamakel#30, blob listing in #27, sqlite open modes in #26).

@senamakel senamakel closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant