070 universal wildcard concrete

✓ Passing This code compiles and runs correctly.

Code

// Test: Universal Wildcard Tap with Metatype
//
// Demonstrates that universal wildcard taps (*:*) must use metatypes
// like Profile, Transition, or Audit (not concrete branches).
//
// With metatype, the tap can observe any event/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 = .{} };
}

// Universal tap using metatype - observes ALL events
~tap(* -> *)
| Profile p |> app.test_lib.logger:log(msg: p.source)
    | done |> _

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

Expected Output

[TAP] koru:start
[TAP] std.taps:tap
[TAP] koru:start
[TAP] app.test_lib.logger:log
Hello
[TAP] input:hello
[TAP] std.taps:tap
[TAP] input:hello
[TAP] app.test_lib.logger:log
Goodbye
[TAP] std.taps:tap
[TAP] input:goodbye
[TAP] app.test_lib.logger:log
[TAP] input:goodbye
[TAP] std.taps:tap
[TAP] input:goodbye
[TAP] app.test_lib.logger:log
[TAP] koru:end
[TAP] std.taps:tap
[TAP] koru:end
[TAP] app.test_lib.logger:log

Imported Files

// Logger for 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 = .{} };
}

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

Test Configuration

MUST_RUN