Skip to main content

Project Structure

This is a Yarn workspaces monorepo with three packages.

ddd-ct-healthcare/
├── packages/
│ ├── implementation/ # TypeScript library
│ │ ├── src/
│ │ │ ├── index.ts # Public API re-exports
│ │ │ ├── fragment.ts # Entity resolution (colimit)
│ │ │ ├── semilattice.ts # Join-semilattice + LWW registers
│ │ │ ├── crdt.ts # State-based CRDT merge
│ │ │ ├── schema.ts # Functorial schema translation
│ │ │ ├── temporal.ts # Event log presheaf
│ │ │ ├── snapshot.ts # Snapshot-accelerated queries
│ │ │ ├── provider.ts # Healthcare domain types
│ │ │ └── logger.ts # Structured logging
│ │ ├── test/ # Jest + fast-check tests
│ │ └── examples/
│ │ └── dr-jane-doe.ts # Complete worked example
│ ├── pre-print/ # LaTeX manuscript
│ │ ├── ms.tex # Main paper source
│ │ ├── refs.bib # Bibliography
│ │ └── ms.pdf # Compiled PDF
│ └── docs/ # This documentation site
├── package.json # Root workspace config
├── tsconfig.json # Root TypeScript config
└── eslint.config.mjs # Shared ESLint config

Module-to-Paper Mapping

Each source module corresponds to a section of the formal paper:

ModulePaper SectionCategorical Construction
fragment.tsSection 3Colimit in
semilattice.tsSection 5Join-semilattice
crdt.tsSection 5Semilattice join (state-based CRDT)
schema.tsSection 6Adjoint triple
temporal.tsSection 7Presheaf
snapshot.tsSection 7Mealy machine optimization
provider.tsSection 8Case study domain types

Compiling the Manuscript

The LaTeX paper can be compiled from the packages/pre-print directory:

cd packages/pre-print
pdflatex ms.tex
bibtex ms
pdflatex ms.tex
pdflatex ms.tex

The compiled PDF is at packages/pre-print/ms.pdf.