Skip to content

Add a live probe for delegated SQL caveats (TC-1791) - #699

Merged
samgbafa merged 8 commits into
mainfrom
test/tc-1791-caveat-probe
Nov 22, 2026
Merged

samgbafa merged 8 commits into
mainfrom
test/tc-1791-caveat-probe

Conversation

@samgbafa

@samgbafa samgbafa commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Test-only: a live probe for delegated SQL caveats, the runbook line that says when to run it, and a CHANGELOG entry. No node change. Low priority; merges after #695 under a Naomi GO naming the head.

What

test/caveat-probe (crate tinycloud-caveat-probe, outside the node workspace like test/load/signer: root exclude, its own Cargo.lock, so the image build never sees it; build with cargo build --manifest-path test/caveat-probe/Cargo.toml) signs as a throwaway wallet that owns one probe space, caveatprobe, delegates tinycloud.sql/read on its probe1791 database to a throwaway ed25519 key under each caveat form, and invokes as that key:

step expects
(e) [{"tables":["p_a"]}] grant admitted; p_a read 200; p_b read 403 sql_caveat_violation
(e-reg) [{}] grant admitted; read 200 (unchanged)
(e2) constrained-statements profile admitted; named statement 200; raw query 403 sql-raw-query-blocked
(g) delegation citing an unstored parent 401

It prints one step status= expected= code= PASS|FAIL line per step and exits 0 only on result PASS. It prints no keys, tokens or bodies; code is only the leading refusal identifier.

State file: the caller names a path outside any repository. The first run creates it with mode 0600 (wallet hex and delegatee JWK). Later runs reuse it, so the same probe space is used each time. docs/releasing.md says not to commit or paste it.

Why

js-sdk refuses caveated delegations (refuseCaveated), and test/load/signer signs sessions only. Before this probe, nothing could sign the 1.26.19 live checks (e), (e-reg), (e2) or (g).

Proof

  • Local, against the 1.26.19 binary from main 991467d on sqlite:
    • With sql.delegated_caveats_enforced on: every step PASS. A rerun reuses the space and still passes.
    • With it off: only e-delegate FAILs, with 401 unsupported-caveat (the 1.26.18 behaviour). Every other step PASSes.
  • Live: Amos ran it on tee after 1.26.19 went LIVE (08:41:42Z): result PASS, exit 0.

Invoking a constrained-statements grant needs the grant's own profile as the invocation caveat. With [{}] instead, the node answers 401 invocation-caveats-not-subset-of-chain on both settings, which matches the SDK.

Review

Bobbie reviews alongside: throwaway keys and state-file handling.

No existing test file is edited.

Details: TC-1791

- test/caveat-probe: throwaway wallet + key, one probe space; checks (e) tables grant, (e-reg) [{}] grant, (e2) constrained-statements, (g) unstored parent; prints status lines only.
- Local proof: flag on all PASS; flag off only e-delegate FAILs with unsupported-caveat.

Details: TC-1791
…adable one

- Bobbie #699 LOW: no umask window, no concurrent-first-run race, refuse mode & 0o077 on load.

Details: TC-1791
…uild never needs it

- #699 Docker build failed: cargo chef prepare loads every workspace member, and the Dockerfile copies only the node's crates.
- Root `exclude` like test/load/signer; own Cargo.lock (pruned from the root lock, same versions) and the root's slab patch.
- Root Cargo.lock back to main's; releasing.md builds with --manifest-path.

Details: TC-1791
- Root Cargo.lock drops the probe's entries (now identical to main); test/caveat-probe/Cargo.lock pruned from the root lock.

Details: TC-1791
@samgbafa
samgbafa merged commit cc98658 into main Nov 22, 2026
33 checks passed
@samgbafa
samgbafa deleted the test/tc-1791-caveat-probe branch November 22, 2026 10:20
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