Visual Diagrams

This document contains visual representations of the framework’s key concepts using Mermaid diagrams.

1. Equity Bridge Flow Diagram

The equity bridge shows how equity reconciles from one period to the next through various source terms:

flowchart TD
    Start["Opening Equity<br/>E₀<br/>$1,000M"] --> NI["+ Net Income<br/>IAS 1.106<br/>$50M"]
    NI --> OCI1["+ FVOCI Investments<br/>IFRS 9.5.7.1<br/>$28M"]
    OCI1 --> OCI2["+ FX Translation<br/>IAS 21.52<br/>$6M"]
    OCI2 --> OCI3["+ Actuarial Gains<br/>IAS 19.93<br/>$1M"]
    OCI3 --> DIV["- Dividends<br/>IAS 1.107<br/>$10M"]
    DIV --> BUY["- Treasury Stock<br/>IAS 32.33<br/>$25M"]
    BUY --> NCI["± NCI Changes<br/>IFRS 10<br/>$0M"]
    NCI --> End["Closing Equity<br/>E₁<br/>$1,050M"]

    style Start fill:#e1f5ff
    style End fill:#e1f5ff
    style NI fill:#d4edda
    style OCI1 fill:#fff3cd
    style OCI2 fill:#fff3cd
    style OCI3 fill:#fff3cd
    style DIV fill:#f8d7da
    style BUY fill:#f8d7da
    style NCI fill:#d1ecf1

Validation Check: - Expected: $1,000 + $50 + $35 - $10 - $25 = $1,050 ✓ - If gap exists: Framework identifies missing OCI components or NCI changes

2. M&A Boundary Flux Diagram

This diagram illustrates the Reynolds Transport Theorem concept applied to accounting consolidation:

flowchart LR
    subgraph Before["Before Acquisition (t=0)"]
        direction TB
        A1["Company A<br/>Equity: $500M<br/>Consolidated Group"]
        B1["Company B<br/>Equity: $100M<br/>External Entity"]
    end

    subgraph During["Acquisition Event"]
        direction TB
        Arrow["Boundary Flux<br/>ΦE = $100M<br/>Entity crosses ∂V"]
    end

    subgraph After["After Acquisition (t=1)"]
        direction TB
        A2["Company A (Consolidated)<br/>Parent Equity: $450M<br/>NCI: $50M<br/>Total: $500M"]
        B2["Company B<br/>Now inside boundary<br/>Contributes $50M NCI"]
    end

    Before --> During
    During --> After

    style Before fill:#fff3cd
    style During fill:#d1ecf1
    style After fill:#d4edda
    style Arrow fill:#f8d7da

Mathematical Form:

dE/dt = ∫(sources) dV + ∫(flux across ∂V) dA + ∫(boundary velocity · ρ) dA
        ↑                ↑                      ↑
        operational      static boundary        moving boundary (M&A)

Key Insight: Company B’s $100M equity is NOT operational income—it’s boundary flux. Framework distinguishes: - ✅ Operational sources: Net income, OCI - ✅ Boundary flux: M&A, NCI changes - ⚠️ Misclassification → Framework detects as reconciliation error

3. Framework Architecture

Technical pipeline from raw XBRL to validated results:

flowchart TD
    subgraph Input["Data Sources"]
        EDGAR["SEC EDGAR<br/>companyfacts API"]
        XBRL["XBRL Filings<br/>.xml format"]
        CSV["Custom Dataset<br/>.csv format"]
    end

    subgraph Parser["Parsing Layer"]
        Extract["XBRL Extractor<br/>scripts/hydrate_companyfacts.py"]
        Map["Concept Mapper<br/>config/concept_aliases.yaml"]
        Taxonomy["Standards Taxonomy<br/>91 IFRS/GAAP mappings"]
    end

    subgraph Validator["Validation Engine"]
        Leverage["Leverage Identity<br/>A = L + E"]
        Bridge["Equity Bridge<br/>ΔE = sources"]
        NCI["NCI Reconciliation<br/>IFRS 10 checks"]
        OCI["OCI Completeness<br/>7 component checks"]
    end

    subgraph Output["Results"]
        Metrics["metrics.json<br/>Pass/fail rates"]
        Report["HTML Reports<br/>index.html"]
        Alerts["Risk Alerts<br/>High-risk flags"]
    end

    Input --> Parser
    Parser --> Validator
    Validator --> Output

    style Input fill:#e1f5ff
    style Parser fill:#fff3cd
    style Validator fill:#d1ecf1
    style Output fill:#d4edda

Key Components: 1. Extractor: Fetches data from SEC EDGAR (rate-limited 10 req/sec) 2. Mapper: Handles XBRL tag variations (us-gaap vs. ifrs-full) 3. Taxonomy: Maps each tag to specific IFRS/GAAP standard 4. Validators: Apply mathematical constraints 5. Metrics: Statistical analysis with Wilson intervals

4. Audit Workflow Integration

How practitioners use the framework in real audit engagements:

flowchart TD
    Start([Audit Planning]) --> Risk["Risk Assessment<br/>ML Model (AUC 0.949)"]
    Risk --> |High Risk| Priority["Prioritize Client"]
    Risk --> |Low Risk| Standard["Standard Procedures"]

    Priority --> Hydrate["Hydrate Client Data<br/>scripts/hydrate_companyfacts.py"]
    Standard --> Hydrate

    Hydrate --> Validate["Run Validation<br/>scripts/demo.py --ticker CLIENT"]

    Validate --> Results{Results?}

    Results --> |All Pass| Green["✓ Green Flag<br/>Document & Continue"]
    Results --> |Failures| Red["⚠ Red Flag<br/>Investigate"]

    Red --> Diagnose["Diagnose Gap<br/>scripts/diagnose_equity_gap.py"]

    Diagnose --> Root{Root Cause?}

    Root --> |XBRL Gap| Request["Request OCI Rollforward<br/>from Client"]
    Root --> |Disclosure Gap| Adjust["Adjust Expectations<br/>Document Limitation"]
    Root --> |Potential Error| Escalate["Escalate to Partner<br/>Consider Adjustment"]

    Request --> Revalidate["Re-run Validation"]
    Adjust --> Document["Document in Workpapers"]
    Escalate --> Document

    Revalidate --> Final{Resolved?}
    Final --> |Yes| Document
    Final --> |No| Escalate

    Green --> Final_Report([Issue Audit Opinion])
    Document --> Final_Report

    style Start fill:#e1f5ff
    style Risk fill:#fff3cd
    style Validate fill:#d1ecf1
    style Green fill:#d4edda
    style Red fill:#f8d7da
    style Final_Report fill:#e1f5ff

Time Savings: - Traditional: 8-12 hours manual tracing per client - Framework: 2 minutes automated validation + targeted follow-up - Efficiency Gain: ~95% time reduction on reconciliation procedures

5. Validation Test Hierarchy

Relationship between different validation tests:

graph TD
    Root["Financial Statement Validation"]

    Root --> L1_Leverage["Leverage Identity<br/>A = L + E"]
    Root --> L1_Equity["Equity Conservation<br/>ΔE = sources + flux"]

    L1_Leverage --> L2_Balance["Balance Sheet Integrity<br/>Assets = Liabilities + Equity"]

    L1_Equity --> L2_Bridge["Equity Bridge Closure<br/>E₁ = E₀ + ΔE"]
    L1_Equity --> L2_NCI["NCI Reconciliation<br/>IFRS 10 compliance"]

    L2_Bridge --> L3_Sources["Source Decomposition"]

    L3_Sources --> L4_NI["Net Income<br/>IAS 1.106"]
    L3_Sources --> L4_OCI["OCI Components<br/>7 items"]
    L3_Sources --> L4_Owner["Owner Transactions<br/>Div, Buybacks"]

    L4_OCI --> L5_FVOCI["FVOCI<br/>IFRS 9.5.7.1"]
    L4_OCI --> L5_FX["FX Translation<br/>IAS 21.52"]
    L4_OCI --> L5_Pension["Actuarial<br/>IAS 19.93"]
    L4_OCI --> L5_Hedge["Hedging<br/>IFRS 9 hedge"]

    style Root fill:#e1f5ff
    style L1_Leverage fill:#d1ecf1
    style L1_Equity fill:#d1ecf1
    style L2_Balance fill:#fff3cd
    style L2_Bridge fill:#fff3cd
    style L2_NCI fill:#fff3cd
    style L3_Sources fill:#ffeaa7
    style L4_NI fill:#d4edda
    style L4_OCI fill:#d4edda
    style L4_Owner fill:#d4edda
    style L5_FVOCI fill:#dfe6e9
    style L5_FX fill:#dfe6e9
    style L5_Pension fill:#dfe6e9
    style L5_Hedge fill:#dfe6e9

Test Strategy: 1. Level 1: Fundamental identities (must pass) 2. Level 2: Component reconciliation (high-level) 3. Level 3: Source term decomposition 4. Level 4: Standard-specific validation 5. Level 5: Granular tag-level checks

6. Empirical Results Summary

Visual representation of 500-company validation results:

%%{init: {'theme':'base', 'themeVariables': { 'fontSize':'16px'}}}%%
graph LR
    subgraph Results["N=500 S&P 500 Companies (2,000 Filings)"]
        direction TB

        L["Leverage Identity<br/>72.9% pass<br/>[70.8%, 74.9%]"]
        E["Equity Bridge<br/>54.9% pass<br/>[52.6%, 57.2%]"]
        N["NCI Reconciliation<br/>68.3% pass<br/>[66.1%, 70.4%]"]
        O["OCI Completeness<br/>43.2% pass<br/>[41.0%, 45.4%]"]
    end

    subgraph Interpretation["Interpretation"]
        direction TB

        I1["Not accounting fraud<br/>XBRL data quality issues"]
        I2["Framework = diagnostic tool<br/>for disclosure gaps"]
        I3["ML audit risk model<br/>AUC 0.949"]
    end

    Results --> Interpretation

    style L fill:#d4edda
    style E fill:#fff3cd
    style N fill:#d4edda
    style O fill:#f8d7da
    style I1 fill:#e1f5ff
    style I2 fill:#e1f5ff
    style I3 fill:#d1ecf1

Key Findings: - 72.9% leverage pass rate: Most companies have balance sheet integrity - 54.9% equity bridge: Significant XBRL/disclosure gaps (especially OCI) - 43.2% OCI completeness: Weakest area—most companies don’t itemize OCI components - AUC 0.949: ML model successfully predicts high-risk filings

7. Standards Taxonomy Structure

Organization of 91 IFRS/GAAP standards mapped to equity source terms:

graph TD
    Root["Equity Change Sources<br/>ΔE = ΣSource Terms"]

    Root --> Cat1["Profit/Loss<br/>IAS 1"]
    Root --> Cat2["Other Comprehensive Income<br/>IAS 1.7"]
    Root --> Cat3["Owner Transactions<br/>IAS 32/IFRS 2"]
    Root --> Cat4["Consolidation<br/>IFRS 10/IFRS 3"]
    Root --> Cat5["Measurement<br/>IFRS 13/IAS 8"]

    Cat2 --> OCI1["Financial Instruments<br/>IFRS 9"]
    Cat2 --> OCI2["Foreign Currency<br/>IAS 21"]
    Cat2 --> OCI3["Employee Benefits<br/>IAS 19"]
    Cat2 --> OCI4["Revaluation<br/>IAS 16/IAS 38"]

    Cat3 --> Owner1["Dividends<br/>IAS 1.107"]
    Cat3 --> Owner2["Share Buybacks<br/>IAS 32.33"]
    Cat3 --> Owner3["Share-Based Payment<br/>IFRS 2"]
    Cat3 --> Owner4["Capital Contributions<br/>IAS 1.108"]

    Cat4 --> Consol1["Acquisitions<br/>IFRS 3"]
    Cat4 --> Consol2["NCI Changes<br/>IFRS 10.23"]
    Cat4 --> Consol3["Loss of Control<br/>IFRS 10.25"]

    OCI1 --> Tag1["us-gaap:OCI_FVOCI"]
    OCI2 --> Tag2["us-gaap:OCI_ForeignCurrency"]
    OCI3 --> Tag3["us-gaap:OCI_PensionPlans"]

    style Root fill:#e1f5ff
    style Cat1 fill:#d4edda
    style Cat2 fill:#fff3cd
    style Cat3 fill:#f8d7da
    style Cat4 fill:#d1ecf1
    style Cat5 fill:#ffeaa7
    style Tag1 fill:#dfe6e9
    style Tag2 fill:#dfe6e9
    style Tag3 fill:#dfe6e9

Complete Taxonomy: See docs/standards/STANDARDS_CROSSWALK.md

8. Cross-Domain Conservation Analogy

Structural similarity across different domains (conceptual only):

graph TD
    subgraph Physics["Physics: Mass Conservation"]
        P1["∂ρ/∂t + ∇·J = s<br/>Density change = flow + source"]
        P2["Example: Fluid in control volume"]
    end

    subgraph Accounting["Accounting: Equity Conservation"]
        A1["ΔE = flows + sources<br/>Equity change = transactions + income"]
        A2["Example: Company balance sheet"]
    end

    subgraph Math["Mathematical Structure"]
        M1["Graph Theory<br/>Nodes + Directed Edges"]
        M2["Discrete Continuity<br/>Balance = In - Out + Source"]
    end

    Physics --> Math
    Accounting --> Math

    style Physics fill:#e1f5ff
    style Accounting fill:#d4edda
    style Math fill:#fff3cd

Important Qualifier: This is a structural analogy, not a claim that “accounting IS physics.” The mathematical form appears similar, but: - Physics: Empirical physical law (mass/energy cannot be created/destroyed) - Accounting: Conventional system designed by humans (double-entry is a definition) - Framework: Uses similar mathematical tools to formalize accounting rules

Usage in Documentation

These diagrams are embedded in: - README.md: Simplified equity bridge flow - FOR_AUDITORS.md: Audit workflow integration - FOR_RESEARCHERS.md: Mathematical structure diagrams - index.html: Consider adding interactive versions

Generating Custom Diagrams

To create custom diagrams for specific companies:

# Generate equity bridge diagram for specific ticker
python scripts/make_equity_bridge_diagram.py --ticker AAPL --quarter 2024Q3

# Output: docs/figures/equity_bridge_AAPL_2024Q3.svg

Note: All diagrams use Mermaid syntax and render natively in GitHub, GitLab, and most modern markdown viewers. For PDF exports, use mermaid-cli:

npm install -g @mermaid-js/mermaid-cli
mmdc -i docs/DIAGRAMS.md -o docs/DIAGRAMS.pdf

Last Updated: 2025-01-05