chore: add project docs and agent workflow setup
This commit is contained in:
1 parent
b647343c99
commit
95e1b9cb89
15 files changed
+894
-1
No files matched your search
@@ -0,0 +1,91 @@
|
||||
# Agentic Workflow
|
||||
|
||||
> **Status: draft.** This is the approach currently being tried. Change it only with the developer's OK, and record why in the [dev log](devlog.md).
|
||||
|
||||
**Current autonomy phase: 1 (interactive)**
|
||||
|
||||
## Premise
|
||||
|
||||
The developer is experienced in Java and TypeScript but new to Python. The agent writes most of the code. The human owns the requirements, the design, the verification and the merge decision. Python-specific knowledge goes into tooling (types, lint, tests, agent review) instead of being learned line by line.
|
||||
|
||||
## Roles
|
||||
|
||||
- **Human:** discusses and approves tickets, approves the plan, reviews, runs the result, approves every commit, push and merge.
|
||||
- **Agent:** drafts tickets from discussions, creates them and moves them on the board, plans, writes tests and code, runs the checks, reviews its own diff, drafts the dev log entry.
|
||||
|
||||
## Project management on Gitea
|
||||
|
||||
This section is about how the project itself is managed. It has nothing to do with what Deverenz does as a product: Deverenz is never run against its own repo, and real runs go only to the sandbox repo.
|
||||
|
||||
- **Source of truth:** issues and the project board in the project's Gitea repo. [roadmap.md](roadmap.md) is only the milestone overview and links to the issues.
|
||||
- **Access:** the agent uses its own Gitea account (not the Deverenz bot) through `.claude/scripts/gitea.sh`. Read calls run freely; every write asks for approval. Repo, URL and token location are in `CLAUDE.local.md`.
|
||||
- **Board columns:** Backlog / Todo / In progress / In review / Done.
|
||||
- **Labels and milestones** are set up in the first planning session and live in Gitea, not in this file.
|
||||
|
||||
### From discussion to tickets
|
||||
|
||||
1. The human and the agent discuss a step, feature, bug or idea.
|
||||
2. The agent drafts the resulting tickets: title (format in [conventions](conventions.md)), acceptance criteria, labels, milestone and column.
|
||||
3. The human approves or corrects the drafts.
|
||||
4. The agent creates them in one batch and links them from `roadmap.md` where they belong to a step.
|
||||
|
||||
A discussion may produce several tickets, backlog items, bugs or a new project; the agent proposes all of them in the same draft. Bugs or ideas found during coding that are outside the current ticket's scope become a new draft ticket, not part of the current change.
|
||||
|
||||
### Ticket status
|
||||
|
||||
| Event | Column |
|
||||
|---|---|
|
||||
| Ticket created, not planned yet | Backlog |
|
||||
| Ticket planned for the near future | Todo |
|
||||
| Branch created, work started | In progress |
|
||||
| PR opened | In review |
|
||||
| PR merged after the human's OK | Done (and the issue is closed) |
|
||||
|
||||
The agent makes these moves. Moving back (e.g. In review → In progress after review feedback) is fine too.
|
||||
|
||||
## Pipeline per ticket
|
||||
|
||||
1. **Ticket** with acceptance criteria, created as described above.
|
||||
2. **Branch** `<type>/<issue>-<description>`; move the ticket to In progress.
|
||||
3. **Plan** in plan mode: approach, files touched, one or more tests per acceptance criterion, Python-specific risks. The human approves before any code is written.
|
||||
4. **Tests first**, then the implementation.
|
||||
5. **Automated checks:** `ruff check`, `pyright` (strict) and `pytest`. Locally through the Stop hook, on every PR through CI.
|
||||
6. **Agent review:** `/code-review` on the diff, including a pass for Python and async pitfalls (blocking calls in async code, mutable defaults, unclosed clients, broad `except`).
|
||||
7. **Commit, push and PR** after the human's OK. The PR body ends with `Closes #<issue>`. Move the ticket to In review.
|
||||
8. **Human review** with the checklist below, and a real run (`--dry-run` or the sandbox repo).
|
||||
9. **Merge** after the human's OK, move the ticket to Done, add a dev log entry.
|
||||
|
||||
## Verification rules
|
||||
|
||||
- Tests are the spec: every acceptance criterion has at least one test, including failure cases.
|
||||
- Don't silence a check to make it pass (`# type: ignore`, `# noqa`, skipped tests) without an inline reason and the human's OK.
|
||||
- CI must be green before merging.
|
||||
|
||||
## Human review checklist
|
||||
|
||||
- Do the tests cover the acceptance criteria, including failures?
|
||||
- Does the design follow `architecture.md` (module boundaries, `Forge` protocol, marked content)?
|
||||
- Are errors handled: timeouts, API errors, invalid LLM output?
|
||||
- Is it free of logged tokens, secrets and full diffs?
|
||||
- Does a real run produce the expected output?
|
||||
- Anything surprising? Ask the agent to explain it.
|
||||
|
||||
## Explanations
|
||||
|
||||
The agent explains Python constructs only where they differ from Java/TypeScript, and does so by mapping them to their Java/TypeScript counterparts (e.g. asyncio vs. promises, Pydantic vs. Zod, pytest fixtures vs. JUnit setup).
|
||||
|
||||
## Autonomy phases
|
||||
|
||||
Autonomy goes up only once the checks have shown they catch the agent's mistakes.
|
||||
|
||||
| Phase | How work runs | Move on when |
|
||||
|---|---|---|
|
||||
| **1. Interactive** | One session at a time, human approves plan and every commit | CI runs on every PR, at least 3 tickets were done this way, and the dev log shows checks catching real mistakes |
|
||||
| **2. Parallel** | Two sessions in separate git worktrees on independent tickets; agent review before human review | Two parallel tickets merged without conflicts or regressions |
|
||||
| **3. Headless** | `claude -p` takes a ticket, works on a branch until the checks pass and opens a PR; human reviews and merges | (open) |
|
||||
|
||||
The same permissions apply in every phase: nothing is pushed to `main`, and real runs only go against the sandbox repo.
|
||||
|
||||
## Metrics
|
||||
|
||||
Recorded in the [dev log](devlog.md) for each ticket: time, cost, agent mistakes and what caught them (test, types, lint, agent review, human review, real run), number of rework rounds, and one thing learned.
|
||||
@@ -0,0 +1,224 @@
|
||||
# Deverenz architecture
|
||||
|
||||
Detailed design reference. CLAUDE.md has the short version; read this when working on the matching module.
|
||||
|
||||
## Workflow
|
||||
|
||||
Deverenz covers a PR's life in three stages:
|
||||
|
||||
1. **Open** — the developer runs `deverenz pr create`. The LLM writes the PR title and description from the local diff and the linked issue, and the PR is opened through the Gitea API. No Gitea UI needed.
|
||||
2. **Update** — on every push to the PR, the server regenerates the Deverenz part of the PR description so it matches the latest diff.
|
||||
3. **Merge** — the server posts a delivery summary with a machine-readable record on the ticket (including deviations from the requirements) and links it from the PR. Clean deliveries are closed and moved to Done; otherwise the ticket stays open for a PO decision.
|
||||
|
||||
Why, and where this is heading: `vision.md`.
|
||||
|
||||
```
|
||||
Developer machine External services
|
||||
----------------- -----------------
|
||||
deverenz pr create -- diff + issue --> LLM (any OpenAI-compatible API)
|
||||
(developer's token) <-- PrDraft ----
|
||||
-- POST /pulls --> Gitea / Forgejo
|
||||
|
||||
Gitea --webhook--> Deverenz container (the only thing we ship, bot token)
|
||||
1. verify signature, filter event, respond 200 immediately
|
||||
2. background job (one at a time per PR)
|
||||
3. fetch PR, diff, linked issues via Gitea API
|
||||
4. filter diff (drop lockfiles, generated files, huge files)
|
||||
5. LLM call -> JSON -> validate (PrDraft or DeliverySummary)
|
||||
6. synchronized: rewrite marked block in PR body
|
||||
merged: ticket comment + record, PR link comment, Done gate
|
||||
```
|
||||
|
||||
Deverenz ships as a single container plus a CLI from the same package. The git host and the LLM are always external services reached over HTTP and configured through env vars. We never bundle or run Gitea, Ollama or any model ourselves.
|
||||
|
||||
Nothing runs inside the git host except a bot user (with an access token) and a webhook pointing to Deverenz.
|
||||
|
||||
## Stage 1: `deverenz pr create`
|
||||
|
||||
1. Read the current branch. Take the issue number from the branch name (`feature/12-comment-upsert` → `#12`, see `docs/conventions.md`). `--issue 12` overrides. No issue is allowed: the requirement check is skipped and a "No linked ticket" warning is added.
|
||||
2. Diff locally with `git diff <base>...HEAD` and run it through `diff_filter`.
|
||||
3. Fetch the issue (title and body are the requirements).
|
||||
4. LLM → `PrDraft`.
|
||||
5. Print a preview and ask for confirmation (`--yes` skips it, `--dry-run` stops here).
|
||||
6. Push the branch if the remote doesn't have it, then `POST /pulls` with title, body, `base`, `head` and the optional `--reviewer` / `--label` values.
|
||||
|
||||
The PR body ends with `Refs #12`, not `Closes #12`. A closing keyword would make Gitea close the issue on every merge, even when the Done gate says it needs a PO decision. Deverenz closes the issue itself when the delivery is clean (see "Done gate").
|
||||
|
||||
## Stage 2: PR updated (`synchronized`)
|
||||
|
||||
Regenerate the `PrDraft` from the latest diff and replace only the text between the body markers (see "Marked content"). Title and anything the developer wrote outside the markers stay unchanged. On `opened`, do the same only if the body has no Deverenz block yet (for PRs opened in the UI).
|
||||
|
||||
## Stage 3: PR merged
|
||||
|
||||
1. Fetch PR, final diff and linked issues.
|
||||
2. LLM → `DeliverySummary`.
|
||||
3. Run the checks and decide the Done gate (below).
|
||||
4. Upsert a marked comment with the record block on each linked issue.
|
||||
5. Upsert a short marked comment on the PR: "Delivery summary posted on #12".
|
||||
6. Apply the Done gate.
|
||||
|
||||
### Done gate
|
||||
|
||||
Work flows freely, Done has to be earned.
|
||||
|
||||
- **Clean** = a linked ticket, `ticket_quality.level == "clear"`, and no requirement has status `deviates` or `missing`.
|
||||
- **Clean:** close the issue and move it to the column named `DONE_COLUMN` on every project board it belongs to. If no such column exists, log a warning and skip the move.
|
||||
- **Not clean:** leave the issue open and where it is. If a requirement deviates or is missing, add `DEVIATION_LABEL` (create the label if the repo doesn't have it). The ticket comment ends with the reason (deviation, vague ticket, …) and: "Not moved to Done: PO decision needed. Close and move to Done to accept, or open a follow-up ticket."
|
||||
- Human acceptance is just closing and moving the ticket; Gitea's timeline records who did it and when. No extra mechanics in the MVP.
|
||||
- The record's `done_gate` field is `"auto"` or `"needs_decision"`.
|
||||
|
||||
## Checks during work (warn, never block)
|
||||
|
||||
- **No linked ticket:** neither the branch name nor `--issue` gives an issue number.
|
||||
- **Vague ticket:** the issue body is empty or very short (deterministic check, forces `missing`), or the LLM rates it `vague` in the same call (no extra call). The LLM names the concrete gaps, e.g. "no acceptance criteria", "'fast' is not measurable", "unclear which user role".
|
||||
|
||||
Ticket quality is shown wherever the content appears: in the PR body, the ticket comment and the record. Anyone reading the ticket, or an LLM asked about it later, can see how much the requirement check can be trusted. A `vague` rating also lowers the confidence of the requirement check: those items are reported as "unclear" rather than "implemented".
|
||||
|
||||
Warnings are shown in the `pr create` preview, written into the PR body block (`⚠ No linked ticket`, `⚠ Ticket has no clear acceptance criteria`), and stored in the merge record's `warnings`. They never stop a PR from being created or updated.
|
||||
|
||||
### Ticket rules
|
||||
|
||||
- **Never edit the issue description.** It is the original requirement, owned by the author/PO. Discrepancies go in the Deverenz comment and the label; the PO decides whether to update the ticket or open a follow-up.
|
||||
- The board move API takes the **global issue id** (`issue.id` from the API), not the repo-local `#12`.
|
||||
|
||||
## Models
|
||||
|
||||
```python
|
||||
class PrDraft(BaseModel): # reviewer-facing
|
||||
title: str # Conventional Commits style, e.g. "feat(webhook): ..."
|
||||
summary: str # 2-3 sentences: what and why
|
||||
changes: list[str]
|
||||
how_to_test: list[str]
|
||||
requirement_check: list[str] # only deviating, missing or unclear items; empty if all met
|
||||
ticket_quality: TicketQuality
|
||||
warnings: list[str] # filled by code (checks.py); not part of the schema sent to the LLM
|
||||
|
||||
class TicketQuality(BaseModel):
|
||||
level: Literal["clear", "vague", "missing"]
|
||||
gaps: list[str] # what is unclear, e.g. "no acceptance criteria"
|
||||
|
||||
class RequirementItem(BaseModel):
|
||||
requirement: str
|
||||
status: Literal["implemented", "deviates", "missing", "unclear"]
|
||||
note: str
|
||||
|
||||
class DeliverySummary(BaseModel): # PM-facing, posted on the ticket
|
||||
user_impact: str # what changes for end users, plain language
|
||||
delivered: list[str]
|
||||
requirements: list[RequirementItem]
|
||||
risks: list[str]
|
||||
open_points: list[str]
|
||||
ticket_quality: TicketQuality
|
||||
```
|
||||
|
||||
Ask the LLM for JSON matching the schema and validate with `model_validate_json`. On failure, retry once with the validation error in the prompt. This must work with small models too, so don't rely on provider-specific structured-output features.
|
||||
|
||||
**Length:** comfortable for a reviewer: about 150–300 words when rendered, bullets over prose, at most about 5 bullets per section. `--short` / `--detailed` come later.
|
||||
|
||||
## Marked content
|
||||
|
||||
- **PR body:** the generated part sits between `<!-- deverenz:start -->` and `<!-- deverenz:end -->`. Only that block is ever rewritten.
|
||||
- **Comments:** every Deverenz comment starts with `<!-- deverenz -->`. Before posting, list comments, find the one with the marker authored by the bot user, and edit it. Create a new one only if none exists.
|
||||
- **Visible label:** every generated block and comment ends with a short line like "_Generated by Deverenz from the diff and #12. Check before relying on it._" Generated content never passes as human-written.
|
||||
|
||||
### Record block
|
||||
|
||||
Each ticket merge comment ends with a hidden, machine-readable record so the project history can be queried by any LLM or script:
|
||||
|
||||
```
|
||||
<!-- deverenz:record v1
|
||||
{"issue": 12, "pr": 34, "merged_at": "2026-11-20T14:03:00Z",
|
||||
"model": "<LLM_MODEL>", "done_gate": "needs_decision", "warnings": [],
|
||||
"summary": { ...DeliverySummary.model_dump() ... }}
|
||||
-->
|
||||
```
|
||||
|
||||
Bump the version on breaking changes and keep a reader for older versions. The Markdown above the block is for people; the block is the stable contract.
|
||||
|
||||
## Components
|
||||
|
||||
| Module | Responsibility |
|
||||
|---|---|
|
||||
| `config.py` | `Settings` class (pydantic-settings), fails fast on missing env vars |
|
||||
| `main.py` | FastAPI app, `POST /webhook/gitea`, `GET /health` |
|
||||
| `webhook.py` | HMAC signature verification, event/action filtering |
|
||||
| `gitea.py` | Async Gitea client with only the endpoints we need |
|
||||
| `board.py` | Find the issue's projects, resolve the Done column, move the issue |
|
||||
| `git_local.py` | Current branch, issue number from branch name, local diff, push |
|
||||
| `checks.py` | Ticket checks (no ticket, vague ticket) and the Done gate decision. Pure functions, no I/O |
|
||||
| `diff_filter.py` | Split unified diff into files, drop noise, truncate to a size limit |
|
||||
| `summarize.py` | Prompts, LLM call, JSON validation with one retry |
|
||||
| `render.py` | `PrDraft` / `DeliverySummary` → Markdown with markers |
|
||||
| `cli.py` | `deverenz pr create`, `deverenz merged owner/repo <pr>`, `deverenz register owner/repo` |
|
||||
|
||||
Keep the Gitea client behind a small `Forge` protocol so a GitLab adapter can be added later. Do not build a larger plugin framework yet.
|
||||
|
||||
## Configuration (env vars)
|
||||
|
||||
| Variable | Purpose |
|
||||
|---|---|
|
||||
| `GITEA_URL` | Base URL of the external Gitea/Forgejo instance |
|
||||
| `GITEA_TOKEN` | Server: bot user token. CLI: the developer's own token, so they are the PR author |
|
||||
| `WEBHOOK_SECRET` | Shared secret for signature verification (server only) |
|
||||
| `LLM_BASE_URL` | OpenAI-compatible endpoint (default `https://api.openai.com/v1`; any compatible provider or self-hosted server works) |
|
||||
| `LLM_API_KEY` | API key for that endpoint, supplied by the operator or developer |
|
||||
| `LLM_MODEL` | Model name |
|
||||
| `LANGUAGE` | Output language (default `en`) |
|
||||
| `DONE_COLUMN` | Project board column for clean merged tickets (default `Done`) |
|
||||
| `DEVIATION_LABEL` | Label added when a requirement deviates or is missing (default `scope-deviation`) |
|
||||
|
||||
The CLI reads the same variables from the environment or `~/.config/deverenz/.env`.
|
||||
|
||||
## Gitea API endpoints used
|
||||
|
||||
Verified on the dev instance (API 28.3.0). Re-check details against `/api/swagger` of the running instance.
|
||||
|
||||
PRs and comments:
|
||||
- `POST /repos/{owner}/{repo}/pulls` (title, body, head, base, labels, reviewers, …)
|
||||
- `GET /repos/{owner}/{repo}/pulls/{index}`
|
||||
- `PATCH /repos/{owner}/{repo}/pulls/{index}` (rewrite body block)
|
||||
- `GET /repos/{owner}/{repo}/pulls/{index}.diff`
|
||||
- `GET /repos/{owner}/{repo}/issues/{index}`
|
||||
- `PATCH /repos/{owner}/{repo}/issues/{index}` with `{"state": "closed"}` (Done gate, clean only)
|
||||
- `GET /repos/{owner}/{repo}/issues/{index}/comments`
|
||||
- `POST /repos/{owner}/{repo}/issues/{index}/comments`
|
||||
- `PATCH /repos/{owner}/{repo}/issues/comments/{id}`
|
||||
|
||||
Labels:
|
||||
- `GET /repos/{owner}/{repo}/labels`, `POST /repos/{owner}/{repo}/labels`
|
||||
- `POST /repos/{owner}/{repo}/issues/{index}/labels`
|
||||
|
||||
Project boards:
|
||||
- `GET /repos/{owner}/{repo}/projects` (also `/orgs/{org}/projects` for org boards)
|
||||
- `GET /repos/{owner}/{repo}/projects/{id}/columns`
|
||||
- `GET /repos/{owner}/{repo}/projects/{id}/columns/{column_id}/issues`
|
||||
- `POST /repos/{owner}/{repo}/projects/{id}/issues/{issue_id}/move` with `{"column_id": …}` (global issue id)
|
||||
|
||||
Setup:
|
||||
- `POST /repos/{owner}/{repo}/hooks` (for `deverenz register`)
|
||||
|
||||
PRs are issues in Gitea, so PR comments go through the issues endpoints.
|
||||
|
||||
## Webhook handling
|
||||
|
||||
- Event header: `X-Gitea-Event: pull_request`
|
||||
- Signature header: `X-Gitea-Signature` = hex HMAC-SHA256 of the **raw request body** with `WEBHOOK_SECRET`. Read the raw body before parsing JSON. Compare with `hmac.compare_digest`.
|
||||
- Relevant actions: `opened` (only without a Deverenz block), `synchronized`, and `closed` with `pull_request.merged == true`. Ignore the rest. Confirm action names against real payloads.
|
||||
- Respond 200 immediately, process in the background (FastAPI `BackgroundTasks` for the MVP).
|
||||
- Use an `asyncio.Lock` per PR so rapid pushes don't trigger parallel LLM calls. Jobs lost on restart are acceptable for the MVP.
|
||||
|
||||
## Deployment and local development
|
||||
|
||||
- One Python package, two entry points: the CLI (installed on developer machines with `uv tool install`) and the server (the Docker image).
|
||||
- The Docker image contains only Deverenz. `docker-compose.yml` defines just the `deverenz` service, reads `.env` and exposes the webhook port.
|
||||
- Gitea (or another git host) and the LLM provider are external. Point `GITEA_URL` and `LLM_BASE_URL` at them.
|
||||
- For development, use a test repo on an existing Gitea instance and the CLI's `--dry-run` flags.
|
||||
|
||||
Gotcha: Gitea blocks webhooks to private/internal addresses by default. If Deverenz runs on a private network, the Gitea admin must add its host to `[webhook] ALLOWED_HOST_LIST` in Gitea's config, otherwise no events arrive.
|
||||
|
||||
## Licensing
|
||||
|
||||
- Core is **Apache-2.0**.
|
||||
- External contributions require a **CLA** so the project can offer commercial licenses later.
|
||||
- Future commercial features go into a separate `ee/` directory under a proprietary license (open-core model).
|
||||
- "Deverenz" is intended to be protected as a trademark; forks may use the code but not the name.
|
||||
@@ -0,0 +1,62 @@
|
||||
# Git Conventions
|
||||
|
||||
## Branch Naming
|
||||
|
||||
```
|
||||
<type>/<short-kebab-case-description>
|
||||
```
|
||||
|
||||
- All lowercase, hyphens only — no camelCase or Title-Case
|
||||
- Keep the description short (3–5 words); the branch name is not the place for detail
|
||||
- If the branch belongs to an issue, include its number right after the type: `feature/12-comment-upsert`. Deverenz reads the ticket from this number.
|
||||
|
||||
| Type | Use for |
|
||||
|---|---|
|
||||
| `feature/` | New functionality |
|
||||
| `fix/` | Bug fixes |
|
||||
| `refactor/` | Code changes with no behavior change |
|
||||
| `chore/` | Tooling, deps, config, cleanup |
|
||||
| `docs/` | Documentation only |
|
||||
|
||||
**Example:** `feature/webhook-server`
|
||||
|
||||
---
|
||||
|
||||
## Commit Messages
|
||||
|
||||
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
||||
|
||||
```
|
||||
<type>(<scope>): <imperative, present-tense summary>
|
||||
|
||||
<optional body — explain WHY, not WHAT>
|
||||
```
|
||||
|
||||
- **Type** — `feat`, `fix`, `refactor`, `chore`, `docs`, `test`, `style` (`feat` is the commit type for `feature/` branches)
|
||||
- **Scope** — the module touched (e.g. `webhook`, `gitea`, `diff`, `summarize`, `render`, `cli`, `config`, `docker`). Leave it out for changes across the whole repo.
|
||||
- **Summary** — imperative mood ("add", not "added" or "adds"); no period at the end
|
||||
- **Body** — only when the reasoning isn't obvious from the diff (a constraint, a bug workaround, a decision). Skip it for simple/self-explanatory changes.
|
||||
- No AI attribution lines (`Co-Authored-By`, "Generated with …").
|
||||
|
||||
**Examples:**
|
||||
```
|
||||
feat(summarize): retry once with validation error on invalid JSON
|
||||
fix(webhook): verify signature against raw body before parsing
|
||||
style: reformat
|
||||
refactor(gitea): move comment lookup behind Forge protocol
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Ticket Titles
|
||||
|
||||
Frame as the outcome, not a task log:
|
||||
|
||||
```
|
||||
<Type>: <what changes for the user/system>
|
||||
```
|
||||
|
||||
**Examples:**
|
||||
- `Feature: Post PR summary as a single updatable comment`
|
||||
- `Bug: Webhook ignored when PR is reopened`
|
||||
- `Chore: Drop lockfiles from diff before LLM call`
|
||||
@@ -0,0 +1,18 @@
|
||||
# Dev Log
|
||||
|
||||
One entry per finished roadmap step, newest first. The agent drafts the entry, the developer corrects it. Rules for the workflow are in [agentic-workflow.md](agentic-workflow.md).
|
||||
|
||||
<!--
|
||||
## YYYY-MM-DD · Step N: <title>
|
||||
|
||||
- **Issue / PR:** #
|
||||
- **Phase:** 1
|
||||
- **Time:** ~h
|
||||
- **Cost:** (from /cost or /usage)
|
||||
- **Rework rounds:** 0
|
||||
- **Agent mistakes and what caught them:**
|
||||
- <mistake> → caught by <test | types | lint | agent review | human review | real run | nothing (found later)>
|
||||
- **What worked well:**
|
||||
- **Learned:**
|
||||
- **Workflow change proposed:** none
|
||||
-->
|
||||
@@ -0,0 +1,34 @@
|
||||
# Roadmap
|
||||
|
||||
Milestone overview. Each step becomes one or more Gitea issues; link them here once they exist. Status lives on the project board only (see [agentic-workflow.md](agentic-workflow.md)), so this file has no checkboxes.
|
||||
|
||||
## Setup
|
||||
|
||||
- **0. Project skeleton and CI:** `pyproject.toml` with uv, ruff (rule sets `E`, `F`, `I`, `B`, `UP`, `ASYNC`) and pyright in strict mode; empty `src/deverenz/` and `tests/` layout. A Gitea Actions workflow runs ruff, pyright and pytest on every PR. First check on the dev Gitea that Actions is enabled and a runner is available.
|
||||
|
||||
## MVP
|
||||
|
||||
- **1. PR draft prompt (most important):** `deverenz pr create --dry-run` reads the local diff and the linked issue and prints the generated title and description. Iterate on the prompt until reviewers find it genuinely useful. Everything else depends on this.
|
||||
- Judge the prompt mainly on the requirement check: the deliberate-deviation case must be caught, and nothing may be falsely reported as implemented.
|
||||
- Include the ticket checks: "no linked ticket" warning and the ticket quality rating with concrete gaps.
|
||||
- Keep 3–5 realistic cases in `tests/prompt_cases/<name>/` (`diff.patch` + `issue.md`), including one with a deliberate deviation from the issue.
|
||||
- `--case <dir>` runs a stored case instead of the local repo; render all cases into gitignored `out/` to compare prompt versions side by side.
|
||||
- Once that works, add a project skill `/try-prompt` that runs all cases.
|
||||
- **2. Open PRs from the CLI:** `deverenz pr create` pushes the branch and opens the PR via the Gitea API.
|
||||
- **3. Merge report from the CLI:** `deverenz merged owner/repo <pr>` posts the delivery summary with the record block on the ticket, links it from the PR, and applies the Done gate (close + move to Done only when clean, otherwise leave open for a PO decision). Has `--dry-run`.
|
||||
- **4. Webhook server:** FastAPI route and signature check. `synchronized` refreshes the PR body block; merge runs step 3's pipeline.
|
||||
- **5. Packaging:** Dockerfile, `docker-compose.yml` (deverenz service only), `deverenz register owner/repo` to create the webhook via the API.
|
||||
- **6. Tests:** replay stored payloads with pytest + respx.
|
||||
|
||||
## Developer tooling (later)
|
||||
|
||||
- Claude Code status line: show model, context usage, current branch and the open roadmap step at the bottom of each session (set up via `/statusline`)
|
||||
|
||||
## Later
|
||||
|
||||
- `--short` / `--detailed` output length flags
|
||||
- Extra board columns (e.g. "Test todo" / "Test done")
|
||||
- Let the LLM pick PR labels from the repo's existing labels
|
||||
- Forgejo verification
|
||||
|
||||
Bigger ideas (other forges, Jira, sprint reports, Definition of Ready, the customizing assistant) live in `vision.md`.
|
||||
@@ -0,0 +1,61 @@
|
||||
# Deverenz vision
|
||||
|
||||
Why the product exists and where it is heading. For implementation detail see `architecture.md`; for what's being built now see `roadmap.md`.
|
||||
|
||||
## Problem
|
||||
|
||||
Project management can be bad or missing entirely, because doing it well is expensive: it takes time, skill and people that a team doesn't always have, even in large companies. Git platforms already offer the building blocks (webhooks, boards, labels, milestones, APIs), but someone has to assemble them into a working process.
|
||||
|
||||
Agile and Scrum make this worse in one specific way. Valuing conversation over documentation is right, but in practice it often turns into laissez-faire:
|
||||
- tickets aren't kept up to date
|
||||
- decisions are made face to face and never written down
|
||||
- developers, project managers and product owners lose track of targets and objectives
|
||||
- the company or client gets inconsistent, ad-hoc updates
|
||||
|
||||
## Positioning
|
||||
|
||||
Deverenz is a **suite of project management measures with opinionated defaults**. It works out of the box: install it, point it at a repo, and a sensible, consistent process happens without anyone designing it.
|
||||
|
||||
- **Self-hosted, bring your own LLM.** Any OpenAI-compatible endpoint; code never has to leave the company.
|
||||
- **Platform-independent, built step by step.** The MVP is proven on Gitea and Forgejo first; GitLab is the next platform, others follow.
|
||||
|
||||
## Agile stance
|
||||
|
||||
Deverenz strengthens Scrum's three pillars and patches its typical weaknesses:
|
||||
|
||||
| Pillar | How Deverenz supports it |
|
||||
|---|---|
|
||||
| Transparency | Every delivery leaves a standardized record on the ticket, written automatically |
|
||||
| Inspection | Each PR is checked against the ticket's requirements (implemented, deviates, missing, unclear), and the ticket's own quality is rated |
|
||||
| Adaptation | Deviations require a visible decision (accept or follow-up ticket) instead of a hallway agreement |
|
||||
|
||||
The result is the lightweight documentation agile tends to skip, without anyone having to write it.
|
||||
|
||||
## Standardized records
|
||||
|
||||
Every merged delivery leaves a structured, versioned record on its ticket: Markdown for people, plus a hidden JSON block for machines. Over time this becomes a queryable project history. Anyone can point their own LLM at it (for example through the git platform's MCP server) and ask "what shipped this sprint, and where did we deviate?". Deverenz is the **writer** of this history; MCP servers and scripts are the **readers**.
|
||||
|
||||
## Principles
|
||||
|
||||
- **Work flows freely, Done has to be earned.** Warn during work, never block it. Only clean deliveries move to Done automatically; everything else needs a visible human decision.
|
||||
- **Generated content is clearly marked** and never pretends to be human-written.
|
||||
- **Never rewrite human-authored requirements.** Ticket descriptions belong to their authors.
|
||||
- **Cheap and predictable.** One LLM call per event.
|
||||
- **One measure finished end to end before the next.**
|
||||
|
||||
## Future
|
||||
|
||||
- An assistant that customizes Deverenz per team on the fly: strictness, output length, columns, language
|
||||
- Ticket quality check on the ticket itself (Definition of Ready): when a ticket is created or moved to "In progress", Deverenz comments with the concrete gaps (missing acceptance criteria, unmeasurable terms, unclear scope) so they're fixed before work starts, not discovered at merge. The MVP only rates ticket quality at PR and merge time.
|
||||
- Sprint review report built from the records of a milestone (milestone = sprint), for the company or client
|
||||
- `/accept` comment command as an explicit PO acceptance of deviations
|
||||
- More measures: stale ticket detection, release notes, test columns
|
||||
- Configurable strictness per team (e.g. block PR creation without a ticket)
|
||||
- Other forges (GitLab, GitHub, Bitbucket), Jira integration, an admin UI
|
||||
|
||||
## Risks
|
||||
|
||||
- **Garbage in, garbage out.** Vague tickets give vague checks. Deverenz can't fix bad input, but it makes it visible: every report and record states the ticket's quality and its gaps, and requirements it can't judge are marked "unclear" rather than guessed. That keeps answers about a ticket honest, whether a person reads it or an LLM is asked about it later.
|
||||
- **Trust.** A wrong "all requirements implemented" does more damage than no report. Accuracy over coverage.
|
||||
- **Scope creep.** A suite of half-finished measures is worth less than one that works.
|
||||
- **Big platforms.** Atlassian, GitHub and GitLab are moving into AI project insight. The defensible space is self-hosted, cross-forge and process-opinionated.
|
||||
Reference in new issue
Block a user