chore: add project docs and agent workflow setup

This commit is contained in:
kasun committed 2026-11-15 14:36:06 +01:00
1 parent b647343c99
commit 95e1b9cb89
15 files changed
+894 -1

No files matched your search

+91
View File
@@ -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.