← j4n00.

collected diagrams

diagrams.

A working set of flowcharts, sequences, schemas and the odd state machine. Some are a glance; others need room. Open any to read it up close.

8 diagrams · 3 types

flowchart TD
        subgraph SETUP["One-Time Setup"]
            A["Create project + system prompt"]
            B["Run file interviews"]
            A --> B
        end

        B --> KB[("Knowledge base
superResume · jobParameters · bragDoc
perfFeedback · connections · aiAssessment")]

        subgraph LOOP["Active Search Loop"]
            C["Outreach or role found"]
            D{"Qualifier flow
blockers · fit score · stackrank"}
            E["Decline / defer"]
            F["Attach JD to Folio chat"]
            G["Resume diff + targeted outline"]
            H["Submit application"]
            I["Interview prep
story mapping · HM research"]
            J["Interview"]
            K{"Offer?"}
            L["Negotiate
base · equity · benefits"]
            M["Accept or decline"]
            N["Close + update pipeline"]
        end

        subgraph MAINT["Ongoing Maintenance"]
            P["Weekly brag doc"]
            Q["Connections refresh"]
            R["Pipeline review"]
        end

        KB -->|"informs"| F
        KB -->|"informs"| I
        C --> D
        D -->|"No"| E
        D -->|"Yes"| F
        F --> G
        G --> H
        H --> I
        I --> J
        J --> K
        K -->|"No"| N
        K -->|"Yes"| L
        L --> M
        M --> N
        N --> R
        R -->|"new cycle"| C
        P -->|"updates"| KB
        Q -->|"updates"| KB

Folio Workflow

flowchart

modern job seeking framework leveraging contextual ai knowledge bases and active loop management.

erDiagram
      users {
          uuid id PK
          varchar email
          timestamptz invited_at
          timestamptz created_at
          timestamptz updated_at
          timestamptz deleted_at
          bool is_sso_user
          bool is_anonymous
      }

      tenants {
          uuid id PK
          text domain
          text slug
          timestamptz created_at
          timestamptz updated_at
          timestamptz archived_at
          tenant_status status
          text display_name
          text crm_ref_id
          bool allow_sandbox
          bool allow_papayaion
          string tier_key FK "refer tenant_usage_policies"
      }

      tenant_usage_policies {
          text tier_key PK "e.g. free, pro, enterprise"
          int max_tokens_per_user "enforced at creation"
          int rate_limit_rpm "enforced at runtime"
          uuid[] allowed_roles FK "allow-list of role ids"
      }

      roles {
          uuid id PK
          timestamptz created_at
          timestamptz updated_at
          text name
          uuid tenant_id FK
          timestamptz archived_at
          _permission permissions
      }

      tenant_members {
          uuid user_id
          uuid tenant_id
          timestamptz created_at
      }

      user_roles {
          uuid id PK
          timestamptz created_at
          timestamptz updated_at
          uuid user_id FK
          uuid role_id FK
      }

      api_keys {
          uuid id PK
          uuid user_id FK "owner"
          uuid tenant_id FK "limits + scopes"
          text name "User-defined label"
          text token_prefix "first 8 chars (Plain Text)"
          text token_hash "secure_hash (Secret)"
          timestamptz last_used_at
          timestamptz expires_at
          timestamptz created_at
          timestamptz updated_at
          timestamptz deleted_at
      }

      api_key_roles {
          uuid id PK
          timestamptz created_at
          timestamptz updated_at
          uuid token_id FK
          uuid role_id FK
      }

      audit_logs {
          uuid id PK
          uuid token_id FK
          uuid actor_user_id FK "who performed the action"
          text event_type "CREATED, REVOKED, MODIFIED"
          jsonb metadata "IP, User Agent, Diff"
          timestamptz created_at
      }

      activity_logs {
          uuid id PK
          uuid token_id FK
          text request_type "API, Webhook, etc."
          jsonb metadata "request, response, current usage/limits"
          timestamptz created_at "partition key"
      }

      %% Relationships
      tenant_members ||--|| users : "has"
      tenant_members }|--|| tenants : "belongs to"
      user_roles ||--|| users : "has"
      user_roles ||--|| roles : "assigned to"
      roles }|--|| tenants : "belongs to"
      tenant_usage_policies ||--|{ tenants : "defines_limits"
      users ||--|{ api_keys : "owns"
      tenants ||--|{ api_keys : "has many"
      api_keys ||--|{ audit_logs : "external history"
      users ||--|| audit_logs : "actor"
      api_keys ||--|{ activity_logs : "internal history"
      api_keys ||--|{ api_key_roles : "has"
      roles ||--|{ api_key_roles : "assigned to"

Multi-Tenant RBAC & API Token Schema

erDiagram

relational database schema for multi-tenant isolation, user roles, and scoped api key tracking.

stateDiagram-v2

	state ReportStatus {
	  [*] --> INCOMING

		INCOMING --> CREATED

	  CREATED --> NOTIFIED
	  CREATED --> EXPIRED
	  CREATED --> STALE

	  NOTIFIED --> FEEDBACK_PROVIDED
	  NOTIFIED --> EXPIRED
	  NOTIFIED --> STALE

	  FEEDBACK_PROVIDED --> EXPIRED
	  FEEDBACK_PROVIDED --> STALE

	  EXPIRED --> [*]
	  STALE --> [*]
	  FEEDBACK_PROVIDED --> [*]
	  NOTIFIED --> [*]

	  UNKNOWN
	}

Report Lifecycle State Machine

stateDiagram

state machine tracking the transactional status phases of a processed report.

stateDiagram
      direction TB
      classDef complete fill:#d4edda,stroke:#155724,color:#155724;
      classDef inprogress fill:#fff3cd,stroke:#856404,color:#856404;
      classDef planned fill:#dbeafe,stroke:#1e3a8a,color:#1e3a8a;
      classDef available fill:#ede9fe,stroke:#6b21a8,color:#6b21a8;
      classDef skipped fill:#f8d7da,stroke:#721c24,color:#721c24;

      state ItemLifecycle {
          direction TB
          [*] --> Source_Created : 🟣 Warehouse Sync
          Source_Created --> Record_Loaded : ✅ RecordService#Load
          Record_Loaded --> Record_Notified : ✅ NotificationService#Notify non-notified
          Record_Notified --> Record_Updated : ✅ update notified_at, notified historicals
          Record_Notified --> Record_Feedback_Provided : ✅ Consumer Dashboard UX
          Record_Feedback_Provided --> Record_Actioned : ✅ "Acknowledge & Action" UX
          Record_Feedback_Provided --> Record_Unactioned : ✅ "Acknowledge No Action" UX
          Record_Feedback_Provided --> Record_Disagreed : ✅ "Dismiss" UX
          Record_Actioned --> Record_Updated : ✅ update provided_feedback, actioned_at
          Record_Unactioned --> Record_Updated : ✅ update provided_feedback, unactioned_at
          Record_Disagreed --> Record_Updated : ✅ update provided_feedback, disagreed_at
          Record_Feedback_Provided --> Source_Removed
          Record_Feedback_Provided --> Source_Unresolvable

          [*] --> Source_Removed : 🟣 Warehouse Sync
          Record_Loaded --> Source_Removed
          Record_Notified --> Source_Removed
          Source_Removed --> Record_Stale_Update : ✅ AuditService#StaleCheck
          Record_Stale_Update --> Record_Updated : ✅ update stale_at, audited_at, historical_tracking_id

          [*] --> Source_Unresolvable : 🟣 Warehouse Sync
          Record_Loaded --> Source_Unresolvable
          Record_Notified --> Source_Unresolvable
          Source_Unresolvable --> Record_Unresolvable_Update : ✅ AuditService#ResolutionCheck
          Record_Unresolvable_Update --> Record_Updated : ✅ update expiry, expired_at, audited_at, historical_tracking_id

          [*] --> Source_Updated : 🟣 Warehouse Sync
          Source_Updated --> Record_Audit_Update : ✅ AuditService#ChangeCheck
          Record_Audit_Update --> Record_Updated : ✅ update stale, expiry, ids, timestamps

          Record_Loaded --> Record_Deleted: ✅ RecordService#Delete
          Record_Notified --> Record_Deleted: ✅ RecordService#Delete
          Record_Updated --> Record_Deleted: ✅ RecordService#Delete

          Record_Loaded --> [*]: ✅ Warehouse Sync
          Record_Notified --> [*]: ✅ Warehouse Sync
          Record_Updated --> [*]: ✅ Warehouse Sync
          Record_Deleted --> [*]: ✅ Warehouse Sync
      }

      class Source_Created available
      class Source_Removed available
      class Source_Unresolvable available
      class Source_Updated available
      class Record_Loaded complete
      class Record_Notified complete
      class Record_Feedback_Provided complete
      class Record_Actioned complete
      class Record_Unactioned complete
      class Record_Disagreed complete
      class Record_Stale_Update complete
      class Record_Unresolvable_Update complete
      class Record_Audit_Update complete
      class Record_Updated complete
      class Record_Deleted complete

Report State Lifecycle

stateDiagram

state machine tracking external ingestion syncs, consumer feedback loops, and automated record audits.

flowchart TB
    subgraph Report Engine
        subgraph SyncPipeline [Sync Pipeline]
          sync_warehouse_to_nosql@{ shape: rounded }
        end
        subgraph DataWarehouse [Data Warehouse]
            basket_historical_data@{ shape: win-pane }
            coconut_historical_data@{ shape: win-pane }
            apple_metric_historical@{ shape: win-pane }
          papaya_historical_data@{ shape: win-pane }
          broccoli_metric_historical@{ shape: win-pane }
          master_report_table@{ shape: cyl }
          subgraph LatestAppleAccess [Latest Apple Access]
            fetch_latest_apple_data@{ shape: subproc }
            fetch_latest_apple_by_owner@{ shape: subproc }
          end
          style LatestAppleAccess stroke:#e31a1c
          subgraph LatestBroccoliAccess [Latest Broccoli Access]
            fetch_latest_broccoli_data@{ shape: subproc }
            fetch_latest_broccoli_by_owner@{ shape: subproc }
          end
          style LatestBroccoliAccess stroke:#33a02c
          subgraph ReportAccess [Report Access]
            fetch_apple_reports@{ shape: subproc }
            fetch_broccoli_reports@{ shape: subproc }
            fetch_loadable_reports@{ shape: subproc }
            fetch_notifiable_reports@{ shape: subproc }
            fetch_existing_reports@{ shape: subproc }
            fetch_owner_reports@{ shape: subproc }
            write_new_reports@{ shape: subproc }
            modify_existing_reports@{ shape: subproc }
          end
          style ReportAccess stroke:#1f78b4
        end
        %% subgraph CloudFunctions [Cloud Functions]
        %%   'FUNCTION_TBD'
        %% end
        subgraph GraphQLAdminAPI [GraphQL Admin API]
          engine_reports_load@{ shape: lean-r }
          engine_reports_audit@{ shape: lean-r }
          engine_reports_notify@{ shape: lean-r }
          engine_reports_delete@{ shape: lean-r }
        end
        subgraph GraphQLAPI [GraphQL API]
          app_reports@{ shape: lean-l }
          app_report_previews@{ shape: lean-l }
          member_reports@{ shape: lean-l }
          member_report_previews@{ shape: lean-l }
          app_report_accept@{ shape: lean-l }
          app_report_in_progress@{ shape: lean-l }
          app_report_dismiss@{ shape: lean-l }
        end
        %% subgraph AppleHistoricalAccess
        %%   'RRH_TBD'
        %% end
        %% subgraph BroccoliHistoricalAccess
        %%   'GRH_TBD'
        %% end
        %% subgraph Admin DatabaseAccessor
        %%   'ADMIN_TBD'
        %% end
        subgraph NoSQLStore [NoSQL Store]
            CoreObjectives@{ shape: cyl }
            NotificationLogs@{ shape: cyl }
        end
        subgraph ObjectStorage [Object Storage]
            blob_event_store@{ shape: docs }
        end
        subgraph NotificationProvider [Notification Provider]
            external_push_notifications{{external_push_notifications}}
        end
        subgraph ApplicationPortal [Application Portal]
          UserDashboardWidget@{ shape: curv-trap }
          AppleAssessmentReport@{ shape: curv-trap }
          style AppleAssessmentReport fill:#e31a1c,stroke:#fb9a99
          BroccoliOpportunityReport@{ shape: curv-trap }
          style BroccoliOpportunityReport fill:#33a02c,stroke:#b2df8a
        end
    end


    sync_warehouse_to_nosql====>|CA1:call|engine_reports_audit
    fetch_latest_apple_data--->|CA2A:fetch|engine_reports_audit
    fetch_existing_reports--->|CA2B:fetch|engine_reports_audit
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_existing_reports
    apple_metric_historical-...->|JOIN:notified_apple_historical|fetch_existing_reports
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_existing_reports
    broccoli_metric_historical-...->|JOIN:notified_broccoli_historical|fetch_existing_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_existing_reports
    basket_historical_data-..->|JOIN:notified_basket_historical|fetch_existing_reports
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_existing_reports
    coconut_historical_data-..->|JOIN:notified_coconut_historical|fetch_existing_reports
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_existing_reports
    papaya_historical_data-..->|JOIN:notified_papaya_historical|fetch_existing_reports
    engine_reports_audit====>|CA3:call|modify_existing_reports
    modify_existing_reports===>|CA4:update|master_report_table
    engine_reports_audit===>|CA5:UPDATE|blob_event_store
    linkStyle 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 stroke:#bebada

    sync_warehouse_to_nosql====>|CL1:call|engine_reports_load
    fetch_latest_apple_data--->|CL2A:fetch|engine_reports_load
    fetch_latest_broccoli_data--->|CL2B:fetch|engine_reports_load
    fetch_loadable_reports--->|CL2C:fetch|engine_reports_load
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_loadable_reports
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_loadable_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_loadable_reports
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_loadable_reports
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_loadable_reports
    write_new_reports====>|CL3:call|engine_reports_load
    write_new_reports===>|CL4:create|master_report_table
    linkStyle 16,17,18,19,20,21,22,23,24,25,26 stroke:#ffffb3

    sync_warehouse_to_nosql====>|CN1:call|engine_reports_notify
    fetch_notifiable_reports--->|CN2:fetch|engine_reports_notify
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_notifiable_reports
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_notifiable_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_notifiable_reports
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_notifiable_reports
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_notifiable_reports
    CoreObjectives--->|CN3:fetch|engine_reports_notify
    engine_reports_notify====>|CN3:call|modify_existing_reports
    modify_existing_reports===>|CN4:update|master_report_table
    engine_reports_notify--->|CN5:trigger|external_push_notifications
    engine_reports_notify====>|CN6:write|NotificationLogs
    engine_reports_notify===>|CN7:CREATE|blob_event_store
    linkStyle 27,28,29,30,31,32,33,34,35,36,37,38,39 stroke:#8dd3c7

    UserDashboardWidget====>|UR1A:?loaded|member_reports
    fetch_owner_reports--->|UR2A:fetch|member_reports
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_owner_reports
    apple_metric_historical-...->|JOIN:notified_apple_historical|fetch_owner_reports
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_owner_reports
    broccoli_metric_historical-...->|JOIN:notified_broccoli_historical|fetch_owner_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_owner_reports
    basket_historical_data-..->|JOIN:notified_basket_historical|fetch_owner_reports
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_owner_reports
    coconut_historical_data-..->|JOIN:notified_coconut_historical|fetch_owner_reports
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_owner_reports
    papaya_historical_data-..->|JOIN:notified_papaya_historical|fetch_owner_reports
    linkStyle 40,41,42,43,44,45,46,47,48,49,50,51 stroke:#fb8072

    UserDashboardWidget====>|UR1B:?preview|member_report_previews
    fetch_latest_apple_by_owner--->|UR2B1:fetch|member_report_previews
    fetch_latest_broccoli_by_owner--->|UR2B2:fetch|member_report_previews
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_latest_apple_by_owner
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_latest_apple_by_owner
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_latest_apple_by_owner
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_latest_broccoli_by_owner
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_latest_broccoli_by_owner
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_latest_broccoli_by_owner
    linkStyle 52,53,54,55,56,57,58,59,60 stroke:#80b1d3

    UserDashboardWidget====>|RCA1:accept|app_report_accept
    app_report_accept====>|RCA2:call|modify_existing_reports
    modify_existing_reports===>|RCA3:update|master_report_table
    linkStyle 61,62,63 stroke:#fdb462

    UserDashboardWidget====>|RCI1:in_progress|app_report_in_progress
    app_report_in_progress====>|RCI2:call|modify_existing_reports
    modify_existing_reports===>|RCI3:update|master_report_table
    linkStyle 64,65,66 stroke:#b3de69

    UserDashboardWidget====>|RCD1:dismiss|app_report_dismiss
    app_report_dismiss====>|RCD2:call|modify_existing_reports
    modify_existing_reports===>|RCD3:update|master_report_table
    linkStyle 67,68,69 stroke:#fccde5

    AppleAssessmentReport====>|RR1A:?loaded|app_reports
    fetch_apple_reports--->|RR2A:fetch|app_reports
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_apple_reports
    apple_metric_historical-...->|JOIN:notified_apple_historical|fetch_apple_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_apple_reports
    basket_historical_data-..->|JOIN:notified_basket_historical|fetch_apple_reports
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_apple_reports
    coconut_historical_data-..->|JOIN:notified_coconut_historical|fetch_apple_reports
    AppleAssessmentReport====>|RR1B:?preview|app_report_previews
    fetch_apple_reports--->|RR2B:fetch|app_reports
    apple_metric_historical-...->|JOIN:latest_apple_historical|fetch_apple_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_apple_reports
    coconut_historical_data-..->|JOIN:latest_coconut_historical|fetch_apple_reports
    linkStyle 70,71,72,73,74,75,76,77,78,79,80,81,82 stroke:#d9d9d9

    BroccoliOpportunityReport====>|GR1A:?loaded|app_reports
    fetch_broccoli_reports--->|GR2A:fetch|app_reports
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_broccoli_reports
    broccoli_metric_historical-...->|JOIN:notified_broccoli_historical|fetch_broccoli_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_broccoli_reports
    basket_historical_data-..->|JOIN:notified_basket_historical|fetch_broccoli_reports
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_broccoli_reports
    papaya_historical_data-..->|JOIN:notified_papaya_historical|fetch_broccoli_reports
    BroccoliOpportunityReport====>|GR1B:?preview|app_report_previews
    fetch_broccoli_reports--->|GR2B:fetch|app_reports
    broccoli_metric_historical-...->|JOIN:latest_broccoli_historical|fetch_broccoli_reports
    basket_historical_data-..->|JOIN:latest_basket_historical|fetch_broccoli_reports
    papaya_historical_data-..->|JOIN:latest_papaya_historical|fetch_broccoli_reports
    linkStyle 83,84,85,86,87,88,89,90,91,92,93,94,95 stroke:#bc80bd

Report Engine Pipeline Architecture

flowchart

system architecture detailing warehouse synchronization, batch data ingestion, api processing layers, and notification triggers.

%%{ init: { 'flowchart': {'defaultRenderer': 'elk' } } }%%
    flowchart TB
      subgraph Ingest
          CRM[Enterprise CRM]--->|Automated ELT|bqa[(Staging Layer)]
          ProductAnalytics[Product Analytics]--->|Automated ELT|bqa
          ExtWarehouse[External Data Partner]--->|Automated ELT|bqa
          SupportDesk[Support Desk Platform]--->|Automated ELT|bqa
          ObjectStorage[Raw Object Storage]--->|Automated ELT|bqa
      end
      bqa-->|normalize|bqp[(Normalized Inputs)]
      bqp-->|medallion ingest|mlc[ML Platform]
      mlc-->|model_retrain|mlc
      mlc-->|model_inference|mlc
      mlc-->|ML artifacts|bqc[(ML Outputs)]
      bqc-->|post-processing|bqp1[(Normalized Outputs)]
      subgraph Export
          bqp1-->|rETL Sync|dest_crm[Enterprise CRM]
          bqp1-->|rETL Sync|dest_cs[Customer Success Tool]
          bqp1-->|rETL Sync|dest_warehouse[External Data Partner]
      end

ML Ingestion & Reverse ETL

flowchart

architectural topology of a multi-source ingestion pipeline, data warehouse normalization loop, and reverse-etl sync.

graph TB
        %% Semantic Node Definitions
        Inspire([Coding Inspiration])
        WIP[WIP]
        PROpened[PR Opened]
        Draft{Draft PR?}
        Ready{Ready for Review?}
        MarkReady[Mark as Ready]
        Review{Code Review?}
        Reviewed{Reviewed?}
        Merge[Squashed & Merged]
        Staging[Staging Deploy]
        QA{QA?}
        Prod[Prod Deploy]
        Done([Done Done])

        %% Process Flow
        Inspire --> WIP
        WIP -->|Checkpoint| PROpened
        PROpened --> Draft
        WIP -->|Updates| Draft
        Draft -->|Yes| Ready
        Inspire -->|Hotfix| Review
        WIP -->|Addressing Feedback| Review
        Ready -->|Yes| MarkReady
        Ready -->|No| WIP
        MarkReady --> Review
        Draft -->|No| Review
        Review -->|Async| Reviewed
        Review -->|Sync| Reviewed
        Review -->|Upstream Changes| WIP
        Reviewed -->|Approved| Merge
        Reviewed -->|Suggested Changes| WIP
        Reviewed -->|Upstream Changes| WIP
        Merge -->|Passing CICD| Staging
        Merge -->|CICD Issues| Inspire
        Staging --> QA
        QA -->|Staging QA'd| Prod
        QA -->|Staging Issues| Inspire
        Prod --> QA
        QA -->|Prod QA'd| Done
        QA -->|Prod Issues| Inspire

        %% Color-Coding (Green=Streamlined, Yellow=Slow, Red=Breakage)
        linkStyle 0,1,2,4,5,7,8,9,10,14,17,19,22,23 stroke:#2ec4b6,stroke-width:1px;
        linkStyle 3,6,12,13,15,16 stroke:#ffb703,stroke-width:2px;
        linkStyle 11,18,20,21,24 stroke:#e63946,stroke-width:4px;

PR Review Lifecycle & Bottleneck Analysis

flowchart

visualizing pull request flow with node-based friction styling.

erDiagram
      TenantConfig ||--|{ PredictiveModel : has
      PredictiveModel ||--|{ ModelSegment : targets
      PredictiveModel ||--|{ ModelOutcome : targets
      ModelOutcome ||--|{ ModelFeature : targets
      PredictiveModel ||--o{ ModelOutput : produces
      ModelSegment ||--|{ Account : CHURN_APPLE
      ModelSegment ||--|{ Contract : DOWNGRADE_APPLE
      ModelSegment ||--|{ Product : EXPANSION_OPPORTUNITY
      Account ||--o{ Contract : has
      Account ||--o{ Product : has
      Contract ||--o{ Product : passthrough
      AppleReport ||--o{ Account : CRITICAL_CHURN
      AppleReport ||--o{ Account : PARTIAL_CHURN
      AppleReport ||--o{ Contract : REVENUE_AT_APPLE
      BroccoliReport ||--o{ Product : UPSELL_BROCCOLI
      Account ||--o{ ModelOutput : predictive_apple_score
      Account ||--o{ ModelOutput : predictive_broccoli_score

Predictive ML Model Lineage & Scoring Schema

erDiagram

relational database schema for tracking ml model configurations, feature targeting, and downstream scoring outputs.