Problem
Remote acquisition is first-class in Leadtype, but the config is collection-first: every collection carries repository, ref, and cacheDir, even when several collections come from the same repository.
The real public-docs configs show the resulting friction:
- c15t docs and changelog are separate collections from one Git repository;
- a shared object reduces repetition, but acquisition and content mapping are still conceptually mixed;
- production configs need custom code to normalize repository URLs and refs;
sourceConfig ownership is declared at collection level even when it is a source-level policy;
- agents must infer that collections sharing
(repository, ref) are cloned only once.
Leadtype already deduplicates acquisition internally. The API should expose the same mental model.
Proposal
Add an additive source-group helper that declares acquisition once and content collections beneath it. Exact naming should align with the canonical config work in #151; a possible shape is:
export default defineLeadtypeConfig({
sources: {
c15t: gitSource({
repository: "https://github.com/c15t/c15t.git",
ref: "main",
cacheDir: ".leadtype/c15t",
collections: {
docs: {
dir: "docs",
routePrefix: "/docs",
inheritConfig: true,
},
changelog: {
dir: "changelog",
routePrefix: "/changelog",
},
},
}),
},
});
The source should own:
- repository URL and revision;
- authentication/environment conventions;
- cache/sync policy;
- default config inheritance policy;
- one acquisition lifecycle shared by its child collections.
Each collection should own:
- content directory and include/exclude rules;
- public route prefix/mounts;
- navigation and schema overrides;
- collection-specific inheritance exceptions.
Compatibility and behavior
- Keep the existing flat
collections map working and normalize both forms into the same source graph.
- Preserve current clone deduplication and offline behavior.
- Detect contradictory acquisition settings for collections that point at the same source.
- Make revision pinning visible: allow branch/tag/SHA, but surface an actionable warning for mutable production refs.
- Report source and collection IDs consistently in human and JSON output.
- A failed source acquisition should name every dependent collection.
Acceptance criteria
Problem
Remote acquisition is first-class in Leadtype, but the config is collection-first: every collection carries
repository,ref, andcacheDir, even when several collections come from the same repository.The real public-docs configs show the resulting friction:
sourceConfigownership is declared at collection level even when it is a source-level policy;(repository, ref)are cloned only once.Leadtype already deduplicates acquisition internally. The API should expose the same mental model.
Proposal
Add an additive source-group helper that declares acquisition once and content collections beneath it. Exact naming should align with the canonical config work in #151; a possible shape is:
The source should own:
Each collection should own:
Compatibility and behavior
collectionsmap working and normalize both forms into the same source graph.Acceptance criteria