Why: svc.sh could show a service table (list), per-instance DB names one at a
time (db ls), and per-service status, but had no single view answering "what
is running, which databases exist, and what is configured" -- the questions
asked when inspecting or handing over a machine.
Evidence: exercised in the task worktree runtime -- empty-state report; fake
agent/static/postgres registrations proving masking (exec DSN password,
password=, SVC_TAVILY_KEYS -> ***, non-secret values verbatim; --reveal shows
plaintext); a real postgres instance (db create r-pg --port 18901, start,
extra orders db, one backup) whose info section lists inner databases with
sizes, pgdata size and backup stats; regressions list/history/--help/help
lifecycle/make svc-info; info stdout carries the full report (stderr 0 bytes)
so it can be redirected as a snapshot. Full log in the task card.
Impact: new read-only `scripts/svc.sh info [name] [--tag T] [--reveal]`
command (also `make svc-info`): service table + running summary, postgres
instances incl. inner databases, per-service svc.env content snapshots plus
global .svc.env / --config / exported SVC_* vars, and recent events. Secrets
are masked by default. No deploy/lifecycle/db-ops behavior changes; `info`
becomes a reserved service name; docs/svc.md gains section 6.2 (former
6.2-6.4 shifted to 6.3-6.5).
Refs: task card .task/feature-svc-info.md (same doc as the PR); docs/svc.md
Why: the completion statement must carry precheck / task-sync / test evidence.
Evidence: make test exit 0 on tested_head=106ef07ef0 (full suite incl. ui 79
tests and agentcmd); functional evidence logged in the card.
Impact: card-only change; PR description mirrors this card.
Refs: .task/feature-svc-info.md
weichen
merged commit 5d3a4b3ee3 into main2026-10-04 12:50:02 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
feature/svc-info 任务卡
任务主记录:<PR 链接,task-finish 时填写>;状态:进行中;owner:weichen
基线与授权
1263e7f7d1scripts/svc.sh info综合信息报告(只读);终点 = PR 合入 main(附 precheck / task-sync / 功能验证三段证据)目标与非目标
目标:
scripts/svc.sh info [name] [--tag T] [--reveal],一条命令展示本机现场:运行中的服务(list 表格 + 运行汇总)、postgres 实例详情(含运行中实例的内部数据库
列表与大小、数据目录/备份体量)、配置文件与内容快照(逐服务 svc.env、全局 .svc.env、
本次 --config、shell 层 SVC_* 变量)、最近事件。
--reveal才显示;报告整体走 stdout 便于整页保存。(新 §6.2,原 6.2-6.4 顺延 6.3-6.5)、Makefile(svc-info 目标 + help)。
非目标:不改 deploy/生命周期/db 运维任何行为;不做 JSON 输出;不涉 Web UI。
实现摘要
info加入保留字(RESERVED_ENVS 与 help model 文档同步补全)。registered_names(global_list 复用)、history_print_rows(cmd_history 复用);新增 mask_dsn/mask_kv(掩码)、info_pg_block/info_config_block/info_global_config/
info_names_filtered、cmd_info。
info子命令;make svc-info。同步记录
1263e7f7d11263e7f7d1结果与验证(完成后填写)
svc.sh info(全景:服务表+汇总/数据库实例+内部库/配置快照/最近事件)、info <name>(单服务深度)、--tag过滤、--reveal显示敏感值;退出码:0 成功、2 用法错误。bash -n通过(shellcheck 本机不可用);SVC_TAVILY_KEYS):全景报告正确;掩码实测——exec 内 DSN 密码→
***、password=***、SVC_TAVILY_KEYS=***、非敏感值原样;--reveal显示明文;db create r-pg --port 18901→ start → 建额外库 orders → db backup →info 数据库节显示"运行中 pid、内部库 postgres/agent/orders 及大小、pgdata 43M、
备份 1 份";
rm r-pg --purge回收;测试现场(伪造登记/.svc.env)全部清除;list/history/--help/help lifecycle/make svc-info均正常;infostdout 纯净(stderr 0 字节),可整页重定向;make test(task-sync 后运行,tested_head=106ef07ef0)exit 0——test-boundaries + test-pins + test-libs(agent-intent/native/squad vet+test)+
test-core + test-backend + test-frontend + test-ui(11 文件 79 用例全过)+ test-agentcmd。
| 同步前验收 |
1263e7f7d1|106ef07ef0| 2026-10-04T12:42:58Z |提交主题:Add read-only svc.sh info report for services, databases, and config snapshots
(body 四段 Why/Evidence/Impact/Refs 见各提交说明;本卡即 PR 主记录)