Skip to content

set_visibility purges the edge cache - #34

Merged
ryuzdev merged 1 commit into
mainfrom
visibility-purge
Oct 24, 2026
Merged

ryuzdev merged 1 commit into
mainfrom
visibility-purge

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Found by the M1 acceptance script: after set_visibility public, /robots.txt still disallowed everything — Cloudflare had cached the unlisted answer (cf-cache-status: HIT, max-age=14400), so a public flip could keep crawlers out for hours (and an unlisted flip could keep serving an indexable robots.txt). set_visibility now purges <slug>.<apps_domain> like deploys and deletes do (best-effort, awaited).

Test set_visibility_purges_the_app_host (fails before the change). 413 tests pass.

Live (outer:503c2db): scripts/m1-acceptance.sh --only visibility on pwa-check → 5/5 PASS (unlisted header + robots, public header + robots passes through, restore).

Summary by CodeRabbit

  • Bug Fixes
    • Updating an app’s visibility now also requests a best-effort purge of its host’s edge cache. The visibility update and its response remain unchanged.
    • Added coverage verifying that making an app public results in a cache-purge request for its host.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f998b5c2-5c05-4075-81a2-a9299b28df56
Commits

Reviewing files that changed from the base of the PR and between 94c367c and 503c2db.

Files selected for processing: 2
  • crates/outer/src/mcp/tests.rs
  • crates/outer/src/mcp/tools/apps.rs

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

Walkthrough

After an app’s visibility update succeeds, set_visibility requests a cache purge for the app host. An end-to-end test checks that the purge endpoint receives one request for the expected host.

Changes: Visibility cache purge

Layer / File(s) Summary
Visibility update and cache purge
crates/outer/src/mcp/tools/apps.rs, crates/outer/src/mcp/tests.rs
After the visibility update succeeds, set_visibility calls purge_host_cache for the app host. The purge result is not propagated. The test checks that the fake endpoint receives one request for that host.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • ryuzcorp/outer#20: Adds the shared cache-purge configuration and function used by this change.
  • ryuzcorp/outer#19: Adds host-cache purging after app deletion, using the same app host and purge client.
  • ryuzcorp/outer#14: Adds the set_visibility tool that this change extends.
Merge Risk: Minimal · up to 503c2

The visibility purge change is mergeable with no identified actionable risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "set_visibility purges the edge cache" matches the main change. The PR adds a best-effort, awaited purge of the app host when set_visibility changes an app's visibility, which addresses cach…
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 "set_visibility purges the edge cache" matches the main change. The PR adds a best-effort, awaited purge of the app host when set_visibility changes an app's visibility, which addresses cached /robots.txt responses persisting after switching between public and unlisted. The title names the function and the behavior, and it is short and specific. It does not mention the robots.txt motivation, but that detail is not required.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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.

@ryuzdev
ryuzdev merged commit df51ecd into main Oct 24, 2026
4 checks passed
ryuzdev added a commit that referenced this pull request Oct 24, 2026
ryuzdev added a commit that referenced this pull request Oct 24, 2026
)

* App secrets: AES-256-GCM module, OUTER_SECRET config, key wiring

New crate::secrets: HKDF-SHA256 key derivation from OUTER_SECRET
(label 'outer app-secret v1'), AES-256-GCM values with per-value random
nonce and AAD binding app_id+name, name/reserved validation, 50-cap with a
race-safe guarded INSERT, decrypt_all failing closed. OUTER_SECRET parsed
in config (dev default, refused off localhost, redacted in Debug) and
derived once at boot into McpState and DeploySettings.

* MCP secret tools: list_secrets, set_secret, unset_secret

Owner-scoped via owned_app; name shape + reserved-name + 4KiB checks;
values never in output, summaries carry names only (LOGGED_TOOLS).
Hints: list READ, set WRITE, unset DESTRUCTIVE. Registry/tests counts
updated (30 tools). Tests: roundtrip without values, refusals, foreign
app not_found, 50-cap, value absent from agent_action rows.

* Deploy: inject secrets as Worker vars, scrub after upload

deploy_step decrypts after the gate, merges secrets over code-defined
vars (overwrite journaled by name), writes the config 0600, uploads,
then restores byte-identically. Builds never see secrets (env: &[]).
Fake-celld saves the deployed config, fake-bun records build env; test
pins decrypted vars in the upload, absence in build env, scrubbed
worktree.

* Docs: Secrets section in celld guide, regenerate tools.md

* Fix the merged test file after rebasing onto #34

* Secrets hardening: symlink-pinned inject, RAII scrub, strict names

F1: find_deploy_config/read/inject/restore refuse symlinks
(symlink_metadata, O_NOFOLLOW, temp+rename atomic replace 0600).
F2: InjectedSecrets restores on Drop; sidecar stash under
{data}/secret-sidecars replayed by scrub_interrupted_injections
at boot next to fail_interrupted.
F3: check_name enforces ^[A-Z_][A-Z0-9_]{0,63}$ exactly.
F4: check_reserved refuses all BUN_*; sink skips reserved or
misshapen rows with a warning. F5: SetSecretInput Debug redacts.

* Secrets injection keeps the config's owner (celld deploy runs as the app uid; found live)
@ryuzdev
ryuzdev deleted the visibility-purge branch October 24, 2026 14:06
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