Repository navigation
Conversation
The vitaminc skill maps each task that touches a secret to the vitaminc type for it, with working recipes. It was not installed here, so agents writing Rust in this repository hand-rolled what vitaminc already has. It is a copy from cipherstash/vitaminc at 5dbbafaa1, beside the misuse-resistance copy, in .claude/skills/ so it does not ship to customers. AGENTS.md says when to read it, and adds two rules the skill does not state yet: derive OpaqueDebug for a type that holds a secret, and reuse an engine or vitaminc type before wrapping it.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
cipherstash-agent
left a comment
There was a problem hiding this comment.
Review attestation
Reviewed 5329ca3 · posted from Claude Code (scheduled routine) · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5; mattpocock-skills:code-review Standards and Spec sub-agents · model not reported
Skills: code-review, company-skills:rust-security, mattpocock-skills:code-review, company-skills:review-cross-check
Findings (5): 1 major, 4 minor — 4 inline, 1 below.
general(PR description) minor The body says #1774 "hand-writesimpl Debugfive times". #1774 has one commit, and it has three:Cipherincrates/core/src/cipher.rs, andPlaintextandCiphertextincrates/core/src/value.rs. Change it to "three".
Every finding was checked against 5329ca3 before posting. The copies hold up: RECIPES.md matches vitaminc 5dbbafaa1 byte for byte, SKILL.md differs only by its note, and ValueFrame derives OpaqueDebug.
Open question, not a defect: the new rule "Do not write impl Debug by hand" makes existing code non-conforming. That includes JsonPlaintext (packages/stack-encrypt/src/json/plaintext.rs:228), OpaqueBlob (packages/stack-encrypt/src/blob.rs:458) and the opaque_debug::implement! sites in packages/stack-kms. List them as known exceptions, or leave them for a follow-up?
Generated by Claude Code
| Read `.claude/skills/vitaminc/SKILL.md` before you write or review Rust that | ||
| holds a key, a token, a plaintext or another secret. That covers the stack-* | ||
| crates, the Go guests and every language binding crate. The skill maps each |
There was a problem hiding this comment.
major This puts protect-ffi in scope, but protect-ffi pins vitaminc = "=0.1.0-pre4.2" (languages/typescript/packages/protect-ffi/crates/protect-ffi/Cargo.toml:52), and RECIPES.md targets 0.10: SafeRand::next_below and vitaminc_aead::{ContextPiece, IntoContext} do not exist at pre4.2, so a recipe copied "as written" into protect-ffi fails to compile. Say that the recipes do not apply to protect-ffi until its pin moves, and that the Go guests get vitaminc through stack-encrypt's re-exports and must not add their own vitaminc dependency (languages/golang/encrypt/guest/Cargo.toml:66-70).
Source: code-review · claude-opus-5-5
Generated by Claude Code
| @@ -0,0 +1,287 @@ | |||
| # vitaminc recipes | |||
|
|
|||
| One recipe per task. Each is complete, compiles, and is the production path: copy it as written. Imports use the individual crates; with the facade crate, `vitaminc_protected::X` is `vitaminc::protected::X`, and so on. | |||
There was a problem hiding this comment.
minor In this workspace, several recipes do not compile as written. The root Cargo.toml has no direct vitaminc-random or vitaminc-password, and the facade has no password feature. stack-encrypt and stack-guest-abi build futures without executor. #[derive(Generatable)] (line 93) needs vitaminc-random as a direct dependency, because the derive's generated code names that crate. Add a stack-specific mapping to the copy note in SKILL.md, the one part allowed to differ: vitaminc_random::X → vitaminc::random::X, password needs a reviewed feature addition, and the Generatable derive and block_on are not usable without new dependencies.
Source: code-review · claude-opus-5-5
Generated by Claude Code
| let a: Equatable<Protected<[u8; 32]>> = Equatable::new([7; 32]); | ||
| let b: Equatable<Protected<[u8; 32]>> = Equatable::new([7; 32]); | ||
| assert!(tag_matches(&a, &b)); |
There was a problem hiding this comment.
minor These statements sit outside any function, so pasting the block into a .rs file gives expected item, found keyword 'let', which contradicts "compiles … copy it as written" at line 3. The "Keyed hash" block at 281-286 has the same problem. Upstream only compiles them as rustdoc doctests (packages/skill-doctests). Wrap the statements in a fn or #[test] upstream in cipherstash/vitaminc, then copy the file again.
Source: code-review · claude-opus-5-5
Generated by Claude Code
| For Rust techniques at each rung (newtypes, typestate, sealed traits, const generics, withheld traits, compile-fail tests, the assumptions behind "if it compiles, it is secure"), read [RUST.md](RUST.md). | ||
|
|
||
| In Rust, the vitaminc crates provide ready-made types for rules 3, 4 and 5: secret wrappers, randomness, encryption, key wrapping and keyed hashing. Reach for them before writing your own. The `vitaminc` skill shows how to use them. That skill is in the vitaminc repository, at `.claude/skills/vitaminc/`. It is not installed here. | ||
| In Rust, the vitaminc crates provide ready-made types for rules 3, 4 and 5: secret wrappers, randomness, encryption, key wrapping and keyed hashing. Reach for them before writing your own. The `vitaminc` skill shows how to use them. It is installed here, at `.claude/skills/vitaminc/`. |
There was a problem hiding this comment.
minor Upstream's last line at 5dbbafaa1 ("the vitaminc skill provides ready-made types … Reach for them before writing your own.") is now true here word for word, because this PR installs the skill. Take upstream's line, and change the note at line 10 to "differs in this note only", so a refresh no longer has to restore a rewritten section. While editing line 10, move its pin from 06861c1b9 to 5dbbafaa1; the content is the same, and both copies would then name one commit.
Source: mattpocock-skills:code-review (Standards) · model not reported
Generated by Claude Code
Summary
Vitamin C is CipherStash's library of cryptographic building blocks. It has an agent skill: a short guide that tells a coding agent which Vitamin C type to use for each task that touches a secret, with working code for each.
That skill was not installed in this repository. Agents writing Rust here did not read it, and wrote by hand what Vitamin C already has. The latest case is the TypeScript SDK work in #1774, which hand-writes
impl Debugfive times to hide a value, where the engine derivesOpaqueDebug.This pull request installs the skill and tells agents when to read it.
Changes
.claude/skills/vitaminc/SKILL.mdandRECIPES.md: a copy of the skill fromcipherstash/vitaminc, at commit5dbbafaa1onmain.RECIPES.mdis unchanged.SKILL.mdgains one note at the top that says it is a copy and how to update it, as themisuse-resistancecopy does..claude/skills/misuse-resistance/SKILL.md: its last section said thevitamincskill "is not installed here". It now points at the installed copy.AGENTS.md: a "vitaminc" section under "Working on the Rust crates". It says to read the skill before writing or reviewing Rust that holds a secret. It also states two rules the skill does not have yet:OpaqueDebug, and does not hand-writeDebug;The skill is in
.claude/skills/, notskills/, so it does not ship to customers in thestashpackage.Verification
.claude/skills/:git grep 'claude/skills' -- scripts .githubfinds only a comment about what a customer's install copies. CI on this pull request is the check.cipherstash/vitaminctheskill-doctestspackage does.Review notes
OpaqueDebug. I put that rule inAGENTS.mdand left the copy unchanged, so the two copies stay the same. The rule should also go into the skill incipherstash/vitaminc.misuse-resistancecopy, so its last section may conflict with this one.