统一:DSH 智能分析、Top100 与图表静默恢复

接入 DSH 专用运行时和对话界面,保留模型原始回答,支持会话分页、连续追问与显式报告。
补齐组合筛选、各维度 Top100、分组查询到排名图的转换,图表故障静默省略并基于保存数据自动恢复。
优化报告风格、图表顺序和表格换行,更新接入说明及构建输入。

验证:独立目录前后端构建通过;118 项 Java、102 项前端、102 项图表、14 项 DSH 应用和 13 项组合筛选检查通过。
仅提交相关源码、锁定依赖与测试;不包含凭据、会话、业务数据或本地产物。
This commit is contained in:
2026-11-12 11:57:41 +08:00
parent cc8832c8e5
commit f1a2fbd494
166 changed files with 26281 additions and 2248 deletions
+29 -3
View File
@@ -122,9 +122,17 @@ class Guardian:
'QUALITY_DATA_WORKFLOW_TEST_MODE': 'true',
'QUALITY_ANALYSIS_PROTOCOL_V1_ENABLED': str(v.get('analysisProtocolV1Enabled', False)).lower(),
'QUALITY_ANALYSIS_AUTONOMOUS_ENABLED': str(v.get('analysisAutonomousEnabled', False)).lower(),
'QUALITY_ANALYSIS_DSH_ONLY': str(self.config.get('analysisDshOnly', False)).lower(),
'QUALITY_PROJECT_ROOT': str(self.root), 'QUALITY_DEFAULT_SOURCE_YEAR': '2026',
'SERVER_ADDRESS': '127.0.0.1', 'PORT': '5281', 'PYTHONDONTWRITEBYTECODE': '1',
})
for setting, variable in (
('analysisRuntime', 'QUALITY_ANALYSIS_RUNTIME_SCRIPT'),
('analysisModelConfig', 'QUALITY_ANALYSIS_MODEL_CONFIG_FILE'),
('analysisState', 'QUALITY_ANALYSIS_STATE_DIR'),
):
if self.config.get(setting):
env[variable] = self.config[setting]
log_config = r / 'operations/logback-quality.xml'
if log_config.is_file() and not log_config.is_symlink():
env['LOGGING_CONFIG'] = str(log_config)
@@ -239,10 +247,23 @@ def ctl(*args, check=True):
return subprocess.run(['/bin/launchctl', *args], check=check, capture_output=True, text=True)
def install(root, jar, clear_maintenance_pause=True):
def install(root, jar, clear_maintenance_pause=True, dsh_only=False,
analysis_runtime=None, analysis_model_config=None, analysis_state=None):
root, jar = Path(root).resolve(), Path(jar).resolve()
cfg = {'root': str(root), 'jarSha256': hashlib.sha256(jar.read_bytes()).hexdigest(),
cfg = {'root': str(root), 'jarSha256': hashlib.sha256(jar.read_bytes()).hexdigest(), 'analysisDshOnly': dsh_only,
'path': '/opt/homebrew/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/bin:/bin:/usr/sbin:/sbin'}
if analysis_runtime:
runtime_path = Path(analysis_runtime).resolve(strict=True)
if not runtime_path.is_file():
raise ValueError('Analysis runtime must be a file')
cfg['analysisRuntime'] = str(runtime_path)
if analysis_model_config:
model_path = Path(analysis_model_config).resolve(strict=True)
if not model_path.is_file() or model_path.stat().st_mode & 0o077:
raise ValueError('Analysis model configuration must be a private file')
cfg['analysisModelConfig'] = str(model_path)
if analysis_state:
cfg['analysisState'] = str(Path(analysis_state).resolve())
Guardian(cfg).preflight()
HOME.mkdir(parents=True, exist_ok=True, mode=0o700)
HOME.chmod(0o700)
@@ -313,11 +334,16 @@ def main():
parser.add_argument('action', choices=['install', 'run', 'status', 'start', 'pause', 'stop'])
parser.add_argument('--root')
parser.add_argument('--jar')
parser.add_argument('--dsh-only', action='store_true')
parser.add_argument('--analysis-runtime')
parser.add_argument('--analysis-model-config')
parser.add_argument('--analysis-state')
args = parser.parse_args()
if args.action == 'install':
if not args.root or not args.jar:
parser.error('install requires --root and --jar')
install(args.root, args.jar)
install(args.root, args.jar, dsh_only=args.dsh_only, analysis_runtime=args.analysis_runtime,
analysis_model_config=args.analysis_model_config, analysis_state=args.analysis_state)
elif args.action == 'status':
status()
elif args.action in ('pause', 'stop'):