Problem
DocsConfig has grown from a local MDX-generation config into the project model for identity, source acquisition, navigation, feeds, redirects, agent surfaces, and multi-repo orchestration. The capabilities are valuable, but the authoring API now exposes historical naming and overlapping concepts:
defineDocsConfig is used for both source-owned docs.config.ts and site/orchestration leadtype.config.ts;
- top-level
frontmatterSchema becomes collection-level schema;
- collection
prefix is specifically a public route prefix;
sourceConfig means “inherit selected config from the source repository”;
groups remains a legacy navigation fallback beside canonical navigation;
- the type permits combinations that are rejected only when the config is loaded.
This makes advanced configs harder to read and gives agents more semantically similar options to choose between. We should establish one canonical vocabulary without breaking existing users.
Proposal
Introduce a new canonical authoring shape and normalize both the existing and new shapes into one internal ResolvedDocsConfig.
Possible vocabulary to validate during design:
defineLeadtypeConfig for project/site orchestration while retaining defineDocsConfig for source-owned docs config;
routePrefix instead of collection prefix;
frontmatterSchema at both top level and collection level;
inheritConfig instead of sourceConfig;
navigation as the canonical IA field, with groups retained only as legacy taxonomy/fallback.
The exact names should be settled with representative configs before implementation. The important architectural constraint is that generation, linting, scoring, syncing, framework adapters, and diagnostics all consume the same resolved shape.
Compatibility strategy
This should be a gradual migration:
- Add the new syntax without removing the old syntax.
- Normalize both at config load into one canonical internal representation.
- Add TypeScript
@deprecated annotations only to fields that have a true replacement.
- Emit one actionable deprecation warning per config load in CLI flows.
- Make
leadtype init, documentation, and examples emit only the new syntax.
- Reject old and new equivalents supplied together instead of silently choosing precedence.
- Keep legacy syntax working through the next major release; do not remove it before 1.0.
Convenience shorthands are not deprecations. For example, agents.mcp: true can coexist with the advanced object form { enabled: true, ... }.
Resolved config requirements
The normalizer should:
- produce a serializable resolved representation where possible;
- preserve source ownership and inheritance provenance for diagnostics;
- validate single-source versus multi-source combinations centrally;
- make conflict errors name both fields and show the canonical replacement;
- be shared by every command and runtime helper rather than reimplemented per subsystem.
Acceptance criteria
Problem
DocsConfighas grown from a local MDX-generation config into the project model for identity, source acquisition, navigation, feeds, redirects, agent surfaces, and multi-repo orchestration. The capabilities are valuable, but the authoring API now exposes historical naming and overlapping concepts:defineDocsConfigis used for both source-owneddocs.config.tsand site/orchestrationleadtype.config.ts;frontmatterSchemabecomes collection-levelschema;prefixis specifically a public route prefix;sourceConfigmeans “inherit selected config from the source repository”;groupsremains a legacy navigation fallback beside canonicalnavigation;This makes advanced configs harder to read and gives agents more semantically similar options to choose between. We should establish one canonical vocabulary without breaking existing users.
Proposal
Introduce a new canonical authoring shape and normalize both the existing and new shapes into one internal
ResolvedDocsConfig.Possible vocabulary to validate during design:
defineLeadtypeConfigfor project/site orchestration while retainingdefineDocsConfigfor source-owned docs config;routePrefixinstead of collectionprefix;frontmatterSchemaat both top level and collection level;inheritConfiginstead ofsourceConfig;navigationas the canonical IA field, withgroupsretained only as legacy taxonomy/fallback.The exact names should be settled with representative configs before implementation. The important architectural constraint is that generation, linting, scoring, syncing, framework adapters, and diagnostics all consume the same resolved shape.
Compatibility strategy
This should be a gradual migration:
@deprecatedannotations only to fields that have a true replacement.leadtype init, documentation, and examples emit only the new syntax.Convenience shorthands are not deprecations. For example,
agents.mcp: truecan coexist with the advanced object form{ enabled: true, ... }.Resolved config requirements
The normalizer should:
Acceptance criteria
@deprecatedguidance and CLI migration warnings.leadtype inituse only the canonical syntax.