Skip to content

UW Markdown — Schemas ​

Normative JSON Schemas for protocol types and a structural XSD for UW XML that cross integration boundaries. Tools written in any language can validate these contracts without reverse-engineering the reference TypeScript implementation.

The JSON schemas use JSON Schema 2020-12 and publish under the https://uwmd.org/schemas/ $id prefix. The XSD targets the UW XML 1.0 namespace https://uwmd.org/ns/document/1. The current canonical files live in this directory pending publication on uwmd.org.

SchemaMirrorsSpec section
uwmd-block.schema.jsonUWBlock + UWMeta (v1.x flat shape)Format §2.4–§2.6
uwmd-block-v2.schema.jsonUWBlock + nested UWMetaV2 + _overrides (format 2.0)Format v2 §2–§3 / RFC 0009
uw-document-envelope.schema.jsonUWDocumentEnvelopeRFC 0014 / Envelope 1.0
uw-document-envelope.xsdStructural UW XML 1.0 tooling schemaUW XML Mapping 1.0
edit-operation.schema.jsonEditOperation (discriminated union)Protocol §V
protocol-error.schema.jsonProtocolErrorProtocol §XI
implementation-manifest.schema.jsonImplementationManifestProtocol §I.4
calc-result.schema.jsonCalcResultProtocol §VIII
issue-remediation.schema.jsonIssueRemediationProtocol §III.6
module-manifest.schema.jsonModuleManifestProtocol §X
module-signature.schema.jsonModuleSignatureProtocol §X.1
uw-receipt.schema.jsonUWReceiptUW Receipt 1.0 / RFC 0016
section-gaps.schema.jsonSectionGapsProtocol §VII
section-components.schema.jsoncomponents section (mixed-use)Format §4.23 / RFC 0019
section-capital-stack.schema.jsoncapital_stack section (tranches + sizing)Format §4.24 / RFC 0026
section-lease-up-schedule.schema.jsonlease_up_schedule section (trajectory + stabilized summary)Format §4.25 / RFC 0008
section-cash-flow-series.schema.jsoncash_flow_series section (dated flows + stated metrics)Format §4.26 / RFC 0034
section-distribution-waterfall.schema.jsondistribution_waterfall section (tier ladder + stated outcomes)Format §4.27 / RFC 0035
lease-escalation-schedule.schema.jsoncommercial tenant rent-step scheduleFormat §4.3 / RFC 0055
lease-recovery-terms.schema.jsoncommercial tenant expense-recovery termsFormat §4.3 / RFC 0058
lease-recovery-true-up.schema.jsonclosed-period CAM reconciliation rowsFormat §4.3 / RFC 0058
lease-termination-option.schema.jsoncommercial tenant break optionFormat §4.3 / RFC 0055
lease-co-tenancy.schema.jsoncommercial tenant co-tenancy trigger and remedyFormat §4.3 / RFC 0055
tax-reassessment.schema.jsonnoi_model reassessment basis (going-in)Format §4.5 / RFC 0053
tax-abatement.schema.jsonnoi_model abatement scheduleFormat §4.5 / RFC 0053
tax-terminal.schema.jsondcf.exit_analysis.terminal_tax (the next buyer's)Format §4.9 / RFC 0053
debt-rate-hedge.schema.jsondebt_structure.rate_hedge (cap strike, notional, term)Format §4.7 / RFC 0056
sources-uses-escrow.schema.jsonone entry of sources_uses.uses.escrowsFormat §4.8 / RFC 0056
renovation-draw.schema.jsonsources_uses.uses.renovation (budget, contingency, draw)Format §4.8 / RFC 0057
expense-targeted-capex.schema.jsoncapex bought to reduce a named operating expenseFormat §4.8 / RFC 0057
uw-deal-package-manifest.schema.jsonUWDealPackageManifestRFC 0018
uw-portfolio-profile.schema.json.uwportfolio.json sidecar (PortfolioProfile)Protocol §XV / RFC 0015
uw-market-data.schema.jsonmarket-data-v1 documentsRFC 0022
uwpart.schema.json.uwpart.md frontmatterUW Composition 1.0 §2 / RFC 0021
uw-external-section.schema.jsonexternal section directiveUW Composition 1.0 §3 / RFC 0021
uw-rollup.schema.jsonportfolio_rollup payloadUW Receipt 1.0 §11 / RFC 0021 §6
period-key.schema.jsonPeriodKeyProtocol §VIII.2a / RFC 0041
period-series-entry.schema.jsonPeriodSeriesEntryProtocol §VIII.2a / RFC 0041
period-refinement-issue.schema.jsonPeriodRefinementIssueProtocol §VIII.2b / RFC 0042
period-excel-binding.schema.jsonPeriodExcelBindingProtocol §VIII.2c / RFC 0043
period-column-snapshot.schema.jsonPeriodColumnSnapshotProtocol §VIII.2c / RFC 0043

Validating a schema ​

bash
npx --yes ajv-cli compile -s spec/schemas/<name>.schema.json

CI runs JSON Schema validation on every PR. The UW XML codec tests and docs-site build cover the XML mapping; the XSD is also compiled during release verification.

Updating a schema ​

The TypeScript types in @uwmd/core/src/protocol.ts and types.ts are the canonical definition. When you change one of those types, update the matching schema here in the same PR. Drift between the two is a normative protocol bug.

If you add a new schema:

  1. Place it next to the existing schemas, named <thing>.schema.json.
  2. Use the https://uwmd.org/schemas/<thing>.schema.json $id.
  3. Add a row to the table above.
  4. CI picks it up automatically — no workflow change needed.

Step 3 is enforced: npm run verify-indexes fails when a schema is on disk without a row, or a row links a file that is not. Three schemas had drifted out of this table before that check existed, which is why it does now.

Lease-up projection (RFC 0044) ​

  • Plan: explicit variant, day count and cash dates.
  • Projection: candidate stream, source digest and bindings.
  • Refusal: CALC-LU-PROJECTION with nested evidence.

Schemas check shape. Implementations additionally check exact period coverage, real calendar dates, source-order timing, verified amounts and digest agreement.

Property cash-flow assembly (RFC 0045) ​

  • Plan: explicit sources, hold dates, basis and coverage.
  • Assembly: copied cash rows and complete declared coverage evidence.
  • Refusal: typed stage reason and nested diagnostics.

Schemas check shape; source identity, complete coverage and economic assertions need semantic validation. Declared completeness is not verified economics.

Released under the MIT License.