@thinkingai/ae-cli 6.1.23 → 6.1.25
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.
- package/README.md +7 -1
- package/README.zh.md +7 -1
- package/dist/{auth-XZNXFRJS.js → auth-LHM7NQPR.js} +167 -7
- package/dist/{capability-FYTU3X6L.js → capability-SJI5KOCK.js} +11 -6
- package/dist/{chunk-CCS66K4K.js → chunk-2FJM4HRV.js} +3 -3
- package/dist/{chunk-57RRFUEZ.js → chunk-5XRQ3CZR.js} +4 -4
- package/dist/{chunk-EQ255HKO.js → chunk-7WZACOAI.js} +2 -2
- package/dist/{chunk-DX5CDO34.js → chunk-BW7JUDEI.js} +84 -19
- package/dist/{chunk-7XGFSUOM.js → chunk-DU72X2IO.js} +271 -76
- package/dist/{chunk-V2NUHPXF.js → chunk-GK7WDY7E.js} +1 -1
- package/dist/{chunk-7FTTULED.js → chunk-IG3DYEIR.js} +4 -1
- package/dist/{chunk-HBGADCKA.js → chunk-KJDOTPYU.js} +3 -3
- package/dist/{chunk-4NRCTUZJ.js → chunk-KS4DE3MX.js} +4 -4
- package/dist/{chunk-JOCDD4ON.js → chunk-N4BLPJC7.js} +1 -1
- package/dist/{chunk-HFGZGYCG.js → chunk-QYXDJOLA.js} +252 -6
- package/dist/{chunk-DVMLWQD4.js → chunk-SO5LKIWP.js} +2 -2
- package/dist/{chunk-VYXXOKYS.js → chunk-XKIW3QMF.js} +7 -4
- package/dist/{chunk-MAPZ7VB6.js → chunk-YVGXGTD6.js} +13 -0
- package/dist/{community-report-client-CU22W53K.js → community-report-client-6VJDDMJJ.js} +1 -1
- package/dist/{config-XO3LI3SA.js → config-XQWOPDHN.js} +25 -6
- package/dist/{context-IFJI3LIT.js → context-M3HDGEIR.js} +4 -4
- package/dist/{data-integration-HNGUKFIC.js → data-integration-XBTCGXQT.js} +6 -6
- package/dist/index.js +78 -41
- package/dist/{local-data-upload-client-GTRIT64F.js → local-data-upload-client-3P7NIVQ4.js} +1 -1
- package/dist/{memory-QGPSNCQS.js → memory-6APEB2JB.js} +4 -4
- package/dist/{metadata-DI5BMYFU.js → metadata-JRYKNUS5.js} +7 -7
- package/dist/{model-RNPQXIBI.js → model-ZS7HVGKN.js} +4 -4
- package/dist/{personal-semantic-preference-5C3WUXFI.js → personal-semantic-preference-IDE2GE5T.js} +8 -6
- package/dist/project-semantic-36KOCYN7.js +356 -0
- package/dist/{sync-O45NXEQY.js → sync-EQLSTUS7.js} +7 -7
- package/dist/{te-agent-K5MSPNHJ.js → te-agent-Z3HCTKR7.js} +348 -55
- package/dist/{te-analysis-AISWCOOZ.js → te-analysis-5ZZ6YHVH.js} +940 -144
- package/dist/{te-community-4OYU3BDA.js → te-community-Z7JACGF3.js} +3 -3
- package/dist/{te-dataops-NFIPB6FX.js → te-dataops-F7GQOIS6.js} +644 -276
- package/dist/{te-engage-BAM3GBFX.js → te-engage-RNRMYDO3.js} +6 -6
- package/dist/{te-experiment-GUTZXZ5Z.js → te-experiment-BTAC2UNK.js} +6 -6
- package/dist/{te-kb-3TS73NO6.js → te-kb-QJLJEX5K.js} +323 -181
- package/dist/{te-system-STMHLS5J.js → te-system-IXC43QHZ.js} +6 -6
- package/dist/{te-team-3I5AOX3N.js → te-team-BIZIKIHZ.js} +6 -6
- package/dist/{update-RZXLPCRH.js → update-W2SGQNKT.js} +4 -4
- package/package.json +11 -4
- package/skills/ae-agent/SKILL.md +9 -4
- package/skills/ae-agent/references/notification.md +40 -0
- package/skills/ae-analysis/SKILL.md +44 -21
- package/skills/ae-analysis/references/adhoc_export.md +1 -1
- package/skills/ae-analysis/references/adhoc_run.md +1 -1
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +3 -1
- package/skills/ae-analysis/references/ai_models/event.md +6 -1
- package/skills/ae-analysis/references/ai_models/funnel.md +7 -1
- package/skills/ae-analysis/references/ai_models/heat_map.md +23 -0
- package/skills/ae-analysis/references/ai_models/interval.md +24 -0
- package/skills/ae-analysis/references/ai_models/path.md +20 -0
- package/skills/ae-analysis/references/ai_models/prop_analysis.md +2 -0
- package/skills/ae-analysis/references/ai_models/rank_list.md +30 -0
- package/skills/ae-analysis/references/ai_models/retention.md +45 -1
- package/skills/ae-analysis/references/ai_models/revenue.md +20 -2
- package/skills/ae-analysis/references/ai_models/session.md +76 -0
- package/skills/ae-analysis/references/ai_models/tag.md +2 -0
- package/skills/ae-analysis/references/ai_models.md +76 -6
- package/skills/ae-analysis/references/analysis_data_retrieval.md +4 -0
- package/skills/ae-analysis/references/analysis_drilldown_contract.md +4 -1
- package/skills/ae-analysis/references/asset_batch_info_export.md +10 -0
- package/skills/ae-analysis/references/asset_batch_sql_export.md +13 -1
- package/skills/ae-analysis/references/asset_export.md +12 -1
- package/skills/ae-analysis/references/asset_list.md +1 -0
- package/skills/ae-analysis/references/asset_search.md +11 -5
- package/skills/ae-analysis/references/bi_panel_list.md +1 -1
- package/skills/ae-analysis/references/catalog_list.md +1 -1
- package/skills/ae-analysis/references/collaboration.md +48 -0
- package/skills/ae-analysis/references/command_index.md +19 -17
- package/skills/ae-analysis/references/dashboard_list.md +4 -4
- package/skills/ae-analysis/references/dashboard_report_data_export.md +2 -0
- package/skills/ae-analysis/references/drilldown_session_details_run.md +41 -0
- package/skills/ae-analysis/references/event_export.md +3 -1
- package/skills/ae-analysis/references/governance_recommendation_auto_review.md +77 -0
- package/skills/ae-analysis/references/governance_recommendation_export.md +11 -0
- package/skills/ae-analysis/references/metadata_resolution.md +3 -3
- package/skills/ae-analysis/references/metric_export.md +3 -1
- package/skills/ae-analysis/references/metric_list.md +1 -1
- package/skills/ae-analysis/references/operation_record_export.md +10 -0
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +2 -2
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +4 -4
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +4 -4
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +30 -12
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +59 -0
- package/skills/ae-analysis/references/property_export.md +3 -1
- package/skills/ae-analysis/references/report_create.md +5 -1
- package/skills/ae-analysis/references/report_data_export.md +6 -0
- package/skills/ae-analysis/references/report_get.md +2 -0
- package/skills/ae-analysis/references/report_list.md +5 -5
- package/skills/ae-analysis/references/report_update.md +7 -1
- package/skills/ae-analysis/references/sql_table_columns.md +4 -4
- package/skills/ae-analysis/references/sql_table_list.md +5 -5
- package/skills/ae-analysis/references/user_cluster_models.md +8 -0
- package/skills/ae-analysis/references/user_tag_create.md +7 -1
- package/skills/ae-analysis/references/user_tag_get.md +1 -1
- package/skills/ae-analysis/references/user_tag_models.md +18 -2
- package/skills/ae-analysis/references/user_tag_refresh.md +1 -1
- package/skills/ae-analysis/references/user_tag_update.md +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +337 -12
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +8 -3
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +284 -24
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs +185 -22
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/precompiled-source.mjs +46 -2
- package/skills/ae-capability/SKILL.md +63 -1
- package/skills/ae-capability/references/collaboration.md +48 -0
- package/skills/ae-community/SKILL.md +5 -1
- package/skills/ae-community/references/collaboration.md +48 -0
- package/skills/ae-data-integration/SKILL.md +4 -0
- package/skills/ae-data-integration/references/collaboration.md +48 -0
- package/skills/ae-data-integration-helper/references/cpp_server_sdk_faq.md +2 -2
- package/skills/ae-data-integration-helper/references/logbus2_parser_plugin.md +6 -6
- package/skills/ae-data-integration-helper/references/sdk_log_guide.md +4 -4
- package/skills/ae-dataops/SKILL.md +54 -74
- package/skills/ae-dataops/references/collaboration.md +48 -0
- package/skills/ae-dataops/references/dataops-backfill.md +23 -18
- package/skills/ae-dataops/references/dataops-flow-create.md +74 -23
- package/skills/ae-dataops/references/dataops-flow-monitor.md +45 -13
- package/skills/ae-dataops/references/dataops-integration.md +57 -30
- package/skills/ae-dataops/references/dataops-query.md +21 -4
- package/skills/ae-dataops/references/dataops-table.md +143 -11
- package/skills/ae-engage/SKILL.md +21 -6
- package/skills/ae-engage/references/add-channel.md +3 -3
- package/skills/ae-engage/references/channel-mgmt.md +3 -3
- package/skills/ae-engage/references/collaboration.md +48 -0
- package/skills/ae-engage/references/common-metric.md +2 -2
- package/skills/ae-engage/references/save-task.md +2 -2
- package/skills/ae-engage/references/scene-config-channel.md +4 -4
- package/skills/ae-generate-tracking-code/SKILL.md +1 -1
- package/skills/ae-generate-tracking-plan/SKILL.md +4 -0
- package/skills/ae-generate-tracking-plan/references/collaboration.md +48 -0
- package/skills/ae-kb/SKILL.md +9 -1
- package/skills/ae-kb/references/collaboration.md +48 -0
- package/skills/ae-kb/references/schema-import.md +30 -0
- package/skills/ae-kb-discovery/SKILL.md +7 -2
- package/skills/ae-kb-discovery/references/collaboration.md +48 -0
- package/skills/ae-metadata/SKILL.md +20 -12
- package/skills/ae-metadata/references/collaboration.md +48 -0
- package/dist/project-semantic-3LF6Q6JZ.js +0 -1119
- package/skills/ae-project-semantic/SKILL.md +0 -193
- package/skills/ae-project-semantic/references/query-routing-v5.md +0 -165
- package/skills/ae-project-semantic/references/recommendation-quality.md +0 -68
|
@@ -11,6 +11,16 @@ Do not load project semantics, project KB, or personal semantic preferences befo
|
|
|
11
11
|
|
|
12
12
|
Hard output gate: a final answer is invalid if it is grouped by asset type, backend array order, raw `work_units`, source dashboard, source report, or separate top-level asset and metric sections. The final answer must follow the fixed business-domain review display below.
|
|
13
13
|
|
|
14
|
+
## Intent Routing
|
|
15
|
+
|
|
16
|
+
There are three separate user intents. Do not merge them.
|
|
17
|
+
|
|
18
|
+
- Recommendation only: call `analysis-meta governance-recommendation export`, present the evidence-backed recommendations, and stop. Do not check the automatic certification project config, do not submit to the review page, and do not certify assets.
|
|
19
|
+
- Recommendation plus page submission: call `analysis-meta governance-recommendation export`, build the review material, then call `analysis-meta agent-review submit-to-page` only after that submission intent is explicit. Do not check the automatic certification project config and do not certify assets.
|
|
20
|
+
- Automatic review or automatic certification: call `analysis-meta governance-recommendation auto-review`. This command validates both `agent_auto_asset_certification_enabled` and `project_semantic_enable` before collecting recommendations. If it returns `PROJECT_AUTO_CERTIFICATION_DISABLED` or `PROJECT_SEMANTIC_DISABLED`, tell the user which project config is disabled and stop. Do not fall back to page submission or ordinary approval commands.
|
|
21
|
+
|
|
22
|
+
`analysis-meta governance-recommendation auto-review` only certifies eligible asset candidates from its current recommendation batch. When `--limit` is omitted, the CLI mirrors the recurring page-review bounded expansion flow by read-only probing top-20/top-50/top-100 pending material, then the CLI Agent builds one automatic decision set from the final selected material and submits it for execution/audit. It does not create recommended metrics. Assets that return `decision:"SKIP"` remain for manual review and must not be described as certified. Automatic decision rows must provide reviewer-readable reasons; semantic-duplicate skips must name concrete conflicting asset targets. Keep raw source/rule traces only in debug output, and preserve the returned `auto_review_expansion` when reporting or auditing the result. If the user later asks to submit the remaining uncertified assets to the page, use `manual_review_handoff` from the auto-review result rather than drafting a fresh all-candidate page batch.
|
|
23
|
+
|
|
14
24
|
Command:
|
|
15
25
|
|
|
16
26
|
```bash
|
|
@@ -103,6 +113,7 @@ Use this fixed review skeleton:
|
|
|
103
113
|
## Related Commands
|
|
104
114
|
|
|
105
115
|
- `analysis-meta agent-review submit-to-page` submits existing-asset proposals for review after user choice or preauthorized submission-only task intent; it does not approve or certify. Read `agent_review_submit_to_page.md` for deduplication and unattended-task rules.
|
|
116
|
+
- `analysis-meta governance-recommendation auto-review` automatically certifies only eligible recommended asset candidates when the user explicitly asks for automatic review/certification and the project switches are enabled. Without an explicit `--limit`, it performs CLI-side bounded expansion and writes only once. Read `governance_recommendation_auto_review.md`.
|
|
106
117
|
- `analysis-meta governance-recommendation submit`
|
|
107
118
|
- `analysis-meta governance-recommendation decisions`
|
|
108
119
|
- `analysis-meta asset-authentication list` only inspects certification state and is not the recommendation workflow.
|
|
@@ -4,14 +4,14 @@ Reuse verified assets, canonical names and business meanings in the current proj
|
|
|
4
4
|
|
|
5
5
|
## Find a reusable definition
|
|
6
6
|
|
|
7
|
-
For an unknown business measure, search relevant saved metrics and
|
|
7
|
+
For an unknown business measure, search relevant saved metrics and readable analysis assets. A named asset needs only its own family; already known definitions go directly to execution. Read the selected [metric](metric_list.md) and [asset search](asset_search.md) command references together, then issue independent searches in the same model turn:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
ae-cli analysis-meta metric list \
|
|
11
11
|
--project-id <project_id> \
|
|
12
12
|
--queries '["<user phrase>","<related English term>"]'
|
|
13
13
|
|
|
14
|
-
ae-cli analysis
|
|
14
|
+
ae-cli analysis asset search \
|
|
15
15
|
--project-id <project_id> \
|
|
16
16
|
--queries '["<user phrase>","<related English term>"]'
|
|
17
17
|
```
|
|
@@ -20,7 +20,7 @@ Use the user's business terms and a few relevant English terms in the same `--qu
|
|
|
20
20
|
|
|
21
21
|
Read metrics from `data.metrics`. With `--queries` and no `--fields`, the response includes `metric_events` and `metric_params` as JSON strings. Inspect those returned definitions directly; use `metric get` only for missing details. Field projection cannot select these two definition fields. A verified saved metric is referenced by `metric_name` in `metrics[].event` and supplies its own aggregation and property.
|
|
22
22
|
|
|
23
|
-
Read
|
|
23
|
+
Read saved-asset summaries from `data.items`; report and dashboard search matches names and descriptions. For a suitable report candidate, pass its `asset_numeric_id` to `analysis report get --project-id <project_id> --report-id <report_id>` to read `data.model_type` and `data.definition`; reuse a definition already read.
|
|
24
24
|
|
|
25
25
|
Compare the candidate's events, aggregation, filters, groups and time semantics with the request. An applicable report goes directly to [report-data run](report_data_run.md) with the supported requested overrides. A custom combination reuses suitable definitions in an AI-facing model. Saved metric JSON describes its measure; it is not itself a complete ad-hoc definition. Discover only the pieces still missing below.
|
|
26
26
|
|
|
@@ -13,7 +13,9 @@ ae-cli analysis-meta metric export --project-id <project_id> --queries '["pay","
|
|
|
13
13
|
|
|
14
14
|
Capability id: `metadata.metric.export`.
|
|
15
15
|
|
|
16
|
-
Input: the gateway receives `project_id` plus optional `ignore_authentication`, `queries`, `fields`, and `
|
|
16
|
+
Input: the gateway receives `project_id` plus optional `ignore_authentication`, `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
|
|
|
@@ -31,7 +31,7 @@ Output always uses the directory envelope: `data.metrics[]`, `total`, `limit`, `
|
|
|
31
31
|
| `--authenticated-only` | No | When true, return only authenticated metrics. |
|
|
32
32
|
|
|
33
33
|
## Decision Rules
|
|
34
|
-
- For an unknown business measure, use this with
|
|
34
|
+
- For an unknown business measure, use this with `analysis asset search` as the saved-definition discovery path in [`metadata_resolution.md`](metadata_resolution.md). Reuse a verified saved metric name directly.
|
|
35
35
|
- Use `--fields` when its projected fields are sufficient. When searching with `--queries`, omit `--fields` to keep `metric_events` and `metric_params` as JSON strings. Read their content in this response; these two fields are not in the projection whitelist.
|
|
36
36
|
- Use `analysis-meta metric get` only when a required definition detail is absent from the returned row.
|
|
37
37
|
- For a complete result, use `analysis-meta metric export`; do not page repeatedly to synthesize an export.
|
|
@@ -22,3 +22,13 @@ Output `data` is an async XLSX descriptor with `run_id`, `artifact_id`, status,
|
|
|
22
22
|
| --project-id | Yes | Numeric project ID. |
|
|
23
23
|
| --record-id | No | Operation record ID; required unless provided inside payload. |
|
|
24
24
|
| --payload | No | Optional JSON object merged into top-level input. Use schema-declared snake_case fields; explicit flags take precedence. `node_ids`, `searchs`, and `status` are arrays; `rule` is an object when supplied. |
|
|
25
|
+
|
|
26
|
+
## Asynchronous export
|
|
27
|
+
|
|
28
|
+
This capability starts an asynchronous artifact export. Use `--wait --output <path>` to wait and download, or keep the returned `run_id` for query status and cancellation. `--force` allows overwriting the selected local output file.
|
|
29
|
+
|
|
30
|
+
- `--artifact-format xlsx` selects the logical data format. Follow the returned descriptor for compression and content type.
|
|
31
|
+
- `--request-id cli_<32 lowercase hex>` assigns a stable request identifier.
|
|
32
|
+
- `--timeout-seconds` accepts 1–7200 (server default: 3600).
|
|
33
|
+
- `--wait-timeout-seconds` controls how long this CLI invocation waits; it does not change the server runtime limit.
|
|
34
|
+
- Explicit flags override corresponding `--payload` fields; omitted options preserve payload values.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Add one personal semantic preference for the authenticated user in one project.
|
|
4
4
|
|
|
5
|
-
Use this when the user explicitly asks to save a personal semantic preference, or when the current project task contains an explicit stable statement, correction, or confirmation that should become a reusable current-user preference. A current-user working definition remains eligible even when the same content may benefit other users. A second "save" confirmation is not required after that evidence gate is met, unless the target meaning is ambiguous.
|
|
5
|
+
Use this when the user explicitly asks to save a personal semantic preference, or when the current project task contains an explicit stable statement, correction, reusable workflow, or confirmation that should become a reusable current-user preference. When a project scope is active, requests such as "remember the above workflow", "save this process for this project", or "以后按这个流程" are project-scoped personal semantics, not global memory; store reusable workflows with `context_type=experience`. A current-user working definition remains eligible even when the same content may benefit other users. A second "save" confirmation is not required after that evidence gate is met, unless the target meaning is ambiguous.
|
|
6
6
|
|
|
7
7
|
Command:
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Command:
|
|
|
10
10
|
ae-cli personal-semantic-preference add --project-id <project_id> --context-type <context_type> --title <title> --summary <summary> --content <content> [--keywords '["keyword"]'] [--resource-refs '[{"resource_type":"report","resource_key":"101","display_name":"Revenue daily report"}]'] [--fresh-until-at "yyyy-MM-dd HH:mm:ss"] [--request-id <id>]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Use `preference` for durable interpretation/output preferences, `asset_context` for durable wording or intent bound to exact assets, `experience` for confirmed reusable work methods, and `background` for stable personal context. `--resource-refs` is required and non-empty only for `asset_context`; for every other type it must be absent or empty.
|
|
13
|
+
Use `preference` for durable interpretation/output preferences, `asset_context` for durable wording or intent bound to exact assets, `experience` for confirmed reusable project work methods or analysis workflows, and `background` for stable personal context. `--resource-refs` is required and non-empty only for `asset_context`; for every other type it must be absent or empty.
|
|
14
14
|
|
|
15
15
|
`--resource-refs` accepts 1 to 50 ordered objects. Each object contains exactly `resource_type`, string `resource_key`, and `display_name`; `(resource_type, resource_key)` must be unique. `resource_type` is generic lower snake_case rather than a report-only enum, so events, properties, metrics, tags, clusters, reports, dashboards, data tables, and later asset types share the same shape. Array order is the user's intended priority.
|
|
16
16
|
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Get one personal semantic preference by ID.
|
|
4
4
|
|
|
5
|
-
Use this command after `personal-semantic-preference list` identifies a likely current-user preference. Pass `--mark-used` when the preference is adopted for the answer, query path, or as the matched target for an update.
|
|
5
|
+
Use this command after `personal-semantic-preference list` identifies a likely current-user preference. Pass the returned directory title with `--title`; it is telemetry context only, and the lookup still uses `id`. Pass `--mark-used` when the preference is adopted for the answer, query path, or as the matched target for an update.
|
|
6
6
|
|
|
7
7
|
Command:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
ae-cli personal-semantic-preference get --project-id <project_id> --id <preference_id> [--mark-used]
|
|
10
|
+
ae-cli personal-semantic-preference get --project-id <project_id> --id <preference_id> --title <title_from_list> [--mark-used]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Input uses `project_id`, `id`, and optional `mark_used`. `id` must be the exact `preference_<id>` value returned by list/add.
|
|
13
|
+
Input uses `project_id`, `id`, required `title`, and optional `mark_used`. `id` must be the exact `preference_<id>` value returned by list/add. `title` must be copied from the matching list item; do not invent it.
|
|
14
14
|
|
|
15
15
|
Do not use this command as a keyword search, project semantics lookup, or asset catalog lookup. Do not call it repeatedly for every catalog row. Do not use `--mark-used` for a candidate that turns out not to match the user's intent or is only inspected and then rejected.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Fetch and mark the personal item only when it materially affects the response. When its asset or calculation wording differs from the current saved definition, explain the difference and use the saved definition for execution unless the user explicitly requests a different calculation.
|
|
18
18
|
|
|
19
19
|
Output is the gateway envelope. `data.preference` contains the full personal preference, including content, complete ordered `resource_refs`, and revision. When `--mark-used` is set, the backend increments `heat_count` and updates `last_used_at` for that record.
|
|
@@ -16,9 +16,9 @@ Do not use this command for project semantics, shared knowledge, metadata catalo
|
|
|
16
16
|
|
|
17
17
|
Output is the gateway envelope. `data.items[]` contains only `id`, `context_type`, `title`, truncated `summary`, limited `keywords`, `resource_ref_count`, distinct `resource_types`, and `revision`; it deliberately omits content, full asset references, heat, and timestamps. `data.returned_count` is at most 200, `data.truncated` says whether entries were omitted, and `data.selection_policy` is `HOT_160_PLUS_RECENT_40`: up to 160 highest-heat items plus up to 40 recently changed items not already selected. The backend may return fewer items to keep the data payload within 64 KiB.
|
|
18
18
|
|
|
19
|
-
If one returned item is actually adopted to interpret the user's request, call `ae-cli personal-semantic-preference get --project-id <project_id> --id <preference_id> --mark-used` before using its full content. Do not mark an item used when it was only inspected or rejected.
|
|
19
|
+
If one returned item is actually adopted to interpret the user's request, call `ae-cli personal-semantic-preference get --project-id <project_id> --id <preference_id> --title <title_from_list> --mark-used` before using its full content. The `--title` value is telemetry context only; the backend lookup is still keyed by `id`. Do not mark an item used when it was only inspected or rejected.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Use a likely match only as the current user's working interpretation. Verify any chosen asset or calculation against its saved definition before execution. A personal preference does not replace the asset's current definition.
|
|
22
22
|
|
|
23
23
|
## Capture a durable preference
|
|
24
24
|
|
|
@@ -26,10 +26,10 @@ The Agent owns the personal preference capture trigger. Choose `context_type` by
|
|
|
26
26
|
|
|
27
27
|
- `preference`: durable interpretation or output preference without an exact asset binding.
|
|
28
28
|
- `asset_context`: durable user wording or intent bound to one or more exact project assets. Send the complete ordered `resource_refs` array; each item has `resource_type`, string `resource_key`, and `display_name`. This identity is generic across reports, dashboards, events, properties, metrics, tags, clusters, data tables, and future asset types.
|
|
29
|
-
- `experience`: a confirmed reusable work method without an exact asset binding.
|
|
29
|
+
- `experience`: a confirmed reusable project work method or analysis workflow without an exact asset binding.
|
|
30
30
|
- `background`: stable personal context without an exact asset binding.
|
|
31
31
|
|
|
32
|
-
Any stable choice of a concrete asset, including an event-selection scenario, must use `asset_context`; do not encode asset IDs only in prose. A current-user working definition remains eligible for personal storage even when it would also benefit other users. Store it only as the current user's preference; do not copy the bound asset definition into its content or imply that it is shared authority. Keep future governance or lifecycle instructions out of the stored content. Do not save transient task details, one-off analysis results, company knowledge, or standalone metadata facts.
|
|
32
|
+
Any stable choice of a concrete asset, including an event-selection scenario, must use `asset_context`; do not encode asset IDs only in prose. In an active project scope, a user request such as "remember the above workflow", "save this process for this project", or "以后按这个流程" should be captured here as `context_type=experience`, not through `ae-cli memory`. A current-user working definition remains eligible for personal storage even when it would also benefit other users. Store it only as the current user's preference; do not copy the bound asset definition into its content or imply that it is shared authority. Keep future governance or lifecycle instructions out of the stored content. Do not save transient task details, one-off analysis results, company knowledge, or standalone metadata facts.
|
|
33
33
|
|
|
34
34
|
An explicit stable statement, correction, or confirmation that passes that evidence gate authorizes `personal-semantic-preference add` or `update` without a second "save" confirmation. Compare against the already loaded catalog first; when one existing preference matches, fetch it with `--mark-used`, update that existing preference, and avoid creating a duplicate. Otherwise add a new one. An explicit instruction not to retain it always wins. Delete remains high risk and requires explicit user confirmation.
|
|
35
35
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Project Semantic Knowledge Base Wiki
|
|
2
2
|
|
|
3
|
-
|
|
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
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.
|
|
6
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.
|
|
8
|
+
|
|
7
9
|
## Boundary
|
|
8
10
|
|
|
9
11
|
- 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.
|
|
@@ -17,7 +19,7 @@ Build one server-consumable project semantic source Wiki from one immutable Comm
|
|
|
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
|
|
|
@@ -31,10 +33,10 @@ The KB description is part of Agent auto-loading and source selection, not a cas
|
|
|
31
33
|
<project_name><asset_scope_label>项目语义知识库,用于辅助 Agent 在分析前召回业务域、资产口径、SQL 报表语义和治理边界。
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
For example:
|
|
36
|
+
For example, using a fictional project name:
|
|
35
37
|
|
|
36
38
|
```text
|
|
37
|
-
|
|
39
|
+
示例项目已认证资产项目语义知识库,用于辅助 Agent 在分析前召回业务域、资产口径、SQL 报表语义和治理边界。
|
|
38
40
|
```
|
|
39
41
|
|
|
40
42
|
```bash
|
|
@@ -90,7 +92,7 @@ The source tree only classifies material. Authority still comes from explicit fa
|
|
|
90
92
|
## First build: precompiled Markdown sources and KB compilation
|
|
91
93
|
|
|
92
94
|
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.
|
|
95
|
+
2. Preserve the local planning and rendering stages. Read the compact knowledge indexes, including dashboard notes, and only the normalized details needed for project positioning, business objects, object relationships, judgment chains, 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. Do not hardcode project names, business domains, asset IDs, event names, metric names, 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
96
|
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
97
|
|
|
96
98
|
```bash
|
|
@@ -103,7 +105,7 @@ The source tree only classifies material. Authority still comes from explicit fa
|
|
|
103
105
|
```
|
|
104
106
|
|
|
105
107
|
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`,
|
|
108
|
+
4. Review the local project business model, domain judgment models, asset meanings, SQL summaries, 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. 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 and their dependent domains/cards only on refresh; reuse unchanged semantic plan entries.
|
|
107
109
|
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
110
|
|
|
109
111
|
Package the builder's prepared Markdown sources into the source tree:
|
|
@@ -131,17 +133,33 @@ Poll `+status`; never poll by resubmitting Schema. Schema/compile failure stops
|
|
|
131
133
|
|
|
132
134
|
## Refresh: update changed Markdown sources
|
|
133
135
|
|
|
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:
|
|
136
|
+
Regenerate the local Wiki using the existing semantic-plan contract. On refresh, reuse unchanged semantic-plan 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, 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, 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:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs \
|
|
140
|
+
--asset-package <tmp>/project-assets-next \
|
|
141
|
+
--semantic-plan <previous-or-updated-semantic-plan.json> \
|
|
142
|
+
--output <next>/project-semantic-wiki \
|
|
143
|
+
--archive <next>/project-semantic-wiki.zip \
|
|
144
|
+
--project-name '<project_name>' \
|
|
145
|
+
--allow-semantic-plan-snapshot-drift
|
|
146
|
+
```
|
|
135
147
|
|
|
136
148
|
```bash
|
|
137
149
|
node skills/ae-analysis/scripts/project-semantic-knowledge-wiki/package-wiki-source-zip.mjs \
|
|
138
150
|
--source-dir <next>-kb-upload-sources \
|
|
139
151
|
--tree-output <next>-kb-source-tree \
|
|
140
152
|
--manifest-output <next>-kb-source-tree-manifest.json \
|
|
141
|
-
--previous-
|
|
153
|
+
--previous-refresh-state <remote-refresh-state.md> \
|
|
154
|
+
--embed-refresh-state-baseline \
|
|
155
|
+
--baseline-source-id <zip_source_id> \
|
|
156
|
+
--baseline-content-revision <current_content_revision> \
|
|
157
|
+
--baseline-published-version-id <published_version_id>
|
|
142
158
|
```
|
|
143
159
|
|
|
144
|
-
The
|
|
160
|
+
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 only `sources/project/<namespace>-refresh-state.md`. The refresh state hidden payload 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. If it 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.
|
|
161
|
+
|
|
162
|
+
The returned plan contains add/replace/remove actions and unchanged paths under `sources/...`, with `skip` or `incremental` compilation. `--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 saved source-tree manifest hash for that path; preserve unexpected manual edits and stop on conflicts. After successful writes, replace the managed refresh-state source with the new payload produced by `--embed-refresh-state-baseline` so the next run remains independent of local state. 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
163
|
|
|
146
164
|
For each changed path, obtain the current revision and perform one existing command through the wrapper:
|
|
147
165
|
|
|
@@ -153,11 +171,11 @@ node "$KB_RUN" +source-rm --name '<company_kb_name>' --id <zip_source_id> \
|
|
|
153
171
|
--path <removed-generated-path> --expected-revision <revision> --host <host>
|
|
154
172
|
```
|
|
155
173
|
|
|
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.
|
|
174
|
+
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
175
|
|
|
158
176
|
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.
|
|
159
177
|
|
|
160
|
-
Compiled navigation must stay decision-oriented. The generated Wiki homepage should
|
|
178
|
+
Compiled navigation must stay decision-oriented. The generated Wiki homepage should first point to the project business model, then business domains, recall cards, category indexes, governance/review pages, and a small set of representative titled entries only. It should not list 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.
|
|
161
179
|
|
|
162
180
|
## Acceptance and readback
|
|
163
181
|
|
|
@@ -171,7 +189,7 @@ node "$KB_RUN" +grep --name '<company_kb_name>' --query '<business question or m
|
|
|
171
189
|
node "$KB_RUN" +read --name '<company_kb_name>' --path '<path copied from index or grep>' --host <host>
|
|
172
190
|
```
|
|
173
191
|
|
|
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.
|
|
192
|
+
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
193
|
|
|
176
194
|
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
195
|
|
|
@@ -7,6 +7,46 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
|
|
|
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": [
|
|
@@ -82,7 +136,11 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
|
|
|
82
136
|
## Rules
|
|
83
137
|
|
|
84
138
|
- Every dashboard occurs exactly once across `domains[].dashboard_ids` and `appendices[].dashboard_ids`.
|
|
139
|
+
- `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.
|
|
140
|
+
- `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.
|
|
141
|
+
- 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.
|
|
85
142
|
- Domain titles represent business retrieval topics, not physical dashboard-space names.
|
|
143
|
+
- 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
144
|
- 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
145
|
- Every excluded ref names a concrete reason. A duplicate should name its canonical resource when known.
|
|
88
146
|
- 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 +148,5 @@ The Agent authors exactly one plan per asset-package snapshot. The builder valid
|
|
|
90
148
|
- `sql_report_semantics[].evidence_locator` exactly equals that report's packaged `source_detail_path`; never cite an external or guessed SQL definition.
|
|
91
149
|
- 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
150
|
- 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.
|
|
151
|
+
- 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
152
|
- 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 `
|
|
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
|
|
|
@@ -4,7 +4,7 @@ Use when the user explicitly wants to create a saved analysis report from an AI
|
|
|
4
4
|
|
|
5
5
|
Do not use raw QP, `analysis_query`, `events`, `event_view`, or `visual_view`. The gateway accepts `model_type` plus AI QP `definition`.
|
|
6
6
|
|
|
7
|
-
Read [`ai_models.md`](ai_models.md) for the single AI-facing model registry. Report create supports the
|
|
7
|
+
Read [`ai_models.md`](ai_models.md) for the single AI-facing model registry. Report create supports the 13 analysis models plus `tag` for saved tag report data.
|
|
8
8
|
|
|
9
9
|
Command:
|
|
10
10
|
|
|
@@ -16,6 +16,8 @@ When the caller supplies an existing snapshot, optional `--intent-snapshot` acce
|
|
|
16
16
|
|
|
17
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`.
|
|
18
18
|
|
|
19
|
+
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.
|
|
20
|
+
|
|
19
21
|
Output is the gateway envelope. `data` contains the created `report_id`, creation status, normalized `model_type`, AI QP `definition`, and optional resolution warnings.
|
|
20
22
|
|
|
21
23
|
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.
|
|
@@ -33,3 +35,5 @@ ae-cli analysis report create --project-id <project_id> --report-name "Recent SQ
|
|
|
33
35
|
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
36
|
|
|
35
37
|
After any successful report create, call `analysis-meta asset url-get` with that returned `report_id` and output its `markdown_link`.
|
|
38
|
+
|
|
39
|
+
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.
|
|
@@ -16,6 +16,8 @@ This command reads saved definition metadata and deliberately has no `--use-cach
|
|
|
16
16
|
|
|
17
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.
|
|
18
18
|
|
|
19
|
+
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.
|
|
20
|
+
|
|
19
21
|
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
22
|
|
|
21
23
|
For a saved non-SQL report with a time granularity, `data.definition` returns the agent-facing `time_particle_size` spelling, such as `day`, `hour`, or `total`; internal `T0` through `T9` codes must never leak. If `time_particle_size` is absent, the saved definition has no readable granularity. Do not infer a granularity from the number of result rows; execute the saved report as-is or use an explicit ad-hoc definition when the user requires a specific granularity.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# analysis report list
|
|
2
2
|
|
|
3
|
-
Use when the user needs
|
|
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.
|
|
@@ -4,7 +4,7 @@ Use when the user explicitly wants to update saved report metadata or replace it
|
|
|
4
4
|
|
|
5
5
|
Do not use raw QP, `qp`, `report_model`, or `analysis_query`. When changing the definition, pass `model_type` and AI QP `definition` together.
|
|
6
6
|
|
|
7
|
-
Read [`ai_models.md`](ai_models.md) for the single AI-facing model registry. Report update supports the
|
|
7
|
+
Read [`ai_models.md`](ai_models.md) for the single AI-facing model registry. Report update supports the 13 analysis models plus `tag` for saved tag report data.
|
|
8
8
|
|
|
9
9
|
Command:
|
|
10
10
|
|
|
@@ -17,6 +17,8 @@ When the caller supplies an existing snapshot, optional `--intent-snapshot` acce
|
|
|
17
17
|
|
|
18
18
|
Input sends `project_id`, `report_id`, `version` from CLI `--report-version`, and at least one of `report_name`, `report_desc`, or `definition`. Read `version` from `analysis report get` before updating. `model_type` is required when `definition` is provided; `resolutions` is allowed only when a definition is provided and is not supported with `model_type=tag`.
|
|
19
19
|
|
|
20
|
+
Definition replacement follows the filter write boundary in [`ai_models.md`](ai_models.md): one compound group level with leaf-only, non-empty `items`. A deeper historical tree remains readable, but a deeper tree or empty group submitted for writing is rejected by the capability schema as `INVALID_CAPABILITY_INPUT`; use the returned field path or schema keyword to correct it. Omit `definition` for metadata-only changes and never flatten it.
|
|
21
|
+
|
|
20
22
|
Output is the gateway envelope. `data` contains update status, `report_id`, and the normalized AI QP definition when a definition was updated.
|
|
21
23
|
|
|
22
24
|
When a definition is supplied, update and its `--validate` / `--dry-run` paths use the same compiler contract. `AI_QP_COMPILE_FAILED` preserves the full structured error array. The report is not changed on this failure; follow [`metadata_resolution.md`](metadata_resolution.md), keep each bound field's path and original wording, fill confirmed model parameters, and retry with `--resolutions` only after confirmation.
|
|
@@ -26,3 +28,7 @@ For the shortest safe update, read the current `version` exactly once with `anal
|
|
|
26
28
|
For a SQL `part_date` parameter, `use_timezone` is a boolean saved definition field with default `false`. Change it only by submitting the complete updated `definition`; report-data `--sql-params` is value-only and must not contain `use_timezone`.
|
|
27
29
|
|
|
28
30
|
After a successful update, call `analysis-meta asset url-get` with the updated `report_id` and output its `markdown_link`.
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
Use `--report-desc ""` to clear an existing description. Omitting `--report-desc` preserves the saved description. Clearing only the description is a valid metadata-only update.
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
List queryable columns for one server-authorized SQL table.
|
|
4
4
|
|
|
5
|
-
For an unknown table, first call `analysis sql-table list --project-id <project_id>`, then copy
|
|
5
|
+
For an unknown table, first call `analysis sql-table list --project-id <project_id>`, then copy the returned `sql_reference` (or legacy `table_ref`). Reuse an already verified authorized table reference in the same scope. Do not guess table or column names.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
ae-cli analysis sql-table columns \
|
|
9
9
|
--project-id <project_id> \
|
|
10
10
|
--table-ref <table_ref> \
|
|
11
|
-
[--usage analysis|tag_cluster]
|
|
11
|
+
[--usage analysis|tag_cluster|sql_datatable]
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
The result
|
|
14
|
+
The result includes `table_ref`, quoted `sql_reference`, `table_type`, nullable `source_type` and `repo_table_type`, and the resolved catalog/schema/table, and returns its columns with machine names, types, and available descriptions. A unique table-only reference is accepted; ambiguous references fail with authorized `candidate_tables` with quoted `sql_reference` values instead of selecting one arbitrarily. Quote the entire shell argument, for example `--table-ref '"hive"."space.name"."orders"'`. Double quotes inside an identifier are doubled. One to three identifier segments are supported; a two-segment reference uses the `hive` catalog.
|
|
15
15
|
|
|
16
|
-
Pass the same `usage` used for `sql-table list`. For SQL tags and SQL clusters this must be `--usage tag_cluster`; the default is `analysis`.
|
|
16
|
+
Pass the same `usage` used for `sql-table list`. For SQL tags and SQL clusters this must be `--usage tag_cluster`; use `--usage sql_datatable` for SQL-built data tables; the default is `analysis`. Do not fall back to another usage if the server rejects it.
|
|
17
17
|
|
|
18
18
|
When copying returned columns into Trino SQL, delimit identifiers containing `#`, `$`, `@`, spaces, or punctuation with double quotes, for example `"#user_id"` or `"$part_event"`. Single quotes are string literals. The CLI does not auto-rewrite SQL.
|
|
19
19
|
|
|
@@ -10,16 +10,16 @@ ae-cli analysis sql-table list \
|
|
|
10
10
|
[--queries '["user","event"]'] \
|
|
11
11
|
[--limit <1-200>] \
|
|
12
12
|
[--offset <next_offset>] \
|
|
13
|
-
[--usage analysis|tag_cluster]
|
|
13
|
+
[--usage analysis|tag_cluster|sql_datatable]
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Contract
|
|
17
17
|
|
|
18
18
|
- Use this command before writing SQL when the table is not already known. Do not ask the customer to supply the fixed project event/user table name and do not guess `v_event_<id>` or `v_user_<id>`.
|
|
19
|
-
- `
|
|
19
|
+
- Use `sql_reference` (quoted catalog/schema/table with escaped double quotes) when copying a table into SQL or `analysis sql-table columns --table-ref`. The legacy `table_ref` remains accepted; do not split it on dots because identifier segments can contain dots.
|
|
20
20
|
- `queries` accepts 1 to 20 non-empty strings with OR semantics. Matching rows include `matched_queries` and `matched_fields`; singular `query` is not accepted.
|
|
21
|
-
- Each item also returns `catalog`, `schema`, `table`, `table_type`, and `
|
|
22
|
-
- `usage=analysis` is the default table set for SQL analysis and reports. Use `usage=tag_cluster` for SQL tags or SQL clusters. These server-authorized sets differ, and the same usage must be passed to `sql-table columns`.
|
|
21
|
+
- Each item also returns `catalog`, `schema`, `table`, `table_type`, `description`, `usage`, `source_type`, `repo_table_type`, and `sql_reference`. `source_type=gaia` identifies space tables; source/type metadata may be null for ordinary tables. Do not infer a space table from `table_type=customTable`.
|
|
22
|
+
- `usage=analysis` is the default table set for SQL analysis and reports. Use `usage=tag_cluster` for SQL tags or SQL clusters, and `usage=sql_datatable` for SQL-built data tables. Lists are flat; these usages select authorized sets rather than UI categories. Do not silently retry a rejected usage with `analysis`. These server-authorized sets differ, and the same usage must be passed to `sql-table columns`.
|
|
23
23
|
- When `has_more=true`, continue only with the returned `next_offset`. Stop when `has_more=false`.
|
|
24
24
|
- An empty list means the current identity has no queryable SQL tables in that project; do not fabricate a table name.
|
|
25
25
|
|
|
@@ -31,4 +31,4 @@ ae-cli analysis sql-table columns --project-id 1 --table-ref hive.ta.v_user_1
|
|
|
31
31
|
ae-cli analysis adhoc run --project-id 1 --model-type sql --definition '{"sql":"select * from hive.ta.v_user_1 limit 10"}'
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Use the exact `
|
|
34
|
+
Use the exact `sql_reference` returned by the first command when writing SQL; the example reference is illustrative only.
|