Skip to content

feat(core): prepare installation-aware Realm-link guards - #404

Merged
alinejun merged 3 commits into
mainfrom
claude/issue-400-local-realm
Nov 10, 2026
Merged

alinejun merged 3 commits into
mainfrom
claude/issue-400-local-realm

Conversation

@alinejun

@alinejun alinejun commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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 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.

CI Gate passed, and I reproduced all 4 Realm-link tests and 16 URI tests in an isolated workspace. Please address the two inline findings before closing #400. The production Rust entry point needs to enforce the guard, and authority-only addresses need to stop before Realm resolution.

Comment thread crates/actrium-core/src/lib.rs Resolved
Comment thread crates/actrium-core/src/realm_link.rs Resolved
@alinejun alinejun changed the title fix(core): guard local Realm links by installation feat(core): prepare installation-aware Realm-link guards Nov 9, 2026
@alinejun
alinejun requested a review from kaito-harry November 9, 2026 10:27

@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.

Re-reviewed 456c3b7. DNS and matching local authority-only URIs now return URI_LABEL_INVALID before either resolver runs. Foreign local Realm links still fail before dispatch, and sharing is disabled for both matching and foreign local links.

The updated scope leaves #400 open for production Rust open/share integration in #324. I reproduced all 5 Realm-link tests and all 16 URI tests against the locked workspace.

Dependency Audit reports RUSTSEC-2026-0459 for libsqlite3-sys 0.30.1 in the unchanged base lockfile. Audit job

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.
Require a RealmId before invoking either resolver and cover DNS and local authority-only inputs with zero-call spies. Mark the helpers as preparatory while production open/share integration remains tracked by #400 and #324.

Constraint: Keep #400 open for production integration
Confidence: high
Scope-risk: narrow
@alinejun
alinejun force-pushed the claude/issue-400-local-realm branch from 79c42a7 to 1e26e59 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 校验和 #408 SQLite 升级),解决了 uri.rs 的冲突。之前的 approve 被 dismiss 了,麻烦再 review 一下,谢谢 🙏

@alinejun
alinejun merged commit a71182f into main Nov 10, 2026
36 checks passed
@alinejun
alinejun deleted the claude/issue-400-local-realm branch November 10, 2026 02:48
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.

2 participants