title: Monorepo Decomposition Plan tags: [plan, architecture, infrastructure, monorepo] created: 2026-05-20 updated: 2026-05-27 status: active related:


Monorepo Decomposition Plan

Objective

Dissolve the monorepo (lemna-dev) into fully independent floating repositories. Zero submodules. Zero super-repos. Each repo is sovereign.

Repos After Decomposition (34 total, 0 submodules)

New repos (3)

RepoContainsOrigin
lemna-knowledgeknowledge/ (cookbook, inventory, journal, templates)monorepo root
lemna-opencode.opencode/ (skills, commands, tools, opencode.json) + AGENTS.mdmonorepo root
data-scrapingdata-scraping/ (plans, sources, paper_collection.json)monorepo root

Freed existing repos (31)

RepoCurrent submodule path
kitchenwaresrc/kitchenware
pantrysrc/pantry
lemna-sdkpipeline/backend/lemna-sdk
databasepipeline/backend/database
secretspipeline/backend/secrets
bucketpipeline/backend/bucket
pestomodels/pesto
pesto-screenmodels/pesto-screen
pomodoromodels/pomodoro
oraclemodels/oracle
backmapmodels/backmap
carbonaramodels/carbonara
carbonara-bindersmodels/carbonara-binders
carbonara-clipmodels/carbonara-clip
novodishmodels/novodish
structuresdatasets/structures
bindersdatasets/binders
endpoint-pestopipeline/services/endpoint-pesto
endpoint-pesto-screenpipeline/services/endpoint-pesto-screen
endpoint-carbonarapipeline/services/endpoint-carbonara
endpoint-carbonara-binderspipeline/services/endpoint-carbonara-binders
endpoint-boltzpipeline/services/endpoint-boltz
endpoint-boltzgenpipeline/services/endpoint-boltzgen
endpoint-cpmppipeline/services/endpoint-cpmp
endpoint-openmmpipeline/services/endpoint-openmm
endpoint-rfdiffusionpipeline/services/endpoint-rfdiffusion
workflow-binder-designpipeline/workflows/binder-design
workflow-debugpipeline/workflows/debug
workspace-backmappipeline/workspace/backmap
workspace-binders-design-pipelinepipeline/workspace/binders-design-pipeline
project-pestopipeline/projects/pesto
project-carbonarapipeline/projects/carbonara
websitewebsite/website
molstar-bfactorwebsite/packages/molstar-bfactor
dashboardtools/dashboard
molstar-viewertools/molstar-viewer

File Disposition

Move to new repos

File/directoryDestination
knowledge/ (entire directory)lemna-knowledge/
.opencode/ (entire directory)lemna-opencode/
AGENTS.mdlemna-opencode/AGENTS.md
data-scraping/ (entire directory)data-scraping/

Fold into knowledge (historical docs)

File/directoryDestination
pipeline/backend/refactor/MIGRATION-PLAN.mdlemna-knowledge/journal/sessions/done/
pipeline/backend/refactor/recover_pssm.shlemna-knowledge/journal/sessions/done/
pipeline/PLAN-decouple-backend.mdlemna-knowledge/journal/sessions/done/

Resolved

File/directoryDecision
pipeline/backend/tests/Deleted — SDK integration tests overlap with lemna-sdk’s own tests; endpoint tests are in each endpoint repo

Move into existing repos

FileDestinationNote
export.jsonpantry/ repo configPantry owns namespace resolution; update pantry code to self-resolve
scripts/pty-push-all.shpantry/scripts/If still used; otherwise delete

Split and redistribute

File (root justfile)DestinationCommands
sync / format / check / testkitchenware/justfileAlready has its own; merge root versions in
marimo utilRepo that uses it (e.g. novodish)
tensorboard utilModel repos that use it
molstar utilmolstar-viewer repo

Delete

File/directoryReason
.hermes/Not needed
pipeline/backend/docker-compose.ymlSuper compose being removed
pipeline/backend/CaddyfilePart of super compose
scripts/git-all.shWalked submodules; no submodules exist
scripts/apply-all.shSame
.gitmodulesNo monorepo
.gitignore (root)Each repo owns its own

Already independent — just remove the pointer

All 36 .gitmodules entries. Each is already its own repo with its own git history. The monorepo only tracked which commit they sat on.

What You Lose and Replacements

CapabilityReplacement
lazygit across all reposPer-repo lazygit. Or alias to open lazygit in 2-3 active repos
git-all cross-repo git commandsGone. Push per-repo
apply-all batch endpoint commandsEach endpoint repo runs its own justfile
Submodule commit syncPin deps in pyproject.toml via git URLs + tags
Single .gitignore / conventionsEach repo owns its own (mostly already do)
Super docker-compose for backendEach backend service runs its own compose independently

Dependency Updates

Replace workspace path dependencies in pyproject.toml with git URLs:

# Before
kitchenware = { path = "../../src/kitchenware" }
 
# After
kitchenware = { git = "https://github.com/lemnabio/kitchenware", tag = "v0.4.1" }

Notable files to update:

  • Any endpoint pyproject.toml referencing kitchenware or SDK via path

Pantry Namespace Resolution (design needed)

Currently export.json maps namespace names to monorepo paths:

{
  "pesto": "models/pesto",
  "carbonara": "models/carbonara",
  ...
}

Options for replacement:

  1. Local config (~/.config/lemna/namespaces.toml) — maps namespace → repo URL or local path
  2. Self-declaration — each repo has a .pantry.toml declaring its namespace; pantry discovers siblings
  3. Remote resolution — pantry queries GitHub org to find repos by convention

Not a blocker for decomposition. Can be addressed as a pantry-internal refactor after.

Migration Steps (ordered)

  1. Create lemna-knowledge, copy knowledge/ + fold in historical docs, push
  2. Create lemna-opencode, copy .opencode/ + AGENTS.md, update skill paths that reference monorepo-relative locations, push
  3. Create data-scraping, copy data-scraping/, push
  4. Decide destination for pipeline/backend/tests/, move it Resolved: deleted
  5. Move export.json into pantry/, update pantry namespace resolution
  6. Move pty-push-all.sh into pantry/scripts/ or delete
  7. Split root justfile into per-repo justfiles, delete root
  8. Delete: .hermes/, super compose files, scripts/, .gitmodules, root .gitignore
  9. Update all pyproject.toml path deps to git URLs
  10. Tag monorepo as last-monorepo, push, stop using it

Open Questions

  • Where does pipeline/backend/tests/ land? Deleted — SDK tests in lemna-sdk, endpoint tests in each endpoint repo
  • Pantry namespace resolution design (local config vs self-declaration vs remote)
  • Which model repos use the root justfile’s marimo/tensorboard utils? Need per-repo placement