Repository navigation
Chunk Quality v3.3: Chunkability score + per-chunk flags - #14
Merged
Merged
Conversation
The Chunks view showed structure but passed no judgment — "then what?"
had no answer. This adds the diagnosis layer, all deterministic (regex,
word counts, stoplists, Jaccard shingles, Flesch-Kincaid) — zero AI.
API: analyzeChunks() attaches flags[] and chunk_score to each big chunk
and returns chunkability {score, grade, top_fixes}. Flags:
- dangling-reference: opens with a pronoun (Our/We/This/...)
- near-duplicate: 5-gram Jaccard >= 0.6 between de-overlapped chunks
- no-entity-anchor: no page-entity term (title/site/JSON-LD org/H1 stems
+ initialisms, so "RAG" anchors "Retrieval-augmented generation")
- thin-section (< min(target.min, 100) words), oversized-section,
generic-heading (~40 stoplist), answer-buried (heading vs first
sentence, >= 2 heading content words), readability (FK > 12, info)
Scoring: each chunk starts at 100 and loses its flags' weights; the page
score is the average — proportional to page size by construction.
Extraction fix the near-duplicate flag surfaced: containers wrapping
nested sections were swallowed wholesale into the parent chunk
(Wikipedia "Improvements" contained all of "Encoder"). stopCondition
now treats a container holding the next heading as the boundary, and
heading-bearing containers that never became chunks are skipped.
UI: color-banded score card with top 3 fixes (+N pts each), red/amber/
info flag chips per chunk with fix tooltips, "show only flagged" toggle.
Tuned on 5 real pages: Wikipedia RAG 79/C (highest, as the control
should be) ... Hayes Barton Place 51/F (the page that started all this).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Replaces #11, which was auto-closed when its base branch was deleted during the #10 merge — identical content, full description in #11.
🤖 Generated with Claude Code