整库发布写入路径原先按 0.7.1 的固定表集合工作:0.9.0 没有 wiki_log_entries, Current/清理/编目/整实例指纹都会在不存在表上失败,跨版本闸门也因快照丢掉 SchemaVersion 而失效(未知版本被当作 74)。 改为在装配时解析目标 profile,表集合与清理顺序按解析结果;快照复制与范围改写 带上 SchemaVersion/Profile;跨版本发布显式拒绝并同时点名两个版本。单文档发布包 仍只支持 0.7.1,但改为明确拒绝并说明原因。 本机隔离验证:真实 0.9.0 schema 源库→导出→封存→写入干净 134 目标→逐表核对→ 写前镜像回滚;74→134 拒绝与 134 缺表不报错两个负例通过。make verify 17 项全绿。
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
"knowledge-governance/internal/libraryprofile"
|
||||
"knowledge-governance/internal/librarysnapshot"
|
||||
)
|
||||
|
||||
@@ -118,7 +119,12 @@ func libraryResourceHandles(rows []json.RawMessage) ([]string, error) {
|
||||
// Revalidate frozen source content at the actual planning boundary. A sealed
|
||||
// manifest proves bytes, not that every row has a parent or a supported owner.
|
||||
func validateArchivedLibraryClosure(archive *librarysnapshot.Archive, manifest librarysnapshot.Manifest) error {
|
||||
var pg PostgresSnapshot
|
||||
// 快照的 schema 契约来自 manifest:不带上版本号,重建出来的快照就是"版本未知",
|
||||
// 而未知版本按 0.7.1 校验——0.9.0 的归档会被要求提供它根本没有的 wiki_log_entries。
|
||||
pg := PostgresSnapshot{SchemaVersion: manifest.Compatibility.SchemaVersion}
|
||||
if profile, err := libraryprofile.For(pg.SchemaVersion); err == nil {
|
||||
pg.Profile = profile.Name
|
||||
}
|
||||
es := SearchSnapshot{MappingSHA256: manifest.Compatibility.IndexMappingSHA256}
|
||||
for _, part := range manifest.Parts {
|
||||
if part.Kind != "database" && part.Kind != "wiki" && part.Kind != "index" {
|
||||
|
||||
Reference in New Issue
Block a user