Expand description
CAR-managed projects — the non-developer’s unit of work.
A non-dev doesn’t have (or want to pick) a git repo. A project is a
named, CAR-managed git repository under ~/.car/projects/<slug>/: created
and initialized for them, so the coder’s worktree/branch machinery works
underneath while the user only ever sees a name. A project has a kind —
App (generic code) or Agent (a declarative CAR agent, Stage 2) — which
decides what gets seeded and how an approved session is delivered.
This is distinct from car_memgine::project::scaffold_project, which
scaffolds a <repo>/.car/ team-metadata directory; we never call it.
Structs§
- Coder
Project - A CAR-managed project. The git repo IS
repo_path; this metadata lives beside it inproject.json(gitignored).
Enums§
- Project
Kind - What a project produces, which selects seeding + the contract style.
Functions§
- list_
projects - All managed projects, newest first.
- load_
project - Load a project’s metadata by slug.
- projects_
root projectsunder the CAR state root (~/.car/projectsunlessCAR_HOMEmoves the root) — managed project repos.CAR_PROJECTS_DIRstill overrides both for tests and embedders (mirroringCAR_CODER_STATE_DIR).- resolve_
or_ create_ project - Resolve a project by name, creating + initializing it if absent. Idempotent:
an existing slug loads its
project.json(the requestedkindis ignored for an existing project — its persisted kind wins). New projects get a git repo (git init -b main), kind-appropriate seed files, an initial commit, and aproject.json. - resolve_
or_ create_ project_ for_ agent - Resolve or create a project while carrying the Agent Builder inputs and an optional existing registered-agent identity through the coder pipeline.
- slugify
- Turn a human name into a filename-safe slug: lowercase, runs of
non-
[a-z0-9]collapse to a single-, trimmed. Empty → “project”. Matches the supervisor’s filename-safe id alphabet so a project slug is a legal agent id too (Stage 2 derives agent ids from project slugs). Names longer than [SLUG_MAX_LEN] chars are truncated and suffixed with a digest of the full slug, so a long description always yields an id that every CAR surface accepts — including the 128-char peer-name rule registration enforces — and distinct long names stay distinct with collision-resistant odds.