Weekly paper
Lore Week 5: labelling images made with AI, checking that a picture still looks right, and prompt caching
This week we merged 34 pull requests and added one AI line to every route that publishes a post.
Lab, weekly paper. Cutoff: this edition covers pull requests merged from Monday 9 Nov 00:00 to Sunday 15 Nov 21:00, Europe/Istanbul. Retrieval: we read those records on Sunday 15 Nov between 21:18 and 21:19.
In one minute
Up to the Sunday 21:00 cutoff we merged 34 pull requests this week. AutoReal took 20 of them, Lexicon 6, guno 3, lorelabs.co 1 and Playables 1. The other 3 went to internal tools. Most of the week happened early: 13 merges on Monday, and none on Saturday or Sunday.
We want to teach three new ideas this week:
- Saying when an image was made with AI. Why we add a plain line to every post that uses a generated picture, and why the line has to be added by code on every route a post can take.
- Checking that a picture still looks right. How reference images and a measured contrast ratio catch changes that a person scrolling past would miss.
- Prompt caching. What it means for a model provider to reuse the start of a prompt, why the order of a prompt decides whether that works, and what it costs.
If you are new here: branches and approval gates were Lore Week 1, CI and check minutes were Lore Week 2, changing model providers and usage caps were Lore Week 3, and retention rules and checking AI written content were Lore Week 4. We do not repeat them here.
How we looked at the week
We listed every merged pull request in each of our repositories for the week, read their descriptions, and compared each product's state file, a short document that says what exists right now, at the start and end of the week. This count includes internal repositories, so it is larger than the build log on our home page, which counts products only.
We count by Istanbul time. Six of this week's merges happened late on Sunday 8 Nov in UTC, which was already after midnight on Monday 9 Nov in Istanbul, so they belong to this edition and not to the last one. We also checked last week's figure again: Lore Week 4 still has 52 merges up to its Sunday 21:00 cutoff.
Idea 1: saying when an image was made with AI
What it is. A disclosure line is a short sentence that tells a reader how a piece of content was made. Ours is "Image made with AI." in English and "Görsel yapay zeka ile oluşturuldu." in Turkish, placed at the end of a post's caption.
Why it matters. AutoReal writes social media posts for small businesses. A post can sit on the business's own photo, on words alone, or on a background picture made by an image model. A reader cannot tell these apart by looking, and a reader who later finds out may feel misled. Large platforms have moved the same way: Meta has described labelling images on Facebook, Instagram and Threads when it detects industry standard signals that they were made with AI.
How it works, in simple words. There are two kinds of disclosure. The first is visible: words a reader sees, like our caption line. The second sits inside the file: metadata that software can read. C2PA is an open technical standard for that second kind, recording where a piece of content came from and how it was edited. Meta notes that file markers can be removed, which is one reason a visible line is still useful. Our line is the visible kind.
The line follows four rules. It is added only when a post really uses a generated picture; posts on the owner's own photos and posts made of words alone get no line. It is added by code at the moment a post is built or published, not written by the model that writes the caption, so the model cannot drop it, rewrite it or translate it. It appears once: if a caption already carries the line in either language, the old one is taken out first, so publishing the same post twice never shows it twice. And when a caption is too long, the words are shortened, never the line.
What happened to us. Our company standard already asked for this line, but the new way of building posts did not write it, and posts on that route could carry a generated picture. We added the line there first. The same night we found older routes that also publish posts, and we added the same rule, with the same wording, to those too. The decision we wrote down that day is short: the line is always on, with the same wording, on every route that publishes. This is our product rule, not a legal assessment.
How we compare. A rule that lives in one place covers only the posts that pass through that place. The work this week was less about the sentence and more about finding every exit a post can take.
new posts
older posts
drafts saved earlier
add the line once
publish
Idea 2: checking that a picture still looks right
What it is. A golden test, also called a snapshot test, keeps a stored reference copy of what a program should produce. Each time the code changes, the program draws the same input again and the test compares the new result with the stored one. The Jest documentation describes the idea for screens: the test fails if the two do not match, and then either the change is a bug or the reference needs updating on purpose.
Why it matters. This week we changed the engine that draws AutoReal's post images. A new engine can draw almost the same picture with small differences: a line of text a little lighter, a label a few pixels lower. One post at a time, nobody notices. Across every design and every brand, those differences add up.
How it works, in simple words. We used two measurements. The first is contrast. The W3C accessibility guideline WCAG sets a contrast ratio of at least 4.5 to 1 between normal text and its background, and 3 to 1 for large text. A ratio of 1 to 1 means the text is the same brightness as its background. We use 4.5 to 1 as a design bar for text on our slides; text inside images is treated differently in the guideline, so this is our own bar, not a claim of conformance. The second is the golden comparison. We keep 88 reference slides, drawn for nine made up brands and our own two, and every proposed change draws them again. On the same kind of machine, a change fails if more than 0.01 percent of a slide's pixels move by more than 16 of 255 colour levels.
What happened to us. The automatic checks on the new engine read 91 test slides and reported 30 cases of low contrast. None came from the engine. They came from our own designs: a slide counter and a timeline label had ratios between 1.00 and 4.48 to 1. We fixed the designs, and the counter now measures between 4.60 and 16.33 to 1. To see whether the golden test would really catch a mistake, we undid that fix on purpose: 24 of the 88 slides failed, and each failure named the brand, the design and where on the slide the change was. We also drew the references on two different kinds of computer, and all 88 images came out identical. A rule in the test itself says that when the references are updated on purpose, someone who did not make the change reviews the before and after.
How we compare. A golden test only says that something changed, not whether the change is good. That is why it sits beside a measurement like contrast, which says whether a slide is readable, and a review step, which decides whether an intended change is acceptable.
- before1.00 to 4.48
- counter after the fix4.60 to 16.33
- our bar4.5
Idea 3: prompt caching
What it is. Every call to a language model sends a prompt: instructions, reference material, and then the new question. Often most of that prompt is the same on every call. Prompt caching lets the provider keep the processed start of a prompt for a short time and reuse it when the next call begins with exactly the same content.
Why it matters. Without caching, the same long instructions are processed and paid for as new input on every call. With caching, repeat calls can be faster and cheaper. Anthropic's documentation for Claude sets out the prices as multiples of the normal input price: writing to the cache costs 1.25 times for a cache that lasts 5 minutes, or 2 times for one that lasts an hour, and reading from it costs 0.1 times on most models. A 5 minute entry is refreshed at no extra cost each time it is used.
How it works, in simple words. The reuse only works from the start of the prompt, and only on an exact match. The documentation says a hit needs the cached part to be 100 percent identical, and that changing anything at or before the cache marker gives a different match on the next call. So order decides everything: stable parts first (tool definitions, the system prompt, long reference material), changing parts last (the date, the user's question). If something that changes on every call, like a timestamp, sits near the top, the cache never matches. There is also a minimum: below a certain prompt length, which depends on the model, nothing is cached.
A worked example, in units of the normal input price: suppose 10 calls within a few minutes each send the same 10,000 token instructions. Without caching, that is 100,000 units. With caching, the first call writes 12,500 units and the next nine read 1,000 each, so 21,500 units in total. This is arithmetic from the published multipliers, not a measurement of our own use.
What happened to us. This week we made prompt caching a company standard: every product that calls the Claude API puts its stable content first and marks the end of it for caching. The standard also asks each call to record three numbers the API returns: tokens read from the cache, tokens written to it, and input tokens processed without it. We have not measured any saving yet, and we will not claim one until those numbers exist.
How we compare. Caching does not change the answer. The documentation says the output is identical to what you would get without caching. It changes how much of the question has to be processed again.
What we learned
- A rule needs every route, not only the first one. The AI line was right where we first added it and missing on older routes until we looked for them.
- Add required text in code, not in the model's instructions. A line that code adds once, at the end, cannot be forgotten, rewritten or doubled by a model.
- Test the designs, not only the engine. All 30 low contrast readings came from our own designs, which a change of engine made visible.
- A test is worth what it catches. Undoing a fix on purpose and watching 24 slides fail showed that the golden test works.
- Two copies of one rule drift apart. An internal tool kept a preview copy of our Turkish language rules. When the copy fell behind the standard, an automatic check stopped two deploys of that tool for most of a day, and a one line fix put the copy back in step.
What happens next
- Our products that call the Claude API will move their stable content to the front of each prompt in their own changes, and record the three cache numbers, so a later edition can report a measured result instead of a calculated one.
- A proposed next step for the AI line: look at the second kind of disclosure, metadata inside the image file.
Sources
- Meta, "Labeling AI Generated Images on Facebook, Instagram and Threads" (2024, updated 2025)
- C2PA, Coalition for Content Provenance and Authenticity
- Jest documentation, "Snapshot Testing"
- W3C, "Understanding Success Criterion 1.4.3: Contrast (Minimum)", WCAG 2.2
- Anthropic, Claude documentation, "Prompt caching"