Skip to content

feat(cache): formalize caching config and add signing fields - #10523

Merged
dmadisetti merged 1 commit into
mainfrom
dm/cache-config
Aug 17, 2026
Merged

feat(cache): formalize caching config and add signing fields#10523
dmadisetti merged 1 commit into
mainfrom
dm/cache-config

Conversation

@dmadisetti

@dmadisetti dmadisetti commented Aug 12, 2026

Copy link
Copy Markdown
Member

📝 Summary

Formalizes the caching config entrypoints, and adds "signing" fields for cache verification.
This PR introduces the bones for signature verification that will come in a subsequent change.

Cache configuration moves out of experimental into a top-level [cache] table, and a [signing] table is added for trust and identity:

[cache]
verification = "on"          # off | on | strict

[cache.store]
type = "file"
args = { save_path = "~/.cache/marimo" }

# Or a tiered store:
# [[cache.store]]
# type = "file"
# [[cache.store]]
# type = "redis"

[signing]
private_key_path = "~/.marimo/key.pem"

[signing.trusted_signers]
"SHA256:kV9x2c...q8" = "CI cache key"
"SHA256:abc9f1...4d" = "Alice"

[cache].verification and [signing] are declared and merged here, with followup providing implementation.

Breaking

experimental.cache is removed for the explicit cache path.

Notes

  • signing.trusted_signers is a replace path in merge_config, not a deep merge. Deep-merging unions the fingerprints from every layer, and then no layer can remove a signer that a lower-priority one anchored.
  • signing.private_key_path joins the secrets mask, so this machine's signing identity is never serialized to the frontend.

Stack

  1. this PR — config entrypoints + signing fields
  2. refactor(cache): introduce SigningPolicy and rename mode to verification #10524SigningPolicy, mode -> verification
  3. feat(cache): sanitize signing config from untrusted layers #10525 — config sanitization
  4. docs(cache): document the cache signing trust model #10526 — docs

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview Aug 12, 2026 9:37pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cubic-dev-ai cubic-dev-ai Bot 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 completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread marimo/_save/stores/__init__.py Outdated
Comment thread marimo/_save/stores/__init__.py Outdated
@dmadisetti dmadisetti added the enhancement New feature or request label Aug 12, 2026
@dmadisetti
dmadisetti requested a lite review from Copilot August 12, 2026 20:03

Copilot AI 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.

Pull request overview

Formalizes marimo’s caching configuration by promoting cache settings to a top-level [cache] table, adding a new [signing] table for future cache signature verification, and preserving backward compatibility with legacy experimental.cache configs.

Changes:

  • Add top-level cache and signing config schemas, including cache.verification and signing.{private_key_path,trusted_signers}.
  • Update cache store resolution to prefer [cache].store while falling back to experimental.cache, and accept legacy store vs type keys for store selection.
  • Extend config merge and secrets-masking behavior to support trust revocation (trusted_signers replace semantics) and prevent signing identity leakage (private_key_path masking), with accompanying tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/_save/stores/test_store_config.py Adds regression coverage for legacy store key parsing and top-level cache store resolution precedence.
tests/_config/test_secrets_config.py Verifies signing.private_key_path is masked and placeholder round-trips don’t overwrite real secrets.
tests/_config/test_config.py Ensures signing.trusted_signers uses replace semantics to allow narrowing/revoking trust.
marimo/_save/stores/init.py Switches store lookup to [cache].store with fallback to experimental.cache and supports legacy store key.
marimo/_config/secrets.py Adds signing.private_key_path to the secrets mask list.
marimo/_config/config.py Introduces new CacheConfig/SigningConfig types and updates merge behavior for signing.trusted_signers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread marimo/_save/stores/__init__.py Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Promotes cache configuration out of `experimental` into a top-level `[cache]`
table, and introduces the `[signing]` table that a later change uses to verify
cache signatures.

    [cache]
    verification = "on"          # off | on | strict

    [cache.store]
    type = "file"

    [signing]
    private_key_path = "~/.marimo/key.pem"

    [signing.trusted_signers]
    "SHA256:kV9x2c...q8" = "CI cache key"

`[cache].verification` and `[signing]` are declared and merged here but nothing
reads them yet; the `SigningPolicy` that consumes them lands next.

BREAKING: `experimental.cache` is gone, not aliased. Move the store to
`[cache].store` and spell its key `type`, which is what `StoreConfig` has always
declared. The old reader looked up `store` instead, so that spelling worked by
accident.

`signing.trusted_signers` is a replace path in `merge_config` rather than a deep
merge. Deep-merging would union the fingerprints from every layer, leaving no way
for a higher-priority layer to narrow or revoke trust.

`signing.private_key_path` joins the secrets mask, so this machine's signing
identity is never serialized to the frontend.
@github-actions github-actions Bot added the bash-focus Area to focus on during release bug bash label Aug 12, 2026
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 90.71kB (0.35%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
marimo-esm 25.66MB 90.71kB (0.35%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: marimo-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/react-*.js 89.06kB 814.16kB 12.28% ⚠️
assets/index-*.css 268 bytes 366.22kB 0.07%
assets/dist-*.js 89 bytes 341.65kB 0.03%
assets/ai-*.js 512 bytes 295.51kB 0.17%
assets/cell-*.js 27 bytes 185.64kB 0.01%
assets/tooltip-*.js -1 bytes 26.91kB -0.0%
assets/vega-*.browser-CAfmqKEc.js (New) 25.14kB 25.14kB 100.0% 🚀
assets/command-*.js 552 bytes 10.13kB 5.76% ⚠️
assets/defaultLocale-*.js 139 bytes 4.65kB 3.08%
assets/cells-*.css 62 bytes 9.16kB 0.68%
assets/utils-*.js 27 bytes 6.39kB 0.42%
assets/vega-*.browser-Dun7Qe4B.js (Deleted) -25.17kB 0 bytes -100.0% 🗑️

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 78.73% 81725 / 103802
🔵 Statements 78.73% 81725 / 103802
🔵 Functions 71.42% 695 / 973
🔵 Branches 79.28% 4884 / 6160
File CoverageNo changed files found.
Generated in workflow #20418 for commit c814b4b by the Vitest Coverage Report Action

@dmadisetti
dmadisetti marked this pull request as ready for review August 12, 2026 22:18
@dmadisetti
dmadisetti requested a review from mscolnick August 13, 2026 18:50

@kirangadhave kirangadhave left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

Comment thread marimo/_save/stores/__init__.py
Comment thread marimo/_config/config.py
Comment thread marimo/_config/secrets.py
("ai", "bedrock", "aws_secret_access_key"),
("runtime", "dotenv"),
# This machine's signing identity — never serialized to the frontend.
("signing", "private_key_path"),

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.

should we include cache here as well? in case there is anything sensitive in it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Cache itself is not sensitive, but the private key is. That's in the stack, so just getting this in

@dmadisetti
dmadisetti merged commit 7ff2b4d into main Aug 17, 2026
49 checks passed
@dmadisetti
dmadisetti deleted the dm/cache-config branch August 17, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash-focus Area to focus on during release bug bash enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants