Repository navigation
feat(ops): add manifest per-type schema hashes, HandleExhausted checks, and DTO vectors (#274) - #517
Conversation
eric8810
left a comment
There was a problem hiding this comment.
schemaHash 算法/95 个哈希/manifest digest/7 个绑定表/HandleExhausted 矩阵都独立复算通过。但 docs 仍直接说“没有 per-type revision/hash / 只有 exact digest”,与实现矛盾(conformance/implementation/upgrading/node/swift/0.6);另外 inputHash 后插入使自校验需要同时剔 digest 和 inputHash,未文档化无测试。请修文档并补自校验测试。
4def62d to
4dffcaa
Compare
|
@eric8810 Ready for re-review at
Verified locally: |
eric8810
left a comment
There was a problem hiding this comment.
4dffcaa 复审通过:schemaHash 是 BFS + BTreeSet 的 cycle-safe 实现,独立复算 SHA-256 匹配;sources.rs 由 codegen 从 VERSIONS.json 生成且在 src/ 下,cargo package 自包含;六个 binding 的协商路径(abi/ops 严格、digest 快路径、逐项 TYPE_SCHEMA_HASHES 校验)无 fail-open;HandleExhausted 矩阵的子进程隔离和 306/203 断言正确;上次两个问题(文档仍说无 per-type hash、inputHash 自校验未文档化/未测试)都已解决。Approve。
但 #537 刚合入,两者都改 aimux-ops/src/manifest.rs,现在 CONFLICTING。rebase 后请确认 codegen --check 通过(#537 后 manifest 走嵌入式快照)并重跑 CI,绿了我直接合。非阻塞:rfc-0039-conformance.md:300/305 写 101 而 R121/R126 写 102;Java 测试名 declaresOnlyTheFourteenPrimitives 已过时(16 个)。
|
@cunninghamcard-bit 我把这个 PR rebase 到了 0.7.0 master(解了和 #537 的 manifest 快照冲突,重跑了 codegen),但 rebase 改写了历史,推你的分支需要 force-push,我没有动。rebase 后的提交放在 #548,作者信息保留,可以直接从那里合。原分支可以关掉。详见 #548 描述。 |
|
更正:我之前开的 #548(rebase 版本)已关闭,那是我越界做的,这个 PR 仍以你的分支为准。 rebase 到 0.7.0 master 时的冲突点,供你参考:
注意:默认 feature 关闭时,只被 |
…s, and DTO vectors (arcships#274)
4dffcaa to
352ac49
Compare
|
@eric8810 Rebased onto latest
Verified locally: |
eric8810
left a comment
There was a problem hiding this comment.
352ac49 复审通过。rebase 到 0.7.0 后的处理核对:generate_manifest() 与 #537 的嵌入式快照共存,manifest.digest = schema/manifest.json 的 digest/inputHash = 7 个 binding 的 MANIFEST_DIGEST(cd147fa9…);schema/manifest.json 作为生成镜像加回(index 已登记),Go/Node/Python/Swift 的合同测试读得到;版本号未动,[0.7.0] 段未碰;20/20 CI 绿。之前的审查结论(schemaHash 实现、六 binding 协商无 fail-open、HandleExhausted 矩阵、上轮两个问题已解)不变。Approve,可合。
非阻塞,可合后补:缺 CHANGELOG [Unreleased] 条目(manifest 新增 schemaHash/sources/generatorVersion、inputHash 自校验、HandleExhausted 覆盖);rfc-0039-conformance.md:300,305 写 101 而 R121/R126 写 102;Java 测试名 declaresOnlyTheFourteenPrimitives 已过时(16 个导出)。
Summary
Implements per-type manifest
schemaHashnegotiation,sourcesmetadata,HandleExhaustedcontract matrix coverage, RFC-0042 §3.2 tool-input & negative DTO vectors, Rust decode round-trip tests, and conformance/release-matrix docs (refs#274, RFC-0039 & RFC-0042).schemaHash,generatorVersion, andsources(aimux-ops,tools/aimux-codegen):"revision": "1"and cycle-safe transitive"schemaHash"per entry inmanifest.types, plus"generatorVersion"and"sources"(aimux-ops/src/sources.rsgenerated fromfixtures/aisdk/VERSIONS.jsonsocargo package -p aimux-opsremains self-contained).schema/manifest.jsonandTYPE_SCHEMA_HASHESacross all 7 generated binding constant files (go,java,kotlin,swift,flutter,node,python), verified bycargo run -p aimux-codegen -- --check.node,python,go,java,swift,flutter):abiVersionandopsVersionstrict.manifest.digest == MANIFEST_DIGEST(preserving minimal C ABI fixtures and Python's explicitexpected_digestpin checks), and falls back to verifying every entry inTYPE_SCHEMA_HASHESagainstmanifest.types[].schemaHash.HandleExhaustedcontract matrix (aimux-ops/tests/ops_matrix.rs):handle_exhausted_negative_state_behaves_per_contractverifies protocol code306across all 20 handle-allocating ops, code203on invalid handles, continued queries on pre-existing handles, zero provider reach, and allocator recovery on RAII guard drop.contract-tests/dto):RawToolCall/002..010.jsonandToolCall/003..010.json.contract-tests/dto/index.json,scripts/check_dto_vectors.py,aimux-ops/src/dto_vectors.rs, and codegen emitters to validate"expectError": truenegative vectors (while keepingErrorEnvelopeopen for forward compatibility), plusencoded_positive_dto_vectors_decode_through_rustinaimux-ops/tests/manifest_contract.rs.R128->gapindocs/rfc-0039-conformance.md, registersD20indocs/rfc-0039-implementation.md, and addsdocs/release-matrix.md.Type of change
Checklist
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningspasses (cargo clippy -p aimux-ops -p aimux-codegen --all-targets -- -D warningspassed locally; full workspace runs in CI)cargo test --workspacepasses (cargo test -p aimux-ops -p aimux-codegen+ Node/Go/Swift/Python checks passed locally; Java/Kotlin/Flutter/pytest run in CI)README.md,docs/,rfc/,bindings/README.md)Verification
cargo run -p aimux-codegen -- --check— passed (on4e6ed9843)bede841de, disjoint from#507):cargo fmt --all -- --check— passedcargo clippy -p aimux-ops -p aimux-codegen --all-targets -- -D warnings— passedcargo test -p aimux-ops -p aimux-codegen— 311 passed, 1 ignored (run_shared_driver)cargo package --list -p aimux-ops— passedtest-abi.sh+ 270 DTO vectors), Swift (33 checks + 270 DTO vectors), Pythontest_manifest_negotiation.py— passed (Java/Kotlin/Flutter/pytestrun in CI)Notes for reviewers
#509or#510lands first, rerunningcargo run -p aimux-codegencleanly regeneratesschema/manifest.json,MANIFEST_DIGEST, andTYPE_SCHEMA_HASHES.aimux-ops/src/dto_vectors.rsremains#[cfg(test)]-gated (compatible with#513).