From ec9bb74be0f8141f3fe38906f7f59d448f8c1d89 Mon Sep 17 00:00:00 2001 From: Bobby Date: Tue, 17 Nov 2026 12:32:17 -0500 Subject: [PATCH] setup --- AGENTS.md | 17 ++++++ MVP-TICKETS.md | 112 ----------------------------------- docs/agents/domain.md | 51 ++++++++++++++++ docs/agents/issue-tracker.md | 25 ++++++++ docs/agents/triage-labels.md | 15 +++++ 5 files changed, 108 insertions(+), 112 deletions(-) create mode 100644 AGENTS.md delete mode 100644 MVP-TICKETS.md create mode 100644 docs/agents/domain.md create mode 100644 docs/agents/issue-tracker.md create mode 100644 docs/agents/triage-labels.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b4fb98b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,17 @@ +# AGENTS.md + +This file documents the architecture and domain model of this repository, intended for both human readers and AI agents. + +## Agent skills + +### Issue tracker + +Issues are tracked in the Gitea instance at https://git.bobbypalko.com/bobby/hapi. Uses the `gt` CLI (Gitea's official CLI). Run `gt auth login -h https://git.bobbypalko.com` to authenticate. See `docs/agents/issue-tracker.md`. + +### Triage labels + +Five canonical triage roles mapped to labels: `needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`. See `docs/agents/triage-labels.md`. + +### Domain docs + +Single-context layout: `GLOSSARY.md` at repo root and `docs/adr/` for architecture decisions. See `docs/agents/domain.md`. diff --git a/MVP-TICKETS.md b/MVP-TICKETS.md deleted file mode 100644 index be87160..0000000 --- a/MVP-TICKETS.md +++ /dev/null @@ -1,112 +0,0 @@ -# HAPI MVP Tickets - -This document outlines the tickets for the HAPI MVP, broken into tracer-bullet vertical slices. - -## Prefactoring Tickets - -1. **Initialize Repository Structure** - - Create `.gitignore`, `pyproject.toml`, `docker-compose.yml`, `Makefile` - - Set up basic folder structure for FastAPI app (`models/`, `routers/`, `schemas/`, `services/`, `db/`) - - Add CI/CD configuration files (`.gitea/`, `.github/`) - - **Blocked by**: None - -2. **Set Up Secrets Management** - - Configure SOPS with age keys (generate key pair, set up SOPS CLI) - - Store age keys in Vaultwarden - - Add encrypted secrets file for initial configuration (DB passwords, API keys) - - **Blocked by**: None - ---- - -## Tracer Bullet Tickets - -### 3. **Terraform: Provision Linode Infrastructure** - - Provision Linode resources (VMs, PostgreSQL, Object Storage, LCR) - - Configure Kubernetes cluster with StatefulSet for PostgreSQL - - Set up networking (firewalls, IPs, DNS) - - **Blocked by**: 1, 2 - -### 4. **Terraform: Provision Kubernetes Add-ons** - - Deploy Prometheus stack for metrics (optional, learnable) - - Deploy cert-manager for TLS certificates - - Deploy ingress controller (e.g., Traefik) - - **Blocked by**: 3 - -### 5. **FastAPI: Build Application Skeleton** - - Create layered architecture (`models/`, `routers/`, `schemas/`, `services/`, `db/`) - - Add basic endpoints (root, health, version) - - Integrate with PostgreSQL (connection, session management) - - **Blocked by**: 1, 2, 3 - -### 6. **FastAPI: Add Authentication Module** - - Implement JWT authentication (token generation, validation, revocation) - - Add authentication middleware and dependency - - Store secrets (JWT secret, refresh token key) in SOPS - - **Blocked by**: 5 - -### 7. **FastAPI: Add Rate Limiting Middleware** - - Implement token-based rate limiting (in-memory, Redis-ready) - - Add rate limit headers and error responses - - Configure limits per environment (staging vs production) - - **Blocked by**: 6 - -### 8. **FastAPI: Add Structured Logging** - - Implement structured JSON logging (timestamps, levels, context fields) - - Add logging middleware for request context - - Configure log levels per environment - - **Blocked by**: 5 - -### 9. **FastAPI: Integrate NTFY Alerts** - - Add NTFY client for sending error/warning notifications - - Add alert topics (e.g., "Database connection failures", "Upload failures") - - Configure alert severity and context (request ID, user ID) - - **Blocked by**: 5, 8 - -### 10. **FastAPI: Expand Health Endpoint** - - Add dependency checks to `/health` (DB, object storage) - - Add `/health/ready` and `/health/live` endpoints - - Add health check response format (status, dependencies, timestamp) - - **Blocked by**: 5, 8 - -### 11. **FastAPI: Add Linode Object Storage Integration** - - Integrate Linode Object Storage for uploads (upload, download, delete) - - Add upload endpoints with metadata (filename, size, type) - - Configure credentials via SOPS - - **Blocked by**: 3, 5, 8 - -### 12. **FastAPI: Add NextCloud Backup Integration** - - Integrate NextCloud as secondary storage for uploads - - Add mirror logic (upload to Linode, then sync to NextCloud) - - Add NextCloud-specific endpoints (e.g., health, sync status) - - **Blocked by**: 3, 5, 8 - -### 13. **FastAPI: Add Pytest Tests** - - Set up Pytest with test database (`hapi_test`) - - Add tests for API endpoints (auth, health, uploads) - - Add tests for auth module (token generation, validation) - - Configure CI to run tests (pytest + coverage) - - **Blocked by**: 5, 8 - -### 14. **Docker Compose: Configure Local Development Stack** - - Set up Docker Compose for local stack (FastAPI, PostgreSQL, Adminer) - - Configure hot reload for FastAPI (volume mounts, `uvicorn --reload`) - - Add optional Redis for caching (ready for rate limiting expansion) - - **Blocked by**: 1, 2, 5 - -### 15. **CI/CD: Set Up Gitea Actions Pipeline** - - Configure Gitea Actions with act_runner for local execution - - Add build workflow (Docker buildx, push to LCR) - - Add test workflow (pytest, coverage report) - - Add deploy workflow (Kubernetes apply, staging auto, prod on tag) - - **Blocked by**: 1, 2, 3, 11, 12 - ---- - -## Notes - -- Tickets are ordered by dependency (blockers first). -- Each ticket is a vertical slice covering multiple layers (infrastructure, API, tests, CI/CD). -- Prefactoring tickets enable later work but aren't strictly blocking. -- Terraform is split into two tickets (Infrastructure + Add-ons) for better focus. -- Observability (ticket 8) is now split into three separate vertical tickets (logging, NTFY, health endpoint). -- File upload support (ticket 9) is split into Linode and NextCloud tickets for clearer scope. diff --git a/docs/agents/domain.md b/docs/agents/domain.md new file mode 100644 index 0000000..4032de0 --- /dev/null +++ b/docs/agents/domain.md @@ -0,0 +1,51 @@ +# Domain Docs + +How the engineering skills should consume this repo's domain documentation when exploring the codebase. + +## Before exploring, read these + +- **`GLOSSARY.md`** at the repo root, or +- **`GLOSSARY-MAP.md`** at the repo root if it exists: it points at one `GLOSSARY.md` per context. Read each one relevant to the topic. +- **`docs/adr/`**: read ADRs that touch the area you're about to work in. In multi-context repos, also check `src//docs/adr/` for context-scoped decisions. + +If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved. + +## File structure + +Single-context repo (most repos): + +``` +/ +├── GLOSSARY.md +├── docs/adr/ +│ ├── 0001-event-sourced-orders.md +│ └── 0002-postgres-for-write-model.md +└── src/ +``` + +Multi-context repo (presence of `GLOSSARY-MAP.md` at the root): + +``` +/ +├── GLOSSARY-MAP.md +├── docs/adr/ ← system-wide decisions +└── src/ + ├── ordering/ + │ ├── GLOSSARY.md + │ └── docs/adr/ ← context-specific decisions + └── billing/ + ├── GLOSSARY.md + └── docs/adr/ +``` + +## Use the glossary's vocabulary + +When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `GLOSSARY.md`. Don't drift to synonyms the glossary explicitly avoids. + +If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`). + +## Flag ADR conflicts + +If your output contradicts an existing ADR, surface it explicitly rather than silently overriding: + +> _Contradicts ADR-0007 (event-sourced orders), but worth reopening because…_ diff --git a/docs/agents/issue-tracker.md b/docs/agents/issue-tracker.md new file mode 100644 index 0000000..149e45b --- /dev/null +++ b/docs/agents/issue-tracker.md @@ -0,0 +1,25 @@ +# Issue Tracker + +**Type**: Gitea (self-hosted) + +**Location**: https://git.bobbypalko.com/bobby/hapi + +**Workflow**: Issues are tracked in the Gitea instance at the above URL. The `gt` CLI (Gitea's official CLI) is used to interact with issues. + +**PRs as request surface**: No (default) + +## Commands + +- Create issue: `gt issue create --title "..." --body "..."` +- View issues: `gt issue list` +- View issue details: `gt issue view ` +- Edit issue: `gt issue edit --title "..." --body "..."` +- Close issue: `gt issue close ` + +## Triage labels + +Run `gt label create ` for each label in `docs/agents/triage-labels.md`. + +## Notes + +- Authenticate with `gt auth login -h https://git.bobbypalko.com`. diff --git a/docs/agents/triage-labels.md b/docs/agents/triage-labels.md new file mode 100644 index 0000000..5276464 --- /dev/null +++ b/docs/agents/triage-labels.md @@ -0,0 +1,15 @@ +# Triage Labels + +The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker. + +| Label in mattpocock/skills | Label in our tracker | Meaning | +| -------------------------- | -------------------- | ---------------------------------------- | +| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue | +| `needs-info` | `needs-info` | Waiting on reporter for more information | +| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent | +| `ready-for-human` | `ready-for-human` | Requires human implementation | +| `wontfix` | `wontfix` | Will not be actioned | + +When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table. + +Edit the "Label in our tracker" column to match whatever vocabulary you actually use.