mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78897a1539 |
No files matched your search
+25
-12
@@ -40,20 +40,32 @@ export const surprisePack = check<FileFacts>({ id: "surprise", text: "one earned
|
||||
if (!s.surprise?.trim() || !MOMENT.test(s.surprise)) found({ says: `${path.basename(f.path)}'s surprise isn't named with its moment ("12.5 s: the dog barks on the punchline")`, fix: `raea goal seen ${f.path} "..." --surprise "SECONDS s: what it is"` })
|
||||
})
|
||||
|
||||
/** what the second opinion is asked of a whole cut, picture and sound (`raea ask`, clef-omni) */
|
||||
/** what the second opinion is asked of a whole cut, picture and sound (`raea ask`, clef-omni): pointed checks, each
|
||||
* a yes when the fault is there. Never "does it look good": asked whether Dutch's plain boxes looked designed, clef
|
||||
* said "strong". 12-01, Shane: "you just have to have them be more specific or pointed like giving it some list of
|
||||
* design checks to answer ... a few catch all checks on visual and audio design"; "the agent itself is really
|
||||
* responsible for design" */
|
||||
export const SECOND = [
|
||||
"Do the on-screen graphics (captions, cards, badges, the end card) look designed for this brand, at the level of a professionally produced social ad, rather than plain boxes of text?",
|
||||
"Is every word that matters large, sharp against what is behind it, and on long enough to read?",
|
||||
"Is the voice clear over everything else, with music and effects marking moments rather than filling space?",
|
||||
"In the first two seconds, is there a picture, a word or a sound that would make this audience stop?",
|
||||
"Is the frame free of clutter throughout: never more than two separate text boxes at once, and no text over a person?",
|
||||
// picture
|
||||
"Are three or more separate text boxes or cards on screen at the same moment at any point?",
|
||||
"Do the captions, cards and badges all look like the same plain rounded box, with nothing but colour telling them apart?",
|
||||
"Is any text too small or too cluttered to read at a glance on a phone?",
|
||||
"Does any text or graphic cover a person's face, or sit cut off at the edge of the frame?",
|
||||
"Is a product or an app shown only as a box of text, and never as the real product or its screen?",
|
||||
"Does the end card hold more than a logo, one line and one thing to do?",
|
||||
"Is there a rendering glitch: a black or frozen frame, torn or blocky video, or a flash?",
|
||||
// sound
|
||||
"Is a voice muffled, distant or hard to understand, or is music louder than the person speaking?",
|
||||
"Is there harsh, shrill or clipping sound, or music that starts or stops abruptly?",
|
||||
"Is there a stretch of dead air, where nothing is said and nothing is heard?",
|
||||
"Is the same sound effect used in the same way more than three times?",
|
||||
]
|
||||
type Opinion = { says?: string; value?: number }
|
||||
type Opinion = { choice?: string; says?: string }
|
||||
|
||||
/** a second opinion on a cut, from clef watching and hearing all of it (12-01, Shane: "the agent itself should be
|
||||
* watching and revising itself always and use clef omni as a secondary opinion or catch all"): each question's grade,
|
||||
* lowest first, kept beside the file (FILE.second.json) for the file as it is now. It's an opinion, never the look:
|
||||
* on 12-01 it graded Dutch's plain boxes "strong". Null where it couldn't be asked. */
|
||||
* watching and revising itself always and use clef omni as a secondary opinion or catch all"): each check, the
|
||||
* faults it found first, kept beside the file (FILE.second.json) for the file as it is now. Null where it couldn't
|
||||
* be asked. */
|
||||
export function second(file: string, ask = askSecond): string | null {
|
||||
const [st, kept] = [statSync(file), `${stem(file)}.second.json`]
|
||||
const stamp = `${Math.round(st.mtimeMs)} ${st.size}`
|
||||
@@ -63,11 +75,12 @@ export function second(file: string, ask = askSecond): string | null {
|
||||
} catch {}
|
||||
const got = ask(file)
|
||||
if (got.length !== SECOND.length) return null
|
||||
const says = got.map((o, i) => ({ q: SECOND[i], says: o.says ?? "no answer", value: o.value ?? 0 })).sort((a, b) => a.value - b.value).map((o) => ` ${o.says}: ${o.q}`).join("\n")
|
||||
const rows = got.map((o, i) => ({ q: SECOND[i], found: o.choice === "yes", says: o.says ?? o.choice ?? "no answer" }))
|
||||
const says = [...rows.filter((r) => r.found), ...rows.filter((r) => !r.found)].map((r) => ` ${r.found ? "FOUND" : "clear"} (${r.says}): ${r.q}`).join("\n")
|
||||
writeFileSync(kept, `${JSON.stringify({ render: stamp, says }, null, 1)}\n`)
|
||||
return says
|
||||
}
|
||||
function askSecond(file: string): Opinion[] {
|
||||
const r = spawnSync(RAEA, ["ask", file, ...SECOND, "--grade", "--json", "--brief", "none"], { cwd: path.dirname(file), encoding: "utf8", maxBuffer: 1 << 26 })
|
||||
const r = spawnSync(RAEA, ["ask", file, ...SECOND, "--choose", "yes,no", "--json", "--brief", "none"], { cwd: path.dirname(file), encoding: "utf8", maxBuffer: 1 << 26 })
|
||||
return String(r.stdout ?? "").split("\n").flatMap((l) => { try { const o = JSON.parse(l); return o.answer ? [o as Opinion] : [] } catch { return [] } })
|
||||
}
|
||||
+1
-1
@@ -262,7 +262,7 @@ export async function main(argv: string[]): Promise<number> {
|
||||
const full = kindOf(path.resolve(file)) === "video" ? media.looks(path.resolve(file)) : []
|
||||
// on raea cloud (where the critic is clef), a second opinion on the whole cut with its sound: never the look itself
|
||||
const op = full.length && critic() === "clef" ? second(path.resolve(file)) : null
|
||||
if (op) console.log(`a second opinion (clef watched and heard all of it; lowest first; weigh it, then look yourself):\n${op}`)
|
||||
if (op) console.log(`a second opinion (clef watched and heard all of it and answered a list of checks; a FOUND is a fix or a reason it's wrong; how it looks is still yours to judge, on the frames):\n${op}`)
|
||||
console.log(`${sheet}\n${full.join("\n")}\nlook at every frame of the sheet for what happens, and open each full-size frame for how it looks (type, captions, cards, the end: beside a reference ad's frame, not from the sheet), then: raea goal seen ${file} "what you see and would change"${full.length ? ' --look "its design at full size, beside a reference, and what you changed"' : ""}`)
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -24,12 +24,13 @@ test("a look at the sheet alone doesn't pass: the design is judged at full size,
|
||||
expect(unjudged({ look: "Captions are 72 px bold with the spoken word in yellow, as the reference's; the offer is one pill, not three boxes." })).toBe(false)
|
||||
})
|
||||
|
||||
test("the second opinion is asked once for a file as it is, lowest grade first, and again after it changes", () => {
|
||||
test("the second opinion is asked once for a file as it is, the faults it found first, and again after it changes", () => {
|
||||
const f = put(project({}), "out/cuts/acme_dog_hook1_v1_9x16.mp4", readFileSync(CLIP))
|
||||
let asked = 0
|
||||
const ask = () => (asked++, SECOND.map((_, i) => ({ says: `grade ${i}`, value: SECOND.length - i })))
|
||||
const ask = () => (asked++, SECOND.map((_, i) => ({ choice: i === 3 ? "yes" : "no", says: i === 3 ? "yes (0.81)" : "no (0.9)" })))
|
||||
const says = second(f, ask)!
|
||||
expect(says.split("\n")[0]).toContain(`grade ${SECOND.length - 1}`)
|
||||
expect(says.split("\n")[0]).toBe(` FOUND (yes (0.81)): ${SECOND[3]}`)
|
||||
expect(says.split("\n")[1]).toStartWith(" clear")
|
||||
expect(second(f, ask)).toBe(says)
|
||||
expect(asked).toBe(1)
|
||||
touch(f, 60)
|
||||
|
||||
Reference in new issue
Block a user