@thinkingai/ae-cli 6.0.62 → 6.0.64

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 (75) hide show
  1. package/README.md +8 -3
  2. package/README.zh.md +8 -3
  3. package/dist/{ai-monitor-X5GL44JT.js → ai-monitor-ABPXAOYL.js} +5 -5
  4. package/dist/ai-monitor.js +6 -6
  5. package/dist/{auth-SPQ46XQ3.js → auth-EV4FSIFI.js} +3 -3
  6. package/dist/{capability-JZP4KXZC.js → capability-B35ZQSSB.js} +3 -3
  7. package/dist/{chunk-E457FREE.js → chunk-434DSEOC.js} +6 -5
  8. package/dist/{chunk-F7TCQPQX.js → chunk-4COJB2CS.js} +1 -1
  9. package/dist/{chunk-YJYC5PLL.js → chunk-4CRZ2YUC.js} +2 -1
  10. package/dist/{chunk-RYY5NJK3.js → chunk-66F7SOGR.js} +2 -2
  11. package/dist/{chunk-PRCHMOWT.js → chunk-7AQ5Y6F2.js} +1 -1
  12. package/dist/{chunk-FGGEF7MI.js → chunk-7TENODN4.js} +2 -2
  13. package/dist/{chunk-VR2D54AA.js → chunk-7XTWP3NB.js} +1 -1
  14. package/dist/{chunk-6HOM2FOJ.js → chunk-A3PREN6Q.js} +4 -14
  15. package/dist/{chunk-2VKMHNUU.js → chunk-KVTFUP5T.js} +3 -3
  16. package/dist/{compat-check-JD5D77ET.js → compat-check-V3NGDQA5.js} +1 -1
  17. package/dist/{config-IIMRATTP.js → config-7OPBS5RW.js} +3 -3
  18. package/dist/context-WAR22IGB.js +349 -0
  19. package/dist/index.js +22 -22
  20. package/dist/{metadata-ZVPG2MIA.js → metadata-OROUBOO5.js} +5 -5
  21. package/dist/{personal-semantic-preference-YNCV4QG3.js → personal-semantic-preference-UQXUQJO3.js} +40 -15
  22. package/dist/{project-semantic-E7ZAQL5S.js → project-semantic-LEU2SN6J.js} +262 -14
  23. package/dist/{sync-Y4OZRQAY.js → sync-JXJUSBN3.js} +2 -2
  24. package/dist/{te-agent-RKAUTYJZ.js → te-agent-W67K6QTR.js} +1 -1
  25. package/dist/{te-analysis-7N5VC4JB.js → te-analysis-TJ7XHW6J.js} +306 -49
  26. package/dist/{te-community-SIA2UHTS.js → te-community-YNFYG42J.js} +4 -4
  27. package/dist/{te-dataops-5MJQCODU.js → te-dataops-GASA7SEG.js} +721 -217
  28. package/dist/{te-engage-ZTLOMKO3.js → te-engage-4CGFYLP6.js} +4 -4
  29. package/dist/{te-kb-LDL3MF2Y.js → te-kb-2ZYZKMDW.js} +27 -7
  30. package/dist/{te-team-JOWHCMZA.js → te-team-ZFQANIPN.js} +4 -4
  31. package/dist/{things-DOQ2L3O2.js → things-AYKSVWGZ.js} +1 -1
  32. package/dist/{update-KUS6TCPB.js → update-EDWNZQ6B.js} +2 -2
  33. package/package.json +4 -3
  34. package/skills/ae-analysis/SKILL.md +41 -16
  35. package/skills/ae-analysis/references/adhoc_export.md +1 -1
  36. package/skills/ae-analysis/references/adhoc_run.md +8 -2
  37. package/skills/ae-analysis/references/analysis_drilldown_contract.md +1 -1
  38. package/skills/ae-analysis/references/audience_scheduling.md +30 -0
  39. package/skills/ae-analysis/references/business_semantics_workspace.md +57 -0
  40. package/skills/ae-analysis/references/command_index.md +18 -13
  41. package/skills/ae-analysis/references/context_prepare.md +49 -0
  42. package/skills/ae-analysis/references/drilldown_entities_export.md +1 -1
  43. package/skills/ae-analysis/references/drilldown_entities_run.md +1 -1
  44. package/skills/ae-analysis/references/drilldown_user_events_export.md +3 -1
  45. package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -1
  46. package/skills/ae-analysis/references/governance_recommendation_export.md +1 -1
  47. package/skills/ae-analysis/references/personal_semantic_preference_add.md +5 -1
  48. package/skills/ae-analysis/references/personal_semantic_preference_get.md +4 -2
  49. package/skills/ae-analysis/references/personal_semantic_preference_list.md +7 -6
  50. package/skills/ae-analysis/references/personal_semantic_preference_submit.md +1 -1
  51. package/skills/ae-analysis/references/personal_semantic_preference_update.md +5 -1
  52. package/skills/ae-analysis/references/project_info_get.md +4 -0
  53. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +1 -1
  54. package/skills/ae-analysis/references/project_semantic_setup.md +60 -0
  55. package/skills/ae-analysis/references/report_get.md +2 -0
  56. package/skills/ae-analysis/references/report_presentation.md +55 -0
  57. package/skills/ae-analysis/references/report_update.md +4 -2
  58. package/skills/ae-analysis/references/system_openapi_token_batch_generate.md +20 -0
  59. package/skills/ae-analysis/references/system_openapi_token_get.md +14 -0
  60. package/skills/ae-analysis/references/user_cluster_create.md +3 -1
  61. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  62. package/skills/ae-analysis/references/user_cluster_update.md +5 -3
  63. package/skills/ae-analysis/references/user_tag_create.md +4 -22
  64. package/skills/ae-analysis/references/user_tag_models.md +8 -0
  65. package/skills/ae-analysis/references/user_tag_update.md +6 -14
  66. package/skills/ae-analysis/scripts/read-semantic-catalog.mjs +40 -0
  67. package/skills/ae-dataops/SKILL.md +9 -6
  68. package/skills/ae-dataops/references/dataops-flow-create.md +64 -47
  69. package/skills/ae-dataops/references/dataops-flow-monitor.md +4 -2
  70. package/skills/ae-dataops/references/dataops-flow-python.md +109 -0
  71. package/skills/ae-kb/SKILL.md +10 -5
  72. package/skills/ae-kb/references/analysis-workflow.md +19 -10
  73. package/skills/ae-kb/references/query-workflow.md +34 -17
  74. package/skills/ae-kb-discovery/SKILL.md +4 -3
  75. package/dist/context-BXHIPIIX.js +0 -138
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: dataops-flow-create
3
- version: 1.0.0
4
- description: "Flow creation and configuration: create flows, manage custom flow parameters, add task nodes, configure dependencies, save task definitions, configure scheduling, test, and release to production. Trigger keywords: create flow, new workflow, configure schedule, add task node, release, cron, scheduled execution."
3
+ version: 1.1.0
4
+ description: "Flow creation and configuration: create flows, manage custom flow parameters, add SQL/integration/check task nodes (and route to Python nodes), configure dependencies, configure scheduling, preview, and release to production. Trigger keywords: create flow, new workflow, configure schedule, add task node, release, cron, scheduled execution."
5
5
  metadata:
6
6
  requires:
7
7
  bins: ["ae-cli"]
@@ -151,15 +151,37 @@ ae-cli dataops_flow +update_task_instance_check_task --spaceCode "${spaceCode}"
151
151
 
152
152
  Task instance check create defaults are `relation=AND`, `checkInterval=10`, and `checkTime=3`; retry defaults are `3`, `5`, and `MINUTE`. `checkItems` is required and replaces the complete target list. On update, omitted check scalars, dependencies, and retry fields keep their current values.
153
153
 
154
- ### Step 5: Modify SQL Task Content
154
+ ### Step 5: Read or Modify SQL Task Content and OUT Parameters
155
155
 
156
156
  ```bash
157
- # Update SQL task content and keep dependencies and retry policy
157
+ # Read the current DEV Trino SQL task definition (sqlTask, preTasks, retry, outputParams, taskParams, paramSources)
158
+ ae-cli dataops_flow +get_sql_task --spaceCode "${spaceCode}" \
159
+ --flowCode ${flowCode} --taskCode ${taskCode}
160
+
161
+ # Create a DEV Trino SQL task that publishes an OUT parameter (must be a SELECT / WITH...SELECT query with LIMIT <= 10)
162
+ ae-cli dataops_flow +create_sql_task --spaceCode "${spaceCode}" \
163
+ --flowCode ${flowCode} --taskName "Compute Latest Date" \
164
+ --sql "SELECT max(dt) AS sql_dt FROM dwd_user LIMIT 1" \
165
+ --outputParams '[{"paramKey":"sql_dt","remark":"Latest processed date"}]'
166
+
167
+ # Partial update: change only outputParams (omit --sql to keep existing DEV SQL)
158
168
  ae-cli dataops_flow +update_sql_task --spaceCode "${spaceCode}" \
159
169
  --flowCode ${flowCode} --taskCode ${taskCode} \
160
- --sql "SELECT * FROM dwd_user"
170
+ --outputParams '[{"paramKey":"sql_dt","remark":"Updated remark"}]'
171
+
172
+ # Clear preSql/postSql hooks and OUT declarations explicitly
173
+ ae-cli dataops_flow +update_sql_task --spaceCode "${spaceCode}" \
174
+ --flowCode ${flowCode} --taskCode ${taskCode} \
175
+ --preSql "" --postSql "" --outputParams '[]'
161
176
  ```
162
177
 
178
+ - **SQL `OUT` parameter rules**: `--outputParams` (`[{"paramKey":"sql_dt","remark":"optional"}]`) declares `VARCHAR` `OUT` parameters (`paramKey` matching `^[a-z][a-z0-9_]{0,39}$`, not `env`, no `ws_` prefix, workflow-wide `OUT` limit default 50). Declaring `OUT` requires the main SQL to be a query (`SELECT` / `WITH ... SELECT`, with `LIMIT` <= `10` such as `LIMIT 1`; pure DML such as `INSERT` is rejected). At runtime, values bind from the **first result row** by matching column name/alias (for duplicate column names, the rightmost non-null, non-empty value wins; 10 KiB UTF-8 limit per node; empty/0-row output does not overwrite an earlier non-empty upstream value). Downstream tasks wired via `--preTasks` consume published outputs as `${paramKey}`. Remark-only `OUT` edits update the parameter table without bumping the task version.
179
+ - **Read & partial update**: `+get_sql_task` reads **DEV** definitions only and requires `dwWorkflowEdit`. On `+update_sql_task`, `--sql` is optional (pass at least one mutable field; omitted fields keep existing DEV values; `--preSql ""` / `--postSql ""` clear hooks to null; `--outputParams` and `--preTasks` use three-state semantics: omit=keep, `'[]'`=clear, non-empty=replace).
180
+
181
+ ### Step 5b: Create, Read, or Modify Python Task Nodes
182
+
183
+ For all 7 Python task and environment/directory commands (`+create_python_task`, `+update_python_task`, `+get_python_task`, `+list_python_versions`, `+list_python_package_sources`, `+list_python_directories`, `+browse_python_directory`), single-file `main.py` packaging, `TE_OUTPUT:` protocol rules, `dwWorkflowEdit` permission requirements, and DEV/PROD boundaries, see [Python workflow nodes](dataops-flow-python.md).
184
+
163
185
  ### Delete a Task Node
164
186
 
165
187
  Verify the target with `+get_flow_overview` before any deletion. Preview the request first, then execute it only after explicit user confirmation:
@@ -209,6 +231,8 @@ ae-cli dataops_flow +preview_release_flow --spaceCode "${spaceCode}" \
209
231
 
210
232
  Inspect `data.releaseStatus` in the default CLI JSON: `READY` permits the requested release; `NO_CHANGES` means skip submission and inspect PROD. For `CHECK_FAILED` or `FAILED`, report the message and failed change items and stop before publishing or executing. Check that the preview contains only the intended changes.
211
233
 
234
+ Note on upstream `OUT` parameters: when a downstream task references an upstream node's declared `OUT` parameter (such as `${out_dt}` from an upstream Python task), a task item may include an informational `refuseReason` like `"Parameter ${out_dt} is null."` even when `data.releaseStatus` is `READY` and the task's `validationStatus` is `SUCCESS`. This reflects runtime-only upstream outputs and does not block release when `releaseStatus=READY` and `validationStatus=SUCCESS`.
235
+
212
236
  ### Step 9: Release to Production and Verify
213
237
 
214
238
  ```bash
@@ -222,54 +246,47 @@ ae-cli dataops_flow +get_flow_overview --spaceCode "${spaceCode}" \
222
246
 
223
247
  Check `data.result.releaseStatus`, not outer `ok` or action `status`: `FAILED`, `CHECK_FAILED`, `FAIL`, `PART_SUCCESS`, and `TABLE_FAIL` are not successful publication. Stop and report their details. `TO_RELEASE`, `RELEASING`, or `SUBMITTED` means completion is unverified; retain `data.result.packageCode` and do not resubmit the release.
224
248
 
225
- Confirm the PROD overview has `data.success=true` and compare its visible `schedule`, `dag`, and `flowParams` with the requested changes, including CRON and task presence/type when applicable. Even a release response of `SUCCESS` needs this readback. The overview does not expose task SQL or the integration task's `syncId`; retain the create/update result and release preview as evidence, and state this readback limit instead of claiming those fields were independently verified in PROD. If publication is pending, make read-only checks within a finite deadline; on expiry or unavailable evidence, report the package/flow IDs and what remains unverified. A release-only request ends here. For an explicitly requested manual run, continue with [execution and completion checks](dataops-flow-monitor.md#workflow-c-manual-execution-and-stop).
249
+ Confirm the PROD overview has `data.success=true` and compare its visible `schedule`, `dag`, and `flowParams` with the requested changes, including CRON and task presence/type when applicable. Even a release response of `SUCCESS` needs this readback. The overview does not expose task SQL, Python script text, or the integration task's `syncId`; retain the create/update result and release preview (`contentCompare`) as evidence, and state this readback limit instead of claiming those fields were independently verified in PROD (once a PROD instance runs, `dataops_operations +get_task_instance_detail` exposes the executed historical definition). If publication is pending, make read-only checks within a finite deadline; on expiry or unavailable evidence, report the package/flow IDs and what remains unverified. A release-only request ends here. For an explicitly requested manual run, continue with [execution and completion checks](dataops-flow-monitor.md#workflow-c-manual-execution-and-stop).
226
250
 
227
251
  ---
228
252
 
229
253
  ## Command Quick Reference
230
254
 
231
- | Command | Purpose | Key Flags |
232
- |---------|---------|-----------|
233
- | `+create_flow` | Create DEV flow | `--spaceCode` `--flowName` `[--remark]` |
234
- | `+create_sql_task` | Create DEV Trino SQL task and save SQL | `--spaceCode` `--flowCode` `--taskName` `--sql` `[--preSql]` `[--postSql]` `[--preTasks]` `[--failRetryTimes]` `[--failRetryInterval]` `[--failRetryUnit]` `[--remark]` |
235
- | `+update_sql_task` | Update DEV Trino SQL task content | `--spaceCode` `--flowCode` `--taskCode` `--sql` `[--preSql]` `[--postSql]` `[--preTasks]` `[--failRetryTimes]` `[--failRetryInterval]` `[--failRetryUnit]` |
236
- | `+create_integration_task` | Create DEV integration sync task from an existing sync solution | `--spaceCode` `--flowCode` `--taskName` `--syncId` `[--preTasks]` `[--failRetryTimes]` `[--failRetryInterval]` `[--failRetryUnit]` `[--remark]` |
237
- | `+update_integration_task` | Rebind DEV integration sync task to a sync solution | `--spaceCode` `--flowCode` `--taskCode` `--syncId` `[--preTasks]` `[--failRetryTimes]` `[--failRetryInterval]` `[--failRetryUnit]` |
238
- | `+create_workflow_instance_check_task` | Create DEV workflow instance check task | `--spaceCode` `--flowCode` `--taskName` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` `[--remark]` |
239
- | `+update_workflow_instance_check_task` | Update DEV workflow instance check task | `--spaceCode` `--flowCode` `--taskCode` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` |
240
- | `+create_task_instance_check_task` | Create DEV task instance check task | `--spaceCode` `--flowCode` `--taskName` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` `[--remark]` |
241
- | `+update_task_instance_check_task` | Update DEV task instance check task | `--spaceCode` `--flowCode` `--taskCode` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` |
242
- | `+delete_task` | Delete one DEV task node after confirmation | `--spaceCode` `--flowCode` `--taskCode` `--yes` |
243
- | `+add_task_relation` | Add DEV dependency | `--spaceCode` `--flowCode` `--preTaskCode` `--taskCode` |
244
- | `+save_schedule_config` | Save DEV schedule config | `--spaceCode` `--flowCode` `--enabled` `[--cron]` |
245
- | `+get_flow_params` | List custom workflow parameters | `--spaceCode` `--flowCode` `[--env DEV\|PROD]` |
246
- | `+create_flow_param` | Create one DEV custom parameter | `--spaceCode` `--flowCode` `--paramKey` `--paramValue` `[--paramDataType VARCHAR\|EXPRESSION]` `[--remark]` |
247
- | `+update_flow_param` | Update or rename one DEV custom parameter | `--spaceCode` `--flowCode` `--paramKey` `[--originParamKey]` `[--paramValue]` `[--paramDataType]` `[--remark]` |
248
- | `+delete_flow_param` | Delete one DEV custom parameter after confirmation | `--spaceCode` `--flowCode` `--paramKey` `--yes` |
249
- | `+get_flow_overview` | View DEV/PROD flow definitions and all task parameter references | `--spaceCode` (`--flowCode` or `--flowName`) `[--env DEV\|PROD]` |
250
- | `+execute_flow` | Manual PROD execution | `--spaceCode` `--flowCode` `[--baseDate]` |
251
- | `dataops_operations +get_flow_instance_detail` | View operations instance DAG and task statuses | `--spaceCode` `--flowCode` `--flowInstanceId` |
252
- | `dataops_operations +get_task_instance_detail` | View operations task detail and optional logs | `--spaceCode` `--flowCode` `--flowInstanceId` (`--taskInstanceId` or `--taskCode` or `--taskName`) `[--includeLog]` |
253
- | `+preview_release_flow` | Preview pending DEV-to-PROD release changes without publishing | `--spaceCode` `--flowCode` |
254
- | `+release_flow` | Submit DEV-to-PROD release | `--spaceCode` `--flowCode` |
255
+ For the 7 Python node commands see [Python workflow nodes](dataops-flow-python.md); for operations instance/log queries see [execution and monitoring](dataops-flow-monitor.md).
256
+
257
+ | Command | Purpose | Risk | Key Flags |
258
+ |---------|---------|------|-----------|
259
+ | `ae-cli dataops_flow +create_flow` | Create DEV flow | write | `--spaceCode` `--flowName` `[--remark]` |
260
+ | `ae-cli dataops_flow +create_sql_task` | Create DEV Trino SQL task | write | `--spaceCode` `--flowCode` `--taskName` `--sql` `[--preSql]` `[--postSql]` `[--outputParams]` `[--preTasks]` `[retry flags]` `[--remark]` |
261
+ | `ae-cli dataops_flow +update_sql_task` | Partially update DEV Trino SQL task | write | `--spaceCode` `--flowCode` `--taskCode` `[--sql]` `[--preSql]` `[--postSql]` `[--outputParams]` `[--preTasks]` `[retry flags]` |
262
+ | `ae-cli dataops_flow +get_sql_task` | Read DEV Trino SQL task definition | read | `--spaceCode` `--flowCode` `--taskCode` |
263
+ | `ae-cli dataops_flow +create_integration_task` | Create DEV integration sync task | write | `--spaceCode` `--flowCode` `--taskName` `--syncId` `[--preTasks]` `[retry flags]` `[--remark]` |
264
+ | `ae-cli dataops_flow +update_integration_task` | Rebind DEV integration sync task | write | `--spaceCode` `--flowCode` `--taskCode` `--syncId` `[--preTasks]` `[retry flags]` |
265
+ | `ae-cli dataops_flow +create_workflow_instance_check_task` | Create DEV `FLOW_CHECK` task | write | `--spaceCode` `--flowCode` `--taskName` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` `[--remark]` |
266
+ | `ae-cli dataops_flow +update_workflow_instance_check_task` | Update DEV `FLOW_CHECK` task | write | `--spaceCode` `--flowCode` `--taskCode` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` |
267
+ | `ae-cli dataops_flow +create_task_instance_check_task` | Create DEV `TASK_CHECK` task | write | `--spaceCode` `--flowCode` `--taskName` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` `[--remark]` |
268
+ | `ae-cli dataops_flow +update_task_instance_check_task` | Update DEV `TASK_CHECK` task | write | `--spaceCode` `--flowCode` `--taskCode` `--checkItems` `[--relation]` `[--checkInterval]` `[--checkTime]` `[--preTasks]` `[retry flags]` |
269
+ | `ae-cli dataops_flow +delete_task` | Delete one DEV task node | high-risk-write | `--spaceCode` `--flowCode` `--taskCode`; `--yes` after confirmation |
270
+ | `ae-cli dataops_flow +add_task_relation` | Add DEV dependency (`preTaskCode` -> `taskCode`) | write | `--spaceCode` `--flowCode` `--preTaskCode` `--taskCode` |
271
+ | `ae-cli dataops_flow +save_schedule_config` | Save DEV schedule config | write | `--spaceCode` `--flowCode` `--enabled` `[--cron]` |
272
+ | `ae-cli dataops_flow +get_flow_params` | List custom workflow parameters | read | `--spaceCode` `--flowCode` `[--env DEV\|PROD]` |
273
+ | `ae-cli dataops_flow +create_flow_param` | Create one DEV custom parameter | write | `--spaceCode` `--flowCode` `--paramKey` `--paramValue` `[--paramDataType VARCHAR\|EXPRESSION]` `[--remark]` |
274
+ | `ae-cli dataops_flow +update_flow_param` | Update or rename one DEV custom parameter | write | `--spaceCode` `--flowCode` `--paramKey` `[--originParamKey]` `[--paramValue]` `[--paramDataType]` `[--remark]` |
275
+ | `ae-cli dataops_flow +delete_flow_param` | Delete one DEV custom parameter | high-risk-write | `--spaceCode` `--flowCode` `--paramKey`; `--yes` after confirmation |
276
+ | `ae-cli dataops_flow +get_flow_overview` | View DEV/PROD flow overview & parameter refs | read | `--spaceCode` (`--flowCode` or `--flowName`) `[--env DEV\|PROD]` |
277
+ | `ae-cli dataops_flow +preview_release_flow` | Preview pending DEV-to-PROD release diff | read | `--spaceCode` `--flowCode` |
278
+ | `ae-cli dataops_flow +release_flow` | Submit DEV-to-PROD release | write | `--spaceCode` `--flowCode` |
279
+ | `ae-cli dataops_flow +execute_flow` | Manual PROD execution | write | `--spaceCode` `--flowCode` `[--baseDate]` |
255
280
 
256
281
  ## Parameter Notes
257
282
 
258
- - **Parameter Reference**: Reference workspace parameters in tasks using `${paramKey}` (e.g., `${ws_run_date}`)
259
- - **Execution**: `+execute_flow` requires `--spaceCode` and `--flowCode`; `--baseDate` is optional and maps to runtime parameter `bd`. It always runs PROD and returns `action/result/status`; `result` includes `flowCode`, `executeId`, `operationStatus`, `nextAction`, and optional `flowInstanceId`.
260
- - **Schedule config**: `+save_schedule_config` requires `--spaceCode`, `--flowCode`, and `--enabled`. `--cron` is required only when `--enabled true`; omit it when disabling scheduling. It returns `action/result/status`; `result` includes `enabled`, `flow`, `message`, and `cron` only when enabled.
261
- - **Release preview**: `+preview_release_flow` requires `--spaceCode` and `--flowCode`; it has no optional flags. It returns `flowCode`, `releaseStatus`, `message`, and `changes`. Each change may include `scheduleConfigChange` and `tasks`; `scheduleConfigChange.diff.old.parameters` and `.new.parameters` show the flow parameter comparison. Parameter-only changes use the existing flow configuration release. Task entries may include `changed`, `contentCompare`, and `targetTable`.
262
- - **Release**: `+release_flow` requires `--spaceCode` and `--flowCode`; it has no optional flags. It returns `action/result/status`; `result` includes `flowCode`, `releaseStatus`, `message`, optional `packageCode`, and optional `changes`. Each change may include `scheduleConfigChange` and `tasks`; task entries include `changed`.
263
- - **Task dependencies**: `--preTasks` is a JSON array of upstream task codes on SQL, integration, workflow instance check, and task instance check create/update commands. Omit `--preTasks` on update to preserve existing dependencies; pass `--preTasks '[]'` to clear them; pass a non-empty array to replace them.
264
- - **Retry policy**: All four task types accept `--failRetryTimes`, `--failRetryInterval`, and `--failRetryUnit`. Create defaults to `3`, `5`, and `MINUTE`. Update preserves every omitted retry field. `MINUTE` is the only supported unit.
265
- - **SQL task creation**: `+create_sql_task` requires `--spaceCode`, `--flowCode`, `--taskName`, and `--sql`; SQL hooks, dependencies, retry policy, and remark are optional. It returns `action/result/status`; `result` includes `flowCode`, `taskCode`, `taskName`, `taskType=TRINO_SQL`, and `sqlSaved=true`.
266
- - **SQL task update**: `+update_sql_task` requires `--spaceCode`, `--flowCode`, `--taskCode`, and `--sql`; omitted SQL hooks, dependencies, and retry fields keep existing values. It returns `action/result/status`; `result` includes `sqlSaved`, `flowCode`, `taskCode`, `taskType=TRINO_SQL`, and `task`.
267
- - **Task dependency**: `+add_task_relation` requires `--spaceCode`, `--flowCode`, `--preTaskCode`, and `--taskCode`. `preTaskCode` is upstream and `taskCode` is downstream. It returns `action/result/status`; `result` includes `status`, `flowCode`, `preTaskCode`, `taskCode`, and `message`.
268
- - **Flow and task parameters**: `+get_flow_overview` requires `dwWorkflowEdit` and supports DEV (default) or PROD. It returns all custom flow definitions in `flowParams` and task references in `dag.tasks[].taskParams`, including source, definition value, type, description, and built-in flags. Expressions remain literal; task references retain `paramDataType=QUOTE`. Source is `FLOW` or `SPACE` for configured parameters. A code-parsed reference without a configured source remains visible with null or omitted `paramFrom` and `paramValue` fields; either form means no configured source/value. Empty parameter lists are arrays. Use the selected environment to compare unpublished DEV changes with PROD.
269
- - **Integration task creation**: `+create_integration_task` requires `--spaceCode`, `--flowCode`, `--taskName`, and `--syncId`; dependencies, retry policy, and remark are optional. It returns `action/result/status`; `result` includes `syncTaskSaved`, `flowCode`, `taskCode`, `taskName`, `taskType=OFFLINE_SYNC`, `syncId`, and `nextAction`.
270
- - **Workflow instance check tasks**: `checkItems` is required and replaces the complete check item list. Create defaults `relation/checkInterval/checkTime` to `AND/5/3`; update preserves omitted scalar values. This command creates `FLOW_CHECK`, not task-instance `TASK_CHECK`.
271
- - **Task instance check tasks**: `checkItems` is required and replaces the complete check item list. Each item identifies a target using `flowCode` and `taskCode`. Create defaults `relation/checkInterval/checkTime` to `AND/10/3`; update preserves omitted scalar values. This command creates `TASK_CHECK`.
272
- - **Task deletion**: `+delete_task` requires `--spaceCode`, `--flowCode`, and `--taskCode`. It is a `high-risk-write`: inspect the node with `+get_flow_overview`, run `--dry-run`, obtain explicit confirmation, and then pass `--yes`. It changes DEV only; release the flow to apply deletion to PROD.
283
+ - **Parameter reference**: Reference parameters in tasks as `${paramKey}` (e.g., `${ws_run_date}`).
284
+ - **Task dependencies (`--preTasks`)**: JSON array of upstream task codes across all task create/update commands. Omit `--preTasks` on update to preserve existing dependencies; pass `--preTasks '[]'` to clear them; pass a non-empty array to replace them.
285
+ - **Retry flags**: `--failRetryTimes`, `--failRetryInterval`, `--failRetryUnit` (`MINUTE` only). Create defaults to `3`, `5`, `MINUTE`; update preserves omitted fields.
286
+ - **SQL & integration updates**: `+update_sql_task` preserves omitted hooks/dependencies/retry fields; `+create_sql_task` returns `taskType=TRINO_SQL`, `sqlSaved=true`; `+create_integration_task` returns `taskType=OFFLINE_SYNC`, `syncTaskSaved=true`.
287
+ - **Schedule & execution**: `+save_schedule_config` requires `--cron` only when `--enabled true`. `+execute_flow` always runs PROD (`--baseDate` maps to `bd`) and returns `result.executeId`, `operationStatus`, and optional `flowInstanceId`.
288
+ - **Release preview & submit**: Both take only `--spaceCode` and `--flowCode`. Preview returns `releaseStatus`, `message`, and `changes` (`scheduleConfigChange.diff.old/new.parameters`, task `changed`/`contentCompare`/`paramCompare`/`targetTable`; `paramCompare` includes `old` and `new` task parameter lists whenever `"parameter"` is in `changed`); parameter-only changes use the existing flow configuration release. Release returns `result.releaseStatus`, `message`, and optional `packageCode`/`changes`.
289
+ - **Flow overview (`+get_flow_overview`)**: Requires `dwWorkflowEdit` in DEV (default) and PROD. Returns `flowParams` and `dag.tasks[].taskParams` (empty arrays when none). Expressions stay literal (`paramDataType=QUOTE` on task refs); `paramFrom` is `FLOW` or `SPACE`, and code-parsed refs without a configured source leave `paramFrom`/`paramValue` null or omitted.
273
290
 
274
291
  ## Transport Status
275
292
 
@@ -279,11 +296,11 @@ Owning module: gaia-mcp workflow
279
296
 
280
297
  Current transport: DataOps CLI REST
281
298
 
282
- Covered workflow tools: `flow_create_workflow_instance_check_task`, `flow_update_workflow_instance_check_task`, `flow_create_task_instance_check_task`, `flow_update_task_instance_check_task`, `flow_delete_task`, `flow_get_flow_params`, `flow_create_flow_param`, `flow_update_flow_param`, and `flow_delete_flow_param`
299
+ Covered workflow tools: `flow_get_sql_task`, `flow_create_workflow_instance_check_task`, `flow_update_workflow_instance_check_task`, `flow_create_task_instance_check_task`, `flow_update_task_instance_check_task`, `flow_delete_task`, `flow_get_flow_params`, `flow_create_flow_param`, `flow_update_flow_param`, and `flow_delete_flow_param`
283
300
 
284
301
  Gateway target: TBD after DataOps workflow Gateway schema review
285
302
 
286
- Review after: 2026-10-27
303
+ Review after: 2026-12-21
287
304
 
288
305
  Exit condition: Migrate or remove these one-to-one commands after equivalent Capability Gateway actions are available.
289
306
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dataops-flow-monitor
3
- version: 1.0.0
3
+ version: 1.1.0
4
4
  description: "Flow execution and monitoring: view execution instances, inspect instance DAGs and task logs, manually execute/stop flows. Trigger keywords: execute flow, running instance, monitor, logs, stop, troubleshoot, instance, flow instance."
5
5
  metadata:
6
6
  requires:
@@ -88,6 +88,8 @@ ae-cli dataops_operations +get_task_instance_detail --spaceCode "${spaceCode}" \
88
88
 
89
89
  Report the failed task, historical instance/base date, and relevant log evidence first. These commands cannot rerun only failed nodes of that historical instance. Do not substitute `+execute_flow` (a new whole-flow PROD run) or a backfill job for that request. If the user explicitly requests a new whole-flow run, establish its business date, release any required DEV fixes using [the release workflow](dataops-flow-create.md#step-8-preview-release), and continue below; pass `--baseDate` for a requested historical date rather than assuming today's date is equivalent.
90
90
 
91
+ For failed or unexpected `PYTHON` tasks, inspect `--includeLog true` output across three fields: `log.taskLog` (pip install errors, container stdout/stderr, Python tracebacks, and `TE_OUTPUT:` protocol parse failures), `definition.task.pythonTask` (exact historical `scriptContent`, `pythonVersion`, `requirementsTxt`, and `packageSourceId` executed by that instance), and `runtimeParams.inputParams` / `runtimeParams.outputParams` (resolved runtime inputs including `UPSTREAM_OUTPUT` provenance and published `TE_OUTPUT:` values).
92
+
91
93
  ---
92
94
 
93
95
  ## Workflow C: Manual Execution and Stop
@@ -150,7 +152,7 @@ ae-cli dataops_flow +get_flow_overview --spaceCode "${spaceCode}" \
150
152
  - **High-frequency release flows**: `+list_high_frequency_release_flows` requires `--spaceCode`; `--days`, `--topN`, `--minCount`, and `--status` are optional. Defaults are `days=30`, `topN=10`, and `status=SUCCESS`. It returns `period`, `filters`, `flows`, `returnedCount`, and `nextAction`; flow items include `rank`, `flowCode`, `flowName`, `releaseCount`, `lastReleaseTime`, and `avgIntervalHours`.
151
153
  - **Operations instance search**: `dataops_operations +search_flow_instances` requires `--spaceCode`; `--keyword`, `--startDate`, `--endDate`, `--status`, `--pageNum`, and `--pageSize` are optional. `--keyword` fuzzy-matches instance ID, workflow name, or workflow remark, not `flowCode`; filter the returned `flowCode` exactly. `pageNum` defaults to `1`; `pageSize` defaults to `20` and maxes at `100`. It returns `totalCount`, `returnedCount`, `pageNum`, `pageSize`, `hasMore`, `instances`, `statusCounts`, `triggerTypeCounts`, and `ownerCounts`.
152
154
  - **Flow instance detail**: `dataops_operations +get_flow_instance_detail` requires `dwOMInstanceView` and returns the historical execution snapshot in `flowInstance.instanceParamMap`. A missing snapshot is null or omitted; the server does not substitute current parameter definitions. Later definition changes do not change historical execution values.
153
- - **Task instance detail**: `dataops_operations +get_task_instance_detail` requires `--spaceCode`, `--flowCode`, `--flowInstanceId`, and one selector: `--taskInstanceId`, `--taskCode`, or exact `--taskName`. Prefer `--taskInstanceId` because retries can create multiple instances with the same task code/name. It requires `dwOMInstanceView`. `--includeLog` is optional and defaults to `false`; when enabled, `log.params` contains the task's historical actual execution values. It returns `success`, `flowInstanceId`, `taskCode`, `taskName`, `taskInstanceId`, `status`, `task`, `taskInstance`, `definition`, and `log` only when requested.
155
+ - **Task instance detail**: `dataops_operations +get_task_instance_detail` requires `--spaceCode`, `--flowCode`, `--flowInstanceId`, and one selector: `--taskInstanceId`, `--taskCode`, or exact `--taskName`. Prefer `--taskInstanceId` because retries can create multiple instances with the same task code/name. It requires `dwOMInstanceView`. `--includeLog` is optional and defaults to `false`; when enabled, `log.params` contains the task's historical actual execution values. It returns `success`, `flowInstanceId`, `taskCode`, `taskName`, `taskInstanceId`, `status`, `task`, `taskInstance`, `definition`, `params`, `runtimeParams`, and `log` only when requested. For `PYTHON` tasks, `definition.task.pythonTask` contains the historical `scriptContent`, `pythonVersion`, `requirementsTxt`, and `packageSourceId` executed by that instance, and `runtimeParams.outputParams` contains published `TE_OUTPUT:` values.
154
156
  - **env**: `DEV` (development) | `PROD` (production, instance list defaults to PROD)
155
157
  - **flow list paging**: `+list_flows` requires `--spaceCode`; `--keyword`, `--pageNum`, and `--pageSize` are optional. It returns `flows`, `totalCount`, `returnedCount`, `pageNum`, `pageSize`, and `hasMore`; flow items include `latestProductionInstance` only when available. `pageSize` defaults to `20` and maxes at `100`.
156
158
  - **Task parameter sources**: Read `dag.tasks[].taskParams` from `+get_flow_overview`. `paramFrom=FLOW` means a flow definition supplies the value; `SPACE` means a space parameter does. A code-parsed reference remains in the list when neither source exists; its `paramFrom` and `paramValue` fields are null or omitted, both meaning no configured source/value. Deleting a flow parameter falls back to a same-name space parameter, or to code-parsed status. Unpublished DEV changes do not alter PROD values or sources.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: dataops-flow-python
3
+ version: 1.0.0
4
+ description: "Python workflow task nodes: discover Python versions, pip package sources, and DEV/PROD mount directories, browse DEV files, and create, read, or partially update single-file Python nodes with TE_OUTPUT parameters. Trigger keywords: Python task, python node, requirements.txt, TE_OUTPUT, python version, package source, python directory."
5
+ metadata:
6
+ requires:
7
+ bins: ["ae-cli"]
8
+ ---
9
+
10
+ # DataOps Python Workflow Nodes
11
+
12
+ > **Prerequisites:** Read [`ae-dataops/SKILL.md`](../SKILL.md) for general rules. Use [flow configuration](dataops-flow-create.md) to create flows, wire DAG dependencies, configure schedules, and preview/release to PROD. Use [execution and monitoring](dataops-flow-monitor.md) for PROD runs and task log troubleshooting.
13
+
14
+ ## Permissions and DEV/PROD Boundaries
15
+
16
+ - **Permission (`dwWorkflowEdit`)**: All 7 Python commands—including the 4 read-only discovery commands—require workflow edit permission (`dwWorkflowEdit`) in `spaceCode`. Missing space membership or `dwWorkflowEdit` returns `error.type="permission"` (`code: "-10"`); re-login will not resolve it.
17
+ - **No remote DEV single-node debug-run CLI**: Debug `./main.py` and `./requirements.txt` locally before upload. When remote execution is explicitly requested, preview and release the flow to PROD via [the release workflow](dataops-flow-create.md#step-8-preview-release), then run `dataops_flow +execute_flow`.
18
+ - **DEV vs PROD visibility**: `+get_python_task` and `+browse_python_directory` inspect **DEV** only. To inspect the executed historical script, dependencies, runtime inputs/outputs, and logs of a **PROD** run, use `dataops_operations +get_task_instance_detail --includeLog true` (`definition.task.pythonTask`, `runtimeParams`, and `log.taskLog`).
19
+
20
+ ---
21
+
22
+ ## Step 1: Discover Environment and Mounted Directories (read-only)
23
+
24
+ ```bash
25
+ # Discover supported Python versions (defaultVersion is first, e.g. 3.11)
26
+ ae-cli dataops_flow +list_python_versions --spaceCode "${spaceCode}"
27
+
28
+ # Discover enabled cluster pip package sources and defaultSourceKey
29
+ ae-cli dataops_flow +list_python_package_sources --spaceCode "${spaceCode}"
30
+
31
+ # List authorized container mount roots (shared DEV/PROD path contract)
32
+ ae-cli dataops_flow +list_python_directories --spaceCode "${spaceCode}"
33
+
34
+ # Bounded browse of physical files in DEV storage (skips virtual parent folders by default)
35
+ ae-cli dataops_flow +browse_python_directory --spaceCode "${spaceCode}" \
36
+ --maxDepth 2 --maxEntries 200
37
+ ```
38
+
39
+ - `+list_python_directories` returns authorized mount root metadata (`/dw/<space>/product` `rw`, `/dw/<space>/exchange` `rw`, incoming `/dw/<owner>/exchange` `ro`) shared across DEV and PROD without hitting storage.
40
+ - `+browse_python_directory` reads **DEV physical files only** (`maxDepth` `1..3` default `2`, `maxEntries` `1..500` default `200`; inspect `truncated` and `hasDeeperDirectories`). When `--path` is omitted, returning `entries: []` with non-empty `roots` means the authorized DEV directories are currently empty (not unmounted). Files written during PROD runs live in PROD storage and do not appear in DEV directory browsing.
41
+
42
+ ---
43
+
44
+ ## Step 2: Author, Upload, Read, and Update Python Nodes
45
+
46
+ ### Runtime and Contract Rules
47
+
48
+ - **Single-file contract (`main.py` only)**: The platform stores one `scriptContent` text and executes it as a single `main.py` in an isolated K8s Pod (`uid=10001`). **Never split custom helper `.py` modules for local `import`**; keep all custom functions/classes in one `.py` file.
49
+ - **Upload from local files**: Prefer `--scriptFile` and `--requirementsFile` over inline strings to avoid shell-quoting or `${paramKey}` expansion bugs. Remember `${paramKey}` is substituted as literal text before container execution, and `/dw/<spaceCode>/...` mount paths exist inside the container rather than on your local host.
50
+ - **Size and dependency rules**: Combined `scriptContent` + `requirementsTxt` must not exceed **524,288 UTF-8 bytes (512 KiB)**. `requirements.txt` supports PyPA package specifiers (version constraints, extras, `#` comments, quoted markers such as `six==1.16.0 ; python_version >= "3.11"`), and **rejects** `-i`/`--index-url`, URLs, VCS links, editable installs, and local archive paths. Packages install with `--user` into the non-root container; write temporary runtime files only to `/tmp` or `rw` `/dw/<spaceCode>/...` directories.
51
+ - **Output parameters (`TE_OUTPUT:` strict protocol)**: Print **one `TE_OUTPUT:` line per parameter** as compact JSON with exact keys `{"name":"<paramKey>","value":<jsonValue>}` (for example `TE_OUTPUT:{"name":"out_dt","value":"2026-11-21"}`), using `flush=True` and no timestamp or log-level prefix before `TE_OUTPUT:`. **Never emit a multi-key map** such as `{"out_a":1,"out_b":2}`—a malformed `TE_OUTPUT:` protocol line fails the entire Python task (`FAIL`). **Only names pre-declared in `--outputParams` are published** as `VARCHAR` (`paramKey` must match `^[a-z][a-z0-9_]{0,39}$`, cannot be `env`, and cannot start with `ws_`); undeclared names are ignored. Downstream nodes wired via `--preTasks` consume published outputs as `${paramKey}`.
52
+
53
+ ```bash
54
+ # Create a DEV Python task from local debugged files with an OUT parameter
55
+ ae-cli dataops_flow +create_python_task --spaceCode "${spaceCode}" \
56
+ --flowCode ${flowCode} --taskName "Score Daily Users" \
57
+ --scriptFile ./main.py --requirementsFile ./requirements.txt \
58
+ --outputParams '[{"paramKey":"out_dt","remark":"Processed business date"}]'
59
+
60
+ # Read the current DEV Python task definition before incremental edits
61
+ ae-cli dataops_flow +get_python_task --spaceCode "${spaceCode}" \
62
+ --flowCode ${flowCode} --taskCode ${taskCode}
63
+
64
+ # Partial update: replace only requirements, keep existing script/version/packageSource/OUT params
65
+ ae-cli dataops_flow +update_python_task --spaceCode "${spaceCode}" \
66
+ --flowCode ${flowCode} --taskCode ${taskCode} \
67
+ --requirementsFile ./requirements.txt
68
+
69
+ # Clear all pip requirements and OUT declarations explicitly
70
+ ae-cli dataops_flow +update_python_task --spaceCode "${spaceCode}" \
71
+ --flowCode ${flowCode} --taskCode ${taskCode} \
72
+ --requirements "" --outputParams '[]'
73
+ ```
74
+
75
+ ### Defaults and Three-State Update Semantics
76
+
77
+ - `+create_python_task` requires `--spaceCode`, `--flowCode`, `--taskName`, and exactly one of `--scriptFile` or `--script`. Defaults: `--pythonVersion` = first configured version (`3.11`), `--packageSourceId` = cluster default source, retry policy = `3` times / `5` / `MINUTE`.
78
+ - `+update_python_task` requires `--spaceCode`, `--flowCode`, `--taskCode`, and at least one update field. Omitted fields keep existing DEV values; `--requirements ""` (or an empty `--requirementsFile`) clears pip dependencies; `--remark ""` clears remark.
79
+ - `--outputParams` (`[{"paramKey":"out_dt","remark":"..."}]`) and `--preTasks` (JSON array of upstream task codes) use three-state semantics on update: omit to keep, pass `'[]'` to clear, or pass a non-empty array to replace.
80
+
81
+ ---
82
+
83
+ ## Command Quick Reference
84
+
85
+ | Command | Purpose | Risk | Key Flags |
86
+ |---------|---------|------|-----------|
87
+ | `ae-cli dataops_flow +create_python_task` | Create DEV single-file Python task | write | `--spaceCode` `--flowCode` `--taskName` (`--scriptFile` or `--script`) `[--requirementsFile\|--requirements]` `[--pythonVersion]` `[--packageSourceId]` `[--outputParams]` `[--preTasks]` `[retry flags]` `[--remark]` |
88
+ | `ae-cli dataops_flow +update_python_task` | Partially update DEV Python task | write | `--spaceCode` `--flowCode` `--taskCode` `[--scriptFile\|--script]` `[--requirementsFile\|--requirements]` `[--pythonVersion]` `[--packageSourceId]` `[--outputParams]` `[--preTasks]` `[retry flags]` `[--remark]` |
89
+ | `ae-cli dataops_flow +get_python_task` | Read DEV Python task definition | read | `--spaceCode` `--flowCode` `--taskCode` |
90
+ | `ae-cli dataops_flow +list_python_versions` | List supported Python versions | read | `--spaceCode` |
91
+ | `ae-cli dataops_flow +list_python_package_sources` | List cluster-enabled pip package sources | read | `--spaceCode` |
92
+ | `ae-cli dataops_flow +list_python_directories` | List authorized container mount roots (`ro`/`rw`) | read | `--spaceCode` |
93
+ | `ae-cli dataops_flow +browse_python_directory` | Bounded browse of DEV Python workspace files | read | `--spaceCode` `[--path]` `[--maxDepth]` `[--maxEntries]` |
94
+
95
+ ## Transport Status
96
+
97
+ Transition status: transitional
98
+
99
+ Owning module: gaia-mcp workflow
100
+
101
+ Current transport: DataOps CLI REST
102
+
103
+ Covered workflow tools: `flow_create_python_task`, `flow_update_python_task`, `flow_get_python_task`, `flow_list_python_versions`, `flow_list_python_package_sources`, `flow_list_python_directories`, and `flow_browse_python_directory`
104
+
105
+ Gateway target: TBD after DataOps workflow Gateway schema review
106
+
107
+ Review after: 2026-12-21
108
+
109
+ Exit condition: Migrate or remove these one-to-one commands after equivalent Capability Gateway actions are available.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ae-kb
3
- version: 1.0.15
4
- description: 'AE knowledge base CLI manual for creating, importing read-only compiled snapshots, querying, LLM-powered ask, listing accessible knowledge bases and their sources, deterministic index/grep/read retrieval, checking status, ZIP source upload and directory management, raw child-file reading, revision-checked child updates and deletion, compiling, schema generation, URL sources, source deletion, ordinary text source creation, full reads and revision-checked editing, file/ZIP source draft replacement and restoration, and knowledge base deletion. Use when the user asks to manage AE (Agentic Engine) knowledge bases, import a compiled Markdown ZIP snapshot, upload documents or URLs to a knowledge base, query knowledge, ask knowledge bases with an LLM, list accessible knowledge bases or source metadata, inspect knowledge base indexes, search knowledge base pages, read a specific knowledge base page, check knowledge base status, generate schemas, compile knowledge, remove sources, create or edit text sources, or delete a knowledge base. To choose which knowledge base is worth searching, use the ae-kb-discovery skill first; this skill runs the retrieval once a target is chosen. Must use ae-cli kb commands and must not guess knowledge base names, scopes, page paths, source IDs, source display names, JSON payload shapes, or URL formats.'
3
+ version: 1.0.17
4
+ description: 'AE knowledge base CLI manual for creating, importing read-only compiled snapshots, querying, LLM-powered ask, listing accessible knowledge bases and their sources, deterministic index/grep/read retrieval, checking status, ZIP source upload and directory management, raw child-file reading, revision-checked child updates and deletion, compiling, schema generation, URL sources, source deletion, ordinary text source creation, full reads and revision-checked editing, file/ZIP source draft replacement and restoration, and knowledge base deletion. Use when the user asks to manage AE (Agentic Engine) knowledge bases, import a compiled Markdown ZIP snapshot, upload documents or URLs to a knowledge base, query knowledge, ask knowledge bases with an LLM, list accessible knowledge bases or source metadata, inspect knowledge base indexes, search knowledge base pages, read a specific knowledge base page, check knowledge base status, generate schemas, compile knowledge, remove sources, create or edit text sources, or delete a knowledge base. For automatic project semantic retrieval, use the exact KB resolved by ae-analysis. Use ae-kb-discovery when the task requires choosing a KB. Must use ae-cli kb commands and must not guess knowledge base names, scopes, page paths, source IDs, source display names, JSON payload shapes, or URL formats.'
5
5
  ---
6
6
 
7
7
  # ae-kb
@@ -348,7 +348,9 @@ Use the deterministic retrieval primitives when an agent needs to explore knowle
348
348
 
349
349
  **Before running a real query, read [`references/query-workflow.md`](references/query-workflow.md)** — it selects the next useful retrieval step without crawling. It covers candidate indexing, copied-path grep, direct bounded reads of linked short pages, same-page read windows, linked-page re-grep when needed, optional outline-derived ranges, and coverage assessment. This section below is the per-command reference the workflow draws on.
350
350
 
351
- Start with the trusted active sources described by `ae-kb-discovery`. Explicit references go straight to scoped retrieval without `+list`; relevant preferred candidates go first, with `+list` only if unrelated or insufficient. When no trusted active sources exist, use `+list` to discover accessible knowledge bases. Use `+index` when you also need navigation maps:
351
+ For automatic project semantic KB retrieval, start with the exact company KB returned by `kb project-target get` under the `ae-analysis` gate. Make a fresh scoped retrieval for each new analysis question. If there is no relevant hit, continue ordinary analysis with business semantics.
352
+
353
+ **Other KB queries:** start with the trusted active sources described by `ae-kb-discovery`. Explicit references go straight to scoped retrieval without `+list`; relevant preferred candidates go first, with `+list` only if unrelated or insufficient. When no trusted active sources exist, use `+list` to discover accessible knowledge bases. Use `+index` when you also need navigation maps:
352
354
 
353
355
  When discovery is needed:
354
356
 
@@ -486,10 +488,11 @@ ae-cli kb +list [--build-status compiled] [--locale zh|en|ja|ko]
486
488
  ### `+index`
487
489
 
488
490
  ```bash
489
- ae-cli kb +index [--sources '[{"scope":"company","name":"kb-name"}]'] [--locale zh|en|ja|ko]
491
+ ae-cli kb +index [--name "<kb-name>" --scope personal|company|system | --sources '[{"scope":"company","name":"kb-name"}]'] [--locale zh|en|ja|ko]
490
492
  ```
491
493
 
492
- - `--sources`: optional JSON array of knowledge base refs. Omit to list all accessible knowledge bases.
494
+ - `--name` and `--scope`: select one exact knowledge base. For example, `ae-cli kb +index --name "Engineering Handbook" --scope company`.
495
+ - `--sources`: JSON array of knowledge base refs for single or multiple targets. Omit both filters to list all accessible knowledge bases.
493
496
  - `--locale`: optional locale: `zh`, `en`, `ja`, or `ko`.
494
497
 
495
498
  ### `+grep`
@@ -588,6 +591,8 @@ ae-cli kb +compile --name "<name>" [--scope personal|company] [--mode incrementa
588
591
  ae-cli kb +status --name "<name>" [--scope personal|company] [--run-id <compile-run-id>]
589
592
  ```
590
593
 
594
+ For a knowledge-base status check, use the name and optionally the exact scope. On supported servers, `schemaFailure` appears when the latest guideline generation failed, and `wikiFailure` appears when the latest Wiki compile failed. Authorized callers receive a short `message` and a `code` when available. Read them alongside `schemaValidation` and publication status to tell whether earlier content is still usable. Older servers may omit these fields.
595
+
591
596
  With `--run-id`, output contains `knowledgeBase` and `compileRun` (`id`, `status`, `errorMessage`, `startedAt`, `finishedAt`) instead of the aggregate lifecycle fields. Copy the ID from `+compile`; wait only for `queued`/`running`, and stop on `succeeded`/`failed`/`cancelled`. A failed run remains failed even when an older published version is available. Exact-run diagnostics require the same compile-run permission as the KB run-detail view, and error text is redacted. The run must belong to the resolved, authorized KB; unknown and cross-KB IDs return `KB_COMPILE_RUN_NOT_FOUND`. Aggregate output includes working and published language declarations when available. Exact-run output can include structured `runStatus` and an original-language `contentSummary`. A legacy `summary` is a historical task status. Older servers may reject the optional field; do not fall back to aggregate polling for exact-run completion. Run success is separate from publication completeness and content acceptance.
592
597
 
593
598
  ### `+list-sources`
@@ -20,13 +20,16 @@ project-KB retrieval as a prerequisite.
20
20
  command. Verify the host and exact project ID; a KB name, binding, or display
21
21
  name does not prove the live project identity. Do not probe a default or
22
22
  previously used project while resolving the requested one.
23
- 2. Use `ae-kb-discovery` to select the candidate. An explicitly named KB wins;
24
- otherwise prefer a compiled KB whose `bindings.targetType` is `project` and
25
- whose `targetId` exactly matches the verified project ID.
26
- 3. Follow the deterministic `+index -> +grep -> +read` procedure in
27
- [`query-workflow.md`](query-workflow.md). Only source-page content actually
28
- returned by `+read` counts as a KB hit. A list item, index title, grep
29
- snippet, or `+ask` synthesis alone is not enough to drive execution.
23
+ 2. For automatic project semantic KB consumption, apply the `ae-analysis`
24
+ dual-switch gate and use only the company KB returned by
25
+ `kb project-target get` for that project. For an explicit KB request, use the
26
+ authorized named source or the general `ae-kb-discovery` workflow.
27
+ 3. Follow the matching route in [`query-workflow.md`](query-workflow.md).
28
+ For a new analysis question with an available project KB, run a fresh
29
+ `+grep` or content `+read`. If there is no relevant hit, continue through
30
+ ordinary analysis with business semantics. Before using a KB hit to choose
31
+ an asset or definition, verify it in source-page content returned by `+read`.
32
+ Index titles, grep snippets and `+ask` synthesis are navigation evidence.
30
33
  4. If `+ask` helps locate or synthesize multiple pages, read its cited source
31
34
  pages before executing data queries. Verify asset IDs, definitions, dynamic
32
35
  parameters, time rules, and limitations in the source text.
@@ -39,6 +42,12 @@ A compiled KB is a snapshot, not a live data source. Use it for routing,
39
42
  semantics, and decision boundaries. Verify current asset existence, the current
40
43
  saved definition, and current data with `ae-analysis`.
41
44
 
45
+ When an applicable, current business-semantic definition differs from a KB
46
+ definition of the same measure or rule, follow business semantics. A saved asset
47
+ whose live definition conflicts with business semantics is unsuitable for that
48
+ measure. Use KB evidence for uncovered context, and use ordinary discovery for
49
+ an authorized asset or query that matches the business-semantic definition.
50
+
42
51
  ## Choose the most specific executable asset
43
52
 
44
53
  A recall card's primary dashboard is a routing prior, not automatically the
@@ -255,9 +264,9 @@ applicable scope is not an equivalent validation.
255
264
 
256
265
  ## Degrade to the ordinary analysis path
257
266
 
258
- The KB path is preferred, not exclusive. If definition inspection establishes
259
- that the KB-selected asset cannot cover the request, or a real execution attempt
260
- cannot produce the requested live result, continue through the ordinary
267
+ If definition inspection establishes that the KB-selected asset cannot cover
268
+ the request, or a real execution attempt cannot produce the requested live
269
+ result, continue through the ordinary
261
270
  `ae-analysis` "Existing business asset before ad-hoc" workflow. Preserve the KB
262
271
  evidence and already verified definitions; do not restart from zero:
263
272
 
@@ -9,18 +9,40 @@ Use `+ask` when the question requires synthesizing across multiple pages or
9
9
  multi-hop reasoning; simple factual lookups are served by the steps below.
10
10
  Everything below is server-side LLM-free.
11
11
 
12
- ## The loop
12
+ ## Automatic project semantic KB retrieval
13
+
14
+ When the `ae-analysis` dual-switch gate is enabled and `kb project-target get`
15
+ returns an available company KB for the verified project, that exact KB is the
16
+ sole candidate. For each new analysis question, reuse exact navigation where
17
+ applicable and make a fresh `+grep` or content `+read` against the current project's resolved KB.
18
+ Results from a previous question do not satisfy the automatic project KB preflight.
19
+ If no obvious page matches, search the closest valid paths returned by navigation.
20
+ If the KB has no valid retrieval path, the retrieval fails, or there are no relevant hits,
21
+ continue ordinary analysis with business semantics. Do not return to discovery or search another KB.
22
+
23
+ ## Other KB queries
13
24
 
14
25
  This picks up **after** `ae-kb-discovery` has chosen a candidate from trusted active sources or `+list`.
15
26
  An explicit reference skips `+list` and stays within the referenced list, even when page evidence is insufficient.
16
27
  Preferred candidates are searched only when relevant; clearly unrelated candidates or evidence gaps can lead to `+list`.
17
28
  After `+list`, retrieve from at most three distinct newly discovered knowledge bases; count every new source in a multi-source `+ask` separately. Explicit references and preferred candidates do not consume that budget.
18
- Start here with a chosen candidate; scope every `+index` / `+grep` / `+read` call to it with `--sources` / `--source`. If the candidate turns out not to cover the question, go back to `ae-kb-discovery` for the next allowed candidate rather than searching everything blindly.
19
29
  When using `+ask` with explicit references or preferred candidates, always pass `--sources` containing only the relevant authorized sources from that active list; never omit it or include unrelated sources. For an explicit reference, insufficient evidence does not authorize expansion to another knowledge base.
20
30
 
31
+ If the first grep misses, rewrite the query once with different terms from the
32
+ navigation and the same `--paths`, then read the likeliest linked page if useful.
33
+ For a remaining evidence gap, try other paths copied from current navigation or
34
+ return to discovery for the next allowed candidate. With no usable paths, apply
35
+ the same discovery limits. Never construct a path from a title.
36
+
37
+ ## Retrieval steps
38
+
39
+ Scope every `+index` / `+grep` / `+read` call to the selected KB with `--sources` / `--source`.
40
+
21
41
  **Known-page fast path:** within the same host, identity, KB and published revision,
22
- reuse navigation and read evidence already obtained in this task. Copy exact
23
- links returned by `+index`, `+grep` or `+read`; go to step 3 for a relevant page
42
+ reuse navigation across questions. For automatic project retrieval, reuse previously
43
+ read content only for the same question. For other KB queries, reuse the evidence
44
+ already read in the same task.
45
+ Copy exact links returned by `+index`, `+grep` or `+read` and go to step 3 for a relevant page
24
46
  whose path is known. Do not guess filenames. Once a path is known,
25
47
  do not repeat indexing or broad directory searches to rediscover it;
26
48
  only read a domain, catalog or parent page when its additional
@@ -47,17 +69,13 @@ A revision or access-context change requires revalidation, not silent reuse.
47
69
  entry must be strictly below `wiki/`: the roots `wiki` and `wiki/`,
48
70
  `index.md`, `raw/`, absolute paths and paths escaping `wiki/` are invalid.
49
71
  Never use the wiki root as a full-library search fallback. If navigation
50
- provides no usable paths, skip grep as described below. Call
51
- `+grep` with the candidate `--sources` and the copied list as `--paths`. Search
52
- with the terms in the returned navigation. If the first grep misses, rewrite
53
- the query **once** using different terms from that navigation, still with
54
- the same `--paths`. If the rewrite also misses, choose the likeliest linked
55
- page and use step 3, or return to discovery. A third rewrite of the same
56
- idea produces no new recall.
57
-
58
- **Done when:** you have hits, or you have rewritten once, or step 1 copied
59
- 0 paths. Copied 0 paths → skip grep and go back to discovery rather than
60
- constructing a path from a title.
72
+ provides no usable paths, skip `+grep` and follow the fallback for your route above.
73
+ With valid paths, call `+grep` with the candidate `--sources` and the copied list as `--paths`. Search
74
+ with the terms in the returned navigation. If the grep misses, follow the
75
+ fallback for your route above.
76
+
77
+ **Done when:** you have relevant hits to read or have reached the fallback
78
+ for your route.
61
79
 
62
80
  **Reading the result — the page-level `results` view.** The response is a page-level
63
81
  `results` array: each entry is one page with its full `hitCount`, a
@@ -160,8 +178,7 @@ A revision or access-context change requires revalidation, not silent reuse.
160
178
  has no guaranteed historical snapshot; do not label its current content historical.
161
179
  Historical source reads are rejected inside a required fixed-context execution;
162
180
  never remove that context or fall back to an ordinary token to bypass its KB set.
163
- If a gap remains, go back to step 2 with another set of `--paths`
164
- **copied** from current navigation, or return to discovery for the next candidate.
181
+ If a gap remains, follow the fallback for your route above.
165
182
  For a knowledge-only question, missing evidence after the allowed search
166
183
  means "not covered by the knowledge base" — do not attach a confident fact
167
184
  from general knowledge, even with a disclaimer. For business data analysis,
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: ae-kb-discovery
3
- version: 1.0.0
3
+ version: 1.0.1
4
4
  description: >
5
- Discover which AE (Agentic Engine) knowledge bases accessible to the current user are worth searching, and decide whether to search at all, through read-only operations. Use when the user explicitly asks to search knowledge bases, internal documentation, or company materials. Also use when a task requires internal facts or business context, or when ae-analysis sees an enabled KB auto-discovery company switch before choosing its query route. Use internal context to explain data analysis results, anomalies, or trends and form evidence-backed conclusions. Do not use if the user explicitly asks not to access knowledge bases. This skill covers discovery and candidate selection; run the actual `+index` / `+grep` / `+read` / `+ask` retrieval with the `ae-kb` skill.
5
+ Discover which AE (Agentic Engine) knowledge bases accessible to the current user are worth searching, and decide whether to search at all, through read-only operations. Use when the user explicitly asks to search knowledge bases, internal documentation, or company materials, or when a task calls for internal facts or business context. For automatic project semantic knowledge-base consumption during data analysis, follow the project gate and exact target in ae-analysis. Do not use if the user explicitly asks not to access knowledge bases. This skill covers discovery and candidate selection; run the actual `+index` / `+grep` / `+read` / `+ask` retrieval with the `ae-kb` skill.
6
6
  ---
7
7
 
8
8
  # Knowledge Base Discovery
@@ -23,7 +23,8 @@ Use this skill when:
23
23
  - The task requires organization-specific facts or context, such as product design and rules, events, campaign or operations calendars, release and iteration records, workflows, policies, or terminology.
24
24
  - Internal context is needed to explain data analysis results, anomalies, or trends and form evidence-backed conclusions.
25
25
  - The knowledge base context currently available does not cover the question, and discovering other accessible sources has clear value.
26
- - `ae-analysis` read `data.routing.knowledge_base: auto` from `ae-cli config show` before selecting the project-scoped query route, and a knowledge base could materially improve the answer or asset selection.
26
+
27
+ For automatic project semantic KB consumption, `ae-analysis` uses its dual-switch policy and the exact project target. Do not discover other KBs when that lookup is disabled, unavailable or insufficient. Explicit requests for general KB discovery retain the workflow below.
27
28
 
28
29
  Do not use this skill when:
29
30