
A live sticky comment: the Source Code Metrics table (top) is always present; the Documentation Metrics table (bottom) is appended when the PR touches Markdown.
mehen diff emits a Documentation Metrics section
below the existing source-code table.
The non-negotiable constraint: every character of output is mechanically derivable from the AST, the
metric tables, and the threshold bands defined in Markdown metrics and
Markdown prose metrics. No LLM call, no “likely cause” inference,
no speculative phrasing. Re-running mehen diff on the same commits produces byte-identical output.
Anchor and when it fires
The Documentation section is a sibling of the source-code section inside the existing sticky comment, demarcated by an HTML comment anchor so upserts replace the right region:Headline table — five columns
RCI, MCC,
MRPC, WQS, Evidence Coverage, and
Repository Grounding all matter but are second-glance signals.
They live in the
<details> drill-down.
For Japanese-dominant docs, the third column header flips to Tateishi RS and the value uses the
simplified formula. Mixed-language docs report the dominant-language score and tag the file with a 🌏
suffix.
Cell format — four canonical shapes
Fixed precision per column:
- DMI, RCI: integer.
- Words, sentence counts, diagram/table/link counts: integer with thousands separators.
- Ratios and scores (0–1): 2 decimal places.
- FKGL, Fog, ARI, Tateishi RS: 1 decimal place.
Delta indicators
Per-metric noticeable thresholds:
Word count never emits 🟢 or 🔴 — it is informational only.
Callout templates
The callout block tells reviewers what specifically to look at, with exact document locations. Every callout must come from the template catalog. No free-text generation is permitted. Callouts are ranked by severity class, then by magnitude within class. Default cap: 8 callouts; overflow goes into a<details> expander.
Severity 1 — objective defects
Severity 2 — band crossings
Severity 3 — readability / wording
Severity 4 — artifact hygiene
Severity 5 — improvements
Severity 6 — new file summary
Permitted and forbidden language
The callout grammar is deliberately thin. Permitted verbs and connectors:added, resolved, exceed, crossed, above, below, has,
missing, unresolved, broken, previously, now, within, no caption, no alt text, →, ;,
,, (, ).
Forbidden: after, because, due to, caused by, following, since, likely, probably,
appears to, seems, may indicate, suggests, possibly. Anything that implies causation or
intent about the author’s edits.
This rule is the hard line between “CI metrics report” and “automated review feedback that
over-reaches”.
Drill-down tables
Below the callouts, a collapsed<details> block holds deeper tables for reviewers who want them.
- Structural / review — RCI, MCC, MRPC, Evidence Coverage, Repository Grounding.
- English wording quality (suppressed if no English file) — WQS, passive %, hedges/100w, long-sentence count, nominalization density.
- English lexical & readability ensemble — MATTR₅₀, hapax ratio, Fog, SMOG, ARI, Coleman-Liau.
- Japanese composition & register (suppressed if no Japanese file) — kanji %, hiragana %, katakana %, avg sentence chars, comma/period ratio, politeness dominant.
Reference mock
Canonical shape for a PR that modifies oneREADME.md, adds one architecture doc, regresses one API
reference, leaves one generated file unchanged but on-alert, and touches the changelog:
What is deliberately NOT in scope
- No causal explanations. The report never says “after X”, “because of Y”, “due to Z”.
- No author-intent inference. Never speculates about what the author “meant” or “should have done”.
- No LLM summaries. Not now, not behind a flag, not as a plugin.
- No trend lines or history. Per-metric trendlines deserve a separate design pass.
- No suggested edits. Belongs in a separate
mehen doc lintcommand. - No scoring gates by default. The PR comment is advisory. Gating requires explicit
--fail-on.
--fail-on gating
The PR comment is advisory by default. To turn documentation regressions into a CI failure, pass
mehen diff --fail-on with one or more band-crossing rule IDs — dmi-drop,
new-broken-link, filler-high, or all — which exit non-zero (code 2) when crossed. These align
with the severity-1 / severity-2 callouts above. See
Concepts → Thresholds and diffs for the source-code threshold path.
See also
- GitHub Action — runs the diff and posts the comment.
- Markdown metrics overview — definitions referenced from callouts.