Exhibit A Definition Auditor
Audit an Exhibit A study definition against its reference image and transcript. Produce a structured audit report with issues and recommended fixes.
Usage
/audit-exhibit-a-def time-between-all-time-highs
/audit-exhibit-a-def ea_sp500_showing_all_time_highs_research
Paths
- Definitions:
/home/adesola/EpochDev/ClaudeCodeResearch/project/definitions/test_runner/
- Exhibit A images & transcripts:
/home/adesola/EpochDev/ClaudeCodeResearch/exhibit_a_research/exhibita_organized/
- Manifest:
/home/adesola/EpochDev/ClaudeCodeResearch/exhibit_a_research/manifest.csv
- Study outputs:
/home/adesola/EpochDev/ClaudeCodeResearch/project/research_studies/test_runner/
Workflow
Step 1: Resolve the Definition
Given the argument, find the matching definition JSON and Exhibit A reference materials.
# Strip ea_ prefix and _research suffix to get the study slug
# e.g. "ea_sp500_showing_all_time_highs_research" -> "sp500-showing-all-time-highs"
# or user may pass the slug directly: "time-between-all-time-highs"
- Find the definition JSON in
project/definitions/test_runner/
- Find the Exhibit A directory in
exhibit_a_research/exhibita_organized/<slug>/
- If no match, search the manifest.csv for the closest match
Step 2: Load All Reference Materials
Read these files:
- Definition JSON - the EpochScript source and configuration
- Exhibit A image (
.png) - the reference chart/visual the definition should replicate
- Exhibit A transcript (
transcript.txt) - title, topic, question, key takeaways, source
Step 3: Audit Against Checklist
Compare the definition against the Exhibit A reference using this checklist:
A. Data Coverage & Source
- Does the date range match the Exhibit A? (e.g., "Since 1950" requires
common_indices(ticker=SPX), not SPY which starts 2003)
- Are the correct assets/data sources used?
- Is the data source capable of providing the full history shown in the Exhibit A image?
B. Chart Type & Visual Match
- Does the chart type match? (lines, bars, area, histogram, scatter, etc.)
- Does the number of series match?
- Are colors consistent with the Exhibit A?
- Is the area fill used when the Exhibit A shows it?
C. Labeling & Metadata
- Does the chart title match the Exhibit A title?
- Are axis labels correct? (Y-axis label, format, decimal places)
- Is the category/section naming appropriate?
D. Data-Driven Approach (CRITICAL)
- NO hardcoded values - All thresholds, averages, reference lines must be computed from data
- NO hardcoded date ranges - Use dynamic detection (e.g.,
hold_until, crossunder, crossover) instead of year filters
- NO hardcoded period labels - Derive from data where possible
- Reference lines should use computed aggregations (e.g.,
cumulative(agg=AggregationType.Mean))
- If the Exhibit A shows summary statistics, compute them dynamically
E. Completeness
- Does the definition capture all charts/tables shown in the Exhibit A?
- Are key takeaways from the transcript reflected in the data presentation?
- Are event markers used where appropriate?
F. EpochScript Correctness
- Are transforms used correctly? (check known bugs:
Timestamp() returns NaT, valuewhen(occurrence=0) returns current bar)
- Are enum values fully qualified? (e.g.,
AggregationType.Max not bare Max)
- Is the null handling correct? (consider
nullPolicy: DropNulls in reporters)
Step 4: Generate Audit Report
Output a structured report:
## Audit: <definition-name>
### Reference
- **Exhibit A Title:** <title from transcript>
- **Exhibit A Date Range:** <date range visible in image>
- **Transcript Key Points:** <bullet points>
### Issues Found
| # | Severity | Category | Issue | Fix |
|---|----------|----------|-------|-----|
| 1 | CRITICAL | Data Coverage | SPY only goes to 2003, Exhibit A shows 1950+ | Use common_indices(ticker=SPX) |
| 2 | HIGH | Hardcoded | Reference line uses hardcoded -35% | Compute from cumulative mean |
| 3 | MEDIUM | Labeling | Y-axis label doesn't match | Change to "..." |
| 4 | LOW | Style | Color doesn't match Exhibit A | Change to Color.X |
### Recommended Definition
[Updated EpochScript source with all fixes applied]
Step 5: Apply Fixes (if user confirms)
If the user wants to apply fixes, update the definition JSON with the corrected EpochScript.
ARGUMENTS: $ARGUMENTS
1---2name: audit-exhibit-a-def3description: Audit an Exhibit A study definition by comparing it against the original reference image and transcript. Use when the user wants to review, audit, or fix a definition to match the Exhibit A source material. Checks for: visual match, data-driven approach (no hardcoded values), correct data source/range, chart type accuracy, and proper labeling.4---56# Exhibit A Definition Auditor78Audit an Exhibit A study definition against its reference image and transcript. Produce a structured audit report with issues and recommended fixes.910## Usage1112```13/audit-exhibit-a-def time-between-all-time-highs14/audit-exhibit-a-def ea_sp500_showing_all_time_highs_research15```1617## Paths1819- **Definitions:** `/home/adesola/EpochDev/ClaudeCodeResearch/project/definitions/test_runner/`20- **Exhibit A images & transcripts:** `/home/adesola/EpochDev/ClaudeCodeResearch/exhibit_a_research/exhibita_organized/`21- **Manifest:** `/home/adesola/EpochDev/ClaudeCodeResearch/exhibit_a_research/manifest.csv`22- **Study outputs:** `/home/adesola/EpochDev/ClaudeCodeResearch/project/research_studies/test_runner/`2324## Workflow2526### Step 1: Resolve the Definition2728Given the argument, find the matching definition JSON and Exhibit A reference materials.2930```bash31# Strip ea_ prefix and _research suffix to get the study slug32# e.g. "ea_sp500_showing_all_time_highs_research" -> "sp500-showing-all-time-highs"33# or user may pass the slug directly: "time-between-all-time-highs"34```35361. Find the definition JSON in `project/definitions/test_runner/`372. Find the Exhibit A directory in `exhibit_a_research/exhibita_organized/<slug>/`383. If no match, search the manifest.csv for the closest match3940### Step 2: Load All Reference Materials4142Read these files:43441. **Definition JSON** - the EpochScript source and configuration452. **Exhibit A image** (`.png`) - the reference chart/visual the definition should replicate463. **Exhibit A transcript** (`transcript.txt`) - title, topic, question, key takeaways, source4748### Step 3: Audit Against Checklist4950Compare the definition against the Exhibit A reference using this checklist:5152#### A. Data Coverage & Source53- Does the date range match the Exhibit A? (e.g., "Since 1950" requires `common_indices(ticker=SPX)`, not SPY which starts 2003)54- Are the correct assets/data sources used?55- Is the data source capable of providing the full history shown in the Exhibit A image?5657#### B. Chart Type & Visual Match58- Does the chart type match? (lines, bars, area, histogram, scatter, etc.)59- Does the number of series match?60- Are colors consistent with the Exhibit A?61- Is the area fill used when the Exhibit A shows it?6263#### C. Labeling & Metadata64- Does the chart title match the Exhibit A title?65- Are axis labels correct? (Y-axis label, format, decimal places)66- Is the category/section naming appropriate?6768#### D. Data-Driven Approach (CRITICAL)69- **NO hardcoded values** - All thresholds, averages, reference lines must be computed from data70- **NO hardcoded date ranges** - Use dynamic detection (e.g., `hold_until`, `crossunder`, `crossover`) instead of year filters71- **NO hardcoded period labels** - Derive from data where possible72- Reference lines should use computed aggregations (e.g., `cumulative(agg=AggregationType.Mean)`)73- If the Exhibit A shows summary statistics, compute them dynamically7475#### E. Completeness76- Does the definition capture all charts/tables shown in the Exhibit A?77- Are key takeaways from the transcript reflected in the data presentation?78- Are event markers used where appropriate?7980#### F. EpochScript Correctness81- Are transforms used correctly? (check known bugs: `Timestamp()` returns NaT, `valuewhen(occurrence=0)` returns current bar)82- Are enum values fully qualified? (e.g., `AggregationType.Max` not bare `Max`)83- Is the null handling correct? (consider `nullPolicy: DropNulls` in reporters)8485### Step 4: Generate Audit Report8687Output a structured report:8889```90## Audit: <definition-name>9192### Reference93- **Exhibit A Title:** <title from transcript>94- **Exhibit A Date Range:** <date range visible in image>95- **Transcript Key Points:** <bullet points>9697### Issues Found9899| # | Severity | Category | Issue | Fix |100|---|----------|----------|-------|-----|101| 1 | CRITICAL | Data Coverage | SPY only goes to 2003, Exhibit A shows 1950+ | Use common_indices(ticker=SPX) |102| 2 | HIGH | Hardcoded | Reference line uses hardcoded -35% | Compute from cumulative mean |103| 3 | MEDIUM | Labeling | Y-axis label doesn't match | Change to "..." |104| 4 | LOW | Style | Color doesn't match Exhibit A | Change to Color.X |105106### Recommended Definition107108[Updated EpochScript source with all fixes applied]109```110111### Step 5: Apply Fixes (if user confirms)112113If the user wants to apply fixes, update the definition JSON with the corrected EpochScript.114115ARGUMENTS: $ARGUMENTS