Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
74173f9
Fence TinyChat meeting publication in native SQL and KV boundary
rsvistel Sep 14, 2026
c56e09b
Carry fixed publication commands on the existing SQL write ability
rsvistel Sep 14, 2026
f48c020
Make publication cleanup idempotent and preserve deleted collisions
rsvistel Sep 14, 2026
690f269
fix: serialize replay writes with SQLite graph transactions
rsvistel Sep 14, 2026
bbba444
fix: serialize artifact saves with SQLite graph transactions
rsvistel Sep 14, 2026
6f41c5b
Preserve legacy REAL durations in meeting publication
rsvistel Sep 15, 2026
ec1dc20
Add temporary generation-checked legacy meeting write barrier
rsvistel Sep 15, 2026
c3622ba
chore(release): prepare tinycloud-node 1.17.0
rsvistel Sep 15, 2026
12adf89
Document legacy meeting migration controls and recovery limits
rsvistel Sep 15, 2026
a99e2fa
Prepare digest-pinned native release promotion
rsvistel Sep 15, 2026
bebf5bc
Fix publication comparison lint and native formatting
rsvistel Sep 15, 2026
20464be
Scope migration round-trip tests and preserve legacy guard history
rsvistel Sep 15, 2026
b80cbb9
Merge branch 'workspace/tinychat-publication-v3-20260914' into Codex/…
rsvistel Sep 15, 2026
59dfcc1
Bound authorization error sizes for current Rust Clippy
rsvistel Sep 15, 2026
0b8ef1c
Document Rust error compatibility in the 1.17.0 release
rsvistel Sep 15, 2026
461e387
Merge branch 'workspace/tinychat-publication-v3-20260914' into Codex/…
rsvistel Sep 15, 2026
bc2aae7
feat(TC-500): integrate native sharing with TinyChat release (#234)
samgbafa Sep 15, 2026
7a58693
chore(release): tinycloud-node 1.17.1 (TC-500) (#235)
samgbafa Sep 15, 2026
0987776
ops: add read-only meeting rollback adoption audit
rsvistel Sep 15, 2026
15c0ee5
ops: report sanitized audit SQLSTATE and connection category
rsvistel Sep 15, 2026
08dc006
ops: classify audit connection errors without remote text
rsvistel Sep 15, 2026
344c46b
ops: use verified public CA roots for recovery audit
rsvistel Sep 15, 2026
60c3ab8
fix: withdraw meeting publication and restore legacy SQL writes
rsvistel Sep 15, 2026
05c6a93
chore(release): tinycloud-node 1.17.3 (TC-529, TC-530, TC-597) (#239)
samgbafa Oct 3, 2026
f365fa9
fix(deploy): publish an Android-resolvable CNAME for tee.node.tinyclo…
samgbafa Oct 4, 2026
c99b312
chore(release): tinycloud-node 1.18.0 (TC-626) (#244)
samgbafa Oct 5, 2026
fe7960c
fix(TC-541): authorize hooks requests like other invocation routes
samgbafa Oct 5, 2026
9530c78
fix(TC-541): make hooks authorization read-only, replay-safe, and res…
samgbafa Oct 5, 2026
f4d90c6
fix(TC-541): spend a hooks ticket invocation only on success
samgbafa Oct 5, 2026
61837ce
fix(TC-541): list only webhook subscriptions inside the authorized scope
samgbafa Oct 5, 2026
b774101
chore(release): tinycloud-node 1.17.4 (TC-541)
samgbafa Oct 6, 2026
309e052
chore(release): tinycloud-node 1.19.0 — kv/sync change feed and list …
samgbafa Oct 6, 2026
8411ae5
docs(release): note 1.17.4 is roll-forward only (TC-541)
samgbafa Oct 6, 2026
033b516
merge TC-541 hotfix into 1.19 release line
samgbafa Oct 6, 2026
541251a
chore(release): tinycloud-node 1.19.1 with TC-541
samgbafa Oct 6, 2026
75e709b
fix(review): correct Phala guard and migration test
Oct 6, 2026
332ccc9
fix(deploy): inspect production via pinned Phala CLI
Oct 6, 2026
38844ab
fix(deploy): fail closed on image inspect errors
Oct 6, 2026
572feb1
fix(deploy): remove the Phala response file on exit
Oct 6, 2026
6f57583
Merge pull request #249 from TinyCloudLabs/fix/tc-767-release-line-tc541
samgbafa Oct 6, 2026
6370add
test(TC-780): failing e2e repro of SQL/DuckDB path-isolation defect (N1)
samgbafa Oct 7, 2026
24c5018
test: require exact-path holder read to succeed (TC-780)
samgbafa Oct 7, 2026
dc391c4
fix(TC-780): isolate SQL and DuckDB by full resource path
samgbafa Oct 7, 2026
0ef6550
fix: close TC-780 N2 SQL isolation review gaps
samgbafa Oct 7, 2026
0f65c13
fix: accept covering SQL delegation branches
samgbafa Oct 7, 2026
26ee215
feat(tc-780): migrate legacy SQL identities through quarantined aliases
samgbafa Oct 7, 2026
a94a3a9
fix(tc-780): harden SQL identity cutover and verification
samgbafa Oct 7, 2026
7d1fcc4
fix(tc-780): cache identity fence and stage Phala cutover
samgbafa Oct 7, 2026
09df8d1
feat(TC-780): port SQL identity cutover to production release line
samgbafa Oct 7, 2026
eb2b8ca
fix(TC-730): recheck hook ticket revocation at stream open; literal s…
samgbafa Oct 7, 2026
fc4bcc7
chore(release): tinycloud-node 1.19.2 with TC-730 and TC-815
Oct 7, 2026
da41525
fix(TC-780): make release cutover metadata-only and safe to roll back
samgbafa Oct 7, 2026
fd6792a
fix(TC-780): reject remote host overrides in offline fingerprint mode
samgbafa Oct 7, 2026
a10b235
Merge pull request #252 from TinyCloudLabs/fix/tc-818-node-1.19.2
samgbafa Oct 8, 2026
c3950bb
Merge release line 1.19.2 into TC-780 cutover
samgbafa Oct 8, 2026
9bed848
fix(TC-780): align cutover with 1.19.2 and make abort paths operable
samgbafa Oct 8, 2026
6af0864
TC-780 harden cutover rollback and rehearsal guards
samgbafa Oct 9, 2026
9b240fb
docs(TC-780): close cutover rollback races
samgbafa Oct 9, 2026
6b32b5a
docs(TC-780): close rollback retry and no-container exits
samgbafa Oct 9, 2026
a7132bf
docs(TC-780): enforce cutover phase and rollback retry gates
samgbafa Oct 9, 2026
9d030c5
docs(TC-780): let step 6 run from phase stopping; reset old-image tim…
samgbafa Oct 9, 2026
99bd2d6
docs(TC-780): use live Phala shapes and PostgreSQL 18
samgbafa Oct 9, 2026
5858bc2
TC-780: budget SQL identity production cutover
samgbafa Oct 9, 2026
c2d5245
Merge pull request from TinyCloudLabs/feat/tc-780-release-line (TC-78…
samgbafa Oct 9, 2026
9a73a3f
docs(TC-780): drift baseline is the pre-stop serving inventory; allow…
samgbafa Oct 9, 2026
81045b7
feat(TC-908): allow root kv sync
samgbafa Oct 11, 2026
dda919d
fix(TC-908): unify KV root authorization spellings
samgbafa Oct 11, 2026
9ac42ea
Merge pull request #255 from TinyCloudLabs/feat/tc-858-kv-sync-root
samgbafa Oct 11, 2026
24bdb93
fix ingress request header buffer capacity
samgbafa Oct 11, 2026
5d83660
fix ingress image publishing gate
samgbafa Oct 11, 2026
d25fec0
Merge pull request #256 from TinyCloudLabs/feat/tc-910-ingress-header…
samgbafa Oct 11, 2026
bf7d47e
chore(TC-894): record prod 1.20.0 revision c2d5245 in release-line an…
samgbafa Oct 11, 2026
d914579
fix(TC-894): stop the SQL/DuckDB covering-chain check at the space owner
samgbafa Oct 11, 2026
8b99dc7
test(TC-894): port TC-825 SQL/DuckDB chain-authority tests to 1.20
samgbafa Oct 11, 2026
a60dcfe
chore(release): tinycloud-node 1.20.1 with TC-894, TC-908 and TC-910
samgbafa Oct 11, 2026
36b3964
test(TC-894): keep the explicit empty KV path in ported test helpers
samgbafa Oct 11, 2026
7019f7e
Merge pull request #257 from TinyCloudLabs/fix/tc-894-owner-boundary-…
samgbafa Oct 12, 2026
87e134e
deploy(TC-910): pin the ingress wrapper for 1.20.1
samgbafa Oct 12, 2026
1acc86c
Merge pull request #258 from TinyCloudLabs/fix/tc-910-pin-ingress-wra…
samgbafa Oct 12, 2026
18caf93
fix(deploy): pass --no-public-logs on Phala deploy (TC-959) (#260)
samgbafa Oct 12, 2026
81148f8
Merge feat/tc-780-release-line (prod 1.20.1, 18caf93) into main (TC-940)
samgbafa Oct 12, 2026
2732cfb
chore(TC-940): bump tinycloud-node to 1.20.1 in the excluded e2e crat…
samgbafa Oct 12, 2026
aa64c47
test(TC-940): make the excluded e2e CI jobs runnable on main
samgbafa Oct 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 264 additions & 45 deletions .github/workflows/docker.yml

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ jobs:
- name: Run the workspace test suite
run: cargo test --workspace

# The workspace suite does not enable tinycloud-core's DuckDB feature.
# Run its unit tests with that feature so SQL/DuckDB identity parity is
# checked in CI as well as through the excluded W5 wire-test crate.
- name: Run DuckDB-enabled core tests
run: cargo test -p tinycloud-core --features duckdb

clippy:
name: clippy (workspace)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -164,8 +170,14 @@ jobs:

# test/m1-realdata-e2e, test/load/signer and test/w5-policy-runtime-node-e2e
# are `exclude`d from the workspace in Cargo.toml, so the workspace-wide jobs
# above do not reach them. m1-realdata-e2e is covered by this job; the other
# two are covered by no job at all — recorded here rather than left implicit.
# above do not reach them. m1-realdata-e2e is covered by the job below.
# w5-policy-runtime-node-e2e (including the TC-780 SQL/DuckDB isolation suite
# in tests/sql_isolation.rs) depends on the private TinyCloudLabs/policy-engine
# repository by git, which this workflow's token cannot clone, so it runs
# locally before a release (`cargo test --locked --manifest-path
# test/w5-policy-runtime-node-e2e/Cargo.toml`); a CI job needs a read token
# for that repository first. test/load/signer is covered by no job at all.
# Recorded here rather than left implicit.
m1-realdata:
runs-on: ubuntu-latest
env:
Expand Down
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,85 @@

## [Unreleased]

- CORS preflight (`OPTIONS`) responses on the generic data plane carry `Access-Control-Max-Age: 7200`, so browsers reuse a preflight instead of repeating it before most `/invoke` calls. Share-owned `/policy/v3/*` responses are unchanged (#240, carried from `main` when the 1.20.1 release line merged into `main`, TC-940).

## [1.20.1] - 2026-10-11

- SQL and DuckDB invocations: the covering-chain check stops at a delegation issued by the owner of the invoked space, as registration already does. An owner's SQL/DuckDB grant that also cites a foreign proof (for example another user's KV grant) no longer gets 401. Every non-owner ancestor must still cover the invoked database, ability and caveats (TC-894, port of TC-825).
- `tinycloud.kv/sync` may be granted on the whole-space KV root (`{space}/kv` or `{space}/kv/`), advertised as `kv-sync-root` in `/info`. Prefix grants still cannot reach the root (TC-908).
- Add the `tinycloud-node-ingress` wrapper image: the pinned dstack-ingress base plus `large_client_header_buffers 4 32k`, so signed delegation `Authorization` headers over 8 KiB are no longer rejected with 400 (TC-910).

## [1.20.0] - 2026-10-08

- Isolate SQL and DuckDB databases by full resource path, require exact non-slash database grants and covering delegation chains, and keep hook and share-email SQL reads within the authorized identity (TC-780).
- Add a write-fenced migration from legacy physical names to quarantined aliases, with a preflight migration inventory, transaction-time fingerprint verification, and an explicit cutover runbook (TC-780).
- Keep the production release line's meeting guard, TC-541 and TC-730/TC-815 hook fixes, and KV-sync migrations; add the TC-780 migrations after them. Gate image publishing and require manual digest promotion for the cutover (TC-780).

## [1.19.2] - 2026-10-07

- Re-check hook-ticket delegation revocation and stream expiry at open, prioritize the absolute deadline over queued events, and match literal subscription prefixes; tickets minted under the prior v2 key context must be re-minted (TC-730).
- Bound proof-DAG ancestor traversal to 64 nodes with fixed-size parent pages and fail closed when the closure exceeds the limit (TC-815).

## [1.19.1] - 2026-10-06

- Include the TC-541 hooks authorization, replay-safety and subscription-reset fixes, including the `m20261005_000000_deactivate_hook_subscriptions` migration.
- Add a Phala deploy guard that requires the running production revision to be an ancestor of the selected commit; deliberate non-descendant deployments require an explicit workflow-dispatch override.

## [1.19.0] - 2026-10-05

- KV list prefixes are segment- and case-exact: a `tinycloud.kv/list` on `docs` no longer lists `docsecret/...` (or, on SQLite, `DOCS/...`), wherever lists run, including public `GET /public/<space>/kv?prefix=`. A list-only invocation now honours its cursor instead of returning page 1 forever, and a cursor outside the listed prefix is a 400 (TC-731). A cursor sent with more than one `kv/list` capability is now a 400, and the list cursor is checked before any write in the same invocation (TC-732).
- Add `tinycloud.kv/sync`: an ordered, resumable, delete-aware feed of the latest state of every key under a KV prefix, served through `/invoke` and advertised as the `kv-sync-v1` feature in `/info`. It must be granted explicitly; no wildcard or default session implies it. Responses carry a node-attested `authority` window, and a separate, never-invoked `tinycloud.kv/retain` grant named in `x-tinycloud-retention-grant` adds `retainUntil`. See `docs/kv-sync.md` (TC-732).
- A KV invocation may carry at most 4096 mutations (`kv/put` plus `kv/del`); larger ones are refused with 400 `{"error":{"code":"TOO_MANY_MUTATIONS","max":4096}}`. HTTP/1's request-header limit already caps an invocation at roughly 2,400 puts, so existing batches are unaffected; the cap bounds HTTP/2 over TLS (TC-732).
- Writes to one space are now serialized through commit, so per-space event sequence numbers are unique and commit-ordered on PostgreSQL. Previously, concurrent writers in one space shared sequence numbers (45–161 duplicated `(space, seq)` groups per 640 writes in the benchmark). Measured with `postgres_kv_write_throughput` (release build, PostgreSQL 16, 640 puts per cell, median of 4 interleaved runs), same-space write throughput drops from 99 to 77 ops/s at 8 writers and from 309 to 89 ops/s at 32 writers with S3 block storage (from 135 to 93 and from 402 to 180 ops/s with in-memory blocks). Writes spread across spaces are unaffected. The S3 upload runs inside the serialized section (TC-732).
- Rolling deploys: commit ordering holds only once every node process sharing a database runs this version. While older processes still write to the same PostgreSQL, they assign sequence numbers without the lock, and `kv/sync` clients can miss changes. Upgrade every replica before relying on `kv/sync` (TC-732).
- Conditional KV writes (`If-Match`, `If-None-Match: *`) run under READ COMMITTED behind the space lock instead of SERIALIZABLE; a conflicting write is a 412, and the retryable 503 serialization-conflict response is gone (TC-732).

## [1.18.0] - 2026-10-05

- Return structured storage-full 402/413 JSON with the existing message, space usage and optional billing account totals; authenticate quota fetches with `TINYCLOUD_ADMIN_SECRET` (TC-626).
- Add the authenticated `tinycloud.space/info` usage read through `/invoke`, including the billing management URL. Existing sessions need explicit authority for this read (TC-626).
- Allow non-growing SQLite writes at full storage with rollback on page growth, and allow DuckDB deletes, drops and existing `IF NOT EXISTS` objects. Checkpoint guarded writes without accumulating WAL charges and preserve rejected-write rollback across rehydration (TC-626).
- Harden full-storage guards against SQLite transaction escapes and partial failed requests; keep absent-database no-ops uncharged and reject serialized SQLite/DuckDB artifact growth. Recheck delegated authority at the current time before returning delayed storage rejections (TC-626).
- Close the full-space export bypass: discard absent SQLite/DuckDB actors after rejected guarded requests and return `DatabaseNotFound` for exports without a durable artifact. DuckDB exports no longer persist checkpoints or alter the live WAL base (TC-626).

## [1.17.4] - 2026-10-06

Security hotfix on the 1.17.3 line; contains TC-541 only.

- `/hooks/tickets` and `/hooks/webhooks` authorize every request like `/invoke`: signature, lifetime cap, delegation chain, revocation, time windows and the Policy/v3 gate are checked before any scope is read. A claimed capability is no longer trusted; clients must hold a delegated `tinycloud.hooks/*` ability for the scope they request. Authorization is read-only: a refused request writes nothing, and the invocation is spent in the replay cache only when the request succeeds. Unregistering a subscription the caller may not touch returns the same 404 as a missing one (TC-541).
- The `m20261005_000000_deactivate_hook_subscriptions` migration deactivates every existing webhook subscription, since rows registered before this fix cannot be re-verified. Pending deliveries dead-letter as "subscription inactive"; owners must re-register. The migration is irreversible (TC-541).
- The hook ticket MAC key moves to the `tinycloud/hooks/tickets/v2` derivation context, so tickets minted before this release stop verifying and clients must mint new ones (TC-541).
- `GET /hooks/webhooks` returns only subscriptions inside the authorized scope. Its prefix filter was an unescaped SQL `LIKE`, so `_`, `%` and ASCII case differences let a list grant return other subscribers' rows, including their `callbackUrl` and `subscriberDid` (TC-541).
- Roll-forward only: 1.17.3 refuses to start on a database this release has migrated (`Migration file of version 'm20261005_000000_deactivate_hook_subscriptions' is missing`). An emergency rollback requires deleting that row from `seaql_migrations` first. Subscriptions stay inactive, but rolling back reopens TC-541.
- Accepted residual: an open `/hooks/events` stream's ticket is bounded by its immediate parent delegation's expiry and `hooks.max_ticket_ttl_seconds` (300 s by default), not by ancestors, so revoking a delegation can take up to 300 s to stop a stream that is already open, or a reconnect with an unexpired ticket (TC-541).

## [1.17.3] - 2026-10-01

- Policy/v3 sessions can be long-lived. `/policy/v3/delegations` accepts an optional `requestedExpiresAt`, bounded by the policy, its roots and, on the account path, the account authorization. Requests without it keep the 60-second session, so deployed SDKs are unchanged. Each policy invocation is still capped at 60 seconds and re-checks root liveness and revocation (TC-529).
- Policy-session chains can be re-delegated beyond one hop: each descendant is admitted against its immediate parent (TC-529).
- The encryption decrypt route and `/signed/kv` apply the same policy gate as `/invoke`, so a revoked or expired policy also stops them (TC-529).
- Email-domain shares can be emailed. Delivery authorization admits any canonical mailbox at exactly the policy's domain, names it in the Node-signed admission, and accepts the request only from the policy owner's key. The envelope's `deliveryEmail` is optional, and any share that grants read can be emailed (TC-530).
- Pin the 300-second credential freshness for the `tinycloud.email-domain-proof/v1` profile (TC-500).
- Policy registration requires the policy owner to hold every capability its roots grant, as root authority or through its own delegations, checked by the same rules as an invocation. Minting checks the same as of the policy's registration time, which covers earlier registrations too (TC-597).
- Exact-email delivery keeps the 1.17.2 contract for mixed-case mailboxes. Only email-domain deliveries require the canonical lowercase mailbox (TC-530).

## [1.17.2] - 2026-09-15

- Withdraw meeting publication v3 mutations and restore ordinary SQL authorization for legacy meeting catalogs. Capabilities report the withdrawn features as unavailable; existing legacy write pauses remain inspectable and releasable with their exact generation. Existing snapshot protection and applied migration history are retained for safe recovery.
- Preserve the 1.17.1 sharing changes and SQL artifact persistence fixes. This compatible rollback does not automatically modify meeting records or release existing pauses.

## [1.17.1] - 2026-09-15

- Integrate the reviewed native sharing correction into the TinyChat production lineage: exact-email delivery is authorized by embedded Policy v3, retries preserve strict request-body, JTI, and sender-DID replay binding, and recipient access remains scoped to the ordinary `/delegate` then `/invoke` storage-enforcer path. TinyChat meeting publication, legacy write guards, and digest-pinned deployment are unchanged (TC-500, #234).

## [1.17.0] - 2026-09-15

- Box large unauthorized resource payloads for current Rust Clippy checks; the two Rust error constructors now take `Box<Resource>`, with unchanged authorization decisions and error messages.
- Add the fixed TinyChat meeting publication v3 boundary: conditional reservation and publication, immutable digest-verified snapshots, retained aliases, and idempotent cleanup. Activation is explicit and fences legacy catalog writes; it does not automatically convert old records.
- Add a per-space pause for legacy meeting artifact writes with generation-checked freeze/release controls. The pause drains earlier KV commits, persists across restart, preserves ordinary chat and native snapshot publication, and remains releasable when content storage is full. This adds the central `meeting_legacy_write_guard` migration. Older binaries that do not recognize that migration cannot be used as a direct rollback; activated catalogs also require the compatible publication protocol.
- Preserve integral, fractional and null legacy REAL durations during meeting reservation and publication.
- Serialize SQLite graph transactions for invocation replay and SQL artifact persistence to avoid competing local writers.

## [1.16.1] - 2026-09-15

- Complete the embedded Policy v3 admission path for exact native credential invitations: validate the sealed share envelope and canonical recipient link, bind delivery authorization to the ephemeral holder key, and issue a deterministic signed receipt with strict nonce, request-body, and sender-DID replay protection. Shared content remains in the owner's TinyCloud storage and is accessed through the ordinary `/delegate` then `/invoke` storage-enforcer flow; no Share-specific data plane is introduced (TC-500, #229).
Expand Down
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions deploy/ingress/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM dstacktee/dstack-ingress:20250924@sha256:40429d78060ef3066b5f93676bf3ba7c2e9ac47d4648440febfdda558aed4b32

# nginx.conf includes conf.d/*.conf in http {}; 00 sorts before the generated server block.
COPY header-buffers.conf /etc/nginx/conf.d/00-header-buffers.conf
1 change: 1 addition & 0 deletions deploy/ingress/header-buffers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
large_client_header_buffers 4 32k;
5 changes: 4 additions & 1 deletion docker-compose.dstack-postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ services:
# headroom for admin/psql access, and raise it only alongside the
# instance's own max_connections.
TINYCLOUD_DATABASE__MAX_CONNECTIONS: "15"
# Required for every manual TC-780 deploy. Keep true through offline
# verification; only the final, explicitly reviewed redeploy sets false.
TINYCLOUD_DATABASE__WRITE_FENCE: "${SQL_IDENTITY_FENCE:?set true during cutover, false after verification}"
TINYCLOUD_CORS: "true"
# --- addressed sharing (TC-397) ------------------------------------
#
Expand Down Expand Up @@ -70,7 +73,7 @@ services:
ROCKET_MAX_BLOCKING: "1024"

dstack-ingress:
image: dstacktee/dstack-ingress:20250924@sha256:40429d78060ef3066b5f93676bf3ba7c2e9ac47d4648440febfdda558aed4b32
image: ghcr.io/tinycloudlabs/tinycloud-node-ingress@sha256:726c6d35858e50c5524cc97e789c2c8f09620e77d708bb71bdc9370e3d80ed3e
ports:
- "443:443"
depends_on:
Expand Down
31 changes: 31 additions & 0 deletions docs/incremental-database-artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@
TinyCloud stores file-backed SQL and DuckDB databases as a durable checkpoint
plus the database engine's current write-ahead log (WAL).

## Database identity (TC-780 N2)

SQL and DuckDB select databases by the complete resource path within a space.
The path bytes are mapped to a fixed-length, case-safe `v2d` plus SHA-256 hex
physical name. A pathless resource uses `v2n`, distinct from an explicitly
empty path and from a path named `default`. The logical path remains in the
resource; it cannot be recovered from the physical name. The old final-segment
selectors remain available only for the explicit N3 legacy-artifact migration;
N2 performs no migration or fallback.
DuckDB paths ending in an empty or formerly invalid final segment now get their
own encoded identities instead of opening the old `default` artifact.
At the N3 cutover, the resolver must reserve every preexisting physical name:
only an explicit `(service, space, logical identity)` alias may reach a legacy
artifact, even if its physical name happens to equal a newly encoded identity.
Unresolved legacy artifacts remain inaccessible.

SQL and DuckDB grants without a trailing slash match one exact path. Grants
ending in `/`, and pathless grants, still cover a namespace. KV matching is
unchanged. The share-email named SQL adapter accepts a canonical URI path and
keys by that authorized `path`, using the same identity as `/invoke`; its
separately pinned `database` field does not select a physical artifact.

SQL and DuckDB hook event `path` values encode the database path and table
name as separate components: `db/p<hex database path>/table/<hex table name>`;
pathless databases use `db/n/table/<hex table name>`. Events also carry
`databasePath` (absent for pathless) and `tableName`. Subscription path scopes
refer to the **logical database path**: a non-slash scope is exact, and a
slash-terminated scope covers a namespace. KV event paths and matching are
unchanged. Existing SQL/DuckDB subscribers using table-suffixed scopes must
update them to database scopes.

## Acknowledgement contract

- A mutation is not acknowledged until either its WAL or a replacement
Expand Down
Loading
Loading