Files
marqdo/tests/ext/agent-sandbox-optin.mq.md
T
cflmy 9331af78e2 release(2.8.0): 合入 CHANGELOG/README/发版说明/skills prove 任务;CI 链接指向 doc/releases
- CHANGELOG.md:v2.8.0 条目(中英双语);
- README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明);
- doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制);
- skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/
  require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过);
- 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
2026-11-18 10:29:26 +08:00

52 lines
1.3 KiB
Markdown
Executable File

---
markup: occlusion
title: agent trial sandbox opt-in — host unchanged until commit
description: >
O1: agent.trial write stays upper until commit=True.
Prefer link index over json.get.
import:
agent: ext/ai/agent.mq.md
sandbox: ext/ai/sandbox.mq.md
fs: lib/fs.mq.md
---
# main
Reset leftover workspace from prior runs.
**had = fs.exists path="_sbx_optin"**
1. `had`
> fs.remove path="_sbx_optin"
2. *
**_ = 0**
> fs.make_dir path="_sbx_optin"
Trial with `commit=False`: upper write must not touch the host tree.
**dry = agent.trial root="_sbx_optin" write_path="proof.txt" text=optin-ok commit=False**
**dry_ok = [ok](access(dry, "ok"))**
**dry_committed = [committed](access(dry, "committed"))**
> print text=`dry_ok`
> print text=`dry_committed`
**before = fs.exists path="_sbx_optin/proof.txt"**
> print text=`before`
Trial with `commit=True`: host sees the file after success.
**wet = agent.trial root="_sbx_optin" write_path="proof.txt" text=optin-ok commit=True**
**wet_ok = [ok](access(wet, "ok"))**
**wet_committed = [committed](access(wet, "committed"))**
> print text=`wet_ok`
> print text=`wet_committed`
**after = fs.read_text path="_sbx_optin/proof.txt"**
> print text=`after`
Profile row is attached (link-index readable).
**prof = [profile](access(wet, "profile"))**
**pname = [name](access(prof, "name"))**
> print text=`pname`