The quarterly loss-ratio and reserve indication, ready for the committee

Claims transactions and premium into paid and incurred triangles by line at September and a rebuilt June, chain-ladder factors with tail selections, ultimates, IBNR and the change since June, paid tied to the GL, everything locked but the selections, and a five-slide committee deck.

Who
Granite Mutual's reserving team's LangGraph agent, on OpenAI gpt-6.1-sol
Runs in
LangGraph
Hands over
.pptxgranite-mutual-q3-2026-reserve-committee.pptx.xlsxgranite-mutual-q3-2026-reserving.xlsx
5 slides + 16 sheetsin 2 files, opened in Office
15 turns, 5 minone agent run in LangGraph on gpt-6.1-sol, unedited

The ask

Q3 reserve indication for the committee. The claims transactions, earned premium and the GL's paid to date are in this folder; reserving_note.md has what we need. Build the reserving workbook (paid and incurred triangles by line, chain-ladder factors and your tail selections, ultimates, IBNR, loss and combined ratios) with paid tying to the GL, lock everything but the selections, and the committee deck. Ledger theme.

Granite Mutual's reserving team's LangGraph agent, on OpenAI gpt-6.1-sol

After each quarter's close the reserving actuary rebuilds the triangles from the claims extract, ties paid losses to the general ledger and drafts the committee deck, leaving the least time for the actual selections.

This run is a LangGraph agent, built the way the docs show with artiwright's Python package, on OpenAI's gpt-6.1-sol. It gets the request, the paths of the files and the notes, and nothing else.

What they handed over

Made-up data in the shape of a real export. Download it and try the ask yourself.

What came out

granite-mutual-q3-2026-reserve-committee.pptxPowerPoint · 5 slides · 46 KB
Download
granite-mutual-q3-2026-reserving.xlsxExcel · 16 sheets · 131 KB
Download

Screenshots exported by PowerPoint and Excel.

What the agent noticed

Paid ties to the GL, and a second calculation agrees

Paid losses in the triangles come to $17,571,250, matching the GL with no difference on any line. The agent also recomputed each line's ultimate at both valuations outside the formulas and wrote the difference, zero, into the Checks sheet.

It said what it had rebuilt

The files had no booked June reserve, so the agent rebuilt June from transactions dated through June 30 and said on the slide that it is not booked. The $275K rise in IBNR splits into $735K released on existing accident quarters and $1.01M from the new quarter.

It flagged where judgment carries the number

Commercial Property holds 87% of the $2.00M IBNR, on a 1.020 tail the agent called judgment, with its oldest link resting on one accident quarter. Raising every tail by 0.01 adds $207K, $102K of it Property, and the new Property quarter runs at a 147.3% combined ratio. The deck asks the committee to challenge the Property tail and compare with booked reserves before booking anything.

Build it yourself

Q3 reserve indication for the committee. The claims transactions, earned premium and the GL's paid to date are in this folder; reserving_note.md has what we need. Build the reserving workbook (paid and incurred triangles by line, chain-ladder factors and your tail selections, ultimates, IBNR, loss and combined ratios) with paid tying to the GL, lock everything but the selections, and the committee deck. Ledger theme.

Set Artiwright up in your app first: Quickstart for AI apps, Google ADK, LangGraph, Node.js.

Inside the workbook

16 sheets, laid out by the agent. In its words, sheet by sheet:

  1. The Summary sheet
    Summary

    Paid, case, ultimate, IBNR and outstanding by line, with loss, expense and combined ratios, the June IBNR, the change split between existing accident quarters and the new one, the effect of a higher tail, and a chart of IBNR by line at June and September.

  2. The Selections sheet
    Selections

    Age-to-age links for each line at both valuations, defaulting to the volume-weighted experience, and the tails with the reason for each: the only cells that can be edited.

  3. The Checks sheet
    Checks

    Paid against the GL for each line, the reserve identity, nine controls that must be zero and the gap to a second calculation done outside the formulas. All zero.

  4. The Method sheet
    Method

    Scope, how the triangles and factors are built, the reasoning for each tail, how June was rebuilt, what the ratios cover and what the indication leaves out.

Show all 10 sheets
  1. PA Q3, HO Q3, CP Q3

    Paid and incurred triangles for each line at September 30, the development links and factors to ultimate, and ultimate, IBNR and ratios by accident quarter.

  2. PA Q2, HO Q2, CP Q2

    The same at June 30, rebuilt from transactions dated on or before June 30 with their own factors, so the change in IBNR can be measured.

  3. The Controls sheet
    Controls

    The valuation dates, expense ratios, the tail sensitivity and the other constants the formulas use.

  4. Claims, Premium, GL

    The 1,820 claim transactions, earned premium by line and accident quarter, and paid to date by GL account, as imported.

  5. The Chart Data sheet
    Chart Data

    June and September IBNR by line, behind the Summary chart.

  6. The Committee Figures sheet
    Committee Figures

    The rounded figures the deck quotes, linked to the Summary.

How it got thereSee all 23 calls the agent made, what lint found and the finalize report

The run

One real session in LangGraph (gpt-6.1-sol), with only Artiwright's tools and the paths of the files above. Nothing below is edited: every call the agent made, what came back, and the renders it looked at.

  1. artiwright_help
    {
      "query": "skill spreadsheets, guide workbook-existing, guide workbook-models",
      "search": "",
      "maxChars": 24000
    }
    ---
    name: artiwright-spreadsheets
    description: Build native Excel workbooks (.xlsx) with Artiwright - live formulas that compute as you write them, tables, number formats, conditional formats, data validation and native charts, then render, lint and publish a checked file. Use when a user asks for a spreadsheet, workbook, financial or operating model, budget, tracker, dashboard or data "as Excel".
    ---
    
    # Artiwright spreadsheets
    
    You build workbooks as code against a live document. Formulas compute as you write them, so you
    can read results back, check them, and look at the sheet as an image before you publish.
    Everything you make stays native and editable in Excel: real formulas (not pasted values), tables,
    number formats, conditional formats, validation dropdowns and charts linked to the cells.
    
    ## The loop
    
    1. **Plan the sheets.** Inputs (assumptions the user can change) → calculations → outputs
       (summary, charts). Decide the rows, columns and units before writing. Never invent numbers:
       ask, or label an assumption clearly as one.
    2. **Build** a sheet or a whole section per call: values, then formulas, then formats.
    3. **Look.** Render each sheet (`artiwright_render`) and read key results back (`return` a range,
       or `artiwright_inspect` with kind `formula`).
    4. **Check** with lint: formula errors, cycles, `####` columns, numbers stored as text, typed-in
       numbers in formulas. Fix everything in one call, then look again.
    5. **Publish** with finalize, stating requirements: the sheets, tables and charts that must exist
       and key cells with the values they must hold (`{ cell: "Checks!B2", equals: 0 }`).
    
    ## Work in few calls
    
    Every call resends the whole conversation, so a workbook made in 4 calls costs a fraction of one
    made in 25. When the user gives the data, this is usually enough:
    
    1. **One `artiwright_run` that builds every sheet**: rename `Sheet1`, write inputs, formulas,
       formats, tables, rules and charts, and `return` the key result cells to read them back.
    2. **`artiwright_lint`**. If it reports problems, fix them all in **one** run.
    3. **`artiwright_finalize`** with requirements (sheets, tables, charts, key cell values).
    
    - Don't probe the API with small runs: the calls on this page are enough. Use `help` only for
      something it doesn't show (`help("range.format")`, `help("functions")`).
    - One formula fills a range adjusted per row: `sheet
    …
  2. I’ll build the triangles and paid chain-ladder indication, reconcile paid losses to the GL, and reconstruct June 30 IBNR for the quarter-over-quarter comparison. I’ll document the tail selections, protect everything except the selection cells, and prepare a five-slide Ledger committee pack.

  3. artiwright_importclaims_transactions.csv
    {
      "session": "loss-reserving",
      "document": "reserving",
      "path": "./work/claims_transactions.csv",
      "content": "",
      "sheet": "Claims",
      "at": "A1",
      "replace": false,
      "table": "Claims",
      "dates": "iso",
      "theme": "ledger"
    }
    {
      "ok": true,
      "value": {
        "sheet": "Claims",
        "range": "A1:G1821",
        "rows": 1820,
        "columns": [
          "Claim ID",
          "Line",
          "Accident quarter",
          "Date",
          "Transaction",
          "Paid",
          "Case reserve change"
        ],
        "firstRows": [
          [
            "HO-23Q4-017",
            "Homeowners",
            "2023-Q4",
            45200,
            "Reported",
            1650,
            2250
          ],
          [
            "PA-23Q4-029",
            "Personal Auto",
            "2023-Q4",
            45201,
            "Reported",
            1600,
            1870
          ],
          [
            "PA-23Q4-035",
            "Personal Auto",
            "2023-Q4",
            45204,
            "Reported",
            6360,
            3350
          ]
        ],
        "table": "Claims"
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Claims"
      ],
      "version": 1,
      "lint": {
        "errors": 0,
        "warnings": 27
      },
      "next": "Use the table in formulas, e.g. =SUM(Claims[column]); import the next file the same way."
    }
  4. artiwright_help
    {
      "query": "sheet.protect, range.format, skill presentations",
      "search": "protect|locked",
      "maxChars": 18000
    }
    5 entries match "protect|locked":
      sheet  One sheet of a workbook.
      sheet.protect  Protects the sheet: locked cells (all, unless formatted with `locked: false`) can't be changed in Excel.
      sheet.unprotect  Removes the sheet's protection.
      sheet.isProtected  Whether the sheet is protected.
      CellFormatInput  How cells look.
  5. artiwright_importearned_premium.csv
    {
      "session": "loss-reserving",
      "document": "reserving",
      "path": "./work/earned_premium.csv",
      "content": "",
      "sheet": "Premium",
      "at": "A1",
      "replace": false,
      "table": "Premium",
      "dates": "iso",
      "theme": "ledger"
    }
    {
      "ok": true,
      "value": {
        "sheet": "Premium",
        "range": "A1:C36",
        "rows": 35,
        "columns": [
          "Line",
          "Accident quarter",
          "Earned premium"
        ],
        "firstRows": [
          [
            "Personal Auto",
            "2023-Q4",
            643100
          ],
          [
            "Personal Auto",
            "2024-Q1",
            648700
          ],
          [
            "Personal Auto",
            "2024-Q2",
            661000
          ]
        ],
        "table": "Premium"
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Claims",
        "Premium"
      ],
      "version": 2,
      "lint": {
        "errors": 0,
        "warnings": 28
      },
      "next": "Use the table in formulas, e.g. =SUM(Premium[column]); import the next file the same way."
    }
  6. artiwright_importgl_paid_to_date.csv
    {
      "session": "loss-reserving",
      "document": "reserving",
      "path": "./work/gl_paid_to_date.csv",
      "content": "",
      "sheet": "GL",
      "at": "A1",
      "replace": false,
      "table": "GLPaid",
      "dates": "iso",
      "theme": "ledger"
    }
    {
      "ok": true,
      "value": {
        "sheet": "GL",
        "range": "A1:C4",
        "rows": 3,
        "columns": [
          "Line",
          "GL account",
          "Paid losses to date"
        ],
        "firstRows": [
          [
            "Personal Auto",
            "5110-PA",
            5035820
          ],
          [
            "Homeowners",
            "5120-HO",
            4836260
          ],
          [
            "Commercial Property",
            "5130-CP",
            7699170
          ]
        ],
        "table": "GLPaid"
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Claims",
        "GL"
      ],
      "version": 2,
      "lint": {
        "errors": 0,
        "warnings": 28
      },
      "next": "Use the table in formulas, e.g. =SUM(GLPaid[column]); import the next file the same way."
    }
  7. artiwright_help
    {
      "query": "sheet.protect, CellFormatInput, skill presentations",
      "search": "",
      "maxChars": 23000
    }
    sheet.protect: sheet.protect(input: ProtectInput?): this
    Protects the sheet: locked cells (all, unless formatted with `locked: false`) can't be changed in Excel. `sheet.protect({ password: "plan", allow: ["sort", "autoFilter"] })`.
    
    Examples:
      sheet.protect({ password: "plan", allow: ["sort", "autoFilter"] })
    
    CellFormatInput
    How cells look. Colors are tokens like the rest of Artiwright ("accent1", "slate-100", "#2346C8"); borders are "style color" strings ("thin slate-300", "medium").
      numberFormat?: string  An Excel number format code, or a shortcut: "integer", "percent", "currency", "millions", "date", …
      font?: string  Font family; default the theme's body font.
      fontSize?: number  Font size in points.
      bold?: boolean
      italic?: boolean
      underline?: boolean | "single" | "double" | "singleAccounting" | "doubleAccounting"
      strike?: boolean
      color?: string  Text color.
      fill?: string  Background color (a solid fill).
      align? (left | center | right | fill | justify | centerAcross | distributed)
      valign? (top | middle | bottom | justify | distributed)
      wrap?: boolean
      indent?: number
      rotation?: number  Degrees, -90 to 90.
      shrinkToFit?: boolean
      border?: string  All four edges of every cell: "thin", "medium slate-400", or "none".
      borderTop?: string
      borderBottom?: string
      borderLeft?: string
      borderRight?: string
      locked?: boolean  Unlocked cells stay editable when the sheet is protected.
    
    ---
    name: artiwright-presentations
    description: Build native, editable PowerPoint decks (.pptx) with Artiwright - plan the story, compose slides from layout recipes with real charts and tables, render and lint them, fix problems by anchor, and publish a checked file. Use when a user asks for a presentation, deck, slides, a QBR, a pitch, or a report "as PowerPoint".
    ---
    
    # Artiwright presentations
    
    You build decks as code against a live document, look at what you built, fix it, and publish a file
    that has been checked. Every object has an anchor (`sl_…` slides, `sh_…` shapes, `ch_…` charts,
    `tb_…` tables, `im_…` pictures) that stays the same across calls, so you can point at exactly what
    to change.
    
    ## The loop
    
    1. **Plan.** Who is the audience and what should they conclude? Write one message per slide. A slide
       that reports a finding gets a headline sentence with the claim ("Enterprise drove 48% of new
       ARR", not "Revenue"); a slide that sets some
    …
  8. artiwright_run
    const c=workbook.sheets.get('Claims').range('A2:G1821').values; return {sheets:workbook.sheets.items.map(s=>s.name), lines:[...new Set(c.map(r=>r[1]))], quarters:[...new Set(c.map(r=>r[2]))].sort(),types:[...new Set(c.map(r=>r[4]))], dates:[Math.min(...c.map(r=>r[3])),Math.max(...c.map(r=>r[3]))], totals:[...new Set(c.map(r=>r[1]))].map(l=>({line:l,paid:c.filter(r=>r[1]===l).reduce((a,r)=>a+r[5],0),case:c.filter(r=>r[1]===l).reduce((a,r)=>a+r[6],0)})),last:c.slice(-8)};
    {
      "ok": true,
      "value": {
        "sheets": [
          "Claims",
          "Premium"
        ],
        "lines": [
          "Homeowners",
          "Personal Auto",
          "Commercial Property"
        ],
        "quarters": [
          "2023-Q4",
          "2024-Q1",
          "2024-Q2",
          "2024-Q3",
          "2024-Q4",
          "2025-Q1",
          "2025-Q2",
          "2025-Q3",
          "2025-Q4",
          "2026-Q1",
          "2026-Q2",
          "2026-Q3"
        ],
        "types": [
          "Reported",
          "Reported and closed",
          "Final payment",
          "Payment"
        ],
        "dates": [
          45200,
          46293
        ],
        "totals": [
          {
            "line": "Homeowners",
            "paid": 4836260,
            "case": 163350
          },
          {
            "line": "Personal Auto",
            "paid": 5035820,
            "case": 260500
          },
          {
            "line": "Commercial Property",
            "paid": 7699170,
            "case": 938030
          }
        ],
        "last": [
          [
            "PA-25Q2-027",
            "Personal Auto",
            "2025-Q2",
            46289,
            "Final payment",
            510,
            -460
          ],
          [
            "PA-25Q4-011",
            "Personal Auto",
            "2025-Q4",
            46289,
            "Payment",
            640,
            -350
          ],
          [
            "PA-26Q3-024",
            "Personal Auto",
            "2026-Q3",
            46291,
            "Reported",
            2440,
            3440
          ],
          [
            "CP-26Q2-003",
            "Commercial Property",
            "2026-Q2",
            46292,
            "Payment",
            68220,
            -29420
          ],
          [
            "HO-26Q3-014",
            "Homeowners",
            "2026-Q3",
            46292,
            "Reported and closed",
            14360,
            0
          ],
          [
            "PA-25Q2-034",
            "Personal Auto",
            "2025-Q2",
            46292,
            "Payment",
            60,
            -30
          ],
          [
            "CP-26Q3-011",
            "Commercial Property",
            "2026-Q3",
            46293,
            "Reported",
            18480,
            91000
          ],
          [
            "PA-25Q4-013",
            "Personal Auto",
            "2025-Q4",
            46293,
            "Payment",
            1240,
            -960
          ]
        ]
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Claims",
        "Premium"
      ],
      "version": 2,
      "lint": {
        "errors": 0,
        "warnings": 28
      }
    }
  9. artiwright_importgl_paid_to_date.csv
    {
      "session": "loss-reserving",
      "document": "reserving",
      "path": "./work/gl_paid_to_date.csv",
      "content": "",
      "sheet": "GL",
      "at": "A1",
      "replace": false,
      "table": "GLPaid",
      "dates": "iso",
      "theme": "ledger"
    }
    {
      "ok": true,
      "value": {
        "sheet": "GL",
        "range": "A1:C4",
        "rows": 3,
        "columns": [
          "Line",
          "GL account",
          "Paid losses to date"
        ],
        "firstRows": [
          [
            "Personal Auto",
            "5110-PA",
            5035820
          ],
          [
            "Homeowners",
            "5120-HO",
            4836260
          ],
          [
            "Commercial Property",
            "5130-CP",
            7699170
          ]
        ],
        "table": "GLPaid"
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Claims",
        "Premium",
        "GL"
      ],
      "version": 3,
      "lint": {
        "errors": 0,
        "warnings": 29
      },
      "next": "Use the table in formulas, e.g. =SUM(GLPaid[column]); import the next file the same way."
    }
  10. artiwright_run
    const rows=workbook.sheets.get('Claims').range('A2:G1821').values;const p=workbook.sheets.get('Premium').range('A2:C36').values;const qs=[...new Set(rows.map(r=>r[2]))].sort();const serial=d=>(Date.parse(d)-Date.UTC(1899,11,30))/86400000;return {premium:p,profiles:['Personal Auto','Homeowners','Commercial Property'].map(l=>({line:l, snapshots:['2026-09-30','2026-06-30'].map(d=>{const v=serial(d);const qv=d==='2026-09-30'?11:10;const aq=qs.filter(q=>rows.some(r=>r[1]===l&&r[2]===q)&&qs.indexOf(q)<=qv);const n=qv-qs.indexOf(aq[0])+1;const tri=aq.map(q=>Array.from({length:n},(_,j)=>{const ix=qs.indexOf(q)+j;if(ix>qv)return null;const year=2023+Math.floor((3+ix)/4),month=((3+ix)%4+1)*3;const end=(Date.UTC(year,month,0)-Date.UTC(1899,11,30))/86400000;return rows.filter(r=>r[1]===l&&r[2]===q&&r[3]<=end).reduce((a,r)=>a+r[5],0)}));return {date:d,n,factors:Array.from({length:n-1},(_,j)=>{const pairs=tri.filter(r=>r[j+1]!=null);return pairs.reduce((a,r)=>a+r[j+1],0)/pairs.reduce((a,r)=>a+r[j],0)}),paid:rows.filter(r=>r[1]===l&&r[3]<=v).reduce((a,r)=>a+r[5],0),case:rows.filter(r=>r[1]===l&&r[3]<=v).reduce((a,r)=>a+r[6],0)}})}))};
    {
      "ok": true,
      "value": {
        "premium": [
          [
            "Personal Auto",
            "2023-Q4",
            643100
          ],
          [
            "Personal Auto",
            "2024-Q1",
            648700
          ],
          [
            "Personal Auto",
            "2024-Q2",
            661000
          ],
          [
            "Personal Auto",
            "2024-Q3",
            662700
          ],
          [
            "Personal Auto",
            "2024-Q4",
            668300
          ],
          [
            "Personal Auto",
            "2025-Q1",
            686800
          ],
          [
            "Personal Auto",
            "2025-Q2",
            715600
          ],
          [
            "Personal Auto",
            "2025-Q3",
            727100
          ],
          [
            "Personal Auto",
            "2025-Q4",
            731500
          ],
          [
            "Personal Auto",
            "2026-Q1",
            717700
          ],
          [
            "Personal Auto",
            "2026-Q2",
            736100
          ],
          [
            "Personal Auto",
            "2026-Q3",
            728300
          ],
          [
            "Homeowners",
            "2023-Q4",
            648200
          ],
          [
            "Homeowners",
            "2024-Q1",
            679800
          ],
          [
            "Homeowners",
            "2024-Q2",
            665700
          ],
          [
            "Homeowners",
            "2024-Q3",
            688100
          ],
          [
            "Homeowners",
            "2024-Q4",
            696300
          ],
          [
            "Homeowners",
            "2025-Q1",
            714500
          ],
          [
            "Homeowners",
            "2025-Q2",
            718900
          ],
          [
            "Homeowners",
            "2025-Q3",
            717800
          ],
          [
            "Homeowners",
            "2025-Q4",
            714600
          ],
          [
            "Homeowners",
            "2026-Q1",
            741900
          ],
          [
            "Homeowners",
            "2026-Q2",
            732000
          ],
          [
            "Homeowners",
            "2026-Q3",
            758700
          ],
          [
            "Commercial Property",
            "2024-Q1",
            1450600
          ],
          [
            "Commercial Property",
            "2024-Q2",
            1485600
          ],
          [
            "Commercial Property",
            "2024-Q3",
            1502000
          ],
          [
            "Commercial Property",
            "2024-Q4",
            1574000
          ],
          [
            "Commercial Property",
            "2025-Q1",
            1600300
          ],
          [
            "Commercial Property",
            "2025-Q2",
            1626100
          ],
          [
            "Commercial Property",
            "2025-Q3",
            15
    …
  11. Paid transactions tie exactly to the GL for all three lines. Commercial Property has only 11 development quarters and still shows late payments, so I’ll select a larger tail than for Auto and Homeowners.

    The June comparison will be a reconstructed indication, not a booked-reserve movement: the files do not include last quarter’s selected or booked reserves. I’ll label that distinction and separate the IBNR change into existing accident quarters and the new quarter.

  12. artiwright_runerror
    const lines=['Personal Auto','Homeowners','Commercial Property'],codes=['PA','HO','CP'];const raw=workbook.sheets.get('Claims').range('A2:G1821').values;const qs=[...new Set(raw.map(r=>r[2]))].sort();const serial=(y,m,d)=>(Date.UTC(y,m-1,d)-Date.UTC(1899,11,30))/86400000;const start=q=>serial(+q.slice(0,4),(+q.slice(-1)-1)*3+1,1);const col=i=>{let s='';for(;i;i=Math.floor((i-1)/26))s=String.fromCharCode(65+(i-1)%26)+s;return s};const add=n=>workbook.sheets.add(n);const summary=add('Summary'),sel=add('Selections'),ctl=add('Controls'),method=add('Method'),checks=add('Checks');
    ctl.range('A1:B1').values=[['CONTROL / UNIT','VALUE']];ctl.range('A2:B16').values=[['Current valuation',serial(2026,9,30)],['Prior valuation',serial(2026,6,30)],['Months per quarter',3],['Quarter-end month offset',2],['Zero',0],['One',1],['Money rounding digits',2],['Tail sensitivity (absolute factor)',0.01],['Personal Auto expense ratio',0.255],['Homeowners expense ratio',0.305],['Commercial Property expense ratio',0.335],['Current last quarter index',11],['Prior last quarter index',10],['Source transactions',raw.length],['Minimum admissible factor',1]];ctl.range('B2:B3').numberFormat='yyyy-mm-dd';ctl.range('B9:B12').numberFormat='percent1';[['ValDate',2],['PriorDate',3],['QMonths',4],['EndOffset',5],['Zero',6],['One',7],['Cents',8],['TailShock',9]].forEach(([n,r])=>workbook.names.add(n,`Controls!$B$${r}`));
    sel.merge('A1:P1');sel.range('A1').values=[['Granite Mutual | Reserving selections']];sel.merge('A2:P2');sel.range('A2').values=[['Blue cells only are editable. Factor defaults link to volume-weighted experience; overwrite to select. Tails are judgemental, not fitted.']];sel.range('A4:P4').values=[['Line','Valuation',...Array.from({length:11},(_,i)=>`${i+1} to ${i+2}`),'Tail','Oldest age','Tail rationale']];
    const info=[];
    for(let l=0;l<3;l++)for(let v=0;v<2;v++){
    const qv=11-v;const aqs=qs.filter(q=>qs.indexOf(q)<=qv&&raw.some(r=>r[1]===lines[l]&&r[2]===q));const n=aqs.length;const name=`${codes[l]} ${v?'Q2':'Q3'}`,s=add(name);const sr=5+l*2+v;const tail=l===2?(v?1.025:1.02):1.002;sel.range(`A${sr}:B${sr}`).values=[[lines[l],v?'2026-06-30':'2026-09-30']];sel.range(`N${sr}:P${sr}`).values=[[tail,n,l===2?'Limited post-2024 history; late payments persist. Q2 tail higher for one less observed age.':'Late links flat, but very few mature cohorts. Small residual margin for unobserved late payments.']];sel.range(`N${sr}`).format({locked:false,color:'blue-700',fill:'blue-50',numberFormat:'0.0000x'});sel.validations.add(`N${sr}`,{type:'decimal',operator:'greaterThanOrEqual',formula1:'=One'});
    s.merge('A1:N1');s.range('A1').values=[[`${lines[l]}: ${v?'June 30':'September 30'}, 2026`]];s.merge('A2:N2');s.range('A2').values=[['Cumulative dollars; age 1 is accident-quarter end. Empty upper-right cells are unobserved, never zero-filled.']];s.range('A4').values=[['PAID TRIANGLE ($)']];s.range('A20').values=[['INCURRED TRIANGLE ($): paid plus cumulative case reserve changes']];
    for(const hr of [5,21])s.range(`A${hr}:${col(n+2)}${hr}`).values=[['Accident quarter','Quarter start',...Array.from({length:n},(_,i)=>i+1)]];
    for(let i=0;i<n;i++){const r=6+i,ir=22+i,q=aqs[i],age=n-i;s.range(`A${r}:B${r}`).values=[[q,start(q)]];s.range(`A${ir}:B${ir}`).values=[[q,start(q)]];for(let j=0;j<age;j++){const c=col(j+3);const f=`SUMIFS(Claims[Paid],Claims[Line],$A$3,Claims[Accident quarter],$A${r},Claims[Date],\"<=\"&EOMONTH(EDATE($B${r},(${c}$5-One)*QMonths),EndOffset))`;s.range(`${c}${r}`).formulas='='+f;s.range(`${c}${ir}`).formulas=`=${c}${r}+SUMIFS(Claims[Case reserve change],Claims[Line],$A$3,Claims[Accident quarter],$A${ir},Claims[Date],\"<=\"&EOMONTH(EDATE($B${ir},(${c}$21-One)*QMonths),EndOffset))`;}}
    s.range('A3').values=[[lines[l]]];s.range('A37:B40').values=[['DEVELOPMENT','Basis'],['Volume-weighted link','Matched cohorts'],['Selected link','Selections tab'],['CDF to ultimate','Including tail']];
    for(let j=0;j<n;j++){const c=col(j+3),last=col(n+2),sc=col(j+3);s.range(`${c}37`).values=[[j===n-1?'Tail':`${j+1} to ${j+2}`]];if(j<n-1){const end=6+n-j-2, nc=col(j+4);s.range(`${c}38`).formulas=`=SUM(${nc}6:${nc}${end})/SUM(${c}6:${c}${end})`;sel.range(`${sc}${sr}`).formulas=`='${name}'!${c}38`;sel.range(`${sc}${sr}`).format({locked:false,color:'blue-700',fill:'blue-50',numberFormat:'0.0000x'});s.range(`${c}39`).formulas=`=Selections!${sc}${sr}`;}else{s.range(`${c}38`).values=[['n/a']];s.range(`${c}39`).formulas=`=Selections!N${sr}`;}s.range(`${c}40`).formulas=`=PRODUCT(${c}39:${last}39)`;}
    if(n<12)sel.range(`${col(n+2)}${sr}:M${sr}`).values=[Array(12-n).fill('n/a')];
    s.range('A44:N44').values=[['Accident quarter','Age (qtrs)','Paid ($)','Case ($)','Incurred ($)','Paid CDF','Ultimate ($)','Outstanding ($)','IBNR ($)','Earned premium ($)','Loss ratio','Expense ratio','Combined ratio','Tail +1pt IBNR ($)']];
    for(let i=0;i<n;i++){const r=45+i,tr=6+i,age=n-i,tc=col(age+2);s.range(`A${r}:B${r}`).values=[[aqs[i],age]];s.range(`C${r}`).formulas=`=${tc}${tr}`;s.range(`D${r}`).formulas=`=${tc}${22+i}-C${r}`;s.range(`E${r}`).formulas=`=C${r}+D${r}`;s.range(`F${r}`).formulas=`=${tc}$40`;s.range(`G${r}`).formulas=`=C${r}*F${r}`;s.range(`H${r}`).formulas=`=G${r}-C${r}`;s.range(`I${r}`).formulas=`=G${r}-E${r}`;s.range(`J${r}`).formulas=`=SUMIFS(Premium[Earned premium],Premium[Line],$A$3,Premium[Accident quarter],A${r})`;s.range(`K${r}`).formulas=`=G${r}/J${r}`;s.range(`L${r}`).formulas=`=Controls!$B$${10+l}`;s.range(`M${r}`).formulas=`=K${r}+L${r}`;s.range(`N${r}`).formulas=`=G${r}*(One+TailShock/Selections!$N$${sr})-E${r}`;}
    const total=45+n;s.range(`A${total}`).values=[['TOTAL / WEIGHTED']];for(const c of ['C','D','E','G','H','I','J','N'])s.range(`${c}${total}`).formulas=`=SUM(${c}45:${c}${total-1})`;s.range(`K${total}`).formulas=`=G${total}/J${total}`;s.range(`L${total}`).formulas=`=Controls!$B$${10+l}`;s.range(`M${total}`).formulas=`=K${total}+L${total}`;
    s.range(`B6:B${5+n}`).numberFormat='yyyy-mm-dd';s.range(`B22:B${21+n}`).numberFormat='yyyy-mm-dd';s.range('C6:N33').numberFormat='#,##0;[Red](#,##0);–';s.range('C38:N40').numberFormat='0.0000x';s.range(`C45:J${total}`).numberFormat='#,##0;[Red](#,##0);–';s.range(`F45:F${total}`).numberFormat='0.0000x';s.range(`K45:M${total}`).numberFormat='percent1';s.range(`N45:N${total}`).numberFormat='#,##0';s.range(`A${total}:N${total}`).format({bold:true,borderTop:'medium accent1',fill:'slate-100'});s.setColumnWidth('A',170).setColumnWidth('B',105).setColumnWidth('C:N',118);s.freeze(5,2);info.push({l,v,name,n,total,last:total-1,sr});
    }
    summary.merge('A1:P1');summary.range('A1').values=[['Granite Mutual | Q3 2026 reserve indication']];summary.merge('A2:P2');summary.range('A2').values=[['September 30, 2026 • All supplied accident quarters • USD • Paid chain ladder • Ratios are ultimate losses / matched earned premium']];summary.range('A4:P4').values=[['Line','Paid ($)','Case ($)','Incurred ($)','Ultimate ($)','IBNR ($)','Outstanding ($)','Earned premium ($)','Loss ratio','Expense ratio','Combined ratio','Q2 IBNR ($)','IBNR change ($)','Existing AQ change ($)','New AQ IBNR ($)','Tail +1pt impact ($)']];
    for(let l=0;l<3;l++){const r=5+l,cur=info.find(x=>x.l===l&&!x.v),pre=info.find(x=>x.l===l&&x.v);summary.range(`A${r}`).values=[[lines[l]]];for(const [dest,src]of [['B','C'],['C','D'],['D','E'],['E','G'],['F','I'],['G','H'],['H','J'],['I','K'],['J','L'],['K','M']])summary.range(`${dest}${r}`).formulas=`='${cur.name}'!${src}${cur.total}`;summary.range(`L${r}`).formulas=`='${pre.name}'!I${pre.total}`;summary.range(`M${r}`).formulas=`=F${r}-L${r}`;summary.range(`O${r}`).formulas=`='${cur.name}'!I${cur.last}`;summary.range(`N${r}`).formulas=`=M${r}-O${r}`;summary.range(`P${r}`).formulas=`='${cur.name}'!N${cur.total}-F${r}`;}
    summary.range('A8').values=[['TOTAL / WEIGHTED']];for(const c of ['B','C','D','E','F','G','H','L','M','N','O','P'])summary.range(`${c}8`).formulas=`=SUM(${c}5:${c}7)`;summary.range('I8').formulas='=E8/H8';summary.range('J8').formulas='=SUMPRODUCT(H5:H7,J5:J7)/H8';summary.range('K8').formulas='=I8+J8';summary.range('B5:H8').numberFormat='$#,##0;[Red]($#,##0);–';summary.range('I5:K8').numberFormat='percent1';summary.range('L5:P8').numberFormat='$#,##0;[Red]($#,##0);–';summary.range('A8:P8').format({bold:true,fill:'slate-100',borderTop:'medium accent1'});summary.merge('A10:P10');summary.range('A10').values=[['Q2 is a reconstructed June 30 indication with June-only data and independently estimated factors, not the booked prior reserve.']];summary.merge('A11:P11');summary.range('A11').values=[['IBNR = ultimate − paid − case. Outstanding = case + IBNR. Negative IBNR, if any, is retained. No discounting or added risk margin.']];summary.setColumnWidth('A',195).setColumnWidth('B:H',130).setColumnWidth('I:K',112).setColumnWidth('L:P',150);summary.freeze(4,1);
    summary.charts.add('column',{data:'A4:A7,F4:F7',at:'A14',size:{width:900,height:330},title:'IBNR by line at September 30, 2026 ($)'});
    checks.range('A1:E1').values=[['Line','Transaction paid ($)','GL paid ($)','Difference ($)','Reserve identity ($)']];for(let l=0;l<3;l++){const r=l+2,sr=l+5;checks.range(`A${r}`).values=[[lines[l]]];checks.range(`B${r}`).formulas=`=SUMIFS(Claims[Paid],Claims[Line],A${r},Claims[Date],\"<=\"&ValDate)`;checks.range(`C${r}`).formulas=`=SUMIFS(GLPaid[Paid losses to date],GLPaid[Line],A${r})`;checks.range(`D${r}`).formulas=`=ROUND(B${r}-C${r},Cents)`;checks.range(`E${r}`).formulas=`=ROUND(Summary!G${sr}-Summary!C${sr}-Summary!F${sr},Cents)`;}
    checks.range('A6:B15').values=[['Control','Result (must be zero)'],['Absolute GL differences','=SUMPRODUCT(ABS(D2:D4))'],['Transaction paid less triangle diagonal','=ROUND(SUM(B2:B4)-Summary!B8,Cents)'],['Reserve identity','=SUMPRODUCT(ABS(E2:E4))'],['IBNR change bridge','=ROUND(Summary!M8-Summary!N8-Summary!O8,Cents)'],['Post-valuation transactions','=COUNTIF(Claims[Date],\">\"&ValDate)'],['Source paid less recognized lines','=ROUND(SUM(Claims[Paid])-Summary!B8,Cents)'],['Premium less recognized quarters','=ROUND(SUM(Premium[Earned premium])-Summary!H8,Cents)'],['Prior paid less prior triangles',`=ROUND(SUMIFS(Claims[Paid],Claims[Date],\"<=\"&PriorDate)-SUM('${info[1].name}'!C${info[1].total},'${info[3].name}'!C${info[3].total},'${info[5].name}'!C${info[5].total}),Cents)`],['Negative selected IBNR line count','=COUNTIF(Summary!F5:F7,\"<\"&Zero)']];checks.range('B2:E4').numberFormat='#,##0.00';checks.setColumnWidth('A',330).setColumnWidth('B:E',185);
    method.range('A1:B1').values=[['RESERVING METHOD / SCOPE','DETAIL']];method.range('A2:B13').values=[['Valuation and scope','September 30, 2026. Supplied accident quarters only, from 2023 Q4 (2024 Q1 for Commercial Property). No assertion of completeness before that history.'],['Transactions','Paid values are cash increments. Case reserve change values are movements, accumulated through each development-quarter end; incurred = paid + cumulative case.'],['Triangles','Accident quarter by development age in quarters. Age 1 is the end of the accident quarter. Upper-right future cells blank. Q2 uses only dates through June 30.'],['Paid factors','All observed matched cohorts; volume-weighted link = sum(next age cumulative paid) / sum(current age cumulative paid). No simple-average links.'],['Selection mechanics','Default selected links equal experience. Blue unlocked cells on Selections can be overwritten; all calculations and sources protected. Last displayed age is the tail, not an observed link.'],['Tail: Auto and Homeowners','1.002 at each valuation: last observed links flat with sparse mature observations; retain a small 0.2% residual rather than assume complete settlement. Judgement, no external benchmark.'],['Tail: Commercial Property','1.020 after age 11 at Q3; 1.025 after age 10 at Q2. Writing began in 2024; late payments persist and oldest link is based on one cohort. Higher Q2 tail reflects shorter maturity. Judgement, not a calibrated fit.'],['Ultimates and reserves','Ultimate = latest paid × product(selected remaining links and tail). Outstanding = ultimate − paid. IBNR (including IBNER) = ultimate − paid − case. Negative indications are not floored.'],['Prior comparison','June 30 is reconstructed with June-only triangles and factors, not a booked or previously approved balance. Movement splits existing accident quarters and the new 2026 Q3 cohort.'],['Ratios','Loss ratio = ultimate / earned premium for all supplied accident quarters. Combined ratio = loss ratio + line expense ratio. Total expense ratio is earned-premium weighted. Not calendar-quarter underwriting ratios.'],['Sensitivity and uncertainty','Tail +1 percentage point is an absolute increase to each line tail; other selections unchanged. Commercial Property is immature and large-loss volatility may invalidate stable-development assumptions. No statistical confidence range.'],['Basis and limitations','Undiscounted nominal indication. No explicit risk margin. No separate claim expense, reinsurance or catastrophe adjustments because none are identified in the supplied fields. Obtain actuarial review before booking.']];method.setColumnWidth('A',260).setColumnWidth('B',1080);method.range('B2:B13').format({wrap:true});
    for(const s of workbook.sheets.items){s.showGridLines=false;const used=s.usedRange;if(used)used.format({font:'Aptos',fontSize:11});s.range(s===summary?'A1:P1':s===sel?'A1:P1':s===method?'A1:B1':s===ctl?'A1:B1':s===checks?'A1:E1':s.name==='Claims'?'A1:G1':s.name==='Premium'||s.name==='GL'?'A1:C1':'A1:N1').format({fill:'accent1',color:'white',bold:true});if(info.some(x=>x.name===s.name)){for(const r of [5,21,37,44])s.range(`A${r}:N${r}`).format({fill:'slate-100',bold:true});}s.protect();}
    sel.range('A4:P4').format({fill:'slate-100',bold:true});sel.setColumnWidth('A',190).setColumnWidth('B',110).setColumnWidth('C:O',95).setColumnWidth('P',720);sel.range('P5:P10').format({wrap:true});ctl.setColumnWidth('A',270).setColumnWidth('B',160);workbook.sheets.get('Claims').setColumnWidth('A:C',160).setColumnWidth('D',110).setColumnWidth('E',180).setColumnWidth('F:G',150);workbook.sheets.get('Claims').range('F2:G1821').numberFormat='#,##0';workbook.sheets.get('Premium').setColumnWidth('A',190).setColumnWidth('B:C',150);workbook.sheets.get('GL').setColumnWidth('A',190).setColumnWidth('B:C',165);summary.range('A4:P4').format({wrap:true,bold:true,fill:'slate-100'});return {summary:summary.range('A4:P8').values,checks:checks.range('A6:B15').values,protection:workbook.sheets.items.map(s=>({sheet:s.name,protected:s.isProtected})),info};
    {
      "ok": false,
      "error": {
        "name": "OptionsError",
        "message": "validations.add:\n  - unknown option \"formula1\". Did you mean \"formula\"?\n  - operator: \"greaterThanOrEqual\" is not one of >, >=, <, <=, =, !=, between, notBetween"
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Claims",
        "Premium",
        "GL"
      ],
      "version": 3,
      "lint": {
        "errors": 0,
        "warnings": 0
      }
    }
  13. artiwright_help
    {
      "query": "sheet.charts.add, ChartInput, sheet.validations.add",
      "search": "",
      "maxChars": 7000
    }
    sheet.charts.add: sheet.charts.add(type: ChartType, options: SheetChartOptions): SheetChart
    A native chart of cells on this (or another) sheet. The first row names the series and the first column holds the categories: `charts.add("column", { data: "A1:C13", at: "E2", title: "Revenue by month" })`.
    
    SheetChartOptions:
      data: string  The cells to plot: "A1:C13" on this sheet or "Model!A1:C13".
      seriesIn? (columns | rows)  Series run down columns (default) or across rows.
      at: string  The chart's top-left cell.
      size?: { w: number; h: number }  Size in px (default 480×288), or `to` for the bottom-right cell.
      to?: string
      series?: Array<Partial<ChartSeriesInput>>  Per-series look, by position: `[{ fill: "accent2" }, { type: "line", axis: "secondary" }]`.
      name?: string
      alt?: string
      title?: string | { text: string; style?: string | TextStyle; overlay?: boolean }
      legend?: false | LegendPosition | { position?: LegendPosition; overlay?: boolean; style?: string | TextStyle }  Position, false to hide, or options.
      dataLabels?: boolean | DataLabelsInput  Labels on every series.
      stacked?: boolean | "percent"  Column, bar, line and area charts: stack series, or stack to 100%.
      axes?: { x?: AxisInput; y?: AxisInput; y2?: AxisInput }  y2: the secondary value axis on the right, for series with axis: "secondary".
      gap?: number  Space between bar groups, percent of a bar's width (0–500).
      overlap?: number  Bar overlap within a group, percent (-100–100).
      holeSize?: number  Doughnut hole, percent of the diameter (10–90).
      firstSliceAngle?: number  Pie and doughnut rotation in degrees.
      varyColors?: boolean  A different color for every point.
      radarStyle? (marker | filled | lines)
      blanks? (gap | zero | span)  How gaps draw: leave a gap, drop to zero, or connect across.
      style?: string | TextStyle  Default text for the chart: font, size, color.
      background?: string
      border?: string | LineOptions
      plotBackground?: string
      upDownBars?: boolean  Stock charts with four series (open, high, low, close).
      highLowLines?: boolean
      totals?: number[]  Waterfall: indexes of the points that are totals (full bars from zero), e.g. [0, 4].
      connectorLines?: boolean  Waterfall: lines joining the bars (default true).
      parentLabels? (overlapping | banner | none)  Treemap: parent labels (default "overlapping").
      bins?: number | { count?: number; width?: number } 
    …
  14. artiwright_run
    const lines=['Personal Auto','Homeowners','Commercial Property'],codes=['PA','HO','CP'];const raw=workbook.sheets.get('Claims').range('A2:G1821').values;const qs=[...new Set(raw.map(r=>r[2]))].sort();const serial=(y,m,d)=>(Date.UTC(y,m-1,d)-Date.UTC(1899,11,30))/86400000;const start=q=>serial(+q.slice(0,4),(+q.slice(-1)-1)*3+1,1);const col=i=>{let s='';for(;i;i=Math.floor((i-1)/26))s=String.fromCharCode(65+(i-1)%26)+s;return s};const add=n=>workbook.sheets.add(n);const summary=add('Summary'),sel=add('Selections'),ctl=add('Controls'),method=add('Method'),checks=add('Checks');
    ctl.range('A1:B1').values=[['CONTROL / UNIT','VALUE']];ctl.range('A2:B16').values=[['Current valuation',serial(2026,9,30)],['Prior valuation',serial(2026,6,30)],['Months per quarter',3],['Quarter-end month offset',2],['Zero',0],['One',1],['Money rounding digits',2],['Tail sensitivity (absolute factor)',0.01],['Personal Auto expense ratio',0.255],['Homeowners expense ratio',0.305],['Commercial Property expense ratio',0.335],['Current last quarter index',11],['Prior last quarter index',10],['Source transactions',raw.length],['Minimum admissible factor',1]];ctl.range('B2:B3').numberFormat='yyyy-mm-dd';ctl.range('B9:B12').numberFormat='percent1';[['ValDate',2],['PriorDate',3],['QMonths',4],['EndOffset',5],['Zero',6],['One',7],['Cents',8],['TailShock',9]].forEach(([n,r])=>workbook.names.add(n,`Controls!$B$${r}`));
    sel.merge('A1:P1');sel.range('A1').values=[['Granite Mutual | Reserving selections']];sel.merge('A2:P2');sel.range('A2').values=[['Blue cells only are editable. Factor defaults link to volume-weighted experience; overwrite to select. Tails are judgemental, not fitted.']];sel.range('A4:P4').values=[['Line','Valuation',...Array.from({length:11},(_,i)=>`${i+1} to ${i+2}`),'Tail','Oldest age','Tail rationale']];
    const info=[];
    for(let l=0;l<3;l++)for(let v=0;v<2;v++){
    const qv=11-v;const aqs=qs.filter(q=>qs.indexOf(q)<=qv&&raw.some(r=>r[1]===lines[l]&&r[2]===q));const n=aqs.length;const name=`${codes[l]} ${v?'Q2':'Q3'}`,s=add(name);const sr=5+l*2+v;const tail=l===2?(v?1.025:1.02):1.002;sel.range(`A${sr}:B${sr}`).values=[[lines[l],v?'2026-06-30':'2026-09-30']];sel.range(`N${sr}:P${sr}`).values=[[tail,n,l===2?'Limited post-2024 history; late payments persist. Q2 tail higher for one less observed age.':'Late links flat, but few mature cohorts. Small residual margin for unobserved late payments.']];sel.range(`N${sr}`).format({locked:false,color:'blue-700',fill:'blue-50',numberFormat:'0.0000"x"'});sel.validations.add(`N${sr}`,{type:'decimal',operator:'>=',value:1,error:'Select a tail factor of at least 1.'});
    s.merge('A1:N1');s.range('A1').values=[[`${lines[l]}: ${v?'June 30':'September 30'}, 2026`]];s.merge('A2:N2');s.range('A2').values=[['Cumulative dollars; age 1 is accident-quarter end. Future development cells are unobserved, never zero-filled.']];s.range('A4').values=[['PAID TRIANGLE ($)']];s.range('A20').values=[['INCURRED TRIANGLE ($): paid plus cumulative case reserve changes']];
    for(const hr of [5,21])s.range(`A${hr}:${col(n+2)}${hr}`).values=[['Accident quarter','Quarter start',...Array.from({length:n},(_,i)=>i+1)]];
    for(let i=0;i<n;i++){const r=6+i,ir=22+i,q=aqs[i],age=n-i;s.range(`A${r}:B${r}`).values=[[q,start(q)]];s.range(`A${ir}:B${ir}`).values=[[q,start(q)]];for(let j=0;j<age;j++){const c=col(j+3);const f=`SUMIFS(Claims[Paid],Claims[Line],$A$3,Claims[Accident quarter],$A${r},Claims[Date],\"<=\"&EOMONTH(EDATE($B${r},(${c}$5-One)*QMonths),EndOffset))`;s.range(`${c}${r}`).formulas='='+f;s.range(`${c}${ir}`).formulas=`=${c}${r}+SUMIFS(Claims[Case reserve change],Claims[Line],$A$3,Claims[Accident quarter],$A${ir},Claims[Date],\"<=\"&EOMONTH(EDATE($B${ir},(${c}$21-One)*QMonths),EndOffset))`;}}
    s.range('A3').values=[[lines[l]]];s.range('A37:B40').values=[['DEVELOPMENT','Basis'],['Volume-weighted link','Matched cohorts'],['Selected link','Selections tab'],['CDF to ultimate','Including tail']];
    for(let j=0;j<n;j++){const c=col(j+3),last=col(n+2),sc=col(j+3);s.range(`${c}37`).values=[[j===n-1?'Tail':`${j+1} to ${j+2}`]];if(j<n-1){const end=6+n-j-2,nc=col(j+4);s.range(`${c}38`).formulas=`=SUM(${nc}6:${nc}${end})/SUM(${c}6:${c}${end})`;sel.range(`${sc}${sr}`).formulas=`='${name}'!${c}38`;sel.range(`${sc}${sr}`).format({locked:false,color:'blue-700',fill:'blue-50',numberFormat:'0.0000"x"'});sel.validations.add(`${sc}${sr}`,{type:'decimal',operator:'>=',value:1,error:'Select a factor of at least 1.'});s.range(`${c}39`).formulas=`=Selections!${sc}${sr}`;}else{s.range(`${c}38`).values=[['n/a']];s.range(`${c}39`).formulas=`=Selections!N${sr}`;}s.range(`${c}40`).formulas=`=PRODUCT(${c}39:${last}39)`;}
    if(n<12)sel.range(`${col(n+2)}${sr}:M${sr}`).values=[Array(12-n).fill('n/a')];
    s.range('A44:N44').values=[['Accident quarter','Age (qtrs)','Paid ($)','Case ($)','Incurred ($)','Paid CDF','Ultimate ($)','Outstanding ($)','IBNR ($)','Earned premium ($)','Loss ratio','Expense ratio','Combined ratio','Tail +1pt IBNR ($)']];
    for(let i=0;i<n;i++){const r=45+i,tr=6+i,age=n-i,tc=col(age+2);s.range(`A${r}:B${r}`).values=[[aqs[i],age]];s.range(`C${r}`).formulas=`=${tc}${tr}`;s.range(`D${r}`).formulas=`=${tc}${22+i}-C${r}`;s.range(`E${r}`).formulas=`=C${r}+D${r}`;s.range(`F${r}`).formulas=`=${tc}$40`;s.range(`G${r}`).formulas=`=C${r}*F${r}`;s.range(`H${r}`).formulas=`=G${r}-C${r}`;s.range(`I${r}`).formulas=`=G${r}-E${r}`;s.range(`J${r}`).formulas=`=SUMIFS(Premium[Earned premium],Premium[Line],$A$3,Premium[Accident quarter],A${r})`;s.range(`K${r}`).formulas=`=G${r}/J${r}`;s.range(`L${r}`).formulas=`=Controls!$B$${10+l}`;s.range(`M${r}`).formulas=`=K${r}+L${r}`;s.range(`N${r}`).formulas=`=G${r}*(One+TailShock/Selections!$N$${sr})-E${r}`;}
    const total=45+n;s.range(`A${total}`).values=[['TOTAL / WEIGHTED']];for(const c of ['C','D','E','G','H','I','J','N'])s.range(`${c}${total}`).formulas=`=SUM(${c}45:${c}${total-1})`;s.range(`K${total}`).formulas=`=G${total}/J${total}`;s.range(`L${total}`).formulas=`=Controls!$B$${10+l}`;s.range(`M${total}`).formulas=`=K${total}+L${total}`;
    s.range(`B6:B${5+n}`).numberFormat='yyyy-mm-dd';s.range(`B22:B${21+n}`).numberFormat='yyyy-mm-dd';s.range('C6:N33').numberFormat='#,##0;[Red](#,##0);–';s.range('C38:N40').numberFormat='0.0000"x"';s.range(`C45:J${total}`).numberFormat='#,##0;[Red](#,##0);–';s.range(`F45:F${total}`).numberFormat='0.0000"x"';s.range(`K45:M${total}`).numberFormat='percent1';s.range(`N45:N${total}`).numberFormat='#,##0';s.range(`A${total}:N${total}`).format({bold:true,borderTop:'medium accent1',fill:'slate-100'});s.setColumnWidth('A',170).setColumnWidth('B',105).setColumnWidth('C:N',118);s.freeze(5,2);info.push({l,v,name,n,total,last:total-1,sr});}
    summary.merge('A1:P1');summary.range('A1').values=[['Granite Mutual | Q3 2026 reserve indication']];summary.merge('A2:P2');summary.range('A2').values=[['September 30, 2026. All supplied accident quarters. USD. Paid chain ladder. Ratios use matched earned premium.']];summary.range('A4:P4').values=[['Line','Paid ($)','Case ($)','Incurred ($)','Ultimate ($)','IBNR ($)','Outstanding ($)','Earned premium ($)','Loss ratio','Expense ratio','Combined ratio','Q2 IBNR ($)','IBNR change ($)','Existing AQ change ($)','New AQ IBNR ($)','Tail +1pt impact ($)']];
    for(let l=0;l<3;l++){const r=5+l,cur=info.find(x=>x.l===l&&!x.v),pre=info.find(x=>x.l===l&&x.v);summary.range(`A${r}`).values=[[lines[l]]];for(const [dest,src]of [['B','C'],['C','D'],['D','E'],['E','G'],['F','I'],['G','H'],['H','J'],['I','K'],['J','L'],['K','M']])summary.range(`${dest}${r}`).formulas=`='${cur.name}'!${src}${cur.total}`;summary.range(`L${r}`).formulas=`='${pre.name}'!I${pre.total}`;summary.range(`M${r}`).formulas=`=F${r}-L${r}`;summary.range(`O${r}`).formulas=`='${cur.name}'!I${cur.last}`;summary.range(`N${r}`).formulas=`=M${r}-O${r}`;summary.range(`P${r}`).formulas=`='${cur.name}'!N${cur.total}-F${r}`;}
    summary.range('A8').values=[['TOTAL / WEIGHTED']];for(const c of ['B','C','D','E','F','G','H','L','M','N','O','P'])summary.range(`${c}8`).formulas=`=SUM(${c}5:${c}7)`;summary.range('I8').formulas='=E8/H8';summary.range('J8').formulas='=SUMPRODUCT(H5:H7,J5:J7)/H8';summary.range('K8').formulas='=I8+J8';summary.range('B5:H8').numberFormat='$#,##0;[Red]($#,##0);–';summary.range('I5:K8').numberFormat='percent1';summary.range('L5:P8').numberFormat='$#,##0;[Red]($#,##0);–';summary.range('A8:P8').format({bold:true,fill:'slate-100',borderTop:'medium accent1'});summary.merge('A10:P10');summary.range('A10').values=[['Q2 is reconstructed using June-only data and independently estimated factors, not a booked prior reserve.']];summary.merge('A11:P11');summary.range('A11').values=[['IBNR = ultimate − paid − case. Outstanding = case + IBNR. Negative IBNR is retained. No discounting or added risk margin.']];summary.setColumnWidth('A',195).setColumnWidth('B:H',130).setColumnWidth('I:K',112).setColumnWidth('L:P',150);summary.freeze(4,1);
    const chart=add('Chart Data');chart.range('A1:C1').values=[['Line','Q2 IBNR ($)','Q3 IBNR ($)']];for(let i=0;i<3;i++){chart.range(`A${i+2}:C${i+2}`).formulas=[[`=Summary!A${i+5}`,`=Summary!L${i+5}`,`=Summary!F${i+5}`]];}summary.charts.add('column',{data:"'Chart Data'!A1:C4",at:'A14',size:{w:1100,h:350},title:'IBNR by line at June 30 and September 30, 2026 ($)'});
    checks.range('A1:E1').values=[['Line','Transaction paid ($)','GL paid ($)','Difference ($)','Reserve identity ($)']];for(let l=0;l<3;l++){const r=l+2,sr=l+5;checks.range(`A${r}`).values=[[lines[l]]];checks.range(`B${r}`).formulas=`=SUMIFS(Claims[Paid],Claims[Line],A${r},Claims[Date],\"<=\"&ValDate)`;checks.range(`C${r}`).formulas=`=SUMIFS(GLPaid[Paid losses to date],GLPaid[Line],A${r})`;checks.range(`D${r}`).formulas=`=ROUND(B${r}-C${r},Cents)`;checks.range(`E${r}`).formulas=`=ROUND(Summary!G${sr}-Summary!C${sr}-Summary!F${sr},Cents)`;}
    checks.range('A6:B15').values=[['Control','Result (must be zero)'],['Absolute GL differences','=SUMPRODUCT(ABS(D2:D4))'],['Transaction paid less triangle diagonal','=ROUND(SUM(B2:B4)-Summary!B8,Cents)'],['Reserve identity','=SUMPRODUCT(ABS(E2:E4))'],['IBNR change bridge','=ROUND(Summary!M8-Summary!N8-Summary!O8,Cents)'],['Post-valuation transactions','=COUNTIF(Claims[Date],\">\"&ValDate)'],['Source paid less recognized lines','=ROUND(SUM(Claims[Paid])-Summary!B8,Cents)'],['Premium less recognized quarters','=ROUND(SUM(Premium[Earned premium])-Summary!H8,Cents)'],['Prior paid less prior triangles',`=ROUND(SUMIFS(Claims[Paid],Claims[Date],\"<=\"&PriorDate)-SUM('${info[1].name}'!C${info[1].total},'${info[3].name}'!C${info[3].total},'${info[5].name}'!C${info[5].total}),Cents)`],['Negative selected IBNR line count','=COUNTIF(Summary!F5:F7,\"<\"&Zero)']];checks.range('B2:E4').numberFormat='#,##0.00';checks.setColumnWidth('A',330).setColumnWidth('B:E',185);
    method.range('A1:B1').values=[['RESERVING METHOD / SCOPE','DETAIL']];method.range('A2:B13').values=[['Valuation and scope','September 30, 2026. Supplied accident quarters only, from 2023 Q4 (2024 Q1 for Commercial Property). No assertion of completeness before that history.'],['Transactions','Paid values are cash increments. Case reserve change values are movements, accumulated through each development-quarter end; incurred = paid + cumulative case.'],['Triangles','Accident quarter by development age in quarters. Age 1 is the end of the accident quarter. Upper-right future cells blank. Q2 uses only dates through June 30.'],['Paid factors','All observed matched cohorts; volume-weighted link = sum(next age cumulative paid) / sum(current age cumulative paid). No simple-average links.'],['Selection mechanics','Default selected links equal experience. Blue unlocked cells on Selections can be overwritten; all calculations and sources protected. Last displayed age is the tail, not an observed link.'],['Tail: Auto and Homeowners','1.002 at each valuation: last observed links flat with sparse mature observations; retain a small 0.2% residual rather than assume complete settlement. Judgement, no external benchmark.'],['Tail: Commercial Property','1.020 after age 11 at Q3; 1.025 after age 10 at Q2. Writing began in 2024; late payments persist and oldest link is based on one cohort. Higher Q2 tail reflects shorter maturity. Judgement, not a calibrated fit.'],['Ultimates and reserves','Ultimate = latest paid × product(selected remaining links and tail). Outstanding = ultimate − paid. IBNR (including IBNER) = ultimate − paid − case. Negative indications are not floored.'],['Prior comparison','June 30 is reconstructed with June-only triangles and factors, not a booked or previously approved balance. Movement splits existing accident quarters and the new 2026 Q3 cohort.'],['Ratios','Loss ratio = ultimate / earned premium for all supplied accident quarters. Combined ratio = loss ratio + line expense ratio. Total expense ratio is earned-premium weighted. Not calendar-quarter underwriting ratios.'],['Sensitivity and uncertainty','Tail +1 percentage point is an absolute increase to each line tail; other selections unchanged. Commercial Property is immature and large-loss volatility may invalidate stable-development assumptions. No statistical confidence range.'],['Basis and limitations','Undiscounted nominal indication. No explicit risk margin. No separate claim expense, reinsurance or catastrophe adjustments because none are identified in the supplied fields. Obtain actuarial review before booking.']];method.setColumnWidth('A',260).setColumnWidth('B',1080);method.range('B2:B13').format({wrap:true});
    for(const s of workbook.sheets.items){s.showGridLines=false;if(s.usedRange)s.usedRange.format({font:'Aptos',fontSize:11});s.range(s===summary||s===sel?'A1:P1':s===method||s===ctl?'A1:B1':s===checks?'A1:E1':s.name==='Claims'?'A1:G1':s.name==='Premium'||s.name==='GL'||s.name==='Chart Data'?'A1:C1':'A1:N1').format({fill:'accent1',color:'white',bold:true});if(info.some(x=>x.name===s.name))for(const r of [5,21,37,44])s.range(`A${r}:N${r}`).format({fill:'slate-100',bold:true});s.protect();}
    sel.range('A4:P4').format({fill:'slate-100',bold:true});sel.setColumnWidth('A',190).setColumnWidth('B',110).setColumnWidth('C:O',95).setColumnWidth('P',720);sel.range('P5:P10').format({wrap:true});ctl.setColumnWidth('A',270).setColumnWidth('B',160);workbook.sheets.get('Claims').setColumnWidth('A:C',160).setColumnWidth('D',110).setColumnWidth('E',180).setColumnWidth('F:G',150);workbook.sheets.get('Claims').range('F2:G1821').numberFormat='#,##0';workbook.sheets.get('Premium').setColumnWidth('A',190).setColumnWidth('B:C',150);workbook.sheets.get('GL').setColumnWidth('A',190).setColumnWidth('B:C',165);summary.range('A4:P4').format({wrap:true,bold:true,fill:'slate-100'});return {summary:summary.range('A4:P8').values,checks:checks.range('A6:B15').values,protection:workbook.sheets.items.map(s=>({sheet:s.name,protected:s.isProtected})),info};
    {
      "ok": true,
      "value": {
        "summary": [
          [
            "Line",
            "Paid ($)",
            "Case ($)",
            "Incurred ($)",
            "Ultimate ($)",
            "IBNR ($)",
            "Outstanding ($)",
            "Earned premium ($)",
            "Loss ratio",
            "Expense ratio",
            "Combined ratio",
            "Q2 IBNR ($)",
            "IBNR change ($)",
            "Existing AQ change ($)",
            "New AQ IBNR ($)",
            "Tail +1pt impact ($)"
          ],
          [
            "Personal Auto",
            5035820,
            260500,
            5296320,
            5382782.21258474,
            86462.21258474002,
            346962.21258474,
            8326900,
            0.6464329117180151,
            0.255,
            0.9014329117180151,
            159671.14064972324,
            -73208.92806498322,
            -91987.04308616125,
            18778.115021178033,
            53720.38136312133
          ],
          [
            "Homeowners",
            4836260,
            163350,
            4999610,
            5174653.434032851,
            175043.43403285136,
            338393.43403285136,
            8476500,
            0.6104705284059283,
            0.305,
            0.9154705284059284,
            163.01557323522866,
            174880.41845961614,
            1367.9080099702114,
            173512.51044964592,
            51643.247844639525
          ],
          [
            "Commercial Property",
            7699170,
            938030,
            8637200,
            10378920.872436706,
            1741720.8724367067,
            2679750.872436707,
            17318400,
            0.5993002166734055,
            0.335,
            0.9343002166734056,
            1568647.1605732776,
            173073.71186342905,
            -644072.0297601279,
            817145.7416235569,
            101754.12620035955
          ],
          [
            "TOTAL / WEIGHTED",
            17571250,
            1361880,
            18933130,
            20936356.519054297,
            2003226.519054298,
            3365106.5190542983,
            34121800,
            0.6135771418581171,
            0.3080246645839317,
            0.9216018064420488,
            1728481.3167962362,
            274745.20225806197,
            -734691.1648363189,
            1009436.3670943809,
            207117.7554081204
          ]
        ],
        "checks": [
          [
            "Control",
            "Result (must be zero)"
          ],
          [
            "Absolute GL differences",
            0
          ],
          [
            "Transaction paid less triangle diagonal",
            0
          ],
          [
            "Reserve identity",
            0
          ],
          [
            "IBNR change bri
    …
  15. artiwright_lint
    {
      "session": "loss-reserving",
      "document": "reserving",
      "rules": "",
      "severity": "warn",
      "slide": ""
    }
    {
      "ok": true,
      "errors": 0,
      "warnings": 20,
      "findings": [
        {
          "rule": "number/unformatted",
          "sheet": "Premium",
          "range": "C2:C36",
          "message": "35 numbers in column C have no number format.",
          "fix": "range.numberFormat = \"#,##0\" (or \"currency\", \"percent1\", \"millions\", …).",
          "severity": "warn"
        },
        {
          "rule": "number/unformatted",
          "sheet": "GL",
          "range": "C2:C4",
          "message": "3 numbers in column C have no number format.",
          "fix": "range.numberFormat = \"#,##0\" (or \"currency\", \"percent1\", \"millions\", …).",
          "severity": "warn"
        },
        {
          "rule": "text/clipped",
          "sheet": "PA Q3",
          "range": "B38",
          "message": "PA Q3!B38 is cut off: \"Matched cohorts\" is wider than the column and C38 is not empty.",
          "evidence": {
            "needs": 114,
            "width": 105
          },
          "fix": "Widen the column, wrap the text (format({ wrap: true })), or shorten it.",
          "severity": "warn"
        },
        {
          "rule": "text/clipped",
          "sheet": "PA Q3",
          "range": "J44",
          "message": "PA Q3!J44 is cut off: \"Earned premium ($)\" is wider than the column and K44 is not empty.",
          "evidence": {
            "needs": 137,
            "width": 118
          },
          "fix": "Widen the column, wrap the text (format({ wrap: true })), or shorten it.",
          "severity": "warn"
        },
        {
          "rule": "text/clipped",
          "sheet": "PA Q2",
          "range": "B38",
          "message": "PA Q2!B38 is cut off: \"Matched cohorts\" is wider than the column and C38 is not empty.",
          "evidence": {
            "needs": 114,
            "width": 105
          },
          "fix": "Widen the column, wrap the text (format({ wrap: true })), or shorten it.",
          "severity": "warn"
        },
        {
          "rule": "text/clipped",
          "sheet": "PA Q2",
          "range": "J44",
          "message": "PA Q2!J44 is cut off: \"Earned premium ($)\" is wider than the column and K44 is not empty.",
          "evidence": {
            "needs": 137,
            "width": 118
          },
          "fix": "Widen the column, wrap the text (format({ wrap: true })), or shorten it.",
          "severity": "warn"
        },
        {
          "rule": "text/clipped",
          "sheet": "HO Q3",
          "range": "B38",
          "message": "HO Q3!B38 is cut off: \"Matched cohorts\" is wider than the column and C38 is not empty.",
          "evidence": {
            "need
    …
  16. artiwright_help
    {
      "query": "sheet.setRowHeight, workbook.sheets.move, workbook.protect",
      "search": "",
      "maxChars": 4500
    }
    sheet.setRowHeight: sheet.setRowHeight(rows: number | string, px: number): this
    Sets row heights in px: `sheet.setRowHeight(1, 32)`, `sheet.setRowHeight("2:10", 24)`. Rows are 1-based like Excel's.
    
    Examples:
      sheet.setRowHeight(1, 32)
      sheet.setRowHeight("2:10", 24)
    
    workbook.sheets.move: workbook.sheets.move(sheet: Worksheet | string, to: number): void
    Moves a sheet to a position, 0 being first.
    
    Nothing is called "workbook.protect". Closest entries (ask help(path) for one):
      workbook.inspect  Compact records of the workbook: sheets, cell values row by row, formulas with results, tables, charts and names.
      Workbook.create  A new, empty workbook; add sheets with `wb.sheets.add("Name")`.
      spreadsheets  Workbooks: Workbook.create(), sheets, ranges, formulas, formats, tables, rules, charts.
      workbook  An Excel workbook: `const wb = Workbook.create(); const s = wb.sheets.add("Model");` then `s.range("A1").values = [["Month", "Revenue"], ["Jan", 120]]` and `await wb.save("model.xlsx")`.
      workbook.creationId  A unique id for this workbook.
      workbook.theme  Theme colors and fonts (the same as a deck's): `wb.theme.set({ colors: { accent1: "#2346C8" } })`.
      workbook.now  The clock for TODAY() and NOW(); default the real time.
      Workbook.open  Opens an .xlsx (or an .xltx template) to edit it: `const wb = await Workbook.open("plan.xlsx")`.
      workbook.sheets.add  Adds a sheet at the end (or at `index`): `wb.sheets.add("Model")`.
      workbook.sheets.get  A sheet by name (not case-sensitive) or 0-based position.
  17. artiwright_render
    {
      "session": "loss-reserving",
      "document": "reserving",
      "slides": [],
      "sheets": [
        "Summary",
        "PA Q3",
        "HO Q3",
        "CP Q3",
        "PA Q2",
        "HO Q2",
        "CP Q2",
        "Selections",
        "Checks",
        "Method",
        "Claims",
        "Premium",
        "GL",
        "Controls",
        "Chart Data"
      ],
      "range": ""
    }
    Sheet SummarySheet PA Q3Sheet HO Q3Sheet CP Q3Sheet PA Q2Sheet HO Q2
    A render the agent looked atA render the agent looked atA render the agent looked atA render the agent looked atA render the agent looked atA render the agent looked at
  18. artiwright_run
    const sn=workbook.sheets.get('Summary');sn.setRowHeight(1,34).setRowHeight(2,30).setRowHeight(4,46).setRowHeight('5:8',28);for(const n of ['PA Q3','PA Q2','HO Q3','HO Q2','CP Q3','CP Q2']){const s=workbook.sheets.get(n);s.setColumnWidth('B',128).setRowHeight(1,32).setRowHeight(44,44);s.range('A44:N44').format({wrap:true});s.range('A41:B42').values=[['Matched pair count','Observed links'],['Matched paid base ($)','Current-age sum']];s.setColumnWidth('A',180);const nages=s.range('C5:N5').values[0].filter(x=>typeof x==='number').length;for(let j=0;j<nages;j++){const c=String.fromCharCode(67+j),end=6+nages-j-2;if(j<nages-1){s.range(`${c}41`).formulas=`=COUNT(${c}6:${c}${end})`;s.range(`${c}42`).formulas=`=SUM(${c}6:${c}${end})`;}else{s.range(`${c}41:${c}42`).values=[['n/a'],['n/a']];}}s.range('C41:N42').numberFormat='#,##0';}
    workbook.sheets.get('Premium').range('C2:C36').numberFormat='$#,##0';workbook.sheets.get('GL').range('C2:C4').numberFormat='$#,##0';const cd=workbook.sheets.get('Chart Data');cd.setColumnWidth('A',200).setColumnWidth('B:C',155);cd.range('B2:C4').numberFormat='$#,##0';const se=workbook.sheets.get('Selections');se.setRowHeight(1,34).setRowHeight(2,32).setRowHeight(4,35).setRowHeight('5:10',60);se.range('A4:P10').format({valign:'middle'});se.range('A4:P4').format({wrap:true});workbook.sheets.get('Method').setRowHeight(1,32).setRowHeight('2:13',54);workbook.sheets.get('Checks').setRowHeight(1,34).setRowHeight('2:15',26);workbook.sheets.get('Checks').range('B7:B15').numberFormat='#,##0.00';
    const d=workbook.sheets.add('Committee Figures');d.range('A1:H1').values=[['Line','Paid ($m)','Ultimate ($m)','IBNR ($000)','IBNR change ($000)','Loss ratio (%)','Combined ratio (%)','Prior IBNR ($000)']];const c=workbook.sheets.get('Controls');c.range('A18:B20').values=[['Currency millions divisor',1000000],['Currency thousands divisor',1000],['Percent display multiplier',100]];workbook.names.add('Millions','Controls!$B$18').add('Thousands','Controls!$B$19').add('Pct','Controls!$B$20');for(let i=0;i<4;i++){const r=i+2,s=i+5;d.range(`A${r}`).formulas=`=Summary!A${s}`;for(const [dest,src,div,digits]of [['B','B','Millions',2],['C','E','Millions',2],['D','F','Thousands',0],['E','M','Thousands',0],['F','I','One',1],['G','K','One',1],['H','L','Thousands',0]])d.range(`${dest}${r}`).formulas=(dest==='F'||dest==='G')?`=ROUND(Summary!${src}${s}*Pct,One)`:`=ROUND(Summary!${src}${s}/${div},${digits===2?'Cents':'Zero'})`;}
    d.range('A8:B22').values=[['Metric','Value'],['Total IBNR ($m)','=ROUND(Summary!F8/Millions,Cents)'],['Total outstanding ($m)','=ROUND(Summary!G8/Millions,Cents)'],['Change ($000)','=ROUND(Summary!M8/Thousands,Zero)'],['Existing cohort change ($000)','=ROUND(Summary!N8/Thousands,Zero)'],['New quarter IBNR ($000)','=ROUND(Summary!O8/Thousands,Zero)'],['All tails +1pt impact ($000)','=ROUND(Summary!P8/Thousands,Zero)'],['CP tail +1pt impact ($000)','=ROUND(Summary!P7/Thousands,Zero)'],['CP share of IBNR (%)','=ROUND(Summary!F7/Summary!F8*Pct,Zero)'],['CP new AQ combined ratio (%)',"=ROUND('CP Q3'!M55*Pct,One)"],['Auto tail','=Selections!N5'],['Homeowners tail','=Selections!N7'],['CP Q3 tail','=Selections!N9'],['CP Q2 tail','=Selections!N10'],['Total paid ($m)','=ROUND(Summary!B8/Millions,Cents)']];d.showGridLines=false;d.setColumnWidth('A',300).setColumnWidth('B:H',155);d.range('B2:H5').numberFormat='0.00';d.range('B9:B22').numberFormat='0.000';d.range('A1:H1').format({fill:'accent1',color:'white',bold:true,wrap:true});d.setRowHeight(1,38);d.protect();
    const order=['Summary','Selections','Checks','Method','PA Q3','HO Q3','CP Q3','PA Q2','HO Q2','CP Q2','Controls','Claims','Premium','GL','Chart Data','Committee Figures'];order.forEach((n,i)=>workbook.sheets.move(n,i));
    const raw=workbook.sheets.get('Claims').range('A2:G1821').values,qs=[...new Set(raw.map(r=>r[2]))].sort();let maxDiff=0;for(const [l,code]of [['Personal Auto','PA'],['Homeowners','HO'],['Commercial Property','CP']])for(let v=0;v<2;v++){const s=workbook.sheets.get(`${code} Q${v?2:3}`);const aqs=qs.filter(q=>qs.indexOf(q)<=11-v&&raw.some(r=>r[1]===l&&r[2]===q));const n=aqs.length;const tri=aqs.map(q=>Array.from({length:n},(_,j)=>{if(j>n-1-aqs.indexOf(q))return null;const y=+q.slice(0,4),mo=(+q.slice(-1)-1)*3;const end=(Date.UTC(y,mo+3*(j+1),0)-Date.UTC(1899,11,30))/86400000;return raw.filter(r=>r[1]===l&&r[2]===q&&r[3]<=end).reduce((a,r)=>a+r[5],0)}));const fs=Array.from({length:n-1},(_,j)=>{const pairs=tri.filter(r=>r[j+1]!==null);return pairs.reduce((a,r)=>a+r[j+1],0)/pairs.reduce((a,r)=>a+r[j],0)});const tail=se.range(`N${5+['PA','HO','CP'].indexOf(code)*2+v}`).values[0][0];const ultimate=tri.reduce((a,r,i)=>a+r[n-i-1]*fs.slice(n-i-1).reduce((a,f)=>a*f,tail),0);maxDiff=Math.max(maxDiff,Math.abs(ultimate-s.range(`G${45+n}`).values[0][0]));}const ch=workbook.sheets.get('Checks');ch.range('A17:B17').values=[['Independent JS projection absolute difference',Math.round(maxDiff*100)/100]];ch.range('B17').numberFormat='0.00';return {display:d.range('A1:H5').values,metrics:d.range('A8:B22').values,independentProjectionDifference:maxDiff};
    {
      "ok": true,
      "value": {
        "display": [
          [
            "Line",
            "Paid ($m)",
            "Ultimate ($m)",
            "IBNR ($000)",
            "IBNR change ($000)",
            "Loss ratio (%)",
            "Combined ratio (%)",
            "Prior IBNR ($000)"
          ],
          [
            "Personal Auto",
            5.04,
            5.38,
            86,
            -73,
            64.6,
            90.1,
            160
          ],
          [
            "Homeowners",
            4.84,
            5.17,
            175,
            175,
            61,
            91.5,
            0
          ],
          [
            "Commercial Property",
            7.7,
            10.38,
            1742,
            173,
            59.9,
            93.4,
            1569
          ],
          [
            "TOTAL / WEIGHTED",
            17.57,
            20.94,
            2003,
            275,
            61.4,
            92.2,
            1728
          ]
        ],
        "metrics": [
          [
            "Metric",
            "Value"
          ],
          [
            "Total IBNR ($m)",
            2
          ],
          [
            "Total outstanding ($m)",
            3.37
          ],
          [
            "Change ($000)",
            275
          ],
          [
            "Existing cohort change ($000)",
            -735
          ],
          [
            "New quarter IBNR ($000)",
            1009
          ],
          [
            "All tails +1pt impact ($000)",
            207
          ],
          [
            "CP tail +1pt impact ($000)",
            102
          ],
          [
            "CP share of IBNR (%)",
            87
          ],
          [
            "CP new AQ combined ratio (%)",
            147.3
          ],
          [
            "Auto tail",
            1.002
          ],
          [
            "Homeowners tail",
            1.002
          ],
          [
            "CP Q3 tail",
            1.02
          ],
          [
            "CP Q2 tail",
            1.025
          ],
          [
            "Total paid ($m)",
            17.57
          ]
        ],
        "independentProjectionDifference": 1.862645149230957e-9
      },
      "logs": [],
      "created": [],
      "removed": [],
      "slides": 0,
      "sheets": [
        "Summary",
        "Selections",
        "Checks",
        "Method",
        "PA Q3",
        "HO Q3",
        "CP Q3",
        "PA Q2",
        "HO Q2",
        "CP Q2",
        "Controls",
        "Claims",
        "Premium",
        "GL",
        "Chart Data",
        "Committee Figures"
      ],
      "version": 5,
      "lint": {
        "errors": 0,
        "warnings": 0
      }
    }
  19. The indication is $2.00m of IBNR and $3.37m of total outstanding losses, with a 92.2% combined ratio across the supplied accident quarters.

    IBNR is $275k higher than the reconstructed June indication. Commercial Property holds 87% of IBNR and is the main area of uncertainty. A one-percentage-point increase in all selected tails adds about $207k. The workbook reconciliations pass, and an independent calculation agrees with the formula-based ultimates.

  20. artiwright_run
    deck.theme.use('ledger');
    const source='Source: Granite Mutual claims, earned premium and GL files; reserving workbook at September 30, 2026.';
    let s=deck.slides.add({notes:'Workbook Summary: ultimate $20,936,356.52; paid $17,571,250; case $1,361,880; IBNR $2,003,226.52; outstanding $3,365,106.52. June reconstructed IBNR $1,728,481.32; change $274,745.20. Scope is all supplied accident quarters, not calendar-Q3 underwriting results. Undiscounted; no explicit risk margin.'});compose(s,h(TitleSlide,{title:'Q3 reserve indication',eyebrow:'Granite Mutual reserve committee',subtitle:'September 30, 2026. Paid chain ladder across the supplied accident quarters.',figures:[{value:'$2.00M',label:'Indicated IBNR'},{value:'$3.37M',label:'Total outstanding losses'},{value:'+$275K',label:'IBNR since reconstructed June'}]}));
    s=deck.slides.add({notes:'Figures read from Committee Figures and Summary in the reserving workbook. Paid by line ties exactly to GL: Auto $5,035,820; Homeowners $4,836,260; Commercial Property $7,699,170. IBNR by line $86,462.21, $175,043.43, $1,741,720.87. Combined ratio includes expense ratios 25.5%, 30.5%, 33.5%. Total expense ratio is premium weighted. CP share is 86.95%.'});compose(s,h(ComparisonTable,{title:'Commercial Property holds 87% of IBNR',rows:[['Line','Ultimate ($M)','IBNR ($K)','Loss ratio','Combined ratio'],['Personal Auto','5.38','86','64.6%','90.1%'],['Homeowners','5.17','175','61.0%','91.5%'],['Commercial Property','10.38','1,742','59.9%','93.4%'],['Total','20.94','2,003','61.4%','92.2%']],takeaways:['Paid losses tie to the GL by line, with no differences.','Ratios cover all supplied accident quarters, not calendar Q3.'],note:source}));
    s=deck.slides.add({notes:'June is reconstructed, not the booked or previously selected reserve. Existing-cohort IBNR movement: Auto -$91,987.04; Homeowners +$1,367.91; CP -$644,072.03; total -$734,691.16. New 2026 Q3 cohort IBNR: Auto $18,778.12; Homeowners $173,512.51; CP $817,145.74; total $1,009,436.37. Net movement $274,745.20. June Homeowners IBNR is $163.02, shown as zero thousand after rounding; negative cohort IBNR is retained.'});compose(s,h(ChartTakeaway,{title:'IBNR rises $275K to $2.00M',chart:{type:'column',categories:['Personal Auto','Homeowners','Commercial Property'],series:[{name:'June reconstructed ($K)',values:[160,0,1569]},{name:'September indication ($K)',values:[86,175,1742]}],format:'$#,##0'},figure:{value:'+$275K',label:'Total IBNR movement'},takeaways:['Existing accident quarters release $735K of IBNR.','The new accident quarter adds $1.01M.','Commercial Property drives most of both movements.'],note:'Source: reserving workbook. June is reconstructed, not booked. Values in $000; rounding may affect sums.'}));
    s=deck.slides.add({notes:'Triangles accumulate paid and case reserve change increments at each development-quarter end. Incurred equals paid plus cumulative case. Paid factors use all available matched cohorts and volume weighting. At Q3, Auto and Homeowners have 12 observed ages and Commercial Property 11. Auto and Homeowners terminal links equal 1; select a 1.002 tail because one mature cohort cannot establish final closure. CP 10-to-11 paid link is approximately 1.0051 based on one cohort; tail 1.020 beyond age 11 is judgemental. June CP tail 1.025 beyond age 10 reflects shorter history. No external tail benchmark is available. Workbook contains matched counts and denominator volumes. June factors are derived only from transactions through June 30, avoiding look-ahead.'});compose(s,h(TwoColumns,{title:'Method and tail selections',left:{heading:'Paid chain ladder',bullets:['Accident quarter by development quarter; future cells stay blank.','Incurred equals paid plus accumulated case reserve movements.','Links use volume-weighted, matched-cohort paid experience.','Ultimate equals latest paid times remaining factors and tail.','IBNR equals ultimate less paid and case reserves.']},right:{heading:'Judgement beyond observed history',bullets:['Auto and Homeowners: 1.002 tails beyond the oldest age.','Flat late links justify small residual payment allowances.','Commercial Property: 1.020 beyond age 11 at September.','June Property tail: 1.025 beyond age 10.','Short Property history and continuing late payments warrant caution.']}}));
    s=deck.slides.add({notes:'Tail sensitivity increases each tail by 0.010 absolute, not by 1% relative. Total added IBNR $207,117.76, including CP $101,754.13. CP new 2026 Q3 accident quarter ultimate $1,889,775.74, premium $1,660,600 and combined ratio 147.30%. This is an immature-cohort signal, not a calendar-quarter result or forecast certainty. Model has sheet protection with only selected links and tails unlocked. The Excel sheet protection is an editing guardrail, not encryption. A booked balance is required before proposing a ledger journal or reserve strengthening amount.'});compose(s,h(TwoColumns,{title:'Review the Property risk before approving the indication',left:{heading:'Committee decision',bullets:['Review $2.00M IBNR and $3.37M total outstanding losses.','Challenge Property tail and early-development stability.','Confirm actuarial selections before any booking decision.','Compare with booked reserves before determining a journal.']},right:{heading:'Follow-up and controls',bullets:['All tails up one point add $207K of IBNR.','Property alone contributes $102K of that sensitivity.','Property’s new-quarter combined ratio is 147.3%.','Monitor large losses and obtain longer development benchmarks.','Only selection cells are editable in the protected workbook.']}}));return {slides:deck.slides.items.map(s=>s.id)};
    {
      "ok": true,
      "value": {
        "slides": [
          "sl_X64YHSKD",
          "sl_3RXZEM94",
          "sl_V4ZDF61A",
          "sl_X7XZ2P6P",
          "sl_XXQQ463Y"
        ]
      },
      "logs": [],
      "created": [
        "sl_X64YHSKD",
        "sh_YDVNSRE7",
        "sh_E564VDA7",
        "sh_H6GS0VYR",
        "sh_63JPQEJ1",
        "sh_TG0G1R0T",
        "sh_4T64RBY0",
        "sh_CEZS3S98",
        "sh_N3HB9H9A",
        "sh_J06GTY5S",
        "sh_ZH7DZGP2",
        "sl_3RXZEM94",
        "sh_9WN7NQ2B",
        "tb_63W789E9",
        "sh_660V03R2",
        "sh_YJWJBTGQ",
        "sl_V4ZDF61A",
        "sh_4AFW2KRV",
        "ch_D9M4GVQC",
        "sh_CND3XF51",
        "sh_1SFKHJPP",
        "sh_9B1MYETC",
        "sh_1EFR3HYG",
        "sl_X7XZ2P6P",
        "sh_FW7QTZ8Z",
        "sh_WYYS32TE",
        "sh_SJV3NSF5",
        "sh_FK4HDNRA",
        "sh_88V6Z6S6",
        "sl_XXQQ463Y",
        "sh_SAHAJD8G",
        "sh_YJ2XWFPY",
        "sh_RYG086EH",
        "sh_1J13G7Y5",
        "sh_HJ3Y8A5X"
      ],
      "removed": [],
      "slides": 5,
      "version": 1,
      "lint": {
        "errors": 0,
        "warnings": 0
      },
      "theme": {
        "theme": "Ledger",
        "source": "requested"
      }
    }
  21. artiwright_render
    {
      "session": "loss-reserving",
      "document": "committee",
      "slides": [],
      "sheets": [],
      "range": ""
    }
    Contact sheet of 5 slides.
    A render the agent looked at
  22. artiwright_lint
    {
      "session": "loss-reserving",
      "document": "committee",
      "rules": "",
      "severity": "warn",
      "slide": ""
    }
    {
      "ok": true,
      "errors": 0,
      "warnings": 0,
      "findings": []
    }
  23. artiwright_lint
    {
      "session": "loss-reserving",
      "document": "reserving",
      "rules": "",
      "severity": "warn",
      "slide": ""
    }
    {
      "ok": true,
      "errors": 0,
      "warnings": 0,
      "findings": []
    }
  24. artiwright_help
    {
      "query": "SheetChart, sheet.charts",
      "search": "",
      "maxChars": 4000
    }
    Nothing is called "SheetChart". Closest entries (ask help(path) for one):
      SheetChartOptions
    
    2 entries under sheet.charts:
      sheet.charts.add  A native chart of cells on this (or another) sheet.
      sheet.charts.items  The charts on this sheet.
  25. artiwright_finalizegranite-mutual-q3-2026-reserving.xlsx
    {
      "session": "loss-reserving",
      "document": "reserving",
      "file": "granite-mutual-q3-2026-reserving.xlsx",
      "requirements": {
        "sheets": [
          "Summary",
          "Selections",
          "Checks",
          "Method",
          "PA Q3",
          "HO Q3",
          "CP Q3",
          "PA Q2",
          "HO Q2",
          "CP Q2",
          "Controls",
          "Claims",
          "Premium",
          "GL",
          "Chart Data",
          "Committee Figures"
        ],
        "tables": [
          "Claims",
          "Premium",
          "GLPaid"
        ],
        "charts": 1,
        "values": [
          {
            "cell": "Checks!D2",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!D3",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!D4",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B7",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B8",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B9",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B10",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B11",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B12",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B13",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B14",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Checks!B17",
            "equals": 0,
            "tolerance": 0
          },
          {
            "cell": "Summary!B8",
            "equals": 17571250,
            "tolerance": 0
          },
          {
            "cell": "Summary!F8",
            "equals": 2003226.519054298,
            "tolerance": 0.01
          }
        ],
        "slideCount": 0,
        "nativeCharts": [],
        "nativeTables": [],
        "tableTotals": [],
        "fonts": {
          "allowed": [
            "Aptos"
          ]
        },
        "lint": {
          "block": [
            "error",
            "warn"
          ],
          "waive": []
        }
      }
    }
    {
      "ok": true,
      "blocking": [],
      "warnings": [],
      "checks": [
        {
          "step": 1,
          "code": "path",
          "ok": true
        },
        {
          "step": 2,
          "code": "validate",
          "ok": true
        },
        {
          "step": 3,
          "code": "requirements",
          "ok": true
        },
        {
          "step": 4,
          "code": "lint",
          "ok": true
        },
        {
          "step": 5,
          "code": "publish",
          "ok": true
        }
      ],
      "path": "./sessions/loss-reserving/outputs/granite-mutual-q3-2026-reserving.xlsx",
      "sha256": "63ccf45bc56e6c11d7318909f79bcf62b9e422ae090c619e2b4704ecd25c26d5",
      "bytes": 134055,
      "receiptPath": "./sessions/loss-reserving/.artiwright/receipts/granite-mutual-q3-2026-reserving.63ccf45bc56e.1794785002256.receipt.json"
    }
  26. artiwright_finalizegranite-mutual-q3-2026-reserve-committee.pptx
    {
      "session": "loss-reserving",
      "document": "committee",
      "file": "granite-mutual-q3-2026-reserve-committee.pptx",
      "requirements": {
        "sheets": [],
        "tables": [],
        "charts": 0,
        "values": [],
        "slideCount": 5,
        "nativeCharts": [
          "sl_V4ZDF61A"
        ],
        "nativeTables": [
          "sl_3RXZEM94"
        ],
        "tableTotals": [],
        "fonts": {
          "allowed": []
        },
        "lint": {
          "block": [
            "error",
            "warn"
          ],
          "waive": []
        }
      }
    }
    {
      "ok": true,
      "blocking": [],
      "warnings": [],
      "checks": [
        {
          "step": 1,
          "code": "path",
          "ok": true
        },
        {
          "step": 2,
          "code": "size",
          "ok": true
        },
        {
          "step": 2,
          "code": "validate",
          "ok": true
        },
        {
          "step": 3,
          "code": "package",
          "ok": true
        },
        {
          "step": 4,
          "code": "slideCount",
          "ok": true
        },
        {
          "step": 4,
          "code": "nativeCharts",
          "ok": true
        },
        {
          "step": 4,
          "code": "nativeTables",
          "ok": true
        },
        {
          "step": 4,
          "code": "numbers",
          "ok": true
        },
        {
          "step": 5,
          "code": "chartData",
          "ok": true
        },
        {
          "step": 6,
          "code": "lint",
          "ok": true
        },
        {
          "step": 7,
          "code": "reimport",
          "ok": true
        },
        {
          "step": 8,
          "code": "publish",
          "ok": true
        }
      ],
      "path": "./sessions/loss-reserving/outputs/granite-mutual-q3-2026-reserve-committee.pptx",
      "sha256": "a722e7c3b4ffe34b3813c013aa64e76f51683d147755e82289dc3e4bb861dada",
      "bytes": 47351,
      "manifestPath": "./sessions/loss-reserving/outputs/granite-mutual-q3-2026-reserve-committee.pptx.manifest.ndjson",
      "receiptPath": "./sessions/loss-reserving/.artiwright/receipts/granite-mutual-q3-2026-reserve-committee.a722e7c3b4ff.1794784999531.receipt.json"
    }
The agent's last message

Completed in Ledger theme:

  • [Reserving workbook](outputs/granite-mutual-q3-2026-reserving.xlsx)
  • [Five-slide committee deck](outputs/granite-mutual-q3-2026-reserve-committee.pptx)

Q3 indication: $2.00m IBNR, $3.37m total outstanding losses, and a 92.2% combined ratio across the supplied accident quarters.

The workbook includes paid and incurred triangles, volume-weighted paid factors, documented tail selections, ultimates, ratios, sensitivities and GL reconciliations. Paid ties exactly by line. All sheets are protected; only selection cells are editable.

Important: The $275k IBNR increase is against a reconstructed June 30 indication, not booked reserves. Commercial Property accounts for 87% of IBNR and is highlighted for committee review.

Both files passed validation with no outstanding warnings.

Lint during the run

Unformatted numbers and clipped labels

Lint found 20 problems in the workbook: four columns of numbers with no number format (premium, the GL and the chart data) and 16 labels cut off by the next cell on the triangle sheets and the chart data. The agent fixed them all in one call and lint came back clean. The deck was clean the first time.

  1. lintreserving4 × number/unformatted16 × text/clipped
  2. lintcommitteeNo findings
  3. lintreservingNo findings
  4. finalizegranite-mutual-q3-2026-reserving.xlsxNo findings
  5. finalizegranite-mutual-q3-2026-reserve-committee.pptxNo findings

Finalize report

Nothing is published until these pass. Finalize checks the real file and never overwrites one.

How this example was made: the request above went to a LangGraph agent on gpt-6.1-sol, built with Artiwright's Python package, using agent-runs/framework_run.py. The files are what it finalized, opened in PowerPoint and Excel for the screenshots. Companies, people and figures are made up.