Repository navigation
fix(content): one count for the rules and for a rewrite's characters, as the editor shows them - #1521
Conversation
…adings' answers and what the last rewrite came to, and offer a Length it can reach Co-Authored-By: Claude Opus 5.5 <[email protected]>
… for, keep its numbers on the row (00285), and read the floor's sections closer (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and count the last rewrite only within its Length's band and the same kept text (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… one more pass Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er to rewrite the cited passages too when they hold the Length out of reach Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e back, release an unused hold, keep a cited-too miss as evidence, and offer it only when cited passages hold the Length (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he agent and Next step move on, and count open rules as the Rules tab does Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es read the page, keep the Length's own words, and wait for the passages before dropping skips (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ion, not the next step, and say how many placeholders it leaves to fill Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aphs, and read a rewrite's once, not on every key (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y why a run left nothing, and show a failed last run on the card Co-Authored-By: Claude Opus 5.5 <[email protected]>
… id and kind, not by clocks, and clear a failed last run once another starts (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e rules before they're accepted, and say which rule met now one would break Co-Authored-By: Claude Opus 5.5 <[email protected]>
…age as it is now, and count a rewrite's Length as its own line reads it (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…wasn't given or drops a name a passage has Co-Authored-By: Claude Opus 5.5 <[email protected]>
…give claims only to sources the page or its input names, and put a rewrite's as a placeholder (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…editor shows them, and hold the rules chip until its count stands Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aracters as the toolbar counts them, and the run's rule count Co-Authored-By: Claude Opus 5.5 <[email protected]>
…for the brief and catalog before the rules' count, hold the panel's counts with it, and read the shown rewrite's Length by the editor's count (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good.
What I checked:
- Stack. The PR's own change sits on #1520's head. Its merge of #1520's branch (c29a90b) adds nothing beyond its parents. With the stack, it merges cleanly on main.
- The chip settles, and only once.
rulesSettledwaits for My rules, the sources, the brief and, on a product page, the catalog. A failed read of each still ends its wait: the sources come back marked failed, the brief's status leavesloading, and the catalog readsnull. So the chip can't stay on "Rules · reading". The panel's open-rules badge, the Rules tab's "N of M rules met" and the card's gain wait with it. - "Reading N rules". The editor sends
countedonly once the count stands; otherwise the API counts the rules sent, as before. A page's rule set is its type's rules plus the shared ones, well under the schema's 60, socountedcan't fail the request. - Before the API deploy.
writeBodyis a plainz.object, so an older API dropscounted, and the waiting page keeps saying the number of rules sent until the API is deployed. Everything else is web and changes on merge: the chip, the panel, and the card's and Compare's counts. Nothing breaks. - Characters.
htmlCharsis the toolbar's own count (characterCount.characters) over the page parsed with the editor's schema. That's howruleEffectsalready counts a Fix's page, and Accept puts the same HTML in withsetContent. So the card's "before → after", Compare, the Length line and C1's check agree with the counter before and after Accept. Without an editor it falls back topageTextLength. - Tests. The chip holding its count, the card with the editor's count, the run's rule count, and
getLastPageRewrite's id.
Low, follow-up:
- The same rewrite is read two ways (
_draft-editor.tsx:1960-1964).- While it's the batch shown, its Length reach uses the editor's count. After a later Fix batch replaces it,
lastRewriteis the API'safter_charsagain. - The two counts differ by 1–2% (5,571 vs 5,468 in the PR's example). Near the edge of the Length's band, the Rules tab can call the same rewrite's Length in reach, then out of reach with a new Length suggested.
- Fix: count it one way in both cases. For example, have the API count
after_charsas the editor does, or keep the editor's count by the rewrite's id once it has been read.
- While it's the batch shown, its Length reach uses the editor's count. After a later Fix batch replaces it,
…ead "per" only as an attribution, "claims" and "states" only before "that", and "göre" not as a comparison; keep a change that keeps every name worded or cased another way, or as bullets; know a source by its possessive, never its last word alone; let the prompts name Your input as a source (review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e Doe", "Recently Gartner"), keep a sentence's first word out of a placeholder, read "per" on English pages only, read "U.S." as one name, and start a name only at a word's start (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nows it Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. #1526 further up the stack does this: the Rules note counts the last rewrite's page with the editor's own This branch now also has #1520's review fixes merged in. |
# Conflicts: # server/src/lib/content-writer.js
|
Merged the PR below it forward (6d3db71), which brings in Checks after the merge:
|
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good.
The new head, 6d3db71, only merges #1520's new head (bf7742b), and through it main (4efa150). Re-merging its parents (14f106f and bf7742b) is clean and gives the commit's tree (7f18990e), so the merge hides nothing. Its own change against #1520 is the same as in round 31, line for line. With its stack, it merges cleanly on main. Round 30's verdict stands.
Summary
Stacked on #1520. The PR's own changes are its commits after the merge of #1520's branch.
In the live editor test (2026-10-25), the counts disagreed:
One count for the rules.
rulesSettled). That's once My rules, the fan-outs (the fan-out rules'), the brief (the keywords rule's) and, for a product page, the catalog (the feed rule's) are read. Before that, rules came and went from it.counted, the chip's total. The API's run counts that, falling back to the rules sent (writeDraftInput.counted, optional). So the waiting page says what the chip says. The rules sent still include the ones only AI reads (tone, language).One count for characters. A rewrite's characters, before and after, are counted the way the toolbar counts the page: the editor's own count over the page parsed with its schema (
htmlChars,createDocument). That applies to:getLastPageRewritenow gives its id), so its Length band is the editor's.Related issue
Editor test findings 2026-10-25 (group E).
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
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): 0 errors; the 6 warnings are in files this PR doesn't touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Server: format, lint,
npm test. One audit test timed out once under load; it passes on its own, and this PR doesn't touch it. Web:yarn testandyarn build. A pre-push review ran; its findings are the last commit.🤖 Generated with Claude Code