Content studio pack

The content studio pack (studio) runs on the pipeline engine. It turns a content brief and the sources you paste into a YouTube script, with three title and thumbnail concepts and a production pack for you to review. Every factual line in the script must trace back to a verbatim quote of one of your sources.

Tevrin never publishes anything, and it never fetches anything. You publish each video yourself. The pack has no YouTube upload, no web search and no URL fetching. It registers no tools and no external handlers, and no stage lists tools:. Research comes only from the source texts you paste into the brief.

The pipeline: content-studio

One run makes one video. A project can have many runs at once (concurrency: { runs: many }). A run starts by hand or from a signed webhook whose body is the content_brief. The approval modes are strict and advisory (the default).

# Stage Who Reads Writes Checks
1 scout agent topic-scout content_brief, channel_profile, the topics of the last 365 days topic needs content_brief within its 200,000-character limit; the repeat veto V1 ends the run vetoed
2 research agent researcher content_brief, topic research_notes grounding rules R1–R4; up to 3 attempts, then an escalation
3 write agent script-writer topic, research_notes, channel_profile script traceability rules S1–S6, then the script-fact-checker; up to 3 attempts, then an escalation
4 edit agent editor topic, research_notes, script, channel_profile edit_review routes back to research or write, or continues
5 package agent packager topic, research_notes, script, channel_profile package (3 variants) package rules P1–P3 on each variant, up to 2 attempts, then the run fails; you pick one at a variant_select gate
6 render handler studio.render topic, script, research_notes, package, content_brief production_pack  
7 review gate publish_approval production_pack   a rejection sends the work back to write

research and write also inject learned feedback (feedback: { inject: true, limit: 10 }).

The run has limits: { revisions: 3, then: escalate }. A backward move is an editor route or a rejection at publish_approval. The first three run. A fourth raises an escalation gate instead, and the run waits for an Owner.

Artifacts and schemas

The JSON schemas in the pack are authoritative. Each field’s title and description label the forms in the UI.

Project artifact (you write this)

channel_profile (Channel profile, JSON, approval required). The run pins the newest locked version when it starts. Without a locked version, starting a run gives 409 SOURCE_ARTIFACT_MISSING naming “Channel profile”.

Field Required Notes
channelName yes  
audience yes Who the videos are for
pillars   The themes the channel covers
tone   How the scripts should sound
wordsPerMinute   100–220, default 150. Used for the runtime check and the section timings
defaultMinutes   1–60, default 8. The target length when a brief doesn’t give one
bannedPhrases   Phrases no script, title or description may use (case-insensitive)
locale   Default en-GB
curl -X POST "$TEVRIN/api/projects/$PID/pipelines/content-studio/artifacts/channel_profile/versions" \
  -H 'Content-Type: application/json' \
  -d '{ "content": { "channelName": "Money, Plainly", "audience": "UK savers who want plain answers",
        "wordsPerMinute": 150, "defaultMinutes": 8, "bannedPhrases": ["smash that like button"] } }'
curl -X POST "$TEVRIN/api/projects/$PID/pipelines/content-studio/artifacts/channel_profile/versions/1/lock"

A Contributor adds versions and an Owner locks them, from the API or the Project artifacts section of the Pipeline tab. Add your credentials to each call, as in the Triggers and webhooks guide.

Input (you give this to a run)

content_brief (JSON, locked when given).

Field Required Notes
idea   What the video could be about, in your words
sources yes 1–20 sources, at most 200,000 characters in all. Each is { id, title, url?, publishedAt?, text }
sources[].id yes s1, s2, … (pattern ^s[0-9]{1,3}$). Facts cite it
sources[].text yes The source’s full text, 1–50,000 characters. Paste it: Tevrin never fetches the url
targetMinutes   The video’s target length; the channel’s defaultMinutes when left out
allowRepeat   Default false. true skips the repeat veto (V1)

The schema can’t check the 200,000-character total, so the studio.brief-limits guard checks it when scout starts. A brief over the limit fails the stage before any agent runs, with a reason such as content_brief: the sources hold 200,005 characters in all; paste at most 200,000.

Stage outputs

Artifact Shape
topic workingTitle, angle, audienceQuestion, keyQuestions (2–8), whyNow?
research_notes facts: [{ id, claim, sourceId, quote }], openQuestions
script hook: { text, factIds }, sections: [{ id, heading, broll?, lines: [{ kind, text, factIds }] }], outro: { text, factIds }. kind is claim, opinion, transition or cta
edit_review route (continue, research or write), route_reason?, scores: { hook, clarity, accuracy, pacing } (1–5), notes
package title, thumbnailText, thumbnailBrief, description, factIds
production_pack Markdown, approval required: what you review at publish_approval

Write a content brief with source ids

Give each source a short id and paste its full text. The researcher may only quote these texts, and every number it states must be in its quote, so paste the passages that hold the figures you want in the video.

{
  "idea": "What falling inflation means for savers",
  "sources": [
    { "id": "s1", "title": "ONS: Consumer price inflation, April 2024", "url": "https://ons.example/cpi-april-2024",
      "publishedAt": "2024-05-22", "text": "UK CPI inflation fell to 2.3% in April 2024, the ONS said." },
    { "id": "s2", "title": "Bank of England: May 2024 rate decision",
      "text": "The Bank of England held Bank Rate at 5.25% in May 2024. Seven members voted to hold and two voted to cut." }
  ],
  "targetMinutes": 8
}

Repeat topics (V1)

Tevrin makes a slug of topic.workingTitle: lower-case, every character other than a-z0-9 turned into -, repeats collapsed and the ends trimmed. “Is a Lifetime ISA worth it in 2027?” and “is a lifetime ISA worth it in 2027” share is-a-lifetime-isa-worth-it-in-2027.

After the topic scout writes topic, the studio.repeat-topic veto compares the slug with the topics of the project’s other content-studio runs that completed in the 365 days before this run started. A vetoed run made no video, so it doesn’t count. A match ends the run vetoed, with a finding such as V1: same topic as run <id> started 2026-06-03. A topic from 400 days ago doesn’t match. Set allowRepeat: true in the brief to make a follow-up on purpose.

Grounding rules (R1 to R4)

Each research fact is { id, claim, sourceId, quote }. Before comparing, Tevrin normalises text: it collapses whitespace, makes curly quotes and dashes straight, and lower-cases it.

Rule Check
R1 Ids are f1, f2, … and unique; there are 3 to 60 facts
R2 sourceId is a brief source’s id, and the normalised quote (10 to 500 characters) is in that source’s normalised text
R3 Every number in claim is among the numbers in quote
R4 Every claim is 1 to 400 characters

A number is a run of digits with an optional decimal part, after removing thousands separators (1,200 is 1200). Currency symbols and % are ignored, and years count.

Example. Source s1 reads “UK CPI inflation fell to 2.3% in April 2024, the ONS said.”

  • Attempt 1: f1 claims “Inflation fell to 2.1% in April 2024”, quoting “inflation fell to 2.3%”. That gives R3: f1 states "2.1", which isn't in its quote (and the same for “2024”, which the quote leaves out). f2 quotes “inflation dropped sharply”, which s1 doesn’t say: R2: f2's quote isn't in source s1. The notes are rejected, and the findings go back to the researcher.
  • Attempt 2: f1 claims “UK CPI inflation fell to 2.3% in April 2024”, quoting “CPI inflation fell to 2.3% in April 2024”. It passes.

Traceability rules (S1 to S6) and the fact-checker

The hook counts as a claim line. The outro counts as a claim when it cites facts, and as a cta when it cites none.

Rule Check
S1 Every claim line cites at least one fact id
S2 Every fact id exists in research_notes
S3 Every number in a claim line is among the numbers in its cited facts’ claims
S4 An opinion, transition or cta line has no number, so a figure is always a cited claim
S5 The spoken words (hook, lines and outro) ÷ wordsPerMinute are within ±20% of the target: targetMinutes, else defaultMinutes
S6 No bannedPhrases entry appears (case-insensitive)

S3 and S4 ignore window lengths: a number directly followed by -day, ` days, -week, weeks, -month, months, -year or years. For S5, 1,230 words at 150 wpm is 8.2 minutes, inside 6.4–9.6 for a target of 8. 1,500 words is 10 minutes, which gives S5: runtime 10.0 min is outside 6.4–9.6`.

The rules run first. Only a script that passes them goes to the script-fact-checker, which gets the script, the research notes and the brief’s source texts. It returns error findings for a claim its fact ids don’t support, or one that overstates them (certainty, scale, causation, recency), and warning findings for loaded or vague wording. An error rejects the attempt. Warnings are listed at the top of the production pack.

Worked example: a rejected claim

Fact f1 is “UK CPI inflation fell to 2.3% in April 2024”.

  1. Attempt 1 has the claim line “Inflation is under control now”, citing nothing (S1: sections[0].lines[2] is a claim with no fact ids), and “It fell to 2.1%” citing f1 (S3: sections[0].lines[1] states "2.1", which isn't in its facts (f1)). The rules reject it, and the fact-checker isn’t called.
  2. Attempt 2 fixes the numbers, but has the claim “This proves rates will be cut” citing f1. The rules pass. The fact-checker returns an error: “‘proves’ claims a cause; f1 reports a figure”. The attempt is rejected.
  3. Attempt 3 makes it an opinion with no number: “Some economists expect that to make rate cuts likelier”. It passes.

After three failed attempts, the run raises an escalation gate instead of continuing.

Editor routes and the revision cap

The editor scores the script (hook, clarity, accuracy and pacing, 1 to 5) and sets route:

  • continue: on to package;
  • research: back to research, when the facts can’t support the video;
  • write: back to write, when the facts are enough but the script isn’t.

A route back reruns that stage, and every stage after it follows again. The re-entered agent gets the editor’s route_reason as feedback, under Sent back by edit (route). A route with no reason gives Sent back by edit with no reason.

Routes and publish_approval rejections are backward moves, and a run allows three. The fourth isn’t made: an escalation gate is raised, package doesn’t run, and an Owner decides what happens next.

Pick a variant

The packager writes three concepts, v1, v2 and v3, each a package. Each one is checked on its own:

Rule Check
P1 title is 20 to 70 characters; thumbnailText is 1 to 5 words; thumbnailBrief is at most 500 characters; description at most 1,000
P2 Every number in title, thumbnailText and description is among the numbers of the facts in factIds (S3’s window exception applies)
P3 No banned phrase

For example, the title “Inflation Hit 2% — What It Means for Your Savings” with factIds: [f1] gives P2: title states "2", which isn't in its facts (f1). A variant that fails is retried once with its findings. If it fails again, the run fails.

When all three pass, a variant_select gate shows them side by side in the gate inbox. An Owner approves it with the chosen label ({ "choice": "v3" } through the API). Only the chosen variant reaches render.

Review and publish yourself

studio.render builds production_pack in a fixed layout. It’s deterministic: the same inputs give the same bytes.

# <title>
> Runtime ~<m:ss> at <wpm> wpm · Review before publishing: Tevrin publishes nothing.
> Fact-checker warnings: <n> (listed below, or "none")
## Thumbnail
**<thumbnailText>**: <thumbnailBrief>
## Description
## Script
### 0:00 Hook
### <m:ss> <heading>      (one per section; claim lines end with their [fact ids])
### <m:ss> Outro
## Sources
- f1: "<quote>" (<source title>, <url or "no URL">, <publishedAt or "undated">)

Each section’s time is the spoken words before it ÷ words per minute, rounded down to whole seconds. Only the facts the script cites are listed under Sources.

The publish_approval gate (the review stage) shows the pack, with the gate’s description from the definition as its copy: “Tevrin publishes nothing. Review the production pack, then record and publish the video yourself.” Approve it when the pack is right. A rejection’s comment goes back to the script writer as feedback, and edit, package and render run again after it.

Record outcomes

The run declares two number outcomes. Both target the package stage, so they’re recorded against the variant you picked.

Metric Title
views_7d Views in the first 7 days
ctr_pct Click-through rate (%)

Record them on the run’s Outcomes panel, or through the API:

curl -X POST "$TEVRIN/api/pipeline-runs/$RUN_ID/outcomes" \
  -H 'Content-Type: application/json' \
  -d '{ "metric": "views_7d", "value": 1250, "observedAt": "2027-01-17T00:00:00Z" }'

Recording a metric again supersedes the earlier value. A run that never reached package gives 409 OUTCOME_TARGET_MISSING.

Start a run

You need a locked channel_profile first.

From the UI

  1. Open the project’s Pipeline tab and select Start run.
  2. Pick content-studio, and an approval mode.
  3. Fill in the content_brief form (paste each source’s text), or choose Upload a JSON file.
  4. Select Start run.

From the API

curl -X POST "$TEVRIN/api/projects/$PID/pipeline-runs" \
  -H 'Content-Type: application/json' \
  -d '{ "pipelineId": "content-studio", "inputs": { "content_brief": {
        "sources": [ { "id": "s1", "title": "ONS: CPI, April 2024", "text": "UK CPI inflation fell to 2.3% in April 2024, the ONS said." } ],
        "targetMinutes": 8 } } }'

Errors: 409 SOURCE_ARTIFACT_MISSING (no locked channel profile), 400 INPUT_INVALID (the brief fails its schema, with the failing paths).

From a signed webhook

An Owner creates a webhook for the pipeline:

curl -X POST "$TEVRIN/api/projects/$PID/pipeline-webhooks" \
  -H 'Content-Type: application/json' \
  -d '{ "pipelineId": "content-studio" }'

The response has url, id and secret. The secret is shown once. The body you post is the content_brief JSON, and each call starts its own run. Sign the exact raw body: the X-Tevrin-Signature header is t=<unix seconds>,v1=<hex>, where the hex is HMAC-SHA256(secret, "<t>.<raw body>"), and send a unique X-Tevrin-Delivery UUID. The full rules are in Triggers and webhooks.

SECRET='whsec_...'
T=$(date +%s)
BODY='{"sources":[{"id":"s1","title":"ONS: CPI, April 2024","text":"UK CPI inflation fell to 2.3% in April 2024."}]}'
SIG=$(printf '%s' "$T.$BODY" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')

curl -X POST "$TEVRIN/api/hooks/pipelines/$WEBHOOK_ID" \
  -H 'Content-Type: application/json' \
  -H "X-Tevrin-Signature: t=$T,v1=$SIG" \
  -H "X-Tevrin-Delivery: $(uuidgen)" \
  --data-binary "$BODY"

A success is 202 with { runId }.

Privacy and safety

  • Your brief, sources and channel profile are sent to the project’s configured LLM provider.
  • Pasted sources are untrusted. The prompts put them in delimited data blocks and tell the agents to treat them as data. No agent has tools, so an injected instruction can’t act, and the rules catch numbers it makes up.
  • Nothing is published or fetched.