Files
quality_analyse/backend
lyun bc19475b29 修复:DSH 自主查询、图片直显与报告稳定性
允许 Agent 在循环中查目录、修正查询和提问,保留实时权限检查及模型原始回答。
统一相同查询证据与图表资源;排名补齐阶段指标,修正 OR 重量筛选,并限制模型明细输入。
增加运行恢复、图表自适应坐标轴与两位小数,修复报告主图选择、重复图及边缘标签。

验证:独立副本通过 162 项 Python、73 项前端及 21 项后端测试,前端构建通过。
线上已用原 8 题复测,并追加两轮双期对比;TOP100 与组合筛选分别核对 100 行和 20 行。
2026-11-12 16:14:20 +08:00
..

Quality platform backend

Java 21 / Spring Boot API and ingestion service. The service binds to 127.0.0.1:5281; its production data store is MySQL 8.4 with Flyway migrations. There is no embedded database fallback.

Local configuration

Set the following environment variables before starting the API:

  • MYSQL_URL — JDBC URL for the local MySQL database, including UTF-8 and UTC options.
  • MYSQL_USER and MYSQL_PASSWORD — least-privilege application account.
  • QUALITY_ARCHIVE_ROOT — absolute directory for immutable source revisions and runtime artifacts (defaults to ./runtimedata/archive).
  • QUALITY_ALLOWED_ROOTS — path-separator-delimited directories that the scanner may inspect. Each entry is canonicalized; symlinks escaping the configured root are rejected.
  • QUALITY_BOOTSTRAP_ADMIN_USERNAME and QUALITY_BOOTSTRAP_ADMIN_PASSWORD — optional one-time local administrator bootstrap. Neither value is logged. Omit both to require provisioning through an existing administrative path.

The API does not accept a filesystem path from a browser as a scan target. Callers select source IDs returned by /api/sources. Multipart uploads are stored under the archive root after size and extension checks. Files without a year in their name use QUALITY_DEFAULT_SOURCE_YEAR (default 2026), matching the current workbook title.

Run

From this directory, use the Maven wrapper when present, or Maven 3.9+:

mvn spring-boot:run

Flyway applies src/main/resources/db/migration at startup. The initial account must be explicitly bootstrapped; no public default credentials are created.

API

The front-end contract is served below /api. GET /api/auth/csrf returns a CSRF token and sets XSRF-TOKEN; mutation requests include the same value in X-XSRF-TOKEN. The authenticated session cookie is HttpOnly and SameSite=Strict. Data APIs require a session, and management mutations additionally require role authorization and an idempotency key or expected-version check.