# 05 — Output Formatting Rules ## Copilot Agent Rendering Specification This file defines exactly how the Agent must format its output when a user requests test results, calculations, or method analysis. The Agent must follow these rules without deviation. --- ## 0. Data Guardrails (Read First — Mandatory) > **Rule: Never guess or estimate price data.** > > If historical index price data has not been provided by the user for a specific date, > or if a reset date falls outside the provided price table: > - Leave the **Price** cell **empty** (blank). > - Leave the **Price Average** cell **empty** (blank). > - Do **not** show zero, N/A, a placeholder, or an estimated value. > - Do **not** use prices from a different date as a proxy. > > The only exception: if the user explicitly states a default price to use for missing dates, > apply that stated value and annotate it as `(user-supplied default)`. --- ## 1. Tab 1 — Row-by-Row Summary Table **When to use:** When the user asks for a test run summary, batch results, or "run all tests." **Format:** A single continuous Markdown table, one row per test case, ordered by TC_ID. ### 1.1 Column Headers (exact, in this order) ``` TC_ID | Method_Name | Pricing_Event | Non_GBD_Roll | BOL_Date | BOL_DoW | Scenario | Pivot_Date | Pivot_DoW | Window_Start | Start_DoW | Window_End | End_DoW | # Days | Incl_Pivot | Price_Average | Status | Notes ``` ### 1.2 Full Column Specification | Column | Format | Example | |---|---|---| | TC_ID | Text | TC-001 | | Method_Name | Text | X DAYS ARD Event | | Method_Name | Text | X DAYS ARD Event | | Pricing_Event | Text | BOL | | Non_GBD_Roll | Text | -Sat+Sun+MonHol-Hol | | BOL_Date | MM/DD/YYYY | 03/18/2026 | | BOL_DoW | 3-letter day | Wed | | Scenario | Text | TC-A: Normal weekday (Wednesday) | | Pivot_Date | MM/DD/YYYY | 03/18/2026 | | Pivot_DoW | 3-letter day | Wed | | Window_Start | MM/DD/YYYY | 03/17/2026 | | Start_DoW | 3-letter day | Tue | | Window_End | MM/DD/YYYY | 03/19/2026 | | End_DoW | 3-letter day | Thu | | # Days | Integer | 3 | | Incl_Pivot | Yes / No | Yes | | Price_Average | 4 decimal places or **empty** | 75.4367 | | Status | PASS / FAIL / ERROR | PASS | | Notes | Text or blank | Mismatch: Days(exp=3 got=2) | ### 1.3 Status Colour Coding | Status | Display | |---|---| | PASS | ✅ PASS | | FAIL | ❌ FAIL | | ERROR | ⚠️ ERROR | | APPROXIMATE | 🔶 APPROX | ### 1.4 Example Summary Table ```markdown | TC_ID | Method_Name | BOL_Date | Pivot_Date | Window_Start | Window_End | # Days | Incl_Pivot | Price_Average | Status | |---|---|---|---|---|---|---|---|---|---|---| | TC-001 | X DAYS ARD Event | 03/18/2026 | 03/18/2026 | 03/17/2026 | 03/19/2026 | 3 | Yes | | ✅ PASS | | TC-002 | X DAYS ARD Event | 03/27/2026 | 03/27/2026 | 03/26/2026 | 03/30/2026 | 3 | Yes | | ✅ PASS | ``` --- ## 2. Tab 2 — Method Breakdown (Vertical Detail Tables) **When to use:** When the user asks for detailed results or reset date breakdowns. **Format:** Grouped by Method_Name. Each test case gets its own vertical detail block. ### 2.1 Block Structure (per test case) #### Element A — Test Case Header ``` ### [Status emoji] TC-XXX | Method: [Method Name] **BOL:** MM/DD/YYYY (DoW) | **Pivot:** MM/DD/YYYY (DoW) | **Window:** MM/DD/YYYY – MM/DD/YYYY | **Incl. Pivot:** Yes/No ``` For TMA methods, add the sequence context: ``` **BOL:** MM/DD/YYYY (DoW) | **prevDate:** MM/DD/YYYY | **currDate:** MM/DD/YYYY | **Pivot:** MM/DD/YYYY | **Window:** MM/DD/YYYY – MM/DD/YYYY | **Incl. Pivot:** Yes ``` #### Element B — Window Summary ``` > **Scenario:** [Scenario text] > **Num_Days:** N | **Price_Average:** [value or *blank if no prices*] ``` #### Element C — Reset Date Detail Table ```markdown | TC_ID | # | Reset Date | Day | Price | |---|---|---|---|---| | TC-XXX | 1 | MM/DD/YYYY | Mon | [price or blank] | | TC-XXX | 2 | MM/DD/YYYY | Tue | [price or blank] | | TC-XXX | **AVG** | | | **[average or blank]** | ``` **Rules:** - TC_ID column is mandatory — repeat on every row including AVG. - One row per reset date (after Include/Exclude pivot logic). - Price blank if not available — never zero or N/A. - Rows in ascending date order. #### Element D — Status Footer ``` **Result:** ✅ PASS **Notes:** [blank if PASS, mismatch detail if FAIL] ``` ### 2.2 Example — X DAYS ARD Event ```markdown ## X DAYS ARD Event — X DAYS ARD Event --- ### ✅ TC-001 | Method: X DAYS ARD Event **BOL:** 03/18/2026 (Wed) | **Pivot:** 03/18/2026 (Wed) | **Window:** 03/17/2026 – 03/19/2026 | **Incl. Pivot:** Yes > **Scenario:** TC-A: Normal weekday (Wednesday) > **Num_Days:** 3 | **Price_Average:** *(no price data provided)* | TC_ID | # | Reset Date | Day | Price | |---|---|---|---|---| | TC-001 | 1 | 03/17/2026 | Tue | | | TC-001 | 2 | 03/18/2026 | Wed | | | TC-001 | 3 | 03/19/2026 | Thu | | | TC-001 | **AVG** | | | | **Result:** ✅ PASS **Notes:** ``` ### 2.3 Example — TMA Argus/Platts ```markdown ### ✅ TC-TMA-A01 | Method: TMA Argus/Platts **BOL:** 03/18/2026 (Wed) | **prevDate:** 01/23/2026 (Fri) | **currDate:** 03/25/2026 (Wed) | **Pivot:** 01/26/2026 (Mon) | **Window:** 01/26/2026 – 02/25/2026 | **Incl. Pivot:** Yes > **Scenario:** TC-A: Normal weekday, mid-period > **Num_Days:** 22 | **Price_Average:** *(no price data provided)* ``` --- ## 3. Single Test Case Query Format When the user asks about a single method calculation, show: 1. Parameter summary (method, BOL, roll rule, scenario). 2. The calculated window block (Tab 2 format, single block). 3. A comparison against expected values if provided, with PASS/FAIL. ### 3.1 DEEMED DATE (DEEMED DATE — Special Header ``` ### [Status emoji] TC-XXX | Method: DEEMED DATE **Pricing Period:** MM/DD/YYYY – MM/DD/YYYY | **Reset_Sym_Date:** [1d / 1cd] | **NGB Roll:** No Roll ``` No BOL_Date or Pivot_Date line (not applicable). --- ## 4. Error Handling Format ```markdown > ⚠️ **ERROR — TC-XXX** > Reason: [specific reason] > Action required: Correct the input and resubmit. ``` Stop that test case and move to the next one. Do not guess. --- ## 5. Response Length and Pagination - ≤ 10 test cases: show all Tab 1 and Tab 2 in a single response. - 11–50 test cases: Tab 1 in full, offer Tab 2 by method group on demand. - 51+ test cases: Tab 1 summary only. Offer Tab 2 on demand by method or TC range. --- ## 6. Locale and Number Format — Mandatory ALL output must use American (US) locale: - Dates: **MM/DD/YYYY** (e.g., 03/18/2026 for 18 March 2026) - Decimal: period (75.4367 — NOT 75,4367) - Thousands: comma (1,000 — NOT 1.000) Applies regardless of the language the user writes in. --- ## 7. Copying Agent Output into Excel The standard Markdown Tab 1 table can be copied directly from the chat and imported into Excel using the **`Import_And_Format`** macro in `PM_Excel_Format.bas`. ### 7.1 Step-by-Step 1. Run any test in the Copilot Agent — normal Tab 1 Markdown output. 2. **Select and copy** the entire Tab 1 table (header + separator + data rows). Do not copy Tab 2 blocks. 3. In Excel: open `PM_TestRunner.xlsm` → blank sheet → click cell **A1** → **Ctrl+V**. 4. Press **Alt+F8** → select **`Import_And_Format`** → **Run**. ### 7.2 Available Macros | Macro | Purpose | |---|---| | `Import_And_Format` | **Main macro** — parse + format in one step | | `Format_QA_Results` | Format only (if data already in columns) | | `Parse_Markdown_Table` | Parse only (no formatting) | | `Clear_QA_Sheet` | Wipe sheet before pasting new results | --- ## 8. Excel File Output When user asks to generate an Excel file, produce two flat tables: ### 8.1 Sheet 1 — Summary (Tab 1 data) One row per test case. Columns in this order: TC_ID | Method_Name | Pricing_Event | Non_GBD_Roll | BOL_Date | BOL_DoW | Scenario | Pivot_Date | Pivot_DoW | Window_Start | Start_DoW | Window_End | End_DoW | Num_Days | Incl_Pivot | Price_Average | Status (no emoji) | Notes ### 8.2 Sheet 2 — Detail (reset date data) One row per reset date. TC_ID links back to Sheet 1: TC_ID | Method_Name | Row_Num | Reset_Date | Day | Price AVG row: Row_Num = "AVG", Reset_Date blank, Day blank, Price = average or blank. Status values in Excel: plain text (`PASS`, `FAIL`, `APPROX`, `ERROR`) — no emoji. --- *This file defines the complete rendering contract for the Copilot Agent.* *No other output format is permitted when computing test results.*