clearai-dsh 0.3.0 → 0.4.0

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 (148) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/README.md +28 -28
  3. package/README.zh-CN.md +28 -28
  4. package/lib/client.js +861 -2555
  5. package/lib/domain-language.js +552 -48
  6. package/lib/fold.js +351 -1015
  7. package/lib/host.js +47 -557
  8. package/lib/invariant.js +9 -12
  9. package/lib/knowledge-view.js +363 -226
  10. package/lib/lang.js +81 -0
  11. package/package.json +1 -1
  12. package/presets/clearai/agent.cordis.yml +54 -82
  13. package/presets/clearai/clearai.patch.yml +54 -82
  14. package/presets/clearai/plugins/clearai-kernel.js +1590 -5437
  15. package/presets/clearai/plugins/ontology.js +56 -14
  16. package/presets/clearai/plugins/prompts.js +73 -363
  17. package/presets/clearai/skills/clearai-loop/SKILL.md +73 -59
  18. package/presets/clearai/plugins/brain.js +0 -547
  19. package/presets/clearai/plugins/commands.js +0 -199
  20. package/presets/clearai/template/knowledge/README.md +0 -25
  21. package/presets/clearai/template/memory/README.md +0 -34
  22. package/presets/clearai/template/project.md +0 -49
  23. package/presets/clearai/template/skills/README.md +0 -37
  24. package/presets/clearai/template/skills/chart-diagram-qa/SKILL.md +0 -43
  25. package/presets/clearai/template/skills/citation-management/SKILL.md +0 -73
  26. package/presets/clearai/template/skills/citation-management/references/bibtex_formatting.md +0 -908
  27. package/presets/clearai/template/skills/citation-management/references/citation_validation.md +0 -794
  28. package/presets/clearai/template/skills/citation-management/references/google_scholar_search.md +0 -725
  29. package/presets/clearai/template/skills/citation-management/references/metadata_extraction.md +0 -870
  30. package/presets/clearai/template/skills/citation-management/references/pubmed_search.md +0 -839
  31. package/presets/clearai/template/skills/citation-management/scripts/doi_to_bibtex.py +0 -204
  32. package/presets/clearai/template/skills/citation-management/scripts/extract_metadata.py +0 -569
  33. package/presets/clearai/template/skills/citation-management/scripts/format_bibtex.py +0 -349
  34. package/presets/clearai/template/skills/citation-management/scripts/generate_schematic.py +0 -139
  35. package/presets/clearai/template/skills/citation-management/scripts/generate_schematic_ai.py +0 -817
  36. package/presets/clearai/template/skills/citation-management/scripts/search_google_scholar.py +0 -282
  37. package/presets/clearai/template/skills/citation-management/scripts/search_pubmed.py +0 -398
  38. package/presets/clearai/template/skills/citation-management/scripts/validate_citations.py +0 -497
  39. package/presets/clearai/template/skills/data-analysis/SKILL.md +0 -92
  40. package/presets/clearai/template/skills/data-analysis/checklists/readiness_check.md +0 -23
  41. package/presets/clearai/template/skills/data-analysis/templates/analysis_report.md.tpl +0 -63
  42. package/presets/clearai/template/skills/data-analysis/templates/cleaning_rules_draft.yaml.tpl +0 -32
  43. package/presets/clearai/template/skills/data-analysis/templates/data_dictionary.md.tpl +0 -12
  44. package/presets/clearai/template/skills/data-analysis/templates/domain_knowledge_template.md.tpl +0 -316
  45. package/presets/clearai/template/skills/data-analysis/templates/feature_candidates.json.tpl +0 -20
  46. package/presets/clearai/template/skills/data-analysis/templates/quality_scorecard.md.tpl +0 -30
  47. package/presets/clearai/template/skills/data-analysis/workflows/01-data-profiling.md +0 -42
  48. package/presets/clearai/template/skills/data-analysis/workflows/02-quality-audit.md +0 -36
  49. package/presets/clearai/template/skills/data-analysis/workflows/03-physical-correlation.md +0 -25
  50. package/presets/clearai/template/skills/data-analysis/workflows/04-unstructured-mining.md +0 -26
  51. package/presets/clearai/template/skills/data-qa-analysis/SKILL.md +0 -102
  52. package/presets/clearai/template/skills/data-qa-analysis/checklists/readiness_check.md +0 -62
  53. package/presets/clearai/template/skills/data-qa-analysis/templates/best_in_class_report.md.tpl +0 -56
  54. package/presets/clearai/template/skills/data-qa-analysis/templates/cleaning_rules_draft.yaml.tpl +0 -56
  55. package/presets/clearai/template/skills/data-qa-analysis/templates/data_dictionary.md.tpl +0 -13
  56. package/presets/clearai/template/skills/data-qa-analysis/templates/data_source_inventory_and_lineage.md.tpl +0 -146
  57. package/presets/clearai/template/skills/data-qa-analysis/templates/data_status_report.md.tpl +0 -60
  58. package/presets/clearai/template/skills/data-qa-analysis/templates/steady_state_rules.yaml.tpl +0 -41
  59. package/presets/clearai/template/skills/data-qa-analysis/templates/subsystem_registry.md.tpl +0 -101
  60. package/presets/clearai/template/skills/data-qa-analysis/templates/unified_execution_plan.md.tpl +0 -100
  61. package/presets/clearai/template/skills/data-qa-analysis/workflows/01-data-source-inventory-and-lineage.md +0 -194
  62. package/presets/clearai/template/skills/data-qa-analysis/workflows/02-data-alignment-and-tag-semantics.md +0 -122
  63. package/presets/clearai/template/skills/data-qa-analysis/workflows/03-steady-state-identification.md +0 -126
  64. package/presets/clearai/template/skills/data-qa-analysis/workflows/04-consumption-analysis.md +0 -152
  65. package/presets/clearai/template/skills/data-qa-analysis/workflows/05-best-in-class-and-optimization-space.md +0 -78
  66. package/presets/clearai/template/skills/domain-presearch/SKILL.md +0 -131
  67. package/presets/clearai/template/skills/domain-presearch/checklists/domain_checklist.md +0 -24
  68. package/presets/clearai/template/skills/domain-presearch/references/figure_code.md +0 -78
  69. package/presets/clearai/template/skills/domain-presearch/references/strategic_frameworks.md +0 -38
  70. package/presets/clearai/template/skills/exploration-loop/SKILL.md +0 -81
  71. package/presets/clearai/template/skills/exploratory-data-analysis/SKILL.md +0 -77
  72. package/presets/clearai/template/skills/exploratory-data-analysis/references/bioinformatics_genomics_formats.md +0 -664
  73. package/presets/clearai/template/skills/exploratory-data-analysis/references/chemistry_molecular_formats.md +0 -664
  74. package/presets/clearai/template/skills/exploratory-data-analysis/references/general_scientific_formats.md +0 -518
  75. package/presets/clearai/template/skills/exploratory-data-analysis/references/microscopy_imaging_formats.md +0 -620
  76. package/presets/clearai/template/skills/exploratory-data-analysis/references/proteomics_metabolomics_formats.md +0 -517
  77. package/presets/clearai/template/skills/exploratory-data-analysis/references/spectroscopy_analytical_formats.md +0 -633
  78. package/presets/clearai/template/skills/exploratory-data-analysis/scripts/eda_analyzer.py +0 -547
  79. package/presets/clearai/template/skills/hypothesis-generation/SKILL.md +0 -73
  80. package/presets/clearai/template/skills/hypothesis-generation/references/experimental_design_patterns.md +0 -329
  81. package/presets/clearai/template/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +0 -198
  82. package/presets/clearai/template/skills/hypothesis-generation/references/literature_search_strategies.md +0 -622
  83. package/presets/clearai/template/skills/hypothesis-generation/scripts/generate_schematic.py +0 -139
  84. package/presets/clearai/template/skills/hypothesis-generation/scripts/generate_schematic_ai.py +0 -817
  85. package/presets/clearai/template/skills/literature-review/SKILL.md +0 -72
  86. package/presets/clearai/template/skills/literature-review/references/citation_styles.md +0 -166
  87. package/presets/clearai/template/skills/literature-review/references/database_strategies.md +0 -455
  88. package/presets/clearai/template/skills/literature-review/scripts/generate_pdf.py +0 -176
  89. package/presets/clearai/template/skills/literature-review/scripts/generate_schematic.py +0 -139
  90. package/presets/clearai/template/skills/literature-review/scripts/generate_schematic_ai.py +0 -817
  91. package/presets/clearai/template/skills/literature-review/scripts/search_databases.py +0 -303
  92. package/presets/clearai/template/skills/literature-review/scripts/verify_citations.py +0 -221
  93. package/presets/clearai/template/skills/paper-lookup/SKILL.md +0 -59
  94. package/presets/clearai/template/skills/paper-lookup/references/arxiv.md +0 -161
  95. package/presets/clearai/template/skills/paper-lookup/references/biorxiv.md +0 -118
  96. package/presets/clearai/template/skills/paper-lookup/references/core.md +0 -150
  97. package/presets/clearai/template/skills/paper-lookup/references/crossref.md +0 -181
  98. package/presets/clearai/template/skills/paper-lookup/references/medrxiv.md +0 -104
  99. package/presets/clearai/template/skills/paper-lookup/references/openalex.md +0 -174
  100. package/presets/clearai/template/skills/paper-lookup/references/pmc.md +0 -152
  101. package/presets/clearai/template/skills/paper-lookup/references/pubmed.md +0 -124
  102. package/presets/clearai/template/skills/paper-lookup/references/semantic-scholar.md +0 -203
  103. package/presets/clearai/template/skills/paper-lookup/references/unpaywall.md +0 -127
  104. package/presets/clearai/template/skills/process-presearch/SKILL.md +0 -196
  105. package/presets/clearai/template/skills/process-presearch/checklists/process_checklist.md +0 -18
  106. package/presets/clearai/template/skills/process-presearch/references/figure_code.md +0 -107
  107. package/presets/clearai/template/skills/process-presearch/references/source_attribution_example.md +0 -22
  108. package/presets/clearai/template/skills/process-understanding-extraction/SKILL.md +0 -69
  109. package/presets/clearai/template/skills/process-understanding-extraction/checklists/readiness_check.md +0 -34
  110. package/presets/clearai/template/skills/process-understanding-extraction/templates/docx_raw_dump_extractor.py.tpl +0 -132
  111. package/presets/clearai/template/skills/process-understanding-extraction/templates/entity_map_unit_topology.json.tpl +0 -86
  112. package/presets/clearai/template/skills/process-understanding-extraction/templates/process_brief.md.tpl +0 -89
  113. package/presets/clearai/template/skills/process-understanding-extraction/templates/process_brief_builder_from_raw_dump.py.tpl +0 -203
  114. package/presets/clearai/template/skills/process-understanding-extraction/templates/process_flow_mermaid.md.tpl +0 -41
  115. package/presets/clearai/template/skills/process-understanding-extraction/templates/unified_execution_plan.md.tpl +0 -53
  116. package/presets/clearai/template/skills/process-understanding-extraction/workflows/01-process-doc-discovery.md +0 -173
  117. package/presets/clearai/template/skills/process-understanding-extraction/workflows/02-process-understanding-and-diagramming.md +0 -106
  118. package/presets/clearai/template/skills/scientific-brainstorming/SKILL.md +0 -64
  119. package/presets/clearai/template/skills/scientific-brainstorming/references/brainstorming_methods.md +0 -326
  120. package/presets/clearai/template/skills/scientific-critical-thinking/SKILL.md +0 -72
  121. package/presets/clearai/template/skills/scientific-critical-thinking/references/common_biases.md +0 -364
  122. package/presets/clearai/template/skills/scientific-critical-thinking/references/evidence_hierarchy.md +0 -485
  123. package/presets/clearai/template/skills/scientific-critical-thinking/references/experimental_design.md +0 -496
  124. package/presets/clearai/template/skills/scientific-critical-thinking/references/logical_fallacies.md +0 -478
  125. package/presets/clearai/template/skills/scientific-critical-thinking/references/scientific_method.md +0 -169
  126. package/presets/clearai/template/skills/scientific-critical-thinking/references/statistical_pitfalls.md +0 -506
  127. package/presets/clearai/template/skills/skill-creator/SKILL.md +0 -109
  128. package/presets/clearai/template/skills/skill-creator/references/authoring-guide.md +0 -89
  129. package/presets/clearai/template/skills/statistical-analysis/SKILL.md +0 -79
  130. package/presets/clearai/template/skills/statistical-analysis/references/assumptions_and_diagnostics.md +0 -369
  131. package/presets/clearai/template/skills/statistical-analysis/references/bayesian_statistics.md +0 -653
  132. package/presets/clearai/template/skills/statistical-analysis/references/effect_sizes_and_power.md +0 -578
  133. package/presets/clearai/template/skills/statistical-analysis/references/reporting_standards.md +0 -469
  134. package/presets/clearai/template/skills/statistical-analysis/references/test_selection_guide.md +0 -129
  135. package/presets/clearai/template/skills/statistical-analysis/scripts/assumption_checks.py +0 -538
  136. package/presets/clearai/template/skills/web-artifact/SKILL.md +0 -165
  137. package/presets/clearai/template/skills/web-artifact/assets/renderer/renderer.css +0 -229
  138. package/presets/clearai/template/skills/web-artifact/assets/renderer/renderer.js +0 -373
  139. package/presets/clearai/template/skills/web-artifact/assets/vendor/elkjs/LICENSE +0 -263
  140. package/presets/clearai/template/skills/web-artifact/assets/vendor/elkjs/UPSTREAM.md +0 -26
  141. package/presets/clearai/template/skills/web-artifact/assets/vendor/elkjs/elk.bundled.js +0 -6605
  142. package/presets/clearai/template/skills/web-artifact/references/when-drawing-a-topology.md +0 -150
  143. package/presets/clearai/template/skills/web-artifact/references/when-the-page-must-work-offline.md +0 -62
  144. package/presets/clearai/template/skills/web-artifact/scripts/check_artifact.py +0 -167
  145. package/presets/clearai/template/skills/web-artifact/scripts/render_topology.js +0 -272
  146. package/presets/clearai/template/skills/what-if-oracle/LICENSE.txt +0 -5
  147. package/presets/clearai/template/skills/what-if-oracle/SKILL.md +0 -72
  148. package/presets/clearai/template/skills/what-if-oracle/references/scenario-templates.md +0 -154
@@ -1,92 +1,106 @@
1
1
  ---
2
2
  name: clearai-loop
3
- description: Use when working inside the ClearAI preset and you need the loop's contract rather than its prompt — how a claim becomes a fact (hypothesis → verification → observation → evaluation → evidence → fact), which tool is the only completion verb, what observation admission does and does not decide, who may write a verdict at each level (L0–L4), what "doer does not judge themselves" costs you, and what happens when a step fails admission. Load it before planning multi-step work, before declaring anything finished, or when a step keeps getting blocked.
3
+ description: Use when working inside the ClearAI preset and a delivery keeps getting rejected, a plan is blocked, an ontology file write is refused or flagged, or you need to read an evaluator's verdict card — what admission checks, what to do after a rejection, how the two-part verdict is read, and how the ontology files are checked.
4
4
  ---
5
5
 
6
- # ClearAI 循环契约
6
+ # ClearAI 循环:被拦了怎么办
7
7
 
8
- 这份技能是**机制的手册**,不是劝告。它描述的每条规则都已经在 `clearai-kernel` 里强制执行:你读它,是为了知道系统会替你做什么、以及你能做什么。
8
+ 循环本身写在提示词的「循环」一段,每个工具的用法写在工具说明里。这份技能只讲那两处没写的:准入核什么、被拦之后怎么走、评估卡怎么读、本体文件怎么被检查。这里的每条规则都由 `clearai-kernel` 执行,不是劝告。
9
9
 
10
- ## 术语与状态
10
+ ## 准入只回答「收不收」
11
11
 
12
- 九个对象是:目标 → 计划 → 命题 → 验证 → 观测 → 评估 → 证据 → 事实 → 世界线(等级 L0–L4 只决定**谁可以写裁决**与是否需要人放行)。状态不存,全部由台账现算;本技能描述的规则就是当前契约的全部。
12
+ `AdvancePlan` 交付时,系统按这个次序核对:
13
13
 
14
- ## 知识模式的启动协议(不等用户提醒)
14
+ 1. 声明的产物**存在**吗?不存在就拒,出路三条:把它做出来、改声明、或用 `RevisePlan(action="void")` 带因作废这一步。
15
+ 2. 声明的是**目录**吗?目录不是物证,改为声明具体文件。零字节文件同样拒:空文件不是观测。
16
+ 3. **结构合法**吗?`.json` 要能解析;`.md` 去掉标题行后不足 20 个字算「只有标题」。别的扩展名不做结构判定。
17
+ 4. 一个产物都没声明 → `no_anchor`:不改变世界的步骤没有可验收的东西。
18
+ 5. 都过了且判据非空 → 不是放行,而是送评(L3 以上派独立评估者;L0–L2 用你给的 `basis` 与 `results`)。
15
19
 
16
- 目标一立、命题一登记,系统就把**知识预检**送进运行态卡:当前主张文本命中的概念 / 谓词 / 可复用事实。按这个顺序走:
20
+ 准入不看判据里的任何断言:数值、口径、一致性都不看。`touch` 一个文件也能过准入,所以过了准入绝不等于这一步做完了。
17
21
 
18
- | 情况 | 动作 |
19
- |---|---|
20
- | 命中的词条能表达 | 直接用 id 引用,不重复登记 |
21
- | 要写断言但谓词不存在 | `RegisterTerm` / `RegisterPredicate` 立最小一组(每个带依据) |
22
- | 核心假设准备登记 | `SetGoal` 里连 `assertions` 一起写 |
23
- | 预检摘要不够精确 | `QueryKnowledge` 按概念 / 谓词 / 主体精确取 |
24
- | 只出现一次且不需要比较 | 保留 claim,不造词 |
25
- | 单步、一次性、无复用 | 不建本体(普通任务连知识模式都不进) |
22
+ ## 被拦之后
26
23
 
27
- **别为了让门放行而编词**:词汇是约定,它将长期约束这个项目怎么写结论。确实不值得留下形态的结论,如实 `CloseGoal(outcome="abandoned")`。
24
+ - **准入拒了**:按返回的缺口改产物或改声明再交。判据本身写错了,用 `RevisePlan(action="refine")` 改,旧判据留在账上。
25
+ - **评估者说交付不成立**:读它的 `shortfalls`(哪条判据、看到了什么、还缺什么),补齐再交。不要换个说法重交同一份东西。
26
+ - **同一步连拦到阈值**:计划置为 blocked,系统当场问人是按缺口再改还是作废这一步;没人能答就停下等人。别硬试下一次。
27
+ - **在 L3 以上带了 `results`**:被拒(`verdict_not_accepted`),去掉 `results` 重交,系统会派评估者。
28
28
 
29
- ## 一句话
29
+ ## 评估卡怎么读
30
30
 
31
- **让模型负责智能判断,让系统负责事实边界。** 你负责理解材料、提出假设、选择路线、判断哪条证据更可信。系统负责什么算完成、状态是什么、一个事实能不能写进知识库、谁的裁决有效。
31
+ 一张卡两项裁决,各管各的:
32
32
 
33
- 推论很硬:**凡是被存储的状态都是潜在的谎言**,所以状态不存,全部由台账现算。你不能声明进度、不能声明阶段、不能声明假设成立——你只能交付。
33
+ | 项 | 回答什么 | 取值 |
34
+ |---|---|---|
35
+ | `holds` | 交付成立吗:判据逐条满足、观测真实 | yes / no / unclear |
36
+ | `results` | 这一步检验的每条判断,对照推翻条件读出了什么 | support / refute / inconclusive |
34
37
 
35
- ## 四拍与唯一的完成动词
38
+ `holds=yes` 这一步就完成,不管 `results` 是支持、推翻还是说不清。推翻和说不清照样记成证据,判断的状态由证据算。评估卡写不进来时裁决降级为 `unknown`,这一步不推进,绝不静默放行。
36
39
 
37
- | 拍 | 你做什么 | 系统做什么 |
38
- |---|---|---|
39
- | 计划 | `CreatePlan`:每步写 `do`、`artifacts`(以何物为证)、`done_criteria`(判定标准) | 强制判据非空、自指检测、≤25 步、步骤 id 唯一 |
40
- | 执行 | 用文件、bash、公网做实际工作;产物落盘 | 只读并行 / 写入串行;沙箱;每次写入进账 |
41
- | 观察 | 拿到结果 | 登记观测(只追加) |
42
- | 反思 | `AdvancePlan` 交付 | 观测准入 → 裁决 → 写证据 → 推进 |
40
+ 评估卡、证据、事实由系统落盘;`clear/evidence`、`clear/knowledge/facts`、`clear/goals` 你都写不了。重评产生新证据,旧证据不改不删。
41
+
42
+ ## 本体文件被拒或被标出来
43
+
44
+ 本体文件(`clear/ontology/{concepts,relations,entities}/**.json`)查三道:
43
45
 
44
- `AdvancePlan` 是**唯一**能推进循环的动词。另外三个动词明确不动进度,并在返回值里告诉你 `progress_changed: false`:
46
+ 1. **写入时只查这一个文件**:JSON 能解析、字段齐且类型对、`id` 等于文件名、取值合法。不过这次写入就被拒,原因原样回给你;照 `clear/ontology/SCHEMA.json` 改好再写。引用的东西在不在这时不查,所以先写实体、后补它的概念也可以。用 bash 写进来的文件跳过这一道,但躲不过下一道。
47
+ 2. **读取时查跨文件**:引用的 id 存在、id 不重复、主语和宾语的类型对得上(下位概念也算)、单值关系只有一个取值。有问题的节点或关系不进图,卡上「本体文件有 N 处问题」逐条列出;它只提示,不拦你干活。
48
+ 3. **升格时把断言涉及的本体全查一遍**:结案通过时,判断里的断言用到的关系、类型、主体此刻都要成立;不成立这条判断就不写进长期知识,回执里写明卡在哪。
45
49
 
46
- - `AmendPlan` —— 补一步(漏了活)。
47
- - `RefinePlan` —— 改判定标准(不改进度;旧判据留痕)。
48
- - `VoidPlanStep` —— 带因作废(作废留痕光明正大;为凑完成而造证是大忌)。
50
+ 卡上某条事实标「定义已变」:它升格时用到的某个概念或关系后来改了含义(释义、上位、主语域、宾语域、单值性)。看一眼它还成不成立:不成立就在新目标里把它当待检验的判断重新检验;改名、改别名不会触发这个标记。
49
51
 
50
- ## 观测准入:它只回答「收不收」
52
+ ## 结案之后
53
+
54
+ 结案成功、而这次摸出了一套以后还会用的做法(怎么查、怎么算、怎么验),把它写成原生技能:`.agents/skills/<名字>/SKILL.md`,开头的 `description` 写清什么时候用。下次宿主会把它列出来。只做了一次、不会再用的,不写。
55
+
56
+ ---
51
57
 
52
- 交付时系统按这个次序检查(以当前 ClearAI DSH 内核的准入契约为准):
58
+ # The ClearAI loop: what to do when blocked (English)
53
59
 
54
- 1. 声明的产物**存在**吗?不存在 → 硬拦 `l1`,并告诉你三条合法出路(做出来 / 改声明 / 带因作废)。
55
- 2. 存在但是**空**吗?空目录、零字节文件 → 同样硬拦:空文件不是观测。
56
- 3. **结构合法**吗?`.json` 必须能解析;`.md` 去掉标题行后实质文本不足 20 字符算「仅有标题」。其他扩展名不做结构判定(不误伤)。
57
- 4. 一个坐标都没声明 → `no_anchor` 硬拦:不改变世界的步骤没有可验收的东西。
58
- 5. 坐标齐备且判据非空 → **不是放行,是送评**(`needs_audit`)。
60
+ The loop itself is in the "loop" section of the prompt, and each tool's usage is in its own description. This skill covers only what those leave out: what intake checks, how to proceed after a rejection, how to read an evaluator's card, and how ontology files are checked. Every rule here is enforced by `clearai-kernel`; none of it is advice.
59
61
 
60
- 准入**不判**判据里的任何断言:数值、口径、一致性都不看。坐标齐备只是必要条件——`touch` 一个文件也能让坐标齐备,所以齐备绝不等于这一步做完了。判据里的断言由评估者逐条核对。
62
+ ## Intake only answers "accept or not"
61
63
 
62
- 连续 3 次未过闸,计划会被置为 `blocked` 并停下等人。别硬试第四次:改产物、改判据,或者把这一步作废。
64
+ When you deliver with `AdvancePlan`, the system checks in this order:
63
65
 
64
- ## 谁可以写裁决
66
+ 1. Do the declared outputs **exist**? If not, it refuses, with three ways out: produce them, change the declaration, or void the step with a reason via `RevisePlan(action="void")`.
67
+ 2. Is a declared output a **directory**? A directory is not proof; declare concrete files. Zero-byte files are refused too: an empty file is not an observation.
68
+ 3. Is the **structure valid**? `.json` must parse; a `.md` with fewer than 20 characters after removing the title line counts as "title only". Other extensions get no structural check.
69
+ 4. No output declared at all → `no_anchor`: a step that changes nothing has nothing to accept.
70
+ 5. All passed and the criteria are non-empty → this is not approval but referral (an independent evaluator from L3 up; your `basis` and `results` at L0–L2).
65
71
 
66
- | 等级 | 定义 | 谁判 |
72
+ Intake does not look at any assertion in the criteria: values, definitions and consistency are not checked. `touch` on a file passes intake, so passing intake never means the step is done.
73
+
74
+ ## After a rejection
75
+
76
+ - **Intake refused**: fix the output or the declaration according to the reported gap, then deliver again. If the criterion itself is wrong, change it with `RevisePlan(action="refine")`; the old one stays in the ledger.
77
+ - **The evaluator says the delivery does not hold**: read its `shortfalls` (which criterion, what it saw, what is missing), fill the gaps, then deliver again. Do not hand in the same thing reworded.
78
+ - **The same step blocked up to the threshold**: the plan is marked blocked and the system asks a person right there whether to revise against the gaps or void the step; if nobody can answer, it stops and waits. Do not force another attempt.
79
+ - **`results` given at L3 or above**: refused (`verdict_not_accepted`). Deliver again without `results`, and the system dispatches an evaluator.
80
+
81
+ ## Reading an evaluator's card
82
+
83
+ One card carries two verdicts, each answering its own question:
84
+
85
+ | Item | Answers | Values |
67
86
  |---|---|---|
68
- | L0 | 只靠推理的快速合理性检查 | 你自己(`verdict` + `basis`,依据必须可复查) |
69
- | L1 | 已有知识:文献、数据库是否已回答 | 你自己 |
70
- | L2 | 已有数据或小规模计算 | 你自己 |
71
- | L3 | 新产生的、可重复的证据 | **独立评估者**(系统派,fresh context,只读产物) |
72
- | L4 | 新产生的、不可重复或来自外部的证据 | **独立评估者**,并且没有人放行不能开始;做的人自己写的文件不算观测 |
87
+ | `holds` | Does the delivery hold: every criterion met, observations real | yes / no / unclear |
88
+ | `results` | For each judgment the step tests, what the observation shows against its refutation condition | support / refute / inconclusive |
89
+
90
+ With `holds=yes` the step is complete, whatever `results` says. Refute and inconclusive are recorded as evidence all the same, and the judgment's status is computed from the evidence. If the card cannot be written, the verdict degrades to `unknown` and the step does not advance; it is never silently let through.
73
91
 
74
- 在 L3 以上交付时带上 `verdict` 会被直接拒绝(`verdict_not_accepted`):做的人不判自己。这不是建议——去掉 `verdict` 重新交付,系统会派评估者,你拿回的是评估卡上的裁决。
92
+ The system writes evaluator cards, evidence and facts; you cannot write `clear/evidence`, `clear/knowledge/facts` or `clear/goals`. A re-evaluation adds new evidence; old evidence is never changed or deleted.
75
93
 
76
- 评估者只核对、不发挥、不执行,产出结构化评估卡;卡由系统落盘(写不进卡时裁决降级 `unknown`,这一步就不推进,绝不静默放行)。你也不能写 `clear/evidence`、`clear/knowledge/facts`、`clear/goals` 里的任何文件——那些是系统所有的面。
94
+ ## When an ontology file is refused or flagged
77
95
 
78
- ## 目标:跨计划的一等对象
96
+ Ontology files (`clear/ontology/{concepts,relations,entities}/**.json`) go through three checks:
79
97
 
80
- 目标带着一份「怎样算回答了」的判据(`done_criteria`)和候选假设。每条假设必须有**推翻条件**:没有推翻条件的假设无法被检验。
98
+ 1. **On write, only this file is checked**: the JSON parses, fields are present with the right types, `id` equals the file name, values are legal. If it fails, the write is refused and the reason comes back verbatim; fix it according to `clear/ontology/SCHEMA.json` and write again. Whether referenced things exist is not checked here, so you can write an entity first and its concept later. Files written through bash skip this check but not the next one.
99
+ 2. **On read, across files**: referenced ids exist, ids are unique, subject and object types fit (narrower concepts count), single-valued relations have one value. Nodes or relations with problems stay off the graph, and the card lists them under "ontology files have N problems"; this only warns, it does not stop your work.
100
+ 3. **On promotion, every part of the ontology an assertion uses is checked**: when a conclusion passes, the relations, types and subjects used by a judgment's assertions must all hold at that moment; if not, that judgment is not written to long-term knowledge, and the receipt says where it is stuck.
81
101
 
82
- - `SetGoal` 修订必须带 `reason`,版本 +1,旧值全部留痕;同一时间只开一个目标。
83
- - 一张 Plan 只承载目标的一个阶段。`ClosePlan` 之后目标若未达成,继续 `CreatePlan` 开下一阶段,不用等人说「继续」。
84
- - `CloseGoal(outcome="achieved")` 会**无条件**触发一次目标级独立评估:评估者逐条核对判据与转写忠实度,只有它说达成才结案;它说没达成,目标保持开放并把缺口回注给你。
85
- - 达升格门槛且无推翻的假设,在结案时由系统升格为事实,写进 `clear/knowledge/facts/`。被推翻的假设留在台账里——一条被推翻的假设是有价值的资产。
102
+ A fact marked "definition changed" on the card: a concept or relation it used at promotion later changed meaning (definition, broader term, subject domain, object range, single-valuedness). Check whether it still holds; if not, test it again as a judgment in a new goal. Renaming or changing aliases does not trigger this mark.
86
103
 
87
- ## 证据的形态
104
+ ## After concluding
88
105
 
89
- - 假设的状态由证据**算**出来,不打分:支持到第几级、有几条推翻、有几次无法判定。你读到的是派生结果。
90
- - `inconclusive` 是诚实的答案。一次如实推翻假设的步骤照样可以通过验收——不要为了让步骤通过而写 support。
91
- - 重评产生**新证据**,旧证据不改、不删。
92
- - 结算单记四列:意图(判据)/ 事实(坐标)/ 评估者 / 差额(依据或缺口)。
106
+ If the conclusion succeeds and the run found a method worth reusing (how to look up, compute or verify), write it as a native skill: `.agents/skills/<name>/SKILL.md`, with a `description` at the top that says when to use it. The host lists it next time. Skip anything done once and never needed again.