043 two sessions one world

✓ Passing This code compiles and runs correctly.

Code

input.k

Supporting Files

files/hello.txt

Actual

  agent> read(path: "hello.txt") | ok t |> write(path: "backup.txt", text: t)
  world< {"branch":"","value":"wrote"}
  agent> tor backup { src: string, dst: string }
backup = read(path: src) | ok t |> write(path: dst, text: t)
  world< defined backup
  agent> backup(src: "hello.txt", dst: "again.txt")
  world< {"branch":"","value":"wrote"}
  agent> vocabulary()
  world< {"branch":"","value":"read(path: string)\nwrite(path: string, text: string)\nvocabulary()\ngrammar()\nbind(name: string, value: Source)\nnote(text: Source) — speaks to the observer, not the user: reasoning, plans, and \"why I'm stuck\" go here\nbackup(src: string, dst: string)"}
  agent> backup(src: "hello.txt", dst: "b-copy.txt")
  world< {"branch":"","value":"wrote"}
  agent> format-disk()
  world< denied: format-disk

Expected output

  agent> read(path: "hello.txt") | ok t |> write(path: "backup.txt", text: t)
  world< {"branch":"","value":"wrote"}
  agent> tor backup { src: string, dst: string }
backup = read(path: src) | ok t |> write(path: dst, text: t)
  world< defined backup
  agent> backup(src: "hello.txt", dst: "again.txt")
  world< {"branch":"","value":"wrote"}
  agent> vocabulary()
  world< {"branch":"","value":"read(path: string)\nwrite(path: string, text: string)\nvocabulary()\ngrammar()\nbind(name: string, value: Source)\nnote(text: Source) — speaks to the observer, not the user: reasoning, plans, and \"why I'm stuck\" go here\nbackup(src: string, dst: string)"}
  agent> backup(src: "hello.txt", dst: "b-copy.txt")
  world< {"branch":"","value":"wrote"}
  agent> format-disk()
  world< denied: format-disk

Flows

flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "sandbox", source: read(1) write(1))
subflow ~turn click a branch to expand · @labels scroll to their anchor
print.ln (expr: " agent> {{ source:s }}")
flow ~create click a branch to expand · @labels scroll to their anchor
create (id: "a", scope: "sandbox", introspection: true, world: "tests/regression/400_RUNTIME_FEATURES/440_RESOURCE_BRIDGE/440_043_two_sessions_one_world/world")

Test Configuration

MUST_RUN

Post-validation Script: