Skip to content

docs(spec): mark the Rust default tenant conformant from cachekit-rs 0.8.0 (LAB-4667) - #206

Merged
27Bslash6 merged 2 commits into
mainfrom
lab-4667-rs-default-tenant-cell
Oct 23, 2026
Merged

27Bslash6 merged 2 commits into
mainfrom
lab-4667-rs-default-tenant-cell

Conversation

@27Bslash6

Copy link
Copy Markdown
Contributor

Flips the Rust cell of the spec/intent-presets.md § SDK Conformance row "Default tenant_id is "default", identical for HKDF and AAD" from ❌ to ✅, with the floor cachekit-rs 0.8.0+, and adds a changelog.d/ fragment. Docs only.

The old cell said from_env() derived under the deployment namespace, "inconsistent by constructor". No published release does that. The new cell states what each Rust path that encrypts with no caller-supplied tenant resolves, and names no API that a published release does not ship.

Evidence

Per decisions/matrix-version-verification.md, against the published artifacts, not main. I downloaded every cachekit-rs release from 0.8.0 up from crates.io on 2026-10-23. Each sha256 matches the registry checksum:

Release .crate sha256 preset tenant (src/intents.rs) from_env() tenant (src/client.rs)
0.8.0 986848f4…d941 :63 "default" :241
0.9.0 792ee2d3…775e :67 "default" :259
0.10.0 6f97c303…5d49 :67 "default" :285
0.11.0 78b6c477…f086 :87 "default" :287
0.11.1 23db3fd7…7733 :87 "default" :287

Presets (rule 6: executed tests). CacheKit::secure and CacheKit::secure_from_env share one private helper that passes the literal "default". Each .crate above ships the crate-internal tests hex_path_decrypts_default_tenant_vector and env_path_decrypts_default_tenant_vector in src/intents.rs. They build each preset path with no tenant, assert tenant_id() == "default", and decrypt test-vectors/encryption.json default_tenant.vectors[0] (default_tenant_interop) to its plaintext_hex. 0.8.0 is the first release that carries them.

CacheKit::from_env() through 0.11.x (rule 6: no test asserts it, so the whole path is traced). Layer checked: the published src/ of each .crate.

  1. CacheKit::from_env() builds its config only from CachekitConfig::from_env(). With CACHEKIT_MASTER_KEY set it encrypts with tenant config.namespace.as_deref().unwrap_or("default") (line in the table).
  2. CachekitConfig::from_env() starts from Self::default(), where namespace is None. It assigns only api_key, api_url, master_key, previous_master_keys and, through 0.11.x, default_ttl. No release assigns config.namespace in src/config.rs, and no src/ file reads a namespace environment variable.
  3. The only setter, CachekitConfigBuilder::namespace, fills a CachekitConfig that no client constructor accepts. Outside config.rs and the lib.rs re-export, the only CachekitConfig use is from_env()'s own CachekitConfig::from_env() call.
  4. Every ? on the path returns an error rather than falling through to another tenant. Building the encryption layer is the last step before Ok(builder), so a .namespace(…) chained on the returned builder changes key prefixes only, never the layer's tenant.

So from_env() derived the key and built the AAD under "default" in every release, and no ciphertext was ever derived under a namespace tenant.

No other tenant-less path. In each .crate, the non-test calls that build an encryption layer are the preset helper, from_env(), and builder methods (.encryption(), .encryption_from_bytes(), .encryption_from_bytes_with_previous(), and from 0.11.0 .encryption_with_previous()) plus EncryptionLayer::new / with_previous_keys. All of these take the tenant as an argument.

Checks

  • python3 tools/test_conformance.py: 284 cases pass.
  • python3 tools/conformance.py check --base origin/main: OK, and conformance/coverage.md is current.
  • The version-floor, spec-duplication and changelog-collect suites pass.
  • CHANGELOG.md is untouched.

…0.8.0

The Rust cell said from_env() derived under a deployment namespace. No
published release does: CacheKit::from_env() falls back to "default"
because CachekitConfig::from_env() never sets the namespace it reads,
and both secure presets read the default_tenant_interop vector in the
SDK's own tests. Checked against every published .crate from 0.8.0 to
0.11.1.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 98d7823 and b818eec.

📒 Files selected for processing: 1
  • spec/intent-presets.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between af0d572 and 98d7823.

📒 Files selected for processing: 2
  • changelog.d/20261023_lab-4667.md
  • spec/intent-presets.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Summary by CodeRabbit

  • Documentation
    • Updated the compatibility notes to record that Rust SDK versions 0.8.0 and later use "default" as the tenant ID for secure operations when no tenant is supplied.
    • Clarified that from_env() also falls back to "default" when CACHEKIT_MASTER_KEY is set, through version 0.11.x.
    • Added verification coverage through version 0.11.1.

Walkthrough

The Rust SDK conformance entry now reports default tenant_id behaviour for the listed methods. A changelog entry records the reported behaviour and releases checked.

Changes

Rust default tenant conformance

Layer / File(s) Summary
Update Rust conformance record
spec/intent-presets.md, changelog.d/20261023_lab-4667.md
The specification marks Rust conformance as passing for default tenant use. The changelog records the reported method behaviour and the checked release range.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: kodus-27b

Merge Risk: ⚪ Minimal · up to 98d78

The documentation update is accurate and introduces no actionable merge risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the change: the Rust default tenant conformance row in the intent-presets spec is marked conformant from cachekit-rs 0.8.0, with a Jira-style ticket reference. It matches the changeset…
Description check Passed The description is specific and on-topic. It names the exact spec cell changed (Rust cell of the SDK Conformance row in spec/intent-presets.md), the version floor (cachekit-rs 0.8.0+), and the added c…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: the Rust default tenant conformance row in the intent-presets spec is marked conformant from cachekit-rs 0.8.0, with a Jira-style ticket reference. It matches the changeset, which flips the Rust cell from ❌ to ✅ and adds a changelog fragment. The title uses the conventional docs(spec) prefix and is 85 characters, within normal length for a commit title.

Full details: Description check

Explanation

The description is specific and on-topic. It names the exact spec cell changed (Rust cell of the SDK Conformance row in spec/intent-presets.md), the version floor (cachekit-rs 0.8.0+), and the added changelog.d/ fragment. It also explains the evidence (crates.io release checks, sha256 matches, and the preset and from_env() tenant tracing) and lists the checks run. It fully matches the raw summary and objectives.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 23, 2026
@27Bslash6

Copy link
Copy Markdown
Contributor Author

@kody start-review

@kodus-27b

kodus-27b Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

kodus-27b[bot]
kodus-27b Bot previously approved these changes Oct 23, 2026
The claim that every other encryption entry point takes the tenant as an argument sat under an open 0.8.0+ floor, and an unreleased builder method that reads the key from the environment encrypts with no tenant argument. Bound it to 0.11.x like the from_env() clause, and name config.namespace so the fallback does not read as a namespace tenant.
@kodus-27b

kodus-27b Bot commented Oct 23, 2026

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

@27Bslash6
27Bslash6 merged commit 0a1c6e8 into main Oct 23, 2026
5 checks passed
@27Bslash6
27Bslash6 deleted the lab-4667-rs-default-tenant-cell branch October 23, 2026 22:03
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