Program: implement IRCGateway #90

Closed
opened 2026-08-08 08:24:33 +00:00 by hugo · 1 comment
Owner

Objective

Port the IRC and grid-chat bridge with explicit protocol boundaries and cancellation.

Deliverables

  • Preserve the original bridge purpose and relevant configuration/command behavior.
  • Implement reconnect/backoff, encoding, channel/user mapping, loop prevention, bounded queues, rate limiting, and sanitized logs.
  • Abstract IRC and grid transports for offline integration tests.

Validation

  • Scripted bidirectional bridge tests pass.
  • Disconnect/reconnect and duplicate/loop scenarios are deterministic.
  • Shutdown leaves neither transport/task running.

Prerequisite

The library behavior required by the program is implemented and its translated parity tests pass.

Project constraints

  • Programs must use the native Rust public API; no CLR, C# process, bridge, RPC, or fallback.
  • Provide deterministic offline/fake validation before opt-in live or device tests.
  • Never log/store credentials or capability tokens, and keep destructive/spending actions separately opt-in.
  • Update program/source completeness, docs, and workspace validation evidence.
## Objective Port the IRC and grid-chat bridge with explicit protocol boundaries and cancellation. ## Deliverables - Preserve the original bridge purpose and relevant configuration/command behavior. - Implement reconnect/backoff, encoding, channel/user mapping, loop prevention, bounded queues, rate limiting, and sanitized logs. - Abstract IRC and grid transports for offline integration tests. ## Validation - Scripted bidirectional bridge tests pass. - Disconnect/reconnect and duplicate/loop scenarios are deterministic. - Shutdown leaves neither transport/task running. ## Prerequisite The library behavior required by the program is implemented and its translated parity tests pass. ## Project constraints - Programs must use the native Rust public API; no CLR, C# process, bridge, RPC, or fallback. - Provide deterministic offline/fake validation before opt-in live or device tests. - Never log/store credentials or capability tokens, and keep destructive/spending actions separately opt-in. - Update program/source completeness, docs, and workspace validation evidence.
hugo added this to the 11 - Programs and live-grid validation milestone 2026-08-08 08:24:33 +00:00
hugo added the enhancement label 2026-08-08 08:24:33 +00:00
Author
Owner

Implemented and pushed in d1e05d1.

The native Rust IRCGateway now preserves the seven positional live arguments (with environment fallbacks), bridges fully audible normal local chat and one IRC channel bidirectionally, accepts teleport lures only from the configured master, and uses only public native LibreMetaverse APIs. The IRC side implements bounded incremental UTF-8 decoding, 512-byte UTF-8-safe writes, NICK/USER registration, PING/PONG, 001/JOIN, PRIVMSG parsing including IRCv3 tags, RFC1459 case mapping, exponential reconnect/backoff, and cancellation. The shared bridge core has bounded queues, deterministic oldest-drop behavior, per-direction integer token buckets, user-name sanitization, self/duplicate/reflection suppression, status/capability redaction, and joined cleanup of the IRC worker, bridge worker, subscriptions, grid login/session, and socket ownership.

Offline validation uses the same BridgeTransport/BridgeEvent boundary as live mode and covers bidirectional mapping/filtering, reconnect and offline queue draining, rate limiting, duplicates/loops, master-only teleport handling, malformed/oversized inputs, fragmented/oversized IRC framing, RFC1459 mapping, bounded queue drops, UTF-8 truncation, and worker/transport cancellation.

Verified:

  • cargo test -p libremetaverse-programs --test irc_gateway_cli --locked (4 passed)
  • cargo test -p libremetaverse-programs irc_gateway::tests --locked (8 passed)
  • cargo test --manifest-path tests/compat/Cargo.toml --test social_message_semantics --locked (4 passed)
  • cargo fmt --all -- --check
  • mapping, shim, and API coverage checks
  • cargo check --workspace --all-targets --locked -j 1
  • cargo check --locked --manifest-path tests/api-compile/Cargo.toml -j 1
  • cargo test --workspace --no-run --locked -j 1
  • cargo clippy -p libremetaverse-programs --all-targets --locked -- -D warnings
  • RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps --locked -j 1

The literal workspace all-features clippy gate reaches unrelated pre-existing tests/compat/tests/archive_model_semantics.rs warnings (three float_cmp and one needless_raw_string_hashes); those out-of-scope cases were left untouched. Documentation and programs/source completeness status were updated.

Implemented and pushed in d1e05d1. The native Rust IRCGateway now preserves the seven positional live arguments (with environment fallbacks), bridges fully audible normal local chat and one IRC channel bidirectionally, accepts teleport lures only from the configured master, and uses only public native LibreMetaverse APIs. The IRC side implements bounded incremental UTF-8 decoding, 512-byte UTF-8-safe writes, NICK/USER registration, PING/PONG, 001/JOIN, PRIVMSG parsing including IRCv3 tags, RFC1459 case mapping, exponential reconnect/backoff, and cancellation. The shared bridge core has bounded queues, deterministic oldest-drop behavior, per-direction integer token buckets, user-name sanitization, self/duplicate/reflection suppression, status/capability redaction, and joined cleanup of the IRC worker, bridge worker, subscriptions, grid login/session, and socket ownership. Offline validation uses the same BridgeTransport/BridgeEvent boundary as live mode and covers bidirectional mapping/filtering, reconnect and offline queue draining, rate limiting, duplicates/loops, master-only teleport handling, malformed/oversized inputs, fragmented/oversized IRC framing, RFC1459 mapping, bounded queue drops, UTF-8 truncation, and worker/transport cancellation. Verified: - cargo test -p libremetaverse-programs --test irc_gateway_cli --locked (4 passed) - cargo test -p libremetaverse-programs irc_gateway::tests --locked (8 passed) - cargo test --manifest-path tests/compat/Cargo.toml --test social_message_semantics --locked (4 passed) - cargo fmt --all -- --check - mapping, shim, and API coverage checks - cargo check --workspace --all-targets --locked -j 1 - cargo check --locked --manifest-path tests/api-compile/Cargo.toml -j 1 - cargo test --workspace --no-run --locked -j 1 - cargo clippy -p libremetaverse-programs --all-targets --locked -- -D warnings - RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps --locked -j 1 The literal workspace all-features clippy gate reaches unrelated pre-existing tests/compat/tests/archive_model_semantics.rs warnings (three float_cmp and one needless_raw_string_hashes); those out-of-scope cases were left untouched. Documentation and programs/source completeness status were updated.
hugo closed this issue 2026-08-11 09:39:27 +00:00
Sign in to join this conversation.