|
|
@@ -221,6 +221,10 @@ public class AttributionComplianceGate {
|
|
|
if (!strainGranularity) {
|
|
|
out.addAll(matchStrainRecommendation(text));
|
|
|
}
|
|
|
+ // §三 P1-2 介导链路确定性因果审计(health.analysis.mediatorAudit,§5.8):
|
|
|
+ // L5 出文档前对解读/结论文本回扫「导致/治愈/改善/典型表现/正是…的根/拖了…后腿」,
|
|
|
+ // 命中即收集为违规(建议改写为 相关联/报告提示/可能与…有关/待进一步确认)。
|
|
|
+ out.addAll(matchMediatorAudit(text));
|
|
|
return out;
|
|
|
}
|
|
|
|
|
|
@@ -299,6 +303,30 @@ public class AttributionComplianceGate {
|
|
|
|
|
|
// ==================== 内部 ====================
|
|
|
|
|
|
+ /**
|
|
|
+ * §三 P1-2 介导链路确定性因果审计(§5.8):对解读/结论文本回扫禁用措辞
|
|
|
+ * ({@link AttributionLowSideRules#FORBIDDEN_MEDIATOR_WORDS}),命中即产出
|
|
|
+ * {@code mediator_audit} 违规(报告侧暴露,建议改写为措辞白名单表述)。
|
|
|
+ */
|
|
|
+ private List<Violation> matchMediatorAudit(String text) {
|
|
|
+ if (text == null || text.trim().isEmpty()) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ List<Violation> out = new ArrayList<>();
|
|
|
+ for (String word : AttributionLowSideRules.FORBIDDEN_MEDIATOR_WORDS) {
|
|
|
+ int from = 0;
|
|
|
+ int idx;
|
|
|
+ while ((idx = text.indexOf(word, from)) >= 0) {
|
|
|
+ out.add(new Violation(AttributionLowSideRules.RULE_MEDIATOR_AUDIT,
|
|
|
+ "介导链路禁确定性因果措辞(§5.8):菌群→递质→情绪/认知链只作上游信号,不判能力",
|
|
|
+ snippet(text, idx, idx + word.length()),
|
|
|
+ AttributionLowSideRules.MEDIATOR_AUDIT_HINT));
|
|
|
+ from = idx + word.length();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return out;
|
|
|
+ }
|
|
|
+
|
|
|
/** 非菌株级粒度下「菌名 + 菌株号」商品推荐拦截(T6 G-2) */
|
|
|
private List<Violation> matchStrainRecommendation(String text) {
|
|
|
if (text == null || text.trim().isEmpty()) {
|