Release 2.7.0: executable handbooks and native user-site workflows
This commit is contained in:
1 parent
aa0c4d0f55
commit
d9aef957f7
562 files changed
+21064
-20387
No files matched your search
@@ -10,52 +10,60 @@ import:
|
||||
|
||||
# main
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
The two trials intentionally differ only in commit. First inspect a successful dry trial and verify that note.txt has not appeared in the host directory. Then run the committed trial, read the host file and compare its actual content. This separates an observed proposal from an observed filesystem change; neither ok alone nor a proposed path establishes that a commit happened.
|
||||
|
||||
Use a disposable filesystem root: the example replaces its named _example_sbx directory and leaves the committed evidence there for inspection. It does not promise to roll back a committed external effect. Read the returned profile as part of the trial evidence, and keep failures visible rather than manufacturing a success marker when the expected file is absent.
|
||||
|
||||
Short demo: write via `agent.trial`, prove the host is clean until commit.
|
||||
|
||||
**had = fs.exists path="_example_sbx"**
|
||||
We first **had = [Compute had](fs.exists(path="_example_sbx"))** for the next step.
|
||||
1. `had`
|
||||
> fs.remove path="_example_sbx"
|
||||
We now **[Call fs.remove](> fs.remove path="_example_sbx")**.
|
||||
2. *
|
||||
**_ = 0**
|
||||
We first **_ = 0** for the next step.
|
||||
|
||||
> fs.make_dir path="_example_sbx"
|
||||
We now **[Call fs.make dir](> fs.make_dir path="_example_sbx")**.
|
||||
|
||||
**dry = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=False**
|
||||
**dry_ok = [ok](access(dry, "ok"))**
|
||||
**dry_committed = [committed](access(dry, "committed"))**
|
||||
We first **dry = [Compute dry](agent.trial(root="_example_sbx", write_path="note.txt", text="sandbox-okf", commit=False))** for the next step.
|
||||
We first **dry_ok = [ok](access(`dry`, "ok"))** for the next step.
|
||||
We first **dry_committed = [committed](access(`dry`, "committed"))** for the next step.
|
||||
1. `dry_ok`
|
||||
1. not `dry_committed`
|
||||
> print text=dry-ok
|
||||
We now **[Display this step's result](> print text="dry-ok")**.
|
||||
2. *
|
||||
> print text=dry-bad-commit
|
||||
We now **[Display this step's result](> print text="dry-bad-commit")**.
|
||||
2. *
|
||||
> print text=dry-fail
|
||||
We now **[Display this step's result](> print text="dry-fail")**.
|
||||
|
||||
**leaked = fs.exists path="_example_sbx/note.txt"**
|
||||
We first **leaked = [Compute leaked](fs.exists(path="_example_sbx/note.txt"))** for the next step.
|
||||
1. `leaked`
|
||||
> print text=host-leaked
|
||||
We now **[Display this step's result](> print text="host-leaked")**.
|
||||
2. *
|
||||
> print text=host-clean
|
||||
We now **[Display this step's result](> print text="host-clean")**.
|
||||
|
||||
**wet = agent.trial root="_example_sbx" write_path="note.txt" text=sandbox-okf commit=True**
|
||||
**wet_ok = [ok](access(wet, "ok"))**
|
||||
**wet_committed = [committed](access(wet, "committed"))**
|
||||
We first **wet = [Compute wet](agent.trial(root="_example_sbx", write_path="note.txt", text="sandbox-okf", commit=True))** for the next step.
|
||||
We first **wet_ok = [ok](access(`wet`, "ok"))** for the next step.
|
||||
We first **wet_committed = [committed](access(`wet`, "committed"))** for the next step.
|
||||
1. `wet_ok`
|
||||
1. `wet_committed`
|
||||
> print text=wet-ok
|
||||
We now **[Display this step's result](> print text="wet-ok")**.
|
||||
2. *
|
||||
> print text=wet-no-commit
|
||||
We now **[Display this step's result](> print text="wet-no-commit")**.
|
||||
2. *
|
||||
> print text=wet-fail
|
||||
We now **[Display this step's result](> print text="wet-fail")**.
|
||||
|
||||
**body = fs.read_text path="_example_sbx/note.txt"**
|
||||
We first **body = [Compute body](fs.read_text(path="_example_sbx/note.txt"))** for the next step.
|
||||
1. `body` == "sandbox-okf"
|
||||
> print text=proof-visible
|
||||
We now **[Display this step's result](> print text="proof-visible")**.
|
||||
2. *
|
||||
> print text=proof-missing
|
||||
We now **[Display this step's result](> print text="proof-missing")**.
|
||||
|
||||
**pname = [name](access([profile](access(wet, "profile")), "name"))**
|
||||
We first **pname = [name](access([profile](access(`wet`, "profile")), "name"))** for the next step.
|
||||
1. `pname` == "default"
|
||||
> print text=profile-default
|
||||
We now **[Display this step's result](> print text="profile-default")**.
|
||||
2. *
|
||||
> print text=profile-other
|
||||
We now **[Display this step's result](> print text="profile-other")**.
|
||||
Reference in new issue
Block a user