R-00083: capability 键改为消费上游生成物(T-capability-01 生成转换半边) - #4
Merged
Conversation
…in baseline 上游 PR #23/#27 后重新同步 docs/architecture/abi/ 的四件字节级镜像。ids/index.json 零改动;lumio_core.h 新增 ADR-040 §7.1 的 9 个 capability 键常量与 COUNT; root-abi-bundle.json 与 packages/index.json 的 compilerHash / outputHash 随生成器 版本变动。 .baseline.sha256 与 generated.rs 的绑定常量(bundle / header / compiler digest) 一并按实测值重 pin——digest 与 compilerHash 均从上游发布物本机重算读出,未从任何 派单文本抄录。inputHash 未变。 镜像 revision 钉 origin/main 提交 3287bba(内容提交 99f94fb),digest 链自洽: header sha256 == bundle.outputFiles[0].digest,bundle sha256 == packages/index.json rootAbi.bundleDigest。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lity-01, R-00083) D-015 已裁决(架构源 ADR-040 §7.1 / ADR-048):ids/index.json 是 capability 键空间 唯一权威,架构生成器是唯一发射方,下游消费投影;裁决前作为「唯一正确模型」的仓内 私有键值表就此变成违规。本卡「生成转换」半边随之解除阻塞。 gen-contracts 从 ids-index.json 的 Capability 命名空间生成 CAPABILITY_KEYS,并在生成 期与镜像 C Header 的 LUMIO_CAPABILITY_<SCREAMING> 常量、LUMIO_CAPABILITY_COUNT 三方 交叉核对,任一不一致直接失败。LUMIO_CAPABILITY_BITS 显式排除在键空间外——D-015 只裁 了键,掩码/计数与 bit 位仍未冻结,registry::capability_bits() 保持恒空并有测试守护。 CapabilityKey 去掉裸构造器:唯一构造路径是 from_registered(ArchitectureCapabilityKey) 与按 id 查表的 from_registry_id,crate 内外都无法凭空造一个注册表没有的键。既有排序 唯一集合语义不变,不推倒重来。 决策落 ADR 0006;.spec 里「Capability 不绑定」的过期表述同步更新。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
D-015 已裁决(架构源
ADR-040 §7.1/ADR-048,PR #21 起),取代了ADR-040 §7原先那句「消费方不得从任一来源派生 capability key,仓内私有键是唯一正确模型」。裁决把权威与发射分开:ids/index.json仍是唯一权威,架构生成器成为唯一发射方,下游改为消费投影——仓内私有 capability 键值表从「唯一正确模型」变成违规。R-00083 的「生成转换」半边随之解除阻塞。既有 crate-private
CapabilityKey+StaticCapabilities(51c0410)的排序唯一集合语义不变,不推倒。改动
1. 镜像重同步与重 pin(
fab2e93)上游 PR #23/#27 后
docs/architecture/abi/四件镜像重新字节级同步到 origin/main 提交3287bba(内容提交99f94fb):ids/index.json零改动(capability numeric 权威未变)lumio_core.h新增 9 个LUMIO_CAPABILITY_<SCREAMING>键常量 +LUMIO_CAPABILITY_COUNTroot-abi-bundle.json/packages/index.json的compilerHash、outputHash随生成器版本变动.baseline.sha256与generated.rs的绑定常量(bundle / header / compiler digest)一并重 pin。所有哈希均从上游发布物本机重算实测读出,未从任何派单文本抄录(compilerHash一天内变了两次)。digest 链自洽:header sha256 ==bundle.outputFiles[0].digest,bundle sha256 ==packages/index.json的rootAbi.bundleDigest。2. 生成转换(
2de6912)cargo xtask gen-contracts从ids-index.json的Capability命名空间生成CAPABILITY_KEYS,并在生成期与镜像 Header 的键常量、LUMIO_CAPABILITY_COUNT做三方交叉核对,任一不一致直接失败LUMIO_CAPABILITY_BITS显式排除在键空间外:D-015 只裁了键,掩码/计数与 bit 位仍未冻结,registry::capability_bits()保持恒空并有测试守护CapabilityKey去掉裸构造器:唯一构造路径是from_registered(ArchitectureCapabilityKey)与按 id 查表的from_registry_id,crate 内外都无法凭空造一个注册表没有的键.spec/decisions/0006;.spec里「Capability 不绑定」的过期表述同步更新守护验证(对照组探针,非空口声称)
VOXEL_SPATIAL 6u→66uVOXEL_ALL_RESIDENTCOUNT 9u→8ucapability_keys_match_header_projectionFAILEDfa2aaca2…镜像 digest 漂移守护同样实测有效:重同步后未改绑定常量时,
bound_identity_matches_published_bundle_mirror与bundle_digest_and_consumer_standing_match_packages_index_mirror先红,改常量后转绿。收口门槛(本机实跑,均 EXIT=0)
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warnings、cargo clippy --workspace --all-targets -- -D warningscargo test --workspace→ 110 passed / 0 failed(改前 106,+4 为新增守护)cargo test --workspace --all-features→ 133 passed / 0 failedcargo test --workspace --no-default-features→ 127 passed / 0 failedcargo xtask check-dep-dag/check-baseline/dump-symbolsnode .spec/tools/spec-lint.mjs(OK)、node --test .spec/tools/spec-lint.test.mjs(13 pass / 0 fail).github/workflows/repository-policy.yml的readmejob 逐条复现:15/15 断言 OK,sha256sum -c docs/architecture/.baseline.sha256五项全 OKKnown gaps
capability_bits(掩码 vs 计数、bit 位指派)仍未冻结,本 PR 不碰——读键可以,推 bit 不行cargo deny check/cargo audit/ Miri 本机工具链不可用,未执行;三平台交叉构建与 Sanitizer 未系统化执行🤖 Generated with Claude Code