Repository navigation
Description
Problem or Motivation
The terminal output of devops (Rich 15.0.0) has no rich.theme.Theme:
- 688 inline markups in 59 files with 23 style combinations, and 162
style=arguments. - The success mark has 6 styles, the error mark has 2 styles (red and bold red), and the warning has 3 marks.
- 4 severity maps do not agree:
review/report.py:123,commands/review.py:996,output/formatters/scalars.py:20andcommands/scan.py:85. LOW is cyan or blue, HIGH is red or orange3, and INFO is green, the same as success. - The syntax theme is monokai on every terminal (
config/defaults.py:380). - Status logic reads emoji in strings:
tables.py:215,report.py:847,reference_extractor.py:609, andpipeline.py:844and2009. - The Textual TUI (8.2.8) is dark only, and its status dots (
ui/projections.py:38-40) have no word.
Proposed Solution & Architectural Design
- Add
src/devops_cli/design/roles.iniwith two sections.[styles]is the Rich theme.[grafana]holds the Grafana color names of the same status roles (oktext, warnsemi-dark-orange, errorred), which the Grafana color item reads. - Roles in
[styles], as ANSI names (a hex value becomes grey code 90 on 16-color terminals, and Rich cannot detect a light background):status.okgreen,status.warnyellow,status.errorbold red,status.infodefault;sev.criticalbold red,sev.highred,sev.mediumyellow,sev.lowdefault,sev.infodim;muteddim,headingbold,table.headerbold,borderdim,accentcyan,linkunderline cyan,codecyan. get_console()loadsTheme.read()ofroles.iniand setshighlight=False.- Each status prints a mark and a word: "OK" with the check mark, "! Warn", "Fail" with the ballot x, "i Info".
- One severity map replaces the 4 maps. INFO is no longer green.
- The syntax theme
ansi_darkreplaces monokai, withansi_lightas a setting. - A status enum replaces the emoji reads in status logic.
messages.pymoves to role names. textual_theme(mode)in the design module registersdevops-lightanddevops-darkfrom the token JSON of feat(design): add the design tokens and their build #4738: primaryaccent, warningstatus.warn, errorstatus.error, successstatus.ok, foregroundfg, backgroundbg, surface and panelsurface. The default isdevops-dark, with a setting for light, because Textual cannot detect the terminal background. The status dots get a word.- With
NO_COLORset, the output keeps bold, the marks and the words.
Target Subsystem
Terminal output (src/devops_cli/output/, src/devops_cli/ui/, src/devops_cli/design/).
Existing Tool Considered
rich.theme.Theme.read (Rich 15.0.0, in use) reads an INI file; Rich has the ansi_dark and ansi_light syntax themes and honors NO_COLOR. Textual 8.2.8 (in use) has register_theme. No new dependency. Custom code: one severity map, one status enum and the theme function. Cost (estimate): about 150,000 tokens and 1 day.
Acceptance Criteria
- A test asserts that the status keys of
roles.iniin[styles]and in[grafana]equal the status roles of the tokens. grepfinds 0 emoji comparisons in status logic.- One severity map remains.
- With
NO_COLORset, the output keeps the marks and words (snapshot test). - The Textual app starts with
devops-darkand switches todevops-lightthrough the setting.
Dependencies
- feat(design): add the design tokens and their build #4738 (the token JSON and the status roles).
Source: #4735
Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: Textualize/rich (https://github.com/Textualize/rich), MIT, last activity 2026-11-13, maintained.
Reason: Searches and the facts of Rich 15.0.0, already in use, show it reads named style roles from an INI theme, ships ANSI syntax themes and honors NO_COLOR; the status vocabulary, severity map, enum and Textual themes stay custom code.
Covers:
- Loads named style roles from one INI file with Theme.read
- Ships the ansi_dark and ansi_light syntax themes
- Honors NO_COLOR and a console highlight switch
Lacks:
- No project status roles, grafana section or single severity map
- No status enum, so emoji string comparisons remain
- No token-driven devops-light and devops-dark Textual themes
Proposed design
Problem statement
The terminal output has no shared Rich theme. It uses 688 inline markups in 59 files, 162 style= arguments, six success marks, two error styles and three warning marks. Four severity maps disagree. Status logic reads emoji. The syntax theme is monokai on every terminal. The Textual TUI is dark only, and its status dots have no word. The change adds one theme in src/devops_cli/design/roles.ini, one severity map, a status enum, ANSI syntax themes and token-driven Textual themes. It keeps bold, marks and words when NO_COLOR is set.
Acceptance criteria
Requirement: Shared console status theme
The console SHALL load the status-role styles from src/devops_cli/design/roles.ini through rich.theme.Theme.read and SHALL set highlight=False.
Scenario: Console role styles
- WHEN A test calls
get_console()and reads thestatus.okandstatus.errorstyles. - THEN The
status.okstyle isgreen, thestatus.errorstyle isbold red, andconsole.highlightis false.
Requirement: Grafana status color access
The design module SHALL expose grafana_color(role) that reads the [grafana] section of src/devops_cli/design/roles.ini.
Scenario: Grafana status colors
- WHEN A test calls
grafana_color('ok'),grafana_color('warn')andgrafana_color('error'). - THEN The function returns
text,semi-dark-orangeandred.
Requirement: Status mark and word
Each status SHALL print one mark and one word: the check mark with OK, ! with Warn, the ballot x with Fail, and i with Info.
Scenario: Status rendering
- WHEN A test renders OK, Warn, Fail and Info through the status helper.
- THEN The text holds
✓ OK,! Warn,✗ Failandi Info.
Requirement: Single severity map
The code SHALL keep one severity map and SHALL make the four former severity paths use it.
Scenario: Severity map sites
- WHEN A test imports the severity map and inspects
src/devops_cli/review/report.py,src/devops_cli/commands/review.py,src/devops_cli/output/formatters/scalars.pyandsrc/devops_cli/commands/scan.py. - THEN It finds one map, and each former site uses it.
Requirement: Status enum
Status logic SHALL compare a status enum and SHALL contain zero emoji comparisons.
Scenario: Status logic scan
- WHEN A test scans
src/devops_clifor comparisons to emoji string literals in status code. - THEN It finds zero emoji comparisons.
Requirement: Syntax theme setting
The syntax highlighter SHALL use ansi_dark by default and SHALL use ansi_light when the setting selects it.
Scenario: Syntax theme selection
- WHEN A test builds output with the default setting and with the
ansi_lightsetting. - THEN The syntax theme is
ansi_darkby default andansi_lightwith the setting.
Requirement: Textual theme registration
textual_theme(mode) in the design module SHALL register devops-light and devops-dark from the token JSON and SHALL map primary to accent, warning to status.warn, error to status.error, success to status.ok, foreground to fg, background to bg, and surface and panel to surface.
Scenario: Theme mode selection
- WHEN A test calls
textual_theme('dark')andtextual_theme('light'). - THEN It gets the two registered themes with the mapped colors, and the app default is
devops-dark.
Requirement: Textual status dot words
The Textual status dots SHALL show a word with each dot.
Scenario: Projection status dot
- WHEN A test renders a projection with a status.
- THEN The dot carries the matching status word.
Requirement: NO_COLOR output
With NO_COLOR set, the output SHALL keep bold, the marks and the words and SHALL contain no color.
Scenario: NO_COLOR snapshot
- WHEN A test renders status output with
NO_COLOR=1. - THEN The snapshot has bold styling, the marks and the words, and no color escape.
Requirement: Textual theme setting
The Textual app SHALL start with devops-dark and SHALL switch to devops-light through the setting.
Scenario: Textual theme setting
- WHEN A test starts the app with the default setting and with the light setting.
- THEN The app theme is
devops-darkby default anddevops-lightwith the light setting.
Existing Tool Considered
Rich (https://pypi.org/project/rich) is in use and is maintained. It covers theme loading with rich.theme.Theme.read, the ansi_dark and ansi_light syntax themes, NO_COLOR handling, and named style roles. It lacks the project's status-role vocabulary, the [grafana] section, one shared severity map, a status enum, mark-plus-word status rendering, and token-driven Textual devops-light/devops-dark themes. The custom code is one roles.ini, one severity map, one status enum, grafana_color(role) and textual_theme(mode). No new dependency is needed. Written cost: about 150,000 tokens and 1 day.
Key questions
- Which file format and loader should hold the shared status roles?: Use
src/devops_cli/design/roles.iniwith[styles]and[grafana]. Load[styles]withrich.theme.Theme.readinget_console(). (best practice) [sources: src/devops_cli/output/console.py]- Chosen: INI file read by Rich Theme.read. Rich reads it directly, and the Grafana item reads the same keys from one file.
- Rejected: Python dictionary in a module. It splits the Grafana names from the Rich theme and needs extra code.
- Rejected: TOML file. Rich Theme.read does not read TOML, so it adds a parser.
- Which color values should the theme roles use?: Use ANSI names:
status.okgreen,status.warnyellow,status.errorbold red,status.infodefault;sev.criticalbold red,sev.highred,sev.mediumyellow,sev.lowdefault,sev.infodim;muteddim,headingbold,table.headerbold,borderdim,accentcyan,linkunderline cyan,codecyan. (best practice) [sources: docs/DESIGN.md:266]- Chosen: ANSI color names. A hex value becomes grey code 90 on a 16-color terminal, and Rich cannot detect a light background.
- Rejected: Hex values. They collapse to grey on 16-color terminals and need background detection.
- Rejected: 256-color values. They need a palette and do not work on a 16-color terminal.
- How should each status show its state?: Print one mark and one word:
✓ OK,! Warn,✗ Failandi Info. (best practice) [sources: src/devops_cli/output/formatters/tables.py:215, docs/DESIGN.md:266]- Chosen: Mark plus word. It stays readable with no color and in snapshots.
- Rejected: Emoji only. It is not readable in NO_COLOR and is hard to test.
- Rejected: Word only. It loses the fast visual cue that the marks give.
- How should the code consolidate severity?: Keep one severity map with
sev.criticalbold red,sev.highred,sev.mediumyellow,sev.lowdefault andsev.infodim. INFO is not green. The four legacy paths import it. (best practice) [sources: src/devops_cli/review/report.py, src/devops_cli/commands/review.py, src/devops_cli/output/formatters/scalars.py:20, src/devops_cli/commands/scan.py:85]- Chosen: One shared severity map. It removes four disagreeing maps and keeps LOW, HIGH and INFO consistent.
- Rejected: Keep four maps. They disagree on LOW, HIGH and INFO.
- Rejected: Reuse status roles for severity. Severity and status are different vocabularies, and INFO must not be green.
- How should status logic stop reading emoji strings?: Add one status enum and make status logic compare enum members.
messages.pyuses role names. (best practice) [sources: src/devops_cli/output/formatters/tables.py:215, src/devops_cli/review/report.py:847, src/devops_cli/security/reference_extractor.py:609]- Chosen: Status enum. It gives one typed value for status and removes string comparisons.
- Rejected: String constants. They still compare strings and can drift.
- Rejected: Regular expressions on output. They parse rendered text and are fragile.
- Which syntax theme should be the default?: Use
ansi_darkby default and exposeansi_lightas a setting. (best practice) [sources: src/devops_cli/config/defaults.py:380]- Chosen: ansi_dark default, ansi_light setting. Rich ships both ANSI themes and they follow the terminal palette.
- Rejected: monokai. It puts one palette on every terminal.
- Rejected: ansi_light default. The project terminals are mostly dark; light stays a setting.
- How should the Textual themes map the design tokens?:
textual_theme(mode)registersdevops-lightanddevops-darkfrom the token JSON. Primary uses accent, warning status.warn, error status.error, success status.ok, foreground fg, background bg, surface and panel surface. The default isdevops-dark, with a setting for light. (best practice) [sources: src/devops_cli/ui/projections.py:38-40]- Chosen: Token-driven Textual themes. It keeps the TUI on the same tokens as the rest of the design.
- Rejected: Hard-coded Textual CSS. It duplicates colors and cannot follow the token files.
- Rejected: Built-in Textual themes. They do not carry the project's status roles or token names.
- How should
NO_COLORchange output?: WithNO_COLORset, keep bold, the marks and the words, and remove color. (best practice) [sources: src/devops_cli/output/console.py]- Chosen: Keep bold, marks and words. It keeps output readable in pipes and on no-color terminals.
- Rejected: Strip all styling. It loses emphasis and NO_COLOR does not require it.
- Rejected: Disable output. NO_COLOR asks for no color, not no output.
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.(output)scope of the title gives the scope.It unifies inconsistent status colors and adds theming, but does not fix a broken function or a security gap.Users see consistent status marks and words across all commands instead of four disagreeing severity maps and emoji reads.The body estimates one day and touches 59 files, a new design module, a status enum, and the Textual TUI.Both target terminal output formatting, but #326 delivers the renderables pipeline and capability negotiation, while the candidate delivers a specific theme file with status roles and a unified severity map.devops-cli-service commentedon Nov 15, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: The searches found no library that ships a status-role theme, one severity map and mark-plus-word status output for a project's own vocabulary. Rich, which the issue already names as in use, does cover a real part of the need with
rich.theme.Theme.readfor an INI theme, the built-inansi_dark/ansi_lightsyntax themes andNO_COLORhandling, but the role vocabulary, severity map, status enum and Textual token themes stay custom code.The repository already uses this tool.
Tool: rich (https://pypi.org/project/rich)
Covers:
rich.theme.Theme.read, whichget_console()can use for the[styles]rolesansi_darkandansi_lightsyntax themes that replace monokaiNO_COLORwhile keeping non-color styling such as boldLacks:
status.ok,status.warn,status.error,status.info,sev.*,muted,heading,border,accent,link,code) defined for this project[grafana]section that maps the same status roles to Grafana color namesdevops-light/devops-darktheme registration and status-dot wordsTools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 0857ee5 (see proposed design in issue body).
9 remaining items
devops-cli-service commentedon Nov 28, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://pypi.org/project/rich. A person decides what the new result means for the item.Searches (6)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Released in v0.237.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.237.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 18:38 UTC