@thinkingai/ae-cli 6.1.17 → 6.1.18

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 (99) hide show
  1. package/dist/{auth-2WTQOP77.js → auth-GBMV6TEJ.js} +3 -3
  2. package/dist/{auth-77BUFLGC.js → auth-ROB2EDYV.js} +12 -13
  3. package/dist/{capability-72DTW5M2.js → capability-DKMYUTLC.js} +50 -13
  4. package/dist/{capability-PJHNI4GJ.js → capability-HYVVPG25.js} +49 -12
  5. package/dist/chunk-3FY3RJ26.js +293 -0
  6. package/dist/{chunk-PTE56QPL.js → chunk-3KWQYGYI.js} +4 -0
  7. package/dist/{chunk-UOUS37JQ.js → chunk-4XXOWOTA.js} +3 -3
  8. package/dist/{chunk-GT46FPXN.js → chunk-BYYS3ANB.js} +17 -8
  9. package/dist/{chunk-YA6SMTXG.js → chunk-EFH4XWYC.js} +3 -3
  10. package/dist/{chunk-4SGZG4XY.js → chunk-J2DEBMRF.js} +9 -7
  11. package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
  12. package/dist/{chunk-VR3LCBHW.js → chunk-JRJY5DMJ.js} +5 -5
  13. package/dist/{chunk-ILIU36SU.js → chunk-OMPRXM3V.js} +3 -3
  14. package/dist/{chunk-VPKZ7I72.js → chunk-QNOLN2LJ.js} +2 -2
  15. package/dist/{chunk-SAU3QFIQ.js → chunk-QZ3AS4KK.js} +3 -3
  16. package/dist/chunk-RJDU7NYP.js +1198 -0
  17. package/dist/{chunk-4KVPKXFX.js → chunk-RNAALWJK.js} +2 -2
  18. package/dist/{chunk-C4MGVGJW.js → chunk-SERWF6G5.js} +1 -1
  19. package/dist/{chunk-RGKJGKT7.js → chunk-Y3LOALAV.js} +5 -5
  20. package/dist/{chunk-P3FGXJTU.js → chunk-ZQ47LWTI.js} +4 -4
  21. package/dist/chunk-ZQKDZXDO.js +317 -0
  22. package/dist/{client-TKG4WBHN.js → client-L2YDMHQ6.js} +5 -4
  23. package/dist/{community-report-client-FI4LNVYS.js → community-report-client-C7WDGET3.js} +1 -2
  24. package/dist/{config-RE6CMGPK.js → config-BMYZX2UE.js} +7 -6
  25. package/dist/{data-integration-XQYB4X4F.js → data-integration-QEKDWQDY.js} +1601 -192
  26. package/dist/index.js +131 -1241
  27. package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-4YYHSYD6.js} +1 -2
  28. package/dist/{memory-CHRU2F7W.js → memory-3ORCR7JH.js} +6 -6
  29. package/dist/{memory-YK33G4T7.js → memory-I2WXDTV2.js} +5 -5
  30. package/dist/{metadata-XXR34N5P.js → metadata-I4C2EWUN.js} +10 -10
  31. package/dist/{metadata-UILXHBWF.js → metadata-VUOQJE26.js} +9 -9
  32. package/dist/{model-NR3JHFSJ.js → model-HLHIEFMU.js} +5 -5
  33. package/dist/{model-K3KLWIW6.js → model-UGRDX4MW.js} +6 -6
  34. package/dist/personal-semantic-preference-LIPACBDX.js +239 -0
  35. package/dist/personal-semantic-preference-OEISBRHM.js +239 -0
  36. package/dist/project-semantic-FFPWFPIW.js +1114 -0
  37. package/dist/project-semantic-RT3R2VQD.js +1114 -0
  38. package/dist/{sync-FCKOVWWS.js → sync-HKIOZXQE.js} +6 -6
  39. package/dist/{sync-DAVKYVMW.js → sync-TFHU2UTG.js} +7 -7
  40. package/dist/{te-agent-HLW4VTQK.js → te-agent-BR6VDBNX.js} +9 -8
  41. package/dist/{te-agent-4BKBODMF.js → te-agent-VLYOV7S4.js} +8 -7
  42. package/dist/{te-analysis-ZMNGOVNW.js → te-analysis-4YGQL5RC.js} +437 -38
  43. package/dist/{te-analysis-O6DCO6BS.js → te-analysis-7VUNUYWZ.js} +436 -37
  44. package/dist/{te-community-HLC43QKH.js → te-community-5DMNKJWY.js} +5 -5
  45. package/dist/{te-community-6HPBWJUZ.js → te-community-ISDQWJU7.js} +6 -6
  46. package/dist/{te-dataops-HDRUXY4K.js → te-dataops-6P5IKWNJ.js} +8 -7
  47. package/dist/{te-dataops-EJP56W3K.js → te-dataops-CVULXNVB.js} +7 -6
  48. package/dist/{te-engage-RAK5PESW.js → te-engage-KZPR5R22.js} +9 -9
  49. package/dist/{te-engage-FGBGQ4IY.js → te-engage-N5WI32H6.js} +8 -8
  50. package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BITX4RD.js} +226 -8
  51. package/dist/{te-experiment-VZF7BT6G.js → te-experiment-UVR4HLND.js} +227 -9
  52. package/dist/{te-kb-SQCLHG6X.js → te-kb-RCLSSH2Q.js} +7 -7
  53. package/dist/{te-system-Z77IKZFN.js → te-system-FXITO2JG.js} +5 -5
  54. package/dist/{te-system-YARIK4S5.js → te-system-K2GYMCTB.js} +6 -6
  55. package/dist/{te-team-EFKWYKMK.js → te-team-ADOC2ROP.js} +6 -6
  56. package/dist/{update-OGPSZM5A.js → update-YCYCKJOO.js} +7 -6
  57. package/package.json +1 -1
  58. package/skills/ae-agent/SKILL.md +3 -4
  59. package/skills/ae-agent/references/edit-skill.md +3 -0
  60. package/skills/ae-agent/references/get-skill-content.md +1 -1
  61. package/skills/ae-agent/references/rescan-skills.md +15 -13
  62. package/skills/ae-agent/references/upload-skill.md +7 -4
  63. package/skills/ae-analysis/SKILL.md +45 -4
  64. package/skills/ae-analysis/metadata_resolution.md +38 -4
  65. package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
  66. package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
  67. package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
  68. package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
  69. package/skills/ae-analysis/references/command_index.md +17 -9
  70. package/skills/ae-analysis/references/dashboard_get.md +18 -1
  71. package/skills/ae-analysis/references/dashboard_update.md +3 -0
  72. package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
  73. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
  74. package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
  75. package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
  76. package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
  77. package/skills/ae-data-integration/SKILL.md +23 -4
  78. package/skills/ae-data-integration/references/custom-layer.md +93 -0
  79. package/skills/ae-data-integration/references/error-handling.md +92 -0
  80. package/skills/ae-data-integration/references/handoff.md +77 -18
  81. package/skills/ae-data-integration/references/local-analysis.md +1 -1
  82. package/skills/ae-data-integration/references/reuse.md +9 -5
  83. package/skills/ae-data-integration/references/sink-upload.md +1 -1
  84. package/skills/ae-data-integration/references/source-inspect.md +18 -12
  85. package/skills/ae-data-integration/references/tracking-plan.md +7 -5
  86. package/skills/ae-data-integration/references/transform.md +10 -10
  87. package/skills/ae-data-integration/references/ue-mapping.md +33 -11
  88. package/skills/ae-engage/references/build-task-save-guide.md +9 -0
  89. package/skills/ae-engage/references/save-task.md +82 -0
  90. package/skills/ae-experiment/SKILL.md +8 -2
  91. package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
  92. package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
  93. package/skills/ae-experiment/references/save_experiment.md +1 -1
  94. package/skills/ae-kb/SKILL.md +1 -1
  95. package/skills/ae-project-semantic/SKILL.md +193 -0
  96. package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
  97. package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
  98. package/dist/chunk-QGM4M3NI.js +0 -37
  99. package/dist/chunk-ZZUOD757.js +0 -598
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: ae-project-semantic
3
+ description: "Use when generating, testing, submitting, reviewing, or publishing governed project semantic candidates from AE/TE project asset packages. This skill owns progressive asset-scope consent, recommendation quality gates, evidence authority, topic-domain grouping, candidate JSON generation, CLI closed-loop validation, and frontend review acceptance. Do not use it for ordinary analysis questions that only consume already published semantics."
4
+ ---
5
+
6
+ # ae-project-semantic
7
+
8
+ Project semantics are governed L2 project-wide business concepts, rules, calculation conventions, and default asset-selection methods. They sit above dashboards and reports. Dashboards, reports, events, properties, and metrics are L1 evidence and execution assets; they are not project semantics by themselves.
9
+
10
+ Use `ae-cli` only. Do not write the database directly for recommendations, approvals, or releases.
11
+
12
+ ## Boundary
13
+
14
+ - Use this skill to generate or evaluate project semantic recommendations.
15
+ - Use `ae-analysis` to consume already published project semantics during analysis tasks.
16
+ - Frontend can review, edit, approve, reject, and publish candidates; it must not generate recommendations.
17
+ - Start with governed authenticated dashboards/reports. Broader project assets may be inspected only after explicit user consent and must retain their lower authority in evidence and confidence. Events, properties, metrics, background documents, and notes can provide supporting evidence only, never the primary L2 candidate subject.
18
+
19
+ ## Required Workflow
20
+
21
+ 1. Resolve the project and host.
22
+ 2. Read both recommendation references before inspecting candidates:
23
+ - [`references/recommendation-quality.md`](references/recommendation-quality.md) for the governed L2 quality bar;
24
+ - [`references/query-routing-v5.md`](references/query-routing-v5.md) for the current query-routing, recall-shortcut, and analysis-playbook discovery protocol.
25
+ 3. Check existing published project semantics:
26
+
27
+ ```bash
28
+ ae-cli project-semantic list --project-id <project_id>
29
+ ```
30
+
31
+ 4. Export governed authenticated project assets and semantic snapshot context by default:
32
+
33
+ ```bash
34
+ ae-cli project-semantic asset-package export --project-id <project_id> --asset-scope governed --output <tmp>/project-semantic-assets --force
35
+ ```
36
+
37
+ When `--host` points directly to a locally started Common service instead of the deployed analysis gateway, scope the empty gateway domain to that command so the request uses Common's native `/api/cli/v1` route. Do not export this override globally:
38
+
39
+ ```bash
40
+ AE_CLI_CAPABILITY_GATEWAY_DOMAIN= ae-cli project-semantic asset-package export --project-id <project_id> --asset-scope governed --output <tmp>/project-semantic-assets --force --host http://127.0.0.1:8992
41
+ ```
42
+
43
+ 5. Inspect `asset_scope`, `exported_asset_count`, `authenticated_asset_count`, `unauthenticated_asset_count`, `truncated`, work-unit count, and definition-family count before scanning. If `truncated=true`, warn that the package hit a compatibility limit. If the governed package is too sparse to support useful problem frames, report the actual counts and ask whether to re-export active collaborative assets. Do not broaden automatically:
44
+
45
+ ```bash
46
+ ae-cli project-semantic asset-package export --project-id <project_id> --asset-scope collaborative --output <tmp>/project-semantic-assets --force
47
+ ```
48
+
49
+ If that package is still too sparse, report its counts and ask separately whether to export all valid project dashboards/reports and their referenced metadata:
50
+
51
+ ```bash
52
+ ae-cli project-semantic asset-package export --project-id <project_id> --asset-scope all_visible --output <tmp>/project-semantic-assets --force
53
+ ```
54
+
55
+ `governed` is authenticated + collaborative + active in the recent 90-day window. `collaborative` removes only the authentication requirement. `all_visible` removes authentication, collaboration, and recency filters while still excluding deleted, frozen, hidden, offline, or otherwise invalid assets. Export is project-administrator-only; no per-user visibility filtering is required inside `all_visible`. Asset authentication is a separate governance write and must never be changed implicitly by scanning.
56
+
57
+ 6. Read the package in this order:
58
+ - `manifest.json`, `.asset-package.json`, `catalog/published.jsonl`, `catalog/disabled.jsonl` when present, `catalog/active-candidates.jsonl`, and `catalog/rejected-candidates.jsonl` to build the exclusion and revision context;
59
+ - `indexes/work-units.jsonl` as the dashboard-first investigation queue, preserving its usage-priority order while rotating across distinct business themes;
60
+ - `indexes/definition-families.jsonl` and compact dashboard/report records to compare reusable definition variants;
61
+ - `indexes/asset-directory.jsonl` and `indexes/governance-coverage.jsonl` for supporting evidence;
62
+ - `details/normalized/**` only for candidate-bearing or conflicting families, and `details/raw/**` only when the normalized definition is insufficient.
63
+
64
+ The service owns deterministic parsing, key-field normalization, definition signatures, usage ordering, and catalog assembly. The Agent owns business topic discovery, evidence interpretation, counterexample review, and candidate wording. Display names, descriptions, and notes remain evidence for interpretation, but they never make two otherwise identical definitions distinct. Do not load every detail file into context up front or delegate business judgment to a project-specific keyword table or deterministic template generator.
65
+
66
+ 7. Compare the proposed behavior against published, disabled, active-candidate, and rejected catalogs. Disabled semantics are suppression context: do not consume, recreate, or update them through recommendation generation. A project administrator can explicitly enable them later. Produce `CREATE` only for a genuinely new semantic, `UPDATE` when an active semantic needs a material revision, and no candidate when the package is already covered. Zero new candidates is a valid successful recommendation result.
67
+
68
+ 8. Validate the Agent-authored file against the exact exported package. This command checks only deterministic contract rules such as required fields, supported enums, catalog conflicts, duplicate fingerprints, and resolvable evidence references. `passed=true` is not a semantic-quality approval:
69
+
70
+ ```bash
71
+ ae-cli project-semantic candidate validate --asset-package <tmp>/project-semantic-assets --submit-file <tmp>/project-semantic-candidates.json
72
+ ```
73
+
74
+ 9. Perform a separate Agent quality-review pass over the unchanged candidate file and the evidence it cites. Apply the Hard Quality Bar and `references/recommendation-quality.md`; do not rely on the generation pass to approve its own wording. For every candidate, record `PASS`, `REVISE`, or `INSUFFICIENT_EVIDENCE` with concrete findings and evidence references. Revise and repeat both deterministic validation and Agent review until every submitted candidate is `PASS`. A successful empty recommendation is preferable to weak filler.
75
+
76
+ 10. Submit the unchanged validated and Agent-reviewed file. Use `.asset-package.json.snapshot_hash`, or the `snapshot_hash` returned by `candidate validate`:
77
+
78
+ ```bash
79
+ ae-cli project-semantic candidate submit --project-id <project_id> --submit-file <tmp>/project-semantic-candidates.json --snapshot-hash <snapshot_hash>
80
+ ```
81
+
82
+ 11. Review and enable through CLI when validating the full closed loop:
83
+
84
+ ```bash
85
+ ae-cli project-semantic candidate list --project-id <project_id>
86
+ ae-cli project-semantic candidate get --project-id <project_id> --candidate-id <candidate_id>
87
+ ae-cli project-semantic candidate enable --project-id <project_id> --candidate-ids '["candidate_1"]'
88
+ ae-cli project-semantic get --project-id <project_id> --id <semantic_id> --mark-used
89
+ ```
90
+
91
+ Lifecycle management is deliberately separate from recommendation review:
92
+
93
+ ```bash
94
+ ae-cli project-semantic disable --project-id <project_id> --semantic-id <semantic_id> --expected-version <version> --reason <reason>
95
+ ae-cli project-semantic list --project-id <project_id> --status disabled
96
+ ae-cli project-semantic delete-impact --project-id <project_id> --semantic-id <semantic_id>
97
+ ae-cli project-semantic delete --project-id <project_id> --semantic-id <semantic_id> --expected-version <version> --reason <reason>
98
+ ae-cli project-semantic enable --project-id <project_id> --semantic-id <semantic_id> --expected-version <version> --reason <reason>
99
+ ```
100
+
101
+ Disable means “do not consume and do not recommend again.” From disabled state, either enable the same semantic or inspect impact and physically delete it. Physical deletion means the semantic is absent and may be rediscovered by a future scan. Never delete merely to regenerate recommendations.
102
+
103
+ ## Hard Quality Bar
104
+
105
+ A candidate file is not acceptable unless all of these are true:
106
+
107
+ - It starts from governed evidence, or records the explicitly approved broader scope and lowers confidence for claims that depend on unauthenticated assets.
108
+ - It groups by L2 business topic domain before generating candidates.
109
+ - Every topic group includes the submit-contract fields `topic_domain_key`, `topic_domain_title`, `topic_group_key`, and `topic_group_title`.
110
+ - It does not create one candidate per asset.
111
+ - It does not promote an event/property/metric name into a project semantic title.
112
+ - Each candidate binds `resource_refs` with real asset names/types/ids or names from the package.
113
+ - Each candidate explains what it means, where it applies, how to use it, and what it excludes.
114
+ - Each candidate body covers business definition, applicable questions, decision or calculation rules, Agent usage, and boundaries or exceptions in the project's natural language. Exact headings are not a machine contract.
115
+ - The concrete business judgment belongs in the decision or calculation content; asset names and counts belong in `resource_refs`, `evidence`, and `recommendation_reason`, not in the semantic body.
116
+ - A batch fails review when candidates reuse the same body with only asset names or counts changed.
117
+ - Each candidate includes evidence excerpts or source titles that show why it was recommended.
118
+ - Each candidate changes how the Agent interprets a business question, selects default assets, or applies a project-wide rule.
119
+ - Each candidate declares one of the evidence-backed recommendation kinds in `query-routing-v5.md`: `QUERY_ROUTING`, `RECALL_SHORTCUT`, or `ANALYSIS_PLAYBOOK`.
120
+ - A formula, threshold, state, event, property, report, or asset name is supporting L1 evidence, never a standalone candidate.
121
+ - A route must contain a meaningful asset-choice branch; a shortcut must contain a minimal bundle plus stop and fallback; a playbook must be note-backed or explicitly labeled as a structure-inferred recommended path.
122
+ - Existing published and disabled semantics are checked before submission; disabled semantics suppress recreation.
123
+ - An unauthenticated asset may support a route, shortcut, or playbook only when definitions, work-unit structure, usage, or notes provide corroboration. Never present it as a certified project rule solely because it was exported.
124
+ - Sparse evidence is either skipped or marked lower confidence; do not inflate weak recommendations.
125
+
126
+ ## Generic Extraction Protocol
127
+
128
+ The protocol must work unchanged for games, retail, finance, SaaS, operations, and unknown project domains.
129
+
130
+ 1. Inventory evidence without deciding themes. Separate authenticated and unauthenticated dashboards/reports, record the export scope and selection reason, and keep existing governed semantics and supporting L1 metadata distinct.
131
+ 2. Discover semantic families only from evidence that was actually read. Use these cross-domain dimensions as questions, not as prefilled answers:
132
+ - business object, state, and alias;
133
+ - analysis subject and deduplication grain;
134
+ - measure, aggregation, numerator, denominator, and transformation;
135
+ - inclusion, exclusion, and filter scope;
136
+ - query range, cohort window, observation window, and freshness;
137
+ - unit, currency, normalization, and attribution;
138
+ - default asset selection and relationships between assets;
139
+ - applicability, exception, and conflict boundaries.
140
+ 3. Compare definition variants inside each family. A candidate may state a default only when evidence shows one authoritative variant. Conflicting variants require a disambiguation rule or a warning, not an invented standard.
141
+ 4. Form a topic domain after the semantic families are understood. The domain title must come from the project's natural business language and explain why its candidates are reviewed together.
142
+ 5. Generate a candidate only when removing it would make a future Agent more likely to choose the wrong business object, asset, grain, formula, scope, unit, window, or exception.
143
+ 6. For every claim in the body, identify direct supporting evidence. Keep asset names and excerpts in `resource_refs`, `evidence`, and `recommendation_reason`; keep reusable business knowledge in `content`.
144
+ 7. Compare candidates by resulting Agent behavior. Merge candidates that lead to the same interpretation and execution; split candidates that answer independently searchable questions.
145
+ 8. Run a counterexample pass: inspect minority definitions and assets that may violate the proposed rule. Narrow or drop unsupported conclusions.
146
+ 9. Before wording candidates, form evidence-backed problem frames and assign asset roles. Use `query-routing-v5.md`; do not optimize for candidate count or one-candidate-per-asset coverage.
147
+ 10. Keep a decision ledger for discovered problem frames, including routed, shortcut, playbook, definition-only, and evidence-insufficient dispositions.
148
+
149
+ ## Anti-Overfitting Rule
150
+
151
+ - Never encode a customer, project name, project ID, asset ID, expected topic title, expected candidate title, or expected candidate count in this skill or CLI generation code.
152
+ - Never start from a fixed industry taxonomy or keyword dictionary. Keywords may locate evidence only after a semantic family is discovered; they must not determine the result.
153
+ - A test package is an evaluation sample, not a source of reusable rules. Tune the protocol only when the change is defensible across unrelated domains.
154
+ - Quality is measured by evidence support and changed Agent behavior, not by matching a previously approved list of topics.
155
+
156
+ ## User-Facing Recommendation Display
157
+
158
+ When showing CLI recommendation results to a user, never flatten candidates into a single numbered list. The user-facing answer must use the same hierarchy as the candidate JSON and frontend review UI:
159
+
160
+ ```text
161
+ Project semantic recommendation scan completed
162
+
163
+ Summary:
164
+ - Topic domains: <N>
165
+ - Candidate semantics: <N>
166
+ - Validation: passed | failed
167
+
168
+ Topic domain: <topic_domain_title> (<candidate_count> semantics)
169
+ - [<semantic_type>] <candidate title>
170
+ <one-sentence summary>
171
+ Evidence: <asset title 1>, <asset title 2>, ...
172
+ ```
173
+
174
+ Rules:
175
+
176
+ - Show topic domains first, then candidates under each domain.
177
+ - Include each domain's semantic count.
178
+ - Include each candidate's semantic type, title, short summary, and primary evidence asset titles.
179
+ - If the CLI command returns `topic_groups`, use that field directly for the display order and counts.
180
+ - Keep the full JSON path or submit command separate from the human summary.
181
+ - Do not present a flat list like `1. semantic A 2. semantic B ...` unless the user explicitly asks for raw candidate order.
182
+
183
+ ## Output Discipline
184
+
185
+ When reporting recommendation results, include:
186
+
187
+ - commands run;
188
+ - asset scope, exported/authenticated/unauthenticated asset counts, and snapshot hash;
189
+ - topic domains, semantic counts per domain, and candidate titles grouped under each domain;
190
+ - evidence assets per candidate;
191
+ - quality warnings, if any;
192
+ - problem-frame coverage and rejected shallow-opportunity warnings;
193
+ - submit/review/release IDs after writes.
@@ -0,0 +1,165 @@
1
+ # Project Semantic Query Routing V5
2
+
3
+ Use this protocol when project asset packages contain asset definitions, work-unit membership, recent usage, authentication provenance, and optional notes, but do not contain historical user questions, query failures, or execution traces. Never claim that a structure-inferred path is a proven historical best practice.
4
+
5
+ The only recommendation kinds are:
6
+
7
+ - `QUERY_ROUTING`: choose the right dashboard/report for a question and distinguish nearby assets;
8
+ - `RECALL_SHORTCUT`: reduce broad asset search to a minimal ordered bundle with stop and fallback conditions;
9
+ - `ANALYSIS_PLAYBOOK`: execute a multi-step or branching analysis path supported by notes or strong complementary asset structure.
10
+
11
+ Submission semantic types remain unchanged: routing and shortcuts normally use `asset_semantics`; playbooks normally use `business_rule`.
12
+
13
+ ## Evidence roles
14
+
15
+ - Dashboard/report membership and work units show which assets jointly address a problem.
16
+ - Normalized/raw definitions determine what each asset computes, filters, groups, and returns.
17
+ - Display names, descriptions, notes, and dashboard memo text explain intended questions and explicit instructions, but never make otherwise identical definitions different.
18
+ - Recent usage and recency may prioritize a default entry among otherwise suitable assets; they never establish a formula, causal rule, or business priority.
19
+ - Definition families and conflicts distinguish alternatives, duplicates, misleading titles, and exception variants.
20
+ - Published, active, and rejected catalogs provide exclusion and revision context.
21
+
22
+ ## Discover problem frames before candidates
23
+
24
+ For every inspected work unit, create zero or more evidence-backed `problem_frames`. Do not require every work unit or asset to produce a candidate. Each frame records:
25
+
26
+ - natural-language problem intent;
27
+ - triggers and constraints;
28
+ - business object and expected answer grain;
29
+ - available assets and their roles;
30
+ - decision points that change asset choice;
31
+ - explicit note/memo guidance, when present;
32
+ - usage/recency priority;
33
+ - evidence gaps.
34
+
35
+ Assign relevant assets one of these roles for the frame:
36
+
37
+ - `DEFAULT_OVERVIEW`;
38
+ - `CONDITIONAL_BRANCH`;
39
+ - `DETAIL_DRILLDOWN`;
40
+ - `COMPARISON_OR_COUNTEREXAMPLE`;
41
+ - `FALLBACK`;
42
+ - `UNSUITABLE_FOR_FRAME`.
43
+
44
+ An asset may have different roles in different frames. Every role assignment must cite exact definition or note evidence.
45
+
46
+ ## QUERY_ROUTING gate
47
+
48
+ Generate only when all are true:
49
+
50
+ 1. At least two plausible assets could be confused or selected for related questions.
51
+ 2. Object, grain, formula, scope, time, parameter, or output differences determine the correct asset.
52
+ 3. The candidate states:
53
+ - triggering question types;
54
+ - default asset or entry dashboard;
55
+ - branch conditions and target assets;
56
+ - assets that must not substitute for one another;
57
+ - required parameters or filters;
58
+ - drilldown and fallback.
59
+ 4. Removing the route would materially increase wrong-asset selection.
60
+
61
+ A formula may explain why a branch is selected, but it is not a routing semantic by itself.
62
+
63
+ ## RECALL_SHORTCUT gate
64
+
65
+ Generate only when all are true:
66
+
67
+ 1. A broad work unit contains more assets than a recurring query needs.
68
+ 2. Evidence supports a minimal ordered subset.
69
+ 3. The candidate states the first asset, continuation conditions, stop condition, safe fallback, and unrelated asset groups that can be skipped.
70
+ 4. Usage may prioritize between evidence-equivalent suitable entries, but cannot override definition fit.
71
+ 5. Search-space reduction is stated from package membership only; never claim measured latency improvement without runtime evidence.
72
+
73
+ ## ANALYSIS_PLAYBOOK gate
74
+
75
+ ### High-confidence playbook
76
+
77
+ Requires an explicit note or memo stating an analysis goal, sequence, decision, or caveat, plus executable assets supporting the steps. If any required asset is unauthenticated, label the playbook lower confidence and require project-administrator review; do not present the path as certified.
78
+
79
+ ### Medium-confidence recommended analysis path
80
+
81
+ Allowed without explicit notes only when all are true:
82
+
83
+ - at least three complementary roles form an overview-to-branch-to-drilldown or measure-to-diagnose-to-verify path;
84
+ - exact definitions establish branch conditions and prevent interchangeable use;
85
+ - no causal claim, business priority, or mandatory sequence is invented;
86
+ - the output is labeled `RECOMMENDED_ANALYSIS_PATH`;
87
+ - boundaries state that the path is structurally inferred and requires review.
88
+
89
+ Reject paths supported only by co-location, similar titles, independent metrics, or usage ranking.
90
+
91
+ ## Reject shallow candidates
92
+
93
+ Reject a candidate that only provides:
94
+
95
+ - one formula, threshold, state, event, property, report, dashboard, or asset name;
96
+ - an inventory of related assets;
97
+ - a topic summary without asset-choice decisions;
98
+ - a broad umbrella listing measures without branches;
99
+ - an inferred maturity hierarchy, causal explanation, or best practice absent from notes;
100
+ - a route that does not reduce ambiguity or search.
101
+
102
+ Simple formulas and states remain evidence inside routes and playbooks. They do not become standalone project semantics.
103
+
104
+ ## Candidate fields
105
+
106
+ In addition to the governed submission fields, retain:
107
+
108
+ - `candidate_kind`;
109
+ - `problem_triggers`;
110
+ - `default_route`;
111
+ - `branch_rules`;
112
+ - `do_not_use`;
113
+ - `drilldown_path`;
114
+ - `fallback`;
115
+ - `asset_roles`;
116
+ - `search_space_reduction`;
117
+ - `evidence_strength`: `HIGH_NOTE_BACKED` or `MEDIUM_STRUCTURE_BACKED`;
118
+ - `confidence_limit`;
119
+ - `problem_frame_ids`.
120
+
121
+ The candidate body must cover business definition, applicable questions, decision or calculation rules, Agent usage, and boundaries or exceptions. Use headings natural to the project's language when headings improve readability; exact localized wording is not part of the machine contract.
122
+
123
+ Reusable decision knowledge belongs in `content`. Asset names, ids, counts, and excerpts belong in route fields, `resource_refs`, `evidence`, and `recommendation_reason`.
124
+
125
+ ## Decision ledger
126
+
127
+ When producing recommendation artifacts, record:
128
+
129
+ - work units and notes actually inspected;
130
+ - discovered problem frames;
131
+ - asset-role assignments and evidence;
132
+ - routing/shortcut/playbook decisions;
133
+ - rejected shallow opportunities and reasons;
134
+ - candidate-to-frame mappings;
135
+ - dispositions: `ROUTED`, `SHORTCUT`, `PLAYBOOK`, `DEFINITION_ONLY`, or `EVIDENCE_INSUFFICIENT`.
136
+
137
+ Coverage is measured over supported problem frames, not raw asset or definition-signature counts. Every discovered frame needs a disposition, but not every work unit or asset needs a candidate.
138
+
139
+ ## Acceptance
140
+
141
+ Candidate count and average prose score are not success metrics. Evaluate with evidence-grounded future-query probes and report:
142
+
143
+ - primary asset or entry selection;
144
+ - conditional branch selection;
145
+ - prevention of plausible wrong-asset substitution;
146
+ - minimal asset bundle;
147
+ - stop and fallback completeness;
148
+ - search-space reduction versus the work unit;
149
+ - playbook step support;
150
+ - unsupported causal or order claims;
151
+ - problem-frame coverage;
152
+ - formula-only or inventory-only candidate count, which must be zero.
153
+
154
+ Before submit, require:
155
+
156
+ - CLI validator `passed=true`;
157
+ - no shallow formula/state-only candidate;
158
+ - every route has a meaningful branch;
159
+ - every shortcut has stop and fallback;
160
+ - every playbook is note-backed or explicitly labeled structure-backed;
161
+ - candidates materially choose or narrow assets better than an undifferentiated work-unit scan.
162
+
163
+ ## Anti-overfitting
164
+
165
+ Never encode project names, project ids, asset ids, event names, expected topics, expected titles, expected routes, expected counts, or fixed industry dictionaries. The reusable mechanism is problem framing, asset-role classification, decision branching, minimal bundles, and evidence-bounded paths.
@@ -0,0 +1,68 @@
1
+ # Project Semantic Recommendation Quality
2
+
3
+ ## Business Goal
4
+
5
+ The Agent should turn a certified project snapshot into a small, reviewable L2 semantic system. The output should help future analysis interpret business terms, choose the right dashboards/reports, and apply project-wide rules consistently.
6
+
7
+ It should not produce a checklist of assets to approve one by one.
8
+
9
+ ## Extraction Method
10
+
11
+ 1. Start with `manifest.json`, `.asset-package.json`, and all catalog files. Published semantics and active candidates form the duplicate/update exclusion set. Disabled semantics form a strict suppression set and must not be recreated by the scan. Rejected candidates require a documented material change before reconsideration.
12
+ 2. Treat `indexes/work-units.jsonl` as the primary investigation queue. Follow its recent-90-day usage order, but rotate across distinct evidence-backed business themes before adding more candidates for a dominant theme.
13
+ 3. Start with authenticated, active dashboards and reports as primary evidence. When the user explicitly approved a broader export scope, preserve each asset's authentication and selection provenance. Unauthenticated dashboards/reports may support discovery only when corroborated by definitions, work-unit relationships, usage, or notes, and any resulting claim must carry a lower confidence boundary. Events, properties, metrics, notes, and background text are supporting evidence only. Open `details/normalized/**` and `details/raw/**` through `detail_locator` only for assets that may support a candidate.
14
+ 4. Use normalized key fields to establish definition families. Display names, descriptions, and notes remain available as interpretation evidence, but differences in those fields alone must not split a family. Discover semantic families with cross-domain questions: business object/state, analysis subject and grain, formula and denominator, inclusion/exclusion, time roles, units and normalization, asset-selection priority, applicability and exceptions. These are inspection dimensions, not topic names.
15
+ 5. Name L2 topic domains only after the evidence families are understood. Use the project's own natural business language; do not start from a fixed industry taxonomy or known test-package themes.
16
+ 6. For every cluster, ask what reusable project meaning it implies:
17
+ - business concept: a named business object or state;
18
+ - business rule: inclusion/exclusion logic;
19
+ - asset semantics: default asset set for a question type;
20
+ - calculation convention: denominator, numerator, window, attribution, currency, deduplication.
21
+ 7. Create candidates only when the semantic is reusable across future questions and changes Agent behavior.
22
+ 8. Return a successful empty recommendation when published or active semantics already cover every supported behavior change.
23
+ 9. Apply [`query-routing-v5.md`](query-routing-v5.md) after evidence-family discovery. Prefer reusable query routing, recall shortcuts, and evidence-bounded analysis paths over standalone formula or state descriptions.
24
+
25
+ ## Reject These Candidates
26
+
27
+ - One candidate per asset.
28
+ - Candidate title merely copies an event/property/report name.
29
+ - Candidate title is an L1 metadata object, for example an event, property, metric, tag, or field name.
30
+ - Candidate has fewer than two related evidence assets unless one asset is a high-authority certified dashboard/report with detailed notes.
31
+ - Candidate claims a calculation rule not present in asset names, descriptions, definitions, notes, or inspected reports.
32
+ - Candidate mixes unrelated lifecycle domains to raise evidence count.
33
+ - Candidate treats an unauthenticated asset as a certified or authoritative project default without corroboration and an explicit confidence limit.
34
+ - Candidate is a duplicate of a published or disabled semantic by title, alias, or equivalent behavior.
35
+ - Candidate is a generic lifecycle template that ignores the project domain discovered in the snapshot.
36
+ - Candidate only restates one formula, threshold, state, event, property, report, dashboard, or asset name.
37
+ - Candidate is a broad topic summary with no asset-choice branch, stop condition, or wrong-asset exclusion.
38
+
39
+ ## Candidate Shape
40
+
41
+ Each topic group should explain why the assets belong together. Each candidate should include:
42
+
43
+ - `candidate_kind`: `QUERY_ROUTING`, `RECALL_SHORTCUT`, or `ANALYSIS_PLAYBOOK`;
44
+ - `semantic_type`;
45
+ - `title`;
46
+ - `summary`;
47
+ - `content` with definition, scope, usage, and exclusions;
48
+ - `keywords`;
49
+ - `resource_refs` with asset type, id/name, display name, and description when available;
50
+ - `work_unit_coverage` for the snapshot work units it covers;
51
+ - `recommendation_reason`;
52
+ - `evidence` with source titles and excerpts.
53
+ - the V5 route fields required for its candidate kind, including branches, exclusions, stop/fallback behavior, asset roles, evidence strength, and problem-frame ids.
54
+
55
+ The candidate body must read as governed business knowledge, not as an asset inventory. Use this review order:
56
+
57
+ 1. **Business definition**: what the concept, rule, or convention means in this project.
58
+ 2. **Applicable questions**: which future questions should activate it.
59
+ 3. **Decision or calculation rule**: the concrete inclusion, exclusion, grain, denominator, time-window, or asset-selection rule proven by evidence.
60
+ 4. **Agent usage rule**: how the Agent changes interpretation or execution after adopting it.
61
+ 5. **Boundaries and exceptions**: what must not be inferred, merged, or substituted.
62
+ 6. **Evidence assets**: keep dashboards/reports in `resource_refs` and evidence sections; do not make their names the semantic body.
63
+
64
+ Reject a batch when multiple candidates differ only by asset names or counts while reusing the same definition, usage, and exclusion prose. A recommendation reason must name the business claim supported by the evidence, not merely state that dashboards/reports were bound.
65
+
66
+ ## Evaluation Packages
67
+
68
+ Evaluate the unchanged protocol on at least two unrelated asset packages when tuning recommendation quality. Do not add project names, asset IDs, expected titles, expected domains, or expected counts to the skill or CLI code after seeing a test result. A sparse governed package should trigger explicit, sequential consent before re-exporting `collaborative` and then `all_visible`; a sparse broad package should still produce fewer candidates or explicit insufficiency warnings rather than generic filler.
@@ -1,37 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + x + '" is not supported');
12
- });
13
- var __commonJS = (cb, mod) => function __require2() {
14
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
-
33
- export {
34
- __require,
35
- __commonJS,
36
- __toESM
37
- };