Skip to content

feat: v1 rename + print-grade visual report system (Deep Teal & Graphite), live-validated on O2C & P2P - #3

Merged
anmolg1997 merged 12 commits into
mainfrom
feat/better-results
Jun 3, 2026
Merged

feat: v1 rename + print-grade visual report system (Deep Teal & Graphite), live-validated on O2C & P2P#3
anmolg1997 merged 12 commits into
mainfrom
feat/better-results

Conversation

@anmolg1997

Copy link
Copy Markdown
Collaborator

What this PR does

Builds on the merged #2. Two themes: (1) make the Discovery Report a genuine print-grade,
visually distinctive deliverable
, and (2) rename prototype/v1/ ahead of versioned work.
Rendering layer only — the discovery/synthesis logic and every number are unchanged and re-validated.

1. Rename prototype/v1/

git mv (history preserved); updated all path references (CI working-dir, pre-commit pyrefly
path + filter, .gitignore, README/CONTRIBUTING/SECURITY/CODEOWNERS/templates/research docs,
in-tree docstrings). Verified green from v1/.

2. Print-grade PDF (fixes a real "sparse / generic" complaint)

Validated the rendered PDFs page-by-page (not just markup) and fixed:

  • Full-bleed branded cover (was a floating box in whitespace) via @page cover { margin:0 }.
  • Running chrome via CSS @page margin boxes (brand top-right, Confidential + page number
    bottom) — replaces Chrome's broken header-template flags; no heading collisions.
  • Relaxed break rules so pages fill (no more half-empty pages).
  • scripts/make_pdf.py produces one print-quality PDF per domain.

3. Visual system — "Deep Teal & Graphite", editorial-consulting

Distinct from the generic AI-report look:

  • Identity: deep teal as the single brand accent (anchored to the cover), system serif
    display type (offline-safe), section-number heading chips, KPI category icons.
  • Roadmap timeline (Report 05): three teal horizon columns on a NOW→LATER arrow with
    opportunity dots — was a near-empty text page.
  • Grounded charts: unfulfilled-by-channel as a magnitude bar (R02) and a share donut
    (R06) — pure inline SVG, teal house-style, values grounded, omitted where data is absent.
  • Before/After visual (Report 04): colour-coded Today → teal arrow → With-the-change panels.

4. Bug fixes surfaced by visual review

  • Domain-agnostic violation fixed: r03/r04 hardcoded O2C dependency strings
    ("Customer Master Reconciliation", "AI Credit Decisioning") that leaked into the P2P report —
    now derived generically from each opportunity's own dependencies → its actual titles.
  • Split single-line def helpers to remove a coverage branch-arc quirk (cleaner too).

Anti-fabrication discipline (unchanged, still enforced)

"Code does the math; the LLM does the reasoning." Every chart/KPI/figure traces to a verified
finding; visuals omit themselves when grounded data is absent; Report 01 stays factual. Verified by
the synthesis grounding gate and by independent recomputation from raw inputs.

Validation

  • Reviewed every page, both domains (o2c + p2p), HTML and PDF — by looking at rendered output.
  • Chart/KPI values re-validated against raw inputs (e.g. unfulfilled by channel: EDI 1,196 /
    Manual 320 / Email 111 — exact).
  • Full-bleed cover + TOC + page chrome intact; pages fill; cross-domain generalization holds
    (P2P renders the same system, zero code changes; omits charts it has no data for).
  • 163 tests, 100% statement+branch coverage (CI fail_under=100), pyrefly clean, grounding
    • factual guards pass on both domains.

Out of scope

  • The spec-driven workflow artifacts (spec-kit scaffold + specs) are kept local and gitignored,
    not committed (by request).
  • A web/interactive UI is a later phase.

anmolg1997 added 12 commits June 3, 2026 17:12
…age chrome, bar/donut)

Reviewed our rendered PDF page-by-page against Akhilesh's prior report (now seen as
a PDF): our content/narrative matches or beats his bar, but the document PRESENTATION
fell short. This closes that gap.

Document craft:
- Branded cover page (teal geometric, AuroPro mark) — domain + brand; client name only
  when known AND not suppressed (honours the existing leak-suppression).
- Table of Contents page with section numbers + dotted leaders.
- Print stylesheet: @page A4 margins, break-inside:avoid on cards/tables/charts/panels,
  break-after:avoid on headings — clean pagination, no mid-element splits.
- scripts/make_pdf.py: renders the suite to one print-quality PDF with native running
  header (title + brand) and footer (page numbers + Confidential). CSS position:fixed
  repeats unreliably across print pages, so chrome is done via the PDF tool's margin boxes.

Charts / visuals (pure inline SVG, offline-safe, grounded inputs only):
- New 'unfulfilled orders by channel' bar (EDI vs Manual vs Email) — code-derived in
  build.derive_charts() from the grounded findings, never model-set.
- value_bar_svg + render_charts helpers; value/feasibility plot gains 4 quadrant labels
  + shaded 'do first' zone so empty space reads as the map, not missing data.
- _metric now prepends the formatted grounded figure when the model's chip text lacks a
  number (e.g. '€30.7M — aggregate divergence addressed').
- KPI tiles lay out 5-across in print.

models: SynthesisContent.charts (code-owned). 160 tests, 100% coverage, pyrefly clean,
grounding + factual-report-01 guards hold. pypdf added (dev, for the PDF merge).
… merged PDFs

Both suites re-rendered with cover, TOC, print stylesheet, new charts; plus single-file
PDFs (out/o2c-report.pdf, out/p2p-report.pdf) via scripts/make_pdf.py. P2P charts empty
by design (no multi-channel count breakdown in its data).
(Empty commit; the prior two pushes did not register a CI run. Local gate is green:
160 tests, 100% coverage, pyrefly clean.)
…ges (no sparse whitespace)

Validated the actual rendered PDFs page-by-page (not just markup) and found the
committed PDFs were poor: cover floated in a box with whitespace, Chrome's DEFAULT
date/url header+footer showed (make_pdf's --print-to-pdf-header-template flags are
silently ignored in headless), and aggressive break rules left pages ~half empty.
Charts WERE in the HTML and rendered on screen — the gap was the print/PDF layer.

Fix (CSS @page margin boxes render reliably in headless Chrome):
- Full-bleed teal/slate cover via @page cover { margin:0 } (210x297mm).
- Running chrome via @page margin boxes: brand top-right, Confidential bottom-left,
  Page N bottom-right — no heading collisions.
- Relaxed breaks: keep small blocks whole (charts/KPIs/panels/rows); tall prose cards
  may split so pages fill. O2C 31->29 pages.
- make_pdf.py: dropped the non-working template flags; suppress Chrome's own chrome and
  let the CSS @page boxes show, then concatenate.

Verified visually on BOTH domains, HTML + PDF: full-bleed cover, page chrome, all
charts render, pages fill. Regenerated suites + merged PDFs. 160 tests, 100%, pyrefly clean.
Rename the engine directory to v1/ ahead of the visual-system upgrade. git mv preserves
history; updated all path references (CI working-dir, pre-commit pyrefly path + filter,
.gitignore, README/CONTRIBUTING/SECURITY/CODEOWNERS/templates/research docs, in-tree
docstrings/comments, .env.example, doctor, smoke_test).

Also split three single-line def helpers (tools._round_*, render px/py) into two-line
defs — removes a coverage branch-arc quirk and reads cleaner. Verified from v1/: 160
tests, 100% coverage, pyrefly clean, doctor PASS. Suites + PDFs regenerated under v1/.
… serif display)

Spec-driven (specs/001-report-visual-system: constitution + spec + plan + tasks; identity
approved). Phase 0 establishes the visual identity:
- Palette: deep teal #0f7c8c is now the single brand accent (replaces generic blue), anchored to
  the cover; sparing warm bronze #c8772e reserved for highest-impact emphasis; cohesive teal
  chart-series ramp. CSS :root tokens + an 8px spacing scale.
- Display type: system serif stack (Iowan/Charter/Georgia — offline-safe) on headings, cover title,
  big stat numbers — authored editorial feel, not generic-AI sans.
- Recoloured all inline-SVG helpers (flow/data-flow/bars/bubble/donut + series) to teal.
- Section-number chip + KPI icon styles staged for Phase 1.

Includes the spec-kit scaffolding + the visual-system spec/plan/tasks/constitution.
Rendering-only; numbers unchanged. 160 tests, 100% coverage, pyrefly clean.
- Teal section-number chips on numbered h2 headings (1.1, 1.2, ...) via a post-render
  wrapper — designed heading rhythm instead of plain underlines. h1 / unnumbered untouched.
- KPI tiles get a small inline-SVG category glyph (currency / pie / alert / bulb / doc),
  chosen by what the tile measures; serif numbers from Phase 0.
- Recoloured remaining blues (metric chips, table headers, .chip, sidebar) to teal family.
- Tests for _secnum_chips + _kpi_icon. 162 tests, 100% coverage, pyrefly clean.
Report 05 was mostly empty text bullets. Added roadmap_timeline_svg: three teal horizon
columns (H1/H2/H3 with window labels), a NOW->LATER time arrow, item cards with an
opportunity dot, and the detailed horizon bullets retained below. Positions encode horizon
+ item order only (no quantitative claim); empty roadmap -> omitted. Pure SVG, teal
house-style, break-inside:avoid. 163 tests, 100% coverage, pyrefly clean.
- derive_charts now emits the unfulfilled-by-channel breakdown as BOTH a magnitude bar
  (Report 02) and a share-of-failures donut (Report 06, 'Where the failures concentrate').
  Every segment is a real grounded count (1196/320/111) — nothing derived or subtracted.
- render_charts gains a  filter so the same grounded series shows as magnitude on one
  report and share on another without duplicating on a page.
- Donut + bar share the teal series ramp + takeaway captions; donut legend uppercases EDI.
- Tests updated (bar+donut series, kinds filter). 163 tests, 100% coverage, pyrefly clean,
  grounding holds.
…eport 04)

Report 04 before/after was two plain text columns. Now a visual transformation: a grey
Today panel, a teal connecting arrow, and a teal-tinted With-the-change panel, each with
the numbered steps. Step text unchanged. Responsive (arrow rotates on narrow). 163 tests,
100% coverage, pyrefly clean.
…suites

Phase-5 review caught a latent domain-agnostic bug: r03/r04 hardcoded O2C dependency strings
leaked into P2P. Now derived from each opportunity's own dependencies -> actual titles.
Regenerated both suites + PDFs with the full visual system. Chart values re-validated vs raw.
163 tests, 100% coverage, pyrefly clean, grounding holds both domains.
Per decision: the spec-kit scaffold (.specify/), the visual-system specs/, and the CLAUDE.md
stub are local workflow artifacts, not committed to the repo. Removed from tracking (files
remain on disk) and gitignored. The implemented work stands on its own.
@anmolg1997
anmolg1997 merged commit 44f4eb2 into main Jun 3, 2026
1 check passed
@anmolg1997
anmolg1997 deleted the feat/better-results branch June 3, 2026 15:38
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.

1 participant