Files
ai-agent/backend/project_costs.py
Gabriel Vidal a291f3cb6e feat(projects): root lab project — the homelab repo, home for unattributed conversations
Conversations that never edit a `projects/<slug>` file — service work, skills,
scripts, docs, plain questions — used to fall out of every project-shaped view
as "(unattributed)". They now land on a root project card backed by the repo
root itself.

- projects.py: ROOT_SLUG (`lab`), attributed_projects() (derived at read time,
  never written to the sidecar), project_dir()/repo_rel() so callers resolve the
  slug to REPO_DIR instead of assuming projects/<dir>, plus the gallery record
  and detail view (repo CLAUDE.md, GOAL.md, git history). A real ~/projects/lab
  dir would win over the synthesised record.
- main.py: _conv_meta applies the fallback (so tags, project pages, graph and
  dashboards all see it), and the goals board + goal-work resolve the unit's dir
  through project_dir()/repo_rel().
- project_costs.py: same fallback, so the lab's spend rolls up on its card.
- gitdiff.py: `project:lab` resolves to the superproject.
- count_loc: the lab's LoC comes from `git ls-files` (tracked source only) —
  a directory walk would count services/media and the untracked data/ tree.
- Frontend: house icon, dashed tinted frame and a `root` badge on the card and
  detail page; no .env editor; the tag's repo path reads `.`.
2026-08-10 03:52:50 +02:00

4.2 KiB