Skip to content

feat(seaborn): implement qq-basic - #9692

Merged
MarkusNeusinger merged 8 commits into
mainfrom
implementation/qq-basic/seaborn
Jul 24, 2026
Merged

feat(seaborn): implement qq-basic#9692
MarkusNeusinger merged 8 commits into
mainfrom
implementation/qq-basic/seaborn

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Implementation: qq-basic - python/seaborn

Implements the python/seaborn version of qq-basic.

File: plots/qq-basic/implementations/python/seaborn.py

Parent Issue: #977


🤖 impl-generate workflow

github-actions Bot added 2 commits July 24, 2026 06:50
Regen from quality 88. Addressed:
- Canvas drift: figsize was (16,9) @ dpi=300 with bbox_inches="tight" (~4800x2700 minus crop), way off the 3200x1800 target. Switched to canonical figsize=(8,4.5), dpi=400, dropped bbox_inches="tight".
- DE-01 (no confidence band/annotations): replaced the bare y=x dashed line with a simulation-based 95% percentile envelope (300 replicate normal samples of the same size), giving the reference guide real statistical depth.
- LM-02 (seaborn features underused): the envelope is drawn via sns.lineplot's built-in errorbar=("pi", 95) bootstrap/percentile-interval estimation over a long-form DataFrame, a genuine seaborn statistical layer rather than a plain matplotlib ax.plot line.
- VQ-02 (dense central overlap): reduced marker size s=200->120, alpha 0.7->0.75, edge linewidth 0.5->0.8 for better separation.
- Rescaled all text to the library prompt's canonical sizing for the new canvas (title 12pt, axis labels 10pt, ticks/legend 8pt).

Kept: bimodal mixture data scenario, Abramowitz & Stegun quantile approximation (no scipy dependency), theme-adaptive chrome tokens, brand green first series.
@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1). Title "qq-basic · seaborn · anyplot.ai" in dark ink is clearly legible, as are the "Theoretical Quantiles" / "Sample Quantiles" axis labels and the softer dark-gray tick labels. The upper-left legend box (cream fill, dark border) reads "Normal reference (95% envelope)" and "Sample quantiles", both fully readable. Green (#009E73) circular markers trace sample quantiles against theoretical quantiles from -3 to 3, closely tracking a dashed gray identity line inside a light-gray 95% simulation-envelope band; markers curve visibly above the envelope for theoretical quantile > ~1.2, showing the intended right-tail deviation from normality. All text is readable against the light background.

Dark render (plot-dark.png): Warm near-black background (#1A1A17). Title and axis labels render in light ink (near-white), fully legible; tick labels in a lighter gray, also legible; the legend box (dark-elevated fill, light border) has light text with no dark-on-dark issues anywhere. Data markers are the same #009E73 green (confirming color parity with the light render), same dashed reference line (now light gray) and simulation envelope (dark-gray shading), same upper-tail deviation pattern. All text is readable against the dark background — no dark-on-dark failures found.

Both renders are theme-correct and readable. The title text itself, however, is missing the mandated language segment ("python") in both renders — a Spec Compliance defect, not a legibility one.

Score: 89/100

Category Score Max
Visual Quality 28 30
Design Excellence 15 20
Spec Compliance 13 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 9 10
Total 89 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8) - All font sizes explicitly set, readable in both themes
  • VQ-02: No Overlap (6/6) - No collisions
  • VQ-03: Element Visibility (5/6) - s=120 slightly above the 50-100 guideline for ~200 points
  • VQ-04: Color Accessibility (2/2) - Green vs. gray, CVD-safe
  • VQ-05: Layout & Canvas (4/4) - Balanced, nothing cut off, canvas gate passed
  • VQ-06: Axis Labels & Title (2/2) - Descriptive per spec
  • VQ-07: Palette Compliance (2/2) - #009E73 first series, correct theme-adaptive chrome

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) - Simulation envelope + correct semantic-anchor usage, clearly above defaults
  • DE-02: Visual Refinement (5/6) - Spines removed, subtle grid, generous whitespace
  • DE-03: Data Storytelling (4/6) - Color contrast creates a focal point on the tail deviation

Spec Compliance (13/15)

  • SC-01: Plot Type (5/5) - Correct Q-Q plot
  • SC-02: Required Features (4/4) - Reference guide + axis labels present
  • SC-03: Data Mapping (3/3) - X=theoretical, Y=standardized sample, correct
  • SC-04: Title & Legend (1/3) - Title missing the mandated language segment

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) - Clear right-tail deviation; left tail stays close to envelope
  • DQ-02: Realistic Context (5/5) - Neutral, plausible mixture distribution
  • DQ-03: Appropriate Scale (4/4) - n=200 within recommended range, sensible values

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2) - Seeded np.random.default_rng(42)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (2/2)
  • CQ-05: Output & API (1/1)

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of sns.lineplot's estimator/errorbar machinery
  • LM-02: Distinctive Features (4/5) - errorbar=("pi", 95) percentile-interval estimation is a genuinely seaborn-specific statistical feature

Score Caps Applied

  • None

Strengths

  • Genuinely creative reference guide: a 300-replicate 95% simulation envelope built with sns.lineplot(estimator='mean', errorbar=('pi', 95)) instead of a bare y=x line, giving the QQ plot real statistical depth and leaning on seaborn's own estimation machinery.
  • Correct Imprint palette usage: sample quantiles use brand green #009E73, and the reference band/line uses the theme-adaptive muted/neutral token in its documented "confidence-band fill" role rather than spending a categorical color on it.
  • Theme-adaptive chrome is threaded consistently through sns.set_theme rc params — both light and dark renders are fully legible with no dark-on-dark or light-on-light failures.
  • Clean, idiomatic KISS structure, reproducible via a seeded np.random.default_rng(42), spines removed, subtle grid.
  • Realistic mixture-distribution sample (normal core + right-tail bump) clearly demonstrates the Q-Q deviation the spec asks for.

Weaknesses

  • Title reads "qq-basic · seaborn · anyplot.ai" — missing the mandated language segment. Per SC-04 it must be {spec-id} · {language} · {library} · anyplot.ai, i.e. "qq-basic · python · seaborn · anyplot.ai". Fix the ax.set_title() string.
  • Marker size (s=120, alpha=0.75) for a ~200-point scatter is a bit larger than the density-appropriate 50-100 range for the 100-300 point bucket — reduce slightly (e.g. s=90) to cut down on marker-to-marker crowding in the dense mid-section.
  • Only the upper/right tail visibly strays from the reference envelope; the sample could show a touch more variety in deviation (e.g. mild left-tail behavior) for fuller Q-Q feature coverage, though this is a minor polish item, not a correctness issue.

Issues Found

  1. SC-04 LOW: Title is missing the required {language} segment ("python")
    • Fix: Change ax.set_title("qq-basic · seaborn · anyplot.ai", ...) to ax.set_title("qq-basic · python · seaborn · anyplot.ai", ...)
  2. VQ-03 MINOR: Marker size slightly oversized for data density
    • Fix: Reduce s=120 to ~s=90 for the ~200-point scatter

AI Feedback for Next Attempt

Fix the title to include the mandated "python" language segment: "qq-basic · python · seaborn · anyplot.ai" (this alone should meaningfully raise SC-04). Optionally trim marker size to ~90 for the ~200-point scatter to slightly reduce mid-section crowding. Everything else — the simulation-envelope technique, palette compliance, theme-adaptive chrome, and code cleanliness — is strong; keep it as-is.

Verdict: REJECTED

@github-actions github-actions Bot added quality:89 Quality score 89/100 ai-rejected Quality not OK, triggers update labels Jul 24, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Jul 24, 2026
Attempt 1/4 - fixes based on AI review
@github-actions

Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 2/3

🚨 Blocking Pipeline Failure — Stale Render

The plot-light.png / plot-dark.png downloaded from GCS staging for this review are byte-for-byte the pre-fix Attempt 1 artifacts, not a render of the current source. Evidence:

  • The rendered title in both images still reads qq-basic · seaborn · anyplot.ai (missing the python segment).
  • The current source (plots/qq-basic/implementations/python/seaborn.py:96, fixed in commit fcd543fd9) reads ax.set_title("qq-basic · python · seaborn · anyplot.ai", ...) — verified correct by running the committed source locally, which renders the title correctly.
  • Root cause, found in the impl-repair run: the "Process repaired image" step logged ::warning::Missing plot-{light,dark}.png after repair — the repair step edited the .py file but never executed it to regenerate plot-light.png/plot-dark.png in the implementation directory. Because those files didn't exist, the following "Upload repaired plot to GCS staging" step's if [ -f plot-light.png ] && [ -f plot-dark.png ] guard was false, so nothing was uploaded — the stale Attempt-1 images stayed in staging and were re-downloaded for this review.

This is a rendering-pipeline defect, not a code-quality defect — the source fix (title + marker size s=90) is correct and verified. Scoring/approving on this artifact would promote a non-compliant PNG to production while the repo's source already has the fix. Score is capped below this attempt's approval threshold to force a re-render before merge — no further code changes are needed, just execute the script for both themes and let the existing upload step pick up the output.

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1, pixel-verified). Title "qq-basic · seaborn · anyplot.ai" in dark ink is legible but missing the mandated "python" segment (stale — see above). "Theoretical Quantiles" / "Sample Quantiles" axis labels and tick labels are legible. Legend box (cream fill, dark border) reads "Normal reference (95% envelope)" and "Sample quantiles". Green (#009E73) markers at the pre-fix size (s=120) trace sample quantiles against theoretical quantiles from -3 to 3, tracking a dashed gray identity line inside a 95% simulation envelope; markers curve above the envelope for theoretical quantile > ~1.2, showing the intended right-tail deviation. All text is readable against the light background.

Dark render (plot-dark.png): Warm near-black background (#1A1A17, pixel-verified). Title and axis labels render in light ink, fully legible; tick labels lighter gray; legend box (dark-elevated fill, light border) has light text, no dark-on-dark issues. Same missing "python" segment (stale, not a new defect). Data markers are the same #009E73 green (color parity confirmed), same dashed reference line and simulation envelope, same pre-fix s=120 marker size. All text is readable against the dark background — no dark-on-dark failures.

Both renders are theme-correct and internally consistent, but both are confirmed stale — they do not reflect the current, already-fixed source.

Score: 65/100 (capped — see pipeline failure notice above; raw category total below is 89/100)

Category Score Max
Visual Quality 28 30
Design Excellence 15 20
Spec Compliance 13 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 9 10
Raw Total 89 100
Reported (capped) Total 65 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8) - All font sizes explicitly set, readable in both themes
  • VQ-02: No Overlap (6/6) - No collisions
  • VQ-03: Element Visibility (5/6) - s=120 in this (stale) render is above the 50-100 density-appropriate range for ~200 points; source already fixed to s=90
  • VQ-04: Color Accessibility (2/2) - Green vs. gray, CVD-safe
  • VQ-05: Layout & Canvas (4/4) - Balanced, nothing cut off, canvas gate passed (3200×1800)
  • VQ-06: Axis Labels & Title (2/2) - Descriptive per spec
  • VQ-07: Palette Compliance (2/2) - #009E73 first series; backgrounds pixel-verified #FAF8F1/#1A1A17; correct theme-adaptive chrome

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) - Simulation envelope + correct semantic-anchor usage, clearly above defaults
  • DE-02: Visual Refinement (5/6) - Spines removed, subtle grid, generous whitespace
  • DE-03: Data Storytelling (4/6) - Color contrast creates a focal point on the tail deviation

Spec Compliance (13/15)

  • SC-01: Plot Type (5/5) - Correct Q-Q plot
  • SC-02: Required Features (4/4) - Reference guide + axis labels present
  • SC-03: Data Mapping (3/3) - X=theoretical, Y=standardized sample, correct
  • SC-04: Title & Legend (1/3) - Title in this (stale) render is missing the mandated {language} segment; source is already fixed (line 96) but the render doesn't reflect it

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) - Clear right-tail deviation; left tail stays close to envelope
  • DQ-02: Realistic Context (5/5) - Neutral, plausible mixture distribution
  • DQ-03: Appropriate Scale (4/4) - n=200 within recommended range, sensible values

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2) - Seeded np.random.default_rng(42)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (2/2)
  • CQ-05: Output & API (1/1)

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of sns.lineplot's estimator/errorbar machinery
  • LM-02: Distinctive Features (4/5) - errorbar=("pi", 95) percentile-interval estimation is a genuinely seaborn-specific statistical feature

Score Caps Applied

  • Pipeline render-staleness gate (reviewer-applied, analogous to the canvas-dimension gate): total capped at 65/100, below this attempt's approval threshold, because the reviewed artifact does not reflect the current source. See "Blocking Pipeline Failure" above for full evidence.

Strengths

  • Genuinely creative reference guide: a 300-replicate 95% simulation envelope built with sns.lineplot(estimator='mean', errorbar=('pi', 95)) instead of a bare y=x line, giving the QQ plot real statistical depth and leaning on seaborn's own estimation machinery.
  • Correct Imprint palette usage: sample quantiles use brand green #009E73, and the reference band/line uses the theme-adaptive muted/neutral token in its documented confidence-band role rather than spending a categorical color on it.
  • Theme-adaptive chrome is threaded consistently through sns.set_theme rc params — both light and dark backgrounds pixel-verified exact, fully legible with no dark-on-dark or light-on-light failures.
  • The source code fix for this attempt is correct and verified: ax.set_title now reads qq-basic · python · seaborn · anyplot.ai (line 96) and marker size was reduced from s=120 to s=90 (line 84), exactly as requested in the Attempt 1 review.
  • Clean, idiomatic KISS structure, reproducible via a seeded np.random.default_rng(42), spines removed, subtle grid.

Weaknesses

  • BLOCKING: Reviewed render is stale — see "Blocking Pipeline Failure" section above for full root-cause evidence (impl-repair run 30073755278, "Process repaired image" step warning).
  • Direct consequence of the above: on the actual reviewed artifact, the title still fails SC-04 (missing {language}) and markers are still s=120 — both are already fixed in source but not reflected in the render.
  • Minor, non-blocking: only the upper/right tail visibly strays from the reference envelope; the sample could show a touch more variety in deviation (e.g. mild left-tail behavior) for fuller Q-Q feature coverage.

Issues Found

  1. PIPELINE BLOCKING: Rendered PNGs are stale (pre-fix Attempt 1 artifacts), not a render of the current source
    • Fix: No code changes needed — the source is already correct. Simply run ANYPLOT_THEME=light and ANYPLOT_THEME=dark against plots/qq-basic/implementations/python/seaborn.py to regenerate plot-light.png/plot-dark.png in that directory so the existing "Process repaired image" / "Upload repaired plot to GCS staging" steps can pick them up.
  2. SC-04 (consequence of Add workflow diagram for new prototype discovery #1): Title in the reviewed render is missing the python language segment
    • Fix: Already applied in source (line 96) — will resolve automatically once the render is regenerated.
  3. VQ-03 (consequence of Add workflow diagram for new prototype discovery #1): Marker size in the reviewed render is s=120
    • Fix: Already applied in source (line 84, s=90) — will resolve automatically once the render is regenerated.

AI Feedback for Next Attempt

Do NOT modify plots/qq-basic/implementations/python/seaborn.py — it already contains the correct fix (title includes "python", marker size is s=90). The only action needed is to actually execute the script for both ANYPLOT_THEME=light and ANYPLOT_THEME=dark so plot-light.png/plot-dark.png are regenerated in the implementation directory before the "Process repaired image" / "Upload repaired plot to GCS staging" steps run — the previous repair attempt's run (30073755278) skipped this and left stale pre-fix images in GCS staging, which is what this review evaluated. Once re-rendered, this implementation should score in the high 80s.

Verdict: REJECTED

@github-actions github-actions Bot added quality:65 Quality score 65/100 ai-rejected Quality not OK, triggers update and removed quality:89 Quality score 89/100 labels Jul 24, 2026
@github-actions github-actions Bot added ai-attempt-2 Second repair attempt and removed ai-rejected Quality not OK, triggers update labels Jul 24, 2026
Attempt 2/4 - fixes based on AI review
@github-actions

Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 2/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

AI Review - Attempt 3/3

Image Description

Light render (plot-light.png): Warm off-white background (#FAF8F1). Title "qq-basic · python · seaborn · anyplot.ai" in dark ink is clearly legible — the language segment is now present, confirming the Attempt 1 fix is reflected in this render (unlike Attempt 2's stale artifact). "Theoretical Quantiles" / "Sample Quantiles" axis labels and softer dark-gray tick labels all readable. Upper-left legend box (cream fill, dark border) reads "Normal reference (95% envelope)" and "Sample quantiles", fully readable, no overlap with plot data. Green (#009E73) circular markers (s=90) trace standardized sample quantiles against theoretical quantiles from about -3 to 3, closely tracking a dashed gray identity/reference line inside a light-gray 95% simulation-envelope band; markers curve visibly above the envelope for theoretical quantile > ~1.2, showing the intended right-tail deviation from normality. All text is readable against the light background.

Dark render (plot-dark.png): Warm near-black background (#1A1A17). Title and axis labels render in light ink (near-white), fully legible; tick labels lighter gray, also legible; legend box (dark-elevated fill, light border) has light text with no dark-on-dark issues anywhere. Data markers are the same #009E73 green (color parity with light render confirmed — only chrome flipped), same dashed reference line (now light gray) and simulation envelope (dark-gray shading), same upper-tail deviation pattern. All text is readable against the dark background — no dark-on-dark failures found.

Both renders are theme-correct, mutually consistent, and correctly reflect the current source — the Attempt 2 staleness issue is resolved: title now includes "python" and markers are s=90, not the stale s=120.

Score: 92/100

Category Score Max
Visual Quality 29 30
Design Excellence 15 20
Spec Compliance 15 15
Data Quality 14 15
Code Quality 10 10
Library Mastery 9 10
Total 92 100

Visual Quality (29/30)

  • VQ-01: Text Legibility (7/8) - All font sizes explicitly set, readable in both themes
  • VQ-02: No Overlap (6/6) - No collisions
  • VQ-03: Element Visibility (6/6) - s=90 now sits in the density-appropriate 50-100 range for ~200 points, fixing the prior s=120 issue
  • VQ-04: Color Accessibility (2/2) - Green vs. gray, CVD-safe
  • VQ-05: Layout & Canvas (4/4) - Balanced, nothing cut off, canvas gate passed (3200×1800)
  • VQ-06: Axis Labels & Title (2/2) - Descriptive per spec
  • VQ-07: Palette Compliance (2/2) - #009E73 first series, correct theme-adaptive chrome

Design Excellence (15/20)

  • DE-01: Aesthetic Sophistication (6/8) - Simulation envelope + correct semantic-anchor usage, clearly above defaults
  • DE-02: Visual Refinement (5/6) - Spines removed, subtle grid, generous whitespace
  • DE-03: Data Storytelling (4/6) - Color contrast and envelope create a focal point on the tail deviation

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct Q-Q plot
  • SC-02: Required Features (4/4) - Reference guide + axis labels present
  • SC-03: Data Mapping (3/3) - X=theoretical, Y=standardized sample, correct
  • SC-04: Title & Legend (3/3) - Title now reads qq-basic · python · seaborn · anyplot.ai, exact required format

Data Quality (14/15)

  • DQ-01: Feature Coverage (5/6) - Clear right-tail deviation; left tail stays close to envelope
  • DQ-02: Realistic Context (5/5) - Neutral, plausible mixture distribution
  • DQ-03: Appropriate Scale (4/4) - n=200 within recommended range, sensible values

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3)
  • CQ-02: Reproducibility (2/2) - Seeded np.random.default_rng(42)
  • CQ-03: Clean Imports (2/2)
  • CQ-04: Code Elegance (2/2)
  • CQ-05: Output & API (1/1)

Library Mastery (9/10)

  • LM-01: Idiomatic Usage (5/5) - Expert use of sns.lineplot's estimator/errorbar machinery
  • LM-02: Distinctive Features (4/5) - errorbar=("pi", 95) percentile-interval estimation is a genuinely seaborn-specific statistical feature

Score Caps Applied

  • None

Strengths

  • Genuinely creative reference guide: a 300-replicate 95% simulation envelope built with sns.lineplot(estimator='mean', errorbar=('pi', 95)) instead of a bare y=x line, giving the Q-Q plot real statistical depth and leaning on seaborn's own estimation machinery.
  • Correct Imprint palette usage: sample quantiles use brand green #009E73, and the reference band/line uses the theme-adaptive muted/neutral token in its confidence-band role rather than spending a categorical color on it.
  • Theme-adaptive chrome threaded consistently through sns.set_theme rc params — both renders fully legible with no dark-on-dark or light-on-light failures.
  • Both fixes from the Attempt 1 review are correctly applied and now reflected in the render: title includes "python", marker size reduced to s=90.
  • Clean, idiomatic KISS structure, reproducible via a seeded np.random.default_rng(42), spines removed, subtle grid, realistic mixture-distribution sample that visibly demonstrates the Q-Q deviation the spec asks for.

Weaknesses

  • Only the upper/right tail visibly strays from the reference envelope; the sample could show a touch more variety in deviation (e.g. mild left-tail behavior) for fuller Q-Q feature coverage — minor polish, not a correctness issue.
  • In the dense mid-section (theoretical quantiles roughly -1 to 1), overlapping markers merge into a near-continuous ribbon; slightly smaller markers or more transparency there would keep individual points distinguishable, though this doesn't rise to an Element Visibility failure.

Issues Found

  1. DE-03 MINOR: Only one tail demonstrates deviation from normality
    • Fix (optional, non-blocking): Introduce a touch of left-tail deviation too, for fuller feature coverage of Q-Q characteristics.

AI Feedback for Next Attempt

No further changes required — this implementation is approved. If revisited in the future, consider adding a touch of left-tail deviation to the sample data for even fuller Q-Q feature coverage, purely optional polish.

Verdict: APPROVED

@github-actions github-actions Bot added quality:92 Quality score 92/100 ai-approved Quality OK, ready for merge and removed quality:65 Quality score 65/100 labels Jul 24, 2026
@MarkusNeusinger
MarkusNeusinger merged commit 29659b8 into main Jul 24, 2026
3 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the implementation/qq-basic/seaborn branch July 24, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt ai-attempt-2 Second repair attempt quality:92 Quality score 92/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant