Repository navigation
feat(content): plan the page in the brief behind CONTENT_BRIEF_RULES: essentials, angle, proof to gather, fan-outs left out and freshness, with Brief › Your input as sources (brief rules PR 5) - #1543
Conversation
…ave as a placeholder, so the writer can't take it as given Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aceholder in half, and test the audience, names in headings and Turkish percentages (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s as a rubric, checks anyone can repeat with a gate on anything the brief wasn't given, a judge model's quoted scores, and a script that records them (CE-EVAL-001, brief rules PR 2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e by line; record the model's own answers and check them again in the test; read quotes in any marks, shortened, three words at least, in one line the judge saw; version the prompt under Quality's phase and the schema; keep a partial run apart; compare addresses by host and path (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ief behind CONTENT_BRIEF_RULES, with the data numbered, the page type's formats and the rules in effect; keep the facts' sources by kind and ref, cut to the web's version 2 limits and fit under 64 KB (brief rules PR 4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…umber only the cited pages as sources, take the rules beside the sources, and read version 2's answers and facts in the brief eval (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…N schema only, so an off-list value never fails a charged call; take out only the page numbers given; match a fan-out as listed before its unquoted form; ask the judge for H2 lengths only (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its essentials, angle, the brand's own proof to gather, the fan-outs left for another page and freshness by page type, with Brief › Your input numbered as sources (brief rules PR 5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nt the eval's fan-out coverage over the fan-outs the brief keeps, and compare the input kind with the web's (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on-plan # Conflicts: # server/.env.example # server/src/lib/content-brief-eval.js # server/src/lib/content-brief-eval.test.js # server/src/lib/content-brief.js # server/src/lib/content-brief.test.js # server/src/scripts/eval-brief.js
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good, with follow-ups.
What I checked:
-
With
CONTENT_BRIEF_RULESoff.- The input isn't read:
readDraftInputsisn't called, andinputSources(null)is[]. - The prompt is as before: the new line is an empty string, and the blank line after the cited pages stays. The pinned hashes hold this.
- Version 1's schema drops the page fields, so no
versionis written.
- The input isn't read:
-
Brief › Your input.
- It's read by the draft, which the rebuild has already matched to the brand, after the route's access check. It's read only at Quality phase 2 or later (
readDraftInputsreturns null below that). - A failed read fails the rebuild before anything is held or charged.
- It's read by the draft, which the rebuild has already matched to the brand, after the route's access check. It's read only at Quality phase 2 or later (
-
The input in the prompt. It's listed as the writer lists it (
inputSources):- one line per item, with double quotes made single;
- cut: experience to 4,000 characters, at most 5 tables of 3,000, 10 Ansvisor rows and 10 quotes;
- the notes left out.
It's numbered after the pages, from the same
briefNumberedlist the read uses. The guard knows its words throughsourceWords, as the writer's does, the note aside. -
The stored brief and the editor. Each field is written as
draftBriefSchemaon main reads it, so nothing is dropped on read:tldrandangleare at most 500 characters, or null;proofhas at most 6 items, each a listed kind and awhatof at most 300 characters;leftOuthas at most 20 fan-outs the person kept, as listed, none an H2 answers;freshnessis the object, or null;- an input source is
{ kind: 'input', ref, label ≤ 300 }, a kind inSUGGESTION_SOURCE_KINDS.
The contract test now compares every limit and kind. Edit brief keeps these fields, and a brief stored before reads as it did.
-
The model's answer.
- An off-list proof kind or an empty
whatis dropped. - A left-out item that isn't a kept fan-out is dropped.
- A missing key fails the call as in #1540: it's charged, nothing is saved, and the brief stays as it was.
- An off-list proof kind or an empty
-
The AI budget. Still one call. The input's tokens are charged by what it used, through the same hold and release.
-
The work.
fanoutMatcherruns once per left-out item, and the model's answer bounds the list. The guard reads the input's words once (knownPeople), so no input makes it slow. -
The fit. The fan-outs left out go first, then the facts' sources, then the facts. The test fails without the new first step.
-
Tests. The page plan, input and flag-off tests fail without the change. The input test reads through the real
inputSources. -
Merge.
Follow-ups (before PR 10 compares version 2 with the baseline):
- Coverage rises as the brief leaves more out (
server/src/lib/content-brief-eval.js:180-190,:335,:346).fanoutCoveragenow counts only the fan-outs the brief keeps. A brief that leaves 3 of 4 out and answers the last one scores 1.0. One that leaves them all out is null, and drops out of the mean.summarizedoesn't add upleftOut. So the headline coverage of version 2 can beat the baseline's without the sums showing why.- Fix: in
summarize, add the fan-outs left out and keep coverage over all fan-outs next to the kept-only figure. Test a case that leaves every fan-out out.
- The new page lines have #1540's quote problem (
content-brief-eval.js:112-140).- The judge sees "TL;DR: ", "Angle: ", "Proof to gather (kind): " and "Freshness: ", and the quote check reads the text without them. A quote that starts with its label, like
Freshness: an "Updated" line, scores 0. - Fix: the same as #1540 item 1: read quotes against the line with its label.
- The judge sees "TL;DR: ", "Angle: ", "Proof to gather (kind): " and "Freshness: ", and the quote check reads the text without them. A quote that starts with its label, like
- The schema still asks for a cited page only (
server/src/lib/content-brief.js:241).- The system prompt now says a fact's
sourcecan be one of the person's input items. Thesourcefield's description, which the model reads in the JSON schema, still says "the cited page to check it against". - Fix: word it as the system prompt does: "The number (S1…) of the person's input that gives it, or of the cited page to check it against, or null."
- The system prompt now says a fact's
- Nothing reads
leftOutyet (content-brief.js:545;server/src/lib/content-writer.js:228).- The writer's
briefTextreads only version 1's fields and still gets every kept fan-out. The editor's fan-out rules still count a left-out fan-out as missing. - Before the flag goes on, a later PR in the series should have the writer and Rules read it. Otherwise the brief leaves out what the page and the checks still ask for.
- The writer's
Summary
Brief rules 2026, PR 5 of 10: the brief plans the page itself. It adds the essentials at the top, the angle, the brand's own proof to gather, the fan-outs left for another page, and freshness. It also reads Brief › Your input as sources.
mainmerged in. This PR's own change is its commits after feat(content): plan each section's answer, format and facts in the brief behind CONTENT_BRIEF_RULES, with the cited pages numbered and the rules in effect (brief rules PR 4) #1540's branch.CONTENT_BRIEF_RULES(off by default). No migration.web/src/lib/content/brief.ts, now onmain).What the model is asked
outlineSchemaV2gains page-level fields:tldr: what the page's essentials at its top must state, as a note to the writer.angle: what this page can show that commodity pages can't.proof: up to 4 pieces of the brand's own proof to gather. Each is one ofexperience,data,case,testorquote, plus what to gather. The kind is an enum in the JSON schema only, as PR 4's keys are, so an off-list kind never fails a charged call.leftOut: fan-outs from the list that belong on another page, so the page keeps to one topic.datedPoint: what the page should date (a price, a figure with its month), or null.SYSTEM_PROMPT_V2gains a line for each of them. It also says:sourcecan be one of the person's input items;kindis a key, likeformatandsourceType.Brief › Your input
readDraftInputs, Quality's second phase) and lists it after the cited pages, numbered the same way:S2 "Returns by model": Their own data, a table: ….{ kind: 'input', ref: 'data:1', label }, as feat(content): read and keep the brief's version 2 through Edit brief (brief rules PR 3) #1539's sample has it.The answer, as kept (
pagePlan)tldr,angle, each proof'swhatanddatedPoint:whatis dropped, and 6 at most are kept.PAGE_TYPE_FRESHNESSincontent-page-types.js):datedPointis the model's. With neither, freshness is null.fitBriefnow drops the fan-outs left out first, then the facts' sources, then the facts.The eval
fanoutCoveragecounts only the fan-outs the brief keeps. A fan-out left for another page on purpose isn't scored as missed.leftOutreports how many were left out.Cost with the flag on
Related issue
Roadmap CE-EVAL-001 / brief rules 2026 (no GitHub issue).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
CONTENT_BRIEF_RULES=trueandCONTENT_QUALITY_PHASE=2, and use an AI key.content_drafts.brief. It has:tldr,angleandproof;leftOut, listing only kept fan-outs;freshnesswithupdatedLineandyearInTitleset totrue;sourceis{ kind: 'input', … }.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): no web changesyarn typecheckpasses (run fromweb/): no web changesyarn format:checkpasses (run fromweb/): no web changesServer checks, run locally on this branch after #1540's merge with
main:npm run format: no changes.npm run lint: clean.npm test: 223 files, 2,796 passed, 3 skipped (the eval's recorded-baseline tests).Tests:
fitBrief: the fan-outs left out go first when that is enough.main. It compares every limit and kind withbrief.ts, includingPROOF_KINDS, and checks the input source kind against the web'sSUGGESTION_SOURCE_KINDS.Pre-push review
A review agent read the change before the push. It confirmed:
brief.ts;leftOutvalues are handled: non-strings, case, quotes, duplicates, and fan-outs an H2 answers;Fixed from it:
inputkind;Left for later: none of the eval's cases has Brief › Your input yet, so planning from the person's input isn't scored. PR 10 can add one.
🤖 Generated with Claude Code