diff --git a/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/ClassMetrics.java b/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/ClassMetrics.java index 34da1947..67b5b90f 100644 --- a/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/ClassMetrics.java +++ b/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/ClassMetrics.java @@ -149,6 +149,14 @@ void freeze() { * sealed class has depth=1; each indirect descendant nests deeper. * Computed post-walk in * {@link GraphMetricsCollector#finalizeMetrics()}. + * + *

Cyclic-depth semantics: the depth is the longest acyclic + * ancestor path terminating at a sealed root within the analyzed + * batch; a class with no such path (including a cycle member whose + * ancestor paths do not reach a sealed root, or a chain dead-ending at a + * non-sealed in-batch class) has depth 0. Ancestors + * absent from the batch preserve a minimum depth of 2 as a + * relationship signal. (Cycle safety: issue #215.) */ @Getter private int sealedHierarchyDepth; diff --git a/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/GraphMetricsCollector.java b/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/GraphMetricsCollector.java index eabbc038..7960b4fb 100644 --- a/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/GraphMetricsCollector.java +++ b/codebase-graph-builder/src/main/java/org/hjug/graphbuilder/metrics/GraphMetricsCollector.java @@ -261,9 +261,12 @@ public void finalizeMetrics() { *