chore(deploy): finalize 0309 SAE rollout updates
Sync deployment documentation to the final successful SAE state and clear pending deployment checklist items. Include backend/frontend/R hardening and diagnostics improvements required for stable production behavior. Made-with: Cursor
This commit is contained in:
@@ -11,6 +11,9 @@ library(jsonlite)
|
||||
# 环境配置
|
||||
DEV_MODE <- Sys.getenv("DEV_MODE", "false") == "true"
|
||||
|
||||
# 空值合并操作符(避免 `%||%` 未定义导致 execute-code 入口报错)
|
||||
`%||%` <- function(x, y) if (is.null(x)) y else x
|
||||
|
||||
# 加载公共函数
|
||||
source("utils/error_codes.R")
|
||||
source("utils/data_loader.R")
|
||||
@@ -116,6 +119,32 @@ function() {
|
||||
)
|
||||
}
|
||||
|
||||
#* 诊断:返回 R 运行时包清单(只读)
|
||||
#* @get /api/v1/debug/packages
|
||||
#* @serializer unboxedJSON
|
||||
function() {
|
||||
required_packages <- c(
|
||||
"plumber", "jsonlite", "ggplot2", "glue", "dplyr", "tidyr",
|
||||
"base64enc", "yaml", "car", "httr", "scales", "gridExtra",
|
||||
"gtsummary", "gt", "broom", "meta"
|
||||
)
|
||||
|
||||
installed <- rownames(installed.packages())
|
||||
missing <- setdiff(required_packages, installed)
|
||||
|
||||
list(
|
||||
status = "ok",
|
||||
r_version = R.version.string,
|
||||
dev_mode = DEV_MODE,
|
||||
lib_paths = .libPaths(),
|
||||
required_count = length(required_packages),
|
||||
installed_count = length(installed),
|
||||
missing_required = missing,
|
||||
required_status = if (length(missing) == 0) "complete" else "incomplete",
|
||||
sample_installed = head(sort(installed), 120)
|
||||
)
|
||||
}
|
||||
|
||||
#* JIT Guardrails Check
|
||||
#* @post /api/v1/guardrails/jit
|
||||
#* @serializer unboxedJSON
|
||||
|
||||
Reference in New Issue
Block a user