Monorepo Split Policy
Modes
monorepo_context_mode supports three modes:
shared_repo(default)split_on_demandsplit_auto(advanced)
Comparison
shared_repo
- Active project key stays at repo level (
github:owner/repo). - Subpath is kept as metadata for ranking/boost.
- Lowest operational overhead.
split_on_demand
- Only explicitly listed subpaths are isolated.
- Policy source:
monorepo_subproject_policies. - Unlisted subpaths remain on repo-level project.
- Recommended split strategy for production teams.
split_auto
- Resolver can create/use
repo#subpathautomatically with guardrails. - More aggressive and convenient, but can create more projects.
- Keep this off unless your team wants automatic per-subpath isolation.
Why Split-On-Demand Is the Default Split Strategy
- Prevents accidental project explosion in large monorepos.
- Gives administrators explicit control of boundaries.
- Keeps shared context available where strict split is not needed.
Operational Guide
- Start with
shared_repo. - Switch to
split_on_demandwhen one or two subpaths need isolation. - Add policies for the exact subpaths to isolate.
- Use
split_autoonly when your workflow tolerates automatic expansion.
Policy Table
monorepo_subproject_policies
workspace_idrepo_keysubpathenabled
Only enabled rows are used in split_on_demand resolution.
Resolver Behavior Summary
shared_repo:- active project =
repo_key
- active project =
split_on_demand:- if
(repo_key, subpath)is enabled in policy table:- active project =
repo_key#subpath - create project on first use if missing
- active project =
- else:
- active project =
repo_key
- active project =
- if
split_auto:- follows automatic split behavior with existing guardrails
Rename Handling
Repository/subpath rename alias mapping is planned as future work. Current recommendation: keep old entries temporarily and migrate policies step by step.