Commit Graph
2 Commits
Author SHA1 Message Date
小唯 44ccb69ca5 chore(deploy): deploy.sh 加构建前洁净检查 + ignore 探针残留
起因(2026-10-14 当晚三次同族事故):
① f8ffcde 把另一任务在途的 server.go 布线一起提交 ⇒ HEAD 编译不过;
② deploy.sh 原先直接从**工作树**构建 ⇒ 任一 worker 在途改动会被顺手编进**生产二进制**,
   且部署后『运行二进制校验和 == 本次构建』仍然通过 ——
   校验和只能证明『跑的是本次构建』,不能证明『本次构建来自已提交代码』。这是验证链的洞。

改动:
- preflight_clean_tree(): git status --porcelain(含未跟踪)非空则拒绝构建;
  显式 --allow-dirty 可覆盖(风险自负,须在卡上记原因)。
  含未跟踪是刻意的:internal/peer 那类事故正是『已提交代码引用未跟踪文件』。
- .gitignore: /go/*-probe(清 17MB 残留 rulefirst-probe)

验证:闸门在 build 前 die(rc=1),生产未动(两服务仍 active、二进制时间戳不变);
--verify-only 不受影响。
2026-10-14 03:44:39 +08:00
小唯 f4d5d2174d deploy: t_f57b8bbf root-fix deploy flow - unified deploy.sh + PartOf= coupling + post-deploy verify
scripts/deploy.sh: build go+rust -> install (not cp) -> stop/reload/start both -> verify (is-active, no (deleted) inode, running-binary checksum == this build, /health=200). --verify-only flag for check-only. make deploy points at this script (replaces stale /usr/local/bin system-level target). Counter-example: install stale sidecar -> service stays active + health=200 (silent pass) -> make deploy-verify exits non-zero (catches silent fault). PartOf=zhiyid.service drop-in on zhiyi-consolidate + ExecStartPre rm /tmp/zhiyi-ipc.sock; restarting zhiyid now restarts sidecar (ActiveEnterTimestamp updates). deploy/ dir aligned to reality and desensitized (3 plaintext keys removed). Key cleanup in git history is a separate track - this card does not touch history. ACs verified. go test internal/governance failures are pre-existing rename tests, unrelated (this card touches no go/ code).
2026-10-08 11:43:43 +08:00