f8-engine 0.6.0__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {f8_engine-0.6.0 → f8_engine-0.6.2}/Cargo.lock +3 -3
- {f8_engine-0.6.0 → f8_engine-0.6.2}/Cargo.toml +1 -1
- {f8_engine-0.6.0 → f8_engine-0.6.2}/PKG-INFO +28 -23
- {f8_engine-0.6.0 → f8_engine-0.6.2}/README.md +27 -22
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/compiled/mod.rs +43 -41
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/compiled/model.rs +2 -2
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/emission/workbook.rs +11 -10
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/eval/model.rs +1 -1
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/graph/resolve.rs +1 -1
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/ir/expand.rs +9 -9
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/ir/symbol.rs +2 -2
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/layout/mod.rs +18 -15
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/table.rs +28 -8
- {f8_engine-0.6.0 → f8_engine-0.6.2}/pyproject.toml +18 -23
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/audit.py +4 -4
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/builder.py +11 -6
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/skills/f8-modeling/SKILL.md +1 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/skills/f8-modeling/references/auditing-and-repair.md +35 -35
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/skills/f8-modeling/references/functions.md +47 -47
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/skills/f8-modeling/references/syntax-and-grid.md +53 -53
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/types.py +2 -2
- {f8_engine-0.6.0 → f8_engine-0.6.2}/LICENSE +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/Cargo.toml +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/compiled/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/emission/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/emission/format.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/emission/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/eval/context.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/eval/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/eval/expr.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/eval/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/graph/cycle.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/graph/dependency.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/graph/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/graph/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/ir/cell.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/ir/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/ir/id.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/ir/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/layout/a1.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/layout/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/lowering/address.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/lowering/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/lowering/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/compiler/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/expr/ast.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/expr/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/expr/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/expr/parser.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/binder.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/common.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/date/constructors.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/date/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/date/parts.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/date/yearfrac.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/financial/annuity.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/financial/discounting.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/financial/irr.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/financial/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/information/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/logical/boolean.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/logical/branching.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/logical/error_handling.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/logical/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/lookup/index.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/lookup/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/lookup/search.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/lookup/xlookup.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/lookup/xmatch.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/math/aggregation.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/math/basic.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/math/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/math/product.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/math/rounding.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/registry.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/traits.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/functions/typecheck.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/lib.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/format.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/id.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/manifest.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/model/theme.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/value/date.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/value/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/value/format.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-core/src/value/mod.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-python/Cargo.toml +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-python/src/error.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-python/src/lib.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/crates/f8-python/src/model.rs +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/__init__.py +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/__main__.py +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/_core.pyi +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/cli.py +0 -0
- {f8_engine-0.6.0 → f8_engine-0.6.2}/python/f8/py.typed +0 -0
|
@@ -58,7 +58,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
|
58
58
|
|
|
59
59
|
[[package]]
|
|
60
60
|
name = "f8-core"
|
|
61
|
-
version = "0.6.
|
|
61
|
+
version = "0.6.2"
|
|
62
62
|
dependencies = [
|
|
63
63
|
"indexmap",
|
|
64
64
|
"petgraph",
|
|
@@ -71,7 +71,7 @@ dependencies = [
|
|
|
71
71
|
|
|
72
72
|
[[package]]
|
|
73
73
|
name = "f8-python"
|
|
74
|
-
version = "0.6.
|
|
74
|
+
version = "0.6.2"
|
|
75
75
|
dependencies = [
|
|
76
76
|
"f8-core",
|
|
77
77
|
"pyo3",
|
|
@@ -80,7 +80,7 @@ dependencies = [
|
|
|
80
80
|
|
|
81
81
|
[[package]]
|
|
82
82
|
name = "f8-wasm"
|
|
83
|
-
version = "0.6.
|
|
83
|
+
version = "0.6.2"
|
|
84
84
|
dependencies = [
|
|
85
85
|
"f8-core",
|
|
86
86
|
"rust_xlsxwriter",
|
|
@@ -3,7 +3,7 @@ resolver = "3"
|
|
|
3
3
|
members = ["crates/f8-core", "crates/f8-python"]
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.6.
|
|
6
|
+
version = "0.6.2"
|
|
7
7
|
edition = "2024"
|
|
8
8
|
description = "Financial modeling engine with compiler verification and live Excel formulas"
|
|
9
9
|
authors = ["Michael (Chencheng) Hu, CFA"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: f8-engine
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
@@ -124,40 +124,42 @@ compiled.save("forecast.xlsx")
|
|
|
124
124
|
### TypeScript
|
|
125
125
|
|
|
126
126
|
```typescript
|
|
127
|
-
import { Model } from "f8-engine"
|
|
127
|
+
import { Model } from "f8-engine"
|
|
128
128
|
|
|
129
|
-
const years = ["2025A", "2026E", "2027E"] as const
|
|
130
|
-
const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 }
|
|
131
|
-
const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 }
|
|
129
|
+
const years = ["2025A", "2026E", "2027E"] as const
|
|
130
|
+
const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 }
|
|
131
|
+
const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 }
|
|
132
132
|
|
|
133
|
-
const model = new Model({ name: "Operating Forecast" })
|
|
134
|
-
const sheet = model.addSheet("Summary")
|
|
133
|
+
const model = new Model({ name: "Operating Forecast" })
|
|
134
|
+
const sheet = model.addSheet("Summary")
|
|
135
135
|
|
|
136
|
-
const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", {
|
|
137
|
-
|
|
136
|
+
const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", {
|
|
137
|
+
subtitle: "($ in millions)",
|
|
138
|
+
})
|
|
139
|
+
ppe.addColumn("item", { role: "descriptor", header: "Line Item" })
|
|
138
140
|
for (const year of years) {
|
|
139
|
-
ppe.addColumn(year, { header: year, format: "currency", decimals: 1 })
|
|
141
|
+
ppe.addColumn(year, { header: year, format: "currency", decimals: 1 })
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
ppe.addRow("beg_balance", {
|
|
143
145
|
cells: { item: "Beginning Balance", "2025A": 100.0 },
|
|
144
146
|
expr: 'PPE["end_balance", col.prev]',
|
|
145
|
-
})
|
|
146
|
-
ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } })
|
|
147
|
-
ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } })
|
|
147
|
+
})
|
|
148
|
+
ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } })
|
|
149
|
+
ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } })
|
|
148
150
|
ppe.addRow("end_balance", {
|
|
149
151
|
cells: { item: "Ending Balance" },
|
|
150
152
|
expr: 'SUM(PPE["beg_balance".."depreciation", @col])',
|
|
151
153
|
style: "total",
|
|
152
|
-
})
|
|
154
|
+
})
|
|
153
155
|
|
|
154
|
-
const compiled = model.compile()
|
|
156
|
+
const compiled = model.compile()
|
|
155
157
|
|
|
156
158
|
// Audit evaluated values in memory (or pass { view: "formulas" } to inspect lowered Excel formulas)
|
|
157
|
-
console.log(compiled.table("PPE").toMarkdown())
|
|
159
|
+
console.log(compiled.table("PPE").toMarkdown())
|
|
158
160
|
|
|
159
161
|
// Emit a live .xlsx workbook with native Excel formulas and styling (you don't have to)
|
|
160
|
-
compiled.save("forecast.xlsx")
|
|
162
|
+
compiled.save("forecast.xlsx")
|
|
161
163
|
```
|
|
162
164
|
|
|
163
165
|
Output:
|
|
@@ -173,15 +175,18 @@ Output:
|
|
|
173
175
|
|
|
174
176
|
## Sample deliverables
|
|
175
177
|
|
|
176
|
-
|
|
178
|
+
### Autonomous Costco equity research
|
|
179
|
+
|
|
180
|
+
Built in a 4-hour, ~$70 autonomous multi-agent run across 50 SEC and macro sources with zero human intervention:
|
|
177
181
|
|
|
178
|
-
- [costco
|
|
179
|
-
- [
|
|
180
|
-
- [
|
|
182
|
+
- Model repo (TypeScript): [mhcfa/faac](https://github.com/mhcfa/faac) ([`public-equity/costco`](https://github.com/mhcfa/faac/tree/main/public-equity/costco))
|
|
183
|
+
- Write-up: [Running an Autonomous Agent on Costco Equity Research: Why It Called a Short](https://mhcfa.github.io/blog/autonomous-costco-equity-research/)
|
|
184
|
+
- Excel model: [costco-valuation.xlsx](https://github.com/mhcfa/f8/releases/latest/download/costco-valuation.xlsx) (9 sheets, 35 tables, 6,500 cells, 4,228 live Excel formulas across 3-statement, DCF, and trading comps)
|
|
185
|
+
- Valuation deck: [costco-equity-valuation.pdf](https://github.com/mhcfa/f8/releases/latest/download/costco-equity-valuation.pdf) (21 slides bound directly to the compiled `f8` model with no copy-paste)
|
|
181
186
|
|
|
182
|
-
### LBO model
|
|
187
|
+
### LBO model preview
|
|
183
188
|
|
|
184
|
-
|
|
189
|
+
- Excel model: [lbo_model.xlsx](https://github.com/mhcfa/f8/releases/latest/download/lbo_model.xlsx) (multi-sheet LBO workbook with transaction structuring, debt waterfall, and returns analysis)
|
|
185
190
|
|
|
186
191
|

|
|
187
192
|
|
|
@@ -98,40 +98,42 @@ compiled.save("forecast.xlsx")
|
|
|
98
98
|
### TypeScript
|
|
99
99
|
|
|
100
100
|
```typescript
|
|
101
|
-
import { Model } from "f8-engine"
|
|
101
|
+
import { Model } from "f8-engine"
|
|
102
102
|
|
|
103
|
-
const years = ["2025A", "2026E", "2027E"] as const
|
|
104
|
-
const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 }
|
|
105
|
-
const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 }
|
|
103
|
+
const years = ["2025A", "2026E", "2027E"] as const
|
|
104
|
+
const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 }
|
|
105
|
+
const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 }
|
|
106
106
|
|
|
107
|
-
const model = new Model({ name: "Operating Forecast" })
|
|
108
|
-
const sheet = model.addSheet("Summary")
|
|
107
|
+
const model = new Model({ name: "Operating Forecast" })
|
|
108
|
+
const sheet = model.addSheet("Summary")
|
|
109
109
|
|
|
110
|
-
const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", {
|
|
111
|
-
|
|
110
|
+
const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", {
|
|
111
|
+
subtitle: "($ in millions)",
|
|
112
|
+
})
|
|
113
|
+
ppe.addColumn("item", { role: "descriptor", header: "Line Item" })
|
|
112
114
|
for (const year of years) {
|
|
113
|
-
ppe.addColumn(year, { header: year, format: "currency", decimals: 1 })
|
|
115
|
+
ppe.addColumn(year, { header: year, format: "currency", decimals: 1 })
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
ppe.addRow("beg_balance", {
|
|
117
119
|
cells: { item: "Beginning Balance", "2025A": 100.0 },
|
|
118
120
|
expr: 'PPE["end_balance", col.prev]',
|
|
119
|
-
})
|
|
120
|
-
ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } })
|
|
121
|
-
ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } })
|
|
121
|
+
})
|
|
122
|
+
ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } })
|
|
123
|
+
ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } })
|
|
122
124
|
ppe.addRow("end_balance", {
|
|
123
125
|
cells: { item: "Ending Balance" },
|
|
124
126
|
expr: 'SUM(PPE["beg_balance".."depreciation", @col])',
|
|
125
127
|
style: "total",
|
|
126
|
-
})
|
|
128
|
+
})
|
|
127
129
|
|
|
128
|
-
const compiled = model.compile()
|
|
130
|
+
const compiled = model.compile()
|
|
129
131
|
|
|
130
132
|
// Audit evaluated values in memory (or pass { view: "formulas" } to inspect lowered Excel formulas)
|
|
131
|
-
console.log(compiled.table("PPE").toMarkdown())
|
|
133
|
+
console.log(compiled.table("PPE").toMarkdown())
|
|
132
134
|
|
|
133
135
|
// Emit a live .xlsx workbook with native Excel formulas and styling (you don't have to)
|
|
134
|
-
compiled.save("forecast.xlsx")
|
|
136
|
+
compiled.save("forecast.xlsx")
|
|
135
137
|
```
|
|
136
138
|
|
|
137
139
|
Output:
|
|
@@ -147,15 +149,18 @@ Output:
|
|
|
147
149
|
|
|
148
150
|
## Sample deliverables
|
|
149
151
|
|
|
150
|
-
|
|
152
|
+
### Autonomous Costco equity research
|
|
153
|
+
|
|
154
|
+
Built in a 4-hour, ~$70 autonomous multi-agent run across 50 SEC and macro sources with zero human intervention:
|
|
151
155
|
|
|
152
|
-
- [costco
|
|
153
|
-
- [
|
|
154
|
-
- [
|
|
156
|
+
- Model repo (TypeScript): [mhcfa/faac](https://github.com/mhcfa/faac) ([`public-equity/costco`](https://github.com/mhcfa/faac/tree/main/public-equity/costco))
|
|
157
|
+
- Write-up: [Running an Autonomous Agent on Costco Equity Research: Why It Called a Short](https://mhcfa.github.io/blog/autonomous-costco-equity-research/)
|
|
158
|
+
- Excel model: [costco-valuation.xlsx](https://github.com/mhcfa/f8/releases/latest/download/costco-valuation.xlsx) (9 sheets, 35 tables, 6,500 cells, 4,228 live Excel formulas across 3-statement, DCF, and trading comps)
|
|
159
|
+
- Valuation deck: [costco-equity-valuation.pdf](https://github.com/mhcfa/f8/releases/latest/download/costco-equity-valuation.pdf) (21 slides bound directly to the compiled `f8` model with no copy-paste)
|
|
155
160
|
|
|
156
|
-
### LBO model
|
|
161
|
+
### LBO model preview
|
|
157
162
|
|
|
158
|
-
|
|
163
|
+
- Excel model: [lbo_model.xlsx](https://github.com/mhcfa/f8/releases/latest/download/lbo_model.xlsx) (multi-sheet LBO workbook with transaction structuring, debt waterfall, and returns analysis)
|
|
159
164
|
|
|
160
165
|

|
|
161
166
|
|
|
@@ -434,7 +434,7 @@ impl CompiledModel {
|
|
|
434
434
|
Ok(TableInspection {
|
|
435
435
|
table_id: table.clone(),
|
|
436
436
|
title: table_spec.title.clone(),
|
|
437
|
-
|
|
437
|
+
subtitles: table_spec.subtitles.clone(),
|
|
438
438
|
sheet,
|
|
439
439
|
columns,
|
|
440
440
|
rows,
|
|
@@ -553,46 +553,48 @@ impl CompiledModel {
|
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
-
// 2. Subtitle
|
|
557
|
-
if let
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
556
|
+
// 2. Subtitle Banners
|
|
557
|
+
if let Some((subtitle_start_row, _)) = placement.subtitle_row_range {
|
|
558
|
+
for (idx, subtitle) in table.subtitles.iter().enumerate() {
|
|
559
|
+
let subtitle_row = subtitle_start_row + idx as u32;
|
|
560
|
+
for col in placement.start_col..=placement.end_col {
|
|
561
|
+
let physical_a1 = coordinate_to_a1(col, subtitle_row)
|
|
562
|
+
.unwrap_or_else(|_| format!("R{subtitle_row}C{col}"));
|
|
563
|
+
if col == placement.start_col {
|
|
564
|
+
cells_map.insert(
|
|
565
|
+
(subtitle_row, col),
|
|
566
|
+
SheetCellInspection {
|
|
567
|
+
physical_col: col,
|
|
568
|
+
physical_a1,
|
|
569
|
+
table_id: Some(table.id.clone()),
|
|
570
|
+
row_id: None,
|
|
571
|
+
col_id: None,
|
|
572
|
+
kind: SheetCellKind::TableSubtitle,
|
|
573
|
+
is_descriptor: false,
|
|
574
|
+
value: CellValue::Text(subtitle.clone()),
|
|
575
|
+
formatted_value: Some(subtitle.clone()),
|
|
576
|
+
formula_expr: None,
|
|
577
|
+
excel_formula: None,
|
|
578
|
+
},
|
|
579
|
+
);
|
|
580
|
+
} else {
|
|
581
|
+
cells_map.insert(
|
|
582
|
+
(subtitle_row, col),
|
|
583
|
+
SheetCellInspection {
|
|
584
|
+
physical_col: col,
|
|
585
|
+
physical_a1,
|
|
586
|
+
table_id: Some(table.id.clone()),
|
|
587
|
+
row_id: None,
|
|
588
|
+
col_id: None,
|
|
589
|
+
kind: SheetCellKind::TableSubtitle,
|
|
590
|
+
is_descriptor: false,
|
|
591
|
+
value: CellValue::Empty,
|
|
592
|
+
formatted_value: None,
|
|
593
|
+
formula_expr: None,
|
|
594
|
+
excel_formula: None,
|
|
595
|
+
},
|
|
596
|
+
);
|
|
597
|
+
}
|
|
596
598
|
}
|
|
597
599
|
}
|
|
598
600
|
}
|
|
@@ -119,8 +119,8 @@ pub struct TableInspection {
|
|
|
119
119
|
pub table_id: TableId,
|
|
120
120
|
/// Table display title.
|
|
121
121
|
pub title: String,
|
|
122
|
-
/// Table display subtitle
|
|
123
|
-
pub
|
|
122
|
+
/// Table display subtitle lines.
|
|
123
|
+
pub subtitles: Vec<String>,
|
|
124
124
|
/// Worksheet containing this table.
|
|
125
125
|
pub sheet: SheetId,
|
|
126
126
|
/// Declared columns with header label tiers.
|
|
@@ -203,16 +203,17 @@ impl WorkbookEmitter {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
// Table Subtitle
|
|
207
|
-
if let
|
|
208
|
-
(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
206
|
+
// Table Subtitle Banners
|
|
207
|
+
if let Some((subtitle_start_row, _)) = placement.subtitle_row_range {
|
|
208
|
+
for (idx, subtitle) in table.subtitles.iter().enumerate() {
|
|
209
|
+
let subtitle_row = subtitle_start_row + idx as u32;
|
|
210
|
+
worksheet.write_string_with_format(
|
|
211
|
+
subtitle_row,
|
|
212
|
+
excel_col_u16(placement.start_col)?,
|
|
213
|
+
subtitle,
|
|
214
|
+
&format_cache.subtitle_format(),
|
|
215
|
+
)?;
|
|
216
|
+
}
|
|
216
217
|
}
|
|
217
218
|
|
|
218
219
|
// Multi-Tier Column Headers
|
|
@@ -625,7 +625,7 @@ mod tests {
|
|
|
625
625
|
let target_table = TableSpec {
|
|
626
626
|
id: TableId::from("Target"),
|
|
627
627
|
title: "Target".into(),
|
|
628
|
-
|
|
628
|
+
subtitles: Vec::new(),
|
|
629
629
|
currency: None,
|
|
630
630
|
collapsible: false,
|
|
631
631
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -485,7 +485,7 @@ mod tests {
|
|
|
485
485
|
let table = TableSpec {
|
|
486
486
|
id: TableId::new("Assumptions"),
|
|
487
487
|
title: "Model Assumptions".to_string(),
|
|
488
|
-
|
|
488
|
+
subtitles: Vec::new(),
|
|
489
489
|
currency: None,
|
|
490
490
|
collapsible: false,
|
|
491
491
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -556,7 +556,7 @@ mod tests {
|
|
|
556
556
|
let table = TableSpec {
|
|
557
557
|
id: TableId::new("Unregistered"),
|
|
558
558
|
title: "Unregistered Table".to_string(),
|
|
559
|
-
|
|
559
|
+
subtitles: Vec::new(),
|
|
560
560
|
currency: None,
|
|
561
561
|
collapsible: false,
|
|
562
562
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -576,7 +576,7 @@ mod tests {
|
|
|
576
576
|
let table = TableSpec {
|
|
577
577
|
id: TableId::new("BadExpr"),
|
|
578
578
|
title: "Bad Expr Table".to_string(),
|
|
579
|
-
|
|
579
|
+
subtitles: Vec::new(),
|
|
580
580
|
currency: None,
|
|
581
581
|
collapsible: false,
|
|
582
582
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -594,7 +594,7 @@ mod tests {
|
|
|
594
594
|
let table = TableSpec {
|
|
595
595
|
id: TableId::new("T1"),
|
|
596
596
|
title: "Table 1".to_string(),
|
|
597
|
-
|
|
597
|
+
subtitles: Vec::new(),
|
|
598
598
|
currency: None,
|
|
599
599
|
collapsible: false,
|
|
600
600
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -616,7 +616,7 @@ mod tests {
|
|
|
616
616
|
let table = TableSpec {
|
|
617
617
|
id: TableId::new("ConflictTable"),
|
|
618
618
|
title: "Conflict Table".to_string(),
|
|
619
|
-
|
|
619
|
+
subtitles: Vec::new(),
|
|
620
620
|
currency: None,
|
|
621
621
|
collapsible: false,
|
|
622
622
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -643,7 +643,7 @@ mod tests {
|
|
|
643
643
|
let table = TableSpec {
|
|
644
644
|
id: TableId::new("ConflictResolved"),
|
|
645
645
|
title: "Resolved Table".to_string(),
|
|
646
|
-
|
|
646
|
+
subtitles: Vec::new(),
|
|
647
647
|
currency: None,
|
|
648
648
|
collapsible: false,
|
|
649
649
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -665,7 +665,7 @@ mod tests {
|
|
|
665
665
|
let table = TableSpec {
|
|
666
666
|
id: TableId::new("UnassignedTable"),
|
|
667
667
|
title: "Unassigned Table".to_string(),
|
|
668
|
-
|
|
668
|
+
subtitles: Vec::new(),
|
|
669
669
|
currency: None,
|
|
670
670
|
collapsible: false,
|
|
671
671
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -689,7 +689,7 @@ mod tests {
|
|
|
689
689
|
let table = TableSpec {
|
|
690
690
|
id: TableId::new("FmtConflict"),
|
|
691
691
|
title: "Format Conflict Table".to_string(),
|
|
692
|
-
|
|
692
|
+
subtitles: Vec::new(),
|
|
693
693
|
currency: None,
|
|
694
694
|
collapsible: false,
|
|
695
695
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -730,7 +730,7 @@ mod tests {
|
|
|
730
730
|
let table = TableSpec {
|
|
731
731
|
id: TableId::new("FmtResolved"),
|
|
732
732
|
title: "Format Resolved Table".to_string(),
|
|
733
|
-
|
|
733
|
+
subtitles: Vec::new(),
|
|
734
734
|
currency: None,
|
|
735
735
|
collapsible: false,
|
|
736
736
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -258,7 +258,7 @@ mod tests {
|
|
|
258
258
|
let table = TableSpec {
|
|
259
259
|
id: TableId::new("IncomeStatement"),
|
|
260
260
|
title: "Income Statement".to_string(),
|
|
261
|
-
|
|
261
|
+
subtitles: Vec::new(),
|
|
262
262
|
currency: None,
|
|
263
263
|
collapsible: false,
|
|
264
264
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -314,7 +314,7 @@ mod tests {
|
|
|
314
314
|
let table = TableSpec {
|
|
315
315
|
id: TableId::new("T"),
|
|
316
316
|
title: "Structural Slots".to_string(),
|
|
317
|
-
|
|
317
|
+
subtitles: Vec::new(),
|
|
318
318
|
currency: None,
|
|
319
319
|
collapsible: false,
|
|
320
320
|
placement: crate::model::table::PlacementSpec::default(),
|
|
@@ -90,8 +90,8 @@ pub struct TablePlacement {
|
|
|
90
90
|
pub end_row: u32,
|
|
91
91
|
/// Physical row index of the table title banner if present.
|
|
92
92
|
pub title_row: Option<u32>,
|
|
93
|
-
///
|
|
94
|
-
pub
|
|
93
|
+
/// Inclusive physical row range of table subtitle banners, or None if the table has zero subtitles.
|
|
94
|
+
pub subtitle_row_range: Option<(u32, u32)>,
|
|
95
95
|
/// Physical row index of the blank buffer gutter below title/subtitle if present.
|
|
96
96
|
pub title_gutter_row: Option<u32>,
|
|
97
97
|
/// Inclusive physical row range of header tiers, or None if the table has zero headers.
|
|
@@ -296,24 +296,27 @@ impl LayoutPlanner {
|
|
|
296
296
|
None
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
-
// Table Subtitle
|
|
300
|
-
let
|
|
301
|
-
let
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
299
|
+
// Table Subtitle Rows
|
|
300
|
+
let subtitle_row_range = if !table.subtitles.is_empty() {
|
|
301
|
+
let subtitle_start = current_row;
|
|
302
|
+
for _ in &table.subtitles {
|
|
303
|
+
if current_row >= MAX_EXCEL_ROWS {
|
|
304
|
+
return Err(LayoutError::GridLimitExceeded {
|
|
305
|
+
dimension: "rows",
|
|
306
|
+
max: MAX_EXCEL_ROWS,
|
|
307
|
+
actual: current_row,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
current_row += 1;
|
|
308
311
|
}
|
|
309
|
-
current_row
|
|
310
|
-
Some(
|
|
312
|
+
let subtitle_end = current_row - 1;
|
|
313
|
+
Some((subtitle_start, subtitle_end))
|
|
311
314
|
} else {
|
|
312
315
|
None
|
|
313
316
|
};
|
|
314
317
|
|
|
315
318
|
// Title Buffer Gutter
|
|
316
|
-
let title_gutter_row = if title_row.is_some() ||
|
|
319
|
+
let title_gutter_row = if title_row.is_some() || subtitle_row_range.is_some() {
|
|
317
320
|
let r = current_row;
|
|
318
321
|
if r >= MAX_EXCEL_ROWS {
|
|
319
322
|
return Err(LayoutError::GridLimitExceeded {
|
|
@@ -458,7 +461,7 @@ impl LayoutPlanner {
|
|
|
458
461
|
end_col,
|
|
459
462
|
end_row: table_end_row,
|
|
460
463
|
title_row,
|
|
461
|
-
|
|
464
|
+
subtitle_row_range,
|
|
462
465
|
title_gutter_row,
|
|
463
466
|
header_row_range,
|
|
464
467
|
body_row_range: (body_start_row, body_end_row),
|
|
@@ -443,11 +443,24 @@ impl Serialize for ValueLiteral {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
+
fn deserialize_optional_value_literal<'de, D>(
|
|
447
|
+
deserializer: D,
|
|
448
|
+
) -> Result<Option<ValueLiteral>, D::Error>
|
|
449
|
+
where
|
|
450
|
+
D: serde::Deserializer<'de>,
|
|
451
|
+
{
|
|
452
|
+
ValueLiteral::deserialize(deserializer).map(Some)
|
|
453
|
+
}
|
|
454
|
+
|
|
446
455
|
/// Detailed cell override containing optional value, formula expression, formatting, note, or provenance.
|
|
447
456
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
|
|
448
457
|
#[serde(deny_unknown_fields)]
|
|
449
458
|
pub struct DetailedCellInput {
|
|
450
|
-
#[serde(
|
|
459
|
+
#[serde(
|
|
460
|
+
default,
|
|
461
|
+
deserialize_with = "deserialize_optional_value_literal",
|
|
462
|
+
skip_serializing_if = "Option::is_none"
|
|
463
|
+
)]
|
|
451
464
|
pub value: Option<ValueLiteral>,
|
|
452
465
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
|
453
466
|
pub expr: Option<String>,
|
|
@@ -988,8 +1001,8 @@ impl PlacementSpec {
|
|
|
988
1001
|
pub struct TableSpec {
|
|
989
1002
|
pub id: TableId,
|
|
990
1003
|
pub title: String,
|
|
991
|
-
#[serde(default, skip_serializing_if = "
|
|
992
|
-
pub
|
|
1004
|
+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
|
1005
|
+
pub subtitles: Vec<String>,
|
|
993
1006
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
|
994
1007
|
pub currency: Option<CurrencyCode>,
|
|
995
1008
|
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
|
@@ -1006,7 +1019,7 @@ impl TableSpec {
|
|
|
1006
1019
|
Self {
|
|
1007
1020
|
id: id.into(),
|
|
1008
1021
|
title: title.into(),
|
|
1009
|
-
|
|
1022
|
+
subtitles: Vec::new(),
|
|
1010
1023
|
currency: None,
|
|
1011
1024
|
collapsible: false,
|
|
1012
1025
|
placement: PlacementSpec::default(),
|
|
@@ -1017,7 +1030,16 @@ impl TableSpec {
|
|
|
1017
1030
|
|
|
1018
1031
|
/// Builder method attaching a subtitle banner.
|
|
1019
1032
|
pub fn with_subtitle(mut self, subtitle: impl Into<String>) -> Self {
|
|
1020
|
-
self.
|
|
1033
|
+
self.subtitles.push(subtitle.into());
|
|
1034
|
+
self
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/// Builder method attaching multi-row subtitle banners.
|
|
1038
|
+
pub fn with_subtitles(
|
|
1039
|
+
mut self,
|
|
1040
|
+
subtitles: impl IntoIterator<Item = impl Into<String>>,
|
|
1041
|
+
) -> Self {
|
|
1042
|
+
self.subtitles = subtitles.into_iter().map(Into::into).collect();
|
|
1021
1043
|
self
|
|
1022
1044
|
}
|
|
1023
1045
|
|
|
@@ -1082,9 +1104,7 @@ impl TableSpec {
|
|
|
1082
1104
|
table: self.id.clone(),
|
|
1083
1105
|
});
|
|
1084
1106
|
}
|
|
1085
|
-
if
|
|
1086
|
-
&& subtitle.trim().is_empty()
|
|
1087
|
-
{
|
|
1107
|
+
if self.subtitles.iter().any(|s| s.trim().is_empty()) {
|
|
1088
1108
|
return Err(ModelError::EmptyTableSubtitle {
|
|
1089
1109
|
table: self.id.clone(),
|
|
1090
1110
|
});
|