Skip to content

feat(content): have the Content Agent write from the kept sources and name them (CE-033, server) - #1398

Merged
gkhngyk merged 42 commits into
ansvisor:mainfrom
cihan-gyk:feature/editor-sources-server
Oct 23, 2026
Merged

gkhngyk merged 42 commits into
ansvisor:mainfrom
cihan-gyk:feature/editor-sources-server

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Content Editor v1.1, CE-033 (server): the Content Agent writes from the sources the Sources tab keeps, numbered, and each suggestion says which ones it used and the words each supports. And no number without a source.

Stacked on #1397 (CE-032/034), which is stacked on #1396 → #1395 → #1394 → #1393 → #1387. Merge after them. Migration 00248, applied on the dev DB.

The web half, with "Based on" chips, ¹ ² marks and "built from N of your sources", follows as its own PR, stacked on this one.

The data, numbered (content-sources.js)

  • Every run lists the kept sources with an id the model cites by: S1 Prompt: "…", S2 Fan-out: "…", S3 Cited page: https://…, S4 Search Console query: "…". This covers Fix open rules, Start with Agent (new page and suggestions) and Rewrite the whole page.
  • Refs are what the Sources tab keys its rows by, so the editor finds each source there: a prompt's id, a normalized query, a page's address.
  • Fix open rules now takes the kept sources (fixRulesInput.sources, optional for an older editor). It reads the brand's prompts for their ids (readPrompts, scoped through prompt_sets).
  • The model returns sources (ids) and marks ({ words, source }) per suggestion. Rewrite returns sources.
  • Kept per row in content_draft_suggestions (00248):
    • sources: [{ kind, ref, label }], at most 8;
    • source_marks: [{ start, end, source }], at most 12. Offsets are into a replace's after_text, or into an insert's HTML read as text (cheerio's .text(), which is a browser's textContent).
    • A rewritten page keeps its sources, with no marks.

No number without a source

  • The model sees a source's words (a question, a search, an address), never what a cited page says, so a mark alone proves nothing.
  • A number the agent adds must be in one of these:
    • the page (all its text, tables and HTML blocks too);
    • the brand's description, or the brief;
    • the rules and the person's own rules (the keywords rule's "2026");
    • today's date;
    • a source's own words. Then it's marked to that source, unasked.
  • What isn't a claim:
    • a lone digit used as a count ("3 ways", "Step 2"). One with %, ×, a scale or a currency sign counts;
    • digits inside a [placeholder].
  • Without a source:
    • a suggestion with such a number is not kept;
    • a page written whole (Start's new page, Rewrite) gets [figure, source] in its place;
    • script, style, code and similar text is left alone.
  • Insert text is read node by node, so "Option 1" and "2 seats" never read as 12.
  • Source numbers the model writes into the words ("(S2)", "[S1, S3]") are taken out. "Amazon S3" stays.

Prompts

  • Each prompt lists the numbered data.
  • They tell the model it doesn't see what a cited page says, and to name its sources in sources and mark the words, never write "S1" in the page.
  • They tell it to add a number only from the page, the brand, the rules or the data's own words; otherwise a placeholder.

Related issue

Content Editor v1.1 (Drive spec, 2026-10-23): CE-033, server half, and the agent brief's hard rule "Nothing is made up". No GitHub issue.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Apply 00248.
  2. Run Fix open rules on a draft with sources kept, from the web PR (or post sources to POST /api/content-drafts/:id/suggestions). The prompt lists S1….
  3. The suggestions' rows carry sources and source_marks.
  4. Ask for a dated data point. A figure that is in none of the data isn't kept: the run leaves fewer suggestions, or a placeholder.
  5. Rewrite the whole page. Its row has sources, and a figure it made up reads [figure, source].

Tests:

  • content-sources.test.js:
    • numbering and refs, and the model's list;
    • sources and marks: marked first, overlaps, unknown ids, tags in the words, the caps (8 / 12);
    • a number from a source's own words marked to it unasked; an invented one refused, marked or not;
    • inserts read node by node; placeholders, counts and scales;
    • today; stripping "(S2)" but not "Amazon S3";
    • placeholders in a page (sign and unit with them; code, attributes and kept tables left alone).
  • content-agent.test.js:
    • a kept suggestion's sources and marks (one auto-marked from a fan-out);
    • invented figures dropped even when marked;
    • a rule's number allowed;
    • "(S2)" taken out of the words;
    • an insert's mark by its text;
    • Fix's prompt lists the numbered data (prompts first) and saves the rows' sources.
  • content-writer.test.js:
    • the numbered prompt;
    • Start's new page gets placeholders for 15 g / 250 g, which no data has;
    • optimize suggestions keep their sources;
    • Rewrite keeps its sources and puts a placeholder for an invented 87% (the kept table's 1:16 stays).

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • npm run lint passes (run from server/)
  • npm test passes (run from server/) — 2,142 tests
  • Changes are focused — one concern per PR
  • Migration added, bash supabase/build-schema.sh run, supabase/schema.sql included

🤖 Generated with Claude Code

cihan-gyk and others added 17 commits October 23, 2026 02:24
The workspace's one AI budget (Improve, the Content Editor's AI and the
Action Center's task writer) had no meter: the first sign of it was an
"AI usage is used up" error. Migration 00242 records what each AI call
was for (prompt_improve_usage.feature, backfilled) and sums the period's
spend by feature (ai_usage_by_feature). GET /api/billing/ai-usage
returns the shares of the plan's budget, and the Billing page shows the
share used, when it resets and what used it, with Agent Chat noted as
running on the workspace's own key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The workspace's AI budget was checked by reading the period's spend; the
call's cost was written once the model answered. Calls running at once
(two tabs, a teammate, an Action Center sweep) all read the same spend
and all ran past the budget. 00243's reserve_ai_usage takes a
per-organization lock, reads the spend with the calls in flight, and
holds the call's estimated cost; reserveAiBudget turns the hold into the
real cost or releases it. Improve, the brief rebuild, Apply rules with
Agent, Start Agent and the Action Center task writer use it in place of
enforceImproveQuota, which goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes:
- Apply rules with Agent and Start Agent charge an answer the provider
  billed but that missed the schema (NoObjectGeneratedError), as Improve,
  the brief and the task writer do; before, the hold was let go and the
  call ran free.
- A call holds the org's median cost over its last 20 calls this period,
  never less than the model's typical cost, so calls in flight pass the
  budget by far less.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Apply rules with Agent makes at most 8 small edits a run, which can't
bring a long page to its Length (about 2% a run on prod). The Content
Agent can now rewrite the whole page in one background call, left as ONE
suggestion (kind 'page', migration 00247) to compare and accept or reject:
- POST /api/content-drafts/:draftId/rewrite, through Start Agent's claim,
  budget hold and background run;
- passages AI quotes today, tables, images, quotes and HTML blocks go to
  the model as [[KEEP n]] lines and come back as they were; a rewrite that
  drops one fails the run;
- one H1, only the page's own links and the ones offered, the editor's
  tags; the page as it was is kept on the suggestion (before_html).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Length

Review fixes:
- Kept blocks are described under the page (a quoted passage's words, a
  table's rows, an image's alt) and their text counts toward Length, so a
  rewrite aims at the whole page's length; with Length off it keeps the
  page's own. A kept H1 stays first, and the page's language is kept.
- The answer is taken out of a code fence, text left at its root goes in
  paragraphs, and an answer in Markdown fails the run.
- The page's own links stay exactly as written (query and anchor too).
- Kept blocks go back untouched (an empty table cell stays), only the
  page's first H1 counts as its title, a page that writes "[[KEEP" gets
  markers of its own, and a page that is only kept blocks isn't sent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…compare it

The Rules tab opens with the agent's two ways to meet its rules: Apply
rules with Agent (small edits, up to 8 a run) and Rewrite the page to
these rules (the whole page as one change). The rewrite is recommended,
with a one-line reason, when the page is more than 30% off its Length or
4 rules or more are open.

A rewritten page comes back as one suggestion with its own bar over the
page: the characters before and after and the agent's reason, Compare
(the page and the rewrite side by side), Accept (History keeps the page
first), Reject, and Undo. A page that changed since the agent read it
isn't written over. The page waits for the rewrite with its own steps,
and a failed rewrite's Try again rewrites again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes:
- A page is compared with the one the agent read by its words, with a
  space between blocks, so stored line breaks and lists don't read as a
  change (Accept and Undo were refused on imported pages).
- One agent run at a time from the page; a rewrite never starts before
  the locked passages are read, and sends the editor's own locked keys.
- Accept holds the page still from the start and checks it again before
  putting the rewrite in; Undo puts the page back as it was (two H1s too),
  and the bar waits while the HTML view is open.
- No rewrite advice for an empty page or one too long to send whole; the
  rewrite mark survives a reload; the waiting view says the rewrite waits
  in the editor; Compare's links don't navigate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Content Editor v1.1, part 1 (CE-025, CE-026, §4): the agent row and the
rewrite bar become one card above the toolbar, in three states:
- waiting: "Content Agent has {n} suggestions for you", what they change
  and the rules they gain ("Rules 5 → 6 of 13"), with Review (scrolls to
  the first suggestion and marks it), Reject all and Accept all; a page
  rewritten shows its characters, with Compare;
- all reviewed: what was accepted and the rules met and still open, with
  Undo all and Run Agent;
- working: while Apply rules with Agent runs.
The tile moves a little (a soft ring, a blink, a spark; a sweep and a
breath while working), never a rotating ring, and not at all with reduced
motion. The card wraps on a narrow page; Accept all and Run Agent are the
primary buttons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Run Agent on the card keeps to one agent run at a time and says why it
  waits; Apply rules never starts beside another run or before the locked
  passages are read.
- Ghost buttons show their hover on the card's grey; the tile and its
  count are hidden from screen readers (the title says it) and the count
  is darker for contrast; "+N more" comes from en.json, the reason's first
  letter is upper-cased in the page's locale.
- Review picks the first open suggestion in the page's order and focuses
  it; the sweep shows on the light tile in dark mode; the spark is slower
  once all are reviewed; without motion the working line is a faint full
  line; "0 still open" isn't said.
- globals.css keeps its own lines; only the motion block is added.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…split Run Agent

Content Editor v1.1 part 2 (CE-028–CE-031): the side panel's tabs become
Instructions · Sources · Live page. Instructions holds Brief | Rules, with
the rules still open on the tab and the segment. Each segment opens with a
status card: Rules has one split Run Agent ▾ (Fix open rules, or Rewrite
the whole page, which renames it "Rewrite page") in place of the two rule
buttons; Brief has Run Agent while empty and Rebuild brief once written.
Why the agent can't run is written under the card, and each card's ⓘ tip
opens below it. The brief shows "Not set yet" and its Length in characters
and about as many words; the toolbar counter adds the page's words.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Run Agent's choice is worked out once and falls back to Fix without a
  rewrite; once a rewrite starts, the button is back on Fix.
- ▾'s choices are menu radio items; Fix is off when only rules the agent
  can't fix are open, and the card says what to do instead.
- The reason line under the card stays mounted for screen readers; Rewrite
  from brief writes its reason too; the tab's count is read out.
- Brief | Rules switch with the arrow keys, one tab stop.
- An edited brief's rebuild question sits under the card; a brief without
  H2s says to rebuild it; an empty brief shows no origin line.
- Plural copy for the open suggestions and the counter's words; rule names
  joined by the formatter; Run Agent's tip leaves ▾ out without a rewrite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Content Editor v1.1 part 3 (CE-032, CE-034): under each Run Agent card,
"Uses your data: 1 prompt · 21 fan-outs · 20 cited pages · 10 Search
Console queries · Edit sources", counted as the Sources tab keeps them, so
turning one off lowers it at once. The Sources tab carries its count, and
its top says "N sources in use" and when the Content Agent last wrote from
them (its latest suggestions or the brief it built). A first visit's note
at the top of Instructions says the agent writes from the person's data;
closing it is kept in their own user metadata.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- "Last used by Content Agent" also counts the agent writing the page
  (agent_state_at: Start with Agent, Rewrite from brief on a new page),
  not a run that failed; a value that isn't a date is skipped.
- The latest batch's time is its first suggestion's, not a sort per render.
- Tests: the Brief segment's line, no line while the sources can't be read,
  the tab's count, the note showing again after a failed write, and a
  suggestion read with its createdAt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… name them

Content Editor v1.1, CE-033 (server): Fix open rules, Start with Agent and
Rewrite the whole page read the sources the Sources tab keeps, numbered
S1, S2… (content-sources.js). Each suggestion keeps the sources it names
and the words each supports (content_draft_suggestions.sources and
source_marks, 00248); a page rewritten whole keeps its sources.

No number without a source: the model reads a source by its words only, so
a number the agent adds must be the page's, the brand's, the brief's, the
rules', today's, or in a source's own words (then marked to it). A
suggestion with any other number is not kept; a page written whole gets a
placeholder in its place. Source numbers written into the words are taken
out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk CE-033 server half. Stacked on #1397. Migration 00248 adds content_draft_suggestions.sources and source_marks; it's applied on the dev DB.

  • The agent writes from the kept sources, numbered S1…, and each suggestion records the sources and words it used.
  • No number without a source, enforced in the backend, as the product brief's hard rule asks. A number the agent adds must come from the page, the brand, the brief, the rules, today's date, or a source's own words. Otherwise:
    • a suggestion with it is dropped;
    • a page written whole gets [figure, source] in its place.

Worth knowing: this is strict on purpose. The model never sees what a cited page says, so a figure "from" a cited page can't be trusted yet. Phase 2's claim check is what will let real figures from sources through. Expect fewer data-point suggestions from Fix until then.

Deploy: 00248 → server → web. The web PR comes next and is stacked on this one.

Checks: server format, lint and 2,142 tests.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few fixes before merge:

  1. Known numbers are matched by value only, so made-up figures still get through.

    • todayText() (server/src/lib/content-sources.js:122) adds the month and day to known (content-agent.js:576-583, content-writer.js:588-596). On Oct 23, "23% of buyers" is kept with no mark. All through October, "10x faster" is kept too.
    • A source's number is matched without its unit (content-sources.js:232-237). The fan-out "crm for 50 users" lets "50% of teams" through, and it is auto-marked to that fan-out. The card would then show a made-up stat as "Based on" a real source.
    • A cited page's address counts as its words. Dates and ids in a path (/2024/03/15/post-1234) make those numbers count as sourced.

    Fix:

    • From today, take only the year (or the date written out in full).
    • Match a claim (%, ×, a scale, a currency) only to a known number with the same unit or sign.
    • Read no numbers from a cited page's URL.
    • Add a test for each.
  2. (low) Some words with digits drop suggestions or break pages the agent writes.

    • The brand's name and industry are in both prompts but not in known. For a brand with a digit in its name, a new page reads "Name [figure, source]", and a Fix suggestion that uses the name is dropped unless the page already has it.
    • A digit stuck to letters counts as a figure, and a "B" after it counts as billions. With this PR's regexes, "B2B software" becomes "B[figure, source] software", unless a lone 2 is known from somewhere else.

    Fix:

    • Add brand.name and brand.industry to known.
    • Skip digits with a letter right before them ((?<!\p{L}) on NUMBER, with the u flag).
    • Add a test with "B2B".
  3. (low) Source ids aren't taken out of reason (content-agent.js:354, content-writer.js:541). The model is told to cite by number, so a reason like "add a data point (S2)" would show on the card. Run stripSourceIds on the reason too.

Merge note: apply 00248 before the server deploy that carries this PR. Fix, Start and Rewrite write sources and source_marks. Without the columns, the insert fails after the model call has already been charged. The supabase.ts columns only come in #1399, so merge the two together.

Checked and fine:

  • There's no new AI call. readPrompts runs before the budget hold. Hold, charge, charge on a schema miss and release in finally are unchanged on Fix, Start and Rewrite.
  • A stored source can only come from the numbered list. The model's ids are looked up in that list, and unknown ids are dropped. kind, ref and label never come from the model. Refs use the same keys as the Sources tab: a prompt's id, the normalized query, the page's address.
  • The list in the prompt has limits from rebuildSources:
    • 100 prompts, checked against the brand through prompt_sets;
    • 40 fan-outs of up to 300 characters;
    • 30 pages of up to 2,048 characters;
    • 20 queries of up to 300 characters.
  • The caps of 8 sources and 12 marks match the 00248 checks. Marks are kept only on a replace or an insert, and always with sources.
  • Placeholders go into text nodes and are escaped when the page is serialized. Script, style, code and pre are left untouched.
  • 00248 only adds nullable columns:
    • RLS is unchanged: members can select, and only the server writes;
    • it needs no index, since rows are read by draft_id;
    • schema.sql matches the migration.

cihan-gyk and others added 7 commits October 23, 2026 14:45
# Conflicts:
#	server/src/lib/content-writer.js
#	server/src/lib/content-writer.test.js
#	supabase/schema.sql
…le it writes

content_drafts.agent_run ('write' or 'rewrite', in 00247 and its guard) is
set when Start or a rewrite claims the draft, so every device knows a failed
rewrite from a failed Start. Fix open rules and the MCP suggest call answer
409 'writing' while a run holds the draft, so its answer is never dropped
after it was charged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…le it writes

content_drafts.agent_run ('write' or 'rewrite', in 00247 and its guard) is
set when Start or a rewrite claims the draft, so every device knows a failed
rewrite from a failed Start. Fix open rules and the MCP suggest call answer
409 'writing' while a run holds the draft, so its answer is never dropped
after it was charged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st batch's rows

The editor reads content_drafts.agent_run, so a failed rewrite is tried again
as one on every device (the localStorage mark is gone). Fix open rules' new
409 'writing' says the agent is already writing. getDraftSuggestions finds
the latest batch first and reads only its rows, and Compare's links can't
take focus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk and others added 11 commits October 23, 2026 15:01
The card's Run Agent writes its reason in the card's second line (amber, tied
to the button by aria-describedby) instead of a hover title, and is turned
off when the only rules left open are ones the agent doesn't fix (one H1),
as the Rules card does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A merge brought in a line formatted by another Prettier version; this puts
back main's formatting, so format:check passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ions

# Conflicts:
#	web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
With only One H1 open and no rewrite advice, ▾ no longer shows the disabled
Fix as Recommended.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-server

# Conflicts:
#	server/src/lib/content-agent.js
#	server/src/lib/content-writer.js
#	supabase/schema.sql
…ates, addresses or words

A claim (a %, a ×, a scale, a currency) is known only with the same unit or
sign, so a fan-out's "crm for 50 users" no longer sources "50%". Today adds
only its year. A cited page's address is no words of its own. The brand's
name and industry are known, digits stuck to a letter ("B2B", "H2") are no
figure, and a source number written into a reason is taken out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd two lines

A test from main still pressed "Apply rules with Agent", and two messages
still named it; the button is Run Agent, its default Fix open rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk Fixed in c46702a, after merging #1397 (which carries main; conflicts in content-agent.js's doc comment, content-writer.js's write prompt and schema.sql — kept both sides, including #1373's fan-out rule).

  1. Known numbers by value only.
    • todayText() is the year alone now, so "23% of buyers" on Oct 23 or "10x faster" in October isn't known.
    • A claim (a %, a ×, a scale, a currency sign) is matched only to a known number with the same unit or sign: knownNumbers keeps each value, and value|unit for one written with a unit; addedNumbers and the auto-mark look a claim up by value|unit. "crm for 50 users" no longer sources "50%" (it still sources "50 users"). Units are named once each way they're written (3x/3×, 2M/2 million, $).
    • A cited page's address is no words of its own (sourceWords): its numbers count neither for the auto-mark nor for a page written whole.
    • Tests for each, in content-sources.test.js.
  2. (low) brand.name and brand.industry are in known on Fix and Start/Rewrite. NUMBER skips digits with a letter right before them ((?<!\p{L}), u flag), so "B2B", "H2" and "Web3" are words; test with "B2B" (and "2B users" still a claim).
  3. (low) stripSourceIds runs on the reason too, on Fix (keepSuggestions) and on a rewrite.

Merge note unchanged: apply 00248 before the server deploy, and merge with #1399.

@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk I merged main (#1404–#1410) forward through the content stack, bottom-up: #1393 → #1394 → … → #1403 → #1411 → #1412. Each PR is now mergeable again.

gkhngyk
gkhngyk previously approved these changes Oct 23, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve, with two low follow-ups.

The three items from the last review are done (c46702a):

  1. Known numbers.
    • todayText() is now the year alone.
    • A claim (%, ×, a scale, a currency sign) is now matched by value|unit. A plain number still matches by value, so "crm for 50 users" sources "50 users" but no longer "50%".
    • A cited page's address adds no numbers (sourceWords), either for the auto-mark or for a page written whole.
    • Each of these has a test.
  2. Names and industry.
    • brand.name and brand.industry are in known on Fix and on Start/Rewrite. I checked that they're still there after #1400's refactor of the writer.
    • NUMBER skips a digit with a letter right before it, and there's a "B2B" test.
  3. Reason. stripSourceIds now runs on the reason, both in keepSuggestions and on a rewrite.

Low, follow-up:

  1. A number glued to letters is still cut when it has two or more digits. The lookbehind (content-sources.js:102) only checks the character before where the match starts, so the match starts at the second digit. "H264" reads as 64, "M365" as 65 and "RTX4090" as 090. A page written whole then reads "H2[figure, source] video", and a suggestion is dropped when it adds such a name that the page doesn't already have.
    • Fix: use (?<![\p{L}\p{N}]) on NUMBER.
    • Add a test with "H264".
  2. A unit written on the other side of the number isn't read as one (unitOf, content-sources.js:109).
    • Two forms are read as plain numbers:
      • a percent sign before the number ("%50"), the way Turkish writes it;
      • a currency sign after the number ("49 €"), the way German and French write it.
    • Turkish, German and French are all content languages (languages.js), and the agent writes in the brand's language. So in those pages "%50" is still sourced by "crm for 50 users".
    • A single digit ("%5", "5 €") isn't checked at all.
    • Fix:
      • in unitOf, read a % right before the number as %, and a currency sign right after it (^\s?[$€£¥₺]) as that sign;
      • have placeholderNumbers (:291) take them along into the placeholder;
      • add a test for each.

Merge commits:

  • e53eaa9 had conflicts in content-agent.js's doc comment, the write prompt and schema.sql. It keeps both sides, including the fan-out rule from main.
  • 2ecbdcc had a conflict in schema.sql only, with 00248 kept before 00250.
  • 2dd85f6 re-merges to the same tree.

The PR merges cleanly on current main. After the merge, schema.sql lists 00247 through 00251 in order.

Migration 00248:

  • It hasn't changed since the last review, and it isn't on prod yet.
  • It only touches content_draft_suggestions, so nothing overlaps with 00250 or 00251 (the traffic tables).
  • Apply order is unchanged:
    1. 00248;
    2. then the server deploy that carries this PR;
    3. merge it together with #1399, whose web read selects the new columns.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving after merging main into the branch. The merge only brings in the squashed parent PR; the tree matches the one tested (web and server tests, typecheck, lint, format).

@gkhngyk
gkhngyk merged commit b2fff01 into ansvisor:main Oct 23, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants