Skip to content

Commit a14c74e

Browse files
bhavesh-kaushalHarness
authored andcommitted
faet: [CCM-25001]: updating prompt (#149)
* CCM-25001-updating prompt
1 parent 4483b47 commit a14c74e

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

pkg/harness/prompts/files/external/ccm.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ Enable users to make informed decisions about their cloud costs by leveraging Ha
1717
- Interact with the user naturally. For example, instead of saying "Step 1: Fetching Available Cost Labels," you should say something like, "Okay, let me see what cost labels are available..."
1818
- Continue the conversation from step 4 once you receive user input in step 3.
1919
- **IMPORTANT: If the user provides specific filter criteria (like "label_key IN ['harness-team']"), skip the ccm_perspective_filter_values_event call and proceed directly to fetching values for the specified label using ccm_perspective_filter_values.**
20+
- **IMPORTANT: DO NOT provide any json response in the summary message to the user.**
2021

2122

2223

23-
## Workflow Template for Team/Department/Environment based cost perspective template
24+
25+
## Workflow Template for Team/Department/Environment/Applications/Service based cost perspective template
2426
##Template: Create Cost Perspective
2527
## Instructions for the AI are below this line.
2628

@@ -44,10 +46,20 @@ Step 4: Validate Perspective Rules
4446
- Parameters: Ensure all keys in the JSON payload are in `snake_case`.
4547
- Formulate the `view_conditions` JSON structure based on the key(s) and value(s) identified in the previous steps.
4648
- **Rule Construction Logic:**
47-
- For each selected label key (e.g., `team`), this key MUST be used as the `field_name` in a `view_condition`.
48-
- For each selected label key (e.g., `team`), field_id MUST be used as the `labels.value` in a `view_condition`.
49-
- The corresponding values for that key (e.g., `engineering`, `finance`) MUST be placed in the `values` array.
50-
- You MUST create one `view_condition` object for each label key.
49+
- You MUST create a separate view_rule object for each unique label key (e.g., team, app).
50+
- You MUST create one `view_condition` object per view_rule.
51+
- This view_condition object must be built as follows:
52+
- For each selected label key (e.g., `team`), selected key MUST be used as the `field_name` in a `view_condition`.
53+
- For each selected label key (e.g., `team`), field_id MUST be used as the `labels.value` in a `view_condition`.
54+
- The corresponding values for that key (e.g., `engineering`, `finance`) MUST be placed in the `values` array.
55+
- view_operator: This field is critical and must follow these rules:
56+
- The value MUST ALWAYS be the string "IN".
57+
- You are STRICTLY FORBIDDEN from using "NOT_NULL".
58+
- Even if you want to include all values for a label, you MUST use "IN" with the complete list of values.
59+
- NEVER use "NOT_NULL" as a shortcut - always fetch and include the actual values in the "IN" operator.
60+
- **CRITICAL VALIDATION RULE:** Before calling validate_ccm_perspective_rules, verify that:
61+
- Every view_condition uses "IN" as the view_operator.
62+
- Every view_condition has a non-empty values array.
5163

5264
Step 5: Ask for User Confirmation
5365
- Ask for explicit confirmation. Example: "I can create a perspective with the following rules: [Show Rules]. Shall I proceed?"

pkg/harness/prompts/files/internal/standard/ccm.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ Enable users to make informed decisions about their cloud costs by leveraging Ha
1717
- Interact with the user naturally. For example, instead of saying "Step 1: Fetching Available Cost Labels," you should say something like, "Okay, let me see what cost labels are available..."
1818
- Continue the conversation from step 4 once you receive user input in step 3.
1919
- **IMPORTANT: If the user provides specific filter criteria (like "label_key IN ['harness-team']"), skip the ccm_perspective_filter_values_event call and proceed directly to fetching values for the specified label using ccm_perspective_filter_values.**
20+
- **IMPORTANT: DO NOT provide any json response in the summary message to the user.**
2021

2122

2223

23-
## Workflow Template for Team/Department/Environment based cost perspective template
24+
25+
## Workflow Template for Team/Department/Environment/Applications/Service based cost perspective template
2426
##Template: Create Cost Perspective
2527
## Instructions for the AI are below this line.
2628

@@ -44,10 +46,20 @@ Step 4: Validate Perspective Rules
4446
- Parameters: Ensure all keys in the JSON payload are in `snake_case`.
4547
- Formulate the `view_conditions` JSON structure based on the key(s) and value(s) identified in the previous steps.
4648
- **Rule Construction Logic:**
47-
- For each selected label key (e.g., `team`), this key MUST be used as the `field_name` in a `view_condition`.
48-
- For each selected label key (e.g., `team`), field_id MUST be used as the `labels.value` in a `view_condition`.
49-
- The corresponding values for that key (e.g., `engineering`, `finance`) MUST be placed in the `values` array.
50-
- You MUST create one `view_condition` object for each label key.
49+
- You MUST create a separate view_rule object for each unique label key (e.g., team, app).
50+
- You MUST create one `view_condition` object per view_rule.
51+
- This view_condition object must be built as follows:
52+
- For each selected label key (e.g., `team`), selected key MUST be used as the `field_name` in a `view_condition`.
53+
- For each selected label key (e.g., `team`), field_id MUST be used as the `labels.value` in a `view_condition`.
54+
- The corresponding values for that key (e.g., `engineering`, `finance`) MUST be placed in the `values` array.
55+
- view_operator: This field is critical and must follow these rules:
56+
- The value MUST ALWAYS be the string "IN".
57+
- You are STRICTLY FORBIDDEN from using "NOT_NULL".
58+
- Even if you want to include all values for a label, you MUST use "IN" with the complete list of values.
59+
- NEVER use "NOT_NULL" as a shortcut - always fetch and include the actual values in the "IN" operator.
60+
- **CRITICAL VALIDATION RULE:** Before calling validate_ccm_perspective_rules, verify that:
61+
- Every view_condition uses "IN" as the view_operator.
62+
- Every view_condition has a non-empty values array.
5163

5264
Step 5: Ask for User Confirmation
5365
- Ask for explicit confirmation. Example: "I can create a perspective with the following rules: [Show Rules]. Shall I proceed?"

0 commit comments

Comments
 (0)