Skip to content

fix(stack-encrypt): pass the cipher to record::decrypt in heap_hygiene - #1655

Open
freshtonic wants to merge 1 commit into
nextfrom
fix/stack-encrypt-heap-hygiene-cipher-ref
Open

freshtonic wants to merge 1 commit into
nextfrom
fix/stack-encrypt-heap-hygiene-cipher-ref

Conversation

@freshtonic

Copy link
Copy Markdown
Contributor

Fixes a build failure on next: packages/stack-encrypt/tests/heap_hygiene.rs does not compile with the dynamic feature.

error[E0433]: failed to resolve: use of undeclared type `Scope`
    --> packages/stack-encrypt/tests/heap_hygiene.rs:1245:33

Cause

Two PRs that each built alone:

Commit cargo check -p stack-encrypt --tests --features dynamic
5811ac412 (#1643 before merge) compiles
aedd55e04 (after #1610) compiles
9f6b08095 (after #1643, current next) fails

Nobody saw it because the test file is #![cfg(all(feature = "dynamic", unix))], so a default-features build skips it, and no checks ran on the merge commit.

Fix

Pass &cipher, as the file's other record::decrypt calls do (lines 451 and 485). Test-only; no changeset.

Checks

  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean.
  • cargo fmt --all -- --check: clean.
  • cargo nextest run -p stack-encrypt --all-features: 1415 passed, 1 skipped.

#1643 called record::decrypt with Scope::Client(&cipher). #1610 replaced
dynamic::Scope with CipherRef, which a &StackCipher converts into, and merged
first. Each PR built on its own, but the merge does not: heap_hygiene.rs
(feature dynamic) fails with an undeclared Scope.
@freshtonic
freshtonic requested a review from a team as a code owner November 13, 2026 11:54
@changeset-bot

changeset-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7bad7ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd60938e-957a-42f4-87d3-011c4489be8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing (cargo-mutants, --in-diff, stack-auth + stack-encrypt)

No mutants were generated for the changed lines.

@cipherstash-agent cipherstash-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review attestation

Reviewed 7bad7ae · posted from Claude Code · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5
Skills: code-review, rust-security, review-cross-check

Findings (1): 1 minor — 0 inline, 1 below.

  • .github/workflows/tests-crates.yml:42 (outside diff) minor No workflow in .github/workflows/ runs on a push to next: every push.branches here is [main], and next has no ruleset that requires branches to be up to date and no merge queue. So two PRs that each pass alone, like #1610 and #1643, can land a compile break on next without CI ever building it. Adding next to push.branches would only catch a break after it lands; to prevent one, require up-to-date branches or a merge queue on next. This is a repo-settings follow-up, and it does not block this PR.

The fix itself checks out. At next (9f6b080), cargo check -p stack-encrypt --tests --features dynamic fails with E0433 on Scope. At 7bad7ae it passes, and cargo test -p stack-encrypt --features dynamic --test heap_hygiene passes 33/33. &cipher builds an unscoped CipherRef (pending.rs:181), and each leaf's key is fetched under the keyset that leaf records. That matches the file's other record::decrypt calls at lines 451 and 485. No Scope::Client call sites remain in any .rs file.


Generated by Claude Code

This branch has not been deployed

No deployments
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.

2 participants