carlos / platform Public

docs: LiveKit guide fixes from the 2026-11-26 live test

The phase 1 path with the store's own credential from the app's
environment, both write credential refusal codes, the CLI version
that first ships carlos store credential (v0.43.8), and where
manifest_location points on a normal recording. Adds the Luna brief.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev a43fdd5bf94ff4d29076ac3f22d3ded07a737734 parent 7a4e16e
3 files changed, +84 −7
  • docs/site/cli.md +3 −1
  • docs/site/live-streams-bring-your-own-livekit.md +42 −6
  • docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit-2.md +39 −0
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 540132d63..affe03f2c 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -2397,7 +2397,9 @@ Authorization: Bearer <service token>
`--revoke` stops every write credential the store has issued so far. It can take a few minutes to reach every upload, and you can mint a new one a minute or two later. Rotating the store's own credential with `carlos store rotate` doesn't affect write credentials.
-Write credentials need AWS S3. Your operator turns them on. This release returns `503` with `write_credentials_not_released`; wait for a later release before using write credentials.
+Write credentials need AWS S3. Your operator turns them on. While they're off, both commands return `503` with one of two codes. `write_credentials_not_configured` means your deployment hasn't turned them on. `write_credentials_not_released` means it has, but its release can't issue them yet. Until then, a service can use the store's own credential from the app's environment, as the [LiveKit guide](/docs/live-streams-bring-your-own-livekit#until-write-credentials-are-on) shows. That credential can read, list and delete every file in the store.
+
+`carlos store credential` needs CLI v0.43.8 or later. An older CLI doesn't know the command and prints the `carlos store` usage instead.
#### carlos store uploads
diff --git a/docs/site/live-streams-bring-your-own-livekit.md b/docs/site/live-streams-bring-your-own-livekit.md
index 458b9f126..c506205b9 100644
--- a/docs/site/live-streams-bring-your-own-livekit.md
+++ b/docs/site/live-streams-bring-your-own-livekit.md
@@ -10,8 +10,9 @@ You need:
- A LiveKit Cloud project. Its settings page gives you the project URL, such as `wss://shop-a1b2c3.livekit.cloud`, and an API key and secret.
- An object store for the app, made with `carlos store create --app shop`, on a deployment with media conversion turned on. The store must pass the check on the media conversion page. A store made with `carlos store create` and left alone passes.
-- A Service credential for media conversion, as in [the media conversion example](/docs/media-conversion#an-example). Use that credential to get a write credential for each recording.
-- Write credentials turned on for your deployment. Your operator does that. If they're off, `carlos store credential` says so. This release returns `503` with `write_credentials_not_released`; wait for a later release before using write credentials.
+- A Service credential for media conversion, as in [the media conversion example](/docs/media-conversion#an-example). Once write credentials are on, use that credential to get a write credential for each recording.
+- Write credentials turned on for your deployment. Your operator does that. While they're off, `carlos store credential` and its API return `503` with one of two codes. `write_credentials_not_configured` means your deployment hasn't turned them on. `write_credentials_not_released` means it has, but its release can't issue them yet. Until they're on, record with the store's own credential instead, as in [Until write credentials are on](#until-write-credentials-are-on).
+- CLI v0.43.8 or later for `carlos store credential`. An older CLI doesn't know the command and prints the `carlos store` usage instead.
What the platform needs from your app:
@@ -85,7 +86,7 @@ To stop someone chatting, your server calls `UpdateParticipant` on LiveKit's roo
## Recording into your store
-Your server starts an Egress, LiveKit's recorder, and points it at the app's store. LiveKit gets a write credential, not the store's own credential. It can only upload files under one folder you name, and only until it expires.
+Your server starts an Egress, LiveKit's recorder, and points it at the app's store. Once write credentials are on, LiveKit gets a write credential, not the store's own credential. It can only upload files under one folder you name, and only until it expires. Until then, see [Until write credentials are on](#until-write-credentials-are-on).
Ask the platform for a write credential just before each recording, with the Service credential:
@@ -213,10 +214,45 @@ info, err := egressClient().StartEgress(ctx, &livekit.StartEgressRequest{
LiveKit Cloud stops a track recording at 12 hours, so that credential asks for 13. The longest a write credential can last is 24 hours.
-LiveKit uploads the file when the recording stops. It also writes a small JSON manifest beside the file. Set `DisableManifest: true` on the output if you don't want it.
+LiveKit uploads the file when the recording stops. It also writes a small JSON manifest beside the file in your store, named `<egress_id>.json`, and the webhook's `manifest_location` points to it. Your app can ignore it or delete it. Set `DisableManifest: true` on the output if you don't want it.
Write credentials need AWS S3. If your app gets `CARLOS_STORE_ENDPOINT`, its store is on an S3-compatible server, and the platform can't issue one for it.
+### Until write credentials are on
+
+Until your deployment can issue write credentials, no `carlos` command gives you a credential to hand LiveKit. `carlos store status` shows only the store credential's key ID, and the secret is sealed in the app's config.
+
+Your app's server already has the store's own credential. The platform puts it in the app's environment as `CARLOS_STORE_ACCESS_KEY` and `CARLOS_STORE_SECRET_KEY`, beside `CARLOS_STORE_REGION` and `CARLOS_STORE_BUCKET`. If you made the store with `--env-prefix`, the names start with that prefix instead. Build LiveKit's `S3Upload` from them:
+
+```go
+import (
+ "errors"
+ "os"
+
+ "github.com/livekit/protocol/livekit"
+)
+
+// storeUpload gives LiveKit the store's own credential, from the app's
+// environment. Use it only until write credentials are on.
+func storeUpload() (*livekit.S3Upload, error) {
+ upload := &livekit.S3Upload{
+ AccessKey: os.Getenv("CARLOS_STORE_ACCESS_KEY"),
+ Secret: os.Getenv("CARLOS_STORE_SECRET_KEY"),
+ Region: os.Getenv("CARLOS_STORE_REGION"), // required: see Before you start
+ Bucket: os.Getenv("CARLOS_STORE_BUCKET"),
+ // No Tagging. The store's credential can't tag either.
+ }
+ if upload.AccessKey == "" || upload.Secret == "" || upload.Bucket == "" {
+ return nil, errors.New("this app has no store credential in its environment")
+ }
+ return upload, nil
+}
+```
+
+In `startRecording`, call `storeUpload()` in place of `recordingUpload`. The rest of this page stays the same.
+
+This gives LiveKit a credential for the whole store. It can read, list, replace and delete every file in it, not only the recording's folder, and it doesn't expire. Whether LiveKit may hold that is your app's decision. If you finish a rotation with `carlos store rotate --finish` while a recording runs, its upload fails. Once write credentials are on, switch to `recordingUpload`, and LiveKit holds only a write credential for one folder.
+
## When the recording is done
LiveKit POSTs events to the webhook URL you set in the LiveKit project, with `Content-Type: application/webhook+json`. Each one carries an `Authorization` token signed with the webhook's configured signing key. Configure the webhook to use the API key above, so the SDK can verify it for you. The one you need is `egress_ended`:
@@ -286,7 +322,7 @@ If LiveKit can't upload the recording to your store, the recording isn't in your
Without a backup copy, the webhook reports `EGRESS_FAILED`, and its error says the upload failed. With backup storage, it reports `EGRESS_COMPLETE` with `backup_storage_used` set instead.
-LiveKit Cloud can keep a copy of a recording whose upload failed in its own backup storage for 7 days. LiveKit turns this on for a project when you ask. When it happens, `manifest_location` in the webhook points to a manifest for retrieving it, and its file URLs are valid for 7 days. The recording is at LiveKit, not in your store.
+LiveKit Cloud can keep a copy of a recording whose upload failed in its own backup storage for 7 days. LiveKit turns this on for a project when you ask. When it happens, `manifest_location` in the webhook points to a manifest at LiveKit for retrieving it, not to one in your store, and its file URLs are valid for 7 days. The recording is at LiveKit, not in your store.
## Virus scanning
@@ -294,7 +330,7 @@ If your store has [virus scanning](/docs/cli#carlos-store-scan), a recording is
## Privacy: a third party in the media path
-With this setup, LiveKit Cloud carries every stream. The video, the audio and the chat pass through LiveKit's servers, and LiveKit records the stream before it reaches your store. LiveKit also holds a write credential while a recording runs. It can only upload files to that recording's folder, until it expires. It can't read, list or delete anything in your store.
+With this setup, LiveKit Cloud carries every stream. The video, the audio and the chat pass through LiveKit's servers, and LiveKit records the stream before it reaches your store. LiveKit also holds a write credential while a recording runs. It can only upload files to that recording's folder, until it expires. It can't read, list or delete anything in your store. Until write credentials are on, LiveKit holds the store's own credential instead, and that one can read, list and delete every file in your store.
The platform doesn't tell your users any of this. Whether and how to tell them is your app's decision. If you do, say it where people decide to stream or watch: near the start of your app's description, and on anything the stream produces, such as the recording's page.
diff --git a/docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit-2.md b/docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit-2.md
new file mode 100644
index 000000000..9d0c2873b
--- /dev/null
+++ b/docs/superpowers/notes/LUNA-DOCS-BRIEF-live-byo-livekit-2.md
@@ -0,0 +1,39 @@
+# Docs and copy pass: live streams on your own LiveKit, round 2 (fixes from the live test)
+
+You are the copy-review gate itself for this change. Paul delegated copy review of platform UI, CLI, email and docs copy to you on 2026-10-25; your verdicts ARE the review. Do NOT run the copy-review skill or start any server. Do not modify any file. You are writing a review report.
+
+## What changed
+
+A live test on dev on 2026-11-26 found four things the page got wrong or left out. Review only the sentences this branch changes or adds, which you can see with `git diff origin/main -- docs/site/`:
+
+- `docs/site/live-streams-bring-your-own-livekit.md`: the "Before you start" bullets on write credentials and the CLI version; the first paragraph of "Recording into your store"; the manifest paragraph; the new "Until write credentials are on" subsection with its Go sample; the `manifest_location` sentence in "When an upload fails"; the last sentence of the privacy section's first paragraph.
+- `docs/site/cli.md`: the last two paragraphs of `#### carlos store credential`.
+
+Everything else on the page was confirmed correct by the test and is out of scope: the file naming, `Filename` as the store key, instances reaching LiveKit with no egress setting, the region with no tags, conversion of LiveKit's MP4, the `StartEgress` samples and the webhook handler. Do not propose changes there.
+
+Readers are app builders on the platform who want a live stream with chat on their own LiveKit Cloud project, recorded into their app's store. Compare the voice with the rest of the page and with `docs/site/media-conversion.md`.
+
+## House rules (Paul's)
+
+- No em or en dashes used as dashes. Use a full stop and a new sentence.
+- Plain, direct, calm. No exclamation marks, no marketing tone, no "simply", no "please" padding, no filler.
+- Say what happened, then what to do. If the reader cannot fix it themselves, say who can.
+- Developer-facing, so technical words (Egress, webhook, manifest, credential, prefix) are fine where the reader needs them. Undefined jargon is not.
+- Neutral examples only (`shop`, `shop.example.com`, `recordings/a1b2/...`). Never a customer or tenant name.
+- Code samples stay in Go. Do not rewrite code unless a comment or string in it breaks a rule above or is wrong. The new sample compiles against `github.com/livekit/server-sdk-go/v2` v2.20.1 and `github.com/livekit/protocol` v1.54.1; any change to code must still compile.
+
+## Facts to check against
+
+These are established; flag any changed sentence that contradicts or overstates them.
+
+- The refusal codes are in `internal/console/apistorecredentials.go` (`wcCodeNotConfigured`, `wcCodeNotReleased`, `writeCredentialsGates`). Both answer `503`. The deployment switch (`CARLOS_STORE_WRITE_CREDENTIALS`) is checked first and answers `write_credentials_not_configured`; with the switch on, a phase 1 release answers `write_credentials_not_released`. Dev answers the first today. The v0.43.8 entry in `docs/site/changelog.json` says the same.
+- `carlos store credential` first shipped in v0.43.8: `git tag --contains 2cadcb43` starts at v0.43.8, and `store.go` at v0.43.8 dispatches `credential`. An older CLI prints the `carlos store` usage for an unknown sub-verb.
+- The app's store variables are `EnvNames` in `internal/objstore/objstore.go` with `DefaultEnvPrefix` `CARLOS_STORE`, and `carlos store create --env-prefix` (`store.go`) changes the prefix. `writeEnv` in `internal/objstore/walk.go` delivers the bucket and region as plain env and both key halves sealed, into the bundle the app's instances read. `carlos store status` prints the key ID, not the secret.
+- The store's own credential is a long-lived key under `storePolicyJSON` (`internal/objstore/aws.go`): it can get, put, delete and list every object in the bucket; it cannot tag. `carlos store rotate` leaves the old key live until `--finish` (`docs/site/cli.md`, the rotate paragraph), so finishing a rotation ends the key LiveKit was given.
+- LiveKit writes a manifest `<egress_id>.json` beside the file in the store on a normal completed recording, and `manifest_location` points to it; with backup storage used, it points to a manifest at LiveKit. The test saw the first on dev.
+- Under the media roadmap (`docs/superpowers/specs/2026-09-07-media-platform-roadmap-design.md` §8), the recipient of an egress is the app's decision, never the platform's. Handing LiveKit the whole store's credential is the app's decision too, and the page must say so without promising anything on the platform's behalf.
+
+## What to return
+
+1. A table `location | old | new | why`, with only the sentences you change, quoting the old text exactly so it can be applied verbatim. Rows you leave alone are approved as they are.
+2. A `## Flags` section with only what Paul must decide, or a fact you could not verify. Keep it short and give your recommendation for each. Write "none" if there are none.