010 shape contract

○ Planned This feature is planned but not yet implemented.

Parked: the emitted Zig for this shape-contract program does not compile

Error Details

install

Failure Output

Showing last 10 of 27 lines
error: the following command failed with 1 compilation errors:
/opt/homebrew/Cellar/zig/0.15.2_1/bin/zig build-exe -ODebug --dep koru_parser --dep koru_ast=ast --dep koru_errors=errors --dep ast --dep flow_parser --dep liquid -Mroot=/Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/410_BUDGETED_INTERPRETER/410_010_shape_contract/output_emitted.zig -ODebug --dep struct_literal --dep ast --dep ast_mangle --dep lexer --dep errors --dep type_registry --dep expression_parser --dep comptime_eval --dep annotation_parser --dep union_collector --dep module_resolver --dep file_types -Mkoru_parser=/usr/local/lib/koru/src/parser.zig -ODebug --dep errors -Mast=/usr/local/lib/koru/src/ast.zig -ODebug -Merrors=/usr/local/lib/koru/src/errors.zig -ODebug --dep ast --dep lexer --dep errors --dep expression_parser -Mflow_parser=/usr/local/lib/koru/src/flow_parser.zig -ODebug -Mliquid=/usr/local/lib/koru/src/liquid.zig -ODebug --dep liquid -Mstruct_literal=/usr/local/lib/koru/src/struct_literal.zig -ODebug --dep ast -Mast_mangle=/usr/local/lib/koru/src/ast_mangle.zig -ODebug -Mlexer=/usr/local/lib/koru/src/lexer.zig -ODebug --dep ast --dep log -Mtype_registry=/usr/local/lib/koru/src/type_registry.zig -ODebug --dep lexer --dep ast -Mexpression_parser=/usr/local/lib/koru/src/expression_parser.zig -ODebug --dep ast --dep expression_parser -Mcomptime_eval=/usr/local/lib/koru/src/comptime_eval.zig -ODebug -Mannotation_parser=/usr/local/lib/koru/src/annotation_parser.zig -ODebug --dep ast -Munion_collector=/usr/local/lib/koru/src/union_collector.zig -ODebug --dep config --dep log --dep file_types -Mmodule_resolver=/usr/local/lib/koru/src/module_resolver.zig -ODebug -Mfile_types=/usr/local/lib/koru/src/file_types.zig -ODebug -Mlog=/usr/local/lib/koru/src/log.zig -ODebug --dep log -Mconfig=/usr/local/lib/koru/src/config.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/larsde/.cache/zig --name output --zig-lib-dir /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig/ --listen=-

Build Summary: 0/3 steps succeeded; 1 failed
install transitive failure
+- install output transitive failure
   +- compile exe output Debug native 1 errors

error: the following build command failed with exit code 1:
.zig-cache/o/fe6ba252fde73c4f0b3939aa1e4d43b5/build /opt/homebrew/Cellar/zig/0.15.2_1/bin/zig /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig /Users/larsde/src/koru/tests/regression/400_RUNTIME_FEATURES/410_BUDGETED_INTERPRETER/410_010_shape_contract .zig-cache /Users/larsde/.cache/zig --seed 0xf8670ef9 -Z234078fde4c0b247

Code

input.kz

Expected output

TEST 1 PASS: valid handler accepted
TEST 2 PASS: caught invalid branch 'not_foundy'
TEST 3 PASS: caught missing field in 'ok'
TEST 4 PASS: free-running mode allows any shape, got branch 'not_foundy'

Flows

flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "api", source: handler(0) // handler itself has no cost (it's the shape) db.user.get(5) // database lookup costs 5 tokens)
flow ~run click a branch to expand · @labels scroll to their anchor
run (source: VALID_HANDLER, scope: "api", budget: 100, shape: "handler")
flow ~run click a branch to expand · @labels scroll to their anchor
run (source: TYPO_HANDLER, scope: "api", budget: 100, shape: "handler")
flow ~run click a branch to expand · @labels scroll to their anchor
run (source: MISSING_FIELD_HANDLER, scope: "api", budget: 100, shape: "handler")
flow ~run click a branch to expand · @labels scroll to their anchor
run (source: TYPO_HANDLER, scope: "api", budget: 100)

Test Configuration

MUST_RUN