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.

chore(health): bump the analyzer stamp so code-origin changes re-score stored indexes (#4668)

Raghav Chamadiyaee6e92ea3c87
diff --git a/packages/core/src/repowise/core/analysis/health/engine.py b/packages/core/src/repowise/core/analysis/health/engine.py
index afcbea2f8..37747d772 100644
--- a/packages/core/src/repowise/core/analysis/health/engine.py
+++ b/packages/core/src/repowise/core/analysis/health/engine.py
@@ -102,6 +102,13 @@ log = structlog.get_logger(__name__)
# Not a licence to move a calibrated scoring weight — those are frozen
# independently of this stamp.
#
+# v43: the code-origin classifier moved for several path shapes: a nested
+# ``tools/`` folder is production (only a repo-root or engineering ``tools/``
+# stays tooling), Python ``_vendor/`` folders and Salesforce static-resource
+# libraries read as vendored, and prefixed migration folders under ``db/`` read
+# as migrations. Stored origins decide health and dead-code scope, so those
+# files re-score.
+#
# v42: a JavaScript-family file under a ``tests/`` folder inside a ``src`` tree
# is production unless its name or a test directory says otherwise, and the
# cross-file assertion pass reads the stored test flag, which moves scope and
@@ -407,7 +414,7 @@ log = structlog.get_logger(__name__)
# forms. Files that were counted untested and are not become tested, which
# moves untested-hotspot findings and the scores that carry them, on every
# language with a prefix or spec convention rather than Ruby alone.
-HEALTH_ANALYZER_VERSION = 42
+HEALTH_ANALYZER_VERSION = 43
def _log_duplication_diagnostics(report: DuplicationReport) -> None:
diff --git a/packages/web/messages/en.json b/packages/web/messages/en.json
index 11433a277..c79460de0 100644
--- a/packages/web/messages/en.json
+++ b/packages/web/messages/en.json
@@ -535,7 +535,7 @@
"coChangeNoticeTitle": "Health scores changed in this release.",
"coChangeNoticeMore": "What changed",
"coChangeNoticeLess": "Hide",
- "coChangeNoticeBody": "Large, well-structured code scores fairer. A file's code-shape deductions follow a saturating curve, and several findings on one function count as one group, so a single big function no longer sinks a whole file, while a critical function still costs more the further it passes its threshold. brain_method is advisory, so it no longer deducts on top of the complexity and size findings it summarises. Repeated change-history findings count the largest in full and the rest at a fraction. Parameter counts cover C, C++ and Kotlin, so primitive_obsession reaches those languages, and the bumpy-road marker is called repeated nesting. Most files score higher; functions far past their thresholds, and C, C++ and Kotlin files, can move either way.",
+ "coChangeNoticeBody": "Some files now count as a different kind of code. A tools/ folder below the repo root is product code, so it is scored; only a root-level or engineering tools/ folder stays tooling. Python _vendor/ folders and Salesforce static-resource libraries count as vendored code, and prefixed migration folders under db/ count as migrations, so they leave the score. Repos with those folders can move either way; other repos keep their scores.",
"tabs": {
"performance": "Performance",
"findings": "Findings",
diff --git a/packages/web/messages/zh-CN.json b/packages/web/messages/zh-CN.json
index 564c55409..cad8b2003 100644
--- a/packages/web/messages/zh-CN.json
+++ b/packages/web/messages/zh-CN.json
@@ -535,7 +535,7 @@
"coChangeNoticeTitle": "本次发布中健康分数发生了变化。",
"coChangeNoticeMore": "有哪些变化",
"coChangeNoticeLess": "收起",
- "coChangeNoticeBody": "结构良好的大型代码得分更公平。文件的代码形态扣分采用饱和曲线,同一函数上的多个发现按一组计算,因此单个大函数不会再拖垮整个文件,而严重超标的函数超出阈值越多,扣分仍然越多。brain_method 改为提示性标记,不再在其概括的复杂度和规模发现之外重复扣分。重复的变更历史发现中,最大的一项全额计入,其余按比例计入。参数计数覆盖 C、C++ 和 Kotlin,primitive_obsession 也随之适用于这些语言;bumpy-road 标记更名为 repeated nesting(重复嵌套)。大多数文件的分数会升高;远超阈值的函数以及 C、C++ 和 Kotlin 文件的分数可能升高也可能降低。",
+ "coChangeNoticeBody": "部分文件的代码类型已重新归类。仓库根目录以下的 tools/ 文件夹现在算作产品代码并参与评分;只有根目录或工程用的 tools/ 文件夹仍算作工具代码。Python 的 _vendor/ 文件夹和 Salesforce 静态资源库算作第三方代码,db/ 下带前缀的迁移文件夹算作迁移代码,因此不再参与评分。含有这些文件夹的仓库分数可能升高或降低;其他仓库分数不变。",
"tabs": {
"performance": "性能",
"findings": "发现",
diff --git a/packages/web/src/app/repos/[id]/code-health/code-health-view.tsx b/packages/web/src/app/repos/[id]/code-health/code-health-view.tsx
index 95750b670..0a9a8a835 100644
--- a/packages/web/src/app/repos/[id]/code-health/code-health-view.tsx
+++ b/packages/web/src/app/repos/[id]/code-health/code-health-view.tsx
@@ -385,7 +385,7 @@ export function CodeHealthView() {
release's version so a reader who dismissed an earlier one sees it. */}
<ReleaseNotice
id="health-scoring"
- version="0.58.0"
+ version="0.59.0"
detail={t("coChangeNoticeBody")}
detailLabel={t("coChangeNoticeMore")}
hideLabel={t("coChangeNoticeLess")}
diff --git a/tests/unit/health/test_model_version_coupling.py b/tests/unit/health/test_model_version_coupling.py
index ea2caae4d..5648e7522 100644
--- a/tests/unit/health/test_model_version_coupling.py
+++ b/tests/unit/health/test_model_version_coupling.py
@@ -22,7 +22,7 @@ from repowise.core.analysis.health.refactoring.identity import (
# The three stamps as they stand together. Moving either identity model means
# moving the analyzer with it, and updating this tuple in the same commit.
-_STAMPS = (42, 3, 4)
+_STAMPS = (43, 3, 4)
def test_the_identity_models_and_the_analyzer_stamp_are_pinned_together() -> None: