@xdxer/dingtalk-agent 0.1.4-beta.1 → 0.1.4-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.en.md +397 -0
  3. package/README.md +497 -46
  4. package/dist/bin/dingtalk-agent.js +1162 -340
  5. package/dist/bin/dingtalk-agent.js.map +1 -1
  6. package/dist/src/actions.js +98 -14
  7. package/dist/src/actions.js.map +1 -1
  8. package/dist/src/agent-audit.js +460 -0
  9. package/dist/src/agent-audit.js.map +1 -0
  10. package/dist/src/agent-bindings.js +132 -0
  11. package/dist/src/agent-bindings.js.map +1 -0
  12. package/dist/src/agent-definition.js +182 -0
  13. package/dist/src/agent-definition.js.map +1 -0
  14. package/dist/src/agent-enhance.js +678 -0
  15. package/dist/src/agent-enhance.js.map +1 -0
  16. package/dist/src/bootstrap.js +125 -17
  17. package/dist/src/bootstrap.js.map +1 -1
  18. package/dist/src/config.js +1 -7
  19. package/dist/src/config.js.map +1 -1
  20. package/dist/src/development-workspace.js +729 -0
  21. package/dist/src/development-workspace.js.map +1 -0
  22. package/dist/src/doctor.js +18 -7
  23. package/dist/src/doctor.js.map +1 -1
  24. package/dist/src/dws.js +145 -0
  25. package/dist/src/dws.js.map +1 -1
  26. package/dist/src/eval-evidence.js +193 -0
  27. package/dist/src/eval-evidence.js.map +1 -0
  28. package/dist/src/init.js +1 -1
  29. package/dist/src/init.js.map +1 -1
  30. package/dist/src/invocation.js +36 -0
  31. package/dist/src/invocation.js.map +1 -0
  32. package/dist/src/lab.js +679 -0
  33. package/dist/src/lab.js.map +1 -0
  34. package/dist/src/lease.js +100 -0
  35. package/dist/src/lease.js.map +1 -0
  36. package/dist/src/memory/candidates.js +451 -0
  37. package/dist/src/memory/candidates.js.map +1 -0
  38. package/dist/src/memory/completion-evidence.js +536 -0
  39. package/dist/src/memory/completion-evidence.js.map +1 -0
  40. package/dist/src/memory/operational.js +263 -0
  41. package/dist/src/memory/operational.js.map +1 -0
  42. package/dist/src/memory/remote-state.js +478 -0
  43. package/dist/src/memory/remote-state.js.map +1 -0
  44. package/dist/src/memory/task-checkpoints.js +204 -0
  45. package/dist/src/memory/task-checkpoints.js.map +1 -0
  46. package/dist/src/multica-deploy.js +1480 -0
  47. package/dist/src/multica-deploy.js.map +1 -0
  48. package/dist/src/multica-provider.js +685 -0
  49. package/dist/src/multica-provider.js.map +1 -0
  50. package/dist/src/opencode-evals.js +1062 -0
  51. package/dist/src/opencode-evals.js.map +1 -0
  52. package/dist/src/opencode-provider.js +531 -0
  53. package/dist/src/opencode-provider.js.map +1 -0
  54. package/dist/src/opencode-workspace.js +197 -0
  55. package/dist/src/opencode-workspace.js.map +1 -0
  56. package/dist/src/perception.js +225 -0
  57. package/dist/src/perception.js.map +1 -0
  58. package/dist/src/personal-event-evals.js +595 -0
  59. package/dist/src/personal-event-evals.js.map +1 -0
  60. package/dist/src/promotion.js +786 -0
  61. package/dist/src/promotion.js.map +1 -0
  62. package/dist/src/remote-semantic-state-live-evals.js +888 -0
  63. package/dist/src/remote-semantic-state-live-evals.js.map +1 -0
  64. package/dist/src/remote-semantic-state-worker.js +38 -0
  65. package/dist/src/remote-semantic-state-worker.js.map +1 -0
  66. package/dist/src/remote-state-evals.js +501 -0
  67. package/dist/src/remote-state-evals.js.map +1 -0
  68. package/dist/src/response-gate.js +51 -0
  69. package/dist/src/response-gate.js.map +1 -0
  70. package/dist/src/robot-evals.js +770 -0
  71. package/dist/src/robot-evals.js.map +1 -0
  72. package/dist/src/sessions.js +66 -105
  73. package/dist/src/sessions.js.map +1 -1
  74. package/dist/src/setup.js +10 -9
  75. package/dist/src/setup.js.map +1 -1
  76. package/dist/src/skill-manager.js +102 -203
  77. package/dist/src/skill-manager.js.map +1 -1
  78. package/dist/src/skills.js.map +1 -1
  79. package/dist/src/storage-evals.js +26 -0
  80. package/dist/src/storage-evals.js.map +1 -0
  81. package/dist/src/types.js.map +1 -1
  82. package/dist/src/upgrade.js +137 -0
  83. package/dist/src/upgrade.js.map +1 -0
  84. package/dist/src/waits.js +5 -1
  85. package/dist/src/waits.js.map +1 -1
  86. package/dist/src/workspace.js +28 -3
  87. package/dist/src/workspace.js.map +1 -1
  88. package/docs/INSTALLATION.md +118 -13
  89. package/docs/SECOND-AGENT-ACCEPTANCE.md +62 -0
  90. package/docs/architecture/agent-memory-topology.png +0 -0
  91. package/docs/architecture/agent-memory-topology.svg +132 -0
  92. package/docs/architecture/general-agent-kernel-topology.png +0 -0
  93. package/docs/architecture/general-agent-kernel-topology.svg +149 -0
  94. package/docs/architecture/provider-bound-development-workspace.png +0 -0
  95. package/docs/architecture/provider-bound-development-workspace.svg +141 -0
  96. package/docs/architecture/task-completion-gate.png +0 -0
  97. package/docs/architecture/task-completion-gate.svg +191 -0
  98. package/docs/schemas/agent-audit-load-evidence.schema.json +14 -0
  99. package/docs/schemas/agent-audit.schema.json +92 -0
  100. package/docs/schemas/agent-bindings.schema.json +54 -0
  101. package/docs/schemas/agent-definition.schema.json +78 -0
  102. package/docs/schemas/agent-enhancement-plan.schema.json +88 -0
  103. package/docs/schemas/agent-enhancement-receipt.schema.json +37 -0
  104. package/docs/schemas/enriched-invocation.schema.json +46 -0
  105. package/docs/schemas/eval-candidate-plan.schema.json +28 -0
  106. package/docs/schemas/eval-candidate-result.schema.json +20 -0
  107. package/docs/schemas/eval-candidate.schema.json +30 -0
  108. package/docs/schemas/invocation.schema.json +19 -0
  109. package/docs/schemas/memory-candidate-proposal.schema.json +18 -0
  110. package/docs/schemas/memory-candidate.schema.json +76 -0
  111. package/docs/schemas/memory-publish-target.schema.json +25 -0
  112. package/docs/schemas/multica-deployment-list.schema.json +29 -0
  113. package/docs/schemas/multica-deployment-operation.schema.json +51 -0
  114. package/docs/schemas/multica-deployment-plan.schema.json +70 -0
  115. package/docs/schemas/multica-deployment-receipt.schema.json +87 -0
  116. package/docs/schemas/multica-deployment-status.schema.json +23 -0
  117. package/docs/schemas/multica-workspace-inspection.schema.json +77 -0
  118. package/docs/schemas/multica-workspace-plan.schema.json +68 -0
  119. package/docs/schemas/multica-workspace-resource-list.schema.json +27 -0
  120. package/docs/schemas/multica-workspace-status.schema.json +34 -0
  121. package/docs/schemas/observation.schema.json +21 -0
  122. package/docs/schemas/operational-memory-provider.schema.json +36 -0
  123. package/docs/schemas/operational-memory-record.schema.json +24 -0
  124. package/docs/schemas/perception-input.schema.json +56 -0
  125. package/docs/schemas/project.schema.json +112 -0
  126. package/docs/schemas/promotion-list.schema.json +36 -0
  127. package/docs/schemas/promotion-plan.schema.json +60 -0
  128. package/docs/schemas/promotion-policy.schema.json +29 -0
  129. package/docs/schemas/promotion-receipt.schema.json +43 -0
  130. package/docs/schemas/promotion-status.schema.json +23 -0
  131. package/docs/schemas/release-readiness.schema.json +65 -0
  132. package/docs/schemas/remote-semantic-state-live-eval.schema.json +60 -0
  133. package/docs/schemas/remote-semantic-state-manifest.schema.json +79 -0
  134. package/docs/schemas/remote-semantic-state-provider.schema.json +98 -0
  135. package/docs/schemas/response-gate.schema.json +20 -0
  136. package/docs/schemas/task-checkpoint.schema.json +71 -0
  137. package/docs/schemas/task-completion-evidence.schema.json +154 -0
  138. package/docs/schemas/workspace-doctor.schema.json +56 -0
  139. package/docs/schemas/workspace-state.schema.json +39 -0
  140. package/evals/baselines/2026-07-16/opencode-basic-010-completion-summary.json +123 -0
  141. package/evals/baselines/2026-07-16/opencode-basic-skill-required-summary.json +69 -0
  142. package/evals/baselines/2026-07-16/opencode-multi-surface-summary.json +63 -0
  143. package/evals/baselines/2026-07-16/remote-state-live-summary.json +70 -0
  144. package/evals/baselines/2026-07-17/agent-enhance-opencode-dogfood-summary.json +98 -0
  145. package/evals/baselines/2026-07-17/personal-event-live-readiness-summary.json +68 -0
  146. package/examples/agents/fde-coach/AGENTS.md +26 -0
  147. package/examples/agents/fde-coach/MEMORY.md +3 -0
  148. package/examples/agents/fde-coach/fields/default/field.json +24 -0
  149. package/examples/agents/fde-coach/knowledge/INDEX.md +4 -0
  150. package/examples/agents/fde-coach/skills/fde-coach/SKILL.md +13 -0
  151. package/examples/agents/release-manager/AGENTS.md +26 -0
  152. package/examples/agents/release-manager/MEMORY.md +3 -0
  153. package/examples/agents/release-manager/fields/default/field.json +24 -0
  154. package/examples/agents/release-manager/knowledge/INDEX.md +4 -0
  155. package/examples/agents/release-manager/skills/release-manager/SKILL.md +13 -0
  156. package/lab/README.md +109 -0
  157. package/lab/agent-eval/catalog.json +91 -0
  158. package/lab/agent-eval/classic-failures.json +177 -0
  159. package/lab/agent-eval/completion-gate-regression.json +99 -0
  160. package/lab/agent-eval/personal-event-live.example.json +94 -0
  161. package/lab/agent-eval/remote-semantic-state-live.example.json +70 -0
  162. package/lab/agent-eval/remote-semantic-state-provider.fixture.json +47 -0
  163. package/lab/agent-eval/remote-state-workspace/AGENTS.md +8 -0
  164. package/lab/agent-eval/remote-state-workspace/opencode.json +7 -0
  165. package/lab/agent-eval/remote-state-workspace/skills/remote-state-operator/SKILL.md +13 -0
  166. package/lab/agent-eval/remote-state.example.json +31 -0
  167. package/lab/agent-eval/workspace/AGENTS.md +7 -0
  168. package/lab/agent-eval/workspace/MEMORY.md +4 -0
  169. package/lab/agent-eval/workspace/artifacts/pending-review.md +3 -0
  170. package/lab/agent-eval/workspace/knowledge/INDEX.md +4 -0
  171. package/lab/agent-eval/workspace/opencode.json +20 -0
  172. package/lab/manifest.example.json +27 -0
  173. package/lab/manifest.personal-event.example.json +27 -0
  174. package/lab/project-workspace/README.md +11 -0
  175. package/lab/project-workspace/fake-multica-provider.mjs +266 -0
  176. package/lab/project-workspace/multica-deploy.fixture.json +29 -0
  177. package/lab/project-workspace/multica-readonly.fixture.json +69 -0
  178. package/lab/project-workspace/observation.fixture.json +14 -0
  179. package/lab/project-workspace/opencode-provider-suite.json +65 -0
  180. package/lab/project-workspace/project.fixture.json +44 -0
  181. package/lab/project-workspace/promotion-policy.fixture.json +15 -0
  182. package/lab/robot-eval/pool.example.json +30 -0
  183. package/lab/robot-eval/suite.json +123 -0
  184. package/lab/robot-eval/workspace/AGENTS.md +21 -0
  185. package/lab/robot-eval/workspace/MEMORY.md +3 -0
  186. package/lab/robot-eval/workspace/knowledge/INDEX.md +5 -0
  187. package/lab/robot-eval/workspace/opencode.json +22 -0
  188. package/lab/schemas/agent-eval-catalog.schema.json +47 -0
  189. package/lab/schemas/lab-manifest.schema.json +70 -0
  190. package/lab/schemas/personal-event-eval.schema.json +91 -0
  191. package/lab/schemas/remote-state-eval.schema.json +66 -0
  192. package/lab/schemas/robot-eval-suite.schema.json +184 -0
  193. package/lab/schemas/robot-pool.schema.json +56 -0
  194. package/package.json +26 -14
  195. package/skills/dingtalk-agent-boot-multica/SKILL.md +40 -0
  196. package/skills/dingtalk-agent-compose/SKILL.md +110 -0
  197. package/skills/dingtalk-agent-compose/assets/AGENTS.template.md +26 -0
  198. package/skills/dingtalk-agent-compose/assets/agent.bindings.dingtalk-doc.template.json +13 -0
  199. package/skills/dingtalk-agent-compose/assets/agent.bindings.local.template.json +13 -0
  200. package/skills/dingtalk-agent-compose/assets/opencode.template.json +12 -0
  201. package/skills/dingtalk-agent-compose/assets/role-skill.template.md +24 -0
  202. package/skills/dingtalk-agent-compose/evals/evals.json +94 -0
  203. package/skills/dingtalk-agent-compose/references/agent-definition-contract.md +55 -0
  204. package/skills/dingtalk-agent-compose/references/opencode-host-contract.md +65 -0
  205. package/skills/dingtalk-agent-compose/references/storage-routing.md +20 -0
  206. package/skills/dingtalk-agent-deploy/SKILL.md +60 -0
  207. package/skills/dingtalk-agent-deploy/references/multica-deployment-contract.md +49 -0
  208. package/skills/dingtalk-agent-deploy/references/promotion-observation-contract.md +49 -0
  209. package/skills/dingtalk-agent-eval/SKILL.md +116 -0
  210. package/skills/dingtalk-agent-eval/assets/eval-catalog.template.json +18 -0
  211. package/skills/dingtalk-agent-eval/evals/evals.json +61 -0
  212. package/skills/dingtalk-agent-eval/references/eval-topology.md +34 -0
  213. package/skills/dingtalk-agent-eval/references/evidence-contract.md +31 -0
  214. package/skills/dingtalk-agent-eval/references/scenario-taxonomy.md +25 -0
  215. package/skills/dingtalk-agent-eval/references/storage-modes.md +75 -0
  216. package/skills/dingtalk-basic-behavior/SKILL.md +63 -3
  217. package/skills/dingtalk-basic-behavior/assets/memory-candidate-proposal.json +10 -0
  218. package/skills/dingtalk-basic-behavior/assets/{task-checkpoint.md → task-checkpoint.json} +2 -21
  219. package/skills/dingtalk-basic-behavior/references/action-contract.md +2 -0
  220. package/skills/dingtalk-basic-behavior/references/memory-and-evolution.md +15 -1
  221. package/skills/dingtalk-basic-behavior/references/perception-and-gates.md +28 -0
  222. package/skills/dingtalk-basic-behavior/references/task-lifecycle.md +32 -7
  223. package/dist/src/boot.js +0 -70
  224. package/dist/src/boot.js.map +0 -1
  225. package/dist/src/duty.js +0 -74
  226. package/dist/src/duty.js.map +0 -1
  227. package/dist/src/kb.js +0 -240
  228. package/dist/src/kb.js.map +0 -1
  229. package/dist/src/runs.js +0 -79
  230. package/dist/src/runs.js.map +0 -1
  231. package/docs/ARCHITECTURE.md +0 -217
  232. package/docs/MINIMAL-WORKSPACE-V1.md +0 -172
  233. package/docs/OPEN-SOURCE-REFERENCES.md +0 -107
  234. package/docs/SELF-TEST.md +0 -252
  235. package/docs//345/206/205/347/275/221/345/256/236/347/233/270.md +0 -77
  236. package/evals/baselines/2026-07-14/behavior-summary.json +0 -28
  237. package/evals/baselines/2026-07-14/contract-summary.json +0 -18
  238. package/evals/baselines/2026-07-14/live-canary-summary.json +0 -25
  239. package/evals/baselines/2026-07-15/dingtalk-basic-behavior-0.3.0/SKILL.md +0 -72
  240. package/evals/baselines/2026-07-15/dingtalk-basic-behavior-0.3.0/references/action-contract.md +0 -31
  241. package/evals/baselines/2026-07-15/dingtalk-basic-behavior-0.3.0/references/event-to-behavior.md +0 -22
  242. package/evals/baselines/2026-07-15/dingtalk-basic-behavior-0.3.0/references/memory-and-evolution.md +0 -25
  243. package/evals/baselines/2026-07-15/dingtalk-basic-behavior-0.3.0/references/runtime-modes.md +0 -34
  244. package/evals/baselines/2026-07-15/task-lifecycle-summary.json +0 -50
  245. package/evals/evals.json +0 -316
  246. package/evals/fixtures/dm-ambiguous-send.json +0 -4
  247. package/evals/fixtures/dm-blocked.json +0 -4
  248. package/evals/fixtures/dm-clear.json +0 -4
  249. package/evals/fixtures/dm-discussion.json +0 -4
  250. package/evals/fixtures/dm-doc-write-no-tool.json +0 -4
  251. package/evals/fixtures/dm-long-task-ack.json +0 -4
  252. package/evals/fixtures/dm-nonblocking-gap.json +0 -4
  253. package/evals/fixtures/dm-structured-task.json +0 -4
  254. package/evals/fixtures/group.json +0 -10
  255. package/evals/fixtures/mentioned.json +0 -3
  256. package/evals/run-contract-evals.mjs +0 -1106
  257. package/evals/run-shadow-evals.mjs +0 -267
  258. package/evals/runners/README.md +0 -66
  259. package/evals/runners/claude-shadow.mjs +0 -533
  260. package/evals/schemas/action-request.schema.json +0 -77
  261. package/evals/shadow-evals.json +0 -133
  262. package/skills/AGENTS.md +0 -104
  263. package/skills//344/273/273/345/212/241.md +0 -48
  264. package/skills//345/237/272/347/241/200/350/241/214/344/270/272.md +0 -44
  265. package/skills//345/277/203/350/267/263.md +0 -79
  266. package/skills//346/266/210/346/201/257.md +0 -50
  267. package/skills//347/237/245/350/257/206.md +0 -55
  268. package/skills//350/257/204/346/265/213.md +0 -62
  269. package/skills//351/222/211/351/222/211.md +0 -64
  270. package/templates/ontology/index.md +0 -24
  271. package/templates/ontology/self/access.md +0 -38
  272. package/templates/ontology/self/role-spec.md +0 -34
  273. package/templates/ontology/self/workspace.md +0 -41
package/CHANGELOG.md ADDED
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@xdxer/dingtalk-agent` are documented here. The project follows semantic versioning; prerelease entries describe release candidates and do not imply that Live canaries or registry publication have completed.
4
+
5
+ ## 0.1.4-beta.10 - 2026-07-19
6
+
7
+ ### Removed
8
+
9
+ - Legacy pre-kernel modules `src/boot.ts`, `src/duty.ts`, `src/kb.ts`, `src/runs.ts` and the unused `templates/ontology/` tree. They were dead code outside the current CLI, were already excluded from the published package, and `runs.ts` conflicted with the documented "Markdown is not a lock, idempotency store, or Receipt" boundary.
10
+ - The `kb`/`duties`/`eval` fields from the default AgentConfig. Existing workspace configs keep unknown fields through passthrough normalization; no migration is required.
11
+
12
+ ### Changed
13
+
14
+ - Entry documents now match repository reality: CLAUDE.md gains run-mode criteria, the eval-Skill reading path, and an annotated command list; README lists all five bundled Skills; the English README is marked as a condensed overview; SECURITY.md states the actually maintained dist-tag; the eval Skill's L1 wording matches the real `dta lab eval` plan/`--execute --yes` flow (Skill 0.5.1).
15
+
16
+ ### Release boundary
17
+
18
+ - Distribution is limited to the public npm `beta` dist-tag. No robot, webhook, schedule, Trigger, or DingTalk/Multica side effect is created. The Live waivers recorded for beta.9 remain unchanged.
19
+
20
+ ## 0.1.4-beta.9 - 2026-07-19
21
+
22
+ ### Added
23
+
24
+ - A general Agent kernel with frozen Agent Definitions, invocation context, employee response gates, durable Session/Run/Wait state, and host-verified completion evidence.
25
+ - Three-layer semantic memory with local and DingTalk document/table routing, candidate review/publish flow, and cold-start recovery contracts.
26
+ - Reusable Compose, Eval, Boot, and Deploy Skills plus two independently auditable example Agents.
27
+ - A Provider-bound Agent Project model with isolated OpenCode and Multica Development Workspaces.
28
+ - OpenCode managed create/run/eval with random Basic Skill load probes and Response/Filesystem/Workspace/Artifact evidence.
29
+ - Multica read-only inspection, plan-bound Agent/Skill deployment, independent readback, load smoke, recovery, rollback, and retire contracts.
30
+ - Policy-bound Promotion Receipts linking local Eval evidence to Multica deployment evidence, plus redacted review-only feedback candidates.
31
+ - Deterministic release-readiness checks that install the generated tarball into an isolated HOME and exercise setup, doctor, bootstrap, eval planning, upgrade, and rollback planning without real DingTalk or Multica access.
32
+ - Default-safe Phase 9 personal-event and Phase 11B remote-state Live runners with explicit resource authorization, fake-DWS contracts, independent readback, and gitignored raw evidence.
33
+ - Plan-bound `dta agent enhance` for existing repositories, with operation-scoped backups, semantic config merging, hash readback, source-drift protection, and zero DingTalk/Trigger side effects.
34
+ - A sanitized local dogfood record proving that an enhanced release-manager Agent reaches `ready` only after a real OpenCode/DeepSeek random Basic load probe.
35
+
36
+ ### Changed
37
+
38
+ - Basic Behavior advanced to 0.10.0 with evidence-gated task completion. The recorded controlled-regression sample passed its safety and artifact gates, but does not prove a stable behavior-quality gain over 0.9.4.
39
+ - Completion grading now detects contradictory positive claims while preserving negated, conditional, and corrected statements; effectiveness requires a predeclared multi-run policy instead of any single positive delta.
40
+ - Agent audit now keeps generated body and Role Skill templates partial until identity, responsibilities, SOPs, and acceptance placeholders are replaced with real semantics.
41
+ - The deterministic contract suite now covers 60 independent scenarios.
42
+
43
+ ### Live waivers and release boundary
44
+
45
+ - The user explicitly waived real Multica apply/promotion, personal-event canary, and remote semantic-state Live as release gates for this beta. The release does not relabel local or fake-Provider evidence as real platform proof.
46
+ - Distribution is limited to the public npm `beta` dist-tag, Git tag, and GitHub pre-release. It does not create a robot, webhook, schedule, Trigger, or DingTalk/Multica side effect.
47
+
48
+ ## 0.1.4-beta.8 - 2026-07-16
49
+
50
+ - Published beta baseline preceding the general Agent kernel and Provider-bound Workspace series.
package/README.en.md ADDED
@@ -0,0 +1,397 @@
1
+ <div align="center">
2
+
3
+ # dingtalk-agent
4
+
5
+ **A shared behavior kernel for DingTalk digital employees.**
6
+
7
+ [![npm](https://img.shields.io/npm/v/%40xdxer%2Fdingtalk-agent?logo=npm&color=cb3837)](https://www.npmjs.com/package/@xdxer/dingtalk-agent)
8
+ [![CI](https://github.com/D1-2004/dingtalk-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/D1-2004/dingtalk-agent/actions/workflows/ci.yml)
9
+ [![Node.js](https://img.shields.io/node/v/%40xdxer%2Fdingtalk-agent)](https://nodejs.org/)
10
+ [![License](https://img.shields.io/badge/license-MIT-2ea44f)](LICENSE)
11
+
12
+ English · [简体中文](README.md)
13
+
14
+ *This English README is a condensed overview; the Chinese README is the complete, authoritative reference.*
15
+
16
+ </div>
17
+
18
+ ## What it is
19
+
20
+ **DWS gives an Agent DingTalk system calls. dingtalk-agent (`dta`) gives every Agent an inheritable, frozen, and verifiable employee behavior kernel.** It does not own event delivery and does not duplicate DingTalk APIs. Starting from a normalized invocation, it organizes the Agent definition, perception enrichment, response eligibility, Session/Run state, action gates, and effect evidence into a Skill-first container.
21
+
22
+ ```text
23
+ Agent Host + dta Kernel + Agent Definition + Basic Behavior + Role Skills + DWS
24
+ = a DingTalk digital employee that can keep working
25
+ ```
26
+
27
+ | Layer | Owns | Does not own |
28
+ |---|---|---|
29
+ | Agent Definition | Identity, responsibilities, service scope, Skills, resources, authority | Current Run state or IDs guessed from message text |
30
+ | Basic + Role Skills | When to reply, ask, stay silent, and how to perform role work | Bypassing identity, target, or effect gates |
31
+ | dta Kernel | Invocation, enrichment, Session/Run/Wait, Action Gate, Receipt | Models, universal event listeners, or a second DWS |
32
+ | DWS | DingTalk messages, docs, tasks, calendars, tables, and other product operations | Deciding whether an employee should act and on whose behalf |
33
+
34
+ Claude Code, Codex, OpenCode, and other Agent Hosts can use the same kernel. Trigger adapters, models, sandboxes, Role Skills, and storage providers remain replaceable.
35
+
36
+ ## Why it exists
37
+
38
+ DWS is enough for occasional manual API operations. A digital employee that works over time also needs a maintained **body, state, and constrained action boundary**. Calling an API is not the same as behaving like a colleague. A reliable Agent must:
39
+
40
+ - stay quiet in unmentioned group conversations and respond to direct messages or explicit mentions;
41
+ - complete well-specified work directly and ask only one truly blocking question;
42
+ - never guess recipients, identities, document IDs, or permissions from natural-language text;
43
+ - acknowledge long work, wait for dependencies, and resume from a later event;
44
+ - distinguish a command attempt, platform visibility, delivery, and human acceptance;
45
+ - store task state, business memory, long-term knowledge, locks, and receipts in the right media.
46
+
47
+ The boundary is: **Skills advise, the CLI enforces, and DWS executes.** Semantic judgment remains in Skills; invariants belong in code; DingTalk product operations stay in DWS.
48
+
49
+ > `0.1.4-beta.9` is published on the public npm `beta` dist-tag with a matching Git tag and GitHub pre-release. It includes the Basic 0.10.0/0.9.4 model regression, host-issued Completion Evidence, remote semantic-state cold-start and Live-ready runners, the developer Golden Path, safe enhancement of existing Agent repositories, Provider-bound Workspace W1–W5, Completion-grader hardening, a Phase 9 personal-event Live-ready runner, and isolated installation acceptance, with 60 deterministic contracts. Phase 8's recorded sample passed the safety and artifact gates that existed at the time, but did not prove a stable model-quality gain for 0.10.0. Phase 15 adds fail-closed contradictory-claim detection and a predeclared effectiveness policy without rewriting historical scores. Real personal-event, remote-state, and Multica Live were explicitly waived as release gates for this beta; local and fake-Provider evidence is not relabeled as real platform proof, and no Trigger or DingTalk/Multica side effect was created.
50
+
51
+ ## Quick start
52
+
53
+ Requires Node.js 18.3 or later.
54
+
55
+ ```bash
56
+ npm install --global --prefix "$HOME/.local" \
57
+ --registry=https://registry.npmjs.org @xdxer/dingtalk-agent@beta
58
+ "$HOME/.local/bin/dta" setup --skip-cli-install
59
+
60
+ dta --version
61
+ dta doctor
62
+ ```
63
+
64
+ `setup` checks Node.js, DWS version and authentication, installs and verifies the Basic Behavior Skill, and reports whether Claude Code, Codex, and OpenCode can discover it. `listen` is an optional development adapter, not the mandatory Agent entry point.
65
+
66
+ For a source release candidate, run the deterministic tarball acceptance:
67
+
68
+ ```bash
69
+ npm run release:check
70
+ ```
71
+
72
+ It creates a real npm tarball, installs it offline into a fresh HOME/prefix, and exercises setup, doctor, direct bootstrap, a plan-only lab eval, forced upgrade from the same tarball, and explicit rollback dry-run. It uses fake DWS and skills-installer binaries only; it sends no DingTalk message, accesses no Multica resource, creates no Trigger, and performs no npm publish, Tag, or GitHub Release.
73
+
74
+ ## Three runtime modes
75
+
76
+ ### Direct Session
77
+
78
+ No initialized Workspace is required. The Agent behaves as a normal colleague but does not invent identity, memory, targets, or DingTalk authority.
79
+
80
+ ```bash
81
+ dta bootstrap --json
82
+ dta bootstrap --agent local-dir:/path/to/agent --json
83
+ ```
84
+
85
+ ### Mounted Session
86
+
87
+ The Agent hydrates a local folder or a DingTalk document without requiring `init` on every session.
88
+
89
+ ```bash
90
+ dta bootstrap \
91
+ --agent local-dir:/path/to/agent \
92
+ --skills local-dir:/path/to/agent/skills \
93
+ --memory local-md:MEMORY.md \
94
+ --knowledge 'dingtalk-doc:<node-or-url>' --json
95
+ ```
96
+
97
+ ### Prepared Run
98
+
99
+ A trusted host freezes the Invocation, Definition, Skills, target, budgets, and allowed actions. Message effects can only pass through the typed Broker or `dta act`.
100
+
101
+ ## From one Agent to many
102
+
103
+ Different employees should vary only in their Definition, Role Skills, field bindings, storage, and authority. They share Basic Behavior, Session/Run/Wait, the two-part gate, Receipt semantics, and the same Lab contract.
104
+
105
+ A minimal Agent kit is:
106
+
107
+ ```text
108
+ my-agent/
109
+ ├── AGENTS.md identity, responsibilities, deliverables, boundaries
110
+ ├── agent.bindings.json Definition and semantic-storage routes
111
+ ├── opencode.json Host loading contract
112
+ ├── .agents/skills/ Host-visible Skill exposure
113
+ ├── skills/<role>/SKILL.md role-specific methods
114
+ ├── MEMORY.md reviewed semantic memory
115
+ ├── knowledge/INDEX.md knowledge entry point
116
+ └── .dingtalk-agent/artifacts/ independently verifiable deliverables
117
+ ```
118
+
119
+ Use the bundled [`dingtalk-agent-compose`](skills/dingtalk-agent-compose/SKILL.md) Skill to audit and assemble a Git checkout or local folder as an Agent, optionally binding semantic state to DingTalk documents. Basic Behavior must be forced into every Host session; directory discovery alone is not proof that the Skill body was loaded.
120
+
121
+ The recommended definition stays local and versioned: `AGENTS.md + Role Skills`. `agent.bindings@1` routes memory and knowledge either to local Markdown or dedicated DingTalk documents, while artifacts and private control state stay local. The shortest acceptance path is:
122
+
123
+ ```bash
124
+ # Plan only: no local write, DWS access, or Trigger creation.
125
+ dta agent enhance --project-name release-agent \
126
+ --role-skill release-manager --dry-run --json
127
+
128
+ # Review operations/blockers/semanticReview, then use the current plan ID.
129
+ dta agent enhance --project-name release-agent \
130
+ --role-skill release-manager \
131
+ --plan-id <current-plan-id> --yes --json
132
+
133
+ dta bootstrap --bindings agent.bindings.json --json
134
+
135
+ # Static only: no model and no DWS. Gaps return partial and exit code 2.
136
+ dta agent audit --bindings agent.bindings.json \
137
+ --require-skill <role-skill-name> --json
138
+
139
+ # Isolated OpenCode load probe; still no DingTalk access.
140
+ dta agent audit --bindings agent.bindings.json \
141
+ --require-skill <role-skill-name> --verify-load --yes --json
142
+ ```
143
+
144
+ This chain has been dogfooded once with `examples/agents/release-manager`. On OpenCode 1.17.14 and `deepseek/deepseek-chat`, the with-skill random probe loaded exactly 1/1, the without-skill control did not guess it 1/1, and the final audit moved from `partial` with only `host.load-probe` missing to `ready`. This proves that the assembly and load path works for that fixture; it does not prove domain-task quality or a stable behavior gain. See the [sanitized dogfood summary](evals/baselines/2026-07-17/agent-enhance-opencode-dogfood-summary.json).
145
+
146
+ `agent enhance` merges rather than blindly overwriting an existing repository. Before updating an old file it creates an operation-scoped backup under `.dingtalk-agent/backups/agent-enhance/<operationId>/`, and a custom `stateDir` is added to `.gitignore`; a stale plan, source drift, invalid Role path, unknown OpenCode instruction entry, path escape, or symlink fails before replacement. Apply has local-file side effects only. Generated body and Role Skill templates intentionally remain `partial` until real identity, responsibilities, deliverables, refusal boundaries, domain SOPs, and acceptance criteria replace every placeholder. Thus a ready [`agent-enhancement-plan@1`](docs/schemas/agent-enhancement-plan.schema.json) means “safe to apply,” not “the Agent is ready”; [`agent-enhancement-receipt@1`](docs/schemas/agent-enhancement-receipt.schema.json) carries the follow-up audit gaps.
147
+
148
+ `agent-audit@1` separates Definition, Storage, Host exposure, and actual loading. A remote memory/knowledge binding remains `partial` until an authorized storage evaluation proves identity, document type, hashes, independent readback, and model use and its report is supplied with `--remote-report`. Local cache presence is never remote proof; Wait, generation, idempotency, Receipts, and credentials remain in the host atomic store.
149
+
150
+ ### One Project, multiple development Workspaces
151
+
152
+ `agent.bindings.json` describes the Agent body and storage routes. A root-level [`dingtalk-agent.json`](docs/schemas/project.schema.json) declares where the same Agent is developed. Each Development Workspace binds exactly one Host Provider, while memory, knowledge, and artifacts remain independent Storage bindings.
153
+
154
+ ```text
155
+ Agent Project
156
+ ├── local-dev ── Host: OpenCode ── Storage: local-md/local-dir
157
+ ├── multica-dev ── Host: Multica ── Storage: dingtalk-doc/local-dir
158
+ └── legacy-prepared ── read-only view of the existing workspace@1
159
+ ```
160
+
161
+ W1 exposes a read-only control plane:
162
+
163
+ ```bash
164
+ dta info --json
165
+ dta workspace list --json
166
+ dta workspace show local-dev --json
167
+ dta workspace doctor local-dev --json
168
+ ```
169
+
170
+ The CLI discovers the Project from any child directory and reports Provider configuration sources, `desiredHash/observedHash`, and [`workspace-state@1`](docs/schemas/workspace-state.schema.json). Doctor inspects only the named Workspace: a missing Multica installation cannot make `local-dev` fail, while Provider, source, managed bytes, or desired-state drift fails closed.
171
+
172
+ OpenCode W2 adds a managed development environment. `create` is plan-only by default; `--yes` atomically materializes a gitignored copy and independently hashes it. `run/eval` use external temporary sandboxes. Provider state becomes `ready` only after the random Basic load probe, exported Session directory, and hard evidence gates pass.
173
+
174
+ ```bash
175
+ dta workspace create local-dev --dry-run --json
176
+ dta workspace create local-dev --yes --json
177
+ dta workspace use local-dev --json
178
+ dta workspace run local-dev --prompt-file prompt.md --execute --yes --json
179
+ dta workspace eval local-dev --suite evals/core.json --runs 3 --execute --yes --json
180
+ ```
181
+
182
+ `workspace run` is zero-tool. File and Artifact tools are available only through case-scoped eval permissions. W2 writes local managed Workspace, selection, state, and evidence, but never calls DWS. CI, evaluations, and future deploy flows must select the Workspace explicitly rather than rely on `current-workspace`.
183
+
184
+ Multica W3 first exposes controlled remote reads. `plan` never starts Multica. After explicit confirmation, `inspect/remote-list` use the declared profile, Workspace ID, Runtime ID, and optional Agent ID to read auth, Workspace, Runtime, Agent, Skill catalog, and assignments. An existing Agent must be bound by `agentIdFrom` or trusted prior state and is never adopted by display name.
185
+
186
+ ```bash
187
+ dta workspace plan multica-dev --json
188
+ dta workspace inspect multica-dev --execute --yes --json
189
+ dta workspace remote-list multica-dev --execute --yes --json
190
+ dta workspace status multica-dev --json
191
+ ```
192
+
193
+ Evidence retains only minimum resource facts and raw-output hashes; it excludes tokens, email, cleartext Server URLs, Agent instructions/runtime config, and Skill content. Identity, default Workspace, scope, stable IDs, Skill uniqueness, and evidence hashes all fail closed. A successful inspection leaves state at `verifying`: `readyForApply=true` only means W4 planning may start.
194
+
195
+ W4 turns that trusted inspection into a plan-bound apply through `dta deploy`. Dry-run freezes the profile, Workspace, Runtime, Agent, Definition, complete Skill-tree hashes, and maximum forward/rollback write budgets; apply re-reads the same ID chain. Only the current `--plan-id` plus explicit `--yes` may create or update remote resources. The CLI synchronizes managed Boot, Basic, and Role Skill trees and the exact assignment, then uses a dedicated Issue to independently read the Skill tool trace and an exact JSON response. Both must pass before state can move from `verifying` to `ready`.
196
+
197
+ ```bash
198
+ dta deploy --workspace multica-dev --dry-run --json
199
+ dta deploy --workspace multica-dev --plan-id <plan-id> --yes --json
200
+ dta deploy --workspace multica-dev --status --json
201
+ dta deploy --workspace multica-dev --status --execute --yes --json
202
+ dta deploy --workspace multica-dev --list --json
203
+ dta deploy --workspace multica-dev --retire --dry-run --json
204
+ dta deploy --workspace multica-dev --retire --plan-id <plan-id> --yes --json
205
+ ```
206
+
207
+ A timed-out write persists its operation/Receipt and enters `reconciling`; status performs independent reads rather than retrying or rolling back an ambiguous action. If Agent create returned no ID, recovery reads candidates by stable ID and binds only one exact instructions/runtime fingerprint match, never a display name alone. Confirmed failures roll back only changes managed by the current operation. Retire archives the exact Agent without deleting Skills, Issues, semantic storage, or evidence history. Deploy never creates a robot, webhook, schedule, or other Trigger. The `dingtalk-agent-deploy` Skill only guides these stable CLI calls; it does not write through Multica directly or retain credentials.
208
+
209
+ W5 links designated W2 Eval evidence to a W4 Receipt as an explicit Promotion chain. A policy freezes source/target Workspaces, suite, minimum runs, required cases, and evidence surfaces. Dry-run recomputes the Definition/Skill, managed Workspace, plan/suite/report, and deployment hashes without Provider calls. Only the current planId plus explicit confirmation may delegate to W4 deploy. The resulting Promotion Receipt binds source, Eval, the historical deployment Receipt, and the final observed hash.
210
+
211
+ ```bash
212
+ dta promote --policy promotion-policy.json --route local-dev-to-multica-dev --dry-run --json
213
+ dta promote --policy promotion-policy.json --route local-dev-to-multica-dev \
214
+ --plan-id <plan-id> --yes --json
215
+ dta promote --status --promotion-id <promotion-id> --json
216
+ dta promote --list --json
217
+ ```
218
+
219
+ `observe` accepts only redacted feedback whose `observedHash` exactly matches a promoted Receipt. It writes one gitignored Eval candidate fixed as `proposed`, review-required, suite-ineligible, and unpublished. It never changes AGENTS.md, prompts, Basic/Role Skills, or Triggers.
220
+
221
+ ```bash
222
+ dta observe --promotion-id <promotion-id> --input observation.json --dry-run --json
223
+ dta observe --promotion-id <promotion-id> --input observation.json --yes --json
224
+ ```
225
+
226
+ See the reusable two-Provider fixture at [`lab/project-workspace/project.fixture.json`](lab/project-workspace/project.fixture.json), the redacted read-only fixture at [`multica-readonly.fixture.json`](lab/project-workspace/multica-readonly.fixture.json), the W4 stateful fake data at [`multica-deploy.fixture.json`](lab/project-workspace/multica-deploy.fixture.json), and the W5 [`promotion-policy.fixture.json`](lab/project-workspace/promotion-policy.fixture.json). Manifests and state reject credential-like fields; `*From` fields preserve only `env:VAR` sources, never resolved values. The current contract proves local orchestration and fail-closed behavior; it does not claim that a real Multica Live apply or promotion has passed.
227
+
228
+ ## Employee task protocol
229
+
230
+ ![Employee task loop and completion gate](docs/architecture/task-completion-gate.svg)
231
+
232
+ ```text
233
+ UNDERSTAND → CLARIFY → PLAN → EXECUTE → WAIT → VERIFY → COMPLETE
234
+ ```
235
+
236
+ `CLARIFY` is a conditional branch, not a mandatory opening question. The Agent first forms an internal task contract—goal, deliverable, scope, observable done conditions, authority, and timing—then asks one question only when a gap blocks safe progress.
237
+
238
+ `COMPLETE` is evidence-gated rather than self-declared. A cross-Run task must move from `working` to `verifying`; every `doneWhen` condition must map to a file check, Workspace/Artifact assertion, Action Receipt, independent platform readback, or human confirmation. A reply that says “created” is not evidence. The CLI rejects `working → completed` and any completed checkpoint without verification evidence.
239
+
240
+ ## Identity and delegation
241
+
242
+ The role identity and the sandbox execution identity are separate:
243
+
244
+ - the role identity says who the employee is, what it owns, whom it serves, and who delegated the work;
245
+ - the execution identity is the trusted DWS profile used for platform effects;
246
+ - if they represent the same subject, it is the Agent's own identity;
247
+ - if they differ, the Definition must make the delegation explicit and the Action Gate must keep the delegated scope narrow.
248
+
249
+ Neither identity can be replaced by a display name, message body, or model memory.
250
+
251
+ ## The two-part gate
252
+
253
+ The safety half prevents wrong actions: response eligibility, trusted identity and target, one egress owner, action budgets, idempotency, and readback.
254
+
255
+ The empathy half supplies context a colleague naturally has: quoted messages, recent conversation burst, attachments, readable identity, status, and interruption context. Enrichment improves decisions but never expands authority.
256
+
257
+ ## Three semantic memory layers
258
+
259
+ | Layer | Typical medium | Content |
260
+ |---|---|---|
261
+ | L1 task memory | Session checkpoint | Current goal, progress, next step, wait condition, evidence |
262
+ | L2 operational memory | AI table, task, calendar, business system | Structured and aggregatable working facts |
263
+ | L3 long-term knowledge | DingTalk docs, knowledge base, wiki | Reviewed methods, stable facts, SOPs, lessons |
264
+
265
+ Control state is separate: event dedupe, leases, generation, idempotency keys, budgets, Wait, and Receipts require an atomic host store. Markdown, DingTalk documents, and Git are not transaction or lock services.
266
+
267
+ ## Real-world Lab
268
+
269
+ Evaluation progresses through five levels:
270
+
271
+ | Level | Environment | Evidence |
272
+ |---|---|---|
273
+ | L0 | fixtures + real CLI | Contracts, state machines, target integrity, idempotency |
274
+ | L1 | model shadow | Skill loading and behavioral gain, without DingTalk effects |
275
+ | L2 | fake DWS + real Action Gate | Intent/Attempt/Receipt, readback, recovery |
276
+ | L3 | dedicated robot connector | Real connection, Workspace, expression, delivery, teardown |
277
+ | L4 | test colleague/group + personal event + dta Broker | Full envelope, identity, target, Wait/Resume, single egress |
278
+
279
+ Live runs require dedicated resources, allowlists, unique markers, fixed budgets, independent platform readback, and exact teardown. A robot response does not prove the personal-event envelope or dta-owned egress.
280
+
281
+ The [`personal-event-eval@1`](lab/schemas/personal-event-eval.schema.json) suite binds Basic + Role Skills, response eligibility, Wait/Resume, duplicate delivery, Perception, Receipts, and teardown into one evidence chain. Event capture remains external; dta does not create a subscription or trigger. The default command is plan-only. Execution requires both `liveAuthorized=yes` in the local suite and all CLI confirmations:
282
+
283
+ ```bash
284
+ dta lab eval --engine personal-event \
285
+ --workspace <agent-workspace> \
286
+ --suite .dingtalk-agent/personal-event-live.local.json --json
287
+
288
+ dta lab eval --engine personal-event \
289
+ --workspace <agent-workspace> \
290
+ --suite .dingtalk-agent/personal-event-live.local.json \
291
+ --execute --live --yes --json
292
+ ```
293
+
294
+ See the placeholder [`personal-event-live.example.json`](lab/agent-eval/personal-event-live.example.json) and the sanitized local [`personal-event-live-readiness-summary.json`](evals/baselines/2026-07-17/personal-event-live-readiness-summary.json). Each reply must independently read back the exact body under the same message ID; a duplicate must reuse the original Run, Action, and Attempt with no new egress. The fake-DWS contract passes 8/8 scenarios, seven physical Runs, and five new outward effects, while rejecting a readback with the correct ID but rewritten body. That proves runner readiness, not a real personal-event delivery.
295
+
296
+ ```bash
297
+ # OpenCode plan only
298
+ dta lab eval --engine opencode \
299
+ --workspace lab/robot-eval/workspace \
300
+ --suite lab/robot-eval/suite.json --lanes stateless --runs 3 --json
301
+
302
+ # Fixed model, isolated Workspace, no DingTalk side effects
303
+ dta lab eval --engine opencode \
304
+ --workspace lab/robot-eval/workspace \
305
+ --suite lab/robot-eval/suite.json --lanes stateless --runs 3 \
306
+ --execute --yes --json
307
+ ```
308
+
309
+ ## Evaluation as a reusable Skill
310
+
311
+ The bundled [`dingtalk-agent-eval`](skills/dingtalk-agent-eval/SKILL.md) Skill defines the complete workflow: identify the Definition, prove Basic Skill loading, select a stable scenario, isolate execution, collect multiple evidence surfaces, apply hard gates, and only then score quality.
312
+
313
+ Scenarios are grouped by the condition they can break, not by date or role:
314
+
315
+ 1. `host-loading`
316
+ 2. `conversation-contract`
317
+ 3. `authority-and-egress`
318
+ 4. `task-lifecycle`
319
+ 5. `memory-and-storage`
320
+ 6. `workspace-and-artifacts`
321
+ 7. `platform-reliability`
322
+
323
+ The repository catalog is [`lab/agent-eval/catalog.json`](lab/agent-eval/catalog.json). A reply is only one evidence surface. Cases can also require filesystem paths and contents, a valid Agent Workspace, artifact manifests and hashes, Receipts, or independent DWS readback. A failed load, safety, or integrity gate cannot be averaged away by a high quality score.
324
+
325
+ Run the classic incident suite or select individual cases:
326
+
327
+ ```bash
328
+ dta lab eval --engine opencode \
329
+ --workspace lab/agent-eval/workspace \
330
+ --suite lab/agent-eval/classic-failures.json \
331
+ --cases requester-only-authorization,workspace-artifact \
332
+ --runs 1 --execute --yes --json
333
+ ```
334
+
335
+ The 2026-07-16 OpenCode 1.17.14 + DeepSeek development regression covers nine classic cases. Basic 0.9.4 passed its load gate. Eight cases passed in the full run; the only correct refusal missed a phrase-only grader and passed a targeted rerun after the grader changed to a bounded regex plus independent reason and exclusion checks. The artifact case allowed only `read/write/edit` and actually used only `write`; it passed all seven Workspace/Artifact/Filesystem postconditions and copied two hashed outputs into the evidence bundle. Writable sandboxes live under a system temporary root outside the repository; the runner canonicalizes and audits every tool path so OpenCode cannot resolve a relative write against a parent Git checkout. This is combined 9/9 passing evidence, not a claim of one statistically significant run. See the [sanitized multi-surface summary](evals/baselines/2026-07-16/opencode-multi-surface-summary.json).
336
+
337
+ The same local `AGENTS.md + Skills` can be evaluated with local semantic state or with `memory` and `knowledge` hydrated from `dingtalk-doc:`:
338
+
339
+ ```bash
340
+ cp lab/agent-eval/remote-state.example.json \
341
+ .dingtalk-agent/remote-state.local.json
342
+
343
+ # Plan only: no DWS read and no model call
344
+ dta lab eval --engine storage \
345
+ --workspace lab/agent-eval/remote-state-workspace \
346
+ --suite .dingtalk-agent/remote-state.local.json --json
347
+
348
+ # Read two dedicated documents and evaluate OpenCode; --live adds one unique write probe
349
+ dta lab eval --engine storage \
350
+ --workspace lab/agent-eval/remote-state-workspace \
351
+ --suite .dingtalk-agent/remote-state.local.json \
352
+ --execute --live --yes --json
353
+ ```
354
+
355
+ The 2026-07-16 live DWS canary used two dedicated `adoc` documents. The local Definition was ready, Basic 0.9.4 was forced through OpenCode instructions, both remote/mount/cache/manifest hashes matched, and DeepSeek returned two remote-only probe values with zero tools. One append marker was verified exactly once through a full-document readback. Deterministic contracts also reject a wrong DWS identity, a non-adoc node, and post-bootstrap drift. The first byte-level marker check produced a false negative because DingTalk escaped Markdown punctuation; the runner now counts the normalized text stream and never treats a command response as proof. See the [sanitized remote-state summary](evals/baselines/2026-07-16/remote-state-live-summary.json).
356
+
357
+ Remote Markdown remains semantic state; private control state stays in the host's atomic store. The evaluator does not infer permission to delete its dedicated test documents.
358
+
359
+ ## Development and verification
360
+
361
+ ```bash
362
+ npm ci
363
+ npm run typecheck
364
+ npm run eval:contract
365
+ npm pack --dry-run
366
+ ```
367
+
368
+ The 60-case deterministic suite also covers `agent-bindings@1`, plan-bound enhancement with backups and semantic-placeholder gates, precise partial-to-ready repairs, OpenCode load evidence bound to the current Definition and Host exposure, two-process L1/L2/L3 remote semantic-state recovery, a default-safe Phase 11B Live runner, the Phase 9 personal-event evidence chain, fail-closed identity/type/drift/slot/cache checks, replication of a second isolated Role Agent without kernel changes, multi-Provider Project/Workspace isolation, Workspace-bound OpenCode materialization/run/eval, Multica W3–W5 orchestration, isolated npm-tarball readiness, negation-aware completion claims, and predeclared comparison policies. A passing comparison policy is a deterministic release gate, not statistical significance or proof of a stable model gain.
369
+
370
+ See [Self-test and evolution](docs/SELF-TEST.md), [Architecture](docs/ARCHITECTURE.md), and the [implementation plan](docs/plans/2026-07-16/eval-test-skill-and-remote-state.md).
371
+
372
+ ## Project layout
373
+
374
+ ```text
375
+ bin/ CLI composition root
376
+ src/ TypeScript runtime
377
+ skills/dingtalk-basic-behavior/ shared employee behavior
378
+ skills/dingtalk-agent-compose/ Agent assembly and optimization
379
+ skills/dingtalk-agent-eval/ scenario, evidence, and promotion method
380
+ examples/agents/ reusable role kits
381
+ lab/ catalogs, manifests, schemas, and runbooks
382
+ evals/ deterministic and model evaluations
383
+ docs/ architecture and decisions
384
+ ```
385
+
386
+ ## Current boundaries
387
+
388
+ - Event listeners and schedulers are outside the kernel.
389
+ - Workspace initialization is optional and never automatic per session.
390
+ - dta does not duplicate the DWS command surface.
391
+ - DingTalk documents do not store locks, idempotency, generation, or effect receipts.
392
+ - Online Runs cannot hot-expand identity, authority, or enabled Skills.
393
+ - `bootstrap` hydrates `dingtalk-doc` as a read-only snapshot; remote publication requires explicit authorization and readback.
394
+
395
+ ## License
396
+
397
+ [MIT](LICENSE)