Refresh agent instruction files

This commit is contained in:
2026-05-18 16:55:53 +02:00
parent 61fa33fc39
commit fd7f25866a
10 changed files with 299 additions and 180 deletions

172
AGENTS.md
View File

@@ -2,46 +2,44 @@
## Repo Identity
**Purpose:** Repository Scoping — turns Git repositories into reviewable,
source-linked maps of `Ability → Capability → Feature → Evidence`. Deterministic
scanners establish observed facts; LLM-assisted extractors propose interpreted
claims; humans or trusted agents approve registry truth.
**Purpose:** repo-scoping - (fill in purpose)
**Domain:** capabilities
**Repo slug:** repo-scoping
**Topic ID:** `64418556-3206-457a-ba29-6884b5b12cf3`
**Workplan prefix:** `RREG-WP-`
**Domain:** capabilities
**Repo slug:** repo-scoping
**Topic ID:** `64418556-3206-457a-ba29-6884b5b12cf3`
**Workplan prefix:** `REPO-WP-`
---
## State Hub Integration
The Custodian State Hub tracks work across all domains. It runs at
`http://127.0.0.1:8000` (local) or `http://127.0.0.1:18000` when accessed from
a remote machine via tunnel.
The Custodian State Hub tracks work across all domains. Interact via HTTP REST —
there is no MCP server for Codex agents.
Interact via HTTP — there is no MCP integration for Codex agents.
| Context | URL |
|---------|-----|
| Local workstation | `http://127.0.0.1:8000` |
| Remote via tunnel | `http://127.0.0.1:18000` |
### Orient at session start
```bash
# Domain workstreams
# Offline brief — works without hub connection
cat .custodian-brief.md
# Active workstreams for this domain
curl -s "http://127.0.0.1:8000/workstreams/?topic_id=64418556-3206-457a-ba29-6884b5b12cf3&status=active" \
| python3 -m json.tool
# Open tasks for this repo (once workstreams are registered)
curl -s "http://127.0.0.1:8000/tasks/?status=todo" | python3 -m json.tool
# Check inbox
curl -s "http://127.0.0.1:8000/messages/?to_agent=repo-scoping&unread_only=true" \
| python3 -m json.tool
```
Also read `workplans/` directly — the files are the source of truth:
Mark a message read:
```bash
ls workplans/
grep -h "^status:" workplans/RREG-WP-*.md
curl -s -X PATCH "http://127.0.0.1:8000/messages/<id>/read" \
-H "Content-Type: application/json" -d '{}'
```
### Log progress (required at session close)
@@ -50,27 +48,31 @@ grep -h "^status:" workplans/RREG-WP-*.md
curl -s -X POST http://127.0.0.1:8000/progress/ \
-H "Content-Type: application/json" \
-d '{
"summary": "describe what was done",
"summary": "what was done",
"event_type": "note",
"author": "codex"
"author": "codex",
"workstream_id": "<uuid>",
"task_id": "<uuid>"
}'
```
Include `"workstream_id": "<uuid>"` and `"task_id": "<uuid>"` when known.
Omit `workstream_id` / `task_id` when not applicable.
### Mark a message read
```bash
curl -s -X PATCH "http://127.0.0.1:8000/messages/<message_id>/read" \
-H "Content-Type: application/json" -d '{}'
```
### Update task status (after workstreams are synced)
### Update task status
```bash
curl -s -X PATCH "http://127.0.0.1:8000/tasks/<task_id>" \
-H "Content-Type: application/json" \
-d '{"status": "in_progress"}'
# values: todo | in_progress | done | blocked
```
### Flag a task for human review
```bash
curl -s -X PATCH "http://127.0.0.1:8000/tasks/<task_id>" \
-H "Content-Type: application/json" \
-d '{"needs_human": true, "intervention_note": "reason"}'
```
---
@@ -78,99 +80,83 @@ curl -s -X PATCH "http://127.0.0.1:8000/tasks/<task_id>" \
## Session Protocol
**Start:**
1. `ls workplans/` — note active workplans and their open tasks
2. Check inbox via `GET /messages/?to_agent=repo-scoping&unread_only=true`
3. Check for human-flagged tasks: `GET /tasks/?needs_human=true`
1. `cat .custodian-brief.md` — domain goal and open workstreams (offline-safe)
2. Check inbox: `GET /messages/?to_agent=repo-scoping&unread_only=true`; mark read
3. Scan workplans: `ls workplans/` — note `status: ready`, `active`, or `blocked` files and open tasks
4. Check blocked tasks: `GET /tasks/?needs_human=true`
**During work:**
- Update task status in the workplan file as tasks progress
- For significant decisions, record them: `POST /decisions/`
- Update task statuses in workplan files as tasks progress
- Record significant decisions via `POST /decisions/`
**Close:**
1. Update task statuses in workplan files to match progress
2. Call `POST /progress/` with a summary of what was done
3. If workplan files changed, sync them to the hub DB:
```bash
curl -s -X POST "http://127.0.0.1:8000/repos/repo-scoping/sync" | python3 -m json.tool
```
This runs the ADR-001 consistency check with `--fix` and returns a JSON report.
A `"result": "warn"` with only C-17 is normal (unpushed commits); no action needed.
A `"result": "fail"` means file/DB drift that could not be auto-fixed — read the issues list.
1. Update workplan file task statuses to reflect progress
2. Log: `POST /progress/` with a summary of what changed
3. Note for the custodian operator: after workplan file changes, run from
`~/state-hub`:
```bash
make fix-consistency REPO=repo-scoping
```
This syncs task status from files into the hub DB.
---
## Workplan Convention (ADR-001)
Work items originate as files in this repo, not in the hub. The hub is a
read/cache/index layer.
Work items originate as files in this repo not in the hub. The hub is a
read/cache/index layer that rebuilds from files.
**File location:** `workplans/RREG-WP-NNNN-<slug>.md`
**File location:** `workplans/REPO-WP-NNNN-<slug>.md`
**Archived location:** finished workplans may move to
`workplans/archived/YYMMDD-REPO-WP-NNNN-<slug>.md`. The `YYMMDD` prefix is
the completion/archive date; the frontmatter `id` does not change.
**Ad Hoc Tasks:** small opportunistic fixes discovered during a session use
`workplans/ADHOC-YYYY-MM-DD.md` with task ids `ADHOC-YYYY-MM-DD-T01`, etc. Use
this only for low-risk work completed directly; create a normal workplan for
anything needing analysis, design, approval, dependencies, or multiple phases.
**Frontmatter:**
```yaml
---
id: RREG-WP-NNNN
id: REPO-WP-NNNN
type: workplan
title: "..."
domain: capabilities
repo: repo-scoping
status: active | done
status: proposed | ready | active | blocked | backlog | finished | archived
owner: codex
topic_slug: foerster-capabilities
topic_slug: ...
created: "YYYY-MM-DD"
updated: "YYYY-MM-DD"
state_hub_workstream_id: "<uuid>" # populated by fix-consistency
state_hub_workstream_id: "<uuid>" # written by fix-consistency — do not edit
---
```
**Task blocks** (one per `##` section):
Use `proposed` for a new draft, `ready` after review against current repo
state, and `finished` after implementation. `stalled` and `needs_review` are
derived health labels, not frontmatter statuses.
```markdown
**Task block format** (one per `##` section):
```
## Task Title
\`\`\`task
id: RREG-WP-NNNN-T01
` ` `task
id: REPO-WP-NNNN-T01
status: todo | in_progress | done | blocked
priority: high | medium | low
\`\`\`
state_hub_task_id: "<uuid>" # written by fix-consistency — do not edit
` ` `
Task description.
Task description text.
```
**Status values:** `todo``in_progress``done` (or `blocked`)
Status progression: `todo` → `in_progress` → `done` (or `blocked`)
---
## Stack and Commands
**Runtime:** Python 3.x, FastAPI, SQLite (dev) / PostgreSQL (prod)
**Package manager:** pip / uv
```bash
# Install
pip install -e ".[dev]"
# Run dev server
uvicorn repo_scoping.web_api.app:app --reload
# Run tests
pytest tests/
pytest tests/ -k "e2e"
# Check API health
curl http://127.0.0.1:8001/health
```
---
## Repo Boundary
This repo owns: repository ingestion, deterministic scanning, LLM-assisted candidate
extraction, review/approval workflow, registry query and search.
It does NOT own: the Custodian State Hub, other domain repos, deployment infrastructure.
Coordination with other domains goes through the State Hub message inbox.
To create a new workplan:
1. Write the file following the format above
2. Notify the custodian operator to run `make fix-consistency REPO=repo-scoping`
(or send a message to the hub agent via `POST /messages/`)