Commit Graph
4 Commits
Author SHA1 Message Date
小唯 cee68592e3 feat(deploy): 部署夹带闸门 preflight_reviewed_commits(t_3f83df64)——构建基准 HEAD 相对 tracked 批准清单比对,未评审提交默认拒绝(--allow-unreviewed / --mark-approved 显式放行);起因:01:18 生产二进制夹带 584fe37 等未评审提交 2026-10-17 08:28:01 +08:00
小唯 de0ddf4b8b chore(deploy): bi-temporal e2e 闸门接进部署流程(堵『写了但永不开火』的洞)
背景:t_763e8701 交付了 bitemporal_e2e_test.go,但该测试默认 t.Skip
(需 ZHIYI_BITEMPORAL_SOCK 指向运行中的 sidecar)。没人设环境变量 ⇒
这道『机器闸门』永不开火 ⇒ 等于不存在(机制铁律:写完无人调用 = 零效力)。

改动:do_verify 增加 verify_e2e_bitemporal() ——
用本次已安装的 sidecar 开临时 socket + 临时 data-dir(不碰生产库),
跑 Go e2e(真实 LanceDB 写→读回),失败即 die。

起因事故:t_3ada332b 单测全 PASS 但生产 no-op —— 三列在 LanceDB 边界
被静默丢弃(Go payload 缺 3 键 + Rust schema 缺 3 列),
validityExpired 永远拿到空串 ⇒ 降权永不触发。本闸门即该事故的守门人。

验证(双向):
- 通过路径:deploy.sh --verify-only 全绿,含『✔ bi-temporal e2e 闸门通过』
- 失败路径:把测试指向不存在的 socket ⇒ go test 返回 FAIL(非零)⇒ 函数 rc≠0 即 die
2026-10-14 05:05:24 +08:00
小唯 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