Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
73edd6d
feat(tinybus): add module-loading infrastructure and workspace member
senamakel Aug 10, 2026
2f5d2f3
feat(module): add initial tinybus-module crate
senamakel Aug 10, 2026
d1e69c7
fix(deps): use explicit path and version for tinybus dependency
senamakel Aug 10, 2026
c9576f7
feat(tinybus): add module_clock example
senamakel Aug 10, 2026
a973a71
chore(deps): add tinybus-module dependency to Cargo.lock
senamakel Aug 10, 2026
a66fa22
feat(error): add ModuleRefused variant for dynamic module admission f…
senamakel Aug 10, 2026
67079a4
feat(error): add sanitize_untrusted helper for log-safe value truncation
senamakel Aug 10, 2026
9b607b5
fix(transport): handle missing module transport file
senamakel Aug 10, 2026
2ac013d
fix(loader): handle untracked module files gracefully
senamakel Aug 10, 2026
531f507
fix(host): handle untracked module host file
senamakel Aug 10, 2026
99389a7
chore: reformat conditional expressions and error calls for consisten…
senamakel Aug 10, 2026
683ff70
test(host): add unit and integration tests for module validation
senamakel Aug 10, 2026
c36090a
fix: correct import ordering in test module
senamakel Aug 10, 2026
17db056
test(host): wait for clock name to appear in test
senamakel Aug 10, 2026
f02bb57
feat(host): add module control trait and enable flag
senamakel Aug 10, 2026
d4bad18
feat(module): make strict flag atomic and extract stop_sync helper
senamakel Aug 10, 2026
9799ad6
feat(host): implement ModuleControl for ModuleHostInner
senamakel Aug 10, 2026
dfb4182
feat(broker): add module control methods behind a feature flag
senamakel Aug 10, 2026
afc9850
fix(module): make host module visible within crate
senamakel Aug 10, 2026
4fa883a
chore(tinybus): reformat chained method calls for consistency
senamakel Aug 10, 2026
3272d00
feat(tinybus): add modules subcommand for inspecting and controlling …
senamakel Aug 10, 2026
67dd99b
refactor(tinybus): split enable and disable into separate match arms
senamakel Aug 10, 2026
e8f53fe
refactor(tinybus): reorder module display fields and simplify functio…
senamakel Aug 10, 2026
80085cd
fix(transport): wrap host_send in panic catch and switch to blocking …
senamakel Aug 10, 2026
345ff24
feat(tinybus-module): add panic hook that logs location and faults
senamakel Aug 10, 2026
1e6d5e1
feat(tinybus-module): add manifest metadata to module_export macro
senamakel Aug 10, 2026
11abcc7
refactor(tinybus-module): simplify log function call
senamakel Aug 10, 2026
627c2ef
feat(docs, protocol): document in-process module ABI and bus extension
senamakel Aug 10, 2026
cad45fb
ci(workflows): add CI jobs for module loading without sockets
senamakel Aug 10, 2026
c14f395
feat(broker): add optional JSON configuration to LoadModule
senamakel Aug 10, 2026
ac87ee9
Merge remote-tracking branch 'origin/main' into feature/modules-dlopen
senamakel Aug 10, 2026
281cd13
feat(tinybus-module): add typed config support to module export macro
senamakel Aug 10, 2026
49c552d
feat(tinybus): add module configuration support
senamakel Aug 10, 2026
9191b35
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
169d0e3
chore(deps): add serde dependency and reformat multi-line function si…
senamakel Aug 10, 2026
20d0b6f
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
6e7c5aa
feat(broker): emit ModuleStateChanged signal for module lifecycle events
senamakel Aug 10, 2026
d684098
fix(host): handle empty parent path in module loading
senamakel Aug 10, 2026
4d14149
fix(broker): collapse multi-line interface name construction
senamakel Aug 10, 2026
decae93
feat(tinybus): add signal assertion to stop-module test
senamakel Aug 10, 2026
31b967b
feat(tinybus-module): install a tracing subscriber that forwards even…
senamakel Aug 10, 2026
7611270
refactor(tinybus-module): collapse record_debug signature onto one line
senamakel Aug 10, 2026
6198855
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
e49659a
feat(host): record rejected modules with their rejection reason
senamakel Aug 10, 2026
9c3b25f
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
3e2df21
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
8d05f9a
test(host): add test for refused artifact not exposing directory path
senamakel Aug 10, 2026
157bb2b
chore: files changed crates/tinybus/src/module/host.rs,docs/modules/m…
senamakel Aug 10, 2026
72bf1cd
chore: files changed crates/tinybus/src/module/host.rs,crates/tinybus…
senamakel Aug 10, 2026
605c317
fix(test): reformat assertion for readability
senamakel Aug 10, 2026
aeaea26
feat(manifest): redesign module manifest with rich metadata and peer …
senamakel Aug 10, 2026
414fb88
chore: files changed crates/tinybus-module/src/lib.rs
senamakel Aug 10, 2026
9227cbe
feat(host): enforce bus name uniqueness and restructure manifest fields
senamakel Aug 10, 2026
2ca1111
feat(host): detect duplicate bus names during module loading
senamakel Aug 10, 2026
7097cdc
chore: files changed crates/tinybus-module/src/lib.rs,crates/tinybus/…
senamakel Aug 10, 2026
52174c2
feat(module): add attach_raw entry point and improve ABI validation
senamakel Aug 10, 2026
a8d9481
refactor(host): return structured error for version and feature misma…
senamakel Aug 10, 2026
dae9d9c
feat(host): add test helper to verify init is not called
senamakel Aug 10, 2026
691737f
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
b29cd45
chore: files changed crates/tinybus-module/src/lib.rs,crates/tinybus/…
senamakel Aug 10, 2026
2e82a39
fix(test): update expected version string in host module test
senamakel Aug 10, 2026
d781f4a
feat(host): expand module lifecycle with detailed states
senamakel Aug 10, 2026
5f3b34a
fix(test): use matches! macro to check rejected module state
senamakel Aug 10, 2026
ac6854a
feat(error): add ModuleUnavailable variant for terminal-state modules
senamakel Aug 10, 2026
6a6f4d4
feat(connection): add module management methods behind a feature flag
senamakel Aug 10, 2026
3940860
feat(connection): add configurable panic handler for dispatched methods
senamakel Aug 10, 2026
eaca7bb
feat(tinybus-module): add configurable detach-on-panic behaviour
senamakel Aug 10, 2026
d1ccf57
chore: reformat long lines for consistency
senamakel Aug 10, 2026
ec31efb
feat(transport): add faulted flag to HostContext
senamakel Aug 10, 2026
24ef35c
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
0e381db
chore: files changed crates/tinybus/examples/module_clock.rs,crates/t…
senamakel Aug 10, 2026
9e726dd
chore: files changed crates/tinybus-module/src/lib.rs,crates/tinybus/…
senamakel Aug 10, 2026
86c90b7
test(module_clock): add test verifying declared methods match dispatc…
senamakel Aug 10, 2026
a29e6ac
fix(tests): correct generic type syntax in panic test
senamakel Aug 10, 2026
6b6b121
feat(tinybus-module): keep module connection alive after setup
senamakel Aug 10, 2026
0775321
fix(host): add failure context to state assertion in test
senamakel Aug 10, 2026
c3692ca
fix(test): flatten assertion formatting in host module test
senamakel Aug 10, 2026
9c5dbda
fix(test): filter state change messages in host test
senamakel Aug 10, 2026
28313dc
feat(module): add deferred initialization and ready signaling
senamakel Aug 10, 2026
d940db9
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
43914c5
feat(broker, router): add module name reservation before handshake
senamakel Aug 10, 2026
b346c0f
feat(host): support lazy module initialisation
senamakel Aug 10, 2026
0bdab71
feat(modules): emit module state signal on peer detachment
senamakel Aug 10, 2026
02f0ef2
feat(broker): emit module state announcements for all affected modules
senamakel Aug 10, 2026
7291cf7
fix(host): update module state when toggling enabled flag
senamakel Aug 10, 2026
eeca932
chore: files changed crates/tinybus/src/module/host.rs,crates/tinybus…
senamakel Aug 10, 2026
60e924d
refactor(tinybus): reformat code for consistency
senamakel Aug 10, 2026
f90edfd
feat(modules): add dry-run scan and explicit path support to module r…
senamakel Aug 10, 2026
8ebda99
chore: reformat multi-line function signatures to single lines
senamakel Aug 10, 2026
065c5b4
fix(host): ignore unused fields in rejection pattern
senamakel Aug 10, 2026
06337ce
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
cfad805
test(module): add test for lazy module initializing exactly once unde…
senamakel Aug 10, 2026
938617f
fix(test): use first body element for method return in test helper
senamakel Aug 10, 2026
816c895
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
7d62847
fix(tests): update lazy module test for new bus and call API
senamakel Aug 10, 2026
06f7f07
fix(tests): reformat long method chain in test
senamakel Aug 10, 2026
860fcd0
fix(test): filter module state change by stopped status
senamakel Aug 10, 2026
eb3f95c
test(host): add tests for feature validation, directory permissions, …
senamakel Aug 10, 2026
c6d5ed1
docs(protocol): document lazy init, modules.toml, and RescanModules c…
senamakel Aug 10, 2026
6720006
chore: files changed crates/tinybus/src/native.rs
senamakel Aug 10, 2026
5a99a5c
feat(host): add safety documentation to attach_raw methods
senamakel Aug 10, 2026
7c9056b
refactor(tinybus-module): replace positional manifest parameters with…
senamakel Aug 10, 2026
a8bb4cf
fix: correct typo in macro variable name
senamakel Aug 10, 2026
ce8a9bb
feat(module): add resolve module behind the modules feature gate
senamakel Aug 10, 2026
d0c594b
refactor(host): delegate module dependency resolution to dedicated re…
senamakel Aug 10, 2026
053936c
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
4a48a1a
fix(tests): reformat test code for consistency
senamakel Aug 10, 2026
4ac30ec
fix(host): pass path by reference in error construction
senamakel Aug 10, 2026
75bb6e0
feat(modules): improve error reporting for unavailable modules
senamakel Aug 10, 2026
4c0bbaf
feat(broker): reject messages to unavailable modules
senamakel Aug 10, 2026
bb7f55b
feat(module): distinguish initialization failure from runtime fault
senamakel Aug 10, 2026
140f432
test(module): add test for lazy-init module that fails permanently
senamakel Aug 10, 2026
9f45f27
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
d00c093
feat(host): record rejected module manifests for introspection
senamakel Aug 10, 2026
3356de0
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
5ce57ab
chore(tinybus): reformat test assertions for readability
senamakel Aug 10, 2026
41ec0bc
fix(broker): use map_err instead of or_else for module target resolution
senamakel Aug 10, 2026
6741ff1
test(host): add tests for lazy module signal matching and module isol…
senamakel Aug 10, 2026
fce7498
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
eac5104
test(host): serialize lazy-module tests with a global mutex
senamakel Aug 10, 2026
cacee5c
fix(host): defer name reservation and emit state transition for lazy-…
senamakel Aug 10, 2026
d478945
feat(host): add O_NOFOLLOW check for module file metadata on unix
senamakel Aug 10, 2026
0a80422
perf(hash): stream input instead of loading entire file into memory
senamakel Aug 10, 2026
2e3be1c
fix(router): gate request_name_for_unique behind modules feature
senamakel Aug 10, 2026
15e24c4
chore: files changed crates/tinybus/Cargo.toml,crates/tinybus/example…
senamakel Aug 10, 2026
e6ae0e4
test(module): add integration tests for symbol isolation and target m…
senamakel Aug 10, 2026
36e7b99
fix(test): reformat variable assignment in symbol resolution test
senamakel Aug 10, 2026
8cc1999
refactor(global): remove dedicated runtime from OnceBus
senamakel Aug 10, 2026
882bdd8
fix(windows): enforce ACL checks on every component of the module sea…
senamakel Aug 10, 2026
1003655
refactor(host): reformat constant and variable declarations
senamakel Aug 10, 2026
c981b23
docs(examples): add safety docs to module init functions
senamakel Aug 10, 2026
47bfa1c
fix: simplify Windows directory check to avoid resolving absolute path
senamakel Aug 10, 2026
ca76893
fix(host): record manifest rejection details for each failure mode
senamakel Aug 10, 2026
821f862
fix(host): record manifest rejection on dependency check failure
senamakel Aug 10, 2026
00ffaf3
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
4eec285
fix(resolve): include missing interface name in error messages
senamakel Aug 10, 2026
a4e3680
feat(host): add load_search_paths and fallback to search paths in rescan
senamakel Aug 10, 2026
99ec048
feat(transport): add init-started flag and wait mechanism
senamakel Aug 10, 2026
e112099
feat(host): support lazy initialization state transitions
senamakel Aug 10, 2026
a577a4c
fix(transport): avoid race in wait_ready and wait_initializing
senamakel Aug 10, 2026
8644fe6
test(connection): add tests for panicking module methods
senamakel Aug 10, 2026
5bb1ec9
feat(tinybus-module): add unit tests for backpressure and frame-size …
senamakel Aug 10, 2026
6603d8a
refactor(host): extract unix directory permission checks into a helper
senamakel Aug 10, 2026
7606f47
feat(tinybus): add test for module directory owned by another user
senamakel Aug 10, 2026
ad47183
test(host): add test that one refused module does not block others in…
senamakel Aug 10, 2026
25a8880
test(transport): add test for module log level propagation
senamakel Aug 10, 2026
7fe6a12
fix(host): call stop_sync instead of shutdown_sync on transports
senamakel Aug 10, 2026
620cd61
chore: files changed crates/tinybus/src/module/host.rs,crates/tinybus…
senamakel Aug 10, 2026
5eba600
chore(tinybus): reorder imports and reformat code
senamakel Aug 10, 2026
853856a
feat(module): track inflight calls to distinguish Ready from Serving
senamakel Aug 10, 2026
1315720
fix(transport): decrement inflight counter on delivery failure
senamakel Aug 10, 2026
542d6b1
fix(transport): drain pending messages on delivery failure
senamakel Aug 10, 2026
85e6194
test(host): add test for caller timeout when module never replies
senamakel Aug 10, 2026
878b014
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
587c70e
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
589da9c
chore: reformat long lines in test and transport code
senamakel Aug 10, 2026
46a7903
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
6aad914
fix(host): handle name reservation failure during lazy init
senamakel Aug 10, 2026
4e7b346
fix(host): handle "bus name is already owned" as unresolved
senamakel Aug 10, 2026
78e9e6d
feat(host): resolve inter-module dependencies during discovery
senamakel Aug 10, 2026
9423dfd
chore(tinybus): move module host tests to a separate file
senamakel Aug 10, 2026
575af27
chore(tests): fix indentation in module tests
senamakel Aug 10, 2026
bc3a5ce
fix(host): merge duplicate state transition branches
senamakel Aug 10, 2026
9c66237
docs(module): document lifecycle states in README
senamakel Aug 10, 2026
b7c059f
refactor(host): always reserve module name on attach
senamakel Aug 10, 2026
0dfd77c
fix(broker): record module state before forced stop
senamakel Aug 10, 2026
06ab54c
chore: files changed crates/tinybus/src/module/host.rs,crates/tinybus…
senamakel Aug 10, 2026
0857ecc
fix(host): compute module state from transport readiness and inflight…
senamakel Aug 10, 2026
a2f571e
fix(host): reformat condition for readability
senamakel Aug 10, 2026
1cf6377
chore: files changed .github/workflows/ci.yml
senamakel Aug 10, 2026
c1904a3
chore: files changed .github/workflows/ci.yml
senamakel Aug 10, 2026
4a985a8
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
e7a57a6
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
231bb3c
chore: files changed crates/tinybus/src/broker.rs
senamakel Aug 10, 2026
3f487e3
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
cf93676
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
815ca6a
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
95b2029
chore: files changed .github/workflows/ci.yml,Cargo.toml,README.md,cr…
senamakel Aug 10, 2026
5f13635
chore: files changed ROADMAP.md,crates/tinybus/src/bin/tinybus.rs
senamakel Aug 10, 2026
dfcb944
chore(tinybus): remove obsolete host-module tests from `tests.rs`
senamakel Aug 10, 2026
fbacd0a
chore(tinybus): move test module declaration to end of host.rs
senamakel Aug 10, 2026
de2640e
fix(test): add MetadataExt import for world-writable directory test
senamakel Aug 10, 2026
87708d1
chore: files changed crates/tinybus/src/module/hash.rs,crates/tinybus…
senamakel Aug 10, 2026
accbcdf
feat(tinybus-module): guard against undersized host vtable and duplic…
senamakel Aug 10, 2026
af7b584
refactor(tinybus-module): extract common macro logic into an internal…
senamakel Aug 10, 2026
b9a9e8a
fix(loader): canonicalize module path before loading on Windows
senamakel Aug 10, 2026
cb92373
fix(host): open file once and pass handle to allowlist check
senamakel Aug 10, 2026
8c03bf9
feat(host): add admission lock to prevent duplicate module loads
senamakel Aug 10, 2026
6dbeff2
chore: files changed crates/tinybus/src/module/host.rs,crates/tinybus…
senamakel Aug 10, 2026
99ee915
chore: files changed crates/tinybus/src/module/host.rs
senamakel Aug 10, 2026
41c76d0
feat(transport): enforce a deadline on module initialization
senamakel Aug 10, 2026
93ce3e0
fix: use `Pin<Box<F>>` instead of `AssertUnwindSafe` wrapper in `Catc…
senamakel Aug 10, 2026
d7eca8f
refactor(broker): extract common bus signal broadcast into a helper
senamakel Aug 10, 2026
b5fb5ac
feat(host): make ModuleControl::stop async and add state validation
senamakel Aug 10, 2026
e276b33
feat(host): return module transitions from load, enable, and rescan
senamakel Aug 10, 2026
6b06890
feat(broker): make module methods async and emit module state changes
senamakel Aug 10, 2026
2dc7a17
feat(broker): handle StopModule asynchronously
senamakel Aug 10, 2026
6c3019e
chore(module): wrap TbModuleVtable in a Send-safe newtype
senamakel Aug 10, 2026
20cf1b7
fix(transport): move SendHostVtable construction before spawn_blocking
senamakel Aug 10, 2026
adadb64
chore: files changed crates/tinybus/src/module/transport.rs
senamakel Aug 10, 2026
63a11c3
refactor(broker): replace string matching with enum for module operat…
senamakel Aug 10, 2026
7aaa780
fix(module): borrow state in matches! to avoid move
senamakel Aug 10, 2026
9e1235c
chore(broker): remove unreachable panic in module member check
senamakel Aug 10, 2026
f3998ae
docs(README): clarify module documentation policy
senamakel Aug 10, 2026
eca5819
test: add tests for invalid manifest and sanitized module refusal
senamakel Aug 10, 2026
ff20c07
chore: files changed crates/tinybus/src/error.rs
senamakel Aug 10, 2026
0dcfb79
refactor(tinybus): reformat match arms and function signatures for co…
senamakel Aug 10, 2026
c686d21
fix(error): sanitize each word in module refusal reason
senamakel Aug 10, 2026
b7490e3
chore: files changed crates/tinybus-module/src/lib.rs
senamakel Aug 10, 2026
0eb4db7
fix(broker): suppress unused variable warning when modules feature is…
senamakel Aug 10, 2026
ac535de
test(host_test): verify re-enabling a stopped module fails
senamakel Aug 10, 2026
66151a2
feat(transport): set faulted state and clear inbound on drain timeout
senamakel Aug 10, 2026
5ca3bbd
refactor(broker, host): replace map_err with inspect_err for side-eff…
senamakel Aug 10, 2026
8f90709
fix(ci, host): use symlink metadata on Windows for module validation
senamakel Aug 10, 2026
ccc71ef
fix(ci): use PowerShell class constructor syntax
senamakel Aug 10, 2026
9d364bb
fix(test): use module artifact parent for temp directory in skipped f…
senamakel Aug 10, 2026
c49fcac
chore: files changed crates/tinybus/src/module/host_test.rs
senamakel Aug 10, 2026
214fe0b
chore(tinybus): reformat test helper for readability
senamakel Aug 10, 2026
e8253be
chore: files changed crates/tinybus/src/module/host_test.rs
senamakel Aug 10, 2026
3c1d113
feat(ci): add mixed-permission directory for module loading tests
senamakel Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 81 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings

permissions: {}

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
Expand All @@ -34,14 +38,17 @@ jobs:
- name: Slim build
run: cargo check --locked --no-default-features

- name: Module loader without sockets
run: cargo check --locked --no-default-features --features modules

- name: Docs
run: cargo doc --locked --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings

# The bus is meant to be embeddable on every platform OpenHuman ships on. The
# Unix transport is Unix-only by construction, so Windows builds the slim
# configuration until the named-pipe backend lands (ROADMAP.md, M6).
# socket adapter remains Unix-only, while the in-process module transport
# and dynamic loader are portable and run on both non-Linux targets.
portability:
strategy:
fail-fast: false
Expand All @@ -50,9 +57,81 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo check --locked --no-default-features --features macros
- name: Test
run: cargo test --locked --no-default-features --features macros
- name: Test modules without sockets
run: cargo test --locked --no-default-features --features modules,macros

modules:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build example module
run: cargo build --locked --example module_clock --example module_clock_two --example module_wrong_target --no-default-features --features modules,macros
- name: Exercise the real loader (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
module=$(find target/debug/examples -maxdepth 1 -type f \( -name 'libmodule_clock.so' -o -name 'libmodule_clock.dylib' \) -print -quit)
module_two=$(find target/debug/examples -maxdepth 1 -type f \( -name 'libmodule_clock_two.so' -o -name 'libmodule_clock_two.dylib' \) -print -quit)
wrong_target=$(find target/debug/examples -maxdepth 1 -type f \( -name 'libmodule_wrong_target.so' -o -name 'libmodule_wrong_target.dylib' \) -print -quit)
for artifact in "$module" "$module_two" "$wrong_target"; do
if [ -z "$artifact" ] || [ ! -f "$artifact" ]; then
echo "a module example artifact is missing; the loader tests would not exercise it" >&2
exit 1
fi
done
TINYBUS_TEST_MODULE="$PWD/$module" TINYBUS_TEST_MODULE_TWO="$PWD/$module_two" TINYBUS_TEST_WRONG_TARGET="$PWD/$wrong_target" cargo test --locked --no-default-features --features modules,macros -- --ignored
- name: Exercise the real loader (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$private = Join-Path $PWD target/private-module-tests
New-Item -ItemType Directory -Force $private | Out-Null
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$acl = [System.Security.AccessControl.DirectorySecurity]::new()
$acl.SetOwner($identity.User)
$acl.SetAccessRuleProtection($true, $false)
$inherit = [System.Security.AccessControl.InheritanceFlags]'ContainerInherit, ObjectInherit'
$rule = [System.Security.AccessControl.FileSystemAccessRule]::new(
$identity.User,
[System.Security.AccessControl.FileSystemRights]::FullControl,
$inherit,
[System.Security.AccessControl.PropagationFlags]::None,
[System.Security.AccessControl.AccessControlType]::Allow
)
$acl.AddAccessRule($rule)
Set-Acl -LiteralPath $private -AclObject $acl
Copy-Item target/debug/examples/module_clock.dll $private
Copy-Item target/debug/examples/module_clock_two.dll $private
Copy-Item target/debug/examples/module_wrong_target.dll $private
$mixed = Join-Path $private mixed
New-Item -ItemType Directory -Force $mixed | Out-Null
Set-Acl -LiteralPath $mixed -AclObject $acl
Copy-Item target/debug/examples/module_clock.dll $mixed
Copy-Item target/debug/examples/module_wrong_target.dll $mixed
$module = (Get-ChildItem "$private/module_clock.dll" | Select-Object -First 1).FullName
$moduleTwo = (Get-ChildItem "$private/module_clock_two.dll" | Select-Object -First 1).FullName
$wrongTarget = (Get-ChildItem "$private/module_wrong_target.dll" | Select-Object -First 1).FullName
$env:TEMP = $private
$env:TMP = $private
$env:TINYBUS_TEST_MODULE = $module
$env:TINYBUS_TEST_MODULE_TWO = $moduleTwo
$env:TINYBUS_TEST_WRONG_TARGET = $wrongTarget
$env:TINYBUS_TEST_MODULE_DIRECTORY = $mixed
cargo test --locked --no-default-features --features modules,macros -- --ignored
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,10 @@ discussion in the pull request:
best-effort signal delivery, and an accept loop that survives a bad client are
all this invariant. Any change that lets one peer's slowness reach another's
latency is a bug, not a tuning question.
- **In-process modules are inside the trust boundary, not outside it.** The
misbehaving-peer invariant applies to peers reached across a real transport
boundary. A module loaded with `dlopen` shares the host address space and is
trusted exactly as much as the host's own code. Bounded queues, deadlines and
caught panics bound misbehaviour; they cannot contain a segfault, abort, heap
corruption, OOM, or deliberate memory access. An integration whose crash or
compromise must not reach the kernel belongs in a separate process.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[workspace]
# Two crates, and there is a reason it is not one. `tinybus-macros` is a
# Three crates, and there is a reason they are not one. `tinybus-macros` is a
# proc-macro crate, which means it compiles for the *host* even when the bus
# itself is cross-compiled; keeping it separate is the only way to have
# `#[interface]` without forcing that split on every downstream target.
# Integrations themselves are never workspace members — the whole point is that
# an integration is a separate process (or a separate crate in its own repo)
# that speaks the wire protocol. Adding an integration here would re-create the
# dependency blob we are trying to delete from the kernel.
members = ["crates/tinybus", "crates/tinybus-macros"]
# `tinybus-module` is the module-side half of the C ABI. It is versioned here in
# lockstep with the host ABI so the two definitions cannot drift. Integrations
# themselves remain separate repositories and are never workspace members.
members = ["crates/tinybus", "crates/tinybus-macros", "crates/tinybus-module"]
resolver = "3"

[workspace.package]
Expand All @@ -17,8 +16,10 @@ license = "GPL-3.0-only"
repository = "https://github.com/tinyhumansai/tinybus"

[workspace.dependencies]
tinybus = { path = "crates/tinybus", version = "0.1.0" }
tinybus = { path = "crates/tinybus", version = "0.1.0", default-features = false }
tinybus-macros = { path = "crates/tinybus-macros", version = "0.1.0" }
tinybus-module = { path = "crates/tinybus-module", version = "0.1.0" }
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time"] }

async-trait = "0.1"
serde = { version = "1", features = ["derive"] }
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,19 @@ crates/tinybus/ the bus: protocol, broker, connection, proxy
src/name/ validated addresses (bus name, path, interface, member)
src/ports/ the two seams: Transport and Listener
src/transport/ in-memory (always) and Unix socket (feature `uds`)
src/module/ stable module ABI and optional dynamic loader
src/events/ bounded in-process domain event fan-out
src/global.rs process-wide one-time bus installation
src/native.rs typed in-process request registry
src/version.rs peer and interface compatibility declarations
src/router.rs the routing table and match rules
src/broker.rs the daemon
src/connection.rs a peer's link: calls out, dispatch in
src/proxy.rs the client handle — the kernel's whole API surface
src/service/ the Interface trait and the object tree
src/bin/tinybus.rs the CLI
crates/tinybus-macros/ #[interface]
crates/tinybus-module/ module-side runtime and export macro
docs/modules/ one document per module
```

Expand All @@ -107,17 +113,20 @@ docs/modules/ one document per module
| `uds` | yes | Unix-socket transport — the production one |
| `macros` | yes | `#[tinybus::interface]` |
| `cli` | yes | the `tinybus` binary |
| `modules` | no | trusted in-process `cdylib` discovery and loading |

`--no-default-features` leaves the protocol, the router, the broker and the
in-memory transport: no sockets, no proc-macro build step, no CLI. That is the
configuration a slim kernel build embeds.

## Status

Milestone 1. The core protocol, broker, connection, proxy, macro, Unix
transport and CLI are implemented and tested. Service activation, file-descriptor
passing, per-peer authorisation policy and the Windows named-pipe backend are
not — see `ROADMAP.md`.
The core protocol, broker, connection, proxy, macro, Unix transport and CLI are
implemented and tested. Trusted in-process modules support lazy activation
behind the non-default `modules` feature; read the module trust-boundary notes
before enabling it. External service-process or bus-driven activation remains
unimplemented. File-descriptor passing, per-peer authorisation policy and the
Windows named-pipe backend are also not implemented — see `ROADMAP.md`.

## Licence

Expand Down
34 changes: 22 additions & 12 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@ Deliberately **not** on this list: `tinyagents`, `tinycortex`, `tinyflows`,
crates. Moving them behind a bus would add latency and a serialisation boundary
to the hot path and remove nothing.

## M3 — activation
## M3 — trusted in-process modules

Right now a service must already be running. Activation makes the broker start
one on demand: a call to a name nobody owns consults a service file, launches
the process, waits for it to claim the name, and then delivers the call.
OpenHuman may embed the broker and load selected integrations as `cdylib`
modules. Each module is an ordinary peer connected at the `Transport` seam,
with its own runtime and bounded queues. The ABI gate rejects incompatible
artifacts before calling their initialization entrypoint.

This is what turns "the integration is not installed" into a non-error for the
common case, and it is what makes lazily-paid dependencies real — an
integration that is never used is a process that never starts.
This is deployment convenience, not process isolation. Loading a library runs
arbitrary code with the host's privileges and puts it inside the host's memory
and crash boundary. Integrations that hold especially sensitive material or
need fault containment remain separate processes.

- [ ] Service files: name, exec line, environment, timeout
- [ ] Launch, wait for `RequestName`, deliver the queued call
- [ ] Refuse to relaunch a service that is crash-looping, with a clear error
rather than a fork bomb
- [ ] `tinybus list --activatable`
- [x] Versioned, C-shaped descriptor and manifest ABI
- [x] Module-side runtime and export macro
- [x] Host transport bridge, admission gate, dependency ordering and loader
- [x] Linux, macOS and Windows loader implementations
- [x] Bus and CLI module inspection/control surface

## M4 — the security boundary

Expand Down Expand Up @@ -96,6 +98,14 @@ sender is responsible for the file's lifetime.
- [ ] A TypeScript client, because some integrations genuinely want the Node
ecosystem and shelling out to it is worse than speaking the protocol

## M7 — external service activation

The trusted-module loader is not a replacement for activating isolated service
processes. A later milestone must define service-file discovery, process
launching, delivery of calls queued during startup, crash-loop prevention, and
how activatable names appear in inspection APIs before bus-driven activation is
safe to claim.

## Not planned

- **A network transport.** The bus is local by construction, and every
Expand Down
15 changes: 15 additions & 0 deletions crates/tinybus-module/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "tinybus-module"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Module-side runtime and export macro for trusted tinybus cdylibs."

[dependencies]
async-trait.workspace = true
serde_json.workspace = true
serde.workspace = true
tinybus.workspace = true
tokio.workspace = true
tracing.workspace = true
Loading
Loading