010 module wildcard metatype

✓ Passing This code compiles and runs correctly.

Code

// Test 183: Module Wildcard + Metatype (VALID)
//
// Pattern: ~input:* -> * | Audit a |>
//
// This is VALID because:
// - Source is module wildcard (input:*) - matches all events in main module
// - Branch is metatype (Audit) - works on any branch
// - Perfect for module-wide auditing/logging

const std = @import("std");

~import "$app/test_lib/logger"

~event compute { x: i32 }
| result { value: i32 }

~event format { value: i32 }
| formatted { text: []const u8 }

~proc compute {
    std.debug.print("compute({d})\n", .{x});
    return .{ .result = .{ .value = x * 2 } };
}

~proc format {
    std.debug.print("format({d})\n", .{value});
    return .{ .formatted = .{ .text = "formatted" } };
}

~compute(x: 42)
| result r |> format(value: r.value)
    | formatted |> _
input.kz

Expected Output

compute(42)
[TAP] Audit: input:compute.result
format(84)
[TAP] Audit: input:format.formatted

Imported Files

// Logger with module wildcard + metatype tap
// BUG: String interpolation doesn't substitute metatype bindings
// {{a.source}} should become _profile_0.source but doesn't

~import "$std/taps"
~import "$std/io"

// VALID: Module wildcard (input:*) + metatype (Audit)
// Audit metatype works on ANY event in the main module
~tap(input:* -> *)
| Audit a |> std.io:print.ln("[TAP] Audit: {{a.source:s}}.{{a.branch:s}}")
test_lib/logger.kz

Test Configuration

MUST_RUN