Repository navigation
Production compose turns on delegated SQL caveats (TC-1791) - #682
Merged
Merged
Conversation
- docker-compose.dstack-postgres.yaml and the tc959 N0 fixture: TINYCLOUD_SQL__DELEGATED_CAVEATS_ENFORCED: "true". - docker.yml n0_template_hash and docs/releasing.md: template 6c9ff33f..., raw c64a6e2b... (6a577c6d... / 272f43b8... before). - CHANGELOG [Unreleased] entry. - Off, a caveated SQL delegation is refused at /delegate, so no stored chain carries caveats and SQL without them is unchanged. Details: TC-1791
…ted rules (TC-1791) - Bobbie's #682 note (a): with the flag on, a request carrying sqlCaveats facts goes through delegated_denial (case-insensitive names; INSERT/DELETE under a columns list and PRAGMA answer 403). No client sends facts today. Details: TC-1791
# Conflicts: # .github/workflows/docker.yml # CHANGELOG.md # docs/releasing.md
# Conflicts: # .github/workflows/docker.yml # docs/releasing.md
# Conflicts: # .github/workflows/docker.yml # docs/releasing.md
# Conflicts: # CHANGELOG.md
…ith caveats enforced
- With delegated_caveats_enforced on, a `[{}]` or `[]` sql/write grant admitted by the real /delegate runs unrestricted reads (any column, sqlite_master), writes and batches.
- The js-sdk readSql form (constrained-statements profile on the grant and the invocation, executeStatement with params: []) runs with fixedParams injected; a raw query under it is refused.
test-ruling: TC-1791 tinycloud-node-server/src/routes/mod.rs new test only (2026-11-22)
Details: TC-1791
# Conflicts: # CHANGELOG.md
samgbafa
marked this pull request as ready for review
November 22, 2026 05:40
This was referenced Nov 22, 2026
samgbafa
pushed a commit
that referenced
this pull request
Nov 22, 2026
… part 5) - Re-pin canonical fields.json to tinycloud-dev 29ee97f9 (#364): pool_wait_ms, query_time_ms (number 0..86400000), query_count (integer 0..2^53-1). - sanitize.vrl copies the three fields only on node_request with status < 400, type- and bound-guarded; anything else is dropped and the event still ships (Naomi ruling A, 05:22Z). - budget: node (status 399 + DB fields) sizes the request allocation (774 B pair, 14.36 rpm); nodeCapped (no DB fields) sizes the capped classes, reserve unchanged at 585.4 MB. - Vector cases: valid, maxima, mistyped, out-of-bounds, and statuses 399..599 (4xx/5xx carry none). Compose embed regeneration follows after #682 and T3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turns on delegated SQL caveats in production (finish-or-kill T5, Sam's "everything ships live" order, 2026-11-21). Config only, no code and no migration.
Change
docker-compose.dstack-postgres.yamland the tc959 N0 fixture: addTINYCLOUD_SQL__DELEGATED_CAVEATS_ENFORCED: "true".docker.ymln0_template_hashanddocs/releasing.md: templatee5f1c356d68fe9dfac3d1f93109ded95108a8def42984b4bbeab1a29c5ee05ea, rawd1d2ef49…, covering retention (Production compose turns the retention sweeper back on (TC-287) #690) plus caveats. Before:e1cf031b…/f4f51e75….Why no existing user breaks
tinycloud.sql/*delegation carryingtables/columns/readOnlyis refused at/delegatewith 401 (CHANGELOG TC-1791 entry). So no stored chain carries these caveats.sqlCaveats(rg sqlCaveatsacross js-sdk, tinychat and openkey src: none).exec_caveatstherefore staysNone(routes/mod.rs:3296-3299), and SQL without caveats behaves as before.sql_caveat_violationoutside them, and/infolistssql-delegated-caveats-v1.Deploy order: merge after #678 (1.26.18) and deploy in its own window: a bump-only release, then Naomi's head-named GO.
/infofeatures includesql-delegated-caveats-v1.Verified locally:
python3 scripts/ci/test-deploy-recovery.pypasses (30 tests); the fixture is byte-equal to the compose.Details: TC-1791