Repository navigation
Description
Problem or Motivation
devops writes no HTML today (0 writers). The one agent HTML artifact uses its own fonts (Archivo, Source Sans 3 and JetBrains Mono), its own palette and its own breakpoints (720 px and 560 px). The project review report (#4679, #4720) and agent HTML artifacts have no shared layout.
Proposed Solution & Architectural Design
- Add
src/devops_cli/design/css/report.css(about 170 lines) that reads only token variables. It has: a byline; numbered captions ("Figure N-M." below a figure, "Table N-M." above a table and outside its scroll box); tables with rules only (a 2 px rule under the header, 1 px rules under rows, no vertical rules, no fills); SLO tiles; status marks as inline SVG shapes with a word (circle with a check "OK", triangle with "!" "Warn", hexagon with "x" "Fail", square with "i" "Info"); margin notes in a 15rem column at 75rem and wider, inline on a phone; scroll boxes for tables, code and charts (tabindex=0,role=region, a label); a theme toggle throughdata-theme. report_css()in the design module returns the token CSS of feat(design): add the design tokens and their build #4738 plusreport.css, so a page can inline both (9.3 KB of token CSS, 3.8 KB gzip).- A small HTML template with the report outline: title; byline (version or period, commit, UTC time); a summary of 3 to 5 sentences with numbers; numbered sections with figures and tables; a postmortem section (summary, impact with n, timeline in UTC, root causes and trigger, resolution and detection, action items, lessons learned) when the period has an incident; an appendix "Method and data".
- A knowledge-base page tells agents to inline the same CSS in HTML artifacts and to load the fonts through Google Fonts (the artifact CSP allows only that font host).
- The ast-grep rule "no color literal in hand-written CSS" covers
report.css. feat(docs): build the docs site theme from the design tokens #4745 adds the rule; if this item merges first, this item adds it.
Target Subsystem
The src/devops_cli/design/ package and the knowledge base.
Existing Tool Considered
The layout model of Tufte CSS 1.9.0 (MIT): reading column, margin notes, full-width figures. The file itself is not used (fixed colors, a fixed font, no custom properties). The report outline takes traits of the Distill template (byline, figure widths, appendix) and no Distill code (not maintained since 2020). Jinja2 (in use) renders the template. Custom code: CSS that reads only tokens. Cost: about 120,000 tokens and 0.5 day.
Acceptance Criteria
- The ast-grep rule finds 0 color literals in
report.css. - A rendered sample report passes a headless browser check: no sideways page scroll at 400 px and 1280 px, chart text 12 px or larger, captions outside the scroll boxes, both themes, 0 console errors.
- A test asserts that
report_css()holds the token CSS andreport.css.
Dependencies
- feat(design): add the design tokens and their build #4738 (the token CSS and
docs/DESIGN.md).
Source: #4735
Alternatives check of 2026-11-26: partly.
Tool: edwardtufte/tufte-css (https://github.com/edwardtufte/tufte-css), MIT, last activity 2026-06-24, maintained.
Reason: Searches found Tufte CSS, the only maintained MIT stylesheet with the report's reading column, margin notes and full-width figures; it has no token variables, theme switch, numbered captions, status marks, scroll boxes or report template, so it covers the layout model only.
Covers:
- Reading column with margin notes and full-width figures
- CSS-only styling with no script
- Rules-only booktabs-style table rules
Lacks:
- No CSS custom properties; fixed colors and one font
- No data-theme switch or second palette
- No numbered captions, SLO tiles or status marks
- No scroll boxes or report outline template
Proposed design
Problem statement
devops-cli writes no shared HTML report today. The one agent HTML artifact uses its own fonts, palette and breakpoints. The project review report and agent artifacts have no shared layout. This change adds a token-driven report.css, a report_css() bundle and a Jinja2 report outline. The live browser layout check is deferred because playwright is absent.
Acceptance criteria
Requirement: Token-only stylesheet
src/devops_cli/design/css/report.css SHALL use only token CSS variables for each color, font, size, space and width.
Scenario: No color literal
- WHEN
uv run pytest tests/design/test_report_css.py::test_no_color_literalruns thecss-color-literalast-grep rule oversrc/devops_cli/design/css/report.css. - THEN The rule reports 0 findings.
Requirement: Inline CSS bundle
devops_cli.design.report_css() SHALL return the four token CSS files in cascade order and then report.css, in one string.
Scenario: Bundle holds both parts
- WHEN
uv run pytest tests/design/test_report_css.py::test_bundle_ordercallsreport_css(). - THEN The string ends with the text of
report.css, and the:rootblock, the@media (prefers-color-scheme: dark)block and the:root[data-theme="dark"]block come before it in that order.
Requirement: Report outline
The Jinja2 template SHALL render a title, a byline with version or period, commit and UTC time, a summary, numbered sections, an appendix "Method and data", and a postmortem section only when the period has an incident.
Scenario: Postmortem only with an incident
- WHEN
uv run pytest tests/design/test_report_template.py::test_postmortem_only_with_incidentrenders the template with a period that has no incident, and again with a period that has one. - THEN The first page has no postmortem section and the second page has one, and both pages hold the title, the byline, the numbered sections and the appendix.
Requirement: Rules-only tables and captions
A table SHALL have a 2 px rule under its header, a 1 px rule under each body row, no vertical rule and no fill, and its caption SHALL sit above the table and outside its scroll box.
Scenario: Table markup
- WHEN
uv run pytest tests/design/test_report_template.py::test_table_markupparses the rendered sample report and readsreport.css. - THEN Each table sits in an element with
tabindex="0"androle="region", itsTable N-M.caption is the previous sibling of that element, andreport.cssholds the 2 px header rule and 1 px row rule with no vertical rule or fill.
Requirement: Status marks
A status mark SHALL be an inline SVG shape with a word: a circle with a check for "OK", a triangle with "!" for "Warn", a hexagon with "x" for "Fail" and a square with "i" for "Info".
Scenario: Each status mark
- WHEN
uv run pytest tests/design/test_report_template.py::test_status_marksrenders a sample report with each status. - THEN Each status shows the named SVG shape and its word.
Requirement: SLO tiles
An SLO tile SHALL show a 36 px number and a status mark with a word.
Scenario: SLO tile
- WHEN
uv run pytest tests/design/test_report_template.py::test_slo_tilerenders a sample report with an SLO tile. - THEN The tile holds the class for a 36 px number and a status mark.
Requirement: Scroll boxes for code blocks
The template SHALL put each code block in a scroll box with tabindex="0", role="region" and a label.
Scenario: Code block scroll box
- WHEN
uv run pytest tests/design/test_report_template.py::test_code_scroll_boxrenders a sample report with a code block. - THEN The code block sits in an element with
tabindex="0",role="region"and anaria-label.
Requirement: Margin notes and breakpoints
report.css SHALL use breakpoint.md (40rem) and breakpoint.lg (75rem) for each @media width, and SHALL place margin notes in a 15rem column at 75rem and wider and inline below that width.
Scenario: Margin note media query
- WHEN
uv run pytest tests/design/test_report_css.py::test_margin_note_columnreadsreport.css. - THEN Each
@mediawidth is 40rem or 75rem, a media query at 75rem sets the margin note column to 15rem, and the base rule places margin notes inline.
Requirement: Theme attribute
The template SHALL set data-theme on <html> when the render context gives a theme, and omit it otherwise.
Scenario: Theme attribute
- WHEN
uv run pytest tests/design/test_report_template.py::test_theme_attributerenders the template with and without a theme. - THEN The page with a theme has
data-theme="light"ordata-theme="dark"on<html>, and the page without a theme has nodata-themeattribute.
Requirement: Fonts link
The template SHALL include a link to the Google Fonts css2 API for Source Serif 4, Source Sans 3 and Source Code Pro with display=swap.
Scenario: Google Fonts link
- WHEN
uv run pytest tests/design/test_report_template.py::test_fonts_linkparses the rendered sample report. - THEN The page holds a
<link>tohttps://fonts.googleapis.com/css2with the three families anddisplay=swap.
Requirement: Agent guideline
The guideline page SHALL tell an agent to inline report_css() in each HTML artifact and to load the Source faces from Google Fonts.
Scenario: Guideline content
- WHEN
uv run pytest tests/invariants/test_guidelines.py::test_agent_html_artifactsreadsdocs/guidelines/agent-html-artifacts.md. - THEN The page names
report_css(), the Google Fonts css2 API anddisplay=swap, anddocs/guidelines/index.mdlinks to the page.
Existing Tool Considered
The alternatives check of 2026-11-26 gives the verdict partly for Tufte CSS (https://github.com/edwardtufte/tufte-css), MIT, maintained. The check block in the issue body lists what it covers and lacks. The change builds its own token-driven report.css and a Jinja2 report outline to supply the missing token variables, data-theme switch, numbered captions, status marks, scroll boxes and template. Cost: about 120,000 tokens and 0.5 day to write, keep and fix.
Key questions
- How does the layout check run without Playwright?: Defer the live browser check to a new issue. The main change uses static tests: the
css-color-literalast-grep rule, a unit test forreport_css(), a template render test, a table and caption parse test, a breakpoint test, and a guideline test. The deferred issue addsplaywrightand the Chromium install. (best practice) [sources: docs/DESIGN.md]- Rejected: Add Playwright as a dependency in this item. The return says
playwrightis absent frompyproject.tomland the workspace. A browser install in CI is test infrastructure, not the report stylesheet. - Chosen: Defer the live browser check to a new issue. The rest of the change is workable with static tests. The deferred issue can add Playwright and the browser check.
- Rejected: Add Playwright as a dependency in this item. The return says
- Where does
report_css()live, and which CSS does it return?: Addsrc/devops_cli/design/report.pywithreport_css(). It reads the built files as package data withimportlib.resourcesand returnstokens-base.css,tokens-light.css,tokens-dark.css,tokens-dark-explicit.css, thenreport.css, in that order. (best practice) [sources: docs/DESIGN.md]- Rejected: Build the CSS text from
devops_cli.design.tokens(mode). The Style Dictionary build already writes the CSS. A second writer drifts from it. - Chosen: Concatenate the built CSS files in cascade order. The token build stays the only writer of the token CSS, and the page inlines one string.
- Rejected: Build the CSS text from
- Where does the report template live, and how does a page render it?: Add
src/devops_cli/templates/report.html.j2and render it with Jinja2 from anEnvironmenton the package template folder, with autoescape on. (best practice) [sources: docs/DESIGN.md]- Rejected: Build the HTML with Python string templates. The repository keeps its templates in
src/devops_cli/templates/, and Jinja2 escapes the values. - Chosen: A Jinja2 template in
src/devops_cli/templates/. It matches the template folder that the repository uses, and Jinja2 is in use.
- Rejected: Build the HTML with Python string templates. The repository keeps its templates in
- Which breakpoints, widths and margin-note column does
report.cssuse?: Use the token widths:size.measure(40rem) for reading text,size.wide(60rem) for figures and tables,size.full(72rem) for the frame andsize.margin(15rem) for margin notes. Usebreakpoint.md(40rem) andbreakpoint.lg(75rem). The margin notes get their column at 75rem and sit inline below it. (best practice) [sources: docs/DESIGN.md]- Rejected: Keep the 720 px and 560 px breakpoints of the existing agent artifact.
docs/DESIGN.mdsets the breakpoints to 40rem and 75rem, and a test compares each@mediawidth with the tokens. - Chosen: Use
breakpoint.mdandbreakpoint.lg. The token values match the design spec and the existing test.
- Rejected: Keep the 720 px and 560 px breakpoints of the existing agent artifact.
- Which fonts does the report load, and through which host?: Load Source Serif 4 for reading text, Source Sans 3 for headings, tables and captions, and Source Code Pro for code, from the Google Fonts css2 API with
display=swap. End each stack with system fonts. (best practice) [sources: docs/DESIGN.md]- Rejected: Keep the artifact fonts Archivo, Source Sans 3 and JetBrains Mono.
docs/DESIGN.mdnames the Source family, and Archivo and JetBrains Mono are not tokens. - Chosen: Load the three Source faces from Google Fonts. The design spec names them, and the artifact CSP allows that host.
- Rejected: Keep the artifact fonts Archivo, Source Sans 3 and JetBrains Mono.
- How do tables, captions and status marks look?: A table has a 2 px rule in
color.fgunder its header, a 1 px rule incolor.borderunder each body row, no vertical rule and no fill. "Table N-M." sits above the table and outside its scroll box, and "Figure N-M." sits below the figure. A status mark is an inline SVG shape with a word: a circle with a check for "OK", a triangle with "!" for "Warn", a hexagon with "x" for "Fail" and a square with "i" for "Info". (best practice) [sources: docs/DESIGN.md]- Rejected: Use a status font glyph. Rule T6 says a web font does not have all mark glyphs.
- Chosen: Inline SVG shape with a word, and rules-only tables. Rules T2 and T6 say so, and color is never the only sign of a state.
- How do the scroll boxes and the phone layout work?: Tables, code blocks and static SVG charts scroll in their own box with
tabindex="0",role="region"and a label. A chart keepssize.chart-min(40rem), so its 12 px text does not shrink. Under 40rem the page is one column, the margin notes sit inline, and the page never scrolls sideways. (best practice) [sources: docs/DESIGN.md]- Rejected: Let the page scroll sideways on a phone. The design spec says the page never scrolls to the side.
- Chosen: One scroll box for each table, code block and chart. Rule T7 and the phone rule give the box its attributes and keep the captions outside it.
- Does this item add a theme toggle script?: No. The token CSS files already switch on
data-theme, so the template writesdata-themeon<html>when a page sets it, and the system theme applies otherwise. The change adds no script, because the CSP of an agent artifact is set outside this item. (best practice) [sources: docs/DESIGN.md]- Rejected: Add an inline toggle script to the template. It needs
script-src, and the CSP of agent artifacts is set outside this item. - Chosen: Switch on
data-themeonly, with no script. The three token CSS files already hold the selectors for both themes.
- Rejected: Add an inline toggle script to the template. It needs
- Does this item change the ast-grep rule
css-color-literal?: No. The rule already rejects a color literal in the hand-written CSS ofsrc/devops_cli/design/css/, so it coversreport.css. Add the rule in this item only when the repository has none at implementation time. (best practice) [sources: docs/DESIGN.md]- Rejected: Wait for feat(docs): build the docs site theme from the design tokens #4745 to extend the rule. The rule covers
src/devops_cli/design/css/already, and feat(docs): build the docs site theme from the design tokens #4745 extends it to the docs siteextra_css. - Chosen: Rely on the rule as it stands. A test that runs the rule over
report.cssgives the gate.
- Rejected: Wait for feat(docs): build the docs site theme from the design tokens #4745 to extend the rule. The rule covers
- Where does the page for agents go?: Add
docs/guidelines/agent-html-artifacts.mdand link it fromdocs/guidelines/index.md. It tells an agent to inlinereport_css()in each HTML artifact and to load the Source faces from Google Fonts. A guideline applies to each managed project, and the docs site publishes it. (best practice) [sources: CONTEXT.md, docs/guidelines/index.md]- Rejected: Add a section to
docs/KNOWLEDGE_BASE.md. That page describes the knowledge base, and a rule for managed projects belongs indocs/guidelines/. - Chosen: A guideline under
docs/guidelines/.CONTEXT.mddefines a guideline as a rule for each managed project, and the docs site publishes it.
- Rejected: Add a section to
- What does the report outline hold, and where do the charts stay?: Title; byline with version or period, commit and UTC time; a summary of 3 to 5 sentences with numbers; numbered sections with figures and tables; a postmortem section (summary, impact with n, timeline in UTC, root causes and trigger, resolution and detection, action items, lessons learned) only when the period has an incident; and an appendix "Method and data". Charts stay in feat(design): render report charts from the design tokens #4758, and the stylesheet gives them a scroll box and token colors only. (best practice) [sources: docs/DESIGN.md, docs/guidelines/sre.md]
- Rejected: Render the postmortem section on each report. The design spec renders it only when the period has an incident.
- Chosen: The outline of the design spec, with the charts in feat(design): render report charts from the design tokens #4758. The design spec and the SRE guideline give the outline, and feat(design): render report charts from the design tokens #4758 holds the chart code.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.design, and .github/labels.yml declares no scope/design label. Add the label to the file to give the scope to this item.It enables other report work but does not block a release or fix a defect.It gives all HTML reports a consistent layout and theme, which users see in every report.The body estimates about 120,000 tokens and 0.5 day of work.Both concern the HTML report look, but the candidate adds the shared CSS and template while #4720 renders one specific project review page.devops-cli-service commentedon Nov 14, 2026
Alternatives check: partly
Reason: The searches found Tufte CSS, an open and maintained stylesheet (MIT, not archived) whose layout model — reading column, sidenotes/margin notes, full-width figures — is exactly the part of the need the issue itself cites. It does not cover the rest of the need: it uses fixed colors and a fixed font with no CSS custom properties, so it cannot serve as the token-driven stylesheet, and it has no report template, theme toggle, numbered captions, SLO tiles, status marks or scroll boxes. No other library was found that covers the whole shared report stylesheet and layout, so Tufte CSS covers only a part.
Tool: edwardtufte/tufte-css (https://github.com/edwardtufte/tufte-css)
Covers:
Lacks:
data-themetabindex=0,role=region, a label)Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at e5dfddb (see proposed design in issue body).
10 remaining items
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.239.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.239.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 20:38 UTC