Skip to main content

Module project

Module project 

Source
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 kindApp (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§

CoderProject
A CAR-managed project. The git repo IS repo_path; this metadata lives beside it in project.json (gitignored).

Enums§

ProjectKind
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
projects under the CAR state root (~/.car/projects unless CAR_HOME moves the root) — managed project repos. CAR_PROJECTS_DIR still overrides both for tests and embedders (mirroring CAR_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 requested kind is 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 a project.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.