# Session Creation Guide This guide walks through the current `/new` Session Wizard, including the default Cloudflare path and the opt-in decentralized/Lit variants. The default path no longer requires an OP Sepolia or Arweave publish step. Related docs: - [Cloudflare worker reference](session-cors-worker.md) - [Arweave payload shapes](arweave-payloads.md) - [SessionRegistry reference](session-registry.md) - [Sponsored resource keys](resource-keys.md) ## What a New Session Needs The first `/new` screen presents the two implemented setup paths as large cards with their required inputs. After a creator chooses one, the chosen profile appears in the setup title. Use **Back** beside the title to return to the setup cards without clearing the current draft, or use **Custom** to open the extra settings supported by that profile. The Centralized card summarizes its inputs as `Cloudflare account / OpenAI API Key` and explains that session settings and responses are stored in Cloudflare. The decentralized card explains that session data is stored on Arweave while session identity and question logic are recorded in Ethereum smart contracts; its pills list the OpenAI, Arweave, Ethereum RPC URL, and Ethereum Gas requirements. For the default `Centralized (Cloudflare)` preset, the user needs a Cloudflare account and one API key for the selected AI provider. The native path is a guided Cloudflare dashboard handoff: it does not ask for a Cloudflare API token, OAuth token, Context Engine deploy helper, or local agent, but it is not a browser OAuth callback or a one-click deployment. The app's passkey-derived EOA supplies the admin identity and signs the worker config, but it does not submit a transaction and needs no gas. Context Engine generates two independent setup values, `TOKEN_HMAC_SECRET` and `CE_STORAGE_ENVELOPE_KEK`, for Cloudflare's encrypted Worker-secret fields. They are secrets for the new Session Worker, not Cloudflare credentials, and stay in the current browser tab during setup. The AI key is written only to the worker's session-secrets store. The legacy deploy-helper and sponsored deploy-grant paths remain explicit fallbacks. Custom hosting settings survive save and reload, including encrypted-storage access rules. Changing the session network updates every SBT rule; check each contract address on the newly selected network. Switching to a different template replaces custom hosting settings, including optional HTTP agent access. Draft Group secrets are cleared when the wizard closes or the signed-in account changes. An owner-written Interview opening must contain a question before the session can be published. For private Cloudflare storage, participants can read their own submitted responses; admins and authorized agents can read session-wide responses when storage rules allow it. Participant aggregate summaries are not implemented. Unencrypted Arweave data is public, while Lit rules govern decryption of encrypted Arweave data. The export-policy selection is a saved preference; the current exporter follows existing access permissions and does not enforce that preference. Use this matrix when choosing a non-default profile: | Input | Why it is needed | Required? | Can a sponsored bundle cover it? | | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------- | | Passkey account | Supplies the admin identity and signs worker or on-chain actions | Yes; the default path creates it in the app | No | | Ethereum Gas (TX Fees) | Pays registry/SBT transactions; this is OP Sepolia ETH on the default chain | Decentralized or other on-chain profiles only | Partially | | Session Worker | Hosts the web runtime. For Cloudflare profiles it also owns canonical config, auth, AI, storage, fetch, and optional faucet routes. For decentralized profiles it assists the web runtime while the Ethereum registry and Arweave remain canonical. | Yes for every reachable `/new` profile | Yes, if the sponsor gives you a deploy-ready bundle | | Cloudflare API token | Powers the explicit legacy deploy-helper fallback | Explicit legacy fallback only; not the native default | Indirectly, through the separate legacy short-lived deploy-grant path | | AI provider key(s) | Powers AI generation, chat, and transcription routes for every provider selected by the session's models | One or more for every reachable `/new` profile | Yes | | Arweave JWK | Pays for Arweave metadata/payload uploads | Decentralized or explicitly Arweave-backed profiles only | Yes | | Ethereum RPC URL | Provides chain reads and writes | Decentralized, Lit/on-chain gating, or explicitly chain-backed profiles only | Yes | | Faucet private key | Lets the session sponsor small OP Sepolia ETH grants for onboarding/publish support | Optional | Yes | | Lit credentials for gated fields or Lit-encrypted payloads | Needed only when the session uses worker-mediated Lit/Chipotle encryption, `lit-arweave`, or Cloudflare `encryption: "lit"`. The manual `/new` setup asks only for one Lit API key; E2E/deploy env should prefer `LIT_USAGE_API_KEY`, while `litAccountApiKey` remains the internal worker-secret field backing the visible input. The worker derives `litUsageApiKey` plus `litApiBase` / `litGroupId` / `litPkpId` / `litActionCid` after deploy when needed. Cloudflare `encryption: "none"` and `encryption: "worker_envelope"` profiles do not require a Lit key. | Optional | Yes | Important: - The default worker-canonical path does not require an Arweave JWK, Lit key, user-supplied RPC URL/key, wallet connector, faucet key, publish funding, or transaction gas. - Hosted profiles with on-chain SBT rules can enable **Send participants test ETH for gas**. It starts off and requires every SBT rule to use the session network (OP Sepolia, or best-effort Base Sepolia). Enabling it shows the Faucet private key field and its derived address. Supply a valid key and fund that address with test ETH on the displayed network. The key is deployed and synced as a private Worker secret; turning the switch off excludes it from those writes. Removing the SBT rules or changing the backend or network turns the switch off. - This toggle uses the `faucet_self` participant grant. Use the updated deploy helper and Session Worker: older helpers reject the grant and older Workers ignore it, so they cannot issue unrestricted participant faucet tokens. Do not substitute `faucet` to bypass that compatibility check. - Hosted payouts send 0.0002 ETH when the recipient balance is at most 0.001 ETH, only to the signed-in wallet, up to three payouts in 24 hours. Refused requests do not consume a payout. The admin faucet test remains registry-only. - For participants, Settings shows **Tx gas** after the Worker confirms a faucet. The existing low-balance auto-funding preference applies to these hosted sessions even while Settings is closed. Chainless hosted sessions do not request funds or probe for a faucet in the background. - Selecting Lit keeps the existing Lit credential and chain/RPC requirements. Selecting the decentralized preset keeps the existing Arweave, registry, wallet-transaction, gas, and compatible Session Worker requirements. - Secrets live in the worker's secrets store or encrypted sponsored bundles, never in public Worker config or Arweave session metadata. ### Mode-aligned optional settings **Custom** reveals only settings supported by the selected profile: | Selected profile | Optional settings shown | | --- | --- | | Pure Cloudflare | Worker session end time, question defaults, Worker Group tag defaults, and Worker-backed privacy/results controls | | Cloudflare with explicit on-chain SBT access | The pure Cloudflare settings plus SBT curation and the on-chain Group Factory/network controls required by that access mode | | Decentralized | Block/time limits, Surveys, Group Factory and Session Registry contracts, and optional testnet faucet settings | Pure Cloudflare setup does not display or persist block numbers, registry contracts, Surveys contracts, faucet settings, or an Ethereum network. Choosing **Custom** does not override this capability boundary. The metadata **Optional details** area (**More options** in Custom settings) contains the settings that most sessions can leave at their defaults. **Session colors** is the final field group and starts collapsed there; expand it to choose a curated color scheme and see its preview. **Who can create groups?** is a dropdown in the same area, constrained to **All participants** or **Admins only** rather than accepting freeform config text. **Voice interview modes** defaults on. Its bordered panel shows the **Interview settings** details only while Voice interview modes is enabled; turning it off hides those controls while preserving their configured values for re-enable. The details expose the OpenAI **Interview voice model**, defaulting to `gpt-live-1`; `/new` publishes this as `interviewMode.realtimeModel` for both Worker-canonical and Arweave-backed sessions. It also lets owners supply an opening question, add an optional `interviewMode.steeringPrompt`, or use the default generated opening. Automatic regeneration and discovery of new questions during a call are off by default; when enabled their default addition threshold is 20%. Question suggestions are optional and off by default. Admin refresh is on by default. **Share AI draft changes for research by default** controls the initial review checkbox through `interviewMode.shareDraftChangesByDefault` (off when unset). Participants can change it before submitting, and their saved choices are retained. Generation waits for public questions and uses the session Worker's OpenAI key. See [Interview settings and lifecycle](session-listening-mode.md#interview). **Results AI views** default to manual generation. The shared session setting is `resultsAnalysis` with `generationMode` (`manual`, `automatic`, or `both`), view toggles for Circles, Breakdown, and Risk Matrix, `autoAfter: { threshold: 10, unit: "distinctParticipants" }`, `inputScope: "submitted"`, and `publication: "latest_success_visible"`. The threshold counts newly seen distinct submitted participants since the last successful run. Circles renders the DebateMap-style argument map and atlas. Risk Matrix axes are generated from the session subject matter rather than a fixed likelihood/impact template. Generation inherits the session's configured AI provider and model routing, including object-shaped `ai.models.thinking` entries; owners do not choose a separate generated-results model. Successful runs are immediately visible as the latest successful generated artifact. Viewer reads are available only when the session profile exposes `public_full_if_storage_public`, `aggregateResultsEnabled` is true, and the caller can pass all three existing Cloudflare storage read gates for `generatedArtifacts`, `questions`, and `responses`. The viewer endpoint returns a safe `jobState` with the artifact and frozen submitted snapshot; it does not return active reservations, retry receipts, failure internals, or wallet mappings. Failed or active runs keep showing the last successful artifact. Admin-only status and Generate/Refresh controls use the separate admin status and signed generate routes. Automatic background generation is supported only for Worker-canonical Cloudflare storage, where the Worker can count authoritative submitted participants and queue durable alarm work. Registry/Arweave and other non-canonical profiles can still use explicit admin manual generation from a sanitized same-session browser snapshot when local submitted responses are hydrated and unlocked. Unsupported profiles report a capability reason instead of silently spending provider calls or using seeded demo data. In `automatic`-only mode, an admin manual retry is still permitted after a failed automatic run so owners can recover without changing generation mode. The optional **Session end time** is a timestamp for Worker-canonical sessions. It must be in the future when the session is published. At that instant the Session Worker stops participant AI, transcription, fetch, upload, Group creation, and Group join work. Existing public or authorized Groups, stored payloads, and results remain readable, and signed admin recovery/configuration routes remain available. `Default Group Tags` seeds the tags in both participant and admin Worker Group creation. Existing Worker sessions that only carry `defaultSbtTags` use that value as a compatibility fallback; new pure Cloudflare sessions persist the generic `defaultGroupTags` field instead. ## Sponsored Bundles: Skip Manual Config If you do not want the recipient to paste worker secrets manually into `/new`, use `/sponsor`. High-level flow: 1. An existing session admin opens `/sponsor` 2. They choose which worker-backed resources to sponsor 3. The page uploads an encrypted bundle to Arweave 4. It returns an ID-only share URL shaped like `/new?sponsored=` and displays the decryption key separately 5. The recipient opens the URL, enters the separately delivered key, and the wizard applies the bundled config client-side 6. Decrypted credentials and the decryption key remain memory-only; a reload requires the key again unless the bundle is still available in the current page runtime What the sponsored bundle can supply to the recipient: - OpenAI / Anthropic / OpenRouter keys - Arweave JWK - custom RPC URL - faucet private key or faucet grant token - Lit authority-bundle mode: one disposable Lit API key per bundle, carried through `litAccountApiKey` internally, so `/new` can create a fresh group / PKP / usage key for each new session - scoped Lit runtime values when intentionally pre-provisioned: `litApiBase`, `litGroupId`, `litPkpId`, `litActionCid`, `litUsageApiKey` - bootstrap worker URL and deploy grant token for grant-backed worker deploys What it does not send directly: - The raw Cloudflare API token. `/sponsor` swaps that for a deploy grant token and keeps the raw token only in the sponsoring worker's server-side grant record until redeem or expiry. - The recipient's passkey identity. They need it for signed worker admin actions; only an on-chain profile also needs it to submit registration transactions. When a sponsored bundle is deploy-ready, the normal-mode wizard can skip the manual Worker step and go straight from Privacy to Deploy Session. A sponsoring Worker running 0.6.8 or later code deploys only the Worker release configured on it (its `WORKER_BUNDLE_URL` and `WORKER_BUNDLE_MANIFEST_URL`). The wizard still sends this build's configured release with a grant, never an uploaded file or a manual bundle URL, so sponsoring Workers running older code, which deploy the release a request names, keep working. If a 0.6.8 or later sponsoring Worker lacks either value, the wizard says the grant was not used and works once the sponsor sets both. An older sponsoring Worker with no release to deploy deploys nothing but keeps the grant reserved for that exact request: retry the same draft from the same site once the sponsor sets `WORKER_BUNDLE_URL` on that Worker. If the sponsor updates its Worker code instead, ask for a new grant; the updated code sees a different request and returns `409`. ### Temporary standard sponsored links fixture For short-lived demos or launches where the goal is "open the app and start now," the repo includes a deliberately simple tracked fixture: - `client/public/standard-sponsored-links.json` This file can hold up to ten intentionally public sponsored `/new` URLs. The URLs contain only opaque bundle ids and are not redeemable without keys delivered through a separate channel. The checked-in version keeps every slot inactive and empty. Operators may paste disposable sponsored URLs into the file, set selected entries to `"active": true`, and publish the JSON through the app's static assets or a GitHub-hosted raw file. Create those URLs through `/sponsor`, and back them only with low-budget, revocable resources. This is not a durable availability system. A link is "unused" only because the operator has left it active in the manifest; the fixture does not mark links used after a click. Never add decryption keys to fixture URLs or fields. Treat each URL plus its separately delivered key as a bearer grant and remove the URL once it is consumed, expired, or reported broken. The fixture does not enforce spend limits, so cap AI/provider keys, faucet wallets, Arweave wallets, and any Lit usage keys or disposable Lit bundle accounts outside the manifest. See [`docs/standard-sponsored-links-fixture.md`](standard-sponsored-links-fixture.md) for the exact manifest contract. Long term, this should be replaced by a worker-backed claim flow that returns one currently available setup link without publishing the full pool. ## Prerequisites ### 1. Cloudflare account The session worker is the canonical config, auth, AI, and payload-storage host for the default preset. A free Cloudflare account is enough for small sessions. Create or sign in to a Cloudflare account at . The native deploy button opens Cloudflare's deployment flow for the isolated package in `deploy/cloudflare/session-worker/`. Cloudflare provisions the Worker, KV namespace, and Durable Object in that account. Paste the slug, public admin address, and the generated Worker runtime secrets shown by the wizard (two normally; three when Agent HTTP is selected); then deploy and paste the resulting `workers.dev` URL back into the wizard. The deploy URL must pin an exact 40-character commit so the reviewed source is immutable. The hosted client uses the public commit it was built from (`REACT_APP_CE_CLOUDFLARE_NATIVE_DEPLOY_REPLAY_COMMIT`, set from Netlify's `COMMIT_REF`), the same commit whose release the wizard downloads Worker bundles from. Builds without it, such as local and self-hosted builds, use the release pinned in `client/src/variables/workerReleasePin.json`. Each release moves that pin to the newest published Worker release, which is the previous release because a release's own bundles are published after its merge. The private source commit is not interchangeable with its public replay SHA. Moving branches, tags, abbreviated hashes, and non-GitHub sources are rejected. The token-based helper procedure later in this guide applies only to the legacy fallback. See [API token setup and handling](session-cors-worker.md#api-token-setup-and-handling) for its account selection, one-attempt handling, expiration, and revocation requirements. The Worker setup section also separates daily request budgets for signed-in and anonymous users. `Authenticated requests per wallet per day` controls signed Worker credentials. `Anonymous requests per IP per day` controls anonymous public reads plus enabled AI, transcription, and realtime routes for everyone sharing the same public IP address, such as shared Wi-Fi. New sessions default the anonymous IP field to `0`, which disables this Worker-level shared-IP daily cap while leaving provider limits and access policy in force. Imported older configs that omit the field leave it blank so the Worker can keep its legacy fallback to the authenticated wallet budget. ### 2. AI provider keys Provide a key for every provider used by the selected fast, thinking, and transcription models. The default model choices use only OpenAI and therefore require one OpenAI key. Mixed assignments require every distinct provider key; for example, Anthropic text models with OpenAI transcription require both Anthropic and OpenAI keys. Each key is AES-GCM encrypted in the per-session Worker KV secrets envelope under a Worker-only KEK; it is never stored in the public session config returned to browsers. This protects KV contents at rest, but the session Worker and Cloudflare runtime can decrypt it. ### 3. A signing identity The default client build is passkey-only and uses the Context Engine passkey EOA to sign Worker SIWE-style messages. Chain-backed profiles use the same account for OP Sepolia transactions. In the legacy deploy-helper fallback, the **Admin address** control says **Click to login** while signed out and opens the existing login modal when activated. After sign-in, the connected wallet address is filled into the deploy form automatically. - Context Engine passkey EOA wallet Deployments built with `REACT_APP_CE_ENABLE_METAMASK_CONNECTOR=true` can also use MetaMask. The separate WalletConnect fallback remains opt-in; see `docs/public-client-config.md`. The same identity is used for: - Cloudflare worker admin signatures during setup - Session registration transactions in decentralized profiles - Optional SBT deployment transactions ### Advanced only: Arweave wallet (JWK) The default Cloudflare preset does not use Arweave. You need a JWK only after choosing the decentralized preset or explicitly switching storage/publish behavior to Arweave. Generate a wallet: - Web wallet: [arweave.app](https://arweave.app) and download the keyfile JSON (JWK) - Wallet guide: [Arweave.app Web Wallet](https://docs.arweave.org/developers/wallets/arweave-wallet) - CLI option: `npx arweave key-create arweave-keyfile.json` Fund the wallet with AR: - Send AR directly to the wallet address from an exchange or another wallet - Or use ArDrive/Turbo if you want a fiat-friendly path into Arweave uploads: [Fund Your Wallet](https://help.ardrive.io/hc/en-us/articles/5258520347419-Fund-Your-Wallet) and [Turbo overview](https://docs.ardrive.io/docs/turbo/what-is-turbo.html) Operational notes: - Treat the JWK like a private key. Anyone with the file controls the wallet. - Keep a backup offline. - In Context Engine, the JWK belongs in worker secrets, not in public metadata. ### Advanced only: OP Sepolia ETH The default worker-canonical publish uses no transaction and needs no gas. You need OP Sepolia ETH only when the selected profile registers the session on-chain or deploys an SBT during publish. Useful links: - Optimism faucet directory: - Superchain faucet: - QuickNode faucet: - Explorer: Registration cost notes: - `SessionRegistry.createSession(...)` currently requires a `0.0001 ETH` creation fee on top of gas - `setSessionFields(...)` and `setResourceGates(...)` are separate follow-up transactions in the current flow ## Session Creation Walkthrough Open `/new`. The app canonicalizes that route to `/session/new`, but `/new` is the intended entry point. The first screen is the session-mode choice. A blank draft has nothing preselected. If this browser already has an explicit saved profile, the header offers `Resume existing setup` instead of silently discarding or replacing it. Choosing a new preset immediately opens the four-stage setup with fields prefilled from the chosen mode; there is no separate Continue action for a new selection: - `Centralized (Cloudflare)` compiles to a Cloudflare-backed, worker-canonical session shape with Cloudflare-internal worker encryption (`worker_envelope`) enabled by default. After selection, the requirements banner lists exactly a Cloudflare account and one `OpenAI API Key`. It does not ask for Arweave, Lit, RPC, funding, faucet, or gas inputs. - `Decentralized (Ethereum + Arweave)` compiles to the Arweave + Ethereum smart-contract session shape. Its requirements banner lists a compatible Session Worker for the web runtime, the Arweave wallet/JWK, Ethereum RPC URL, Ethereum gas for transaction fees, an `OpenAI API Key`, and an optional Lit key needed when encryption is enabled. The Worker assists the browser runtime; the Ethereum registry and Arweave remain the canonical authority and metadata store. The validated version-1 profile, rather than legacy top-level fields, determines which capabilities are reachable: | Reachable `/new` profile | Canonical authority and storage | Identity and Groups | Chain-dependent capabilities | | ------------------------------------------ | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | Centralized default | Session Worker + Cloudflare; `worker_envelope` | Passkey + **Native Worker Groups** | None; `evm.registryChainId` is `null` | | Custom Cloudflare, no encryption | Session Worker + Cloudflare; `encryption: "none"` | Passkey + **Native Worker Groups** | None; `evm.registryChainId` is `null` | | Custom Cloudflare, Worker envelope | Session Worker + Cloudflare; `encryption: "worker_envelope"` | Passkey + **Native Worker Groups** | None unless an explicit `sbt_onchain` condition is added | | Custom Cloudflare + explicit `sbt_onchain` | Session Worker + Cloudflare; Worker envelope | Passkey + **Native Worker Groups**; SBT conditions are separate **Advanced on-chain access gates** | Positive chain ID and RPC; wallet/gas only when `/new` must create an SBT | | Custom Cloudflare + Lit | Session Worker + Cloudflare; `encryption: "lit"` | Passkey + **Native Worker Groups** | Positive chain ID, RPC, and Lit credential; this does not make the registry canonical | | Decentralized or custom Arweave | Ethereum registry + Arweave; Session Worker-assisted web runtime; `encryption: "none"` or `"lit"` | Wallet with passkey support + on-chain SBT Groups | Compatible Session Worker, chain/RPC, registry transactions, gas, and Arweave; Lit also needs its credential | Agent Session Wrapped, result-visibility, and export choices do not change that ownership split. Profiles marked schema-only or unavailable, and malformed or cross-lineage profiles, do not receive partial capabilities: publication and downstream projection fail closed. A stored config with no version-1 profile may use the bounded legacy registry compatibility path only when its registry identity and positive chain are present; legacy chain fields never turn a validated chain-free Worker profile into a hybrid. After selection, the profile remains visible in the setup title. **Back** returns to the setup cards while preserving the draft, and **Custom** opens Privacy instead of opening a separate technical popover. When Custom is active, **Back to templates** returns to the guided setup while keeping the current custom settings in the draft. Profile settings follow the existing stages: - Privacy owns storage, encryption, decryption access, result visibility, and small-group protection. Switching from Arweave to Cloudflare installs an explicit role gate; switching back removes Cloudflare-only access fields. Admin-only and public-redacted result modes remain visible as unavailable until their complete read paths are enforced. - Worker offers the website and **Agents (HTTP API)** (Agent Session Wrapped). Each channel has a question-mark tooltip explaining its purpose. The website remains enabled. Agent access is off by default and uses the same Session Worker. The **Agent API access** status distinguishes **Off** from **On after deployment**: authorized agents can use the HTTP API once the service is deployed and verified, subject to session access rules. Removed bot and Mini App adapters have no setup controls. - **Require users to pay for usage** appears only in the custom Worker settings for decentralized (Ethereum registry + Arweave) sessions. Centralized Cloudflare sessions, including those using Lit, do not show this option. The choice applies only where the option shows: in normal mode and for other profiles, Worker secrets stay on, and the saved choice applies again when you return to the custom settings of a decentralized session. - Deploy owns the export policy. Selected-channel export remains visible as unavailable until the export runtime consumes that filter. Changing one of these values flips the profile to `custom`. Profile-based drafts do not also show the older `Session Storage` metadata editor, so storage has one visible authority. New session publishes write the `sessionModeProfile` profile as the source of truth and compile it down to the existing storage profile / payload-access fields for runtime compatibility. The publish boundary sends one canonical object-valued `storageProfile`; its backend, payload gate, encryption mode, and effective access-condition document must agree with the validated profile. Deploy, signed config mutation, and public Worker readback all fail closed on missing, ambiguous, or divergent profile/storage policy. Switching storage also replaces the mode-specific identity and authorization lineage: Cloudflare uses passkey plus Worker roles, while Arweave uses wallet plus on-chain SBT authorization. A stale wallet, Worker role, or legacy top-level chain ID cannot survive that switch as a hidden capability. The wizard validates that profile at the publish boundary and rechecks the live draft after asynchronous identity and duplicate-session preflight. A profile edit made while preflight is running therefore still stops before upload, worker, or registry side effects. Invalid settings are also shown in the stage where they are edited. Mode values are exact enums at every write boundary: explicit blanks, friendly aliases, unknown values, and reserved key providers are rejected rather than normalized to a less-protective default. Legacy aliases remain readable only for stored compatibility. Legacy `telegramOnly` fields are read only as a migration fallback when no explicit profile exists; they migrate to hosted HTTP access. An explicit `surfaces.agentHttp: false` remains authoritative even if stale legacy flags remain. Enabling Agent HTTP adds token login alongside ordinary wallet/passkey web participation; it does not replace the web session page. New client writes keep the reserved `surfaces.telegram` and `surfaces.miniApp` booleans false. The normal-mode wizard is effectively four stages: 1. Session Details 2. Privacy & Access 3. Worker 4. Deploy Session The step rail keeps equal-sized tiles: inactive stages show only their step number, and the selected stage shows its title. ### 1. Naming and session details Enter the core session metadata: - `sessionName` - `sessionInfo` - `sessionContext` for optional public background shown on the session page as plain text and HTTPS links; it is not executable HTML and must not contain secrets. - **Optional details** (**More options** in Custom settings) → **Session colors** → **Color scheme**. Session colors is the final optional field group and is collapsed by default. Expand it to choose `Context Engine`, `Ocean`, or `Amber`; the compact preview updates immediately. This controls only documented session accents/chrome and does not change the app theme. - slug Start with a lowercase letter or number, then use only lowercase letters, numbers, `_`, or `-`, up to 128 characters. Participant links open only slugs in this form. Slugs whose link opens a different session are reserved: `general` (the default session), `debate` (the session Worker opens `rxc` instead), `constructor` and `prototype`. - session ID - network/contract defaults for chain-backed profiles - `blockLimits.start` for chain-scanned profiles - optional session header image URL; Arweave-backed sessions can also upload the image file with their metadata AI configuration also lives in the session metadata draft: - `ai.models.fast` - `ai.models.thinking` - `ai.models.transcription` - `interviewMode.realtimeModel` (OpenAI interview voice; defaults to `gpt-live-1`) - `interviewMode.steeringPrompt` (optional owner-authored interview guidance; defaults to empty and is capped at 3000 characters) What gets stored where: - For `worker_canonical`, the session worker stores the sanitized canonical identity, text metadata, AI model choices, authority policy, and storage profile in Worker KV. This includes exactly one public `appearance.colorSchemeId`, never palette values. Publish verifies a read-after-write of that config before showing the session URL. - Decentralized and explicit Arweave-backed profiles keep storing the human-readable session config on Arweave: name, description, AI defaults, block limits, contract pointers, featured lists, the same `appearance.colorSchemeId`, and any Lit-encrypted fields. The EVM registry stores only the metadata pointer; it does not duplicate the scheme ID. - The Centralized preset combines `storageProfile.backend = "cloudflare"` with `worker_envelope` encryption and Worker-role/agent-grant access. Advanced Cloudflare profiles can add an explicit `sbt_onchain` access condition, which makes the profile hybrid and requires its configured chain/RPC before the Worker serves bytes. That is a separately labelled Advanced on-chain gate; it does not replace the session's Worker-native Groups and is not end-to-end encryption. - The **Data storage** controls include separate help tooltips. Arweave is permanent storage and can receive payloads encrypted before upload. Cloudflare storage is mutable and not permanent; a future attestation layer could make stored revisions verifiable, but would not make the underlying storage permanent. - Each **Session encryption** option has its own help tooltip. Advanced options are `none` (payload bytes are stored as provided), `lit` (data is encrypted before upload and a Lit Action releases its key after an on-chain SBT check; the key passes through the session worker, so the Worker operator and Lit account administrators remain trusted; scoped usage keys alone cannot authorize decryption, and it is not end-to-end), and Cloudflare `worker_envelope`: data is encrypted before Cloudflare stores it, and the session worker decrypts only after checking access. `lit` requires a registry network, RPC connection, and Lit credentials. `worker_envelope` is available only with Cloudflare storage. The operator and Cloudflare runtime can decrypt; it is not decentralized, not end-to-end, and not private from the session operator or Cloudflare runtime. - Public stored-results visibility requires unencrypted storage. The current wizard offers it only for Arweave + no encryption; switching backend or encryption coerces an incompatible selection back to participant aggregate. Validated legacy Cloudflare public-result profiles remain readable only when their payload gate is `none` and neither profile policy branch carries access conditions. - When `/new` deploys a custom worker for Cloudflare storage, the deploy helper receives the normalized storage profile before Worker upload so it can bind the storage index KV and any requested R2 bucket. If `worker_envelope` is selected, the helper also generates the worker secret used as the deployment KEK; the generated value is not written to session metadata. - Worker-envelope key provider is fixed to `worker_secret` in this release. In a nonpublic Worker-canonical session, the normal participant storage scope permits submitting and reloading their own responses. Reading another participant's individual response additionally requires a current session admin or an authenticated delegated storage grant; ordinary `storage: true` is not that grant. Existing item access conditions still apply. Aggregate-only visibility does not permit downloading everyone's raw answers to calculate a summary in the browser; combined summaries require an authorized server-generated aggregate. An explicit override can combine Session role (`worker_role`), SBT holders (`sbt_onchain`), or Authorized agents (`agent_grant_scope`) rules with any/all matching; the wizard writes those conditions to `storageProfile.payloadAccessControl.accessConditions` for the worker. - `SessionRegistry` does not store long-form content directly. Decentralized profiles store a metadata URI pointer plus minimal session identity fields; the default worker-canonical profile skips registry writes entirely. Important: - `blockLimits.start` is required for chain-scanned profiles. The default worker-canonical profile does not require a chain scan window. After its canonical worker config is verified, reloads keep that session out of EVM discovery even when the original share URL has been normalized. - Chainless worker-canonical profiles do not request testnet faucet funds. - The wizard strips secrets and worker-only runtime config out of the Arweave payload before upload. - Draft recovery keeps only the stable color-scheme ID. Sponsored setup changes Worker resources without resetting the selected scheme. Missing or invalid IDs use `context-engine`; viewing an older session does not rewrite it. ### 2. Privacy and access control Use the privacy section to decide who can decrypt locked metadata fields and who can access sponsored resources. The default worker-canonical preset uses worker roles/groups and the persisted version-1 `workerAuthority` policy. It does not require an SBT, registry, RPC, or Lit key. Participant and anonymous scopes, plus any login gate, are evaluated by the session worker. Before publishing a worker-canonical session, the **Session Access** section can queue Groups through the same form used by normal Worker Group creation. Queued Group drafts collapse independently while preserving their edits. Each draft supports a name, description, image URL or local image file, tags, public HTTPS reference URLs, member limit, self-join deadline, group-admin address, join mode, and member visibility. Durable text and URL metadata stays in the recoverable browser wizard state. A selected local image file stays only in the current tab; after the canonical Worker origin, slug, and session ID are verified, publish uploads it through the selected session storage and writes the resulting public URL back into the draft before creating the Group. Publish then creates queued Groups with stable IDs and merges the session's default Group tags with each draft's tags. If creation is interrupted, retrying reuses an identical already-created ID and continues instead of duplicating it. A conflicting record, failed image upload, or other Worker error leaves the wizard recoverable and reports the failure instead of marking the session complete. After publishing, the session's Groups section manages those native Cloudflare records and adds the full editing surface. The worker admin supplies the group name, optional description and HTTPS image, tags, public HTTPS reference URLs, an optional per-group member limit, an optional self-join deadline, group-admin address, join mode, and visibility. The deadline closes participant self-join; configured session admins can still manage membership. Image input supports a direct HTTPS URL, clipboard paste, or local upload with preview; uploaded files are published through the selected session storage before the group record is created. Public, ungated sessions can render stored group artwork before sign-in, while private-session storage reads keep using the authenticated session credential. No SBT contract is deployed, so there is no contract address, network transaction, gas payment, RPC setting, or burn authorization. The client pins the validated Worker origin, canonical slug, and canonical session ID. Worker-canonical nonce/login requests, login responses, JWTs, Group requests, Group responses, stored records, and the Durable Object coordinator all carry or verify that same slug/session-ID pair. A failed, unreachable, mismatched, stale, or empty Worker response never falls back to a generic Worker cache, SBT discovery, or a global session scan. A Worker/SBT hybrid still uses native Worker Groups for participation. Its configured SBT conditions appear separately as **Advanced on-chain access gates**, with chain/RPC requirements but no implied registry ownership. A Worker/Lit hybrid likewise remains Worker-canonical while exposing only its explicit Lit/RPC requirements. Registry-canonical sessions continue to use the on-chain SBT group flow below. The **Who can create groups?** dropdown is available under **More options** for every `/new` mode and is persisted as `groupCreationPolicy`: - **All participants** is the new-session default. In Worker-native sessions, an authenticated participant with the `groups` scope can join or create an open, session-visible group without a wallet transaction. Participants can supply the same tags, reference URLs, member limit, and join deadline as an admin; the Worker generates the ID and records the signed participant address as the group administrator instead of trusting a submitted address. Session admins retain edit, delete, and membership controls. In registry-canonical sessions, the session's SBT creation UI remains available to participants. - **Admins only** hides and rejects the session-bound creation path for other participants. Existing Worker configs that omit the field retain this fail-closed default. For on-chain sessions this is a Context Engine UX policy, not a factory-level access control: the deployed public SBT factory can still be called independently outside the session UI. Group discovery is a separate privacy decision. A valid Worker-canonical mode with public stored results, unencrypted Cloudflare storage, and no payload access gate exposes only redacted, session-visible group metadata before sign-in. Participant-, member-, or admin-visible results modes and any gated or encrypted storage mode keep group discovery and results behind authentication, regardless of who may create groups. Ordinary pure-Worker session pages project that same chain-free contract downstream. Account settings do not offer Ethereum, MetaMask, or testnet controls; the session shell and Polis report do not show a network/blockchain; Lit hooks, SBT auto-mint, and SBT question filters do not run; and the Document Library accepts only Cloudflare references without exposing Arweave/Lit controls. If navigation or live config changes from a chain-backed profile to a pure Worker profile, stale auto-mint timers, stored targets, filter state, network values, and non-Cloudflare document references are cleared or ignored before the next operation. Advanced chain-backed profiles retain the existing controls: - One or more SBT gates - Gate mode: `Any` or `All` - Default gate for the session - Optional per-resource overrides (`ai`, `arweave`, `rpc`, `txGas`, `lit`, and other resource keys) - Optional inline SBT creation if the required SBT does not exist yet For those advanced profiles: - If you created new SBT drafts in the wizard, publish can deploy them first through `SBTFactory.createSBT(...)` or its deterministic variant - The final gate definitions are written on-chain through `SessionRegistry.setResourceGates(...)` - Lit-encrypted metadata keeps references to the selected gate IDs, but gate authority itself remains on-chain in `SessionRegistry` The standalone Create SBT (`/sbts/new`) and global Smart Contracts references in Docs remain optional on-chain tools. Opening them from a Worker-native session does not add them to that session's native Groups authority. ### 3. Worker deploy and secrets Every reachable hosting profile uses a Session Worker for the web runtime. The default wizard guides the creator through deploying a new Worker or, for an eligible decentralized profile, attaching an existing compatible Worker before publication. Registry and Arweave remain canonical for decentralized sessions. In the default native handoff you provide: - a Cloudflare account and dashboard deployment - one OpenAI / Anthropic / OpenRouter key matching the selected AI models The wizard generates the session slug, passkey-derived public admin address, and independent Worker runtime secrets: two normally, plus a third agent signing secret when Agent HTTP is selected. It provides a copy control for each value, opens Cloudflare in a separate tab, and waits for the creator to return with the resulting `workers.dev` URL. Advanced profiles may additionally expose Arweave, Lit, RPC, faucet, or custom-provider inputs when their selected capabilities actually require them. Common combinations: - Default Centralized session: - Cloudflare account - one OpenAI API key for the default text and transcription models - Worker/SBT hybrid: - Cloudflare account, AI provider key, and RPC - wallet and gas only when the wizard must create a new SBT - Worker/Lit hybrid: - Cloudflare account, AI provider key, RPC, and Lit credential - Decentralized session: - compatible Session Worker, Arweave JWK, RPC, wallet/registry transaction funding, AI provider key, and Lit credential only when Lit encryption is selected - Session created from a sponsored bundle: - the profile's signing identity: passkey for a pure Worker session, or wallet plus passkey support for a registry session - session details - no manual worker-secret entry, as long as the bundle is deploy-ready What happens during deploy: - The deploy-helper calls Cloudflare’s Workers API - For every first-party publish, it creates an isolated physical worker name by deriving a deterministic suffix from the publish generation's stable `deploymentRequestId`. A retry after a lost or gateway-shaped response reuses that ID and resumes or replays the same physical deployment instead of allocating another worker. Starting an explicit new generation produces a new deterministic identity; only legacy requests without an ID receive a random suffix. - It fetches the account `workers.dev` subdomain and creates/changes it only when explicitly needed - It returns the final worker URL - The wizard auto-fills `corsWorkerUrl` - The wizard signs the config with the selected profile's session admin account or wallet and persists it. Worker-canonical profiles must also verify public `/session-config` readback. Decentralized profiles instead require the signed `/admin/set-config` write to confirm acceptance; they do not turn the Worker into discovery authority. An initialized registry-canonical Worker cannot be reassigned to another session ID. - A custom Worker is publish-ready only while that verified deployment still matches the selected Worker identity, the complete canonical session-mode profile, each effective AI provider/model assignment, and every required secret value. Changing any of them requires a new deploy/sync verification. Sponsored auto-deploy writes this verified tuple to the live publish runtime before its promise resolves, so the same publish attempt can consume it without depending on a React render. This proof is kept in memory only: secret values and secret verifiers are not written to the wizard cache. After a reload, the wizard may retain the safe public Lit runtime descriptor, but it must replay deployment/synchronization checks before a custom Worker becomes publish-ready again. The shared default Worker and a deploy-ready sponsored flow keep their separate readiness paths. - Worker config persistence captures one immutable draft/identity/secrets snapshot. After the signed write and the profile-appropriate verification (public canonical readback or decentralized signed-write acceptance), the wizard compares the live publish inputs and rebuilt config with that exact snapshot, then repeats that comparison immediately before writing settlement markers or clearing the cache. Any edit made before settlement stops the flow and leaves the draft intact for an explicit retry; an unchanged publish settles and clears only the captured verified session identity. - For Lit profiles, an account key authorizes bootstrap but is not runtime readiness evidence. Publish stays blocked until the Worker has a usage key and the complete Lit runtime descriptor, and failed post-deploy synchronization retains enough local bootstrap authority for an exact retry. - Cleanup deletes a failed deployment only when the deploy helper can prove the script still carries that deployment's ownership marker. It preserves pre-existing or ownership-ambiguous scripts and reports any orphaned resource. - If a remote bundle is definitively rejected after stable resources were staged, the manual-file fallback reuses the same deployment request, Worker, and KV namespace. Only corrected bundle bytes may change; all non-bundle deployment fields stay bound, existing secret bindings are preserved, and the request remains recoverable until its terminal receipt is durable. - The requested Worker name is always a readable prefix rather than an exact physical script name. The suffix is derived before existence checks or mutable Cloudflare operations: first-party callers with different request generations receive different deterministic names, while legacy callers without `deploymentRequestId` receive random names. The helper still verifies its ownership marker after upload and stops before hostname/secret activation if ownership does not match. When Agent Session Wrapped is selected, the same Session Worker serves it. The helper creates an independent fresh managed root secret; native setup adds `AGENT_MANAGED_ROOT_SECRET` in Cloudflare. Setup verifies same-origin capability readiness after saving canonical configuration. Admin enable/disable uses signed session configuration without a deployment token. Worker-canonical and registry sessions use their existing login/membership gates. An unlocked workerless registry session must attach a compatible Worker; a permanently locked one cannot. Wrapped member credentials are capped by 24 hours and source-JWT expiry, with source revocation and membership checked on every request. Predictions use HTTPS/KV and remain separate from ordinary responses. No Bridge resources, identities or invites are transferred. What gets stored where: | Store | Contents | | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | Worker KV `session:{slug}:config` | canonical worker session identity/content plus public authority, storage, CORS, limits, and `appearance.colorSchemeId`; no credentials | | Worker KV `session:{slug}:secrets` | OpenAI/Anthropic/OpenRouter keys, Arweave JWK, faucet private key, and other runtime secrets | | Arweave metadata | decentralized/Arweave profiles only; includes `appearance.colorSchemeId`, never palettes or worker secrets | | `SessionRegistry` | decentralized/registry profiles only; skipped by `worker_canonical` | ### 4. Registration and publish When you click `Publish` with the default worker-canonical profile, the flow is: 1. Deploy the per-session worker if it is not already ready 2. Persist the sanitized, admin-signed canonical config to the session worker 3. Read it back and verify its identity, revision, authority, and worker URL 4. Surface reload-safe session and admin URLs containing the public HTTPS `worker` query parameter There is no `uploadMetadata`, `registerSessionOnChain`, registry cache refresh, or gas-funded transaction on this path. Decentralized and explicit Arweave/registry profiles keep the existing upload and registration sequence: The on-chain registration sequence is: 1. `SessionRegistry.createSession(slug, sessionId, chainId, metadataURI, encryptedMetadataURI)` 2. `SessionRegistry.setSessionFields(...)` 3. `SessionRegistry.setResourceGates(...)` What each write does: - `createSession(...)` - stores the slug, session ID, chain ID, metadata URI, encrypted metadata URI, admin address, and timestamps - `setSessionFields(...)` - stores lightweight string fields such as `corsWorkerUrl` and the sponsored capability flags - `setResourceGates(...)` - stores the authoritative SBT gate config per resource After success, the wizard generates: - worker-canonical session URL: `/session/?worker=https%3A%2F%2F` - worker-canonical admin URL: `/admin?sessionId=&sessionSlug=&worker=https%3A%2F%2F` - decentralized session URL: `/session/` - decentralized admin URL: `/admin?sessionId=&chainId=11155420` ## Worker Deployment Options ### Native Cloudflare dashboard handoff (default) This is the default path exposed in `/new`. High-level flow: 1. Generate setup values for a new Worker, or paste an existing compatible Worker URL when the selected decentralized profile is eligible for direct attachment. 2. Copy the session slug, public admin address, `TOKEN_HMAC_SECRET`, and `CE_STORAGE_ENVELOPE_KEK` with the adjacent copy controls. 3. Open the immutable Cloudflare deployment package, paste those values into Cloudflare, and complete the dashboard deployment. 4. Return to the still-open Context Engine tab and paste the resulting `workers.dev` URL. 5. Select `Verify Session Worker`. Context Engine checks Worker reachability, a non-empty CORS allowlist containing the current browser origin, and the exact session identity. CORS entries must be exact origins; wildcards are rejected. Registry-backed attachment also writes the selected public RPC URL/map and retries private secret delivery while the accepted config becomes visible. Worker-canonical profiles require public canonical-config readback; decentralized profiles require signed config acceptance while their EVM registry and Arweave records remain canonical. Registry attachment requires the connected signer, requested Worker admin, and on-chain session admin to match. The template deploys with `DEPLOY_HELPER_ENABLED` set to `"0"`, so when you generated setup values for this session slug and admin, the wizard records that the Worker you verify has no embedded deploy helper and `/sponsor` does not offer deploy grants from it. The wizard remembers that you generated them, but not the values, across step changes and reloads of this tab. An attached existing Worker without generated setup values keeps the draft's embedded deploy-helper setting, because no route reports the binding. The runtime secrets remain in the current tab and Cloudflare's encrypted Worker-secret store. They are not placed in the deployment URL, logs, analytics payloads, or a Context Engine-controlled origin. There is no automatic callback from Cloudflare, so keep the wizard tab open and return to it manually. The native return step supports the default Worker-envelope mode, eligible decentralized attachment, and optional on-chain SBT checks. Advanced Lit profiles use the labeled manual bootstrap fallback for their Lit action. Agent HTTP and Session Wrapped use the native Session Worker after the additional managed root secret is configured. Reference: [session-cors-worker.md](session-cors-worker.md) ### Legacy CE-hosted deploy-helper fallback The collapsed Advanced/fallback section retains the request-only Cloudflare API token flow for existing operators. It can create the Worker, discover its URL, and seed config automatically, but it requires trusting the helper with the request-only token. It is not required by the default Cloudflare path. ### Sponsored `/sponsor` handoff Use this when one session admin wants to help someone else launch a session without manually sharing raw worker secrets. Best fit: - onboarding a collaborator who should not have to paste OpenAI / Arweave / faucet credentials by hand - shortening the guided `/new` handoff for internal pilots - preloading a worker deploy grant so the recipient does not need to enter a raw Cloudflare API token What the recipient still needs: - the signing identity required by the selected profile (passkey for a pure Worker session; wallet plus passkey support for a registry session) - session name / slug / metadata choices - enough publish authorization to complete the flow Deep reference: see the `Sponsored bundle flow` section in [session-cors-worker.md](session-cors-worker.md). ### Self-hosted with Wrangler Use this when you want to own the Cloudflare project directly and deploy the worker outside the helper flow. Repo path: - `workers/sessionCorsWorker/` Minimal setup: 1. Install the worker dependencies: ```bash cd workers/sessionCorsWorker npm install ``` 2. Create a `wrangler.toml` in that folder. The repo does not currently ship one for this worker, so create your own minimal config: ```toml name = "my-session-worker" main = "worker.js" compatibility_date = "2025-01-01" compatibility_flags = ["nodejs_compat", "global_fetch_strictly_public"] [[kv_namespaces]] binding = "GROUP_KV" id = "" [durable_objects] bindings = [ { name = "CE_SESSION_COORDINATOR", class_name = "SessionWriteCoordinator" }, ] [[migrations]] tag = "ce-session-write-coordinator-v1" new_sqlite_classes = ["SessionWriteCoordinator"] [vars] DEFAULT_SESSION_SLUG = "" BOOTSTRAP_ADMIN_ADDRESS = "" DEPLOY_HELPER_ENABLED = "false" ``` 3. Add the two required secrets. Use independent, high-entropy values and do not commit them to `wrangler.toml`: ```bash npx wrangler secret put TOKEN_HMAC_SECRET npx wrangler secret put CE_STORAGE_ENVELOPE_KEK ``` 4. Deploy: ```bash npx wrangler deploy ``` Operational notes: - `GROUP_KV` is required - `CE_SESSION_COORDINATOR` and the `ce-session-write-coordinator-v1` SQLite migration are required; signed config writes fail closed without them - `TOKEN_HMAC_SECRET` and `CE_STORAGE_ENVELOPE_KEK` are separate required Worker secrets - A new `/new` session must bind `BOOTSTRAP_ADMIN_ADDRESS` to the public admin address shown by the wizard before the first signed config write. Omit this binding only when an existing registry session and the Worker's configured registry/RPC can attest the exact session ID and that the signer and requested config admin are that session's on-chain admin. - Leave `DEFAULT_SESSION_SLUG` empty for a multi-tenant worker, or set it to a specific session slug for a single-tenant worker - After deploy, paste the resulting worker URL back into the wizard before publishing If you also want helper-assisted deployments from your own wizard instance later, separately self-host the legacy deploy-helper described in [session-cors-worker.md](session-cors-worker.md). ### Manual Cloudflare dashboard upload This is separate from the native Deploy to Cloudflare flow above. Native deploy clones the checked-in `deploy/cloudflare/session-worker/` template; manual deploy uploads only a generated Worker bundle. Use this manual path when you want to avoid Wrangler and the native Git-template flow. Recommended source files: - Bundled release asset: `https://github.com/AgalmicSoftware/context-engine/releases/download/worker-bundles-/sessionCorsWorker.bundle.js`. The hosted client uses the commit it was built from (Netlify's `COMMIT_REF`); local and self-hosted builds use the commit in `client/src/variables/workerReleasePin.json` - Adjacent provenance manifest: `https://github.com/AgalmicSoftware/context-engine/releases/download/worker-bundles-/worker-release-manifest.json` (the deploy helper verifies its expected SHA-256 before Cloudflare mutation) - Generated repo-local fallback bundle after `nvm use 20 && npm run worker:bundle`: `dist/sessionCorsWorker.bundle.js` - Canonical worker source: `https://github.com/AgalmicSoftware/context-engine/tree/main/workers/sessionCorsWorker` Dashboard checklist: 1. Create a new Worker in Cloudflare 2. Paste or upload the bundled worker source 3. Enable `nodejs_compat` and `global_fetch_strictly_public` compatibility flags 4. Add the `GROUP_KV` binding 5. Add the required vars/secrets, especially `TOKEN_HMAC_SECRET` 6. Deploy the worker 7. Copy the worker base URL into the wizard or `/admin` This is the most manual option, but it works if the helper path is unavailable. ## Post-Creation ### Verify the session on `/admin` Open the admin URL generated by the wizard, or manually visit: - worker canonical: `/admin?sessionId=&sessionSlug=&worker=` - decentralized: `/admin?sessionId=&chainId=11155420` Confirm that `/admin` can resolve: - session slug and session ID - worker URL - resource gates - canonical name/content from Worker KV for `worker_canonical` - metadata URI, registry chain/address, and sponsored flags for decentralized sessions ### Manage Agent Session Wrapped Compatible worker-canonical and registry-canonical sessions show an Agent Session Wrapped panel in `/admin`. Enter a fresh request-only Cloudflare token for each enable, disable-access, or explicit redeploy operation; the browser clears it when the request finishes and does not restore it from storage. `Check health` verifies the recorded protocol, session slug, access bit, and pinned session-Worker origin. Disabling access retains deployed resources and publishes `enabled: false`; resource deletion is a separate confirmed live operation. An unhealthy or failed redeploy does not replace the last verified origin/revision. ### Test worker health Use the `Worker Tests` panel in `/admin` to run: - `/health` - AI test - Arweave upload test when the selected profile uses Arweave - transcription test - faucet test when the selected profile configures a faucet If `/health` or the other worker calls fail with browser network errors, use the `/admin` button `Allow this origin (CORS)` and test again. ### Add questions Once the session exists, you can start populating it: - use `/admin` to set session defaults and the question-generation prompt - add questions or surveys through the normal authoring flow for that session - use the AI audio generator flow if you want AI-assisted question generation When questions/surveys are published: - worker-canonical sessions store active question/survey payload resources in Cloudflare worker storage - decentralized sessions keep the existing Arweave payload and `Surveys` contract registration flow Participant responses follow the same authority boundary. For a worker-canonical session, the client keeps the verified session config through submission, uploads response resources to that session's dedicated Worker, and returns the durable Cloudflare storage references without sending an EVM transaction. Chain-backed profiles retain their existing contract submission path. On reload, the client paginates the dedicated Worker's `questions`, `surveys`, and `responses` indexes and hydrates the stable `worker` cache scope. Question and survey payloads must repeat the exact canonical slug and session ID before they enter the cache; mismatched rows are isolated. Response rows are keyed by responder metadata that the Worker bound to the authenticated uploader, so a response payload cannot claim another participant's address. These reads use the current passkey context when the storage policy is authenticated. A Worker read, auth, or pagination failure remains a retryable Worker error and never falls through to registry discovery. Workers deployed before trusted responder metadata was added must be upgraded before their newly stored rows can participate in fresh-browser response hydration. For payload examples, see [arweave-payloads.md](arweave-payloads.md). ### Share the session URL The public entry point is: `/session/?worker=` for worker-canonical sessions, or `/session/` for registry-discovered decentralized sessions. Keep the `worker` query parameter in copied worker-canonical links. A fresh browser uses it only to locate `GET /session-config`; it is not an authorization credential. The client rejects unsafe production targets (non-HTTPS origins, URL credentials, paths, and private-network hosts), binds the worker origin to the exact slug/session identity, and prompts before replacing a conflicting trust-on-first-use pin. ## Troubleshooting ### Worker deploy fails For the default native handoff, check these first: - the selected Cloudflare account owns the newly deployed Worker - the account has an active `workers.dev` subdomain - all displayed setup values were copied into the matching Cloudflare fields - the returned URL is the HTTPS `workers.dev` origin, without a path - the Worker allows the current Context Engine browser origin If deployment succeeds but verification fails: - re-open `/admin` - verify or restore the Worker URL - use the Worker Tests panel to confirm `/health` - confirm the canonical config slug and public admin identity match the wizard For the collapsed legacy fallback, also verify that the request-only Cloudflare API token has permission to manage Workers scripts and KV and that the helper can access the selected account. ### Questions are not loading The two most common causes are bad scan bounds and a missing `Surveys` contract reference. These checks apply to chain-scanned profiles. A verified worker-canonical session obtains its questions from its dedicated Worker and does not require `blockLimits.start` or a `Surveys` contract. Check: - `blockLimits.start` in session metadata - `contracts.surveys.address` - `contracts.surveys.chainId` Why this matters: - the app uses `blockLimits.start` to decide where question and survey discovery begins - question creation later fails if the session does not have a valid `Surveys` contract address ### Auth issues Check both CORS and SIWE assumptions: - `allowOrigins` must be non-empty and include the exact browser origin you are using; `*` and wildcard hosts are unsupported, while an empty list means open CORS at runtime and is rejected by native `/new` verification - the SIWE message domain must match the request URI host - the active passkey-derived EOA or connected wallet must match the configured session admin for signed admin actions - Worker-canonical discovery must resolve one validated HTTPS Worker origin, slug, and canonical session ID; an old `worker` query hint is not authority after canonical config discovery Typical symptoms: - `Failed to fetch` or `Load failed` from worker auth endpoints usually means the origin is missing from `allowOrigins` - `SIWE domain does not match URI host.` means the login or admin signature was created for a different host than the one receiving the request ### Default AI models New sessions default both text-model lanes to `gpt-5.6-terra` with low reasoning effort. This includes group/cluster identification, summaries, question generation, and Interview response mapping. OpenAI requests use standard processing (`service_tier: default`) unless a caller explicitly selects another tier. GPT-Live voice and transcription settings are separate. Existing explicit session models and local overrides remain available; bundled demo defaults use Terra. Hosted Worker verification writes and reads back the prepared public configuration without finalizing publication. You can edit and verify again; Publish creates the final publication revision. Edits replace what an earlier verification stored: a blank end time is sent as `""` and blank request limits as `null`, so a cleared value does not stay on the Worker. The browser compares the shared public fields, including session appearance and the Worker URL's origin. It skips fields the Worker sets itself: the authorization epoch, the publication marker, the response field encryption it reports on every read, and, before publication, a revision the deploy helper staged. If verification fails, the wizard shows the reason: the Worker's error for a rejected write, or where the read-back config differs, naming the fields it lacks or adds. Retrying queued Group creation compares canonical HTTPS image and document URLs, so a host-only URL and the same URL with a trailing slash reuse the saved Group. The wizard restores custom allowed origins from its tab-scoped draft after reload, including an explicitly empty field. Drafts without a saved origins field use the normal defaults. ### Exploring group tags Click a tag in a session’s SBT or worker-group details to open the tag explorer without leaving the session. The originating session is preselected; you can change it using the dropdown in the top-right of the modal, or compare additional tags. **Open tag page** opens the full explorer with the selected session included as `?session=` (`?session=general` for General). Ctrl/Cmd-click on a tag opens its session-scoped link directly. The question pile’s microphone button sits beside the question-actions menu on small screens and remains directly visible in the desktop toolbar. It opens the voice-mode chooser when the session supports voice features, or resumes an unfinished interview. Its idle appearance matches the adjacent controls; an interview in progress keeps the microphone emphasized even after closing the modal. Closing stops audio capture and retains the transcript and review edits on the current page. Reopen to continue, submit, or explicitly discard the interview. Reloading or leaving the page clears this in-memory interview; closing does not submit responses. Importing a different prefill packet starts a new review, while reopening the same packet retains review edits. On small screens, Submit and Clear stay beside the menu and microphone. Submit and its pending count retain full-size text on phones. When the controls need more width, the navigation arrows wrap onto a right-aligned row below, with extra vertical space separating them from Clear. On that separate row, the arrows closely frame a horizontal question counter (for example, **5 / 50**). The counter only stacks when it needs to fit into a shared control row. Mobile question cards keep the same height across question types and prompt lengths, so the navigation stays in place. Long prompts use the space left by each answer type and shrink only when they overflow, down to the normal body-text size. Longer text remains scrollable. Binary choices use their original larger sizing when the full-size prompt and controls fit; otherwise they share one compact row. Rating sliders sit at the card's vertical center when the prompt and footer leave enough room. Multichoice options use two rows with horizontal scrolling. These layout adjustments apply only at narrow phone widths (480px and below); wider views retain their existing typography, button sizes, and answer layout. Above 768px, the navigation arrows and question-action icons form one evenly spaced vertical rail alongside the full card height, with the question counter between the two arrows. The compact question-actions menu labels its controls **Filter questions**, **Add questions**, and **All questions**. Opening it blurs the page behind it; selecting an action, clicking outside, or pressing Escape dismisses the menu. In the expanded question-card rating controls, Conviction and Importance each show their value directly beside the label. For quadratic questions, these expanded controls sit below the centered option-scroll arrows.