Skip to main content

Event intake sources and model controls

The backend operations and authenticated adapters share one private intake contract. Website and MCP callers must never supply actor identity in request JSON.

Upload and artwork boundaries​

createEventPosterHandlers({authority, admin?}) exposes beginPosterUpload, completePosterUpload, readPoster, and selectPosterArtwork. The authority callback resolves the current signed-in actor or current contribution-scoped OAuth credential on every operation. The short-lived MCP bridge uses the same presigned POST as the website. Website and MCP callers cannot supply a remote source URL; only the Discord bridge below fetches one, from the Discord CDN.

Uploads declare SHA-256, MIME and exact bytes before signing. Accept PNG, JPEG or WebP, at most 12 MiB. Completion checks MIME, digest, byte count and full decoding with the existing profile image validator. Its 8192-pixel source dimension and 4096-pixel display bounds also apply. A ten-minute signed POST writes a quarantine key. Digest-checked bytes are copied to a distinct immutable key before completion. The signer constrains exact bytes, MIME, and private cache controls. The source record reserves both copies before signing, with 20 active sources and 120 MiB of reserved private bytes per actor. Sources on a connector's draft neither count toward nor are capped by that quota; the connector's daily run cap bounds them. Failed signing/completion leaves a cleanup obligation. Expired transfer capabilities cannot complete.

Discord intake runs reach the bucket through the token-gated web route /api/internal/discord-intake/poster. Its store step downloads a Discord CDN attachment and follows the same upload, freeze, and validate path. Its read step writes the prepared poster to a new key under profile-assets/quarantine/, which the bucket lifecycle expires after two days, and returns a 60-second signed GET link, because a prepared poster can exceed the web host's 4.5 MB response cap.

Keys live under profile-assets/event-posters/, within the existing Terraform S3 role prefix. S3 block-public-access remains required. Private reads require the source actor or an active super_admin reviewer. Profile-media intent consumers cannot promote these records because event evidence uses its own purpose-bound table and no profile asset row.

Save the singular posterSourceId before completing its upload. Completion prepares that poster's artwork automatically and returns the current draft version and artworkAssetId. A singular client can also complete before saving the reference. A failed derivative write fails completion and blocks publication. Retry the same completion to finish it, or remove the poster. A ready source never needs another quarantine copy on retry.

Automatic processing and the existing singular artwork_select command share actor/draft checks, an independent key, a sanitized WebP derivative and a versioned commit. Save a replacement posterSourceId to clear old artwork and pending processing. Save posterSourceId: null to remove it atomically; no separate artwork clearing command is needed. Explicit null is retained in the private draft so a late completion cannot restore removed artwork. Revision checks and the processing intent reject stale or concurrent completions. Publication accepts only a ready derivative associated with the saved poster; a saved poster without ready artwork blocks publication. An exact duplicate belonging to another draft never inherits this draft's artwork. Private evidence and public artwork retain independent records and cleanup.

The public artwork route serves the canonical path /api/v0/events/{eventId}/artwork/{artworkAssetId} through eventIntakeSources.publicArtwork. Check the returned asset's event association against the route and honor public visibility. The website private source command uses the session-derived actor with readActorSource and private/no-store responses. Do not expose source or quarantine keys through public file routes. Selected artwork is still stored privately in S3; the validated application route serves public bytes.

Website intake​

POST /api/event-intake derives the actor from the signed-in website session. It accepts only extraction, poster begin/complete, private preview, and artwork selection commands. Same-origin POST is required, JSON requests have a 64 KB streaming cap, and responses use private, no-store. It reuses the API/MCP commands and validates the same strict inputs. No personal API token is needed.

Source accepts one poster, optional text, or both. Uploading a new poster replaces the current poster and prepares artwork automatically. Removal clears artwork. Details and Lineup show tentative fields and private evidence. Accepted manual fields survive source changes; stale suggestions and evidence do not. Lineup authoring shows native local dates instead of day offsets, with an occurrence selector for repeated hours and validation for DST gaps. Contributor corrections omit Source and cannot change images or artwork.

The browser hashes the chosen file and saves a private posterDeclaration before requesting upload. This validated MIME/size/digest input supports a poster-only draft without inventing event fields. Existing draft quotas, expiry and publish minimums apply, including when upload fails. Removing the only source can leave an existing private draft empty. New drafts still require meaningful input. The browser transfers the chosen file without session credentials or redirects, saves its source reference before completion, and uses completion's version for the next draft save.

Extraction saves candidate fields under tentative, with unresolved questions. Accept copies an individual field or reviewed lineup into confirmed fields; manual edits remain available. Draft writes retain the version paired with the source/form. Concurrent edits refuse candidate persistence. Missing model configuration leaves manual editing and publication available. Draft reads return the processed artwork source ID for the preview. A replacement preview never shows the old poster while the new source read is pending.

flowchart LR
A[Events, community or direct contribute link] --> B[Sign in and return]
B --> C[Source: one poster and optional text, or skip]
C --> D[Private versioned draft]
D --> E[Extract tentative details and questions]
E --> F[Details and Lineup: accept or edit fields]
E -->|Unavailable| F
D -->|Complete poster upload| G[Automatic artwork preparation]
G --> F
F --> D
F --> H[Review and publish]
H --> I[Canonical event page]

Exact newly authored public copy still requires BASIC approval before shipping. Local fixture screenshots prove the browser states, not hosted session/storage or model accuracy.

Retention and deletion​

Personal Discord sources​

Selected-message text, model evidence, pending signed URLs and the selected update baseline are private to the draft actor. Preparation uses the existing website source/extraction controls and stores no complete interaction payload or conversation history. Its actual download is bounded as well as its declared size. Extraction of these drafts, including later manual retries, sends usage metrics to diagnostics without request or response content.

For a new Discord event, choose the source time zone once on Details. A dated import shows one time-zone warning per editor step instead of listing the same requirement for every set. Once the event date and time zone are set, dated set times can be accepted together. Uncertain dates and ambiguous clocks still need review. Saved imports can use this flow without running extraction again.

Failed or expired preparation invalidates the old draft version before retrying, so late poster writes cannot replace the retry's selection. If artwork completed before source adoption failed, retry adopts that artwork without downloading another copy. An unfinished, unsaved artwork selection is cleared, allowing a fresh upload or manual publication. Its abandoned source keeps the normal cleanup lifecycle. After text-only preparation or explicit removal, another poster can be uploaded through the existing source editor. Captured signed URLs are cleared when preparation succeeds.

Pending source metadata follows the draft's rolling 30-day expiry. Publication or discard clears source text, suggestions, questions, the update baseline and pending URLs. Resolved personal drafts expire immediately and stop consuming active-draft quota. Event-linked actor/message/author IDs and hashes remain private for provenance and replay, like existing contribution receipts. Eventless discarded metadata expires immediately; explicitly selecting that message again replaces it with a fresh draft. Old discarded links remain unavailable. The existing bounded draft sweep removes expired eventless and orphan metadata. Completed sources for cancelled or moderated events cannot create another event through reselection; existing-event management remains the recovery path. Image evidence and intentionally published artwork retain their independent storage, expiry and hold rules below. Removing an imported poster retains accepted event details; it cannot restore itself through a late preparation response.

Abandoned evidence expires 30 days after draft activity, capped at 180 days after upload. Published evidence expires 30 days after the event date/start, with the same cap. Date-only events use the end of that UTC calendar date. Reads enforce expiry immediately. Ready records are rechecked at most daily to account for a changed event date; expiresAt is a conservative next cleanup check, not a grant of access until that timestamp.

The existing ten-minute contributionCleanup.sweep invokes the authenticated media-cleanup worker. It claims at most 50 records per state with one-minute leases, deletes exact server-selected keys, then confirms using lease tokens. Failures retain their deletion obligation. Failed transfers have a one-day grace after the upload capability expires. Cleanup leaves the source kind, digest and IDs/audit linkage, with storage keys removed and byte reservations released.

setEvidenceHold({posterAssetId, reportId}) requires an active super-admin grant and a report tied to that evidence's event. A hold must precede deletion claiming. Passing null releases the hold after the dispute is resolved. Holds cover a specific private evidence item. They do not retain unrelated uploads. Published artwork has an independent record and is never included in source cleanup. Published artwork is rechecked daily. The worker renews a derivative still selected by a published event and deletes it after deselection or retraction. If an unpublished event still points to that derivative, cleanup clears the stale poster URL before deleting the object. Abandoned uncommitted artwork has its own bounded sweep. Each selection reserves a ten-minute write window plus one day of cleanup grace, including retries of pending selections. The server rejects preparation that outlives the write window and passes its deadline to S3. Expired/deleting selections retry with a fresh key. Artwork tombstones retain their exact key so a failed late write can requeue deletion even after an earlier sweep confirmed it. Published artwork is unaffected.

Extraction and classification​

The agent lives in packages/event-intake-agent (@vrdex/event-intake-agent). createEventIntakeExtractor binds authenticated draft/source admission and public search callbacks; extractEventIntake returns only {event,lineup,evidence,questions,decision}. decision is new, update with an event slug, or not_event with a reason; web and MCP runs pass no run context and always get new. The strict nullable candidate schema is shared in packages/api-contracts. Nothing in this loop writes confirmed draft fields or publishes an event.

The Responses loop sends optional source text and one authorized, sanitized inline poster in one discovery run. Its prepared image data URL has a 20 MB limit before the provider call. It uses store:false, no provider file upload, strict structured output, no mutation tools, at most five tool calls and six model turns. The callbacks return at most five public people or communities, or zero/one/multiple UTC instants. The read-only list_events and get_event tools are offered only with run context. Candidate slugs must appear in the corresponding actual lookup results, and an update slug only from list_events; any other update falls back to new with a question. Evidence records its text, poster, lookup, calculation or connector origin. After model extraction, a required read-only lineup pass looks up unresolved performer labels even if the model called no identity tools. It preserves links already grounded by the model's public search results. It processes at most eight unique normalized labels, with up to five public results per query and a three-second timeout per query and a shared five-second budget. Repeated labels reuse the result. Additional labels and failed lookups retain their source text and receive review questions.

A unique exact normalized display-name or slug match becomes a tentative link. Other names remain unlinked. For names of at least six normalized characters, a second query retrieves their first four characters and offers only candidates within one insertion, deletion or substitution of the full display name or slug. These typo candidates are saved as question alternatives for review, preserving the original label. This bounded retrieval does not correct arbitrary misspellings, including typos in those first four characters. Multiple exact or nearby candidates remain explicit alternatives; a missing name never becomes an invented identity. Mandatory lookups for non-private sources have separate lineup.search_people Langfuse spans containing the query, retrieval phase, public results and availability outcome. They do not consume or expand the five model-tool-call budget. Lookup and tracing failures cannot discard otherwise valid extracted event details.

Tentative values, up to 40 private evidence entries, and unresolved questions survive draft resume without changing accepted fields. Editing source text or the poster clears those discovery results while retaining accepted fields. Explicit candidate dates become bounded day offsets only when the event date, timezone, and local instant are valid; undated times keep no inferred offset. An undated lineup start earlier than the event start asks for its actual date. Ambiguous times remain questions with both alternatives. Timezone abbreviations are clues and cannot silently select an instant.

Refusals, incomplete/malformed output, provider errors and absent credentials return an empty candidate with a reason code. Manual editing and publication remain available. Extraction and classification share an actor limit of 20 model attempts per rolling day. Classifier quota exhaustion behaves as an outage. Extraction runs report to sinks instead of a console metric: Langfuse traces each model turn when its keys are set, and an event_intake_run product analytics event records the outcome, turns, tool calls, tokens and cost.

Publication classification defaults to off. shadow records sample/outage reports without blocking. block_high_confidence additionally requires an explicit threshold and an approved measured baseline. Without that baseline it behaves as shadow. The baseline must contain positive genuine/spam counts, zero false blocks, nonnegative finite latency/tokens/cost, and approved: true. This is a deployment configuration guard, not a claim that any sample size guarantees safe blocking. The threshold must come from that evaluation, not the synthetic policy tests.

Classifier decisions bind to draft ID/version. The final commit repeats deterministic preflight and atomically records outage/sample flags in the operator report list. An outage permits an otherwise passing submission. No model decision establishes factual authenticity or owner confirmation. Logs include IDs, reason classes, latency and token counts. Cost is explicitly null until evaluated, never inferred as zero from the absence of a paid run. No source text, image bytes or model prose is logged.

Configuration and ownership​

The VRDex operator owns these settings. Keep secrets in the appropriate provider secret store. Rotate the OpenAI key in the OpenAI project, update each enabled consumer, then revoke the old key. Recreate storage credentials and cleanup tokens using the existing profile-assets Terraform and media-cleanup deployment procedure. No provider changes or deployment were made for Task 6.

VariableRuntimeDefault
OPENAI_API_KEYWeb extraction; Convex classification only when enabledUnset
VRDEX_EVENT_INTAKE_AI_ENABLEDWebfalse
VRDEX_EVENT_INTAKE_MODELWebgpt-6-luna
LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_BASE_URLWeb and Convex, optional tracingUnset (Langfuse Cloud host)
VRDEX_EVENT_SPAM_MODEConvexoff
VRDEX_EVENT_SPAM_MODELConvexgpt-6-luna
VRDEX_EVENT_SPAM_BLOCK_THRESHOLDConvexUnset
VRDEX_EVENT_SPAM_EVALUATIONConvex, JSON with fields described aboveUnset
Existing profile asset bucket/region/role settingsWebExisting S3 configuration
VRDEX_MEDIA_CLEANUP_URL and VRDEX_MEDIA_CLEANUP_TOKENConvex scheduler; matching web tokenExisting cleanup worker

Setting extraction false or spam off is the corresponding model kill switch. Self-hosted manual intake works without OpenAI credentials. Before enabling image intake in a deployment, verify consent, the private bucket policy, delete-worker health, retention expectations, and provider data controls.

Offline evaluation and limits​

The owned fictional fixture manifest is tests/fixtures/event-intake/manifest.json. Tests render its text to PNG locally. It contains clear, dense, partial, conflicting and adversarial source material plus four genuine and two spam labels. No real poster consent is asserted, and no unlicensed image is committed. Injected model responses test policy and data boundaries, not extraction or spam accuracy.

A five-case fixture-fed Time plan executor comparison measured direct resolution at 0.208 to 0.494 ms and the existing executor at 5.062 to 88.761 ms in one local run. Both resolved the three ordinary cases. The existing executor failed on both DST gap and fold; the direct resolver returned zero and two instants, respectively. The direct resolver is selected because it preserves all choices. Planner inference was not run. These timings exclude model calls and initial module import and do not predict hosted latency.

Field accuracy, false identity matches, false-block rate, provider latency, provider tokens and cost are unmeasured. Blocking remains off and no launch threshold is chosen. A paid, consented evaluation and operational storage proof are required before claiming hosted accuracy or enabling blocking.

Current OpenAI facts were checked on 2026-09-28: Responses migration, function calling, strict output, vision, and the GPT-6 Luna model. store:false removes application-state persistence, but does not promise zero provider abuse-monitoring retention. See data controls.