feat: banded context layer — cited typical ranges under every KPI (#48) - #62
Merged
Conversation
#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48
Implemented by the autonomous loop: DA (deepseek/deepseek-v4-flash) → deterministic gate (test, vet, fmt) → QAA (anthropic/claude-haiku-4.5) approved.