014 transitive chain

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

--- bridge open
open(a.txt)
  open: held=1
  q1: held=2
  q2: held=3
--- hang up; chain must release leaf-first, all three
close-query() ran for 'q2.txt'
[BRIDGE] Invoked 'close-query' for handle 'q2.txt' [main:queried]
close-query() ran for 'q1.txt'
[BRIDGE] Invoked 'close-query' for handle 'q1.txt' [main:queried]
close-file() ran for 'a.txt'
[BRIDGE] Invoked 'close-file' for handle 'a.txt' [main:opened]
--- done

Expected output

--- bridge open
open(a.txt)
  open: held=1
  q1: held=2
  q2: held=3
--- hang up; chain must release leaf-first, all three
close-query() ran for 'q2.txt'
[BRIDGE] Invoked 'close-query' for handle 'q2.txt' [main:queried]
close-query() ran for 'q1.txt'
[BRIDGE] Invoked 'close-query' for handle 'q1.txt' [main:queried]
close-file() ran for 'a.txt'
[BRIDGE] Invoked 'close-file' for handle 'a.txt' [main:opened]
--- done

Flows

flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "files", source: open(10) query(10) close-file(1) close-query(1))
subflow ~run-turn click a branch to expand · @labels scroll to their anchor
run (br, source)
flow ~create click a branch to expand · @labels scroll to their anchor
create (id: "chain", scope: "files")

Test Configuration

MUST_RUN