@uwmd/core 1.3.0 → 1.6.0

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.
Files changed (63) hide show
  1. package/dist/browser.d.ts +14 -6
  2. package/dist/browser.d.ts.map +1 -1
  3. package/dist/browser.js +8 -4
  4. package/dist/browser.js.map +1 -1
  5. package/dist/capital-stack.d.ts +116 -0
  6. package/dist/capital-stack.d.ts.map +1 -0
  7. package/dist/capital-stack.js +227 -0
  8. package/dist/capital-stack.js.map +1 -0
  9. package/dist/cascade.d.ts +60 -6
  10. package/dist/cascade.d.ts.map +1 -1
  11. package/dist/cascade.js +93 -14
  12. package/dist/cascade.js.map +1 -1
  13. package/dist/cli.js +269 -11
  14. package/dist/cli.js.map +1 -1
  15. package/dist/composition.d.ts +182 -0
  16. package/dist/composition.d.ts.map +1 -0
  17. package/dist/composition.js +536 -0
  18. package/dist/composition.js.map +1 -0
  19. package/dist/context.js +23 -23
  20. package/dist/defaults.d.ts +18 -0
  21. package/dist/defaults.d.ts.map +1 -1
  22. package/dist/defaults.js +64 -0
  23. package/dist/defaults.js.map +1 -1
  24. package/dist/index.d.ts +14 -6
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +8 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/lite-bridge.d.ts +9 -0
  29. package/dist/lite-bridge.d.ts.map +1 -1
  30. package/dist/lite-bridge.js +44 -5
  31. package/dist/lite-bridge.js.map +1 -1
  32. package/dist/lite.js +37 -1
  33. package/dist/lite.js.map +1 -1
  34. package/dist/market-data.d.ts +134 -0
  35. package/dist/market-data.d.ts.map +1 -0
  36. package/dist/market-data.js +292 -0
  37. package/dist/market-data.js.map +1 -0
  38. package/dist/packs/index.d.ts +1 -0
  39. package/dist/packs/index.d.ts.map +1 -1
  40. package/dist/packs/index.js +3 -0
  41. package/dist/packs/index.js.map +1 -1
  42. package/dist/packs/mixed-use.d.ts +3 -0
  43. package/dist/packs/mixed-use.d.ts.map +1 -0
  44. package/dist/packs/mixed-use.js +204 -0
  45. package/dist/packs/mixed-use.js.map +1 -0
  46. package/dist/protocol.d.ts +57 -8
  47. package/dist/protocol.d.ts.map +1 -1
  48. package/dist/protocol.js +153 -4
  49. package/dist/protocol.js.map +1 -1
  50. package/dist/receipts.d.ts +189 -9
  51. package/dist/receipts.d.ts.map +1 -1
  52. package/dist/receipts.js +373 -14
  53. package/dist/receipts.js.map +1 -1
  54. package/dist/report.js +165 -165
  55. package/dist/types.d.ts +54 -1
  56. package/dist/types.d.ts.map +1 -1
  57. package/dist/types.js.map +1 -1
  58. package/dist/validator.d.ts.map +1 -1
  59. package/dist/validator.js +263 -6
  60. package/dist/validator.js.map +1 -1
  61. package/dist/version.d.ts +1 -1
  62. package/dist/version.js +1 -1
  63. package/package.json +1 -1
@@ -0,0 +1,204 @@
1
+ // Canonical mixed-use calc pack.
2
+ //
3
+ // A mixed-use property is two or more uses under one purchase price and one
4
+ // loan — apartments over ground-floor retail, an office podium under a hotel.
5
+ // No single income model or denominator describes it, so this pack does NOT try
6
+ // to treat the property as one homogeneous building. It reads the per-use
7
+ // subtotals stated in the `components` section (UW_FORMAT_SPEC §4.23, RFC 0019)
8
+ // and computes:
9
+ //
10
+ // 1. Property-level metrics that are legitimately single-figure — cap rate,
11
+ // LTV, DSCR, debt yield, cash-on-cash. One NOI, one price, one loan.
12
+ // 2. A NOI share per component. Pure, allocation-free, always meaningful.
13
+ // 3. Use-level intensive metrics (price per unit / psf / bed) that require
14
+ // splitting the single purchase price across uses. That split is
15
+ // `allocation_pct`, a user-supplied input. When allocation is absent the
16
+ // formula multiplies by a null and the metric evaluates to null — never a
17
+ // silent area- or income-share guess (RFC 0019 §4).
18
+ // 4. Operating-business intermediates surfaced per component — a hotel's
19
+ // `gross_operating_profit`, a senior facility's `total_labor_expense`.
20
+ // These sit at different points in their respective waterfalls, so they are
21
+ // passed through per use, never blended into one property number (§3a).
22
+ //
23
+ // DELIBERATE OMISSIONS, in the spirit of the land pack. There is NO property
24
+ // `price_per_unit` or `loan_per_unit`: units are a residential denominator and a
25
+ // mixed-use property is not all residential — dividing the whole price by the
26
+ // apartment count is the exact "number that looks like a metric" this design
27
+ // exists to eliminate. There is NO blended market cap rate: a weighted average
28
+ // of component market caps reads as an observable rate and is not one. The going-
29
+ // in `cap_rate` here is the property's own NOI over its own price — an arithmetic
30
+ // fact about this deal, not a market-implied blend. `mixed-use.test.ts` pins
31
+ // these omissions so a future contributor cannot add them back by pattern-
32
+ // matching the other packs.
33
+ //
34
+ // Component fields are addressed by static path (`components.retail.net_operating_income`),
35
+ // which is all the Tier-3 calc engine can express — see RFC 0019 §1. Every
36
+ // admissible component class (all nine income classes except land) gets its own
37
+ // NOI-share metric; a class simply not present in a given deal evaluates to null.
38
+ export const MIXED_USE_PACK = {
39
+ manifest_version: '1',
40
+ id: 'org.uwmd.pack.mixed_use',
41
+ name: 'Mixed-Use Starter Pack',
42
+ version: '1.0.0',
43
+ description: 'Derived metrics for mixed-use underwriting: property-level cap rate, LTV, DSCR, debt yield, and cash-on-cash; a NOI share per component use; allocation-gated price per unit / psf / bed; and per-component operating-business intermediates (GOP, labor). Deliberately omits property price/unit, loan/unit, and any blended market cap rate.',
44
+ authors: ['UW Markdown Working Group'],
45
+ license: 'MIT',
46
+ requires_protocol: '^1.0.0',
47
+ requires_format: '^1.1.0',
48
+ requires_tier: 'tier-3-calc-host',
49
+ asset_classes: ['mixed_use'],
50
+ calculations: [
51
+ // ── Property-level (one NOI, one price, one loan) ──────────────────────
52
+ {
53
+ id: 'cap_rate',
54
+ label: 'Cap Rate (going-in)',
55
+ formula: 'noi_model.net_operating_income / valuation.purchase_price',
56
+ unit: '%',
57
+ deterministic: true,
58
+ },
59
+ {
60
+ id: 'ltv',
61
+ label: 'LTV',
62
+ formula: 'debt_structure.loan_amount / valuation.purchase_price',
63
+ unit: '%',
64
+ deterministic: true,
65
+ },
66
+ {
67
+ id: 'dscr',
68
+ label: 'DSCR',
69
+ formula: 'noi_model.net_operating_income / debt_structure.annual_debt_service',
70
+ unit: 'x',
71
+ deterministic: true,
72
+ },
73
+ {
74
+ id: 'debt_yield',
75
+ label: 'Debt Yield',
76
+ formula: 'noi_model.net_operating_income / debt_structure.loan_amount',
77
+ unit: '%',
78
+ deterministic: true,
79
+ },
80
+ {
81
+ id: 'cash_on_cash',
82
+ label: 'Cash-on-Cash',
83
+ formula: '(noi_model.net_operating_income - debt_structure.annual_debt_service) / sources_uses.sources.equity_sponsor',
84
+ unit: '%',
85
+ deterministic: true,
86
+ },
87
+ // ── NOI share per component use (allocation-free; null when absent) ─────
88
+ {
89
+ id: 'multifamily_noi_share',
90
+ label: 'Multifamily NOI Share',
91
+ formula: 'components.multifamily.net_operating_income / noi_model.net_operating_income',
92
+ unit: '%',
93
+ deterministic: true,
94
+ },
95
+ {
96
+ id: 'retail_noi_share',
97
+ label: 'Retail NOI Share',
98
+ formula: 'components.retail.net_operating_income / noi_model.net_operating_income',
99
+ unit: '%',
100
+ deterministic: true,
101
+ },
102
+ {
103
+ id: 'office_noi_share',
104
+ label: 'Office NOI Share',
105
+ formula: 'components.office.net_operating_income / noi_model.net_operating_income',
106
+ unit: '%',
107
+ deterministic: true,
108
+ },
109
+ {
110
+ id: 'industrial_noi_share',
111
+ label: 'Industrial NOI Share',
112
+ formula: 'components.industrial.net_operating_income / noi_model.net_operating_income',
113
+ unit: '%',
114
+ deterministic: true,
115
+ },
116
+ {
117
+ id: 'self_storage_noi_share',
118
+ label: 'Self-Storage NOI Share',
119
+ formula: 'components.self_storage.net_operating_income / noi_model.net_operating_income',
120
+ unit: '%',
121
+ deterministic: true,
122
+ },
123
+ {
124
+ id: 'hospitality_noi_share',
125
+ label: 'Hospitality NOI Share',
126
+ formula: 'components.hospitality.net_operating_income / noi_model.net_operating_income',
127
+ unit: '%',
128
+ deterministic: true,
129
+ },
130
+ {
131
+ id: 'senior_housing_noi_share',
132
+ label: 'Senior Housing NOI Share',
133
+ formula: 'components.senior_housing.net_operating_income / noi_model.net_operating_income',
134
+ unit: '%',
135
+ deterministic: true,
136
+ },
137
+ {
138
+ id: 'student_housing_noi_share',
139
+ label: 'Student Housing NOI Share',
140
+ formula: 'components.student_housing.net_operating_income / noi_model.net_operating_income',
141
+ unit: '%',
142
+ deterministic: true,
143
+ },
144
+ // ── Use-level intensive metrics (null without allocation_pct) ──────────
145
+ {
146
+ id: 'multifamily_price_per_unit',
147
+ label: 'Multifamily Price / Unit',
148
+ formula: '(valuation.purchase_price * components.multifamily.allocation_pct) / components.multifamily.total_units',
149
+ unit: '$',
150
+ deterministic: true,
151
+ },
152
+ {
153
+ id: 'retail_price_psf',
154
+ label: 'Retail Price / SqFt',
155
+ formula: '(valuation.purchase_price * components.retail.allocation_pct) / components.retail.nra_sqft',
156
+ unit: '$',
157
+ deterministic: true,
158
+ },
159
+ {
160
+ id: 'office_price_psf',
161
+ label: 'Office Price / SqFt',
162
+ formula: '(valuation.purchase_price * components.office.allocation_pct) / components.office.nra_sqft',
163
+ unit: '$',
164
+ deterministic: true,
165
+ },
166
+ {
167
+ id: 'industrial_price_psf',
168
+ label: 'Industrial Price / SqFt',
169
+ formula: '(valuation.purchase_price * components.industrial.allocation_pct) / components.industrial.nra_sqft',
170
+ unit: '$',
171
+ deterministic: true,
172
+ },
173
+ {
174
+ id: 'self_storage_price_psf',
175
+ label: 'Self-Storage Price / SqFt',
176
+ formula: '(valuation.purchase_price * components.self_storage.allocation_pct) / components.self_storage.nra_sqft',
177
+ unit: '$',
178
+ deterministic: true,
179
+ },
180
+ {
181
+ id: 'student_housing_price_per_bed',
182
+ label: 'Student Housing Price / Bed',
183
+ formula: '(valuation.purchase_price * components.student_housing.allocation_pct) / components.student_housing.total_beds',
184
+ unit: '$',
185
+ deterministic: true,
186
+ },
187
+ // ── Operating-business intermediates, surfaced per component ───────────
188
+ {
189
+ id: 'hospitality_gross_operating_profit',
190
+ label: 'Hospitality Gross Operating Profit',
191
+ formula: 'components.hospitality.gross_operating_profit',
192
+ unit: '$',
193
+ deterministic: true,
194
+ },
195
+ {
196
+ id: 'senior_housing_total_labor_expense',
197
+ label: 'Senior Housing Total Labor Expense',
198
+ formula: 'components.senior_housing.total_labor_expense',
199
+ unit: '$',
200
+ deterministic: true,
201
+ },
202
+ ],
203
+ };
204
+ //# sourceMappingURL=mixed-use.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixed-use.js","sourceRoot":"","sources":["../../src/packs/mixed-use.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAChF,gBAAgB;AAChB,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,sEAAsE;AACtE,8EAA8E;AAC9E,+EAA+E;AAC/E,yDAAyD;AACzD,2EAA2E;AAC3E,4EAA4E;AAC5E,iFAAiF;AACjF,6EAA6E;AAC7E,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,8EAA8E;AAC9E,6EAA6E;AAC7E,+EAA+E;AAC/E,kFAAkF;AAClF,kFAAkF;AAClF,6EAA6E;AAC7E,2EAA2E;AAC3E,4BAA4B;AAC5B,EAAE;AACF,4FAA4F;AAC5F,2EAA2E;AAC3E,gFAAgF;AAChF,kFAAkF;AAIlF,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,gBAAgB,EAAE,GAAG;IACrB,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,OAAO;IAChB,WAAW,EACT,gVAAgV;IAClV,OAAO,EAAE,CAAC,2BAA2B,CAAC;IACtC,OAAO,EAAE,KAAK;IACd,iBAAiB,EAAE,QAAQ;IAC3B,eAAe,EAAE,QAAQ;IACzB,aAAa,EAAE,kBAAkB;IACjC,aAAa,EAAE,CAAC,WAAW,CAAC;IAC5B,YAAY,EAAE;QACZ,0EAA0E;QAC1E;YAC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;QACD;YACE,EAAE,EAAE,+BAA+B;YACnC,KAAK,EAAE,6BAA6B;YACpC,OAAO,EACL,gHAAgH;YAClH,IAAI,EAAE,GAAG;YACT,aAAa,EAAE,IAAI;SACpB;QAED,0EAA0E;QAC1E;YACE,EAAE,EAAE,oCAAoC;YACxC,KAAK,EAAE,oCAAoC;YAC3C,OAAO,EAAE,+CAA+C;YACxD,IAAI,EAAE,GAAG;YACT,aAAa,EAAE,IAAI;SACpB;QACD;YACE,EAAE,EAAE,oCAAoC;YACxC,KAAK,EAAE,oCAAoC;YAC3C,OAAO,EAAE,+CAA+C;YACxD,IAAI,EAAE,GAAG;YACT,aAAa,EAAE,IAAI;SACpB;KACF;CACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { AssetClass, ConfidenceLevel, DealStage, FinancialThresholds, ParsedUWFile, PipelineStatus, UWBlock, UWMeta, ValidationMessage, ValidationSeverity } from './types.js';
2
2
  /** Semver of this protocol. Bumped independently of @uwmd/core's npm version. */
3
- export declare const PROTOCOL_VERSION: "1.4.0";
3
+ export declare const PROTOCOL_VERSION: "1.5.0";
4
4
  /** Format spec version this protocol pairs with. */
5
5
  export declare const FORMAT_VERSION: "1.1";
6
6
  /** The four conformance tiers defined in UW_PROTOCOL_v1.md Part II. */
@@ -141,17 +141,40 @@ export type ViewModelRegistry = Readonly<Record<string, SectionViewModel>>;
141
141
  * Step 0 (`user_override`) and step 1 (`user_input`) are detected by
142
142
  * walking the parsed file for an existing block at the field path
143
143
  * whose `_meta.source` matches; the remaining steps are looked up in
144
- * external tables (investor profile, market data) or built-in tables
145
- * (asset class, global, system).
144
+ * external tables (inherited assumptions, investor profile, market data)
145
+ * or built-in tables (asset class, global, system).
146
+ *
147
+ * **`inherited_assumption` was added by RFC 0021 §5 (protocol 1.5.0),**
148
+ * taking the cascade from seven steps to eight. It sits directly below
149
+ * `user_input`, so a value someone entered on the deal always beats one
150
+ * inherited from an ancestor — inheritance supplies defaults, it never
151
+ * overrides.
152
+ *
153
+ * It sits *above* `investor_profile`, which the RFC's own diagram is silent
154
+ * on because that diagram omits `investor_profile` entirely. Resolved on the
155
+ * merits: an inherited assumption comes from a named ancestor in this deal's
156
+ * composition DAG, so it is more specific to this deal than an
157
+ * institution-wide preference set, and the more specific source should win.
158
+ *
159
+ * Inheritance resolves along the composition DAG **only**. A document not
160
+ * reachable as an ancestor contributes nothing, and there is no ambient or
161
+ * global assumption scope — so a standalone record, which is every record
162
+ * that existed before RFC 0021, can never resolve at this step and no
163
+ * existing digest moves.
146
164
  */
147
- export type CascadeStep = 'user_override' | 'user_input' | 'investor_profile' | 'market_data' | 'asset_class_default' | 'global_default' | 'system_default';
165
+ export type CascadeStep = 'user_override' | 'user_input' | 'inherited_assumption' | 'investor_profile' | 'market_data' | 'asset_class_default' | 'global_default' | 'system_default';
148
166
  /** Ordered cascade as a runtime value (frozen). Index === precedence. */
149
167
  export declare const CASCADE_ORDER: readonly CascadeStep[];
150
168
  /**
151
169
  * The full set of canonical short-form source tags producers stamp into
152
- * `_meta.source`. The first seven values match `CascadeStep` 1:1; the
153
- * remaining four are non-cascade tags retained from v1.0 for back-compat
154
- * (`manual`, `ai_extracted`, `agent_computed`, `scenario_default`).
170
+ * `_meta.source`. Eight of these match `CascadeStep` 1:1; the rest are
171
+ * non-cascade tags `manual`, `ai_extracted`, `agent_computed`,
172
+ * `scenario_default`, and `market_data_accepted`.
173
+ *
174
+ * `market_data_accepted` (RFC 0022 §4) is deliberately *not* a cascade step:
175
+ * it is an in-file value of record that resolves at the `user_input` step
176
+ * while keeping its own tag, because a value accepted for lack of better
177
+ * evidence must stay distinguishable from one someone typed in.
155
178
  *
156
179
  * `scenario_default` is retained but its meaning is sharpened to mean
157
180
  * "value derived from a named scenario in the file or institution
@@ -162,7 +185,7 @@ export declare const CASCADE_ORDER: readonly CascadeStep[];
162
185
  * `import:filename.pdf`) remain valid; this constant enumerates the
163
186
  * canonical short forms only.
164
187
  */
165
- export declare const SOURCE_TAGS: readonly ["user_input", "user_override", "manual", "investor_profile", "market_data", "ai_extracted", "agent_computed", "asset_class_default", "scenario_default", "global_default", "system_default"];
188
+ export declare const SOURCE_TAGS: readonly ["user_input", "user_override", "manual", "inherited_assumption", "investor_profile", "market_data", "market_data_accepted", "ai_extracted", "agent_computed", "asset_class_default", "scenario_default", "global_default", "system_default"];
166
189
  export type CanonicalSourceTag = (typeof SOURCE_TAGS)[number];
167
190
  /**
168
191
  * What a producer should do when an incomplete-data condition (missing or
@@ -371,6 +394,31 @@ export interface ModuleLoadResult {
371
394
  manifest?: ModuleManifest;
372
395
  errors: ProtocolError[];
373
396
  }
397
+ /**
398
+ * The section ids the format registers in `UW_FORMAT_SPEC_v1.md` Part IV: the
399
+ * 21 standard data sections (§ 4.0 – § 4.20) plus `gaps` (§ 4.22). Each entry is
400
+ * the `**ID:**` that subsection declares. § 4.21 is the `x_` extension
401
+ * meta-spec, which registers a namespace rather than a section, so it has no id
402
+ * here.
403
+ *
404
+ * This exists because "is this a section the format knows about?" had no single
405
+ * answer in the library. `BUILTIN_VIEW_MODELS` claims to be that list and is
406
+ * not — it omits eight of these (including `operating_statement`) and adds
407
+ * eight ids Part IV never registers — and `lite-bridge.ts` keeps a third,
408
+ * different list. Rather than pick one of two wrong answers, RFC 0022 reads the
409
+ * spec, which is the authority. Reconciling the other two is tracked separately;
410
+ * `protocol.test.ts` pins this list so it cannot drift from Part IV silently.
411
+ *
412
+ * Extension sections (`x_`-prefixed, § 4.21) are valid but deliberately absent:
413
+ * they are institution-defined, so membership here would be a category error.
414
+ * Use `isStandardSectionId` for registry membership and check the `x_` prefix
415
+ * separately when extensions are permitted.
416
+ */
417
+ export declare const STANDARD_SECTION_IDS: readonly string[];
418
+ /** True when `id` is a section registered by FORMAT_SPEC Part IV. */
419
+ export declare function isStandardSectionId(id: string): boolean;
420
+ /** The `x_` namespace FORMAT_SPEC § 4.21 reserves for non-standard content. */
421
+ export declare const EXTENSION_SECTION_PREFIX: "x_";
374
422
  /**
375
423
  * A profile is a versioned contract for the *purpose and permitted sections* of
376
424
  * one document. It is not a filename extension, an asset class, a pipeline
@@ -388,6 +436,7 @@ export interface DocumentProfile {
388
436
  export declare const DEAL_UNDERWRITING_PROFILE: "deal-underwriting-v1";
389
437
  export declare const LEASE_ABSTRACT_PROFILE: "lease-abstract-v1";
390
438
  export declare const SOURCE_NOTE_PROFILE: "source-note-v1";
439
+ export declare const MARKET_DATA_PROFILE: "market-data-v1";
391
440
  export declare const BUILTIN_DOCUMENT_PROFILES: readonly DocumentProfile[];
392
441
  /**
393
442
  * Profile identifiers are opaque lowercase ASCII tokens. An unknown profile is
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAIpB,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,oDAAoD;AACpD,eAAO,MAAM,cAAc,EAAG,KAAc,CAAC;AAI7C,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,mEAAmE;AACnE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7F;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,UAAU,GACV,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,YAAY,GACZ,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,oBAAoB,GACpB,YAAY,GACZ,aAAa,CAAC;AAElB,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG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9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAgOhC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,UAAU,EAMrD,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,gBAAgB,EAkV1D,CAAC;AAIH,YAAY,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,kBAAkB,GACnB,CAAC"}
package/dist/protocol.js CHANGED
@@ -11,7 +11,7 @@
11
11
  // operations are a layer over JSON Schema.
12
12
  // ─── Versioning ───────────────────────────────────────────────────────────────
13
13
  /** Semver of this protocol. Bumped independently of @uwmd/core's npm version. */
14
- export const PROTOCOL_VERSION = '1.4.0';
14
+ export const PROTOCOL_VERSION = '1.5.0';
15
15
  /** Format spec version this protocol pairs with. */
16
16
  export const FORMAT_VERSION = '1.1';
17
17
  /** Default number-formatting table referenced by Part III §3.1. */
@@ -31,6 +31,7 @@ export const DEFAULT_DATE_FORMAT = {
31
31
  export const CASCADE_ORDER = Object.freeze([
32
32
  'user_override',
33
33
  'user_input',
34
+ 'inherited_assumption',
34
35
  'investor_profile',
35
36
  'market_data',
36
37
  'asset_class_default',
@@ -39,9 +40,14 @@ export const CASCADE_ORDER = Object.freeze([
39
40
  ]);
40
41
  /**
41
42
  * The full set of canonical short-form source tags producers stamp into
42
- * `_meta.source`. The first seven values match `CascadeStep` 1:1; the
43
- * remaining four are non-cascade tags retained from v1.0 for back-compat
44
- * (`manual`, `ai_extracted`, `agent_computed`, `scenario_default`).
43
+ * `_meta.source`. Eight of these match `CascadeStep` 1:1; the rest are
44
+ * non-cascade tags `manual`, `ai_extracted`, `agent_computed`,
45
+ * `scenario_default`, and `market_data_accepted`.
46
+ *
47
+ * `market_data_accepted` (RFC 0022 §4) is deliberately *not* a cascade step:
48
+ * it is an in-file value of record that resolves at the `user_input` step
49
+ * while keeping its own tag, because a value accepted for lack of better
50
+ * evidence must stay distinguishable from one someone typed in.
45
51
  *
46
52
  * `scenario_default` is retained but its meaning is sharpened to mean
47
53
  * "value derived from a named scenario in the file or institution
@@ -56,8 +62,10 @@ export const SOURCE_TAGS = Object.freeze([
56
62
  'user_input',
57
63
  'user_override',
58
64
  'manual',
65
+ 'inherited_assumption',
59
66
  'investor_profile',
60
67
  'market_data',
68
+ 'market_data_accepted',
61
69
  'ai_extracted',
62
70
  'agent_computed',
63
71
  'asset_class_default',
@@ -203,9 +211,64 @@ export function lookupIncompleteDataPolicy(section, field_path, stage, policies
203
211
  }
204
212
  return best;
205
213
  }
214
+ // ─── Standard section registry (FORMAT_SPEC Part IV) ─────────────────────────
215
+ /**
216
+ * The section ids the format registers in `UW_FORMAT_SPEC_v1.md` Part IV: the
217
+ * 21 standard data sections (§ 4.0 – § 4.20) plus `gaps` (§ 4.22). Each entry is
218
+ * the `**ID:**` that subsection declares. § 4.21 is the `x_` extension
219
+ * meta-spec, which registers a namespace rather than a section, so it has no id
220
+ * here.
221
+ *
222
+ * This exists because "is this a section the format knows about?" had no single
223
+ * answer in the library. `BUILTIN_VIEW_MODELS` claims to be that list and is
224
+ * not — it omits eight of these (including `operating_statement`) and adds
225
+ * eight ids Part IV never registers — and `lite-bridge.ts` keeps a third,
226
+ * different list. Rather than pick one of two wrong answers, RFC 0022 reads the
227
+ * spec, which is the authority. Reconciling the other two is tracked separately;
228
+ * `protocol.test.ts` pins this list so it cannot drift from Part IV silently.
229
+ *
230
+ * Extension sections (`x_`-prefixed, § 4.21) are valid but deliberately absent:
231
+ * they are institution-defined, so membership here would be a category error.
232
+ * Use `isStandardSectionId` for registry membership and check the `x_` prefix
233
+ * separately when extensions are permitted.
234
+ */
235
+ export const STANDARD_SECTION_IDS = Object.freeze([
236
+ 'deal_context',
237
+ 'property',
238
+ 'ownership',
239
+ 'rent_roll',
240
+ 'operating_statement',
241
+ 'noi_model',
242
+ 'valuation',
243
+ 'debt_structure',
244
+ 'sources_uses',
245
+ 'dcf',
246
+ 'stress_tests',
247
+ 'market_analysis',
248
+ 'borrower_sponsor',
249
+ 'due_diligence',
250
+ 'risk_assessment',
251
+ 'compliance',
252
+ 'assumptions',
253
+ 'validation',
254
+ 'pipeline_log',
255
+ 'custom_calculations',
256
+ 'custom_scenarios',
257
+ 'gaps',
258
+ 'components',
259
+ 'capital_stack',
260
+ ]);
261
+ const STANDARD_SECTION_ID_SET = new Set(STANDARD_SECTION_IDS);
262
+ /** True when `id` is a section registered by FORMAT_SPEC Part IV. */
263
+ export function isStandardSectionId(id) {
264
+ return STANDARD_SECTION_ID_SET.has(id);
265
+ }
266
+ /** The `x_` namespace FORMAT_SPEC § 4.21 reserves for non-standard content. */
267
+ export const EXTENSION_SECTION_PREFIX = 'x_';
206
268
  export const DEAL_UNDERWRITING_PROFILE = 'deal-underwriting-v1';
207
269
  export const LEASE_ABSTRACT_PROFILE = 'lease-abstract-v1';
208
270
  export const SOURCE_NOTE_PROFILE = 'source-note-v1';
271
+ export const MARKET_DATA_PROFILE = 'market-data-v1';
209
272
  export const BUILTIN_DOCUMENT_PROFILES = Object.freeze([
210
273
  Object.freeze({
211
274
  id: DEAL_UNDERWRITING_PROFILE,
@@ -225,6 +288,15 @@ export const BUILTIN_DOCUMENT_PROFILES = Object.freeze([
225
288
  required_identity: Object.freeze(['document_id']),
226
289
  financial_role: 'evidence',
227
290
  }),
291
+ Object.freeze({
292
+ // RFC 0022. `evidence`, not `underwriting`: a market-data document carries
293
+ // observations, contains no calculations, and no pack applies to it. It has
294
+ // no `deal_id` and must never be read as an underwriting record.
295
+ id: MARKET_DATA_PROFILE,
296
+ purpose: 'Dated, attributable market observations for one geography and asset class.',
297
+ required_identity: Object.freeze(['document_id', 'as_of', 'provider', 'geo']),
298
+ financial_role: 'evidence',
299
+ }),
228
300
  ]);
229
301
  const PROFILE_BY_ID = new Map(BUILTIN_DOCUMENT_PROFILES.map((p) => [p.id, p]));
230
302
  /**
@@ -631,6 +703,83 @@ export const BUILTIN_REMEDIATIONS = Object.freeze([
631
703
  remediation: 'Refresh the section, supersede with a new agent/manual write, or mark deliberate stale.',
632
704
  spec_ref: '§5.3 CC-10',
633
705
  },
706
+ {
707
+ code: 'CC-11', severity: 'error',
708
+ title: 'Components section on a non-mixed-use document',
709
+ description: 'A `components` section is present but frontmatter.asset_class is not `mixed_use`.',
710
+ remediation: 'Set asset_class to `mixed_use`, or remove the components section and model the deal under its own asset class.',
711
+ spec_ref: '§5.3 CC-11',
712
+ },
713
+ {
714
+ code: 'CC-12', severity: 'error',
715
+ title: 'Components do not foot to property NOI',
716
+ description: 'noi_model.net_operating_income does not equal the sum of the component net_operating_income values.',
717
+ remediation: 'Reconcile the component NOIs with the property NOI — the property figure MUST equal their sum (RFC 0019 §3a).',
718
+ spec_ref: '§5.3 CC-12',
719
+ },
720
+ {
721
+ code: 'MU-01', severity: 'error',
722
+ title: 'Too few components',
723
+ description: 'A mixed-use property declares fewer than two admissible components.',
724
+ remediation: 'Declare at least two components; a single-component deal is not mixed use and should use that component\'s own asset class.',
725
+ spec_ref: '§4.23 MU-01',
726
+ },
727
+ {
728
+ code: 'MU-02', severity: 'error',
729
+ title: 'Inadmissible component class',
730
+ description: 'A component key is not one of the eight income classes; `land` and unknown classes are excluded.',
731
+ remediation: 'Remove the inadmissible component. Only multifamily, retail, office, industrial, self_storage, hospitality, senior_housing, and student_housing may appear.',
732
+ spec_ref: '§4.23 MU-02',
733
+ },
734
+ {
735
+ code: 'MU-03', severity: 'error',
736
+ title: 'Component class/key mismatch',
737
+ description: 'A component\'s component_class does not equal the key it is filed under.',
738
+ remediation: 'Make component_class equal the key, or move the entry under the key that matches its component_class.',
739
+ spec_ref: '§4.23 MU-03',
740
+ },
741
+ {
742
+ code: 'MU-04', severity: 'error',
743
+ title: 'Component missing NOI',
744
+ description: 'A present component omits net_operating_income, which the property rollup consumes.',
745
+ remediation: 'State the component\'s net_operating_income. A present use with no NOI is an incomplete document, not zero income.',
746
+ spec_ref: '§4.23 MU-04',
747
+ },
748
+ {
749
+ code: 'MU-05', severity: 'error',
750
+ title: 'Component allocation does not sum to 1.0',
751
+ description: 'allocation_pct across present components does not sum to 1.0 within 0.0001.',
752
+ remediation: 'Reconcile the allocation split so present components sum to 1.0, or omit allocation_pct entirely (use-level intensive metrics then evaluate to null).',
753
+ spec_ref: '§4.23 MU-05',
754
+ },
755
+ {
756
+ code: 'MU-06', severity: 'error',
757
+ title: 'Component-level debt not allowed',
758
+ description: 'A component carries its own debt_structure; this section models one property-level loan.',
759
+ remediation: 'Remove the component debt_structure. Component-level financing is expressed as a component-level capital_stack (§4.24, RFC 0026), which this section accepts and validates with the CS-* rules.',
760
+ spec_ref: '§4.23 MU-06',
761
+ },
762
+ {
763
+ code: 'CS-01', severity: 'error',
764
+ title: 'Malformed capital-stack tranche',
765
+ description: 'A tranche omits a required field (id, class, position, amount) or repeats an id/position.',
766
+ remediation: 'Give every tranche a unique id, a valid class, a unique integer position, and a numeric amount.',
767
+ spec_ref: '§4.24 CS-01',
768
+ },
769
+ {
770
+ code: 'CS-02', severity: 'error',
771
+ title: 'Tranche rate does not match its class',
772
+ description: 'A debt or preferred tranche omits its rate, or a common-equity tranche states one.',
773
+ remediation: 'State a rate on every debt and preferred_equity tranche; remove it from common_equity.',
774
+ spec_ref: '§4.24 CS-02',
775
+ },
776
+ {
777
+ code: 'CS-WATERFALL-UNSUPPORTED', severity: 'error',
778
+ title: 'Distribution waterfall is out of scope',
779
+ description: 'The capital_stack encodes a distribution waterfall (promote, hurdles, tiers, or catch-up), which this version does not model.',
780
+ remediation: 'Model the waterfall in x_partnership_structure for now; a later phase adds it once a hold-period cash-flow primitive exists (RFC 0026 §E).',
781
+ spec_ref: '§4.24 CS-WATERFALL-UNSUPPORTED',
782
+ },
634
783
  {
635
784
  code: 'DQ-01', severity: 'warning',
636
785
  title: 'Provisional block without gap entry',