Repository navigation
fix(content): put a number, name or quote the brief's sources don't have as a placeholder (brief rules 2026, PR 1) - #1535
Merged
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]>
This was referenced Oct 26, 2026
gkhngyk
approved these changes
Oct 26, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
What I checked:
- What the guard knows. It knows what the brief's prompt gives as words: the brand's name, industry and description, the page's title, the prompts, fan-outs, Search Console queries and live headings kept, the length, and this year.
- The rest of the prompt has no facts to lose. The page-type and site-type lines have no numbers or names.
- The cited pages' and the live page's addresses aren't words, as
sourceWordstreats them for the writer. - So a figure or name the model was given stays. The tests cover each input, numbers from a prompt and a fan-out, a count, this year and Turkish percentages.
- Where it runs.
- Goal, audience and key points are read as text. Headings are read as page headings are.
- A keyword is dropped when the guard would change it.
- It runs before the cut, and the cut never leaves half a placeholder.
keyPointswrapsguard.text, somap's index isn't passed asheading.
- What it catches.
- A number with a unit, or of two digits or more. Numbers are read first, so a number inside a quoted question goes too.
- Names by the writer's cues.
- Quotes of four words or more.
- The writer. It reads the brief as given (
briefTextis in bothknownandpeople). A rebuilt brief now adds nothing beyond its inputs, apart from the gaps below. - Cost. Same prompt, same single call. The guard runs after the charge.
- Merge.
- Server only. Two commits on the old main; it merges cleanly on main (4085418). No migration.
- Nothing changes on Vercel at merge. Rebuild outline changes with the next API deploy. Edit brief stays unguarded, as described.
Follow-ups:
- A given address loses its numbers (
server/src/lib/content-brief.js:326).placeholderNumbersreads the whole text, addresses too. The prompt gives the cited pages and the live page by address (:376,:389).- A key point that names one with a number in its path gets cut: "…/thread/123" becomes "…/thread/[figure, source]", and "/2024/05/…" loses both numbers. That drops a fact the brief was given, and the address no longer works.
- It's rare today, since the brief plans no links. The 2026 rules add links. #1538's gate then reads the cut address as one nobody gave: its case
b2b-de-solution_pagecites ".../thread/123". - Fix: run both guards on the text between addresses (
(?:https?:\/\/|www\.)\S+) and leave the addresses as written. Add a test with a cited ".../thread/123".
- A search in quotes, reworded, becomes a person's quote (
:329).- The prompt lists the fan-outs in quotes (
:383), so the model quotes searches in key points. - One of four words or more that isn't word for word in the inputs reads as a quote. On the city-bike case,
Compare "derailleur vs internal gear hub" for city ridingbecomesCompare [quote from a real person, with its source] for city riding. The writer is then asked for a quote from a real person. - Fix: read a quote whose every word is in what the brief was given (
isKnownon each word againstpeople) as a phrase to target, not a person's words. One next to speech stays a quote. Add a test with a reordered fan-out.
- The prompt lists the fan-outs in quotes (
- A quoted question makes its words known for the whole text (
:327-328).askedInadds the question's words to the names and quotes the text may have:Answer "Is Dr. Jane Doe right about burr grinders?"keeps Dr. Jane Doe. So does any "Dr. Jane Doe" elsewhere in the same key point. The writer then takes the name as given for the whole page.- A question someone is said to ask passes too:
"Why did nobody tell me sooner?" says one customer.Without the exception, that's a quote, and it would get the placeholder.
- Fix: leave a quoted question out of the quote check only. Don't add its words to the known set.
- Blank its two marks in a copy, read
peopleEditson the copy withpeople, and apply the edits to the text (the places don't move). - Keep a question next to speech (the guard's
SPOKEN_AFTER/SPOKEN_BEFORE) as a quote. - Test a name inside a quoted question, and a question followed by "says".
- Blank its two marks in a copy, read
- A role and a name in a heading pass, and then reach the page's body (
:333).- Heading mode skips role cues, as page headings do, so "What CFO Anna Weber needs from a forecast" keeps the name. #1538 notes this.
- On a page, the miss costs one heading. Here it goes further: the writer's
peopleincludes the brief, so "CFO Anna Weber explained…" in the body passes too. - Fix:
- Read role cues in a brief heading unless it's in title case (most words after the first capitalised). Title case is the case the trade-off is for ("Questions A CTO Asks Before Switching").
- For title case, the writer could leave the brief's headings out of
people.
7 of 12 tasks
4 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brief rules 2026, PR 1 of 10: guard the brief's numbers, names and quotes. This PR is cut from
mainand touches the server only.The Content Editor's writer reads the brief as part of what it was given. The numbers in the brief, and the people and quotes it names, are in the writer's "known" lists (
content-writer.js:knownNumbers(…, brief, …)andknownPeople(…, brief, …)). Rebuild outline asks the model to "use only the facts given", but nothing checked what it wrote. A made-up "73%" or "Dr. Jane Doe" in a key point would pass the writer's own guards (CE-033, CE-044) and could end up on the page.Now the brief goes through the same guards as a written page before it is cut and saved:
briefGuardincontent-brief.jsknows only what the brief was built from:[figure, source], an unknown person's name[name of a real person], and an unknown quote[quote from a real person, with its source]. These areplaceholderNumbersandguardPeople, as the writer uses them.guardPeople's heading mode, as page headings do.Answer "Which espresso machine should I buy?"is a question to answer, not a person's words. A quote that isn't a question still goes.[figure, so.What changes for the person:
Not in this PR: Opportunities › Generate Brief (
routes/content.js,generateBriefForOpportunity) has the same gap. The writer falls back to that brief when the draft has none. It is a separate feature with its own quota, so it gets its own PR.This is the first step of the plan for the 2026 brief rules and CE-EVAL. Next comes the brief eval (CE-EVAL-001), which will record a baseline of today's briefs before the brief gains new fields.
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
cd server && npx vitest run src/lib/content-brief.test.js.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:
npm run format(only this PR's two files),npm run lint(clean) andnpm test(2,743 passed and 1 skipped as onmain; 7 files that timed out under memory pressure passed when rerun alone: 145 tests).Tests:
A pre-push review ran.
🤖 Generated with Claude Code