Commit c8e0d2d
feat(ops): workflow_concern module — derive 7-bucket concern from workflow name (A1)
A1 of the Workflows page refinement (docs/specs/ops-workflows-page-refinement/).
Mirrors the spec_lifecycle.py pattern (PR #533 / shipped v7.3.0).
Pure-logic module that maps a workflow's canonical name to one of
seven concern buckets:
- review: code-review, deep-review, security-audit, bug-predict
- test: test-gen, test-audit
- docs: doc-gen, doc-audit, doc-orchestrator
- refactor: simplify-code, refactor-plan
- audit: discovery-sweep, perf-audit, dependency-check
- meta: release-prep, secure-release, orchestrated-health-check,
health-check
- other: rag-code-gen, research-synthesis
Authoritative assignment per
docs/specs/ops-workflows-page-refinement/decisions.md (PR #550 —
merged 2026-06-01).
Module API mirrors spec_lifecycle:
- derive_concern(name) → Concern (with "other" fallback)
- group_by_concern(names) → dict[Concern, list[str]] (sorted)
- concern_counts(names) → dict[Concern, int] (all 7 buckets populated)
- ALL_CONCERNS: ordered tuple for stable UI rendering
Tests (42):
- Per-bucket assignment tests for all 20 workflows (one parameterized
test class per bucket)
- Boundary tests for the 6 trade-off cases ratified in decisions.md
(security-audit/bug-predict in review not audit, test-audit in test
not audit, doc-audit in docs not audit, doc-orchestrator in docs not
meta, perf-audit confirmed in audit)
- Unknown/empty/uppercase name fallback to "other"
- group_by_concern() alphabetical-within-bucket sorting
- concern_counts() always-populates-all-7-buckets contract
- ALL_CONCERNS order stability (chip toolbar depends on this)
- Drift-guard: every workflow returned by list_workflows() has an
explicit (not-fallback) concern mapping; catches the
"add-a-workflow-without-mapping" pattern at CI level
Next in the Workflows page refinement spec:
- A2: wire derive_concern into the route serializer
- A3a/b/c: chip filter + URL params + kebab menu
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent c89d8f7 commit c8e0d2d
2 files changed
Lines changed: 482 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
0 commit comments