071 module wildcard concrete

✓ Passing This code compiles and runs correctly.

Code

// Test: Module Wildcard Tap with Metatype
//
// Demonstrates that module wildcard taps (input:*) must use metatypes
// like Profile, Transition, or Audit (not concrete branches).
//
// With metatype, the tap can observe any event in the module/branch combination
// and access the Profile metadata (source, branch, destination).

const std = @import("std");
~import "$std/taps"

~import "$app/test_lib/logger"

~event hello {}
| done {}

~event goodbye {}
| done {}

~proc hello {
    std.debug.print("Hello\n", .{});
    return .{ .done = .{} };
}

~proc goodbye {
    std.debug.print("Goodbye\n", .{});
    return .{ .done = .{} };
}

// Module wildcard tap observes all events in input module with metatype
~tap(input:* -> *)
| Profile p |> app.test_lib.logger:log(msg: p.source)
    | done |> _

~hello()
| done |> goodbye()
    | done |> _
input.kz

Expected Output

Hello
[TAP] input:hello
[TAP] input:hello
[TAP] input:hello
Goodbye
[TAP] input:goodbye
[TAP] input:goodbye
[TAP] input:goodbye

Imported Files

// Logger for module wildcard tap test

const std = @import("std");
~import "$std/taps"

~pub event log { msg: []const u8 }
| done {}

~proc log {
    std.debug.print("[TAP] {s}\n", .{msg});
    return .{ .done = .{} };
}

// Module wildcard tap using metatype (valid usage)
~tap(input:* -> *)
| Profile p |> log(msg: p.source)
    | done |> _
test_lib/logger.kz

Test Configuration

MUST_RUN