Просмотр исходного кода

feat(attribution): S-cfc-118 guhe.lowSide.noSupplement T4 低位补菌红线落地(契约 3 RED -> 6/6 GREEN)

- AttributionLowSideRules: 新增 RULE_NO_SUPPLEMENT=no_supplement 规则码与 NO_SUPPLEMENT_HINT
  「偏低不推荐补菌」口径常量(无成熟证据支持缺X→补X,L4-3)
- AttributionComplianceGate.LowSideNode: 暴露 isNoSupplement()(低侧节点恒 true,源头禁补菌,
  非门禁事后回扫)
- IndicatorInterpretEngine: 偏低条件致病菌含义路径注入「偏低不推荐补菌」口径,源头拦截
  「报告缺 X -> 买含 X 菌株产品」桥接

TDD: GuheLowSideNoSupplementContractTest 基线 3 RED -> 6/6 GREEN
验证: 相邻归因/门禁契约零回归(GuheEvidenceIsolateContractTest 2err 与 GuheLowSideRuleLoadContractTest
7fail 经基线对照确认为先存状态,非本键引入)
E2E Test Bot 3 дней назад
Родитель
Сommit
957cac4e70

+ 9 - 0
cfc-backend/src/main/java/com/etotem/cfc/constant/AttributionLowSideRules.java

@@ -34,6 +34,15 @@ public final class AttributionLowSideRules {
     public static final String RULE_NO_CAUSAL_BRIDGE = "no_causal_bridge";
     public static final String RULE_NO_PRESCRIPTION = "no_prescription";
 
+    /** T4 低位补菌红线(L4-3)规则码:偏低不推荐补菌——无成熟证据支持「缺大肠杆菌→补大肠杆菌」,
+     *  区别于 T5 的 no_causal_bridge(文本回扫),本规则码标识「L4 引擎源头不产出补菌建议」。 */
+    public static final String RULE_NO_SUPPLEMENT = "no_supplement";
+
+    /** T4(L4-3)「偏低不推荐补菌」口径常量(无成熟证据支持缺X→补X),
+     *  供 L4 归因引擎偏低含义路径与报告侧引用,源头拦截「报告缺 X → 买含 X 菌株产品」桥接。 */
+    public static final String NO_SUPPLEMENT_HINT =
+            "偏低不推荐补菌:无成熟证据支持缺X→补X,不推荐购买含该菌株的补菌产品。";
+
     /** G-2 门禁分组码(16S 粒度拦截 / 菌株级推荐阻断,T6 P0) */
     public static final String GROUP_CODE_2 = "G-2";
     public static final String GROUP_TITLE_2 = "16S 粒度拦截组(granularity != strain 禁生成含菌株号的商品推荐)";

+ 5 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/attribution/AttributionComplianceGate.java

@@ -71,6 +71,11 @@ public class AttributionComplianceGate {
         public boolean isAssociationOnly() {
             return true; // 低侧红线组恒为「仅关联」
         }
+
+        /** T4(L4-3)低位补菌红线:任意「偏低」归因节点在源头即标注「不推荐补菌」(恒 true,非门禁事后回扫)。 */
+        public boolean isNoSupplement() {
+            return true;
+        }
     }
 
     /** 单条合规违规 */

+ 5 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/attribution/IndicatorInterpretEngine.java

@@ -1,5 +1,6 @@
 package com.etotem.cfc.service.attribution;
 
+import com.etotem.cfc.constant.AttributionLowSideRules;
 import com.etotem.cfc.constant.AttributionWeights;
 import com.etotem.cfc.constant.ConditionalPathogenLowSideRules;
 import com.etotem.cfc.service.attribution.model.IndicatorReading;
@@ -96,7 +97,10 @@ public class IndicatorInterpretEngine {
             // 文本注入 reading.meaning 供报告 JSON 直接透出(G-1 门禁将反向回扫该文本)。
             if (IndicatorReading.STATUS_LOW.equals(r.getStatus())
                     && ConditionalPathogenLowSideRules.isConditionalPathogen(r)) {
-                r.setMeaning(ConditionalPathogenLowSideRules.lowSideMeaning(r));
+                // T4(L4-3)低位补菌红线:偏低含义源头注入「偏低不推荐补菌」口径常量
+                // (无成熟证据支持缺X→补X),源头拦截「报告缺 X → 买含 X 菌株产品」桥接。
+                r.setMeaning(ConditionalPathogenLowSideRules.lowSideMeaning(r)
+                        + " " + AttributionLowSideRules.NO_SUPPLEMENT_HINT);
                 r.setAssociationOnly(true);
             } else {
                 r.setMeaning(buildMeaning(dim, r));