Skip to content

TC-940: merge the 1.20.1 release line into main (main = prod) - #263

Merged
samgbafa merged 83 commits into
mainfrom
skgbafa/tc-940-main-catch-up
Oct 13, 2026
Merged

samgbafa merged 83 commits into
mainfrom
skgbafa/tc-940-main-catch-up

Conversation

@samgbafa

@samgbafa samgbafa commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Linear: TC-940: make main contain everything production runs.

This is a merge commit, not a rebase. It merges feat/tc-780-release-line at 18caf93e into main. After it lands, main builds what production runs today, plus one main-only performance change (#240) that the release line never got. The 200 MB ingress change (#261) is on the other release branch and arrives in a follow-up PR. It is not part of prod parity.

What prod runs (2026-10-12)

Version 1.20.1 (https://tee.node.tinycloud.xyz/info)
Image ghcr.io/tinycloudlabs/tinycloud-node@sha256:687090118997ad1d54d26c59fffffc37fcb30fc6f9ba02e10f944c0ed479cd80
Revision label 1acc86ce92e36d686edc06414e8cf5bcf7972219 (merge of #258)
Deployed by docker.yml run 38236844781, ref feat/tc-780-release-line, digest promotion, sql_identity_fence=false
Compose docker-compose.dstack-postgres.yaml at 1acc86c. docker.yml rewrites only the node image: to the promoted digest.
Ingress ghcr.io/tinycloudlabs/tinycloud-node-ingress@sha256:726c6d35858e50c5524cc97e789c2c8f09620e77d708bb71bdc9370e3d80ed3e. This is the TC-910 wrapper: dstack-ingress:20250924 plus large_client_header_buffers 4 32k. It is built from deploy/ingress/ on the release line and pinned in the compose by #258.
Storage PostgreSQL 18.6
/info features kv, delegation, sharing, sql, hooks, signed-urls, encryption, kv-sync-v1, kv-sync-root, tee

Which branch. 1acc86c is on feat/tc-780-release-line, which built and deployed it. Tonight Codex/roman/rollback-meeting-node-20260915 was fast-forwarded to the same commit, and #261 was then merged on top of it (3bac7ad, not deployed). The 32 KB header setting is not a deploy-time patch, and it comes from no other repo. It is the TC-910 wrapper image, built from this repo's deploy/ingress/ and pinned by digest in the release line's compose.

Every branch docker.yml has ever built from (all workflow_dispatch runs):

  • Contained in the release line, so carried by this PR:
    • Codex/roman/rollback-meeting-node-20260915 up to 1acc86c
    • Codex/roman/tinychat-native-release-20260915
    • recovery/tc-500-node-1.17.0
    • skgbafa/tc-541-hotfix-1.17.4
    • v1.17.1
  • Already on main: main, v1.4.9, v1.6.0, v1.6.1, v1.8.0, feat/email-claim-n4-integration, skgbafa/prod-rollback-1fba9b4, skgbafa/tc-277-bench-image. The patch from skgbafa/tc-465-phala-trust-bundle is also already on main.
  • Not carried. These were July and August CI experiments. They touch only workflow files, and none of them is the running image:
    • feature/tc-234-phala-cvms: bench image toggle
    • skgbafa/dns-aid-rollout: DNS-AID workflow
    • skgbafa/phala-prod-debug: temporary debug workflows
    • ops/phala-recovery: its commits no longer exist
  • Follow-up PR: Codex/roman/rollback-meeting-node-20260915 at 3bac7ad, which adds fix: allow 200 MB uploads through node ingress #261.

Inventory: release line commits not on main (80)

TC-894: the SQL/DuckDB covering-chain check stops at the space owner (1.20.1, #257)

TC-908: root kv/sync, kv-sync-root (#255)

  • 81045b7, dda919d
  • 9ac42ea merge

TC-910: ingress header buffers, 32 KB (#256, pin #258)

  • 24bdb93 wrapper image
  • 5d83660 publishing gate
  • d25fec0 merge
  • 87e134e pin 726c6d35…
  • 1acc86c merge (the prod revision)

TC-959: --no-public-logs on the Phala deploy (#260)

  • 18caf93

TC-957, TC-899, TC-930: not on any branch. They are 1.20.2 scope with no PRs yet, and will land on main.

TC-780: SQL/DuckDB isolation by full resource path, plus the identity cutover (1.20.0)

  • 6370add, 24c5018, dc391c4, 0ef6550, 0f65c13, 26ee215, a94a3a9, 7d1fcc4, 09df8d1, da41525, fd6792a, 9bed848, 6af0864, 9b240fb, 6b32b5a, a7132bf, 9d030c5, 99bd2d6, 5858bc2, 9a73a3f
  • merges c3950bb and c2d5245 (prod 1.20.0)

TC-730 / TC-815: hooks ticket revocation and bounded ancestry (1.19.2, #251/#252, TC-818)

  • eb2b8ca, fc4bcc7
  • a10b235 merge

TC-541: hooks authorization (1.17.4 hotfix, 1.19.1, #249, TC-767)

  • fe7960c, 9530c78, f4d90c6, 61837ce
  • b774101, 8411ae5, 541251a releases
  • merges 033b516 and 6f57583

Release-line CI and docker.yml (Phala ancestry guard, digest promotion, deploy probes)

kv/sync change feed and list fixes (1.19.0, TC-746/TC-731/TC-732, #248)

  • 309e052

TC-626: storage-full reads and structured errors (1.18.0, #244)

  • c99b312

1.17.3 (TC-529, TC-530, TC-597, #239)

  • 05c6a93

TC-500: TinyChat meeting publication v3 and the native release (1.17.0–1.17.2)

Meeting rollback ops (prod 1.20.0 was built from this line)

  • 0987776, 15c0ee5, 08dc006, 344c46b read-only rollback audit
  • 60c3ab8 withdraws the meeting publication and restores legacy SQL writes

Conflict decisions

There were 17 conflicted files. The rule: keep prod's behaviour unless main has a later, intended change that the release line lacks. I resolved conflict hunks to the release line, then reviewed git diff origin/feat/tc-780-release-line HEAD. Every surviving main-only line is accounted for below.

main-only commit Decision Why
4f7bea7 CORS preflight Access-Control-Max-Age: 7200 (#240) Kept (lib.rs, with its tests) Not on the release line. It is additive: preflight responses only, and /policy/v3/* is untouched. This is the only behavioural difference from prod.
fe29051 TC-626 forward port (#245) Release line Same change as c99b312 (#244). The only differing line is the release line's grows_content, which is main's sql_request_is_write plus the TC-500 meeting-publication exemption (ec1dc20). Test helpers that auto-merged twice were dropped.
b0082dc TC-730/815 (#251) Release line Identical content (eb2b8ca).
2166578 TC-541 (#243) Release line The release line has the later hardening: f4d90c6, 9530c78, 61837ce, and the same hook ticket key context v3 (main's #243 introduced v2; b0082dc/eb2b8ca rotated both lines to v3).
d7f511f TC-732 kv/sync (#247) Release line main required a non-empty KV prefix. Prod deliberately allows the root (TC-908, kv-sync-root).
a11ea8f TC-731 list prefixes (#246) Release line Same semantics via kv_prefix_condition and byte_ordered_resource in the 1.19.0 port.
f894564 TC-500 runtime preflight (#236) Release line docker.yml and probe script The release line's docker.yml has the preflight plus the ancestry guard and digest promotion prod uses. main's stricter probe-script assertion (unsigned delivery must be exactly 401) does not match the release line's probe, which accepts 401 or 400/422. Prod's deploy check was kept.
12f3aa6 TC-513 (#241) Release line Identical (f365fa9).
4a441ad TC-498 (#229), 834c72a 1.16.1 Release line Content is present. The 1.16.1 CHANGELOG section was restored.

.github/workflows/*, docker-compose*.yaml, deploy/ingress/*, Cargo.toml (version 1.20.1) and Cargo.lock are byte-identical to the release line.

Follow-up commit 2732cfb: rust.yml (which never ran on the release line) builds test/m1-realdata-e2e and test/w5-policy-runtime-node-e2e with --locked. Their lockfiles still named tinycloud-node 1.19.0 / 1.20.0, so it bumps both to 1.20.1. That is a one-line version change in each lockfile.

Follow-up commit aa64c47 makes the excluded e2e CI jobs runnable. They had never run on the release line.

  • m1-realdata seeded its SQL fixture under the pre-TC-780 name conversations. After TC-780 the node resolves the full-path digest, and it treats a non-digest artifact as an unmigrated legacy database, which fences SQL with 503. The fixture now seeds under database_identity::logical_name(SQL_PATH). The node is unchanged.
  • w5-node-e2e pulls the private TinyCloudLabs/policy-engine in as a git dependency. The workflow token can't clone it, and the job has never passed (see the TC-780 N1 PR run 37566895448). I removed the job and documented the gap in rust.yml: the suite runs locally before a release (11/11 passed on this branch), and restoring a CI job needs a read token. Switching to m1's vendored copy doesn't compile, because the EvidenceSatisfaction API differs.

Verification

See the PR comments. The full workspace suite runs on SQLite and on PostgreSQL 18.6, plus the DuckDB-enabled core tests. Also checked: /info against prod, and the TC-910 32 KB header test through the pinned ingress wrapper in front of a node built from this branch.

Not in this PR

rsvistel and others added 30 commits September 14, 2026 16:38
Durable, re-delegatable Policy/v3 sessions; the policy gate on the decrypt and signed KV routes; email delivery for email-domain shares; the email-domain freshness pin (from #238); policy owners must hold the authority their roots grant (registration and mint); the exact-email delivery contract kept for mixed-case mailboxes. Two independent reviews (release review and security review), all findings fixed; cargo test --workspace, clippy -Dwarnings and fmt clean; joined gate passed against this head with SDK 3.0.0-beta.19 and Share #105. Details in #239.
…ud.xyz (TC-513) (#242)

The dstack-ingress sidecar CNAMEs DOMAIN to GATEWAY_DOMAIN on every fresh
container start. It was _.${DSTACK_GATEWAY_DOMAIN}; Android's resolver
(bionic res_hnok) rejects a CNAME target whose first label is '_', so
tee.node.tinycloud.xyz does not resolve on Android (WebView and native).

Use gateway.${DSTACK_GATEWAY_DOMAIN}: the CNAME target Phala Cloud
advertises for this CVM (gateway.cname) and upstream dstack-ingress
documents since Dstack-TEE/dstack-examples#123. It resolves to the same
gateway IP; the gateway still routes by SNI + the _dstack-app-address TXT
record, so TLS remains terminated inside the CVM.

(cherry picked from commit 091688b)
Storage-full reads with structured 402/413 errors and account totals, the authenticated tinycloud.space/info usage read, non-growing writes at full storage, and hardened guards plus export bypass fixes. Independent review approved 24f3ff0 (62 tests, clippy -D warnings clean). Details in #244.
Run the ordinary invocation authorization (signature, delegation chain,
revocation, time windows) and the Policy/v3 gate before the hooks ticket
and webhook routes read an invocation's capabilities, matching
/signed/kv. Scope checks now accept only a verified invocation.

Clients must hold a delegated tinycloud.hooks/* ability for the scope
they request.

(cherry picked from commit 6daf117)
…et hook state

Hooks routes no longer reuse verify_auth, whose TinyCloud::invoke records
the invocation and executes input-free operations such as kv/del before
the route rejects the request. Each hooks request now:

- refuses any capability outside tinycloud.hooks/* on the hooks service;
- applies /invoke's admission (signature, lifetime cap) and the read-only
  invocation kernel (delegation chain, revocation, time windows) via the
  new SpaceDatabase::authorize_admitted, with no space lookup;
- passes the Policy/v3 gate, then the route's scope check;
- only then spends the invocation in the /invoke replay cache.

A refused request writes nothing. Unregistering a subscription the caller
may not touch now looks the same as unregistering a missing one.

Existing state is reset on upgrade:
- a migration deactivates every existing webhook subscription (rows
  carry no delegation reference, so they cannot be re-verified); owners
  re-register. It logs the count and the (space, subscriber) pairs only;
- the hook ticket MAC key context moves to tinycloud/hooks/tickets/v2,
  so tickets minted before this change stop verifying.

Bounded residual: a ticket's lifetime is capped by the immediate parent
delegation's expiry and max_ticket_ttl (300 s by default), not by
ancestors, so revoking an ancestor takes effect on open streams within
that window.

(cherry picked from commit f9f4889)
create_hook_ticket recorded the invocation in the replay cache before
mint_hook_ticket checked the effective expiry, so a request refused for
an immediately-expiring TTL still consumed its header and a valid retry
got 409. The ticket is now built and signed first; the invocation is
spent only when the request will succeed.

Document that the Policy/v3 root-authority probe must be signed by the
content space's owner.

(cherry picked from commit 8ac8990)
GET /hooks/webhooks filtered rows with sea-orm starts_with, an unescaped
LIKE 'prefix/%'. `_` and `%` matched any character and SQLite LIKE ignores
ASCII case, so a hooks/list grant on kv/my_docs also returned other
subscribers' rows (callbackUrl, subscriberDid) under MY_DOCS/, myXdocs/
and my%docs/.

The route now re-checks every returned row against the requested space,
service and scope with the exact-or-'/'-boundary rule its authorization
uses.

(cherry picked from commit 9ccb7ac)
…0 N3, 1.20.0)

TC-780: SQL identity isolation (N3) for tinycloud-node 1.20.0
… only added unique single-path databases

Block 05 checks the 17:52 metadata snapshot against serving prod and records the serving
inventory (with timestamp and allowed additions) as the drift baseline. Steps 4-5 check the
outage inventory and artifact-metadata identities against that baseline. Allowed drift: added
durable databases classified unique with one path and no collision. Removed or changed
identities, new ambiguous/unattributed databases and any collision abort.

Approved by the TC-780 orchestrator (a69fffe1); rehearsed locally on 10 cases.
…-buffers

fix ingress request header buffer capacity
has_covering_chain walked SQL/DuckDB proofs to a parentless root, so an
owner-issued grant citing a foreign proof (e.g. another user's KV grant)
got 401, although registration already treats an owner-issued delegation
as the authority boundary. Stop at a delegation issued by the owner of the
invoked space; every non-owner ancestor must still cover the database,
ability and caveats.

Port of the owner-boundary half of ebf86d6 (TC-825, 1.19 line).
Ports the tc825_ route tests (0374e7e, incl. T2.6
tc825_owner_issued_sql_capability_terminates_chain_despite_foreign_proof),
the three-hop caveat test (f5fc6c7) and the restored helper comment
(a10df21) onto the 1.20 fixture, keeping 1.20's /info route and KV root
helpers. Without the fix only the owner-issued test fails.
The ported resource_in helper made an empty path pathless for every
service, so device_invocation("") signed {space}/kv instead of
{space}/kv/ and the TC-908 root-spelling test compared one spelling with
itself. KV keeps the explicit path again, and the test asserts the two
signed spellings differ (found by the Sol review).
…1.20

fix(TC-894): SQL/DuckDB chain check stops at the space owner; release 1.20.1
Pins ghcr.io/tinycloudlabs/tinycloud-node-ingress at the digest published
by docker.yml run 38202180076 (build of 7019f7e, the 1.20.1 merge): the
pinned dstack-ingress base plus large_client_header_buffers 4 32k (#256).
Roll back by restoring dstacktee/dstack-ingress:20250924@sha256:40429d78060ef3066b5f93676bf3ba7c2e9ac47d4648440febfdda558aed4b32.
…pper-1.20.1

deploy(TC-910): pin the ingress wrapper for 1.20.1
Brings main level with production: tinycloud-node 1.20.1, image
sha256:687090118997ad1d54d26c59fffffc37fcb30fc6f9ba02e10f944c0ed479cd80
(revision 1acc86c), plus #260 (--no-public-logs, TC-959).

Conflicts resolved to the release line (prod) except where main had a
later change the release line lacks:
- keep main's CORS preflight Access-Control-Max-Age (#240) in lib.rs;
- restore main's 1.16.1 CHANGELOG section.
Every other main-only commit (TC-498, TC-500 preflight, TC-513, TC-541,
TC-626, TC-730/815, TC-731, TC-732) already has a later port on the
release line, which wins. See the PR description for each decision.
@samgbafa

Copy link
Copy Markdown
Contributor Author

Review (openai-codex/gpt-6-astra)

Findings

No blocking correctness or authorization regression found in merge 81148f838bc3d9ed22afb0a68a21e6f882a271f0.

Tree and production parity

  • Both parents are present, in order: main fe290510b4cd86d0d8b226a441ca15a868495d40, release 18caf93ec22abcae01d32ce8a4acadf21fc80253.
  • The complete release-to-merge diff touches only tinycloud-node-server/src/lib.rs and CHANGELOG.md: the CORS fairing extraction, OPTIONS max-age and its tests; the Unreleased entry and restored 1.16.1 entry.
  • tinycloud-core/src/sql/*, tinycloud-core/src/duckdb/*, tinycloud-core/src/db.rs, and server routes/mod.rs are byte-identical to both release 18caf93 and production revision 1acc86c. This is not a mixture of the two authorization ports.
  • .github/workflows, docker-compose*.yaml, deploy/ingress, root Cargo.toml, Cargo.lock, and the server manifest are byte-identical to the release line. The server remains 1.20.1. The sole intervening release-line commit after the stated production revision is TC-959 (--no-public-logs).

All ten main-only commits, compared directly

Main-only commit Review disposition
fe29051 — TC-626 / #245 Release retains the storage-full read and no-growth write behavior from c99b312. sql_request_is_write is retained; grows_content only exempts recognized meeting-publication compatibility status/release commands, not arbitrary SQL writes (routes/mod.rs:2377-2394,2514-2535).
b0082dc — TC-730/815 / #251 Release eb2b8ca preserves the hook/revocation changes. The final tree retains proof-bearing tickets, revocation checks before opening streams, bounded complete ancestor traversal, literal subscription prefixes, and the v3 ticket key (routes/hooks.rs:298-320; hooks.rs:97-99).
2166578 — TC-541 / #243 No missing hooks fix. Compared with release fe7960c, 9530c78, f4d90c6, and 61837ce: the release retains ordinary invocation authorization, hooks-only/read-only admission, policy gating, replay handling, authorized subscription filtering, and the subscription-reset migration. The four compared hook implementation/migration files have no diff between 2166578 and 61837ce.
d7f511f — TC-732 / #247 Root rejection is intentionally superseded by TC-908, not accidentally lost. Both root spellings are accepted; the ordinary authorization checks remain, so a prefix grant does not become a root grant (routes/mod.rs:917-951; db.rs:2293-2409).
a11ea8f — TC-731 / #246 Release retains the read-only list cursor and segment-/case-exact membership. The shared prefix helper uses literal byte-ordered ranges, not wildcard LIKE; cursor comparison and ordering remain consistent (db.rs:2464-2473,3498-3562).
4f7bea7 — CORS / #240 Preserved. Existing allow-origin/method/header/credentials values are unchanged. Max-age is added only for OPTIONS, after the /policy/v3/ early return (lib.rs:706-764). No Policy-v3 response policy is widened.
12f3aa6 — TC-513 / #241 The release's f365fa9 carries the identical Android-compatible gateway.${DSTACK_GATEWAY_DOMAIN} CNAME change.
f894564 — TC-500 / #236 Startup preflight and digest pinning survive. --validate-config still precedes app initialization (main.rs:34-53); the workflow checks image revision/version and runs sealed validation without network access before normal deployment (docker.yml:475-544). The probe/script is deliberately less strict about malformed unsigned delivery responses (401 or 400/422), but the actual route still requires the invocation guard and verify_and_authorize before delivery processing (policy_v3.rs:1342-1364). No delivery authorization bypass is introduced.
834c72a — 1.16.1 release Superseded by 1.20.1 manifest/lockfile versions; the historical 1.16.1 changelog entry is restored (CHANGELOG.md:84-86).
4a441ad — TC-498 / #229 Native delivery authorization remains: signature/chain authorization, exact resource and owner-envelope binding, registered policy/live roots, ciphertext/link/holder binding, freshness and durable retry/replay checks. The only main-to-release production-code addition in config.rs is the SQL cutover write_fence; no delivery configuration behavior is dropped.

SQL/DuckDB inspection also confirms admission before execution (routes/mod.rs:3551-3578), full-resource identity resolution, and a covering proof chain that checks resource, ability and caveats at every non-owner ancestor and stops at the invoked space owner (models/invocation.rs:460-490). TC-780 isolation and TC-894's owner boundary are preserved together.

Nits (non-blocking)

  • P3 — PR-description precision; tinycloud-node-server/src/hooks.rs:97-99: the decision table's “main had v2” applies to the earlier TC-541 commit, not the main tip being merged. Main's later b0082dc already rotates the same context to v3. Clarify this historical distinction; no code change is needed.

Verification

  • Read-only historical/tree comparisons; checkout unchanged. Execution isolated under /tmp/tc940-astra-review.
  • node scripts/check-deployment-policy-probes.mjs passed.
  • cargo test -p tinycloud-node --lib cors_fairing_tests --locked passed: 2 tests. These dispatch requests through Rocket's actual catch-all OPTIONS route and fairings, covering generic preflight headers, actual POST responses, and Policy-v3 exclusion.
  • No full-workspace, PostgreSQL, DuckDB-enabled, or live-deployment run was performed for this review.

VERDICT: APPROVE

…es' lockfiles

rust.yml runs m1-realdata-e2e and w5-policy-runtime-node-e2e with --locked;
the release line never ran rust.yml, so both lockfiles still named 1.19.0/1.20.0.
@samgbafa

Copy link
Copy Markdown
Contributor Author

Review (Claude Opus 5.5)

Independent read-only review of 81148f8. Method: tree diff against origin/feat/tc-780-release-line; for each of the 10 main-only commits, git apply --check (forward and reverse) against the merged tree; patch-to-patch comparison with the release-line equivalent; and git blame origin/main over every file that differs between main and the merge, listing each line that a main-only commit wrote and that no longer appears anywhere in the merged file. Built the merged tree in a scratch worktree: cargo test -p tinycloud-node --lib passes 430/430 (SQLite; PostgreSQL and DuckDB not re-run here).

Findings

1. Blocking (medium): merging tags and publishes v1.20.1 from a tree that is not prod 1.20.1

  • .github/workflows/release-plz.yml:73-89: the release job (release-plz release) runs on every push to main.
  • release-plz.toml:54-55: git_tag_enable = true and git_tag_name = "v{{ version }}".
  • After this PR, main is at version = "1.20.1", and no v1.20.1 tag exists. Remote tags stop at v1.17.1; there is also no v1.17.3…v1.20.0.
  • This has happened before. The v1.16.1 tag object says "chore: Release package tinycloud-node version 1.16.1". It was created at 01:49:33Z, inside the release-plz run for the push of 834c72a to main. That tag then started docker.yml run 34918787220 (ref v1.16.1) and a cargo-dist run, and github-actions published GitHub Release v1.16.1.
  • So merging TC-940: merge the 1.20.1 release line into main (main = prod) #263 will:
    • create the git tag v1.20.1 on the merge commit, not on the prod revision 1acc86c;
    • have cargo-dist (release.yml:44-45) publish a GitHub Release v1.20.1;
    • have docker.yml (docker.yml:19, :294) build and push tinycloud-node:1.20.1, 1.20.1-dstack, 1.20-dstack and 1-dstack (gated by TC780_CUTOVER_READY, which is set for prod).
  • That tree contains the perf(server): cache CORS preflight responses with Access-Control-Max-Age #240 CORS change that prod 1.20.1 lacks. The PR's own CHANGELOG lists that change as [Unreleased]. The released 1.20.1 would then name two different binaries, and a tag and release that have been published are hard to take back.
  • Running prod is not affected: compose is digest-pinned, and deploy-phala only runs on workflow_dispatch.
  • Fix, before merging: push an annotated tag v1.20.1 at 1acc86ce92e36d686edc06414e8cf5bcf7972219. That also records the prod revision. release-plz then sees 1.20.1 as already released and skips it. You could tag v1.20.0 at c2d5245 too, for the same history. The other option is a version bump in this PR, but that breaks the "Cargo.toml identical to the release line" property.

2. Verified, no issue: tree and parents

3. Verified, no issue: the 10 main-only commits

  • 12f3aa6 (TC-513) and 4f7bea7 (perf(server): cache CORS preflight responses with Access-Control-Max-Age #240) are fully present (they reverse-apply cleanly). b0082dc (TC-730/815) has a patch byte-identical to eb2b8ca.
  • TC-498 4a441ad: the config.rs and policy_v3.rs patches are byte-identical to bc2aae7. Of 4a441ad's lines, only an import list and the email-proof freshness predicate are gone. The release line widened that predicate to tinycloud.email-proof/v1 | tinycloud.email-domain-proof/v1 (policy_v3.rs:5871), which is a later prod change.
  • TC-541 2166578 vs fe7960c/9530c78/f4d90c6/61837ce. Everything in fix(TC-541): authorize hooks requests like other invocation routes #243 is in the merge:
    • VerifiedHookInvocation and consume-on-success, with an invoker nonce for policy sessions (routes/hooks.rs:43-115);
    • create_hook_ticket in the Policy/v3 gate, with its test (policy_v3.rs:8337, 9064-9129);
    • authorize_admitted (tinycloud-core/src/db.rs:514);
    • the deactivate_hook_subscriptions migration, registered in migrations/mod.rs:24,56;
    • HOOK_TICKET_KEY_CONTEXT set to v3 (hooks.rs:99).
    • main vs merged routes/hooks.rs and hooks.rs differ only by the TC-780 additions for exact SQL/DuckDB database scope (database_scope_matches, normalize_path_prefix_for_service). These narrow scope matching; they don't widen it.
  • TC-732 d7f511f: the only main-only lines that are gone are the non-empty-prefix rule: routes/mod.rs kv_sync_target, tinycloud-core/src/db.rs kv_sync_target, the kv-sync-v1-only features line, a test assertion, and the docs. The merge has TC-908's version (routes/mod.rs:921-952, db.rs:2546-2578). It still requires a single capability, service == kv, and no query or fragment. It maps {space}/kv and {space}/kv/ to one canonical resource, so root sync is allowed by design and nothing else is relaxed.
  • TC-731 a11ea8f: every line a11ea8f added is still in the merged tree. kv_prefix_condition, byte_ordered_resource, kv_list_cursor_in_prefix and the segment-exact and hostile-collation tests are all present, with the same call counts as on main.
  • TC-626 fe29051 vs c99b312. The two differ in two places:
    • (a) The release line has grows_content = publication_command.is_none() && sql_request_is_write(..) (routes/mod.rs:2521-2529). That is main's predicate, plus the meeting-publication carve-out, which only exposes status and release.
    • (b) main clears the SQLite authorizer after every actor Execute. The merged tree has that too (tinycloud-core/src/sql/database.rs:219), so nothing is lost.
  • TC-500 f894564: --validate-config, resolve_runtime_config and the config tests survive; only comment lines are gone. The release-line docker.yml keeps the digest pin, the revision/version label check, and the "Preflight sealed runtime configuration" step (docker.yml:488-521, :544). The probe assertion got weaker; see nit 1.
  • 834c72a: version bump only. It is superseded, and the [1.16.1] CHANGELOG section is restored.

4. Verified, no issue: SQL/DuckDB authorization (TC-894, TC-780)

git diff --stat origin/feat/tc-780-release-line 81148f8 -- tinycloud-core tinycloud-auth tinycloud-node-server/src/routes is empty. sql/*, duckdb/*, db.rs, models/* and routes/mod.rs (invocation, authorization, handle_sql_invoke, select_database_scope, require_sql_admin_for_request) are prod's byte for byte. Nothing from main's port is mixed in.

5. Verified, no issue: CORS

  • cors_fairing (lib.rs:706-740) sets the same allow-origin, methods, headers and credentials values as prod. It adds only Access-Control-Max-Age: 7200, and only when request.method() == Method::Options (:729).
  • It returns before any header for is_mounted_share_path (/policy/v3/, lib.rs:763), so /policy/v3/* stays owned by share_security_fairing.
  • cors_fairing_tests passes 2/2 on the merged tree.

6. Verified, no issue: deploy surface

.github/workflows/*, docker-compose*.yaml, deploy/ingress/*, every Cargo.toml and Cargo.lock are byte-identical to 18caf93. The compose pins ingress @sha256:726c6d35…, and Cargo.toml is at 1.20.1.

Nits (non-blocking)

  1. docker.yml:709-720: the post-deploy probe accepts 400 or 422 from /policy/v3/deliveries/authorize as well as 401. main's f894564 required exactly 401 and failed CI on 400|401|422 (main:scripts/check-deployment-policy-probes.mjs:39-50). The handler takes the AuthHeaderGetter guard before the Json data guard (policy_v3.rs:1342-1363), so 401 is the real contract, and accepting 400 would hide a reordered or unauthenticated route. Keeping prod's check is consistent with this PR; restoring the strict check is worth a follow-up.
  2. Behaviour change on main worth telling release owners: docker.yml no longer deploys to Phala on release or v* tag events. deploy-phala is workflow_dispatch + deploy_phala + TC780_CUTOVER_READY only (docker.yml:358-366). This is prod's surface, so it is intended.
  3. The PR table says "main had v2" for the hook ticket key context. That is true of fix(TC-541): authorize hooks requests like other invocation routes #243, but main HEAD already had v3 from b0082dc. The wording is off; the code is unaffected.

VERDICT: REQUEST_CHANGES

rust.yml only runs for PRs into main, so the release line never ran these.
- m1-realdata seeded its SQL fixture under the pre-TC-780 final-segment
  name ("conversations"); the node now resolves the full-path digest, and a
  non-digest artifact is an unmigrated legacy database that fences SQL with
  503. Seed under database_identity::logical_name(SQL_PATH) instead.
- w5-node-e2e depends on the private policy-engine repository by git, which
  the workflow token cannot clone; the job has never run. Drop it and record
  that the suite runs locally until CI has a read token.
@samgbafa

Copy link
Copy Markdown
Contributor Author

TC-940 parity proof (no deploy)

All of this ran locally on this branch. The suites ran at aa64c47. The image was built from 81148f8; the commits after it touch only test crates and rust.yml, so the node source is the same.

Suites

PostgreSQL is postgres:18.6 (prod runs 18.6), in container tc940-pg18, with TINYCLOUD_TEST_POSTGRES_URL set.

Suite Result
cargo test --workspace (SQLite, plus every postgres_* test against PG 18.6) and cargo test -p tinycloud-core --features duckdb 1304 passed, 0 failed. The 8 ignored are 7 siwe README doctests and the manual PG throughput benchmark.
test/m1-realdata-e2e (--locked, CI's python requirements) 13 passed
test/w5-policy-runtime-node-e2e (--locked, private policy-engine via local git credentials), including TC-780 sql_isolation.rs 11 passed
TC-957 guard test (~/scratch/tc-957/repro/node-guard-test.patch, applied temporarily): tc957_account_index_schema_needs_an_account_space_grant ok

/info

Compared three nodes:

  • main: docker build --build-arg CARGO_FEATURES=dstack, as docker.yml build-dstack does;
  • prod image: ghcr.io/tinycloudlabs/tinycloud-node@sha256:68709011…cd80, run locally;
  • public prod: https://tee.node.tinycloud.xyz/info.

The main and prod-image nodes both ran on PG 18.6.

  • All three report version 1.20.1 with the same features, kv, delegation, sharing, sql, hooks, signed-urls, encryption, kv-sync-v1, kv-sync-root, tee.
  • inTEE is false locally only because there is no dstack socket.

TC-910 header test

Each ingress image ran with a mirror of the TLS + http2 server block that dstack-ingress generates. Status codes by Authorization header size, for GET /info / POST /delegate:

Ingress → node HTTP/1.1, 8.5 / 12 / 20 / 31 KB HTTP/2, 8.5 / 12 / 20 / 31 KB 40 KB, HTTP/1.1
prod wrapper 726c6d35… → main build 200 / 401 at every size 200 / 401 at every size nginx 400 (over 32k)
prod wrapper 726c6d35… → prod image identical to the row above identical identical
base dstack-ingress:20250924 → main build (negative control) nginx 400 "Request Header Or Cookie Too Large" at every size 8.5 KB ok; 12 KB and up: stream reset nginx 400
#264 wrapper 08cf3ee4… → main build 200 / 401 at every size 200 / 401 at every size nginx 400

nginx -T shows large_client_header_buffers 4 32k in both wrappers and not in the base.

End-to-end smoke

Run against both the main build and the prod image with the tc CLI, using a throwaway key-only profile in an isolated HOME:

  • auth login --method local (that is, /delegate);
  • kv put / kv get;
  • sql execute (create + insert) / sql query.

Both succeed and return the same results.

The only behavioural difference

OPTIONS /invoke on main adds access-control-max-age: 7200 (#240). Every other CORS header is byte-identical to the prod image.

@samgbafa

Copy link
Copy Markdown
Contributor Author

Review (openai-codex/gpt-6-astra)

Final-head re-review of aa64c471dc42e523ffd2a13a8a6976bfa2a24c6e.

Findings

No blocking findings or new nits. My approval applies to this final head, not just the original merge.

  • aa64c47 changes exactly .github/workflows/rust.yml and test/m1-realdata-e2e/tests/cross_layer_contract.rs. Node/application code is unchanged. The earlier 2732cfb remains only the two excluded-crate lockfile version corrections already reviewed.
  • The m1 helper at cross_layer_contract.rs:72-77 uses database_identity::logical_name(Some(SQL_PATH)), the full-path identity introduced by TC-780. All three seed writes use it (:1158,1188,1832), rather than creating a legacy conversations artifact that triggers the migration fence.
  • This does not weaken the contract assertions: invocation resources still carry the original SQL_PATH, with signed holder authorization sent through the real /invoke route (:1057-1085). Successful queries still assert the exact seeded conversation/participant results (:414-441); disallowed statement, fixed-parameter override, raw query/write, batch and export operations still assert their exact forbidden outcomes (:447-493). Delegation, revocation, audience, expiry and KV-denial checks are unchanged. No assertion, expected error, capability, or authorization check is removed by this fixture correction.
  • The w5 suite itself is untouched. Removing its presently unrunnable CI job is documented explicitly in rust.yml:171-183, including the private dependency, required read token, local command and TC-780 SQL/DuckDB coverage. This leaves a known automated coverage gap; it does not make that suite CI-covered. I accept the supplied private-dependency/API incompatibility evidence and the reported local 11/11 run; I did not retry the inaccessible dependency or substitute the incompatible vendored API.

Evidence and CI status

Read the final-head parity proof: it reports 1304 passing workspace/DuckDB tests with PostgreSQL 18.6, m1 13 passing, w5 11 passing, production-image comparisons and CLI/header smoke results. Those are the author's recorded results, not new runs by this reviewer.

gh pr checks 263 and the Rust run metadata identify aa64c47 and currently show:

  • Passed: m1-realdata, workspace build/clippy/fmt, capabilities, version guard, ingress image build, and release plan.
  • Still pending: PostgreSQL-backed workspace tests and the Docker build job.
  • Other listed jobs are skipped; no failed check was reported in the inspected snapshot.

This is source-review approval, not an all-green-CI claim. Preserve the remaining CI merge gates. The annotated production tag, empty release-plz dry-run result and accepted mutable-image-tag movement are supplied release-coordination evidence; I did not rerun or change them.

Read-only review; no repository changes, deployment, or containers created in this pass.

VERDICT: APPROVE

@samgbafa

Copy link
Copy Markdown
Contributor Author

Review (Claude Opus 5.5): final-head re-review at aa64c47

Release-plz blocker: resolved

  • v1.20.1 exists on origin as annotated tag object cb029e6c…, peeled to 1acc86ce92e36d686edc06414e8cf5bcf7972219, the prod revision. Its message records docker.yml run 38236844781 and image sha256:68709011…cd80.
  • With that tag present, release-plz (publish = false, git_tag_enable = true) has nothing to release at 1.20.1. That matches the dry run you reported (Already published - Tag v1.20.1 already exists, {"releases":[]}).
  • The mutable image tags the merge moves (latest, <sha7>, dstack, dstack-<sha7>, ingress latest/<sha7>) are accepted. No semver image tag moves on a push to main.

aa64c47: test/CI-only, and m1 is not weakened

  • Files: only .github/workflows/rust.yml and test/m1-realdata-e2e/tests/cross_layer_contract.rs.
    • git diff --stat origin/feat/tc-780-release-line aa64c47: lib.rs (perf(server): cache CORS preflight responses with Access-Control-Max-Age #240) and CHANGELOG.md as before, the two e2e lockfiles from 2732cfb, and these two files.
    • Every other release-line file, including tinycloud-core, tinycloud-auth, routes/, docker.yml, the compose files, deploy/ingress and the root Cargo.toml/Cargo.lock, is still byte-identical to the release line.
  • m1 fixture:
    • The SQL_DB = "conversations" constant is replaced by sql_db() = database_identity::logical_name(Some(SQL_PATH)), used at the three direct SqlService::execute seed calls (:1158, :1188, :1832).
    • That is exactly what the node resolves for an unaliased path: database_migration::resolve starts from logical_name(path) (tinycloud-core/src/database_migration.rs:615) and only diverts when an alias row exists, which this fixture never creates.
    • The name has the form v2d + 64 hex characters, so is_digest_name holds and the TC-780 fence no longer trips.
    • No assertion changed. The diff touches only the seed target, so every read and denial expectation in the test is the same as before.
    • The test still proves that the node's own name resolution finds the seeded rows (rowCount 1, "Planning", participants). If resolution differed from the seed name, those reads would fail.
    • The old run hit 503 because the fixture bypassed resolution, not because coverage was dropped.
  • w5 removal: the job never succeeded in CI. It cannot clone the private policy-engine dependency (job 115057304529). The new comment (rust.yml:171-180) records that and the local command.
    • Residual risk: the TC-780 sql_isolation.rs suite now has no CI coverage until a read token exists. Track that as a follow-up rather than relying on the comment.
    • I ran the w5 clippy step locally earlier at 2732cfb (the w5 crate is unchanged since) and it was clean. Your 11/11 local result covers the tests.

CI on aa64c47 (gh pr checks 263): 10 pass, 8 skipping, 0 failing

  • ci run 38324813599: build, clippy, fmt, capabilities, m1-realdata and test (workspace, PostgreSQL-backed) all pass. The PostgreSQL job finished at 00:17:01Z.
  • Docker Container run 38324813618: Version guard, Build dstack ingress image and build pass. build-dstack, rollback-audit and deploy-phala are skipped, as expected on a PR.
  • Release (cargo-dist plan): passes, with publish jobs skipped.

The proof comment's parity results match what I checked independently:

The only image built is from 81148f8. That is sound, because the later commits change no node source.

Remaining (non-blocking)

VERDICT: APPROVE (#263, final head aa64c47)

@samgbafa
samgbafa merged commit f529147 into main Oct 13, 2026
18 checks passed
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.

2 participants