Skip to content

test(e2e): audit the index for recipes registration now rejects - #400

Merged
Sunrisepeak merged 1 commit into
release/0.4.70from
test/pkgindex-registration-audit
Jul 26, 2026
Merged

test(e2e): audit the index for recipes registration now rejects#400
Sunrisepeak merged 1 commit into
release/0.4.70from
test/pkgindex-registration-audit

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

P4.1 of the 0.4.70 release train — 发布前的索引门禁。

为什么需要

provider-scoped 注册把一个包的全部 xvm 操作作为一个批次校验并 fail-closed。其中三项检查会把过去静默通过的 recipe 缺陷变成安装失败:

检查 含义
SelfBinding 条目绑定到自己
RootNotInBatch binding 指向该 recipe 从未注册的 target
DuplicateNode 同一 target + version 注册两次

命中任一项的 recipe 完全装不上。索引必须在发布前是干净的。

结果

对钉住的索引(dee7848,113 个 recipe,89 个使用 xvm):

rejected     0
unresolved   3

三条无法静态判定的,全部人工读过,全部无害

recipe 情况
git.lua / sourcetrail.lua 同名在 if is_host("windows") 的两个分支各注册一次 —— 只有一个分支会执行
seeme-report.lua 绑定到 package.name .. "@" .. version,而同一 recipe 就注册了它

第一版扫描把前两条报成了 REJECT

这正是审计工具必须避免的失败模式:两个发现两个都是误报,会训练人忽略它。

要证明分支互斥需要真正求值 Lua。所以现在两次注册之间出现 else / elseif 就降级为 unresolved —— 既不清白也不定罪

runtime 构建的 binding 目标同理:报告而非跳过。

一个静默略过"没看懂的部分"的审计,读起来像"没有问题要修",实际意思是"没有看"。

Verification

python3 tests/e2e/pkgindex_registration_audit.py <index>
  scanned      113 recipes, 89 register with xvm
  rejected     0
  unresolved   3
  → exit 0

三条 unresolved 已逐条打开源文件确认。

后续

建议在 pkgindex 仓的 CI 里对新 recipe 强制跑一次(跨仓,不在本 PR 范围)。

Provider-scoped registration validates a package's whole set of xvm
operations as one batch and fails closed. Three of those checks turn
recipe defects that used to pass silently into install failures:
SelfBinding, RootNotInBatch, and DuplicateNode. A recipe hitting any of
them cannot be installed at all, so the index has to be clean before the
release ships.

Result against the pinned index (dee7848, 113 recipes, 89 registering
with xvm): zero rejections. Three cases the scan cannot decide, all read
by hand and all benign:

  git.lua, sourcetrail.lua   one name registered in both arms of an
                             if is_host("windows") -- only one arm runs
  seeme-report.lua           binds to package.name .. "@" .. version,
                             which the same recipe registers

The first version of the scan reported the two if/else cases as
rejections. That is the failure mode an audit has to avoid: two false
alarms out of two findings teaches people to ignore it. Proving
exclusivity needs the Lua evaluated, so an else or elseif between the
two registrations now downgrades them to unresolved -- neither cleared
nor rejected.

Same reasoning for runtime-built binding targets: reported rather than
skipped. An audit that quietly passes over what it could not parse reads
as "nothing to fix" when it means "did not look".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant