Repository navigation
test(protocol): add shared Actr URI vectors - #406
Conversation
## Summary - centralize Actor serial parsing on one canonical rule: `0` or lowercase hexadecimal without leading zeros, up to `2^54 - 1` - enforce the same rule in `ActrUri` and `ActrId`, so every accepted Actor URI can be converted to an `ActrId` - publish shared valid and invalid Actor URI/ActorId serial vectors in `contracts/actr/test-vectors/actor-uri-serial.json`, consumed directly by the Rust assertions - store hexadecimal serials and exact decimal expectations as strings, including the 54-bit maximum and a value above JavaScript's safe integer range - document the canonical grammar and shared fixture in the English and Chinese URI specifications and the contracts README Fixes #399. ## Validation - `cargo fmt` - `cargo fmt --all --check` - `cargo clippy --fix --lib --bins --all-targets --allow-dirty -p actr-protocol --all-features --locked` - `cargo test -p actr-protocol --all-features --locked --quiet`: **107 passed, 0 failed**; 4 documentation tests remain ignored - Shared fixture: **5 valid and 8 invalid cases**; JSON syntax and exact string-valued serial expectations verified - `git diff --check` - Verified the existing #406 changes still apply cleanly
8688af5 to
9f59ffc
Compare
kaito-harry
left a comment
There was a problem hiding this comment.
The Language Policy job fails on three Unicode literals in the new URI fixture. The inline comment gives a fix that preserves all 49 decoded vectors. Language Policy log
The Dependency Audit job also reports RUSTSEC-2026-0459 for libsqlite3-sys 0.30.1 in the base lockfile. Dependency Audit log
kaito-harry
left a comment
There was a problem hiding this comment.
Verified that the three JSON Unicode escapes preserve all 49 decoded URI vectors. The Language Policy job passed, and the local actr-protocol suite passed 109 tests.
The Dependency Audit job reports RUSTSEC-2026-0459 for libsqlite3-sys 0.30.1 in the base lockfile.
Dependency Audit is blocked by [RUSTSEC-2026-0459](https://github.com/RustSec/advisory-db/blob/main/crates/libsqlite3-sys/RUSTSEC-2026-0459.md) in bundled SQLite. The workspace and four downstream lockfiles now resolve one `libsqlite3-sys 0.39.1`, bundling SQLite **3.54.1**. ## Changes - Upgrade rusqlite to **0.41.1** and consolidate CLI/sync dependencies on the workspace declaration, preserving statement caching and checked unsigned integer conversions. - Use SQLx **0.9.0** pinned to official upstream commit `10462fa4414c6c7f1ed1d39bb31678e3b726878c` ([SQLx #4502](transact-rs/sqlx#4502)). The published release excludes the patched SQLite version; replace this pin once a release includes the fix. - Adapt SQLx query-safety APIs with static SQL, bound fixture values, and integer-only PRAGMA builders. Update Tokio/Rustls feature declarations and all five affected lockfiles. Related CI blockers: #404, #406. ## Validation - `cargo audit --json`: **0 vulnerabilities** under the existing repository policy; four existing warnings remain and the audit exceptions are unchanged. - `cargo fmt`, `cargo fmt --all --check`, language policy, and `git diff --check`: passed. - `cargo clippy --fix --lib --bins --all-targets --allow-dirty --locked` for loran-signer, loran-platform, loran-issuer, loran-publisher-registry, and loran-server: passed. - Signer Clippy with `--all-features`: passed, including PostgreSQL backend compilation. - Locked Cargo metadata resolves for all five workspaces. | Executed tests | Passed | | --- | ---: | | Mailbox, sync, admin, issuer, platform, publisher registry, signer library suites | 327 | | Native platform | 14 | | Hyper storage, including reopen persistence | 8 | | Issuer Realm Profile integration | 16 | | Fullstack registration/discovery and unregister durability across restart | 2 | | **Total** | **367** | One existing admin library test remains ignored.
Use JSON Unicode escapes for the IDNA domain and rejected Unicode path/fragment inputs so the shared fixture passes the repository language policy while preserving all 49 decoded vectors. Constraint: Preserve every decoded URI vector Confidence: high Scope-risk: narrow
c0e4ecd to
b95ee6c
Compare
|
@kaito-harry 我已把这个 PR rebase 到最新 main(吸收了 #403 Actor serial 校验),文档和 README 的冲突已处理。之前的 approve 被 dismiss 了,麻烦再 review 一下,谢谢 🙏 |
## Summary - add installation-aware URI parsing and Realm-link guard helpers in `actrium-core` - dispatch matching local Realm links only to the supplied local resolver, and DNS Realm links only to the supplied remote resolver - reject foreign local Realm links with `URI_LOCAL_REALM_FOREIGN` before either callback is entered - reject authority-only addresses with `URI_LABEL_INVALID` before either callback is entered, including a matching local installation's authority - disable sharing for local and domain-only addresses while allowing DNS Realm/Actor links ## Scope This PR is preparatory work related to #400. Production Rust open/share integration remains tracked by #400 as part of the Front-Service flow in #324. **#400 remains open after this PR.** The tests exercise these helper APIs and their supplied resolver callbacks. ## Validation - `cargo fmt` - `cargo fmt --all --check` - `cargo clippy --fix --lib --bins --all-targets --allow-dirty -p actrium-core --all-features --locked` - `cargo test -p actrium-core --test realm_link --all-features --locked --quiet`: **5 passed** - `cargo test -p actr-protocol --lib uri::tests --all-features --locked --quiet`: **16 passed** - DNS and local authority-only cases assert **zero calls to both callbacks** - `python3 .github/scripts/check_cjk.py`: **clean** - `git diff --check` ## Baseline CI blocker The shared base lockfile contains `libsqlite3-sys 0.30.1`, reported by Dependency Audit as `RUSTSEC-2026-0459`. The baseline finding and dependency constraints are documented in #406.
Summary
actr://parsing and normalization vectors undercontracts/actr/test-vectors/uri.jsonActrUriparser, normalized output, public fields, stable error codes, normalization idempotence, ActorId conversion, and local-installation checksCanonical Actor serial validation and its dedicated boundary fixture are already on
mainvia #403. This PR adds the broader URI conformance fixture.Fixes #401.
Validation
cargo fmtcargo fmt --all --checkcargo clippy --fix --lib --bins --all-targets --allow-dirty -p actr-protocol --all-features --lockedcargo test -p actr-protocol --all-features --locked --quiet: 109 passed, 0 failed; 4 documentation tests remain ignoredpython3 .github/scripts/check_cjk.py: cleanpython3 -I -m json.tool contracts/actr/test-vectors/uri.jsoncargo test -p actr-protocol --test uri --all-features --locked --quiet: 2 passed, covering all 49 URI vectorsgit diff --checkBaseline CI blocker
Dependency Audit reports
RUSTSEC-2026-0459forlibsqlite3-sys 0.30.1.Cargo.tomlandCargo.lockare byte-identical tomainat1dd15c89fef6feaa46806311dbe45b00808e9eb9.The advisory requires
libsqlite3-sys >=0.39.0, while bothrusqlite 0.32.1andsqlx-sqlite 0.8.6depend on the 0.30.1 line. Resolving this baseline failure requires a coordinated database dependency update.