You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27b: an anytype parameter the body reads with @TypeOf -- one instance per argument type (queen-public-agents.t27) #8713
Part of epic #8326 (coverage, see #6063). This is the last `type anytype` row in docs/reports/t27b_expectations.json.
Problem
In `specs/port/browseros/trios/agent-server/apps/server/src/api/routes/queen-public-agents.t27`, `heartbeatTime(value: anytype)` reads its parameter. It branches on `if (@typeof(value) == i64)` and returns `value` inside that branch. The tests call it with an i64, a string and null.
The reference passes 9/9. Zig compiles the function once per argument type, folds `@TypeOf(value) == i64` at compile time, and never type-checks a branch whose condition is false. The spec is correct; this is not a spec defect.
#8028 (any_param_plan) covers only an anytype parameter the body never reads, and any_param_plan.t27 lists this case as not covered.
Minimal repro
The reference gives 1/1 with 3 asserts. t27b refuses with `type anytype at line 3`.
One instance of the function per distinct argument type at its call sites (monomorphization), named deterministically.
`@TypeOf(param) == T` folded per instance at compile time.
A branch whose condition folds to false is skipped, not lowered, as Zig skips analysing it.
Each decision belongs in a .t27 plan (any_param_plan), with net <= 0 hand-written lines (#8236). With `heartbeatTime` and its 4 tests removed, t27b already passes the other 5 tests (9 asserts), so this is the spec's only blocker.
Acceptance
The repro passes `t27b test --check`, as a conformance spec under specs/tri/t27b/conformance/.
queen-public-agents.t27 passes `t27b test --check` with runtime asserts, and its ledger row is `pass`.
User Scenarios
Given a function with an anytype parameter that is read via @TypeOf and branched on (e.g., if (@TypeOf(value) == i64)), when the function is called with multiple distinct argument types (i64, string, null), then t27b compiles one instance per argument type, folds @TypeOf at compile time, skips false branches, and all assertions pass.
Requirements
FR-001: t27b MUST monomorphize functions with anytype parameters that are read via @TypeOf, creating one instance per distinct argument type at call sites with deterministic names.
FR-002: t27b MUST fold @TypeOf(param) == T at compile time per instance.
FR-003: t27b MUST skip lowering of branches whose condition folds to false, not type-checking them.
Activity
t27b: an anytype parameter the body reads gets one instance per argum…