feat: V1.1 - 注释补充

This commit is contained in:
2026-08-03 14:48:29 +08:00
parent 20b86592cb
commit f734455d6a
10 changed files with 285 additions and 1 deletions

View File

@@ -16,27 +16,37 @@ public class CheckerConfig {
/** 总开关false 时跳过检测与通知(流水线 exit 0 */
private boolean enabled = true;
/** notify | block */
/** 运行模式:notify(仅通知)| block(有变更则失败退出) */
private String mode = "notify";
/** 是否扫描 test 源码目录 */
private boolean scanTestSources = false;
/** 额外源码根路径(相对仓库根);空则按约定扫描 main */
private List<String> sourceRoots = new ArrayList<>();
/** 企微通知配置 */
private Notify notify = new Notify();
/** 忽略规则key / 文件 / 写入方法 / MQ destination */
private Ignore ignore = new Ignore();
/** 检测模式与推断参数 */
private Detection detection = new Detection();
/** 按 ChangeType 名覆盖默认严重级别,如 FIELD_ADDED → P0 */
private Map<String, String> severityOverrides = new LinkedHashMap<>();
/** 人工写入点映射(自动推断不准时补齐) */
private List<ManualMapping> manualMappings = new ArrayList<>();
/** 已知误报抑制规则 */
private List<Suppression> suppressions = new ArrayList<>();
/** 仅检测这些模块(路径前缀/模块名);空表示不限制 */
private List<String> includeModules = new ArrayList<>();
/** 排除这些模块,不参与检测 */
private List<String> excludeModules = new ArrayList<>();
public boolean isBlockMode() {
@@ -46,18 +56,24 @@ public class CheckerConfig {
/** 企微通知相关配置。 */
@Data
public static class Notify {
/** 是否发送企微通知 */
private boolean enabled = true;
/** 企微机器人 Webhook 完整 URL */
private String webhookUrl = "";
/** 无变更时是否仍发「清洁」通知 */
private boolean notifyOnClean = false;
/** 报告标题前缀 */
private String titlePrefix = "[序列化结构变更]";
}
/** 忽略规则key / 文件路径 / 写入方法 / MQ destination。 */
@Data
public static class Ignore {
/** 忽略的 Redis key / 模式 */
private List<String> keyPatterns = new ArrayList<>();
/** 忽略的源文件 glob */
private List<String> filePatterns = new ArrayList<>();
/** 忽略的写入方法Class#method 或简单名) */
private List<String> writerMethods = new ArrayList<>();
/** 忽略的 MQ destination 模式topic / topic:tag */
private List<String> mqDestinations = new ArrayList<>();
@@ -66,10 +82,13 @@ public class CheckerConfig {
/** 检测模式与推断参数Redis W*、MQ MQ*、读侧补强开关等)。 */
@Data
public static class Detection {
/** Redis 写入检测模式列表,如 W01~W06 */
private List<String> patterns = new ArrayList<>();
/** MQ 投递检测模式MQ01~MQ05、MQ-K01~MQ-K04 */
private List<String> mqPatterns = new ArrayList<>();
/** 低于此置信度的结构变更按低置信度降级处理 */
private double minConfidence = 0.6;
/** 字段展开最大深度,防止循环引用爆栈 */
private int maxFieldDepth = 8;
/** W06是否启用读侧反序列化类型辅助补强 */
private boolean readHintsEnabled = true;
@@ -82,10 +101,15 @@ public class CheckerConfig {
*/
@Data
public static class ManualMapping {
/** 规则 id便于配置追溯 */
private String id;
/** 目标写入方法标识 */
private String writerMethod;
/** 指定的 key / destination 模式 */
private String keyPattern;
/** 指定的 value 类型 */
private String valueType;
/** 备注说明 */
private String description;
}
@@ -94,10 +118,15 @@ public class CheckerConfig {
*/
@Data
public static class Suppression {
/** 规则 id */
private String id;
/** 可选:限定写入方法 */
private String writerMethod;
/** 可选:匹配的 key / destination 模式 */
private String keyPattern;
/** 要抑制的 ChangeType 名列表;空表示不按类型过滤 */
private List<String> changeTypes = new ArrayList<>();
/** 抑制原因(文档用) */
private String reason;
}
}