Files
ai-agent/backend/svc.py
Gabriel Vidal 604ba94cf3 feat(ai-agent): surface GOAL.md — x/n checklist tag on cards, Goal link on detail pages
Projects and services can keep a GOAL.md (the north star the goal-keeper cron
agent pushes forward every 5h), but nothing in the viewer showed it existed.

- backend/goal.py: shared parser for both catalogs. goal_summary() -> the
  {done,total} checklist rollup that tags a card; goal_detail() adds the
  markdown for the detail page. Counting skips fenced code blocks so a "- [ ]"
  inside a snippet isn't mistaken for a task. No GOAL.md => goal: null.
- projects.py / svc.py: goal on the summary + detail records, GOAL.md added to
  KEY_FILES.
- Cards get an x/n tag (emerald once complete; a GOAL.md with no checklist
  still tags, since the point is that the file exists).
- Detail pages get a Goal button in the header that jumps to a new GOAL.md
  section (progress bar + the rendered markdown, task lists as checkboxes).
- Mock seed carries the goal states (partial / complete / no-checklist / absent)
  so every visual state is reachable with ?mock=1.
- CLAUDE.md: document goal.py, and fix the openapi re-dump command — it needs
  --entrypoint python (the image entrypoint otherwise boots the server) and
  os._exit(0) (importing main starts threads that block a normal exit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 15:28:12 +02:00

21 KiB