Skip to content

feat(contract): bind the published Root ABI bundle — converge R-00056/69/72/74/79/179/180 - #3

Merged
Go1c merged 9 commits into
mainfrom
claude/loving-mendeleev-7e825d
Aug 29, 2026
Merged

feat(contract): bind the published Root ABI bundle — converge R-00056/69/72/74/79/179/180#3
Go1c merged 9 commits into
mainfrom
claude/loving-mendeleev-7e825d

Conversation

@Go1c

@Go1c Go1c commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

把上游 LumioGameEngineArchitecture 已发布的 Root ABI Bundle(ADR-040,含 ADR-046 kernel status band;两者 Status 均为 Draft,但发布物已在上游 origin/main,镜像钉在 1f2ead3)真正绑定进本仓,收敛 7 张受波及卡;R-00083 按上游裁决(ADR-040 §7 / D-015)维持 BLOCKED,无代码改动。派单来源:架构仓 TD 2026-08-28 NativeCore 收敛盘点。

改动清单(每卡一提交)

  • 14ca3ed R-00056:字节级镜像 docs/architecture/abi/(钉 revision + .baseline.sha256 钉 Hash)+ 身份绑定(RootAbiBinding digest 链、AbiVersion、LumioStatus/LumioHandle/LumioBuffer/LumioCoreConfigV1 POD)
  • 9f52ef3 R-00072:cargo xtask gen-contracts 生成 layout Golden;类型/表/槽位偏移断言,仅在认证档 linux-x86_64-glibc 上比对(D-016),交叉 --target x86_64-unknown-linux-gnu 编译验证
  • 3c599eb R-00074:漂移 Gate(baselineId + bundleDigest 三方链:CI sha256sum -c ↔ pin ↔ 发布 digest ↔ 常量;历史真实漂移样本作反例)
  • 8fd9bba R-00069:ErrorCode 注册表 53 值全量生成绑定(含 kernel band);Capability 维持不绑定(D-015)、OperationId 判不适用(B-ABI-004)
  • ee03cb6 R-00079:13 个 ErrorCategory 全量单射映射(1044–1053 + 1020/1029/1030),MappingBlocked 移除,映射进入零分配窗口
  • 93c88af R-00179:按发布 Header 的 provider lumio_core_api 表 + 槽位实现(shutdown/last_error_detail 返回注册 numeric;init 维持 BLOCKED)+ C smoke(镜像 Header 独立编译,其 static assert 即布局 Golden)
  • c0174c7 R-00180:符号负向 Gate 扩展(entrySymbol/symbolPrefix 从镜像绑定、lumio_* 前缀白名单、仅 ffi 允许 cdylib/staticlib)+ 修复扫描器字符字面量失步缺陷(含回归测试)
  • 8ec472f 知识沉淀:repository-architecture.md 记录镜像消费机制

验证证据(host x86_64-apple-darwin, rustc 1.94.0)

  • cargo fmt --all --check → OK
  • cargo clippy --workspace --all-targets -- -D warnings → Finished, 0 warnings
  • cargo test --workspace → 82 个测试组全部 ok,0 failed
  • cargo build --workspace --benches → Finished
  • cargo xtask check-dep-dag → OK(10 crates);dump-symbols → lumio_* 未批准导出 0;check-baseline → OK
  • node .spec/tools/spec-lint.mjs → OK;spec-lint.test.mjs → fail 0
  • repository-policy readme job 本地复现 → ALL OK(含 shasum -a 256 -c 全部镜像)
  • 认证档交叉验证:cargo check/clippy --target x86_64-unknown-linux-gnu(contract-types / native-ffi 全 target)→ 通过

Known gaps

  1. AlreadyReleased 统一映射 1030;arena 使用路径的空槽命中按 ADR-046 §2 应显现为 1029,属 handle 模块检查顺序问题,已在 R-00079 卡面记录待裁决
  2. lumio_core_init 维持 BLOCKED:core_config_v1 body 未发布 + 发布签名的 out_context 按值传递无法回传结果(已上报上游)
  3. provider 组合契约(CoreEngine 如何取得 provider 表 / 符号清单)未发布,故仍无任何 C 导出
  4. error_hot_path_does_not_allocate 在满负载并行下观察到一次偶发(harness IO 分配竞入计数窗口,窗口设计先于本 PR 存在),复跑 7 次全绿

沉淀落点

.spec/knowledge/standards/repository-architecture.md 新增镜像消费机制条目;镜像更新流程见 docs/architecture/abi/README.md

🤖 Generated with Claude Code

Cui and others added 9 commits August 29, 2026 08:21
…contract-types-01, R-00056)

Mirror the ADR-040 consumer surface byte-for-byte under docs/architecture/abi/
(pinned at LumioGameEngineArchitecture origin/main 1f2ead3), pin every mirror
file in .baseline.sha256, and replace the blocked identity seam with the real
binding: RootAbiBinding digest chain, AbiVersion(1), and the published POD
types LumioStatus / LumioHandle / LumioBuffer / LumioCoreConfigV1. Mirror
cross-check tests reject any drift between constants, mirror bytes, and the
published bundleDigest; xtask now audits every .baseline.sha256 row.

Capability bits (D-015), non-linux-x86_64-glibc layout (D-016) and
OperationId (B-ABI-004: not applicable) stay deliberately unbound.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…types-03, R-00072)

Add cargo xtask gen-contracts: derives generated_data.rs from the byte-pinned
bundle mirror (type golden, struct/slot offset golden, layout-profile
scalars); an xtask regression test rejects any hand edit by re-deriving.
layout.rs compares the bound Rust PODs against the Golden with compile-time
asserts, but only on the one certified profile linux-x86_64-glibc — every
other target succeeds without asserting, per ADR-040 §7 (D-016 pending).
StructSize becomes a real byte-size scalar. Tests cross-check every golden
row against the mirror and were cross-checked to compile for the certified
target (cargo check --target x86_64-unknown-linux-gnu).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-contract-types-04, R-00074)

verify_root_abi_bundle_digest_against completes the drift chain: CI
sha256sum -c proves mirror bytes match the pin, the crate tests prove
pin == published rootAbi.bundleDigest == the bound constant, and the new
tests reject the previous published digest as a real drift sample plus any
mixed-revision mirror set (all three indices must agree on one baselineId).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ct-types-02, R-00069)

gen-contracts now derives the full 53-value ErrorCode table (including the
ADR-046 kernel status band, Draft but published in ids/index.json on
origin/main) from the byte-pinned ids mirror — the generator enforces
Architecture ownership, Active status, uniqueness, and the int32 status
range, and no numeric is hand-written anywhere. registry.rs serves ordered
iteration plus by-id lookup; Capability stays unbound pending D-015 (its
numerics are package-capability ordinals, not bit positions) and
OperationId stays permanently empty (B-ABI-004: not applicable). The kernel
mapping test drops its stale registry-is-empty guard; the mapping itself
stays MappingBlocked until T-error-03 (R-00079).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…079)

ADR-046 (Draft; values published in ids/index.json on origin/main) covers
all 13 frozen ErrorCategory values: the 1044-1053 kernel band plus the
adjudicated 1020/1029/1030. to_architecture_error_code becomes infallible
and injective, resolving codes through the generated registry by id string
so no numeric is written in kernel sources; MappingBlocked is gone and the
mapping now sits inside the error hot path's zero-allocation window.

Known gap (recorded on the card): the arena reports empty-slot hits on use
paths as AlreadyReleased, which ADR-046 §2 expects to surface as
InvalidHandle (1029); this mapping applies the release-path ruling
(HandleDoubleRelease). Resolving the use path is a handle-module
check-order question outside this card.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed Header (T-ffi-04, R-00179)

Transcribe the generated Header's lumio_core_api into a repr(C) provider
table (field names, slot signatures and Option<extern fn> null slots follow
the Header verbatim; version/struct_size come from the bundle Golden via
gen-contracts, not literals). shutdown / last_error_detail slots run through
ffi_boundary and the single error mapping — with init unpopulated no context
can exist, so they return the registered InvalidHandle numeric, never an
invented one. The C smoke calls through the slot function pointers and
compiles the mirrored lumio_core.h standalone (its LUMIO_STATIC_ASSERT rows
are the layout Golden); Rust-side table offsets are asserted only on the
certified linux-x86_64-glibc profile (D-016), cross-checked via cargo
check/clippy --target x86_64-unknown-linux-gnu. No C symbol is exported:
the composition contract for handing this table to CoreEngine is
unpublished, and lumio_core_init stays blocked on the opaque
lumio_core_config_v1 body plus the by-value out_context question (raised
upstream).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…blished surface (T-ffi-05, R-00180)

dump-symbols now derives entrySymbol/symbolPrefix from the mirrored bundle,
cross-checks them against the hardcoded Root symbol, and fails on ANY
lumio_-prefixed export outside the approved provider list (empty until the
provider composition contract is published) instead of only the Root symbol.
symbol_guard gains mirror_entry_symbol (guard == published bundle, either
JSON formatting) and a dependency-half test that only lumio-native-ffi may
declare cdylib/staticlib. Also fixes a latent scanner desync: a quote inside
a char/byte-char literal ('"', b'"') flipped the string stripper's parity,
which could both hide real identifiers and surface string contents as code —
covered by a regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… §7)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… (T-error-04 harness)

The global count also saw libtest-harness allocations from other threads,
which raced into the measurement window under machine load — observed twice
after R-00079 widened the window to cover the mapping calls. Gate counting
by a const-initialized thread-local so the assertion means 'this thread's
hot path allocated nothing', with a self-check that a real allocation on
the test thread is still counted. 0/60 failures quiet+loaded after the fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Go1c
Go1c merged commit e192459 into main Aug 29, 2026
2 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