Files
marqdo/tests/ext/agent-constitution-b0.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

71 lines
1.6 KiB
Markdown
Executable File

---
markup: occlusion
title: agent constitution markers (Wave B1 offline)
description: Assert call_site / source / protocol order in build_step_context.
import:
llm: ext/ai/llm.mq.md
agent: ext/ai/agent.mq.md
json: lib/json.mq.md
plugin: lib/plugin.mq.md
sys: lib/sys.mq.md
---
## probe_tool
*"probe-ok"*
# main
**p = > plugin.native_path name="agent"**
1. `p`
> plugin.load path=`p`
2. *
> print text=no-agent-plugin
> sys.exit code=1
> sys.env_set name="OPENAI_API_KEY" value="offline-constitution-dummy"
**model = > llm.llm**
`工具表` =
| 工具 |
|------|
| probe_tool |
**助手 = > agent.agent model=`model` tools=`工具表` standing="constitution probe"**
**ctx = > agent.build_step_context agent=`助手` task="constitution-probe-task"**
**a = > split value=`ctx` sep="--- call site ---"**
**b = > split value=`ctx` sep="--- source (.mq.md) ---"**
**c = > split value=`ctx` sep="--- how to act ---"**
**d = > split value=`ctx` sep="Code is documentation"**
**na = > len value=`a`**
**nb = > len value=`b`**
**nc = > len value=`c`**
**nd = > len value=`d`**
1. `na` > 1
1. `nb` > 1
1. `nc` > 1
1. `nd` > 1
> print text=constitution-ok
2. *
> print text=motto-missing
> sys.exit code=1
2. *
> print text=act-missing
> sys.exit code=1
2. *
> print text=source-missing
> sys.exit code=1
2. *
> print text=call-site-missing
> sys.exit code=1
**site = > agent_call_site**
**path = > json.get value=`site` key="path"**
1. `path`
> print text=site-path-ok
2. *
> print text=site-path-missing
> sys.exit code=1