Skip to content
Automatron-workflowsPublic

About

Matinee: a sponsored short film inside LLM chat. Watch the film, earn model credits, and inspect the single use receipt.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Matinee

The short film that pays for the answer.

A sponsored film inside an LLM conversation. Watch it once, earn free credits for the model you want, and keep the single use receipt.

The working demo: a real chat, a sponsored film card and a model scoped credit chip

Read the protocol · Host previews · Inline placements · Integrate the component · Server verifier · Security boundary · Functional Minimalism review · Design notes

What this is

An LLM app can run out of credits. Matinee gives it one honest option: place a labelled sponsored film between turns, verify that it was watched, and grant a credit receipt the host can redeem exactly once.

The name is the format. A matinee is a short daytime screening; here it is a short sponsored film that makes the next answer free. The sponsor covers the inference. The person chooses whether to watch. The receipt proves what moved.

The demo is a working end to end reference. The chat is a working shell with a model, a credit chip and a composer. A reply costs 10 credits. An 8 second film earns 40 credits for Sage Mini. The player pauses when the tab is hidden or the film leaves the view. Completion produces a claim; the host verifies a signed receipt and updates the credit chip. Replaying the receipt is refused.

The page follows the Functional Minimalism harness: the working chat, the film card and the credit chip lead. How it works holds the optional explanation and boundary. Developer holds the receipt, event trace, inline placement and host verification. The first view does not require an introductory read. The review and its limits are recorded in docs/FUNCTIONAL-MINIMALISM.md.

No account, API key, ad network or backend is connected.

The film

The working film is an 8 second fictional spot for Still, a focus app. It moves from a coffee pour to handwriting to a home office, then lands on a designed end card. It is cut from licensed Coverr footage; the source and license notes are in assets/film/SOURCES.md.

The player is a real <video> element with a poster, a custom progress bar, a pause control and a sound control. The film starts muted. The card itself stays quiet: no sponsor name, no watch copy and no reward copy. The sponsor and the reward live in the accessible labels and on the credit chip, so turning Matinee on accrues credits behind the scene. The creative is local, served from the same origin, and the page keeps media-src 'self' and connect-src 'none'.

The sponsor, the product and still.example are fictional.

Host previews

The same film in Claude, ChatGPT and Gemini style shells. The page pairs a generic display card (Before) with a host-native film card (After), so the adaptation is visible without pretending the hosts integrate it.

An illustrative Claude-style host window with the Matinee film card

Open the host previews · Placement rules

The host page is an authored illustration and is quiet by design: a host rail, a Before and After comparison and the stage. It uses no official logos and discloses that Claude, ChatGPT and Gemini are trademarks of their owners. The working player and reward flow stay on the demo.

Run it locally

Node 22.12 or newer is required for development (.nvmrc pins 24.16).

npm ci --ignore-scripts
npm run dev

Open http://127.0.0.1:4173/. The page is self contained. It uses no external fonts, images, scripts or requests. The film and poster are local files.

The same contract is available in the terminal:

node bin/matinee.mjs demo
Ad       still-matinee · Still · 8s · +40
Claim    valid · 8000ms · nonce 80sDPOch
Receipt  rcpt_mjzrBuiNBWzJlBOQizjLs3 · signature valid
Ledger   +40 · balance 50
Boundary demo issuer only · no advertiser or payment is connected

The CLI uses the bundled 8 second Still definition. The browser demo uses the same definition and the local film.

The CLI writes fresh claims, validates them and credits a fresh ledger:

node bin/matinee.mjs sample --out claim.json
node bin/matinee.mjs verify claim.json
node bin/matinee.mjs credit claim.json

One component

<matinee-card> is a framework independent custom element. It owns attention. It never changes a balance. It can play a film through src and poster, or accept a host supplied creative in the default slot.

The same contract can be shown as a film, a logo card, an image or a text creative. The demo swaps between them with a small format switcher.

Place it between turns, not inside a model answer:

<div class="conversation">
  <assistant-message>...</assistant-message>
  <matinee-card
    ad-id="still-matinee"
    sponsor="Still"
    title="A quieter way to start."
    src="assets/still-matinee.mp4"
    poster="assets/still-matinee.jpg"
    duration="8"
    reward="40"
  ></matinee-card>
  <assistant-message>...</assistant-message>
</div>
Attribute Default Meaning
ad-id sponsored-message The ad identity the claim is bound to.
sponsor Sponsor The sponsor label in the chrome.
title A short sponsored film. The idle headline and fallback title.
src absent Local video source. The component renders a film.
poster absent Poster frame shown before playback.
duration 15 Seconds. Clamped to 5 through 120.
reward 40 Credits. Clamped to 1 through 1000.
disabled absent Closes the player for this session.

Methods: start(), pause(reason?), resume(), reset(), toggleMute().

Properties: status, elapsedMs, claim, durationMs, reward, muted.

Events bubble and cross the shadow boundary:

Event Detail
matinee:ready { adId, durationMs, reward }
matinee:started { adId, durationMs, reward, attempt }
matinee:progress { adId, elapsedMs, durationMs, progress }
matinee:paused { adId, elapsedMs, reason }
matinee:resumed { adId, elapsedMs }
matinee:completed { claim }
matinee:reset { adId }

The clock pauses when the document is hidden, when the film leaves the conversation view and when the host disables the element. It does not auto resume. A background tab cannot earn credits.

One proof

A completed watch produces a completion claim:

{
  "version": 1,
  "adId": "still-matinee",
  "sessionId": "ses_example",
  "startedAt": 1794926880661,
  "completedAt": 1794926895688,
  "elapsedMs": 8000,
  "reward": 40,
  "nonce": "80sDPOch2cgTN0d5c_uYfRZq"
}

The host checks the ad, reward, session, nonce, elapsed time, timestamps and freshness. A claim older than five minutes is refused. The demo issuer then returns a receipt with a receiptId, issuedAt and HMAC signature.

The signature proves the claim survived the code path. It does not prove an ad network served the film. A server side verifier example ships in server/; see docs/VERIFIER.md.

One ledger

creditReceipt is pure. It returns a new ledger and refuses:

  • a receipt that was already credited (receipt_used)
  • a claim for another ad (ad_mismatch)
  • a reward that does not match the published reward (reward_mismatch)
  • a short watch, expired claim or malformed nonce (claim_invalid)
  • a tampered receipt (signature_invalid)
  • a session beyond its cap (session_cap)
  • a spend below zero (insufficient_credits)

The demo starts at 10 credits, charges 10 per reply, rewards 40 credits per 8 second watch and caps the session at 3 watches. Credits are scoped to Sage Mini in the demo. Replay the last receipt proves the second credit is refused while the balance stays unchanged.

Boundary

This is a working reference, not an ad network. The sponsor is fictional. The demo issuer runs in the browser and its key is public on purpose. The film is a demo cut from licensed stock footage, not a real campaign.

A server side verifier example now ships in server/. It owns a server secret, checks a session and credits a ledger transactionally. See docs/VERIFIER.md.

Production still needs two things this repository deliberately leaves to the host:

  1. A completion proof signed by the ad network, bound to one ad and one session.
  2. A billing agreement with the sponsor. Credits are not money.

No targeting, telemetry, cookies or third party requests are used. The page CSP sets connect-src 'none' and allows only local media with media-src 'self'.

Verify

npm test          # protocol, issuer, CLI and export tests
npm run check     # tests plus static checks for network primitives and CSP
npm run test:browser  # Chrome film flow, pause, replay, host previews, mobile
npm run serve       # server verifier example on 127.0.0.1:8787
npm run build:site    # static site in _site/

The browser check covers the real film playback, the model scoped credit chip, the Developer and How it works dialogs, pause and resume, receipt replay, reset, offscreen pause, the 390 pixel layout and the three host previews. It needs Google Chrome. Set CHROME_PATH if Chrome is not in its default location.

Project layout

src/protocol.mjs       claim validation, receipts, ledger
src/issuer.mjs         demo HMAC issuer and verifier
src/element.mjs        <matinee-card>, video player, timer and events
src/index.mjs          public exports
bin/matinee.mjs        verify, credit, sample and demo commands
server/verifier.mjs    server side session ledger and verifier
server/index.mjs       Node HTTP verifier example
index.html             working host app, How it works and Developer dialogs
app.mjs                demo host state and DOM
styles.css             page, app shell and film card styles
hosts.html             illustrative host previews, not the working demo
hosts.css              host windows, Before and After cards
hosts.mjs              host selector and comparison state
assets/still-matinee.mp4  the working 8 second film
assets/still-matinee.jpg  a clean poster frame
assets/film/SOURCES.md    stock footage provenance and license
examples/              bundled ad definition and sample claim source
docs/                  protocol, placements, integration, verifier, security, roadmap
test/                  Node tests
scripts/               dev server, static check, site build, browser check

Maintaining records the release and rollback loop.

Status

v0.5.5 is published as a public Automatron reference: https://automatron-workflows.github.io/matinee/. The source is public on GitHub. The npm package remains private: true until the owner chooses a distribution route.

The next tests should run with an ad network proof, an authenticated account binding, a durable transactional store and a short user study of whether the exchange, the model scope and the film placement are understood without opening How it works. The host page is an authored illustration; the working player and reward flow stay on the demo.

About

Matinee: a sponsored short film inside LLM chat. Watch the film, earn model credits, and inspect the single use receipt.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages