ai-measurement-regression-harness

Enforces regression tests for AI roof measurement pipeline fixes against canonical baselines.

Updated Sep 24, 2025
One-click install
npx skills add https://github.com/chriso789/pitch-1 --skill ai-measurement-regression-harness-chriso789
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-measurement-regression-harness
Source: https://github.com/chriso789/pitch-1/tree/main/.agents/skills/ai-measurement-regression-harness
Command: npx skills add https://github.com/chriso789/pitch-1 --skill ai-measurement-regression-harness-chriso789

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Fixes to the AI Measurement pipeline often ship without tests that would have caught the original regression, allowing perimeter, topology, state, and report-rendering bugs to silently recur. This Skill mandates that every pipeline change includes regression tests validated against canonical baselines like the Fonsica roof benchmark. ## Core Features & Use Cases - Baseline Enforcement: Asserts Fonsica canonical values (3077 sqft area, ~264 LF perimeter, ~14 facets, 6:12 pitch, non-zero ridge and valley lengths) on every relevant change. - Gate-by-Gate Assertions: Validates perimeter shape checks, topology phase execution, route provenance, result_state normalization, and customer_report_ready transitions individually. - Report Rendering Guards: Ensures rejected-geometry rows never render as customer-ready reports and that rejected_only diagrams still show the perimeter overlay. - Use Case: When fixing a bug where topology ran despite a failed perimeter shape check, use this Skill to generate a Deno test asserting phase3C/phase3D never execute when shape_passed is false. ## Quick Start Ask the AI to add regression tests for a measurement pipeline fix, for example: create a Fonsica perimeter shape regression test for the start-ai-measurement function.

Frequently Asked Questions about ai-measurement-regression-harness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a regression test for an AI measurement pipeline fix?▼

Place a test file under supabase/functions/<fn>/__tests__/ named after the regression, such as fonsica-perimeter-shape.test.ts, and map each assertion to the hard rule it enforces. Run it with the Deno edge function test command for that function.

What are the Fonsica baseline values for roof measurement tests?▼

The canonical Fonsica baseline is 3077 sqft area, approximately 264 LF of eaves plus rakes, about 14 facets, and a 6:12 pitch. When topology passes, ridge_lf and valley_lf must both be greater than zero.

Why must topology tests fail when perimeter shape validation fails?▼

Topology phases 3C and 3D must not execute when shape_passed is false unless user_verified_perimeter is true. Tests assert no phase3C or phase3D execution in that case, preventing invalid geometry from propagating downstream.

How is customer_report_ready allowed to become true?▼

It may only flip to true through the assertCustomerReportReady guard or an equivalent checked path. Any direct set of customer_report_ready to true is treated as a test failure.

What fixtures should measurement regression tests use?▼

Use real persisted rows, anonymized, stored under supabase/functions/_shared/__fixtures__/ or src/test/fixtures/, such as fonsica-row.json. Hand-crafted shapes are discouraged because they drift from production data.

What happens if a rejected_only measurement renders a blank report?▼

That is a refusal trigger: rows with diagram_render_intent of rejected_only and an existing phase3_5 must render the perimeter overlay, and failed-geometry rows must never look like a customer-ready report. Snapshot tests must catch both cases.