Skip to content

fix(xvm): let doctor repair a dangling legacy binding edge - #412

Merged
Sunrisepeak merged 2 commits into
release/0.4.70from
fix/dangling-legacy-edges
Jul 27, 2026
Merged

Sunrisepeak merged 2 commits into
release/0.4.70from
fix/dangling-legacy-edges

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Jul 26, 2026 •

Copy link
Copy Markdown
Member

发布阻塞项。 补跑计划里一直有、却从未执行的 P4.2(真实工具链验证)时发现的。

症状:真实安装上的行为回退

用真实的 ~/.xlings.json(246 targets / 372 条目)在隔离 HOME 里测:

0.4.68(已发布)   xlings use gcc 15.1.0  →  gcc -> 15.1.0        ✓
2026.7.27.0        xlings use gcc 15.1.0  →  拒绝
                     "a member of this release is registered at no such version"
                     nothing was changed

原因:[email protected] 带一条指向 [email protected] 的 legacy 成对边,而这个锚点只注册了 16.1.0。

为什么之前没被发现

  • doctor 报不出来 —— 它的 INV-4 检查只看有 bindingGroup 的条目,而 0.4.70 之前写的状态全都没有
  • --fix 修不了
  • 提示是"重装这个包",能解决但太重,而且没有任何东西把用户引到那里

对一个宣称无感升级的版本,这是反面。

修法

指向不存在版本的边不携带任何信息 —— 它描述不出任何可切换的成员,只会造成拒绝。所以剪掉它是不需要猜测的修复,这正是它区别于"发布内部不一致"(--fix 刻意不碰那种)的地方。

doctor 现在报 xvm-legacy-edge-dangling,--fix 剪除,且排在停用扫描之前 —— 否则那一遍会看到同一个问题换了个样子。

刻意保守

拥有者版本本身也不存在的边,不动。 解析永远从真实的 (target, version) 出发,这类边不可达、造不成本次要修的拒绝。同一台真实机器上是 32 条里的 12 条 —— 惰性垃圾,动它们属于清理而非修复。

实测(真实配置)

剪除边数 20 条(434 → 414)
use gcc 15.1.0 ✅ 恢复可用
gcc 16.1.0 ✅ 仍解析为两成员的发布,没被压平成独立条目

测试

6 个新用例(XvmDanglingEdge),其中一个先复现拒绝,保证修复不是空过。458 测试 / 11 二进制全绿。

Found by finally running the real-toolchain check the plan had carried from
the start and never executed. On a real installation:

    0.4.68           xlings use gcc 15.1.0  ->  gcc -> 15.1.0
    2026.7.27.0      xlings use gcc 15.1.0  ->  refused,
                       "a member of this release is registered at no such
                        version"; nothing was changed

`[email protected]` carries a pairwise binding edge to `[email protected]`, an
anchor registered only at 16.1.0. The fail-closed resolution added in #384 is
right to refuse an unresolvable release -- what was missing is any way out.
`doctor` did not report it, because its INV-4 pass only inspects entries that
carry a `bindingGroup` and everything written before 0.4.70 does not. `--fix`
could not repair it. The hint said "reinstall the package", which works but
is a heavy answer to a stale edge, and nothing pointed the user at it. For an
upgrade sold as seamless, that is the opposite.

An edge whose destination version does not exist carries no information: it
cannot name a member anyone could switch to, it can only cause a refusal. So
dropping it is repair without guessing, which is exactly what separates it
from the incoherent-release case that `--fix` deliberately will not resolve.

doctor now reports these as `xvm-legacy-edge-dangling` and `--fix` drops
them, before the deactivation pass so that pass does not see this problem
wearing another shape.

Deliberately narrow: an edge recorded under a version that is *also* absent
is left alone. Resolution always starts from a real (target, version), so
such an edge is unreachable and cannot cause the refusal this fixes. On the
same real installation that is 12 of 32 -- inert, and touching them would be
cleanup rather than repair.

Measured on that installation: 20 edges dropped, `use gcc 15.1.0` works
again, and 16.1.0 still resolves as a two-member release rather than
collapsing into standalone entries.

Verified: 6 new cases (XvmDanglingEdge), one of which reproduces the refusal
before anything is repaired so the fix cannot pass vacuously. 458 tests, 11
binaries green.
An upgrade from 0.4.68/0.4.69 can hit a `use` that is refused where it
previously worked: legacy pairwise edges may point at versions that are no
longer registered, and fail-closed resolution rejects the whole release.

The notes now say what to run. Without it the user's only visible option was
the reinstall the error hinted at, which is a heavy answer to a stale edge --
and doctor did not surface the finding in the first place.
@Sunrisepeak
Sunrisepeak merged commit 7b00fad into release/0.4.70 Jul 27, 2026
7 checks passed
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