Skip to content

feat(review): per-mark label density rule in the shared style guide - #12189

Merged
MarkusNeusinger merged 2 commits into
mainfrom
feat/style-guide-label-density
Oct 15, 2026
Merged

MarkusNeusinger merged 2 commits into
mainfrom
feat/style-guide-label-density

Conversation

@MarkusNeusinger

@MarkusNeusinger MarkusNeusinger commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • One source for the per-mark label rule. feat(agents): gates for per-mark label density and the plot language's number format #12184 gave the agent adapter a rule for elements the catalogue draws once per bar or point (value labels, dots on bar ends, shadows): keep them only while each fits its mark, which rarely holds past about 25 marks; otherwise drop them or label the extremes. Per the owner's decision of 2026-10-15, the rule now lives in prompts/default-style-guide.md ("Per-mark Labels and Decorations"), so the catalogue pipeline applies it too.
  • Rubric, proportional and soft. prompts/quality-criteria.md VQ-03 gains a "Per-mark labels and decorations count as elements" paragraph (deduct VQ-03 in proportion to how much of the plot they bury, VQ-02 where they overlap; labels that fit, or a few labelled extremes, are no deduction), and the 5d proportional sizing check of ai-quality-review.md gets a matching bullet. No new hard threshold: "about 25 marks" is a heuristic like the data-density heuristic's "< 50 points"; the agent's G11 gate keeps its own measured thresholds in code.
  • Agent prompts. agents/anyplot/prompts/adapter.md keeps its agent-specific framing ("the same style" covers fixed-count elements) and points at the shared rule instead of repeating it; the adapter reads the style guide and the VQ-03 rubric verbatim. The scorer's and reviewer's narrowed house-style exemption stays as is (it is the agent-only exception, not the rule). A unit test holds that the "about 25 marks" wording appears once in the adapter's instruction. docs/concepts/agent-network.md names the new source.

Review retest

The last all-Opus set v1 arm (37233543394, rules c64630aa7) predates the claude-code-action pin bump (#11975/#12099) and the rubric change of #12102, so a fresh baseline was run on main's rules (e2a63d6, run 38702205512). To keep the spend near one core arm, both arms ran the 15 fresh core items plus f-bar-stacked-labeled-d3 and f-heatmap-basic-seaborn (labelled plots, as false-alarm probes), 3 runs each, all on claude-opus-5-5, without the bubble regen pairs, which carry no per-mark labels.

Review retest — set v1 f-bubble-basic-ggplot2,f-area-elevation-profile-seaborn,f-bar-horizontal-makie,f-bode-basic-altair,f-bar-diverging-plotnine,f-pie-basic-highcharts,f-bar-pareto-letsplot,f-waterfall-basic-muix,f-line-win-probability-chartjs,f-bubble-basic-d3,f-network-basic-bokeh,f-bar-diverging-likert-matplotlib,f-acf-pacf-plotly,f-line-stock-comparison-pygal,f-gantt-basic-echarts,f-bar-stacked-labeled-d3,f-heatmap-basic-seaborn (17 fresh × 3)

Fresh: claude-opus-5-5 · rules e2a63d6 → 35caaaf · harness v1

Metric Baseline Candidate Δ (95% CI)
Total mean / pooled within-item SD (typed) 79.2 / 1.4 79.3 / 1.5 0.0 (-0.8…+0.9) / 0.1 (-0.5…+0.8)
Items with split verdict at 90 0/17 0/17
Noisiest criteria (SD) VQ-01 0.5 · DE-02 0.5 · LM-02 0.4 VQ-01 0.5 · VQ-03 0.5 · VQ-05 0.5
Weakness-topic Jaccard 0.61 0.62
Silent deductions (technical items, fresh) 0/178 (0%) 0/174 (0%)
Named-defect miss rate 17/69 15/69
False alarms on permitted features 0/9 1/9
Sessions / API-equivalent cost 51/51 / $37 51/51 / $41

run · set v1 lock sha256 a6831a315a11

Reading. Neutral, as intended for a set with no crowded labels. No candidate weakness cites per-mark label density; the labelled plots (f-bar-stacked-labeled-d3, f-bar-horizontal-makie value labels, f-bar-diverging-plotnine value labels, f-heatmap-basic-seaborn cell text) keep their VQ-03 scores (6/6/6, 6/6/6, 6/6/6, 5–6). VQ-03's mean stays at 5.4. VQ-03's within-item SD (0.31 → 0.46) moves on f-bode-basic-altair (one 4) and f-line-stock-comparison-pygal (4 to 6), whose VQ-03 comments name a bright dark-theme grid, thin lines and small legend swatches, not labels. The one false alarm is f-bubble-basic-ggplot2 A1, run 1: an SC-01 line about the off-spec top-3 callout layer says the callouts "sit on top of the dense bubble clusters", which the probe's overlap regex catches; it is not a per-mark label deduction. The set has no crowded-label item, so the retest shows that the rule does not take points from plots that pass it, but it cannot measure detection. G11's fixtures in #12184 cover the crowded case on the agent side.

Plan

N/A

Test plan

  • uv run pytest tests/unit -n 4 (11,037 passed)
  • ruff check, ruff format --check, tools.changelog check --base origin/main
  • Review retest candidate vs baseline: no per-mark label deductions on the labelled plots, no rise in silent deductions, total within ±0.9 points

The per-mark label rule #12184 gave the agent adapter now lives once in
prompts/default-style-guide.md ("Per-mark Labels and Decorations"), with
a proportional VQ-03 paragraph in quality-criteria.md and a 5d bullet in
ai-quality-review.md, so the catalogue pipeline applies it too. The
adapter prompt points at the shared rule instead of carrying a copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M
Copilot AI balanced review requested due to automatic review settings October 15, 2026 07:57
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdMSqLR5ww4ji74EUSmk9M

Copilot AI 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.

🔵 Needs a closer look

The required baseline-versus-candidate review retest remains pending, leaving catalogue scoring regressions unverified.

0 open findings

What changed in this PR

Centralizes per-mark label density guidance so the catalogue pipeline and agent adapter share the same rule.

Changes:

  • Adds shared guidance and proportional scoring deductions for crowded labels and decorations.
  • Replaces duplicated adapter guidance with a reference to the shared rule.
  • Adds a prompt consistency test and updates documentation.
File Description
tests/​unit/​agents/​runtime/​test_density_locale_gates.py Checks shared guidance appears once in adapter instructions.
prompts/​workflow-prompts/​ai-quality-review.md Adds the label-density review check.
prompts/​quality-criteria.md Defines proportional deductions for crowding.
prompts/​default-style-guide.md Establishes the shared per-mark density rule.
docs/​concepts/​agent-network.md Documents the shared rule’s source.
changelog.d/​style-guide-label-density.md Records the rubric and adapter changes.
agents/​anyplot/​prompts/​adapter.md References shared guidance instead of duplicating it.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarkusNeusinger
MarkusNeusinger merged commit 8407e5c into main Oct 15, 2026
16 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the feat/style-guide-label-density branch October 15, 2026 09:29
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