Skip to content

Verdict and workbench: honest left rail, self-help rates, adverbs by function, two-rail layout - #57

Merged
mekado11 merged 3 commits into
gh-pagesfrom
claude/fiction-analysis-tool-vb1pH
Sep 21, 2026
Merged

mekado11 merged 3 commits into
gh-pagesfrom
claude/fiction-analysis-tool-vb1pH

Conversation

@mekado11

Copy link
Copy Markdown
Owner

Three commits, each building on the last, all in the spirit of the week's brief: numbers read off the manuscript, no hardcoded verdicts, and a layout that gives each rail one job.

1. Left rail: the genre contract, the prose mix, and no verdicts nobody measured (6ab9b55)

  • Goal box → genre contract. The fixed fiction checklist (Hook reader fast / Build tension / Emotional depth / Fast pacing / Strong dialogue) ticked "Fast pacing" on a self-help introduction and left "Strong dialogue" unchecked as if the book were failing at it. Replaced by genre-expectations.js: what a reader of this genre comes for, each item met / partial / unmet / unknown with its observation and how it was evidenced.
  • Scene Intelligence → Prose mix. "Exposition Heavy · Energy: High · Tension: Steady" were fiction instruments read off whatever text was open. Replaced by the passage-classifier distribution, plus (fiction only) the measured tension direction across the last two quarters.
  • Parallel structure. "Poverty does not disappear through sympathy. It disappears through decisions." — two short sentences sharing content stems in the same order are a device, not a fault. The finding stays on record marked rhetorical and is set aside with that reason in any passage, including an epigraph too short for the classifier. Top copy issues and category lists draw only from the narrative span.
  • "Clean" removed. Any dimension scoring 80+ was labelled "Clean", implying an inspection nobody made. Cards now carry the counts they were built from.

2. Self-help model as rates; adverbs judged by what they do (4483413)

  • Self-help dimensions were capped raw counts (min(25, imperatives × 2)…), so any book-length manuscript saturated every cap and scored 100 on Practical Application by length alone. Now rates per 1,000 words ramped to a stated ceiling, each dimension summing to 100; the same text five times over scores identically (pinned by test). On the 58k-word fixture Practical Application went 100 → 65 with its basis visible.
  • Pre-existing floor bug fixed: rates were computed against max(words/1000, 1), so any text under 1,000 words had every rate under-reported (18/1K reported for a true 61/1K) — chapters and excerpts were quietly marked down.
  • Adverbs: a stance adverb (generally, eventually, only, probably…) qualifies a claim and is set aside with that reason; a manner adverb is raised with the manuscript's own rate quoted; an adverb on a speech tag is raised regardless of passage; an adverb in a list or stack ("quietly, persistently wrong") is never auto-deleted.

3. Verdict and workbench: give each rail one job (1bbffa4)

  • Left rail (the verdict): gauge with sub-scores and readability grade, the genre contract, the prose mix, and one "Start here" card — the dimension whose repair moves the overall most, (100 − score) × weight, with its basis and one button into the workbench. The five duplicate score cards and both "+ Improve Opening" buttons are gone; the opening coach is reached from its finding.
  • Right rail (the workbench): the "What does your book know right now?" box becomes one ✦ Ask your book button in the tab row; the eight dimension cards become rows with the basis beside each score, so the selected dimension's findings sit above the fold; every detail opens with "Built from:"; Evidence & Support and Practical Application list the chapters where attributed claims / explicit actions are fewest.
  • No score changes; every value shown is an existing field. Both models use the one layout.

Verification

  • 112/112 unit tests (npm run verify), including new copy-detectors.test.js and detailed-metrics.test.js cases: parallel-structure suppression, stance/manner/list/speech-tag adverb behaviour, self-help length invariance, per-dimension evidence strings.
  • Full real-Chromium smoke run (npm run test:browser) with new assertions for the genre contract, prose mix, absence of "Clean", Start here → workbench, "Built from", the Intelligence button, and per-chapter evidence rows on the self-help fixture.
  • Screenshot checked at desktop width; two wrap nits fixed.

Caveats

  • Ramp ceilings (e.g. full marks at 2.5 imperatives per 1K) and the MSTTR bands are approximate, not corpus-calibrated — which is why the measured rate is always shown beside the score.
  • "Start here" on a very clean manuscript still names the least-good dimension; a hide-below-gain threshold is a one-line change if wanted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VWzYm8L13Mra3ihjhuCM2U


Generated by Claude Code

…measured

Goal box: the fixed fiction checklist (Hook reader fast / Build tension /
Emotional depth / Fast pacing / Strong dialogue) ticked "Fast pacing" on a
self-help introduction and left "Strong dialogue" unchecked as if the book
were failing at it. It is replaced by the genre contract from
genre-expectations.js: what a reader of THIS genre comes for, each item
met / partial / unmet / unknown with its observation and how it was evidenced.
The Intelligence window exposes its memoised book-level build for this, taking
the text and analysis explicitly because the rail renders before the editor is
filled.

Scene Intelligence ("Exposition Heavy · Energy: High · Tension: Steady") were
fiction instruments read off whatever text was open. Replaced by the prose mix
from the passage classifier, plus, for fiction only, the measured tension
direction across the last two quarters.

Repetition: two short sentences of similar length sharing two or more content
stems in the same order are parallel structure ("…disappear through sympathy.
It disappears through decisions."). The finding stays on the record marked
rhetorical, and prose-norms sets it aside with that reason regardless of
passage, so an epigraph too short for the classifier is covered. Top copy
issues and category lists now draw only from the narrative span: a word in the
epigraph is never the book's top issue.

Score cards: "Clean" for any dimension scoring 80+ implied an inspection that
never happened. Self-help dimensions now carry the counts they were built from
("13 imperatives · 5 exercises · 0 numbered steps · 2 how-tos"); fiction cards
show their basis or nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VWzYm8L13Mra3ihjhuCM2U
…r suffix

Self-help: every component was a capped raw count (min(25, imperatives × 2)…),
so any book-length manuscript saturated every cap and scored 100 on Practical
Application by length alone. Components are now rates per 1,000 words ramped
linearly to a stated ceiling, each dimension summing to 100, and the same text
five times over scores the same on every dimension (pinned by test). The
basis line on each card quotes the rate and the count. Also fixes a
pre-existing floor: rates were computed against max(words/1000, 1), so any text
under 1,000 words had every rate under-reported (18/1K reported for a true
61/1K), which quietly punished chapters and excerpts.

Adverbs: a stance adverb (generally, eventually, only, probably…) qualifies the
claim it sits in; it is doing work, and is set aside with that reason in any
passage. A manner adverb is raised with the manuscript's own rate quoted
("this manuscript uses 412 manner adverbs, 5.8 per 1,000 words"). An adverb on
a speech tag is raised regardless of passage. An adverb in a list or stack
("quietly, persistently wrong") is never auto-deleted, because removing one
word leaves punctuation debris; it is offered for editing instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VWzYm8L13Mra3ihjhuCM2U
Left rail (the verdict): the gauge with its sub-scores and readability grade,
the genre contract, the prose mix, and one card, "Start here": the dimension
whose repair would move the overall most, (100 - score) x weight, with the
basis it was built from and one button into the workbench. The five score
cards that sat here were the right rail's list shown a second time, and the
two "+ Improve Opening" buttons opened the same coach; the opening diagnosis is
now a finding under Hook / Promise Strength with the coach reached from there.

Right rail (the workbench): the large "What does your book know right now?"
box becomes one button in the tab row; the eight dimension cards become rows
with the basis beside each score, a third of the height, so the findings for
the selected dimension sit above the fold. Every detail opens with "Built
from:" and the counts or density that produced the number. Dimensions with no
locatable copy findings (Evidence & Support, Practical Application) list the
chapters where attributed claims or explicit actions are fewest, from the same
per-chapter extraction the Intelligence window shows.

No score changes; every value shown is an existing field. Both models (self-help
and fiction) use the one layout.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VWzYm8L13Mra3ihjhuCM2U
@vercel

vercel Bot commented Sep 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
manuscriptlens Ready Ready Preview Sep 21, 2026 12:04am UTC

@mekado11
mekado11 merged commit 2e01c1e into gh-pages Sep 21, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bbffa42c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread analyzer.js
Comment on lines +701 to +706
if (all1 <= 16 && all2 <= 16 && all1 > 0 && all2 > 0 && Math.max(all1, all2) / Math.min(all1, all2) <= 2) {
const c1 = content(s1.raw), c2 = content(s2.raw);
const sharedInOrder = [];
let from = 0;
for (const w of c2) { const at = c1.indexOf(w, from); if (at !== -1) { sharedInOrder.push(w); from = at + 1; } }
parallel = sharedInOrder.length >= 2;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require structural similarity before suppressing repetition

Do not treat two shared content stems as sufficient proof of parallel structure. Ordinary adjacent sentences such as “She opened the heavy door and entered the quiet room. The door closed behind her, leaving the room silent.” satisfy this condition, causing both repetitions to receive rhetorical: 'parallel'; ProseNorms.apply then suppresses them from the copy score and actionable findings. Compare sentence structure rather than merely ordered vocabulary, or mark only repetitions participating in a verified parallel construction.

Useful? React with 👍 / 👎.

Comment thread app.js
Comment on lines +928 to +932
return [
{k:'plot',name:isNF?'Argument Structure':'Plot Structure',score:scores.plot||0,density:null,issues:0,weight:'9%',evidence:plotEv},
{k:'transitions',name:'Transitions',score:scores.transitions||0,density:null,issues:(t.details||[]).filter(x=>!x.supported).length,weight:'7%',evidence:t.smoothRate!=null?t.smoothRate+'% of paragraph boundaries supported':''},
{k:'hook',name:'Hook Strength',score:hookScore,density:null,issues:hookScore<80?hookProblems:0,weight:'9%',evidence:hookProblems?hookProblems+' opening problem'+(hookProblems===1?'':'s')+' diagnosed':'no opening problems diagnosed'},
{k:'style',name:'Style & Voice',score:scores.style||0,density:null,issues:0,weight:'7%',evidence:st.lexicalDiversity!=null?'lexical diversity '+st.lexicalDiversity+'% \u00B7 sentence SD '+(st.sentenceLengthStdDev??'\u2014'):''},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Rank Start here across every overall-score dimension

Include all dimensions used by _computeScoreBundle in this returned list before claiming that _startHere selects the fix that moves the overall most. For fiction and general nonfiction, the overall also contains line, clarity, discipline, efficiency, engagement, and momentum, but none can be selected here; for example, a manuscript with line: 0 and all listed cards above 50 will recommend a smaller-impact listed dimension instead. Nonfiction also renormalizes applicable weights, so the displayed percentages are not its actual shares of the overall.

Useful? React with 👍 / 👎.

Comment thread app.js
if(isSH&&r.selfHelpScores){
const ev=sh.evidence||{};
return [
{k:'sh_clarity', name:'Clarity & Polish', score:Math.round(sh.clarityReadability||0), density:perPage(copyRaw),issues:copyRaw,weight:'15%',evidence:ev.clarity},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Show the actual basis for self-help clarity

Do not assign copy-finding density as the basis of sh.clarityReadability. That score is calculated from Flesch ease, sentence length, paragraph length, and transition rate, not from copyRaw; because _dimensionBasis prioritizes density, any self-help manuscript with a copy finding displays “Built from: … findings” and hides ev.clarity, even though removing those findings may leave this score unchanged. Keep the findings as separate editorial examples while using ev.clarity for the score basis.

Useful? React with 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview — 1bbffa42 Deployed Sep 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants