Person/codekiln/GitHub/sourcer/Project/v0 AI Spec/Config
Config (
srcr.toml)- In the MVP, the config file is the primary interface. Humans, CI, devcontainer builds, and AI agents all converge on the same artifact: a declarative description of which source repositories should exist on disk, at which refs, under which root layout.
Role in the system
- Sourcer separates desired state (what
srcr.tomlsays) from realized state (what exists under the source root aftersrcr install). - That boundary mirrors mise, npm, and other tools that read a manifest and reconcile the environment.
- Unlike a package manager, Sourcer does not resolve version graphs or build artifacts. It materializes git (and eventually other SCM) trees at stable paths keyed by canonical identity.
- Sourcer separates desired state (what
File location and discovery
- Project-local:
srcr.tomlat the repository root of the project being worked on (alongside or nearmise.toml,package.json, etc.). - User-global: a dotfile or XDG path for personal defaults (exact discovery TBD; precedence should favor project over user over built-in defaults).
- Multiple files may merge in the future; MVP can assume a single effective config per invocation context.
- Project-local:
Top-level keys (MVP)
Access policy (MVP vs Phase 2)
- Sourcer separates two concepts (see Person/codekiln/GitHub/sourcer/Project/v0 AI Spec/Trust):
- MVP: listing under
[sources]means allowed and installed oninstall. No separate[allow]table in MVP. - Phase 2: optional
[allow]for wildcards without auto-install; optionalinstall = falseon a[sources]entry (allowed, path-resolvable, not cloned untilsrcr use). - Phase 2 example:
[sources]— declaration model- Keys use the canonical identity form
<provider>/<owner>/<repository>(no scheme, no.gitsuffix). - Values are either a ref string (happy path) or a source object (escape hatch).
String form
Object form
- toml
[sources] "github.com/example/project" = "main" "github.com/example/private-tool" = { ref = "main", clone = "ssh" } "internal.example.com/platform/tool" = { ref = "main", remote = "ssh://git@internal.example.com/platform/tool.git" } - MVP object keys (intentionally small):
ref— branch, tag, or commit-ish name (required when using object form).clone— transport preference:"https"|"ssh"(provider may default to https for public hosts).remote— full clone URL when identity alone is insufficient (self-hosted, non-standard paths).path— override local directory relative toroot; use only when layout cannot follow the default convention.
- Provider defaults should derive:
Identity → URL → path (worked example)
- Keys use the canonical identity form
Layout root (
root)Symmetry with mise
Editor and schema affordances
- Ship a published JSON Schema for
srcr.tomleven though the on-disk format is TOML. - Taplo (and editors that delegate to it) can attach the schema for:
- Document a one-line editor snippet (VS Code
evenBetterToml, etc.) pointing at the schema URL. - Rationale: in the MVP, users spend more time editing the file than memorizing CLI flags; schema quality directly reduces support burden.
- Ship a published JSON Schema for
Reconciliation semantics (
srcr install)- For each entry in
[sources]whereinstallis notfalse(MVP: all entries):- Resolve identity → path and remote.
- Allow check (MVP: must be listed in
[sources]). - If path missing: clone at
ref. - If path exists: fetch and checkout
ref(idempotent; no-op when already correct). - If entry removed from config: do not delete by default in MVP (safe default); explicit prune command is a future addition.
- Partial failure: document whether
installstops on first error or continues and reports aggregate status (recommend aggregate + non-zero exit for CI).
- For each entry in
What config deliberately does not do (MVP)
- No imperative mutation: no
srcr use/srcr unusewriting the file (Phase 2; see Person/codekiln/GitHub/sourcer/Project/v0 AI Spec non-goals and Person/codekiln/GitHub/sourcer/Project/v0 AI Spec/CLI Phase 2 commands). - No dependency graph between sources (ordering is declaration order or topological sort later).
- No build or compile hooks.
- No replacement for git submodules when a hard submodule pin is required for reproducible builds.
- No imperative mutation: no
Example project
srcr.tomlFuture config directions (Phase 2 and beyond)
[allow]table andinstall = falseon[sources]entries (see access policy above).- Included config fragments (
import = "allow.d/*.toml"). - Per-source TTL or eviction metadata for garbage collection.
- Content-addressed snapshot pins (commit SHA required, immutability guarantees).
- Imperative
srcr usefor DevContainer/Feature one-liners without hand-editing the developer's global config (see Person/codekiln/GitHub/sourcer/Project/v0 AI Spec/CLI).