Skip to content

feat(venue): admit the logging capability to the venue-adapter world - #37

Open
mfw78 wants to merge 4 commits into
feat/denial-classification-seamfrom
feat/venue-logging-capability
Open

feat(venue): admit the logging capability to the venue-adapter world#37
mfw78 wants to merge 4 commits into
feat/denial-classification-seamfrom
feat/venue-logging-capability

Conversation

@mfw78

@mfw78 mfw78 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

Admits the logging capability to the venue-adapter world: VENUE_CAPABILITIES in crates/videre-macros/src/world.rs now includes logging alongside chain, messaging, and http, and synthesize_venue threads the capability's adapter ident through so the #[venue] macro (crates/videre-macros/src/lib.rs) can emit an install_tracing() glue function when logging is declared, wiring the guest nexum_sdk::tracing facade and panic hook onto the world's nexum:host/logging import via a LogSink impl - the function only exists when the capability is declared, so the facade cannot bind to an undeclared import. videre-sdk re-exports nexum_sdk (crates/videre-sdk/src/lib.rs) so the macro-emitted glue reaches it without adding a direct dependency in adapter crates. VenueAdapterKind::link in crates/videre-host/src/registry.rs binds nexum::host::logging::add_to_linker unconditionally alongside chain and messaging, gated per adapter by the declared world same as the other two. The new fixture crate modules/fixtures/logging-venue declares logging alone in module.toml and exercises install_tracing, an INFO/WARN event with structured fields, and a per-level probe from init, plus one INFO event from a dispatched verb. crates/videre-host/tests/platform.rs adds e2e_logging_venue_component_imports_logging_when_declared (the component imports nexum:host/logging and nothing else capability-bearing), e2e_logging_adapter_tracing_reaches_the_host_pipeline (host-interface records preserve each event's own level and its rendered fields, boot-time and verb-interior), and e2e_undeclared_logging_import_refuses_the_adapter_at_boot (an adapter manifest omitting logging from required is refused at boot). The positive E2E now boots the fixture from modules/fixtures/logging-venue/module.toml (logging already in [capabilities].required) instead of a tempdir synthetic manifest, and the placeholder component = "sha256:0000..." line is gone from module.toml and the inline test manifests since the pin now rejects the all-zero digest sentinel at parse.

Why

The venue-adapter world previously withheld logging along with the store and identity capabilities, leaving venue adapters with no host-backed way to emit diagnostic records; logging grants no authority beyond emitting records the host already accepts from every module world, so refusing it bought no isolation while forcing adapter authors toward ad hoc workarounds. Wiring the standard nexum_sdk::tracing facade through the macro keeps venue adapters on the same guest-side logging idiom as core modules instead of a bespoke shim.

Closes #26

Testing

All runs in the repo's pinned nix develop shell (rustc 1.94.0, cargo-nextest 0.9.127), on a fresh clone detached at fb3e434 (identical to origin/feat/venue-logging-capability); origin/feat/denial-classification-seam confirmed an ancestor of HEAD.

  • cargo clippy -p videre-host -p videre-macros -p videre-sdk --all-targets --all-features -- -D warnings - clean.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (CI's exact clippy job; covers the new logging-venue member on the native target) - clean.
  • cargo fmt --all -- --check - clean.
  • cargo test --doc -p videre-host -p videre-macros -p videre-sdk --all-features - ok (0 doctests in each of the three).
  • Red-teamed by re-deriving the diff and mutating the code rather than trusting the report: the world synthesis, the linker addition, and the guest glue are correct, no venue-specific symbol enters videre-sdk/host/macros, no new dependency beyond the fixture's tracing (matching the upstream guest idiom and an existing workspace dep), no em-dashes and no new banner comments, the "unchanged when not declared" done-when is covered by the pre-existing echo-venue import test, and the wasm build is clean.

AI Assistance

Implemented with claude-fable-5, red-teamed with claude-opus-5, PR description written with claude-sonnet-5.

@mfw78

mfw78 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Adoption blocker filed upstream: nullislabs/nexum-runtime#77. The pinned runtime rejects logging in a provider manifest (PROVIDER_CAPABILITIES is chain+messaging only), so this PR is safe to merge but no adapter can declare the capability until the runtime admits it. The same issue carries the target-field gap: the WIT log verb has no target, so "level and target intact" needs an additive WIT change or a documented limitation.

@mfw78

mfw78 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Correction: the canonical upstream issue for the provider logging capability is nullislabs/nexum-runtime#76 (filed during implementation; also covers declaration enforcement). nexum-runtime#77 was a duplicate and is closed.

mfw78 added 3 commits August 6, 2026 15:59
The venue world refused logging at compile time, so adapter-interior
events could only surface through captured stderr as unstructured WARN
records. Add logging to VENUE_CAPABILITIES: the synthesis mirrors the
module loop and passes the core adapter idents through, and the venue
macro rides the logging ident to emit install_tracing, binding the
standard nexum-sdk tracing facade to the crate's own nexum:host/logging
import. Without the declaration the function does not exist, so the
facade cannot bind to an undeclared import.

Host side, the venue provider linker binds the module-world logging
implementation beside chain and messaging: unconditional in the linker,
gated per adapter by the declared world. videre-sdk re-exports
nexum_sdk so the emitted glue needs no direct dependency in the
adapter crate.

The logging-venue fixture declares logging alone; the platform tests
assert the declared import is present (and absent otherwise) and that
guest tracing reaches the host log pipeline as host-interface records
with per-event levels and structured fields intact. The runtime pin
carries no logging row in its provider capability registry yet, so the
E2E boots with the declaration omitted from the boot manifest.

AI Assistance: Claude Code used for implementation and tests.
…manifest gap

The emitted level mapping has five arms; only INFO and WARN were covered,
so an ERROR or TRACE transposition passed. Emit one bare probe per level in
init and assert exactly one host-interface record per level, which catches a
collapsed arm as well as a missing one.

Record the provider capability-registry gap where it bites: booting the
fixture's own module.toml fails with `unknown capability "logging"`, tracked
as nullislabs/nexum-runtime#76.

AI Assistance: Claude Fable used for the red-team review and these fixes.
…ndeclared import

The bumped runtime pin admits logging to the provider capability
registry and enforces a component import against its declaration
(nexum-runtime#95), and rejects the all-zero digest sentinel at parse
(nexum-runtime#79). Retire the tempdir workaround manifest and its
nexum-runtime#76 anchor: the positive E2E boots the fixture from its
own module.toml, logging declared, and the old workaround shape
(logging imported, nothing declared) becomes the negative case, a
boot refusal naming the capability violation. Drop the placeholder
component digest the runtime now refuses.
@mfw78
mfw78 force-pushed the feat/venue-logging-capability branch from d6074fd to 9e64639 Compare August 6, 2026 16:11
The level ladder counted host-interface records per level, which any
permutation of the emitted mapping preserves: transposing the ERROR and
TRACE arms of the venue macro's sink kept every count at one and the
suite stayed green. Name each probe after its own level and hold the
record's level to the message that produced it, so a transposed arm
fails.

Cover the motivating case as well: adapter-interior facts are reported
from a dispatched verb, not only from init, so submit one intent through
the registry and read the verb's record back with its fields intact. The
fixture already emitted that event; nothing asserted on it.

List the fixture in the README layout table beside flaky-venue.
@mfw78 mfw78 changed the title feat(venue): add logging capability feat(venue): admit the logging capability to the venue-adapter world Aug 6, 2026
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.

1 participant