From f243d8b51282bc476b3eb0dce5c0482b1ee22c9b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 19 Oct 2026 15:28:26 +0200 Subject: [PATCH] cultmesh-ts/content: README section and CI step naming Builds. Docs and a workflow name/comment only. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cultmesh-portability.yml | 5 ++-- packages/cultmesh-ts/README.md | 27 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cultmesh-portability.yml b/.github/workflows/cultmesh-portability.yml index 12b326f3..086e54bd 100644 --- a/.github/workflows/cultmesh-portability.yml +++ b/.github/workflows/cultmesh-portability.yml @@ -119,13 +119,14 @@ jobs: - name: Verify the browser client against the shared TypeScript verifier run: npm run test --workspace packages/cultmesh-browser - # The realtime frame codec. Its byte parity rests on two vector files, + # The realtime frame codec and the HTTP content chunk provider (content.test.ts, + # its answers over node:http). The codec's byte parity rests on two vector files, # contracts/cultmesh/realtime-frame-vectors.json written by the C# # reference and decoded by this step, and realtime-frame-vectors.ts-written.json # written by this codec and decoded by the C# step below. Neither half ran # in CI on any OS until these two steps existed, so a codec that agreed # only with itself would have gone green. - - name: Verify the realtime frame codec with the TypeScript codec + - name: Verify the realtime frame codec and the content provider with the TypeScript runtime run: npm run test --workspace packages/cultmesh-ts # Both directions of the CultMesh authority vectors: the C#-written diff --git a/packages/cultmesh-ts/README.md b/packages/cultmesh-ts/README.md index e1fa368b..63858126 100644 --- a/packages/cultmesh-ts/README.md +++ b/packages/cultmesh-ts/README.md @@ -516,3 +516,30 @@ negotiation, watch callbacks, and latest-frame cursor contracts for non-C# clients. The native C# path owns shared-memory rings and GPU-handle integration points. CultCache page append/readback remains the durable recording or nonlocal fallback. + +## Content Chunks over HTTP(S) + +`cultmesh-ts/content` answers the C# HTTPS connector's request, `GET` or `HEAD` +`?chunkHash=&recordKey=`. The mount path is the host's; the +handler reads only the query. Every chunk is hashed against its name before a +byte is sent, so a corrupt or swapped file answers 500 and never leaves the +process, and chunks are never served by path. + +The directory store reads a flat `/` layout. The publisher writes it +from `packContent`'s chunks (an artifact of one chunk is the file named by its +content hash). The store never writes, lists or caches. TLS and concurrency +bounds belong to the host: memory is at most `maxChunkBytes` per in-flight +request. `onServerFault` reports every 500 (`hash-mismatch`, `too-large`, +`store-error`) for health. + +```ts +import { readFileSync } from "node:fs"; +import { createServer } from "node:https"; +import { createContentChunkHandler, createDirectoryChunkStore, toNodeListener } from "cultmesh-ts/content"; + +const handler = createContentChunkHandler(createDirectoryChunkStore("/srv/content"), { + onServerFault: fault => console.error("chunk fault", fault.kind, fault.chunkHash), +}); +createServer({ key: readFileSync("key.pem"), cert: readFileSync("cert.pem") }, toNodeListener(handler)) + .listen(8443, "127.0.0.1"); +```