Loading Lion artifact…
Inspect Lion Program Source (JSON)
[
  "begin",
  [
    "relation",
    "plan_cohort",
    [
      "id",
      "segment",
      "list_price",
      "monthly_orders",
      "uses_promo"
    ],
    {
      "certified": true,
      "description": "Active SaaS customer cohorts exposed to pricing discount policies",
      "key": [
        "id"
      ]
    }
  ],
  [
    "relation",
    "ctrl",
    [
      "k",
      "v"
    ],
    {
      "key": [
        "k"
      ]
    }
  ],
  [
    "fact",
    [
      "plan_cohort",
      "starter",
      "Starter Self-Serve",
      100,
      1800,
      true
    ],
    [
      "plan_cohort",
      "growth",
      "Growth Team",
      250,
      900,
      true
    ],
    [
      "plan_cohort",
      "business",
      "Business Annual",
      600,
      320,
      true
    ],
    [
      "plan_cohort",
      "enterprise",
      "Enterprise Custom",
      1500,
      95,
      false
    ],
    [
      "ctrl",
      "partner_pct",
      25
    ],
    [
      "ctrl",
      "promo_pct",
      20
    ],
    [
      "ctrl",
      "credit_usd",
      25
    ],
    [
      "ctrl",
      "cogs_usd",
      45
    ],
    [
      "ctrl",
      "mutex_cap",
      false
    ],
    [
      "ctrl",
      "selected",
      "starter"
    ]
  ],
  [
    "define",
    "view",
    [
      "lambda",
      [],
      [
        "begin",
        [
          "define",
          "partner_pct",
          [
            "array/head",
            [
              "find",
              "?v",
              [
                "ctrl",
                [
                  "quote",
                  "partner_pct"
                ],
                "?v"
              ]
            ]
          ]
        ],
        [
          "define",
          "promo_pct",
          [
            "array/head",
            [
              "find",
              "?v",
              [
                "ctrl",
                [
                  "quote",
                  "promo_pct"
                ],
                "?v"
              ]
            ]
          ]
        ],
        [
          "define",
          "credit_usd",
          [
            "array/head",
            [
              "find",
              "?v",
              [
                "ctrl",
                [
                  "quote",
                  "credit_usd"
                ],
                "?v"
              ]
            ]
          ]
        ],
        [
          "define",
          "cogs_usd",
          [
            "array/head",
            [
              "find",
              "?v",
              [
                "ctrl",
                [
                  "quote",
                  "cogs_usd"
                ],
                "?v"
              ]
            ]
          ]
        ],
        [
          "define",
          "mutex_cap",
          [
            "array/head",
            [
              "find",
              "?v",
              [
                "ctrl",
                [
                  "quote",
                  "mutex_cap"
                ],
                "?v"
              ]
            ]
          ]
        ],
        [
          "define",
          "sel",
          [
            "array/head",
            [
              "find",
              "?v",
              [
                "ctrl",
                "selected",
                "?v"
              ]
            ]
          ]
        ],
        [
          "define",
          "eff_pct",
          [
            "cond",
            [
              "mutex_cap",
              [
                "cond",
                [
                  [
                    "number/greaterThan",
                    "partner_pct",
                    "promo_pct"
                  ],
                  "partner_pct"
                ],
                [
                  "else",
                  "promo_pct"
                ]
              ]
            ],
            [
              "else",
              [
                "number/add",
                "partner_pct",
                "promo_pct"
              ]
            ]
          ]
        ],
        [
          "define",
          "keep_pct",
          [
            "number/subtract",
            100,
            "eff_pct"
          ]
        ],
        [
          "define",
          "smt_check",
          [
            "proof/smt",
            [
              "array/make",
              "and",
              [
                "quote",
                [
                  ">=",
                  "price",
                  100
                ]
              ],
              [
                "quote",
                [
                  "<=",
                  "price",
                  5000
                ]
              ],
              [
                "array/make",
                "=",
                "net100",
                [
                  "array/make",
                  "-",
                  [
                    "array/make",
                    "*",
                    "keep_pct",
                    "price"
                  ],
                  [
                    "number/multiply",
                    "credit_usd",
                    100
                  ]
                ]
              ],
              [
                "array/make",
                "<",
                "net100",
                [
                  "number/multiply",
                  "cogs_usd",
                  100
                ]
              ]
            ]
          ]
        ],
        [
          "define",
          "has_loophole",
          [
            "object/get",
            "smt_check",
            "satisfiable"
          ]
        ],
        [
          "define",
          "opt_safe_cap",
          [
            "proof/optimize",
            "max",
            "?d",
            [
              "and",
              [
                "schema/fits?",
                "?d",
                "value/integer?"
              ],
              [
                "number/greaterThanOrEqualTo",
                "?d",
                0
              ],
              [
                "number/lessThanOrEqualTo",
                "?d",
                100
              ],
              [
                "number/greaterThanOrEqualTo",
                [
                  "number/subtract",
                  [
                    "number/subtract",
                    100,
                    "?d"
                  ],
                  "credit_usd"
                ],
                "cogs_usd"
              ]
            ]
          ]
        ],
        [
          "define",
          "safe_cap_pct",
          [
            "object/get",
            "opt_safe_cap",
            "optimal"
          ]
        ],
        [
          "define",
          "min_net_starter",
          [
            "number/subtract",
            [
              "number/divide",
              [
                "number/multiply",
                "keep_pct",
                100
              ],
              100
            ],
            "credit_usd"
          ]
        ],
        [
          "define",
          "unit_gap",
          [
            "number/subtract",
            "cogs_usd",
            "min_net_starter"
          ]
        ],
        [
          "define",
          "annual_leak_k",
          [
            "cond",
            [
              [
                "number/greaterThan",
                "unit_gap",
                0
              ],
              [
                "number/round",
                [
                  "number/divide",
                  [
                    "number/multiply",
                    [
                      "number/multiply",
                      "unit_gap",
                      1800
                    ],
                    12
                  ],
                  1000
                ]
              ]
            ],
            [
              "else",
              0
            ]
          ]
        ],
        [
          "define",
          "cohort_rows",
          [
            "find",
            {
              "id": "?id",
              "list_price": "?p",
              "margin_usd": [
                "number/subtract",
                [
                  "cond",
                  [
                    "?up",
                    [
                      "number/subtract",
                      [
                        "number/divide",
                        [
                          "number/multiply",
                          "keep_pct",
                          "?p"
                        ],
                        100
                      ],
                      "credit_usd"
                    ]
                  ],
                  [
                    "else",
                    "?p"
                  ]
                ],
                "cogs_usd"
              ],
              "net_price": [
                "cond",
                [
                  "?up",
                  [
                    "number/subtract",
                    [
                      "number/divide",
                      [
                        "number/multiply",
                        "keep_pct",
                        "?p"
                      ],
                      100
                    ],
                    "credit_usd"
                  ]
                ],
                [
                  "else",
                  "?p"
                ]
              ],
              "orders_mo": "?ord",
              "segment": "?seg",
              "status": [
                "cond",
                [
                  [
                    "number/lessThan",
                    [
                      "cond",
                      [
                        "?up",
                        [
                          "number/subtract",
                          [
                            "number/divide",
                            [
                              "number/multiply",
                              "keep_pct",
                              "?p"
                            ],
                            100
                          ],
                          "credit_usd"
                        ]
                      ],
                      [
                        "else",
                        "?p"
                      ]
                    ],
                    "cogs_usd"
                  ],
                  "BLEEDING MARGIN"
                ],
                [
                  "else",
                  "PROFITABLE"
                ]
              ]
            },
            [
              "plan_cohort",
              "?id",
              "?seg",
              "?p",
              "?ord",
              "?up"
            ]
          ]
        ],
        [
          "define",
          "nodes",
          [
            "array/make",
            {
              "group": "input",
              "id": "cart",
              "label": "Any Cart ($100-$5k)",
              "subtitle": "unbounded price",
              "tone": "ok"
            },
            {
              "group": "rule",
              "id": "partner",
              "label": "Partner Tier",
              "subtitle": [
                "string/join",
                [
                  "array/make",
                  [
                    "number/toString",
                    "partner_pct"
                  ],
                  "% off"
                ],
                ""
              ],
              "tone": "accent"
            },
            {
              "group": "rule",
              "id": "promo",
              "label": "Campaign Promo",
              "subtitle": [
                "cond",
                [
                  "mutex_cap",
                  "blocked by mutex"
                ],
                [
                  "else",
                  [
                    "string/join",
                    [
                      "array/make",
                      [
                        "number/toString",
                        "promo_pct"
                      ],
                      "% stacked"
                    ],
                    ""
                  ]
                ]
              ],
              "tone": [
                "cond",
                [
                  "mutex_cap",
                  "ok"
                ],
                [
                  "else",
                  "warn"
                ]
              ]
            },
            {
              "group": "rule",
              "id": "credit",
              "label": "Loyalty Credit",
              "subtitle": [
                "string/join",
                [
                  "array/make",
                  "-$",
                  [
                    "number/toString",
                    "credit_usd"
                  ]
                ],
                ""
              ],
              "tone": "accent"
            },
            {
              "group": "gate",
              "id": "floor",
              "label": "COGS Floor Gate",
              "subtitle": [
                "string/join",
                [
                  "array/make",
                  "min $",
                  [
                    "number/toString",
                    "cogs_usd"
                  ]
                ],
                ""
              ],
              "tone": [
                "cond",
                [
                  "has_loophole",
                  "error"
                ],
                [
                  "else",
                  "ok"
                ]
              ]
            }
          ]
        ],
        [
          "define",
          "edges",
          [
            "array/make",
            {
              "from": "cart",
              "label": "applies",
              "to": "partner",
              "tone": "ok"
            },
            {
              "from": "partner",
              "label": [
                "cond",
                [
                  "mutex_cap",
                  "max-of-1"
                ],
                [
                  "else",
                  "stacks +"
                ]
              ],
              "to": "promo",
              "tone": [
                "cond",
                [
                  "mutex_cap",
                  "ok"
                ],
                [
                  "else",
                  "warn"
                ]
              ]
            },
            {
              "from": "promo",
              "label": "deducts",
              "to": "credit",
              "tone": "ok"
            },
            {
              "from": "credit",
              "label": [
                "cond",
                [
                  "has_loophole",
                  "BREACHES COGS"
                ],
                [
                  "else",
                  "proven >= COGS"
                ]
              ],
              "to": "floor",
              "tone": [
                "cond",
                [
                  "has_loophole",
                  "error"
                ],
                [
                  "else",
                  "ok"
                ]
              ]
            }
          ]
        ],
        [
          "ui/stack",
          {
            "gap": "lg"
          },
          [
            "ui/hero",
            {
              "badges": [
                "quote",
                [
                  {
                    "label": "Unbounded SMT Proof",
                    "tone": "accent"
                  },
                  {
                    "label": "Exact Arithmetic",
                    "tone": "ok"
                  },
                  {
                    "label": "Zero QA Blind Spots",
                    "tone": "ok"
                  }
                ]
              ],
              "eyebrow": "Lion-Only Proof 01 · Pricing & Revenue Protection",
              "subtitle": "Unit tests check 10 carts; customers exploit the 11th. Lion mathematically proves across every possible cart ($100-$5,000) whether stackable promos can ever sell below COGS — or synthesizes the exact money-losing cart live.",
              "title": "Autonomous Promo & Margin Guardrail Prover"
            }
          ],
          [
            "ui/grid",
            {
              "cols": 4,
              "gap": "md"
            },
            [
              "ui/metric",
              {
                "caption": [
                  "cond",
                  [
                    "has_loophole",
                    "Adversarial cart found by SMT"
                  ],
                  [
                    "else",
                    "Proven safe for all carts $100-$5k"
                  ]
                ],
                "label": "Universal Margin Proof",
                "tone": [
                  "cond",
                  [
                    "has_loophole",
                    "error"
                  ],
                  [
                    "else",
                    "ok"
                  ]
                ],
                "value": [
                  "cond",
                  [
                    "has_loophole",
                    "LOOPHOLE FOUND"
                  ],
                  [
                    "else",
                    "CERTIFIED SAFE"
                  ]
                ]
              }
            ],
            [
              "ui/metric",
              {
                "caption": "Worst-case net revenue on Starter ($100)",
                "label": "Worst-Case Net ($)",
                "tone": [
                  "cond",
                  [
                    "has_loophole",
                    "error"
                  ],
                  [
                    "else",
                    "ok"
                  ]
                ],
                "value": "min_net_starter"
              }
            ],
            [
              "ui/metric",
              {
                "caption": "Effective stacked discount rate",
                "label": "Combined Discount",
                "tone": [
                  "cond",
                  [
                    "mutex_cap",
                    "ok"
                  ],
                  [
                    "else",
                    "warn"
                  ]
                ],
                "value": [
                  "string/join",
                  [
                    "array/make",
                    [
                      "number/toString",
                      "eff_pct"
                    ],
                    "%"
                  ],
                  ""
                ]
              }
            ],
            [
              "ui/metric",
              {
                "caption": "Projected annual loss on Starter cohort",
                "label": "Annual Exposure ($k)",
                "tone": [
                  "cond",
                  [
                    "has_loophole",
                    "error"
                  ],
                  [
                    "else",
                    "ok"
                  ]
                ],
                "value": [
                  "string/join",
                  [
                    "array/make",
                    "$",
                    [
                      "number/toString",
                      "annual_leak_k"
                    ],
                    "k"
                  ],
                  ""
                ]
              }
            ]
          ],
          [
            "ui/section",
            {
              "badge": [
                "cond",
                [
                  "has_loophole",
                  "Revenue Leak Exposed"
                ],
                [
                  "else",
                  "Kernel-Verified Safe"
                ]
              ],
              "step": "01",
              "subtitle": "Adjust your live discount policy sliders or toggle the Mutual-Exclusion Cap. Lion re-runs its exact DPLL(T) solver in real time across every valid order price.",
              "title": "Live Pricing Rules & Counterfactual Guardrail",
              "tone": [
                "cond",
                [
                  "has_loophole",
                  "error"
                ],
                [
                  "else",
                  "ok"
                ]
              ]
            },
            [
              "ui/card",
              [
                "ui/stack",
                {
                  "gap": "md"
                },
                [
                  "ui/toggle",
                  {
                    "checked": "mutex_cap",
                    "label": "Enforce Mutual-Exclusion Policy: allow only the highest percentage discount (no Partner + Promo stacking)",
                    "onChange": [
                      "quote",
                      [
                        "fact",
                        [
                          "ctrl",
                          "mutex_cap",
                          "value"
                        ]
                      ]
                    ]
                  }
                ],
                [
                  "ui/grid",
                  {
                    "cols": 3,
                    "gap": "md"
                  },
                  [
                    "ui/slider",
                    {
                      "label": "Partner Tier Discount (%)",
                      "max": 45,
                      "min": 0,
                      "onChange": [
                        "quote",
                        [
                          "fact",
                          [
                            "ctrl",
                            "partner_pct",
                            "value"
                          ]
                        ]
                      ],
                      "step": 5,
                      "value": "partner_pct"
                    }
                  ],
                  [
                    "ui/slider",
                    {
                      "label": "Campaign Promo Discount (%)",
                      "max": 45,
                      "min": 0,
                      "onChange": [
                        "quote",
                        [
                          "fact",
                          [
                            "ctrl",
                            "promo_pct",
                            "value"
                          ]
                        ]
                      ],
                      "step": 5,
                      "value": "promo_pct"
                    }
                  ],
                  [
                    "ui/slider",
                    {
                      "label": "Stackable Loyalty Credit ($)",
                      "max": 60,
                      "min": 0,
                      "onChange": [
                        "quote",
                        [
                          "fact",
                          [
                            "ctrl",
                            "credit_usd",
                            "value"
                          ]
                        ]
                      ],
                      "step": 5,
                      "value": "credit_usd"
                    }
                  ]
                ]
              ]
            ],
            [
              "cond",
              [
                "has_loophole",
                [
                  "ui/alert",
                  {
                    "title": "Adversarial Margin Loophole Synthesized by SMT",
                    "tone": "error"
                  },
                  "Under current rules, a $100 Starter cart stacks discounts + credit down below your $45 COGS floor — exposing projected annual margin bleed. Flip the Mutual-Exclusion toggle above or lower discounts to get a kernel-verified proof."
                ]
              ],
              [
                "else",
                [
                  "ui/alert",
                  {
                    "title": "Mathematically Certified: Zero Margin Loopholes Across All Carts",
                    "tone": "ok"
                  },
                  "Lion's DPLL(T) solver proved UNSAT for net_revenue < COGS across every order from $100 to $5,000 — independently verified by proof/valid?."
                ]
              ]
            ],
            [
              "ui/graph",
              {
                "edges": "edges",
                "height": 220,
                "layout": "layered",
                "nodes": "nodes",
                "title": "Discount Stacking Pipeline -> COGS Margin Gate"
              }
            ]
          ],
          [
            "ui/section",
            {
              "step": "02",
              "subtitle": "See exact per-order unit economics across every live customer segment alongside the independently verified SMT certificate.",
              "title": "Cohort Unit Economics & Formal Certificate"
            },
            [
              "ui/split",
              {
                "gap": "md",
                "ratio": "3:2"
              },
              [
                "ui/table",
                {
                  "columns": [
                    "quote",
                    [
                      {
                        "key": "segment",
                        "label": "Customer Segment"
                      },
                      {
                        "key": "list_price",
                        "label": "List ($)"
                      },
                      {
                        "key": "net_price",
                        "label": "Worst Net ($)"
                      },
                      {
                        "key": "margin_usd",
                        "label": "Gross Margin ($)"
                      },
                      {
                        "key": "status",
                        "label": "Guardrail"
                      }
                    ]
                  ],
                  "onSelect": [
                    "quote",
                    [
                      "fact",
                      [
                        "ctrl",
                        "selected",
                        "value"
                      ]
                    ]
                  ],
                  "rowKey": "id",
                  "rows": "cohort_rows",
                  "selected": "sel",
                  "title": "Live Customer Cohort Exposure"
                }
              ],
              [
                "ui/stack",
                {
                  "gap": "md"
                },
                [
                  "ui/proof",
                  {
                    "summary": [
                      "cond",
                      [
                        "has_loophole",
                        "Solver synthesized a concrete cart violating net_price >= COGS — inspect the live SMT model values above."
                      ],
                      [
                        "else",
                        "Kernel-verified DPLL(T) UNSAT certificate proving NO cart in [$100, $5000] can breach the $45 COGS floor."
                      ]
                    ],
                    "title": "Unbounded Margin Proof (proof/smt)",
                    "valid": [
                      "cond",
                      [
                        "has_loophole",
                        false
                      ],
                      [
                        "else",
                        [
                          "proof/valid?",
                          [
                            "object/get",
                            "smt_check",
                            "proof"
                          ]
                        ]
                      ]
                    ]
                  },
                  "smt_check"
                ],
                [
                  "ui/proof",
                  {
                    "summary": [
                      "string/concat",
                      "Duality-certified maximum safe discount cap: ",
                      [
                        "number/toString",
                        "safe_cap_pct"
                      ],
                      "% at $",
                      [
                        "number/toString",
                        "credit_usd"
                      ],
                      " credit and $",
                      [
                        "number/toString",
                        "cogs_usd"
                      ],
                      " COGS floor."
                    ],
                    "title": "Optimal Safe Discount Cap (proof/optimize)",
                    "valid": [
                      "proof/valid?",
                      "opt_safe_cap"
                    ]
                  },
                  "opt_safe_cap"
                ]
              ]
            ]
          ]
        ]
      ]
    ],
    {
      "persist": true
    }
  ],
  [
    "view"
  ]
]