Files
marqdo/examples/agent-sandbox-okf/index.mq.md
T

1.5 KiB

markup, title, description, import
markup title description import
occlusion agent-sandbox-okf — trial then commit O1 example: opt-in sandbox trial with GFM-table returns and link-index reads.
agent fs
ext/ai/agent.mq.md lib/fs.mq.md

main

Short demo: write via agent.trial, prove the host is clean until commit.

had = fs.exists path="_example_sbx"

  1. had

fs.remove path="_example_sbx"

_ = 0

fs.make_dir path="_example_sbx"

dry = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=False dry_ok = ok) dry_committed = committed)

  1. dry_ok
  2. not dry_committed > print text=dry-ok
> print text=dry-bad-commit

print text=dry-fail

leaked = fs.exists path="_example_sbx/note.txt"

  1. leaked

print text=host-leaked

print text=host-clean

wet = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=True wet_ok = ok) wet_committed = committed)

  1. wet_ok
  2. wet_committed > print text=wet-ok
> print text=wet-no-commit

print text=wet-fail

body = fs.read_text path="_example_sbx/note.txt"

  1. body == "sandbox-okf"

print text=proof-visible

print text=proof-missing

pname = name), "name"))

  1. pname == "default"

print text=profile-default

print text=profile-other