Run Vale over every tracked Go, Markdown and template file and fix the remaining findings: long sentences, repetition, UI verbs, identifiers that should be backticked, and migration narration in comments. AGENTS.md and CLAUDE.md keep their absolute rules; the prompt heuristic against repeated absolutes is disabled for rule files.
70 lines
3.7 KiB
Markdown
70 lines
3.7 KiB
Markdown
# Self-development loop: archie develops its own codebase
|
||
|
||
**Status:** Decided, not yet built (2026-11-03, sam) **Scope:** how archie
|
||
keeps developing archie-core itself. This file records a
|
||
desired state, not an implementation or a product. Nothing below exists unless
|
||
the "Built today" section says so. The plan is tracked as epic #1769 with child
|
||
issues #1770–#1775. This file is a record, not a mechanism: agents only see what
|
||
is in their context, so verify every claim here against the code before acting
|
||
on it. Where they disagree, the code wins. The boundary below is load-bearing
|
||
only where it is enforced (the gate, access control, the daemon's git monopoly)
|
||
and stated in `AGENTS.md`. Everywhere else this file is a pointer.
|
||
|
||
## Built today
|
||
|
||
The machinery the loop will reuse exists. It includes the shipped
|
||
triage/implement/pr-review workflows and the adversarial self-review stage before
|
||
a PR opens (epic #1348, closed). It also includes the prbench judge for review
|
||
quality with its acceptance bar, canary releases judged on the installed release
|
||
(releaseupdate), and the curator engine. What does not exist is the loop itself:
|
||
no self-intake curator, no automatic run for approved issues, no judge for
|
||
diffs, no outcome distillation, no canary routing specific to self-directed
|
||
changes.
|
||
|
||
## Decision
|
||
|
||
Archie improves its own codebase through a closed loop, built in stages:
|
||
|
||
1. **Self-intake** (#1770): a curator pass reads run outcomes, step transcripts,
|
||
gate failures and alerts, dedupes against open issues, and files new issues.
|
||
Archie files its own work; the maintainer approves priority.
|
||
2. **Approved-issue loop** (#1771): an approved issue runs the shipped
|
||
triage/implement workflows end to end. The workflow makes a read-only plan
|
||
and a gated build, then runs the adversarial self-review; the daemon commits
|
||
and opens a green PR. The maintainer still merges at this stage.
|
||
3. **Implementation judge** (#1772): the prbench judge pattern scores diffs,
|
||
calibrated against the maintainer's merge decisions. Automatic merge applies
|
||
only when the gate is green, the review stage is clean, and the judge is above
|
||
the calibrated bar.
|
||
4. **Outcome distillation** (#1773): a curator turns merged-run postmortems into
|
||
proposals for the repo's agent instructions. Each proposal is added only
|
||
because it changes a decision, and rules that stop changing decisions are
|
||
removed.
|
||
5. **Canary** (#1774): self-directed changes ship through the canary release
|
||
window and are judged on the installed release before promotion. Rollback is
|
||
a plain revert, because every self-directed change is one gated commit.
|
||
|
||
## Boundary
|
||
|
||
Enforcement lives in the code, never in the prompt (#1775). Archie may propose
|
||
changes to the commit gate, the invariants in `AGENTS.md`, access control and
|
||
grant scoping, the daemon-only git path, and webhook HMAC verification. It never
|
||
merges them; those changes require a maintainer merge. Everything else
|
||
(workflows, curators, memory, docs, the dashboard) is fair game for the loop.
|
||
|
||
## Why
|
||
|
||
Self-improvement degrades when it relies on the model choosing to follow rules.
|
||
Gates, scoped grants and the daemon's monopoly on git cannot be argued with. A
|
||
prompt can. Keeping quality measurable is what lets the loop widen without
|
||
turning the codebase to garbage: a judge bar and a canary verdict as numbers,
|
||
and tests guarding the protected seams.
|
||
|
||
## Consequences
|
||
|
||
- One issue to one small PR applies doubly to self-directed work. Past about 100
|
||
lines or any new mechanism, the change stops and reassesses.
|
||
- Every self-directed commit cites the issue that authorised it.
|
||
- Rule proposals from the distillation curator must name the run that triggered
|
||
them, and `AGENTS.md` stays short enough to read in full every session.
|