Skip to content

test(protocol): add shared Actr URI vectors - #406

Merged
alinejun merged 4 commits into
mainfrom
claude/issue-401-uri-vectors
Nov 10, 2026
Merged

alinejun merged 4 commits into
mainfrom
claude/issue-401-uri-vectors

Conversation

@alinejun

@alinejun alinejun commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add language-neutral actr:// parsing and normalization vectors under contracts/actr/test-vectors/uri.json
  • exercise the real ActrUri parser, normalized output, public fields, stable error codes, normalization idempotence, ActorId conversion, and local-installation checks
  • document the fixture and its Cargo integration-test command
  • encode Unicode inputs with JSON escapes so the fixture passes the language policy while preserving all 49 decoded vectors

Canonical Actor serial validation and its dedicated boundary fixture are already on main via #403. This PR adds the broader URI conformance fixture.

Fixes #401.

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: 109 passed, 0 failed; 4 documentation tests remain ignored
  • python3 .github/scripts/check_cjk.py: clean
  • python3 -I -m json.tool contracts/actr/test-vectors/uri.json
  • cargo test -p actr-protocol --test uri --all-features --locked --quiet: 2 passed, covering all 49 URI vectors
  • Verified the escaped fixture decodes to exactly the same JSON values as before
  • URI integration coverage: 2 tests, consuming 10 valid and 39 invalid vectors
  • git diff --check

Baseline CI blocker

Dependency Audit reports RUSTSEC-2026-0459 for libsqlite3-sys 0.30.1. Cargo.toml and Cargo.lock are byte-identical to main at 1dd15c89fef6feaa46806311dbe45b00808e9eb9.

The advisory requires libsqlite3-sys >=0.39.0, while both rusqlite 0.32.1 and sqlx-sqlite 0.8.6 depend on the 0.30.1 line. Resolving this baseline failure requires a coordinated database dependency update.

alinejun added a commit that referenced this pull request Nov 9, 2026
## 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
Base automatically changed from claude/issue-399-actor-serial to main November 9, 2026 10:00
@alinejun
alinejun force-pushed the claude/issue-401-uri-vectors branch from 8688af5 to 9f59ffc Compare November 9, 2026 10:09
@alinejun
alinejun requested a review from kaito-harry November 9, 2026 10:09

@kaito-harry kaito-harry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread contracts/actr/test-vectors/uri.json Resolved
@alinejun
alinejun requested a review from kaito-harry November 9, 2026 10:23

@kaito-harry kaito-harry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

alinejun added a commit that referenced this pull request Nov 9, 2026
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
@alinejun
alinejun force-pushed the claude/issue-401-uri-vectors branch from c0e4ecd to b95ee6c Compare November 9, 2026 14:16
@alinejun

alinejun commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@kaito-harry 我已把这个 PR rebase 到最新 main(吸收了 #403 Actor serial 校验),文档和 README 的冲突已处理。之前的 approve 被 dismiss 了,麻烦再 review 一下,谢谢 🙏

alinejun added a commit that referenced this pull request Nov 10, 2026
## 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.
@alinejun
alinejun merged commit 1b30656 into main Nov 10, 2026
34 checks passed
@alinejun
alinejun deleted the claude/issue-401-uri-vectors branch November 10, 2026 03:34
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.

test(actr-protocol): add shared actr URI parsing and normalization vectors

2 participants