editorbrain 0.55.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,291 @@
1
+ # Measure the reference
2
+
3
+ Numbers first, opinions later. Everything below runs on this computer and needs
4
+ only FFmpeg and FFprobe on PATH, which the EditorBrain media commands already
5
+ require. Nothing is uploaded.
6
+
7
+ Give the reference a short working id, such as `ref-01`; the style gets its
8
+ real name later, once you know what it does. Keep everything in one folder:
9
+
10
+ ```sh
11
+ mkdir -p .editorbrain-local/reference-styles/ref-01
12
+ ```
13
+
14
+ Put the user's file there as `reference.<ext>` without re-encoding it. The
15
+ commands below use `R` for that folder, and the `ffmpeg` commands are run from
16
+ inside it so output files need no escaped paths. Run the EditorBrain commands
17
+ from the workspace folder and give `--out` a relative path inside
18
+ `.editorbrain-local/`: they reject an absolute path, and they refuse to
19
+ overwrite an existing output, so choose a new name when you rerun one.
20
+
21
+ ## 1. Identity and streams
22
+
23
+ ```sh
24
+ editorbrain media inventory --input R/reference.mp4 --out R/inventory.json --details
25
+ ```
26
+
27
+ Record duration, frame rate, resolution, audio streams and the file hash. A
28
+ variable or unusual frame rate, a missing audio stream or a rotated display is
29
+ a fact about this file to keep, not something to normalize away.
30
+
31
+ ## 2. See the whole video
32
+
33
+ One image per minute of video, one frame per second, before any counting:
34
+
35
+ ```sh
36
+ ffmpeg -hide_banner -nostdin -loglevel error -ss 0 -t 60 -i reference.mp4 -an \
37
+ -vf "fps=1,scale=256:-2,tile=10x6" -frames:v 1 overview-000.jpg
38
+ ```
39
+
40
+ For vertical video use `scale=-2:320` so each thumbnail stays readable. Repeat
41
+ with `-ss 60`, `-ss 120` and so on; a single sheet for a long video is too small
42
+ to read. For videos over ten minutes, sample every 5 seconds (`fps=1/5`) for the
43
+ overview and then go back at one per second for the parts that define the style.
44
+
45
+ Decide here which pixels count. If the video sits inside a platform interface,
46
+ a reposter's frame or letterbox bars, note the inner rectangle as fractions of
47
+ the frame, add `crop=` to the filters below, and record it as `analysedCrop`.
48
+
49
+ Decide which seconds count as well. A file saved from an app often ends with a
50
+ card the platform added: a dimmed last frame, a logo, a handle, sometimes after
51
+ one black frame, and its audio can be shorter than its video. Find where the
52
+ edit stops, add `-t <seconds>` before `-i` in the commands below, compute pace
53
+ over that length and record it as `analysedIntervalSeconds`. A logo or handle
54
+ that drifts over the picture is the platform's watermark, not a graphic of the
55
+ edit: leave it out.
56
+
57
+ The opening deserves its own strip, four frames per second across 3 seconds:
58
+
59
+ ```sh
60
+ ffmpeg -hide_banner -nostdin -loglevel error -t 3 -i reference.mp4 -an \
61
+ -vf "fps=4,scale=256:-2,tile=6x2" -frames:v 1 opening.jpg
62
+ ```
63
+
64
+ ## 3. Cuts and pace
65
+
66
+ List every candidate picture change with a low threshold:
67
+
68
+ ```sh
69
+ ffmpeg -hide_banner -nostdin -loglevel error -i reference.mp4 -an \
70
+ -vf "select='gt(scene,0.10)',metadata=print:file=cuts.txt" -f null -
71
+ ```
72
+
73
+ `cuts.txt` holds a pair of lines per candidate: `pts_time` in seconds and
74
+ `lavfi.scene_score` from 0 to 1. The filter sees picture change, not editorial
75
+ intent. A score of 0.5 or more is almost always a clean cut between different
76
+ shots. Below that it can be a jump cut on the same framing (often 0.10 to 0.20),
77
+ a cut into a flat color card (0.15 to 0.30), a dissolve, a fast move, or a word
78
+ changing on screen. So every candidate under 0.5 gets looked at.
79
+
80
+ Look at them in batches. For each candidate compute the source frame number
81
+ `n = round(pts_time × fps)` and tile frame `n - 1` beside frame `n`, four pairs
82
+ per row:
83
+
84
+ ```sh
85
+ ffmpeg -hide_banner -nostdin -loglevel error -i reference.mp4 -an \
86
+ -vf "select='eq(n,115)+eq(n,116)+eq(n,258)+eq(n,259)+eq(n,404)+eq(n,405)+eq(n,536)+eq(n,537)',scale=256:-2,tile=8x1" \
87
+ -frames:v 1 pairs-01.jpg
88
+ ```
89
+
90
+ Each pair reads left to right as before and after. Add a row to `tile` for
91
+ every four more pairs. Classify each candidate as one of:
92
+
93
+ | Class | What the pair shows | Counts toward pace |
94
+ |---|---|---|
95
+ | `cut` | A different shot, or the same framing with a jump in time | Yes |
96
+ | `scene_change` | The subject continues while the background or the whole layout behind it is replaced | Yes |
97
+ | `device` | Same shot with a punch-in, a flash, a whip, or a graphic or card entering | No; record it by name with its time |
98
+ | `caption_event` | Only on-screen text changed | No |
99
+ | `false` | Camera or subject motion, nothing edited | No |
100
+
101
+ Then check the overview sheets once more: a change visible there with no
102
+ candidate near it is a missed dissolve or slow transition. Add it by hand.
103
+
104
+ Compute from the events that count toward pace:
105
+
106
+ - shot lengths as the gaps between consecutive events, with 0 and the duration
107
+ as the ends: count, median, mean, shortest, longest;
108
+ - cuts per minute for the whole file: events ÷ duration × 60;
109
+ - time of the first event;
110
+ - pace by zone, counting events by their time and never splitting a shot: the
111
+ number in the first 3 seconds, the number in the first 10 seconds, and cuts
112
+ per minute for the rest. If the sheets show another obvious change of gear,
113
+ such as a slow last third, report that zone too.
114
+
115
+ Report devices separately as a rate and a list. A video can be slow in cuts and
116
+ busy in devices, and that difference is part of the style.
117
+
118
+ ### Events inside one region
119
+
120
+ When graphics sit over a continuous shot, the whole-frame list misses most of
121
+ what happens. Crop to the region of one element and detect changes there. This
122
+ one watches a 120 by 160 pixel area whose top-left corner is at x=546, y=356:
123
+
124
+ ```sh
125
+ ffmpeg -hide_banner -nostdin -loglevel error -i reference.mp4 -an \
126
+ -vf "crop=120:160:546:356,select='gt(scene,0.05)',metadata=print:file=events-region.txt" -f null -
127
+ ```
128
+
129
+ Run it once per element: a panel, each slot where a chip or label appears, the
130
+ band where captions sit. A flat graphic entering or being replaced scores 0.3
131
+ to 1.0; scores under 0.1 in a region are usually the subject moving behind it
132
+ or a watermark passing. The times go into `devices`.
133
+
134
+ Two uses are worth doing on every talking video:
135
+
136
+ - **The speaker's region.** A change there at the same time as a graphic swap
137
+ is a real cut to another take; a graphic swap with no change there is a
138
+ device. Whole-frame scores cannot tell these apart.
139
+ - **The caption band.** Each strong change is a new card, which gives the
140
+ number of cards and the time each stays up. In the test file a threshold of
141
+ 0.13 separated card changes from noise; over busy footage expect extra hits
142
+ and check them. Then tile one crop per card, taken at the middle of each
143
+ card, to read them all in one image:
144
+
145
+ ```sh
146
+ ffmpeg -hide_banner -nostdin -loglevel error -i reference.mp4 -an \
147
+ -vf "select='eq(n,12)+eq(n,35)+eq(n,54)+eq(n,69)',crop=600:80:60:676,tile=2x2" \
148
+ -frames:v 1 captions-sheet.jpg
149
+ ```
150
+
151
+ Count the words on each card for words per card. Words over the analysed
152
+ length give a speech rate tagged `estimated`, not a measured one.
153
+
154
+ ## 4. Frames to read
155
+
156
+ Chosen moments, up to 12 per call, saved full size with a labelled sheet:
157
+
158
+ ```sh
159
+ editorbrain media sample --file R/reference.mp4 --at 0.5,2,4.4,6.8,9 --out R/frames --sheet
160
+ ```
161
+
162
+ Use sheets to locate moments and full-size frames to judge them. Take at least
163
+ one frame from the middle of every kind of shot and every kind of graphic.
164
+
165
+ A strip around one event shows an entrance or transition frame by frame. This
166
+ one covers 0.8 s starting at 4.0 s at 12 frames per second:
167
+
168
+ ```sh
169
+ ffmpeg -hide_banner -nostdin -loglevel error -ss 4.0 -t 0.8 -i reference.mp4 -an \
170
+ -vf "fps=12,scale=320:-2,tile=10x1" -frames:v 1 strip-4.0.jpg
171
+ ```
172
+
173
+ Count frames in the strip to time a move: at 12 per second each frame is 83 ms.
174
+ Raise `fps` up to the source rate for fast moves.
175
+
176
+ ### Where a graphic sits
177
+
178
+ Positions go into the style as fractions of the frame. For a first reading,
179
+ draw a grid of tenths over a frame and read the edges against the lines; tag
180
+ those values `estimated`:
181
+
182
+ ```sh
183
+ ffmpeg -hide_banner -nostdin -loglevel error -ss 0.5 -i reference.mp4 -frames:v 1 \
184
+ -vf "drawgrid=w=iw/10:h=ih/10:t=2:c=yellow@0.9" grid-0.5.jpg
185
+ ```
186
+
187
+ For the exact edges of an element with a flat fill, dump one row of pixels
188
+ that crosses it, here the row at y=950, and one column the same way with
189
+ `format=rgb24,crop=1:ih:360:0`. Keep `format=rgb24` first: without it a
190
+ one-pixel crop fails on most video:
191
+
192
+ ```sh
193
+ ffmpeg -hide_banner -nostdin -loglevel error -ss 0.5 -i reference.mp4 -frames:v 1 \
194
+ -vf "format=rgb24,crop=iw:1:0:950" -f rawvideo -pix_fmt rgb24 row.bin
195
+ ```
196
+
197
+ `row.bin` holds three bytes per pixel, left to right. With any scripting tool
198
+ on this computer, find the first and last pixel whose color is within a small
199
+ tolerance of the fill; divide by the frame width. Pick a frame where the
200
+ element is a single color, such as a panel before its content appears, and a
201
+ row that no watermark or text crosses. Those values are `measured`.
202
+
203
+ ## 5. Color
204
+
205
+ Sample pixel values with a tool; do not read hex codes off an image by eye.
206
+ First open a full-size frame and pick a point inside a flat graphic area: a
207
+ card background, a caption box, a highlight, the fill of large type. Footage is
208
+ not a color role. This averages a 16 by 16 patch at x=100, y=100 of the frame
209
+ at 2 s into three bytes, red, green and blue:
210
+
211
+ ```sh
212
+ ffmpeg -hide_banner -nostdin -loglevel error -ss 2 -i reference.mp4 -frames:v 1 \
213
+ -vf "crop=16:16:100:100,scale=1:1" -f rawvideo -pix_fmt rgb24 color.bin
214
+ ```
215
+
216
+ Read the three bytes with any hex viewer (`xxd -p color.bin`, or `Format-Hex` in
217
+ PowerShell). Stay away from edges, gradients and compression blocks, and take
218
+ each role twice from different frames. Record where each value was sampled.
219
+ Thin text is too narrow to sample: shrink the patch to fit inside a stroke, or
220
+ mark the color `estimated`.
221
+
222
+ ## 6. Sound, as far as it can be measured
223
+
224
+ ```sh
225
+ editorbrain production audio-check --file R/reference.mp4 --out R/audio.json
226
+ ```
227
+
228
+ That gives integrated loudness, loudness range and true peak for the file. If
229
+ you can listen to the file, a curve over time helps you place what you hear,
230
+ one value every 0.1 s:
231
+
232
+ ```sh
233
+ ffmpeg -hide_banner -nostdin -loglevel error -i reference.mp4 -vn \
234
+ -af "ebur128=metadata=1,ametadata=print:key=lavfi.r128.M:file=loudness.txt" -f null -
235
+ ```
236
+
237
+ Compare it with the events: jumps that land on cuts, a level that drops under
238
+ speech, a rise into the ending. What the music or an effect sounds like is not
239
+ measurable this way. If you cannot listen, skip the curve, say so, and keep
240
+ sound descriptions out of the style.
241
+
242
+ For speech pace, `editorbrain studio prepare --file R/reference.mp4 --out R/audio.wav`
243
+ extracts audio for a speech recognizer already installed on this computer. With
244
+ none available, report words per minute as not measured. Do not send the
245
+ reference's audio to a cloud service unless the user asks for that.
246
+
247
+ ## 7. Text on screen
248
+
249
+ Read sampled frames yourself: that is the primary method for wording structure,
250
+ case and layout. When Tesseract is installed it can add positions for large,
251
+ clean text such as titles:
252
+
253
+ ```sh
254
+ tesseract R/frames/<frame>.jpg stdout --psm 11 tsv
255
+ ```
256
+
257
+ Each row carries a box in pixels; divide by the frame size for normalized
258
+ positions and for text height as a fraction of frame height. It fails on small
259
+ or stylized captions and returns noise on busy footage. Crop to the text area
260
+ first, keep only confident rows, and check what it says against the frame. When
261
+ it fails, estimate positions from the frame and tag them `estimated`.
262
+
263
+ ## `measurements.json`
264
+
265
+ Save one file with what was measured, so the style can cite it and a later
266
+ comparison can reuse it. Keep units in the names and leave out anything you did
267
+ not measure rather than writing zero.
268
+
269
+ ```json
270
+ {
271
+ "schemaVersion": 1,
272
+ "file": { "sha256": "<from inventory>", "durationSeconds": 64.72, "width": 1916, "height": 1078, "fps": 60 },
273
+ "analysedCrop": { "x": 0, "y": 0, "width": 1, "height": 1 },
274
+ "analysedIntervalSeconds": [0, 64.72],
275
+ "events": [
276
+ { "seconds": 1.93, "score": 0.26, "class": "cut" },
277
+ { "seconds": 2.27, "score": 0.15, "class": "caption_event" }
278
+ ],
279
+ "pace": { "events": 26, "cutsPerMinute": 24.1, "medianShotSeconds": 2.2, "shortestShotSeconds": 1.0, "longestShotSeconds": 6.2, "firstEventSeconds": 1.93 },
280
+ "zones": { "first3sEvents": 1, "first10sEvents": 4, "restCutsPerMinute": 24.1 },
281
+ "devices": [{ "seconds": 12.2, "name": "punch-in" }],
282
+ "layout": { "panel": { "x0": 0.076, "x1": 0.924, "y0": 0.584, "y1": 0.899, "measuredAtSeconds": 0.5 } },
283
+ "captions": { "cards": 28, "words": 64, "medianCardSeconds": 0.61 },
284
+ "audio": { "integratedLufs": -14.27, "loudnessRangeLu": 2.2, "truePeakDbtp": -2.38, "listened": false },
285
+ "colors": [{ "role": "card background", "hex": "#FF2EB4", "sampledAt": { "seconds": 2, "x": 100, "y": 100 } }],
286
+ "notMeasured": ["words per minute"]
287
+ }
288
+ ```
289
+
290
+ The numbers in this example come from one test file. They show the shape, not
291
+ values to expect.
@@ -0,0 +1,82 @@
1
+ # Observe the reference
2
+
3
+ Measurement says when things happen. Observation says what happens and how.
4
+ Write `observations.md` as a transcription an editor could rebuild from, not as
5
+ a summary of what the video is about.
6
+
7
+ ## Transcribe, do not summarize
8
+
9
+ For every device that defines the edit, write down what a rebuild needs:
10
+
11
+ - when it starts and ends, and what triggers it: a word, an action, a cut;
12
+ - what each element does: where it enters from, where it holds, how it leaves;
13
+ - how elements overlap in time, and which one leads;
14
+ - sizes and positions as fractions of the frame, not pixels;
15
+ - which layers are sharp, blurred, dimmed or masked;
16
+ - sampled colors by role.
17
+
18
+ "Bold captions pop in" is a summary. "Two-word cards, uppercase, centered at 68 %
19
+ of frame height, cap height 4 % of frame height, the spoken word turns yellow,
20
+ each card scales from 90 % to 100 % in 3 frames at 30 per second and is replaced
21
+ on the next spoken word" is a transcription.
22
+
23
+ State every quantity as an absolute value or a ratio. "Bigger than usual" cannot
24
+ be checked later; "cap height 4 % of frame height" can.
25
+
26
+ ## Say how you know
27
+
28
+ Tag each statement with one of these, and keep the tag when it moves into the
29
+ style:
30
+
31
+ | Tag | Meaning |
32
+ |---|---|
33
+ | `measured` | From a tool: cut time, loudness, sampled color, OCR box |
34
+ | `observed` | Seen directly in a frame you opened |
35
+ | `estimated` | Seen, but the number is your reading: a size, an easing, a duration between sparse frames |
36
+ | `inferred` | Your explanation of why the editor did it |
37
+ | `not_reviewed` | Not examined. This is not the same as absent. |
38
+
39
+ A font is never `measured`: list candidates and the visible traits (width,
40
+ contrast, terminals, weight) and let the style ask for an available licensed
41
+ font with those traits. Easing curves, exact blur radius and grade settings are
42
+ `estimated` at best.
43
+
44
+ ## Coverage checklist
45
+
46
+ Go through every channel and write one of: described, absent in the reviewed
47
+ frames, or `not_reviewed`. A missing line reads later as "nothing there".
48
+
49
+ | Channel | Look for |
50
+ |---|---|
51
+ | Opening 3 seconds | What is on screen at 0 s, first text, first movement, first cut; what promise or question the opening sets up, as a function |
52
+ | Pacing | Zones from the measurements; what shortens or lengthens shots; holds on purpose. When the picture rarely cuts, say whether graphic events carry the rhythm and whether they repeat on a schedule |
53
+ | Framing | Shot sizes, punch-ins and reframes on the same shot, camera move versus editorial zoom |
54
+ | Captions | Position, lines, words per card, case, weight, color, stroke, shadow or box, highlight of the spoken word, entrance and exit, what they avoid covering |
55
+ | Titles and graphics | Headlines, labels, lower thirds, lists, counters, arrows: hierarchy, placement, when they appear |
56
+ | Inserts and b-roll | What kind, how long, what the insert does for the sentence it covers, how dense |
57
+ | Motion | Entrance, hold and exit per element; direction, overshoot, stagger, duration in frames |
58
+ | Transitions | Hard cuts versus devices; which device at which kind of moment |
59
+ | Color and texture | Contrast, saturation, tint, grain, vignette, background treatment |
60
+ | Layout | Margins, safe zones, where the subject sits, what stays fixed between shots |
61
+ | Ending | Last beat, call to action as a function and a placement, how the video stops |
62
+ | Sound | Only what you measured or actually heard: level changes at cuts, music under speech, silence. Suspected effects stay candidates. |
63
+
64
+ ## Read text for structure
65
+
66
+ Use on-screen text to learn structure: how many words per card, where lines
67
+ break, what gets emphasized, how the hook is built. Record the pattern, such as
68
+ "question of six words, then a number, then proof within three seconds", and
69
+ leave the sentences behind.
70
+
71
+ ## Several references
72
+
73
+ Run the measurements for each file. In one table, list each device and whether
74
+ it appears in each reference. What appears in all of them is the style. What
75
+ appears in one is that video's content or an experiment: keep it as an example,
76
+ not as a rule. Report ranges for numbers, such as "median shot 1.4 to 2.1 s".
77
+
78
+ ## Close the step
79
+
80
+ End `observations.md` with three short lists: what defines the style, what
81
+ varied or looked incidental, and what you could not determine. The third list
82
+ goes to the user with the result.
@@ -0,0 +1,80 @@
1
+ # Recreate and compare
2
+
3
+ A written style reaches most of a reference; the rest is found by building,
4
+ comparing and correcting. Do this when the user wants the match checked, on
5
+ their material and within the review mode, tools and spending they already
6
+ approved. It is not required to save a draft.
7
+
8
+ ## Build a short pilot
9
+
10
+ Apply the style to a short stretch of the user's own video through the normal
11
+ edit workflow: the opening plus one typical section is enough. Use their brand,
12
+ their footage and their words. The pilot calibrates the method; it is not a
13
+ remake of the reference, and it never uses the reference's footage, audio or
14
+ text.
15
+
16
+ ## Compare like with like
17
+
18
+ Pair moments by function, not by timestamp: opening card with opening card,
19
+ first caption with first caption, a list beat with a list beat, a transition
20
+ with the same kind of transition. For each pair, sample both frames and put
21
+ them side by side:
22
+
23
+ ```sh
24
+ ffmpeg -hide_banner -nostdin -loglevel error -i ref-frame.jpg -i pilot-frame.jpg \
25
+ -filter_complex "[0:v]scale=-2:720[a];[1:v]scale=-2:720[b];[a][b]hstack" pair-01.jpg
26
+ ```
27
+
28
+ Run the same measurements on the pilot that you ran on the reference
29
+ ([measure](measure.md)) so pacing and loudness are compared as numbers.
30
+
31
+ ## Fidelity table
32
+
33
+ Record one row per axis. This table goes to the user.
34
+
35
+ | Axis | Reference | Pilot | Verdict |
36
+ |---|---|---|---|
37
+ | Pacing | cuts per minute, median shot, zones | same figures | matched, close, different |
38
+ | Captions | position, cap height, words per card, highlight | same | |
39
+ | Graphics and titles | hierarchy, placement, timing rule | same | |
40
+ | Motion | entrance and exit durations in frames, overshoot | same | |
41
+ | Transitions | devices used and where | same | |
42
+ | Color and texture | sampled roles, contrast, grain | same | |
43
+ | Sound | measured levels and their movement | same | or not reviewed |
44
+
45
+ Use four verdicts: `matched`, `close`, `different on purpose` (brand, format or
46
+ footage required it) and `cannot reproduce here` (missing tool, font or asset).
47
+ A difference caused by the user's brand is correct, not a defect.
48
+
49
+ ## Correct with absolute targets
50
+
51
+ - Fix one axis at a time and leave what already matches untouched.
52
+ - State each correction as a value or a ratio. "Cap height 4 % of frame height"
53
+ and "entrance 4 frames at 30 per second, scale 0.9 to 1.0" converge. "A bit
54
+ bigger" and "snappier" swing past the target and back.
55
+ - Re-sample the same pairs after each change. Expect a handful of rounds, and
56
+ stop when the user's budget or patience says so, reporting what is still off.
57
+
58
+ ## Put the result back in the style
59
+
60
+ The values you converged on are the reusable part. Update the style so the next
61
+ edit starts from them:
62
+
63
+ - replace `estimated` numbers with the ones that worked, and say they were
64
+ calibrated on a pilot;
65
+ - move the component from `concept` to `implemented`;
66
+ - record the pilot in `examples.json` by render hash and interval, as the
67
+ [style creator](../../editorbrain/references/style-creator.md) describes;
68
+ - keep `transfer_tested` for after it works on a second, different video.
69
+
70
+ ## Know where words stop
71
+
72
+ Counts, timings, ratios, positions and hex values transfer through text without
73
+ loss. Glow falloff, material feel, the character of a grade and the feel of an
74
+ easing do not: corrections to them oscillate instead of closing. When that last
75
+ part matters, keep the working artifact itself as a private component of the
76
+ style (`styles component extract`, in the style creator) so the next edit
77
+ reuses the exact scene instead of a description of it.
78
+
79
+ Report the table, the remaining gaps and the style's new status. Do not present
80
+ a close match as an exact one.
@@ -0,0 +1,150 @@
1
+ # Turn the evidence into a style
2
+
3
+ A style is the set of documents another agent reads to edit a different video
4
+ the same way. Write it from `measurements.json` and `observations.md` only. Use
5
+ the document formats and commands in the
6
+ [style creator](../../editorbrain/references/style-creator.md); this guide says
7
+ what goes where when the source is a reference.
8
+
9
+ ```sh
10
+ editorbrain styles create <style-id> --name "<descriptive name>"
11
+ editorbrain styles check <style-id>
12
+ ```
13
+
14
+ `create` writes scaffolds: placeholder text marked `STYLE_DRAFT` in `style.md`,
15
+ `effects.md` and `music.md`, and one placeholder component in `style.json`.
16
+ Replace all of it with what the evidence supports, in the language the user
17
+ works in. Delete the `STYLE_DRAFT` line from a document once you have written
18
+ it from evidence; `styles check` warns while a marker remains, which is correct
19
+ for a section you have not been able to fill. Replace the placeholder component
20
+ with the real mechanisms.
21
+
22
+ ## Sort every finding into three bins
23
+
24
+ | Bin | What belongs | Where it goes |
25
+ |---|---|---|
26
+ | Identity | Colors, type, logo, the look of the brand | The user's brand by default. Reference values enter only as `example` tokens, or as `preferred` when the user asked to copy the look. |
27
+ | Method | Pacing zones, caption behavior, how the hook is built, when a graphic or insert appears, motion grammar, how sound follows the cut | The body of the style: `style.md`, `effects.md`, `music.md`, `captions.json`, `rules.json` |
28
+ | This video only | Its topic, words, footage, exact timestamps, shot count, the creator | Nowhere, except as cited evidence |
29
+
30
+ The test for the third bin: would it still be true if the same editor cut a
31
+ video about something else? Exact timestamps and counts fail it. A cue at 35.9 s
32
+ is evidence; "the title enters on the first noun of the promise" is method.
33
+ Numbers in the new edit come from the new script and footage.
34
+
35
+ ## Document by document
36
+
37
+ **`style.md`.** Purpose and fit; the few mechanisms that make the edit
38
+ recognizable; what stays constant; what adapts to topic, script, brand, footage
39
+ and aspect ratio; when not to use it. State the source in one line, such as
40
+ "learned from one 65-second reference supplied by the user", with what was
41
+ measured, estimated and not reviewed. No creator name.
42
+
43
+ **`style.json` tokens.** One token per reusable discrete fact, with its
44
+ strength and a rationale that cites the evidence:
45
+
46
+ ```json
47
+ {
48
+ "pacing.median_shot_seconds": { "value": 2.4, "strength": "preferred", "rationale": "measured median over 22 shots; adapt to the script" },
49
+ "pacing.first_cut_seconds": { "value": 4.3, "strength": "example", "rationale": "measured in the reference; depends on the opening line" },
50
+ "caption.words_per_card": { "value": 2, "strength": "preferred", "rationale": "observed on 14 sampled cards" },
51
+ "color.accent": { "value": "#FF2EB4", "strength": "example", "rationale": "sampled twice; the brand accent applies unless the user asks to copy the look" }
52
+ }
53
+ ```
54
+
55
+ Token names are lowercase, starting with a letter, with `_`, `.` or `-` as
56
+ separators; `styles check` rejects anything else.
57
+
58
+ Use `required` only for something the user stated as a rule. A measurement is
59
+ never required by itself. Brand tokens still take precedence when the style is
60
+ resolved for a project.
61
+
62
+ **`style.json` references.** Cite the reference as evidence without shipping it:
63
+
64
+ ```json
65
+ { "videoId": "local:<first 12 characters of the file hash>", "relationship": "reference_only", "reviewStatus": "agent_reviewed" }
66
+ ```
67
+
68
+ **`style.json` components.** One entry per defining mechanism. Status is
69
+ `concept` until you build it, `implemented` after a recreation you inspected,
70
+ and `transfer_tested` only after it worked on different material and was
71
+ reviewed.
72
+
73
+ **`effects.md`.** For each device: purpose, when it is useful, how to build it,
74
+ timing anchor, what to adapt or omit, how to check it. Give timings in frames
75
+ or milliseconds and sizes as fractions of the frame, each with its tag from the
76
+ observation step. Describe triggers as functions ("on the stressed word of the
77
+ claim"), not as reference timestamps.
78
+
79
+ **`music.md`.** Only what was measured or heard: overall level, loudness range,
80
+ how level moves around cuts and under speech, where silence is used. If nobody
81
+ listened, write that the sound character was not reviewed and leave the choice
82
+ to the user's audio preferences. Never name or describe the reference's track
83
+ as something to reuse.
84
+
85
+ **Captions.** Always describe the caption behavior in `effects.md` and as
86
+ tokens such as `caption.words_per_card` and `caption.position_y`: that is what
87
+ any engine can follow. Add a `captions.json` preset only when both of these
88
+ hold, following [captions](../../editorbrain/references/captions.md) and its
89
+ current version 2 format:
90
+
91
+ - the treatment is one the built-in renderer draws: a box behind the block, a
92
+ karaoke highlight of the spoken word, or a marker under it. Plain text with a
93
+ shadow or stroke, stacked word collages and other treatments have no preset;
94
+ leave them as prose and tokens rather than forcing the nearest mode;
95
+ - the user has a font file they are licensed to use, declared in
96
+ `resources.json`. The preset needs that exact font; do not invent a family
97
+ name or point at a font the workspace does not hold.
98
+
99
+ When it applies, map what you observed:
100
+
101
+ | Observed | Preset field |
102
+ |---|---|
103
+ | Analysed frame size | `referenceSize` |
104
+ | Card position as fractions | `position` |
105
+ | Words per card and line breaks | `chunk.maxWords`, `chunk.punctuation`, `chunk.noEndWith` |
106
+ | Box, karaoke highlight or marker | `mode`, `activeBox` |
107
+ | Entrance scale and duration | `pop.scale`, `pop.durationSeconds` |
108
+ | Areas captions never cover | `forbiddenZones` |
109
+ | Type traits | `font`, through a declared font resource the user has the right to use |
110
+
111
+ Bind color and family to the destination's tokens with `tokenBindings` so the
112
+ user's brand colors apply. If the reference had no captions, say so and add
113
+ nothing.
114
+
115
+ **`rules.json`.** Optional. Use it for the few checks that can be verified on a
116
+ finished video, following [style rules](../../editorbrain/references/style-rules.md):
117
+ a safe zone, a frame that must show text by a given second, a loudness target.
118
+ Keep them `preferred`.
119
+
120
+ **`techniques.json`.** Optional. Its anchors are literal phrases searched in the
121
+ new script, so add a technique only when the user's own scripts will contain a
122
+ recurring phrase that should trigger it. Never use a phrase from the reference.
123
+
124
+ **`examples.json`.** Leave the array empty, or record entries that point to the
125
+ reference by hash and time interval with a note of what they show, for example:
126
+
127
+ ```json
128
+ { "id": "opening-card", "purpose": "one-word color card on the claim", "source": { "kind": "local_reference", "sha256": "<file hash>" }, "startSeconds": 1.9, "endSeconds": 4.3, "reviewStatus": "agent_reviewed" }
129
+ ```
130
+
131
+ Do not copy frames or clips into the style, and do not upload them. The check
132
+ accepts an empty list with a note that no pilot is recorded; that is accurate
133
+ until step 5.
134
+
135
+ **`resources.json`.** Declare what the style needs as requirements: "a condensed
136
+ heavy sans the user is licensed to use", "a short percussive hit from the user's
137
+ sound library". Nothing from the reference is a resource.
138
+
139
+ ## Before saving, reread it as a stranger
140
+
141
+ - Could an agent with only these documents and a different video rebuild the
142
+ edit's behavior?
143
+ - Is every number tagged, and does every `measured` value appear in
144
+ `measurements.json`?
145
+ - Did any sentence from the reference, any creator name, or any instruction to
146
+ reuse its footage or music slip in? Remove it.
147
+ - Do the documents say what was not reviewed?
148
+
149
+ Then run `styles check`. A valid check confirms structure only. It does not
150
+ confirm that the style matches the reference.