Skip to content

feat: banded context layer — cited typical ranges under every KPI (#48) - #62

Merged
gkanitz merged 2 commits into
mainfrom
agent/issue-48
Jul 6, 2026
Merged

feat: banded context layer — cited typical ranges under every KPI (#48)#62
gkanitz merged 2 commits into
mainfrom
agent/issue-48

Conversation

@gkanitz

@gkanitz gkanitz commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Closes #48

Implemented by the autonomous loop: DA (deepseek/deepseek-v4-flash) → deterministic gate (test, vet, fmt) → QAA (anthropic/claude-haiku-4.5) approved.

gkanitz and others added 2 commits July 6, 2026 00:15
#48)

Adds an embedded bands.json (5 metric keys with cited ranges), a
metrics/bands Lookup package, an optional BandsBlock on the Report
schema (populated by Build for each present metric), and neutral
context lines in the rendered HTML under each banded KPI.

Files changed:
- metrics/bands/bands.json (new) -- embedded band data with version 1
- metrics/bands/bands.go (new) -- Lookup and Version functions
- metrics/bands/bands_test.go (new) -- Lookup + completeness tests
- report/report.go -- add BandsBlock, BandEntry types, populate in Build
- report/report_test.go -- 6 new tests for bands block behavior
- render/render.go -- bandContext template func + formatBandRange
- render/templates/layout.tmpl -- .context-line CSS (neutral styling)
- render/templates/sections/30-collaboration.tmpl -- 4 band context lines
- render/testdata/sample-report.json -- add bands block to fixture
- render/testdata/sample-report.golden.html -- updated golden
- docs/examples/sample-report.html -- updated docs sample

Key decisions:
- Band context is derived from the report's Bands block, never from the
  embedded file at render time (attested artifact principle).
- Template uses bandContext(...) helper that reads from r.Bands, not
  from bands.Lookup, so what is shown is what is attested.
- Context lines use neutral .context-line styling with no judgment
  colors or grading words.
- pr_size_lines entry is present in bands.json but dormant (no PR size
  metric in Collaboration yet).
- Schema version stays v0; bands block is omitempty; Validate() accepts
  reports without bands (backward compat).

Co-Authored-By: Claude <noreply@anthropic.com>
Fix gofmt alignment, comment indentation, and missing trailing newlines
across the bands-layer implementation. No behavioral changes.

Files: metrics/bands/bands.go, metrics/bands/bands_test.go,
       render/render.go, render/render_test.go, report/report.go

Co-Authored-By: Claude <noreply@anthropic.com>
@gkanitz
gkanitz merged commit ab8144b into main Jul 6, 2026
1 check passed
@gkanitz
gkanitz deleted the agent/issue-48 branch July 6, 2026 00:22
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.

feat: banded context layer — cited typical ranges under every KPI

1 participant