@thinkingai/ae-cli 6.0.52 → 6.0.54

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 (185) hide show
  1. package/README.md +35 -10
  2. package/README.zh.md +32 -10
  3. package/bin/ae-cli.js +6 -1
  4. package/cli-installation-guide.md +91 -0
  5. package/dist/{auth-XZNXFRJS.js → auth-MBWRZTB6.js} +171 -13
  6. package/dist/automation-NWWVLWG2.js +459 -0
  7. package/dist/{capability-RJZ4KRGP.js → capability-7SSN6PNZ.js} +11 -6
  8. package/dist/chunk-4655PUNX.js +43 -0
  9. package/dist/{chunk-4NRCTUZJ.js → chunk-5XJYLEVC.js} +4 -4
  10. package/dist/{chunk-JOCDD4ON.js → chunk-7QXISROD.js} +1 -1
  11. package/dist/{chunk-EQ255HKO.js → chunk-AP7YP2NX.js} +2 -2
  12. package/dist/{chunk-DVMLWQD4.js → chunk-CT7QDJS6.js} +2 -2
  13. package/dist/chunk-D6ACFILC.js +56 -0
  14. package/dist/{chunk-HFGZGYCG.js → chunk-EOYSKMXN.js} +264 -10
  15. package/dist/{chunk-57RRFUEZ.js → chunk-FMNNGNYO.js} +43 -8
  16. package/dist/{chunk-7XGFSUOM.js → chunk-GIK6EDUG.js} +291 -84
  17. package/dist/{chunk-WEPZ5M3Z.js → chunk-HBLK3ZHW.js} +7 -4
  18. package/dist/chunk-HVHR4SCP.js +133 -0
  19. package/dist/{chunk-DX5CDO34.js → chunk-KFNMQTZI.js} +580 -214
  20. package/dist/{chunk-HBGADCKA.js → chunk-PLE722AJ.js} +28 -11
  21. package/dist/chunk-RK6GLDGI.js +27 -0
  22. package/dist/{chunk-V2NUHPXF.js → chunk-S6M42KND.js} +1 -1
  23. package/dist/{chunk-7FTTULED.js → chunk-UQ77JXYH.js} +7 -3
  24. package/dist/{chunk-MAPZ7VB6.js → chunk-WNGFSIOB.js} +20 -1
  25. package/dist/{chunk-L2QUIZTS.js → chunk-ZIQWCZTS.js} +3 -3
  26. package/dist/{community-report-client-CU22W53K.js → community-report-client-PEERQCX2.js} +1 -1
  27. package/dist/{config-XO3LI3SA.js → config-FF6YVJKI.js} +29 -10
  28. package/dist/context-YAE3QXP3.js +136 -0
  29. package/dist/{data-integration-HNGUKFIC.js → data-integration-HESZET7E.js} +6 -6
  30. package/dist/index.js +169 -55
  31. package/dist/{local-data-upload-client-GTRIT64F.js → local-data-upload-client-TWMHFLUA.js} +1 -1
  32. package/dist/memory-62BJOULV.js +580 -0
  33. package/dist/{metadata-JAQW7KGZ.js → metadata-7CUMWIB4.js} +7 -7
  34. package/dist/{model-RNPQXIBI.js → model-SBV2JFJI.js} +9 -5
  35. package/dist/{personal-semantic-preference-QCZ2IZTK.js → personal-semantic-preference-6SRCYPGE.js} +119 -11
  36. package/dist/{project-semantic-64JURXKF.js → project-semantic-YYEM4OSU.js} +7 -7
  37. package/dist/{sync-O45NXEQY.js → sync-SU33KYX7.js} +12 -8
  38. package/dist/{te-agent-K5MSPNHJ.js → te-agent-F5QBZSQA.js} +423 -494
  39. package/dist/{te-analysis-KQKCAI5H.js → te-analysis-U4I2W2WC.js} +1090 -67
  40. package/dist/{te-community-4OYU3BDA.js → te-community-PFLDLPP4.js} +3 -3
  41. package/dist/{te-dataops-NFIPB6FX.js → te-dataops-FOQSRIAZ.js} +644 -276
  42. package/dist/{te-engage-HSVSRW22.js → te-engage-ZX76CNAB.js} +6 -6
  43. package/dist/{te-kb-3TS73NO6.js → te-kb-MHDOST62.js} +666 -244
  44. package/dist/{te-system-STMHLS5J.js → te-system-J2FQF5ER.js} +6 -6
  45. package/dist/{te-team-3I5AOX3N.js → te-team-5UOZPTU3.js} +6 -6
  46. package/dist/things-VPPXXLHB.js +1091 -0
  47. package/dist/{update-RZXLPCRH.js → update-EEUTEI6R.js} +59 -51
  48. package/dist/workspace-O3EEIYQM.js +554 -0
  49. package/package.json +30 -11
  50. package/skills/ae-agent/SKILL.md +95 -140
  51. package/skills/ae-agent/references/add-model.md +1 -1
  52. package/skills/ae-agent/references/create-agent.md +1 -1
  53. package/skills/ae-agent/references/find-archived-conversations.md +12 -5
  54. package/skills/ae-agent/references/get-agent.md +1 -1
  55. package/skills/ae-agent/references/list-agents.md +2 -2
  56. package/skills/ae-agent/references/list-models.md +2 -2
  57. package/skills/ae-agent/references/notification.md +40 -0
  58. package/skills/ae-agent/references/restore-conversation.md +3 -1
  59. package/skills/ae-analysis/SKILL.md +76 -15
  60. package/skills/ae-analysis/references/agent_review_submit_to_page.md +2 -0
  61. package/skills/ae-analysis/references/ai_models/event.md +6 -1
  62. package/skills/ae-analysis/references/ai_models/funnel.md +12 -4
  63. package/skills/ae-analysis/references/ai_models/heat_map.md +23 -0
  64. package/skills/ae-analysis/references/ai_models/interval.md +24 -0
  65. package/skills/ae-analysis/references/ai_models/path.md +20 -0
  66. package/skills/ae-analysis/references/ai_models/prop_analysis.md +2 -0
  67. package/skills/ae-analysis/references/ai_models/rank_list.md +30 -0
  68. package/skills/ae-analysis/references/ai_models/retention.md +45 -1
  69. package/skills/ae-analysis/references/ai_models/revenue.md +20 -2
  70. package/skills/ae-analysis/references/ai_models/tag.md +2 -0
  71. package/skills/ae-analysis/references/ai_models.md +96 -0
  72. package/skills/ae-analysis/references/analysis_data_retrieval.md +4 -0
  73. package/skills/ae-analysis/references/asset_batch_info_export.md +10 -0
  74. package/skills/ae-analysis/references/asset_batch_sql_export.md +13 -1
  75. package/skills/ae-analysis/references/asset_export.md +12 -1
  76. package/skills/ae-analysis/references/asset_list.md +1 -0
  77. package/skills/ae-analysis/references/asset_search.md +11 -5
  78. package/skills/ae-analysis/references/bi_panel_list.md +1 -1
  79. package/skills/ae-analysis/references/catalog_list.md +1 -1
  80. package/skills/ae-analysis/references/collaboration.md +48 -0
  81. package/skills/ae-analysis/references/command_index.md +26 -17
  82. package/skills/ae-analysis/references/dashboard_list.md +4 -4
  83. package/skills/ae-analysis/references/dashboard_move.md +21 -0
  84. package/skills/ae-analysis/references/dashboard_report_add.md +2 -0
  85. package/skills/ae-analysis/references/dashboard_report_data_export.md +2 -0
  86. package/skills/ae-analysis/references/dashboard_report_get.md +19 -0
  87. package/skills/ae-analysis/references/dashboard_report_update.md +27 -0
  88. package/skills/ae-analysis/references/dashboard_update.md +1 -1
  89. package/skills/ae-analysis/references/event_export.md +3 -1
  90. package/skills/ae-analysis/references/event_report_presentation.md +76 -0
  91. package/skills/ae-analysis/references/feedback_submit.md +37 -0
  92. package/skills/ae-analysis/references/governance_recommendation_auto_review.md +71 -0
  93. package/skills/ae-analysis/references/governance_recommendation_export.md +11 -0
  94. package/skills/ae-analysis/references/metadata_resolution.md +18 -3
  95. package/skills/ae-analysis/references/metric_export.md +3 -1
  96. package/skills/ae-analysis/references/metric_list.md +1 -1
  97. package/skills/ae-analysis/references/operation_record_export.md +10 -0
  98. package/skills/ae-analysis/references/personal_semantic_preference_add.md +2 -2
  99. package/skills/ae-analysis/references/personal_semantic_preference_get.md +6 -4
  100. package/skills/ae-analysis/references/personal_semantic_preference_list.md +5 -3
  101. package/skills/ae-analysis/references/personal_semantic_preference_review.md +9 -0
  102. package/skills/ae-analysis/references/personal_semantic_preference_review_list.md +7 -0
  103. package/skills/ae-analysis/references/personal_semantic_preference_submit.md +7 -0
  104. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +91 -32
  105. package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +99 -1
  106. package/skills/ae-analysis/references/property_export.md +3 -1
  107. package/skills/ae-analysis/references/report_create.md +17 -3
  108. package/skills/ae-analysis/references/report_data_export.md +6 -0
  109. package/skills/ae-analysis/references/report_get.md +7 -1
  110. package/skills/ae-analysis/references/report_list.md +5 -5
  111. package/skills/ae-analysis/references/report_update.md +20 -3
  112. package/skills/ae-analysis/references/sql_table_columns.md +4 -4
  113. package/skills/ae-analysis/references/sql_table_list.md +5 -5
  114. package/skills/ae-analysis/references/system_query_monitor_overview.md +2 -0
  115. package/skills/ae-analysis/references/system_query_task_cancel.md +2 -0
  116. package/skills/ae-analysis/references/system_query_task_export.md +6 -2
  117. package/skills/ae-analysis/references/system_query_task_get.md +2 -0
  118. package/skills/ae-analysis/references/system_query_task_list.md +7 -3
  119. package/skills/ae-analysis/references/system_query_task_options.md +2 -2
  120. package/skills/ae-analysis/references/system_query_task_realtime_list.md +15 -0
  121. package/skills/ae-analysis/references/user_cluster_models.md +8 -0
  122. package/skills/ae-analysis/references/user_tag_create.md +7 -1
  123. package/skills/ae-analysis/references/user_tag_get.md +1 -1
  124. package/skills/ae-analysis/references/user_tag_models.md +20 -2
  125. package/skills/ae-analysis/references/user_tag_refresh.md +1 -1
  126. package/skills/ae-analysis/references/user_tag_update.md +2 -2
  127. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-empty-skeleton.mjs +105 -0
  128. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +669 -29
  129. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +21 -8
  130. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +28 -10
  131. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +66 -0
  132. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +285 -24
  133. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +262 -30
  134. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/plan-kb-source-sync.mjs +1 -1
  135. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +46 -2
  136. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/prepare-compile-schema.mjs +64 -0
  137. package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/refresh-state-parts.mjs +91 -0
  138. package/skills/ae-automation/SKILL.md +16 -0
  139. package/skills/ae-automation/references/cli.md +53 -0
  140. package/skills/ae-automation/references/command_index.md +17 -0
  141. package/skills/ae-capability/SKILL.md +73 -2
  142. package/skills/ae-capability/references/collaboration.md +48 -0
  143. package/skills/ae-community/SKILL.md +5 -1
  144. package/skills/ae-community/references/collaboration.md +48 -0
  145. package/skills/ae-current-context/SKILL.md +3 -2
  146. package/skills/ae-data-integration/SKILL.md +4 -0
  147. package/skills/ae-data-integration/references/collaboration.md +48 -0
  148. package/skills/ae-dataops/SKILL.md +54 -74
  149. package/skills/ae-dataops/references/collaboration.md +48 -0
  150. package/skills/ae-dataops/references/dataops-backfill.md +23 -18
  151. package/skills/ae-dataops/references/dataops-flow-create.md +74 -23
  152. package/skills/ae-dataops/references/dataops-flow-monitor.md +45 -13
  153. package/skills/ae-dataops/references/dataops-integration.md +57 -30
  154. package/skills/ae-dataops/references/dataops-query.md +21 -4
  155. package/skills/ae-dataops/references/dataops-table.md +143 -11
  156. package/skills/ae-engage/SKILL.md +21 -6
  157. package/skills/ae-engage/references/channel-mgmt.md +3 -3
  158. package/skills/ae-engage/references/collaboration.md +48 -0
  159. package/skills/ae-engage/references/scene-config-channel.md +4 -4
  160. package/skills/ae-generate-tracking-plan/SKILL.md +4 -0
  161. package/skills/ae-generate-tracking-plan/references/collaboration.md +48 -0
  162. package/skills/ae-kb/SKILL.md +70 -12
  163. package/skills/ae-kb/references/analysis-workflow.md +73 -36
  164. package/skills/ae-kb/references/collaboration.md +48 -0
  165. package/skills/ae-kb/references/query-workflow.md +67 -33
  166. package/skills/ae-kb/references/schema-import.md +32 -0
  167. package/skills/ae-kb/references/source-mutations.md +6 -4
  168. package/skills/ae-kb/references/text-sources.md +53 -0
  169. package/skills/ae-kb-discovery/SKILL.md +8 -3
  170. package/skills/ae-kb-discovery/references/collaboration.md +48 -0
  171. package/skills/ae-metadata/SKILL.md +20 -12
  172. package/skills/ae-metadata/references/collaboration.md +48 -0
  173. package/skills/ae-team/SKILL.md +23 -17
  174. package/skills/ae-things/SKILL.md +85 -0
  175. package/skills/ae-things/references/cli.md +103 -0
  176. package/skills/ae-things-progress/SKILL.md +43 -0
  177. package/skills/ae-things-review/SKILL.md +42 -0
  178. package/skills/ae-workspace/SKILL.md +43 -0
  179. package/skills/ae-workspace/references/commands.md +51 -0
  180. package/dist/chunk-E2JKXMVO.js +0 -29
  181. package/dist/context-IFJI3LIT.js +0 -46
  182. package/dist/memory-QGPSNCQS.js +0 -892
  183. package/skills/ae-agent/references/create-automation.md +0 -125
  184. package/skills/ae-agent/references/list-automations.md +0 -56
  185. package/skills/ae-agent/references/update-automation.md +0 -107
@@ -1,23 +1,25 @@
1
1
  # Project Semantic Knowledge Base Wiki
2
2
 
3
- Requires `project_semantic_enable=on` for the target project. If export returns `PROJECT_SEMANTIC_DISABLED`, report that this project must enable `project_semantic_enable` and stop this workflow. Do not bypass the disabled entry point with other export, metadata, or capability commands.
3
+ Asset-package export requires access to the target project. Neither the retired `project_semantic_enable` project switch nor the company switch for automatic knowledge-base discovery gates an explicit build or refresh. If project access or company KB permission is denied, report the error and stop; do not switch to a different project, scope, or export path.
4
4
 
5
- Build one server-consumable project semantic source Wiki from one immutable Common asset-package snapshot and prove that the KB-compiled knowledge base can be browsed and consumed correctly. The asset package is the raw truth source. Default to a governed package; use an `all_visible` package only when the user explicitly asks for all assets or for uncertified assets to be included. The Agent summarizes the asset semantics once into editable Markdown sources; KB owns schema generation, final compilation, source lifecycle, and incremental maintenance.
5
+ Build one server-consumable project semantic source Wiki from one immutable Common asset-package snapshot and prove that the KB-compiled knowledge base can be browsed and consumed correctly. The asset package is the raw truth source. Default to a governed package; use an `all_visible` package only when the user explicitly asks for all assets or for uncertified assets to be included. The Agent summarizes the asset semantics once into editable Markdown sources; KB owns formal rule application, final compilation, source lifecycle, and incremental maintenance.
6
+
7
+ The first product goal is not an asset directory. The Wiki must teach the user and Agent how this project observes business: what business system it covers, who uses it, what business objects exist, how those objects relate, which judgment chains users follow, and which assets play primary, supporting, drilldown, or exclusion roles in those chains. Asset pages, report formulas and metadata pages hang under that business judgment model. A Wiki that only lists domains, reports, metrics, dimensions, recall cards, counts, or source containers is an incomplete project semantic KB even if it compiles.
6
8
 
7
9
  ## Boundary
8
10
 
9
- - This command reference covers asset-package download, one Agent semantic-planning pass, deterministic Wiki-source rendering, validation, editable ZIP source upload, schema generation, compilation, server readback, and retrieval acceptance.
11
+ - This command reference covers asset-package download, one Agent semantic-planning pass, deterministic Wiki-source rendering, validation, editable ZIP source upload, preset initialization/reuse, compilation, server readback, and retrieval acceptance.
10
12
  - The default source scope is `governed`. If and only if the user explicitly requests all assets, use `all_visible`; keep uncertified assets visible but marked `certification_state=uncertified`, and do not present uncertified or conflicting assets as governed definitions.
11
13
  - The retired governed project-semantic candidate/review/enable/release lifecycle is not part of this workflow. A retrieval taxonomy or Wiki page is not automatically a governed project semantic.
12
14
  - The generated Wiki is a retrieval and evidence layer. Current counts, recent customers, and live usage still require report execution.
13
- - Do not use `kb +import` for this loop. `kb +import` imports an already compiled read-only snapshot; this workflow needs source upload followed by `kb +schema` and `kb +compile`.
15
+ - Do not use `kb +import` for this loop. `kb +import` imports an already compiled read-only snapshot; this workflow needs editable source upload, valid formal rules, and `kb +compile`. Do not generate Schema in the normal build/refresh path.
14
16
 
15
17
 
16
18
  ## Usage and Intake Gate
17
19
 
18
20
  When the user asks to build, update, refresh, rebuild, or sync a project semantic knowledge base from project assets, open this reference from `ae-analysis` and run the full loop here. Do not use this workflow for asset-certification or metric recommendations; those use `analysis-meta governance-recommendation export`.
19
21
 
20
- CLI Agent performs the main semantic precompilation: understand definitions and SQL, author complete asset meanings, domain relationships, recall boundaries, SQL business summaries, and evidence-backed conflicts, then render Markdown sources. Scripts only handle deterministic work: validation, IDs, links, packaging, source-tree diffs, and removal of parser/placeholder noise. They must not author business purpose, domain intent, SQL applicable questions, conflict interpretation, or visible rationale from templates. Upload those sources as an editable ZIP and let KB compile the final Wiki, integrate human context, maintain citations/navigation, and incrementally update affected pages. Never use `kb +import` for this workflow: a read-only snapshot cannot provide this source lifecycle.
22
+ CLI Agent performs the main semantic precompilation: understand definitions and SQL, author a project-level business model, complete asset meanings, domain judgment models, domain relationships, recall boundaries, SQL business summaries, and evidence-backed conflicts, then render Markdown sources. Scripts only handle deterministic work: validation, IDs, links, packaging, source-tree diffs, and removal of parser/placeholder noise. They must not author business positioning, business objects, judgment chains, business purpose, domain intent, SQL applicable questions, conflict interpretation, or visible rationale from templates. Upload those sources as an editable ZIP and let KB compile the final Wiki, integrate human context, maintain citations/navigation, and incrementally update affected pages. Never use `kb +import` for this workflow: a read-only snapshot cannot provide this source lifecycle.
21
23
 
22
24
  ## Company-only target and permission boundary
23
25
 
@@ -34,7 +36,7 @@ The KB description is part of Agent auto-loading and source selection, not a cas
34
36
  For example, using a fictional project name:
35
37
 
36
38
  ```text
37
- 示例项目的已认证资产语义知识库,帮助 Agent 在分析前查阅业务域、资产口径、SQL 报表含义和治理边界。
39
+ 示例项目已认证资产项目语义知识库,用于辅助 Agent 在分析前召回业务域、资产口径、SQL 报表语义和治理边界。
38
40
  ```
39
41
 
40
42
  ```bash
@@ -45,11 +47,32 @@ node "$KB_RUN" +new --name '<company_kb_name>' \
45
47
  --project-id <project_id> --project-name '<project_name>' --host <host>
46
48
  ```
47
49
 
48
- The wrapper executes the installed `ae-cli`. Directory APIs lack a scope parameter, so it verifies the ZIP source belongs to the company KB before mutation. Permission denial stops the flow. An explicitly requested personal test uses the project CLI directly with `--scope personal` on scope-aware commands; this is never a permission fallback. Personal test KB creation follows the same description rule and must still use a business-facing description.
50
+ The wrapper executes the matching project/package CLI when present; standalone installed Skills retain `ae-cli` from PATH. Directory APIs lack a scope parameter, so it verifies the ZIP source belongs to the company KB before mutation. Permission denial stops the flow. An explicitly requested personal test uses the project CLI directly with `--scope personal` on scope-aware commands; this is never a permission fallback. Personal test KB creation follows the same description rule and must still use a business-facing description.
51
+
52
+ ## Preset initialization, reuse and release acceptance
53
+
54
+ The canonical directly uploadable rules are `scripts/project-semantic-knowledge-wiki/default-compile-schema.md`. Maintain this user-visible document in Chinese while retaining literal paths and protocol field names. It defines durable compilation behavior, not project-specific facts. Review and AI-validate the exact preset bytes once before releasing a preset version; keep its hash and report as acceptance evidence. Do not run AI validation for every KB initialization or source refresh. Retain deterministic format, revision, content-hash, permissions and current-formal-hash checks.
55
+
56
+ `prepare-compile-schema.mjs` never applies rules or compiles. It returns `reuse` only after status and downloaded formal bytes agree that rules are valid. A pending new KB can contain a default placeholder even when no effective rules exist; preparation uploads the preset as a candidate and returns `review_import` with `compile_ready=false`. Download errors other than explicit missing-file errors, busy/recovery/review states and invalid established rules are terminal. Use a stable `--request-id` when resuming the same initialization; do not create a second candidate after an uncertain write.
57
+
58
+ For `review_import`, use the returned stable candidate ID with the project/package CLI. Read the entire candidate, full current-schema diff and any advisories. Then explicitly apply using the current revision, candidate hash and formal hash from that diff:
59
+
60
+ ```bash
61
+ ae-cli kb +schema-import-content --import-id <returned_id> --host <host>
62
+ ae-cli kb +schema-import-diff --import-id <returned_id> --baseline current-schema --host <host>
63
+ ae-cli kb +schema-import-apply --import-id <returned_id> --revision <current_revision> \
64
+ --hash <candidate_hash> --schema-hash <formal_hash_from_diff> --request-id <apply_id> --host <host>
65
+ ```
66
+
67
+ Only if the diff reports formal absence use `--schema-absent` instead of `--schema-hash`. New KB placeholders are present files and require their actual hash. `--report-id` is optional; old callers may still supply it. A successful application must have `status=applied` with no settlement/recovery pending. Read status and formal bytes again before compilation. `BASE_CHANGED` requires a fresh review, never automatic hash refresh/replay. Do not overwrite valid custom rules just because their hash differs from the preset.
68
+
69
+ Preset release acceptance explicitly uses `ae-cli kb +schema-import-validate --import-id <id> --revision <revision> --hash <hash> --request-id <validation_id> --host <host>`, followed by `+schema-import-status` until the exact candidate has a complete passing report. Validate changed preset bytes again; do not carry a report across hashes. Keep this authoring check separate from the normal KB lifecycle. Test a first full publication and a real changed-source incremental publication with unchanged formal bytes.
70
+
71
+ Compatibility: existing explicit `company-kb.mjs +schema --custom-instructions-file default-compile-rules.md` remains supported for user-requested rule generation. `default-compile-rules.md` is legacy generation guidance, not the normal preset input. Old commands, scopes and model parameters are retained; no new Skill is introduced. Servers that still require per-candidate AI reports cannot use the fast application path and must be reported as unsupported until their contract is upgraded; do not silently fall back to generation.
49
72
 
50
73
  ## User-selected model
51
74
 
52
- Resolve the requested model with `ae-cli agent +list-models --host <host>` and retain its exact Model.id. Pass the same `--model <model_ref>` to Schema and compile, including incremental refreshes. Stop if the requested model is unavailable or ambiguous.
75
+ Resolve the requested model with `ae-cli agent +list-models --host <host>` and retain its exact Model.id. Pass the same `--model <model_ref>` to compilation, including incremental refreshes. AI rule validation is a separate preset-release acceptance step and accepts a model only when explicitly requested. Stop if the requested model is unavailable or ambiguous.
53
76
 
54
77
  ## Source directory contract
55
78
 
@@ -64,6 +87,11 @@ sources/
64
87
  reports/
65
88
  metrics/
66
89
  metadata/
90
+ personal-semantics/
91
+ background/
92
+ preference/
93
+ experience/
94
+ asset-context/
67
95
  business/
68
96
  meetings/
69
97
  decisions/
@@ -71,26 +99,40 @@ sources/
71
99
  references/
72
100
  ```
73
101
 
74
- CLI-managed asset facts go only under `sources/assets/**`. Human material goes under the other top-level categories. Asset refreshes may add, replace, or remove files owned by the generated asset package; they must not delete user material in `project/`, `business/`, `meetings/`, `decisions/`, `corrections/`, or `references/`.
102
+ CLI-managed asset facts go only under `sources/assets/**`. Adopted personal semantics exported by Common go under `sources/personal-semantics/**` by their `context_type`: `background`, `preference`, `experience`, or `asset_context` (`asset-context` path). Human material goes under the other top-level categories. Asset refreshes may add, replace, or remove files owned by the generated asset package under `sources/assets/**` and `sources/personal-semantics/**`; they must not delete user material in `project/`, `business/`, `meetings/`, `decisions/`, `corrections/`, or `references/`.
75
103
 
76
104
  The intended compiled Wiki is organized by consumption, not by raw file shape:
77
105
 
78
106
  ```text
79
107
  index.md
80
- wiki/project/
108
+ wiki/project-overview.md
109
+ wiki/common/
81
110
  wiki/domains/
82
- wiki/semantics/
83
- wiki/assets/
84
- wiki/decisions/
85
- wiki/review/
111
+ wiki/asset-index/
112
+ wiki/event-map/
113
+ wiki/governance/
86
114
  ```
87
115
 
88
116
  The source tree only classifies material. Authority still comes from explicit facts: decisions require confirmer, status, date, and scope; corrections require target, corrected content, reason, date, and scope.
89
117
 
90
118
  ## First build: precompiled Markdown sources and KB compilation
91
119
 
92
- 1. Export one complete schema 3.0 governed asset package with `ae-cli project-semantic asset-package export --project-id <project_id> --asset-scope governed --output <package> --host <host>`. Require `truncated=false` and authenticated entry/dependency closure. Use `all_visible` only on explicit user request.
93
- 2. Preserve the local planning and rendering stages. Read the compact knowledge indexes, including dashboard notes, and only the normalized details needed for ambiguous grouping, conflicts, SQL semantics, and recall-card choices. Author one snapshot-bound plan using [`project_semantic_knowledge_wiki_plan_schema.md`](project_semantic_knowledge_wiki_plan_schema.md). This is the run's only Agent synthesis pass. Do not create the plan with a generic script. If many summaries share the same template with only names or fields changed, discard the plan and have the Agent reread the relevant asset definitions.
120
+ 1. Export one complete schema 3.0 governed asset package with `ae-cli project-semantic asset-package export --project-id <project_id> --asset-scope governed --output <package> --host <host>`. Require `truncated=false` and authenticated entry/dependency closure. Use `all_visible` only on explicit user request. The export always includes current `ADOPTED` personal semantics for this project in `sources/adopted-personal-semantics.jsonl`; do not add a switch to exclude them and do not run a second personal-semantic export.
121
+ If the governed dashboard, report, and metric catalogs and adopted personal semantics are all empty, this is a valid new-project initialization. Do not ask the user to choose between an empty skeleton and all visible assets. Do not switch to `all_visible` or invent business facts. Run the empty-skeleton builder below, upload its ZIP through the same company-only wrapper, prepare/apply the preset as described below, compile full, and read back the project overview and governance boundary. Skip the semantic planning and normal builder steps below in this case. Resolve the model and company KB target as usual before upload.
122
+
123
+ ```bash
124
+ node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-empty-skeleton.mjs \
125
+ --asset-package <tmp>/project-assets --output <tmp>/empty-skeleton \
126
+ --project-name '<project_name>'
127
+ node "$KB_RUN" +add --name '<company_kb_name>' \
128
+ --files '["<tmp>/empty-skeleton/empty-skeleton.zip"]' --host <host>
129
+ node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/prepare-compile-schema.mjs \
130
+ --name '<company_kb_name>' --host <host> --output '<new-formal-rules-file>' --request-id '<initialization-id>'
131
+ # If review_import is returned, review and apply the candidate below before compilation.
132
+ # Wait for generated Schema status, then compile.
133
+ node "$KB_RUN" +compile --name '<company_kb_name>' --mode full --model <model_ref> --host <host>
134
+ ```
135
+ 2. Preserve the local planning and rendering stages. Read the compact knowledge indexes, including dashboard notes, the adopted personal semantic source file, and only the normalized details needed for project positioning, business objects, object relationships, judgment chains, ambiguous grouping, conflicts, SQL semantics, personal context fusion, and recall-card choices. Author one snapshot-bound plan using [`project_semantic_knowledge_wiki_plan_schema.md`](project_semantic_knowledge_wiki_plan_schema.md). This is the run's only Agent synthesis pass. Do not create the plan with a generic script. Do not hardcode project names, business domains, asset IDs, event names, metric names, personal-semantic conclusions, or example decision chains into the workflow; examples are illustrative only, and the Agent must derive the current project's model from the current package. If many summaries share the same template with only names or fields changed, discard the plan and have the Agent reread the relevant asset definitions.
94
136
  3. Render the locally precompiled material for review and generate Markdown sources. The review ZIP is a local artifact; upload the source ZIP from the next step:
95
137
 
96
138
  ```bash
@@ -103,7 +145,7 @@ The source tree only classifies material. Authority still comes from explicit fa
103
145
  ```
104
146
 
105
147
  When the exported package is `asset_scope=all_visible`, pass `--allow-all-visible` to the builder. Do not pass this flag unless the user explicitly requested all visible assets.
106
- 4. Review the local asset meanings, SQL summaries, domains, conflicts, and recall cards. Business-domain sources must contain the short `Agent 使用摘要` for first-hop routing: primary analysis goals, preferred entries, main events, main metrics, drilldown dimensions, and boundaries. SQL report sources must also use one `Agent 使用摘要`, but that single section must contain the complete Agent-authored SQL semantics: purpose, parameters, output fields, grain, filters, limits, question boundaries, and evidence locator. This section must be business language an Agent can use directly, not parser labels such as `SQL 输出字段`, `来源表达式`, `${Selector:...}`, `${PartDate:...}`, `C00`, or raw SQL fragments. All business analysis should be completed here; missing evidence remains explicitly unknown. Precompile affected assets and their dependent domains/cards only on refresh; reuse unchanged semantic plan entries.
148
+ 4. Review the local project business model, domain judgment models, asset meanings, SQL summaries, adopted personal-semantic fusion, domains, conflicts, and recall cards. The project overview must start with business positioning, business objects, object relationships, judgment chains, and non-goals; asset counts and snapshot metadata come later. Business-domain sources must contain the judgment model plus the short `Agent 使用摘要` for first-hop routing: business state judged, objects, signals, decision path, asset roles, primary analysis goals, preferred entries, main events, main metrics, drilldown dimensions, and boundaries. Adopted personal semantics must be fused by type: `background` can enrich project background and domain context, `preference` can shape preferred routing and answer style, `experience` can add proven analysis heuristics and caveats, and `asset_context` can annotate concrete reports/dashboards/metrics only when the referenced asset still exists. Preserve the source person's display name and source/update time from the payload in the local source page provenance; never expose backend identifiers such as `open_id` in KB Markdown. Non-SQL report summaries must not repeat the same generated sentence as both purpose and applicable question; they should expose the report's business use, usable questions, metrics/outputs, drilldown dimensions, filters and boundaries from structured asset evidence, and use "return to source report to confirm" wording for missing fields instead of parser-style `未识别/未发现` placeholders. SQL report sources must also use one `Agent 使用摘要`, but that single section must contain the complete Agent-authored SQL semantics: purpose, parameters, output fields, grain, filters, limits, question boundaries, and evidence locator. This section must be business language an Agent can use directly, not parser labels such as `SQL 输出字段`, `来源表达式`, `${Selector:...}`, `${PartDate:...}`, `C00`, raw SQL fragments, or visible build-process phrases such as `CLI Agent 基于同一资产快照生成`, `摘要来源`, `semantic_plan`, `builder`, `parser fallback`. All business analysis should be completed here; missing evidence remains explicitly unknown. Precompile affected assets, personal-semantic source pages, and their dependent domains/cards only on refresh; reuse unchanged semantic plan entries.
107
149
  5. Package the builder's Markdown sources. Raw JSON indexes and raw SQL remain in the local review/evidence package; the KB input contains the precompiled meanings and structured calculation facts.
108
150
 
109
151
  Package the builder's prepared Markdown sources into the source tree:
@@ -120,28 +162,45 @@ Then upload and run KB compilation:
120
162
 
121
163
  ```bash
122
164
  node "$KB_RUN" +add --name '<company_kb_name>' --files '["<new-archive>.zip"]' --host <host>
123
- node "$KB_RUN" +schema --name '<company_kb_name>' --model <model_ref> \
124
- --custom-instructions-file skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md --host <host>
125
- node "$KB_RUN" +status --name '<company_kb_name>' --host <host>
126
- # Run only after schema generation succeeds.
165
+ node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/prepare-compile-schema.mjs \
166
+ --name '<company_kb_name>' --host <host> --output '<new-formal-rules-file>' --request-id '<initialization-id>'
167
+ # review_import requires full candidate/diff review and explicit application; reuse is already compile-ready.
127
168
  node "$KB_RUN" +compile --name '<company_kb_name>' --mode full --model <model_ref> --host <host>
128
169
  ```
129
170
 
130
- Poll `+status`; never poll by resubmitting Schema. Schema/compile failure stops the flow; do not switch to snapshot import. Start with a few representative assets before attempting the complete package.
171
+ Poll `+status`; never poll by generating Schema again. Rule initialization or compilation failure stops the flow; do not switch to snapshot import. Start with a few representative assets before attempting the complete package.
131
172
 
132
173
  ## Refresh: update changed Markdown sources
133
174
 
134
- Regenerate the local Wiki using the existing semantic-plan contract. Use normalized content hashes from the builder's upload manifests so snapshot-only header changes do not rewrite every asset:
175
+ When refreshing an empty skeleton, export a fresh governed package first. If both source classes are still empty, do not rewrite or recompile an unchanged skeleton. If governed entry assets have appeared, synthesize the first evidence-based semantic plan and run the normal builder. Read the skeleton's remote `sources/project/<namespace>-refresh-state.md` and pass it to the source-tree packager as `--previous-refresh-state`. Its taxonomy version intentionally differs from the populated Wiki, so the packager requests `compile_mode=full` and explicit rule-compatibility review. Reuse valid compatible rules; do not regenerate Schema. Apply the resulting add/replace/remove actions to the existing company ZIP with revision checks, including removal of obsolete empty-state sources; preserve human sources and unrelated ZIP paths. Never create a second KB or reuse the empty skeleton's unknown statements as business facts. If only adopted personal semantics appear while entry assets remain empty, do not run the asset builder or claim the skeleton is current; report that the personal-only source path is not yet supported.
176
+
177
+ Regenerate the local Wiki using the existing semantic-plan contract. On refresh, reuse unchanged semantic-plan entries and unchanged adopted-personal-semantic fusion entries instead of asking the Agent to rewrite them. The builder persists the reusable semantic plan and fragment-level state in `sources/project/<namespace>-refresh-state.md`, and records each Markdown source's fragment dependencies. A changed recall card, SQL summary, domain model, adopted personal semantic, appendix, or project model affects only sources that reference that fragment; never treat the whole semantic-plan file hash as a full-source rewrite trigger. When the asset package snapshot hash changes but the existing plan is intentionally reused, pass `--allow-semantic-plan-snapshot-drift`; the builder still validates current project, domain, asset, adopted personal semantic, recall-card and SQL-report references against the new package and stops if the closure no longer matches. Do not use this flag for first build or to bypass real asset additions/removals. Use normalized content hashes from the builder's upload manifests so snapshot-only header changes do not rewrite every asset:
178
+
179
+ ```bash
180
+ node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs \
181
+ --asset-package <tmp>/project-assets-next \
182
+ --semantic-plan <previous-or-updated-semantic-plan.json> \
183
+ --output <next>/project-semantic-wiki \
184
+ --archive <next>/project-semantic-wiki.zip \
185
+ --project-name '<project_name>' \
186
+ --allow-semantic-plan-snapshot-drift
187
+ ```
135
188
 
136
189
  ```bash
137
190
  node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs \
138
191
  --source-dir <next>-kb-upload-sources \
139
192
  --tree-output <next>-kb-source-tree \
140
193
  --manifest-output <next>-kb-source-tree-manifest.json \
141
- --previous-manifest <previous>-kb-source-tree-manifest.json
194
+ --previous-refresh-state <remote-refresh-state.md> \
195
+ --embed-refresh-state-baseline \
196
+ --baseline-source-id <zip_source_id> \
197
+ --baseline-content-revision <current_content_revision> \
198
+ --baseline-published-version-id <published_version_id>
142
199
  ```
143
200
 
144
- The returned plan contains add/replace/remove actions and unchanged paths under `sources/...`, with `skip` or `incremental` compilation. Do not replace an existing ZIP parent. Before each write, verify the remote bytes still match the last applied local baseline; preserve unexpected manual edits and stop on conflicts. Retain unchanged baseline bytes and update the persisted source-tree manifest only after successful application. If interrupted, reconcile remote bytes before resuming. Compare by the stable ZIP-relative `sources/...` path; when the previous local files are unavailable, discover current paths with paginated `+source-ls` and compare via `+source-read`. Do not replace the ZIP parent or re-upload every file. Do not run the old flat-source uploader or `plan-kb-source-sync.mjs`.
201
+ The normal refresh baseline is remote managed state, not the local filesystem. Read `+list-sources` once to get the ZIP source ID and current `contentRevision`, then read the small `sources/project/<namespace>-refresh-state.md` index. For schema `2.0`, read each listed `-part-NNN.md` into the same local directory using the exact filenames; never read the whole ZIP or concatenate the parts in an Agent tool response. The packager verifies each part, the complete payload, and the stored manifest before planning changes. A legacy single-file base64 state remains readable. The state contains the previous semantic plan, fragment state, source-tree manifest, source ID, content revision, published version ID, and manifest hash. If `contentRevision` matches the saved baseline, use `--previous-refresh-state` and compare against the saved source-tree manifest; do not page through every remote file and do not run full `+source-read` over the ZIP. A machine-state-only migration can advance the ZIP revision without changing business sources. If the revision differs, treat the baseline as potentially stale but still start from `--previous-refresh-state`; verify only paths that would be written or removed before mutating them, and escalate to a full source-tree read only when the refresh state is missing, corrupt, or cannot explain the required conflict check. A local `<previous>-kb-source-tree-manifest.json` with `--previous-manifest` is a compatibility fallback for manual repair runs, not the scheduled path.
202
+
203
+ The returned plan contains add/replace/remove actions and unchanged paths under `sources/...`, with `skip` or `incremental` compilation. Adopted personal semantics use the same source-tree manifest, stable ZIP-relative paths, content hashes, conflict checks, and add/replace/remove actions as asset sources; do not maintain a separate personal-semantic delta file or a second upload flow. When a previously adopted personal semantic is edited, its review status becomes `NONE`, it disappears from the next adopted source export, and the next refresh removes or rewrites only the generated paths whose fragment dependency points to that source. `--previous-tree-root` lets a repair run re-hash the last applied local baseline with the current normalizer, so harmless compiler/normalization-rule changes do not create a one-time false delta. Do not replace an existing ZIP parent. Before each write, verify the target remote bytes still match the action's `previous_content_hash`; for the v2 index and part files this is the raw file SHA-256, while legacy sources use the existing normalized content hash. Preserve unexpected manual edits and stop on conflicts. Apply the index and every listed part action; a machine-state-only change keeps `compile_mode=skip`. Compare by the stable ZIP-relative `sources/...` path. Do not replace the ZIP parent or re-upload every file. Do not run the old flat-source uploader or `plan-kb-source-sync.mjs`.
145
204
 
146
205
  For each changed path, obtain the current revision and perform one existing command through the wrapper:
147
206
 
@@ -153,11 +212,11 @@ node "$KB_RUN" +source-rm --name '<company_kb_name>' --id <zip_source_id> \
153
212
  --path <removed-generated-path> --expected-revision <revision> --host <host>
154
213
  ```
155
214
 
156
- Only remove files owned by this generated asset package. Preserve unrelated source material and unexpected manual edits; stop on conflicts. Keep deletion confirmation unless the exact refresh deletion scope is already authorized. Execute sequentially using returned revisions; a 409 requires fresh discovery and review, not blind retry. Failed writes stop compilation. On resume, compare current remote bytes again so already successful writes are not replayed. Unchanged files are not written. Apply changed Markdown manifest/index sources from the plan too; keep the JSON sync manifest local.
215
+ Only remove files owned by this generated asset package. Preserve unrelated source material and unexpected manual edits; stop on conflicts. Keep deletion confirmation unless the exact refresh deletion scope is already authorized. Execute sequentially using returned revisions; a 409 requires fresh discovery and review, not blind retry. Failed writes stop compilation. On resume, compare current remote bytes again so already successful writes are not replayed. Unchanged files are not written. Apply changed Markdown manifest/index sources from the plan too; keep the JSON sync manifest local. A refresh-state-only baseline update is a managed-state write and does not by itself require compilation.
157
216
 
158
- After all source-tree changes succeed, call `+compile --mode incremental --model <model_ref>` exactly once. Reuse the existing Schema. Do not force full compilation based only on file count or percentage. No file changes means skip compilation unless the user explicitly requests rebuilding or compiler rules have changed. Schema/authority/taxonomy rule changes require an explicit rebuild decision; normal source updates do not.
217
+ After all source-tree changes succeed, use the source-tree packager's `compile_mode`. `skip` needs no preparation, upload, AI validation or compilation unless explicitly requested. Otherwise run `prepare-compile-schema.mjs` with a fresh output path: valid formal rules return `schema_action=reuse` and `compile_ready=true` without generation, upload, application or AI validation. Call `+compile --mode incremental --model <model_ref>` once for `incremental`, or `+compile --mode full --model <model_ref>` once for `full`. A full rebuild, source-change volume or navigation migration does not trigger Schema generation. `navigation_taxonomy_migration.requires_schema_review=true` requires checking that the formal rules support the new navigation; an incompatible older preset needs an explicit reviewed rule upgrade, never automatic replacement. The legacy `requires_schema_force` field remains false; legacy `schema_force_reasons` explain full-build reasons only. Preserve human sources and unrelated ZIP paths. Normal content updates still use incremental mode.
159
218
 
160
- Compiled navigation must stay decision-oriented. The generated Wiki homepage should not list every report/dashboard file or bare numeric IDs. It should link to modules, business domains, recall cards, category indexes, governance/review pages, and a small set of representative titled entries only. Individual assets belong in their category index or domain context, with title-first link text and IDs as supporting identity.
219
+ Compiled navigation must follow the five layers: project overview, shared project knowledge, business domains, event and asset catalog, and governance with provenance. Recall cards belong under domains. The homepage should contain a small set of representative titled entries only, not every report/dashboard file or bare numeric IDs. Individual assets belong in their category index or domain context, with title-first link text and IDs as supporting identity. Public event groups are lookup indexes, not business domains.
161
220
 
162
221
  ## Acceptance and readback
163
222
 
@@ -171,7 +230,7 @@ node "$KB_RUN" +grep --name '<company_kb_name>' --query '<business question or m
171
230
  node "$KB_RUN" +read --name '<company_kb_name>' --path '<path copied from index or grep>' --host <host>
172
231
  ```
173
232
 
174
- Do not assume the old local Wiki layout. Inspect actual server paths. Check asset IDs, SQL/calculation fidelity, certification, missing facts, cross-source conflict handling and provenance. Smoke-test a representative reusable asset. After refresh, verify additions, changed current definitions, removal of obsolete assertions and preservation of unchanged facts. Historical definitions may remain only when explicitly marked historical and evidenced. Publish statistics such as `reusedPages` are evidence; incremental mode alone does not prove lower model cost.
233
+ Do not assume the old local Wiki layout. Inspect actual server paths. Check the project overview can answer: what business system this project observes, who uses it, what business objects exist, how objects relate, what decision chains exist, which assets attach to each chain, and what cannot be answered without live execution. Then check domain judgment models, asset IDs, SQL/calculation fidelity, certification, missing facts, cross-source conflict handling and provenance. Smoke-test a representative reusable asset. After refresh, verify additions, changed current definitions, removal of obsolete assertions and preservation of unchanged facts. Historical definitions may remain only when explicitly marked historical and evidenced. Publish statistics such as `reusedPages` are evidence; incremental mode alone does not prove lower model cost.
175
234
 
176
235
  Report target scope/name, requested model, ZIP source ID/revision, compile status/version, source counts and quality findings. Record observed compile duration and usage; small-sample success does not prove a full package will stay below turn limits.
177
236
 
@@ -190,13 +249,13 @@ canonical_asset_id: report:1234 | null
190
249
 
191
250
  - `authenticated=true` maps only to `certification_state=certified`; it never overrides a definition conflict. In explicit `all_visible` mode, unauthenticated assets remain visible as `certification_state=uncertified` and must not be described as approved/governed semantics.
192
251
  - A detectable conflict always yields `runtime_policy=block` and `standalone_recall=false` until reviewed.
193
- - An unauthenticated child retained through a certified parent is `dependency_only`; it can support its parent but cannot independently become the answer.
252
+ - An unauthenticated child retained through a certified parent is `dependency_only`; its verified definition and dependencies may answer definition or relationship questions. It cannot independently establish a business state or current number. When direct retrieval is unavailable, inspect the authorized parent and state the remaining gap.
194
253
  - Technical appendix, duplicate, demo, reproduction, and targeted-diagnostic assets are blocked from standalone recall.
195
254
  - Ranking order is: project/permission/status filter -> recall card -> canonical and valid assets -> certification -> semantic relevance and usage. Raw evidence never participates in first-round broad recall.
196
255
 
197
256
  ## SQL report rules
198
257
 
199
- Every SQL report requires structured semantics grounded in the packaged SQL and parameters. The compiled Wiki must include one CLI Agent-authored `## Agent 使用摘要` for every SQL report. That single section is the primary SQL business source; do not create a second SQL-specific summary section. The local review retains `sql_semantic_facts` and raw SQL for audit. KB consumes the precompiled meanings and only reopens analysis for concrete inconsistencies or new human evidence. Apply `default-compile-rules.md` to preserve:
258
+ Every SQL report requires structured semantics grounded in the packaged SQL and parameters. The compiled Wiki must include one CLI Agent-authored `## Agent 使用摘要` for every SQL report. That single section is the primary SQL business source; do not create a second SQL-specific summary section. The local review retains `sql_semantic_facts` and raw SQL for audit. KB consumes the precompiled meanings and only reopens analysis for concrete inconsistencies or new human evidence. Apply the durable `default-compile-schema.md` preset to preserve:
200
259
  - business purpose;
201
260
  - input parameters and their meaning;
202
261
  - output fields;
@@ -211,4 +270,4 @@ The builder rejects a plan that omits any SQL report or contains mechanically ge
211
270
 
212
271
  ## Existing flat-source knowledge bases
213
272
 
214
- Do not automatically migrate existing flat sources or read-only snapshots. Keep existing user material and resolve a separate migration scope when necessary. Source-tree refresh uses the recorded ZIP source ID and directory mutations above.
273
+ For an existing managed source-tree knowledge base, `navigation_taxonomy_version` missing or below `2.0` triggers the full Wiki rebuild on its next refresh. Source-tree refresh uses the recorded ZIP source ID and directory mutations above; it never deletes human-authored sources. Read-only snapshots and unmanaged flat sources have no verified managed baseline and must be reviewed separately before migration.
@@ -1,12 +1,52 @@
1
1
  # Project semantic knowledge Wiki plan
2
2
 
3
- The Agent authors exactly one plan per asset-package snapshot. The builder validates every referenced asset against the package.
3
+ The Agent authors exactly one plan per asset-package snapshot. The builder validates every referenced asset against the package. New plans must fill `recall_cards[].routing` from verified evidence. Older 2.0 plans without routing still compile with a conservative domain fallback; branches may only target assets already listed in that card's preferred or fallback references.
4
4
 
5
5
  ```json
6
6
  {
7
7
  "schema_version": "2.0",
8
8
  "source_snapshot_hash": "<asset package snapshot_hash>",
9
9
  "generation_method": "agent_semantic_synthesis",
10
+ "project_business_model": {
11
+ "business_positioning": "该项目观察的业务系统、服务对象和决策范围。必须从当前资产包证据归纳,不得写项目特化模板。",
12
+ "audience_roles": ["会使用这个项目做业务判断的角色"],
13
+ "business_objects": [
14
+ {
15
+ "object_id": "stable-object-id",
16
+ "name": "业务对象名称",
17
+ "meaning": "对象在本项目中的业务含义",
18
+ "evidence_refs": [
19
+ {"resource_type": "dashboard", "resource_key": "1234"}
20
+ ]
21
+ }
22
+ ],
23
+ "object_relationships": [
24
+ {
25
+ "from_object": "业务对象A",
26
+ "to_object": "业务对象B",
27
+ "relationship": "两个对象如何形成判断链路",
28
+ "evidence_refs": [
29
+ {"resource_type": "report", "resource_key": "5678"}
30
+ ]
31
+ }
32
+ ],
33
+ "decision_chains": [
34
+ {
35
+ "chain_id": "stable-chain-id",
36
+ "title": "业务判断链路名称",
37
+ "decision_question": "这条链路帮助用户判断什么",
38
+ "signals": ["判断信号、指标、状态或维度"],
39
+ "decision_steps": ["先看什么", "再看什么", "如何下钻或停止"],
40
+ "preferred_domain_ids": ["domain-id"],
41
+ "asset_refs": [
42
+ {"resource_type": "dashboard", "resource_key": "1234"}
43
+ ],
44
+ "requires_live_execution": true,
45
+ "boundaries": ["不能由知识库直接回答的边界"]
46
+ }
47
+ ],
48
+ "non_goals": ["本知识库不承载的内容"]
49
+ },
10
50
  "domains": [
11
51
  {
12
52
  "domain_id": "stable-lowercase-id",
@@ -19,6 +59,20 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
19
59
  "drilldown_dimensions": [
20
60
  "Agent 总结的常用下钻维度、字段 key 和使用场景;不要写缺少业务解释的技术字段。"
21
61
  ],
62
+ "domain_judgment_model": {
63
+ "business_state_judged": "这个业务域判断什么业务状态",
64
+ "main_objects": ["涉及的业务对象"],
65
+ "signals": ["这个域使用的判断信号"],
66
+ "decision_path": ["域内判断步骤"],
67
+ "asset_attachment_logic": [
68
+ {
69
+ "asset_ref": {"resource_type": "dashboard", "resource_key": "1234"},
70
+ "role": "primary_entry | supporting_evidence | drilldown | exclusion",
71
+ "reason": "为什么这个资产挂在该业务判断链路上"
72
+ }
73
+ ],
74
+ "boundaries": ["这个域不能直接回答或必须实时执行的边界"]
75
+ },
22
76
  "merge_rationale": "跨物理空间归并或拆分的证据",
23
77
  "dashboard_ids": ["dashboard resource_key"],
24
78
  "recall_cards": [
@@ -34,6 +88,21 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
34
88
  }
35
89
  ],
36
90
  "fallback_asset_refs": [],
91
+ "routing": {
92
+ "applicable_when": "问法、对象与范围何时适用本卡",
93
+ "answer_grain": "答案对象与统计粒度",
94
+ "required_parameters": ["时间范围或过滤参数"],
95
+ "branches": [
96
+ {
97
+ "when": "满足哪种已核验的问法和口径",
98
+ "asset_refs": [{"resource_type": "dashboard", "resource_key": "1234", "reason": "分支采用该资产的证据"}],
99
+ "reason": "为什么该分支使用这些资产"
100
+ }
101
+ ],
102
+ "stop_when": "何时已取得足够且权威的最小证据",
103
+ "fallback_when_unavailable": "无匹配、冲突、权限不可用时如何回到域内筛选或说明缺口",
104
+ "evidence_boundary": "不可互替口径、当前数值执行与证据强度边界"
105
+ },
37
106
  "excluded_asset_refs": [
38
107
  {
39
108
  "resource_type": "report",
@@ -48,6 +117,27 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
48
117
  ]
49
118
  }
50
119
  ],
120
+ "personal_semantic_integrations": [
121
+ {
122
+ "integration_id": "stable-personal-semantic-integration-id",
123
+ "context_type": "background | preference | experience | asset_context",
124
+ "source_ids": ["personal_semantic:42"],
125
+ "title": "融合后的项目语义标题",
126
+ "project_usage": "这组个人语义如何被项目知识库消费",
127
+ "integration_target": {
128
+ "target_type": "project | domain | asset | recall_card",
129
+ "target_id": "project, domain_id, resource_key, or card_id"
130
+ },
131
+ "source_people": [
132
+ {
133
+ "owner_name": "source owner display name from payload",
134
+ "updated_at": "source update time from payload"
135
+ }
136
+ ],
137
+ "conflict_policy": "compatible | scoped | blocked",
138
+ "boundaries": ["适用范围、冲突或必须回源确认的边界"]
139
+ }
140
+ ],
51
141
  "appendices": [
52
142
  {
53
143
  "appendix_id": "technical-or-temporary-assets",
@@ -82,7 +172,14 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
82
172
  ## Rules
83
173
 
84
174
  - Every dashboard occurs exactly once across `domains[].dashboard_ids` and `appendices[].dashboard_ids`.
175
+ - `project_business_model` is required. It must explain how the project observes business before listing assets: positioning, audience roles, business objects, object relationships, decision chains, and non-goals.
176
+ - `project_business_model` and every `domain_judgment_model` must be derived from current asset-package evidence. Do not hardcode project names, business domains, asset IDs, event names, metric names, or example decision chains into the workflow.
177
+ - Every business object, object relationship and decision chain must cite concrete `dashboard`, `report`, or `metric` refs from the current package. A decision chain must reference existing domain IDs and explain when live execution is required.
178
+ - Adopted personal semantic integrations must cite concrete `personal_semantic:<id>` source IDs from `sources/adopted-personal-semantics.jsonl`. Group and fuse them by `context_type`: `background`, `preference`, `experience`, and `asset_context`.
179
+ - `asset_context` integrations must target an existing dashboard, report, metric, domain, or recall card. If the referenced asset no longer exists, do not attach the personal semantic to a live asset page; mark the integration as blocked or scoped historical context.
180
+ - Personal semantic integrations are project context, routing preferences, heuristics, or asset annotations. They do not override governed project semantic records, current asset definitions, SQL/calculation facts, or live query results unless an explicit correction/decision source gives that authority.
85
181
  - Domain titles represent business retrieval topics, not physical dashboard-space names.
182
+ - Every domain has one `domain_judgment_model` describing the business state judged, objects, signals, decision path, asset roles and boundaries. A domain that only lists questions, events, metrics, dimensions and assets is not acceptable.
86
183
  - Every domain has at least one recall card. Preferred and fallback refs must belong to that domain's dashboard/report closure or be a reusable metric directly referenced by it.
87
184
  - Every excluded ref names a concrete reason. A duplicate should name its canonical resource when known.
88
185
  - Every SQL report in the package has exactly one `sql_report_semantics` row. Unknown evidence is represented explicitly; it is never filled from the title.
@@ -90,4 +187,5 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
90
187
  - `sql_report_semantics[].evidence_locator` exactly equals that report's packaged `source_detail_path`; never cite an external or guessed SQL definition.
91
188
  - A SQL report with `definition_state=valid` has at least one output field, one applicable question and one non-applicable question. Use `unknown` when those boundaries cannot be proven.
92
189
  - Visible SQL fields must use business names and meanings. Do not expose parser/debug terms such as `SQL 输出字段`, `来源表达式`, `${Selector:...}`, `${PartDate:...}`, `where 条件`, `order by`, or operator codes.
190
+ - The generated Markdown must not expose build-process markers such as `CLI Agent 基于同一资产快照生成`, `摘要来源`, `semantic_plan`, parser fallback labels, or builder/debug terminology. Keep those only in local artifacts when needed for audit.
93
191
  - The plan contains no query results, customer rows, users, tokens, credentials, or conversation text.
@@ -13,7 +13,9 @@ ae-cli analysis-meta property export --project-id <project_id> --scope event --e
13
13
 
14
14
  Capability id: `metadata.property.export`.
15
15
 
16
- Input: the gateway receives `project_id` plus optional `table_type`, `scope`, `event_name`, `queries`, `fields`, and `authenticated_only`; `output` is local-only.
16
+ Input: the gateway receives `project_id` plus optional `table_type`, `scope`, `event_name`, `queries`, `fields`, `authenticated_only`, and `certification_scope`; `output` is local-only.
17
+
18
+ Use `--certification-scope project|certified|all` consistently with the corresponding list command. The default `project` follows the project switch; `certified` exports only certified assets; `all` exports every accessible asset. This scope never bypasses access permissions.
17
19
 
18
20
  Output: a successful response must prove `complete=true` and `total` equal to the row count before the CLI atomically publishes a private-mode `.json` array.
19
21
 
@@ -9,14 +9,26 @@ Read [`ai_models.md`](ai_models.md) for the single AI-facing model registry. Rep
9
9
  Command:
10
10
 
11
11
  ```bash
12
- ae-cli analysis report create --project-id <project_id> --report-name "Demo" --model-type event --definition '{...}' [--resolutions '<confirmed_resolution_json>'] [--report-desc "..."] [--dashboard-ids "[1001]"]
12
+ ae-cli analysis report create --project-id <project_id> --report-name "Demo" --model-type event --definition '{...}' [--presentation '{"chart_type":"line","table_layout":"date"}'] [--resolutions '<confirmed_resolution_json>'] [--report-desc "..."] [--dashboard-ids "[1001]"]
13
13
  ```
14
14
 
15
15
  When the caller supplies an existing snapshot, optional `--intent-snapshot` accepts `schema_version: 1`, non-empty `requirement`, `definition` and `model_type`. The CLI checks that its definition and model match the submitted values locally; the snapshot is never sent to Gateway.
16
16
 
17
- Input sends `project_id`, `report_name`, `model_type`, `definition`, optional user-confirmed `resolutions`, `report_desc`, `cache_seconds`, `query_duration_ms`, and `dashboard_ids`. `--resolutions` is not supported with `--model-type tag`.
17
+ Input sends `project_id`, `report_name`, `model_type`, `definition`, optional top-level `presentation`, user-confirmed `resolutions`, `report_desc`, `cache_seconds`, `query_duration_ms`, and `dashboard_ids`. `--resolutions` is not supported with `--model-type tag`.
18
18
 
19
- Output is the gateway envelope. `data` contains the created `report_id`, creation status, normalized `model_type`, AI QP `definition`, and optional resolution warnings.
19
+ Omitting `--report-desc` or passing `--report-desc ""` sends `report_desc: ""`, matching analysis-page creation. This default applies only to creation: [`report update`](report_update.md) preserves the saved description when `--report-desc` is omitted, and clears it when explicitly empty.
20
+
21
+ ## Event-report presentation
22
+
23
+ For `model_type=event`, optional `presentation` is separate from `definition`. `chart_type` accepts `line`, `combo`, `bar`, `stacked`, `cumulative`, or `pie`; `table_layout` accepts `date`, `event`, or `group` for the analysis page's result table. The gateway checks compatibility with the saved definition; pie always requires grouping without time comparison. A total-time report supports bar, or pie only when those grouping/comparison conditions hold. Omission leaves page-default/inherited settings. This contract does not expose presentation writes for other models.
24
+
25
+ For `combo`, explicitly set a requested non-total `definition.time_particle_size` such as `day` (omission defaults to `total`), and supply report-level `presentation.series` with metric indexes and bar/line + primary/secondary axes. Read [event-report presentation](event_report_presentation.md) for the version-bound metric binding, subset/reset contract, examples and impact on inherited dashboard trends. It also distinguishes combo from cumulative and corrects the event pie mapping; never use raw graph codes.
26
+
27
+ A table card is a dashboard-level display, not `presentation.chart_type=table` on the source report. To create a table card, create the event report, associate it through `--dashboard-ids` or [`dashboard-report add`](dashboard_report_add.md), then call [`dashboard-report update`](dashboard_report_update.md) with the returned report ID, exact dashboard ID, and `--chart-type table`. Do not insert `graphShape`, `byType`, `reportGraphShape`, or other raw QP/UI fields into the definition or presentation.
28
+
29
+ Saved report definitions follow the filter write boundary in [`ai_models.md`](ai_models.md): one compound group level with leaf-only, non-empty `items`. A deeper tree or empty group is rejected by the capability schema as `INVALID_CAPABILITY_INPUT`; use the returned field path or schema keyword to correct it, and never flatten a deeper tree.
30
+
31
+ Output is the gateway envelope. `data` contains the created `report_id`, creation status, normalized `model_type`, AI QP `definition`, event-report `presentation`, and optional resolution warnings. Card presentation is read separately with `dashboard-report get`.
20
32
 
21
33
  Report creation and its `--validate` / `--dry-run` paths use the same compiler contract. `AI_QP_COMPILE_FAILED` preserves the full structured error array. No report is created on this failure; follow [`metadata_resolution.md`](metadata_resolution.md), keep each bound field's path and original wording, fill confirmed model parameters, and pass `--resolutions` only after user confirmation.
22
34
 
@@ -33,3 +45,5 @@ ae-cli analysis report create --project-id <project_id> --report-name "Recent SQ
33
45
  After creation, keep the `report_id` returned by this exact create response. If the user also requests report data, call `analysis report-data run` directly with the requested value-only `--sql-params` overrides, or omit that flag to use saved defaults. Do not rebuild internal `sqlViewParams` or guess an ID.
34
46
 
35
47
  After any successful report create, call `analysis-meta asset url-get` with that returned `report_id` and output its `markdown_link`.
48
+
49
+ The capability schema includes model-specific nested definition validation. Unknown fields, including nested filter/time-range fields and diagnostic backing fields, are rejected instead of silently ignored. Use canonical snake_case keys and aggregation names such as `user_count`; event report metrics may additionally carry `display_name`. Inspect the report capability itself for the full saved-report definition schema.
@@ -25,6 +25,12 @@ ae-cli analysis report-data export --project-id <project_id> --report-ids '[1001
25
25
 
26
26
  Input also accepts optional `cluster_query_scope` and conditional `slave_cluster_id`. Omit both for current-self data. Resolve allowed physical routes with `analysis query-cluster list`; SQL reports reject `GLOBAL`. Async export has no inline row limit. Runtime defaults to and is capped at 21600 seconds (6 hours); cancel earlier with `analysis query cancel --run-id <run_id>`.
27
27
 
28
+ Path exports contain native graph node and link records. `record_type` distinguishes `node` and `link`; `step` is one-based, and `source`/`target` refer to native node IDs. The saved maximum steps and nodes per step still define the graph, including native More aggregation and wastage links. Export includes every computed node and link without the synchronous `preview_rows` cap.
29
+
30
+ An empty path follows synchronous query semantics: native `PROJECT_NO_DATA` becomes an empty result. Other native failures, including identity and permission failures, still fail the export. JSONL uses `empty` when no data rows were produced, even when a native printer emitted only a header.
31
+
32
+ Saved-report JSONL records (`schema`, `row`, `empty`, `error`) carry `report_id`; each report has an independent schema. CSV batches use `# report_id=...` boundary comments. Empty reports retain an explicit marker instead of disappearing from a mixed batch.
33
+
28
34
  The downloaded report-data artifact contains report rows and per-report markers, not `actual_cluster_query_scope` metadata. Therefore resolve an allowed route first, keep the submitted scope/ID with the run record, and do not infer route from row contents.
29
35
 
30
36
  Timezone contract is identical to `report-data run`: omit `--zone-offset` to match the current user's report UI timezone (falling back to the project default); use an enabled integer from `-12` through `14` for a fixed UTC offset; use `--zone-offset 99` for local-time mode, where rows are not converted to one fixed UTC offset. `99` is a mode identifier, not `UTC+99`, and the option is not persisted.
@@ -14,7 +14,13 @@ Input sends `project_id` and `report_id`.
14
14
 
15
15
  This command reads saved definition metadata and deliberately has no `--use-cache` option. Cache selection applies to `report-data run/export`, not to definition reads.
16
16
 
17
- Output is the gateway envelope. `data` contains `version`, `model_type`, `definition`, report metadata, and dashboard membership in snake_case. Use `data.version` as `--report-version` when updating the same report. Raw frontend `events`, `event_view`, `visual_view`, and raw QP are not returned.
17
+ Output is the gateway envelope. `data` contains `version`, `model_type`, `definition`, report metadata, and dashboard membership in snake_case. Event reports additionally expose separate `presentation` with `chart_type` and `table_layout`. Use `data.version` as `--report-version` when updating the same report. Raw frontend `events`, `event_view`, `visual_view`, and raw QP are not returned.
18
+
19
+ `presentation.chart_type` describes the source report's effective chart under the current definition. `presentation.table_layout` describes its persisted result-table layout when readable; a legacy report without a persisted layout omits it because that setting can be inherited from the browser, not because it is necessarily `date`. For a table card on a specific analysis board, read [`dashboard-report get`](dashboard_report_get.md) with the exact dashboard ID. A raw chart code such as `L0` can coexist with a displayed result table or a dashboard table card; it is not proof of a read failure. Use the semantic response fields, and state unknown/null presentation fields as inherited/unknown rather than inventing values.
20
+
21
+ For an effective trend, presentation also returns `series_scope=report` and per-metric `series` including default styles/axes. Non-default series can make `chart_type=combo` despite native `graphShape=L0`. Match each 1-based series index to this response's `definition.metrics` order, and use its current version for a subsequent source-series write. Read [event-report presentation](event_report_presentation.md) before interpreting or editing combination styles/axes.
22
+
23
+ Reads preserve historical filter trees without flattening, including definitions deeper than the current analysis page can author. Follow the read/write boundary in [`ai_models.md`](ai_models.md): omit `definition` for metadata-only changes, and never feed an unsupported historical tree back as a definition update.
18
24
 
19
25
  For saved tag/cluster filters, `data.definition` preserves `field.type` and the persisted `cluster_date_policy`: `AUTO` means dynamic matching by analysis date, `LATEST` means the latest computed result, and `SPECIFIED` requires `specified_cluster_date`. Do not infer dynamic matching from the tag name or `field.type` alone; if a legacy report has no readable policy, state that the saved date semantics are unknown rather than claiming `AUTO`.
20
26
 
@@ -1,19 +1,19 @@
1
1
  # analysis report list
2
2
 
3
- Use when the user needs to find reports they can access in a project, with optional keyword search, semantic model filtering, field projection, and inline pagination.
3
+ Use when the user needs a directory of reports they can edit or manage in a project, with optional keyword search, semantic model filtering, certification filtering, field projection, and inline pagination. The result includes both self-created and shared reports when effective report-edit permission is present; it excludes shared read-only reports.
4
4
 
5
- Do not use for report data execution or report definition writes. Use `report-data run/export` for data and `report create/update` for writes.
5
+ Do not use for readable asset discovery: use `analysis asset search`, which includes shared read-only reports and dashboards. Do not use for report data execution or report definition writes. Use `report-data run/export` for data and `report create/update` for writes.
6
6
 
7
7
  Command:
8
8
 
9
9
  ```bash
10
- ae-cli analysis report list --project-id <project_id> [--queries '["growth","retention"]'] [--model-types '["event","sql","tag","revenue"]'] [--fields '["report_id","report_name","report_desc","report_model","version"]'] [--limit 50] [--offset 0]
10
+ ae-cli analysis report list --project-id <project_id> [--queries '["growth","retention"]'] [--model-types '["event","sql","tag","revenue"]'] [--fields '["report_id","report_name","report_desc","report_model","version"]'] [--certification-scope project|certified|all] [--limit 50] [--offset 0]
11
11
  ```
12
12
 
13
- Input sends `project_id`, optional `queries`, `model_types`, `fields`, `limit`, and `offset` as snake_case gateway input. `queries` is a JSON array of 1 to 20 non-empty strings with OR semantics; matching rows include `matched_queries` and `matched_fields`. The legacy singular `query` is not accepted. `limit` defaults to 50 and must be 1..200; out-of-range values are rejected rather than silently clamped.
13
+ Input sends `project_id`, optional `queries`, `model_types`, `fields`, `certification_scope`, `limit`, and `offset` as snake_case gateway input. `queries` is a JSON array of 1 to 20 non-empty strings with OR semantics; matching rows include `matched_queries` and `matched_fields`. The legacy singular `query` is not accepted. `limit` defaults to 50 and must be 1..200; out-of-range values are rejected rather than silently clamped.
14
14
 
15
15
  Output is the gateway envelope. `data` contains report summaries, `total`, effective `limit`, `offset`, `has_more`, and nullable `next_offset`. When `has_more` is true, use exactly `next_offset` for the next call; stop when it is false. Include `version` in `--fields` when the next step is `analysis report update`.
16
16
 
17
- When locating reports, group known names into one `--queries` call or narrow with `--model-types` before paging. Stop when the required reports are found; do not issue one list call per name.
17
+ When locating manageable reports for an edit or management workflow, group known names into one `--queries` call or narrow with `--model-types` before paging. Stop when the required reports are found; do not issue one list call per name.
18
18
 
19
19
  Search matches report names and descriptions, not events inside definitions. Inspect a suitable candidate with `report get` when its definition is not already available; use [metadata resolution](metadata_resolution.md) for a business-measure lookup.