Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

feat(web): show "at least N" cycles on the conformance page when the count is capped (#4666)

Raghav Chamadiya8c03bc7a1dad
diff --git a/packages/web/messages/en.json b/packages/web/messages/en.json
index e61a035a1..04bc12921 100644
--- a/packages/web/messages/en.json
+++ b/packages/web/messages/en.json
@@ -1575,8 +1575,10 @@
"violationsDescription": "Dependencies that exist in the graph but are forbidden by a rule you declared.",
"violationBreaks": "Breaks",
"cyclesTitle": "Dependency cycles ({count})",
+ "cyclesTitleAtLeast": "Dependency cycles (at least {count})",
"cyclesDescription": "Groups of services that depend on each other in a loop, so none of them can be changed or deployed independently.",
"cyclesDetectedNotListed": "{count, plural, one {# cycle detected, but not listed} other {# cycles detected, but not listed}}",
+ "cyclesDetectedNotListedAtLeast": "At least {count, plural, one {# cycle} other {# cycles}} detected, but not listed; counting stopped at the cap",
"noCyclesTitle": "No circular dependencies",
"cyclesUnlistedDescription": "The count is recomputed from the system graph, but the services in each cycle are recorded by the conformance check. Run it to see which services are involved.",
"noCyclesDescription": "Every dependency in the graph runs one way. Nothing has to be changed in lockstep.",
@@ -1604,7 +1606,8 @@
"coreSizeSubPct": "{pct}% of all services",
"coreSizeSub": "mutually dependent centre",
"cycles": "Cycles",
- "cyclesSub": "circular service dependencies"
+ "cyclesSub": "circular service dependencies",
+ "cyclesAtLeast": "{count}+"
},
"aiPrompt": {
"label": "Fix violations with AI",
diff --git a/packages/web/messages/zh-CN.json b/packages/web/messages/zh-CN.json
index c4f551a93..7274342df 100644
--- a/packages/web/messages/zh-CN.json
+++ b/packages/web/messages/zh-CN.json
@@ -1575,8 +1575,10 @@
"violationsDescription": "图中存在、但被你声明的规则禁止的依赖。",
"violationBreaks": "违反",
"cyclesTitle": "依赖循环({count})",
+ "cyclesTitleAtLeast": "依赖循环(至少 {count})",
"cyclesDescription": "互相循环依赖的一组服务,其中任何一个都无法独立变更或部署。",
"cyclesDetectedNotListed": "检测到 {count} 个循环依赖,但未列出",
+ "cyclesDetectedNotListedAtLeast": "检测到至少 {count} 个循环依赖,但未列出;计数在达到上限时停止",
"noCyclesTitle": "没有循环依赖",
"cyclesUnlistedDescription": "该计数由系统图重新计算,但每个循环中的服务由一致性检查记录。运行它即可看到涉及哪些服务。",
"noCyclesDescription": "图中每条依赖都是单向的,没有任何东西需要同步变更。",
@@ -1604,7 +1606,8 @@
"coreSizeSubPct": "占全部服务的 {pct}%",
"coreSizeSub": "相互依赖的中心",
"cycles": "循环",
- "cyclesSub": "服务间的循环依赖"
+ "cyclesSub": "服务间的循环依赖",
+ "cyclesAtLeast": "{count}+"
},
"aiPrompt": {
"label": "用 AI 修复违规",
diff --git a/packages/web/src/app/workspace/conformance/page.tsx b/packages/web/src/app/workspace/conformance/page.tsx
index a4c5a9ed8..ed4274c57 100644
--- a/packages/web/src/app/workspace/conformance/page.tsx
+++ b/packages/web/src/app/workspace/conformance/page.tsx
@@ -70,6 +70,8 @@ export default async function ConformancePage() {
// graph with no edges would read as "no cycles", which nothing measured.
const undetermined = metrics != null && metrics.score === null;
const cycleCount = metrics?.cycle_count ?? cycles.length;
+ // The enumeration budget stopped the count, so it is a floor, not a total.
+ const cycleCountCapped = metrics?.cycle_count_capped === true;
const notDetermined = t("notDetermined");
const fixed = (value: number | null | undefined, digits: number) =>
value == null ? "—" : value.toFixed(digits);
@@ -105,7 +107,12 @@ export default async function ConformancePage() {
},
{
label: t("ribbon.cycles"),
- value: metrics && !undetermined ? formatNumber(cycleCount) : "—",
+ value:
+ metrics && !undetermined
+ ? cycleCountCapped
+ ? t("ribbon.cyclesAtLeast", { count: formatNumber(cycleCount) })
+ : formatNumber(cycleCount)
+ : "—",
sub: t("ribbon.cyclesSub"),
},
];
@@ -220,7 +227,13 @@ export default async function ConformancePage() {
</OverviewSection>
<OverviewSection
- title={undetermined ? t("cyclesTitleUndetermined") : t("cyclesTitle", { count: cycleCount })}
+ title={
+ undetermined
+ ? t("cyclesTitleUndetermined")
+ : cycleCountCapped
+ ? t("cyclesTitleAtLeast", { count: cycleCount })
+ : t("cyclesTitle", { count: cycleCount })
+ }
description={t("cyclesDescription")}
>
{cycles.length === 0 && undetermined ? (
@@ -234,7 +247,9 @@ export default async function ConformancePage() {
className="p-6"
title={
cycleCount > 0
- ? t("cyclesDetectedNotListed", { count: cycleCount })
+ ? cycleCountCapped
+ ? t("cyclesDetectedNotListedAtLeast", { count: cycleCount })
+ : t("cyclesDetectedNotListed", { count: cycleCount })
: t("noCyclesTitle")
}
description={